99import net .minecraftforge .fml .common .eventhandler .SubscribeEvent ;
1010import net .minecraftforge .fml .common .network .FMLNetworkEvent ;
1111
12- @ Mod (modid = "mmcutils " , name = "MMCUtils " , version = "0.1.4" , clientSideOnly = true , acceptedMinecraftVersions = "1.8.9 " )
12+ @ Mod (modid = "@ID@ " , name = "@NAME@ " , version = "@VER@ " )
1313public class MMCUtils {
1414 private static final Minecraft mc = Minecraft .getMinecraft ();
1515 public static final ImmutableList <String > ALL_PROXY = ImmutableList .of ("AS Practice" , "EU Practice" , "NA Practice" , "SA Practice" );
16- public static boolean inMMC , inPractice , inPartyChat ;
16+ public static final ImmutableList <String > BRIDGING_GAMES = ImmutableList .of ("Bed Fight" , "Fireball Fight" , "Bridges" , "Battle Rush" );
17+ public static boolean inMMC , inPractice , inPartyChat , inBridgingGame ;
1718
1819 @ Mod .EventHandler
1920 public void init (FMLInitializationEvent e ) {
@@ -28,24 +29,32 @@ public void onJoin(FMLNetworkEvent.ClientConnectedToServerEvent e) {
2829
2930 @ SubscribeEvent
3031 public void onQuit (FMLNetworkEvent .ClientDisconnectionFromServerEvent e ) {
31- inMMC = inPractice = inPartyChat = false ;
32+ inMMC = inPractice = inPartyChat = inBridgingGame = false ;
3233 }
3334
3435 @ SubscribeEvent
3536 public void onChat (ClientChatReceivedEvent e ) {
3637 if (!inMMC ) return ;
3738
38- if (!inPractice && "Minemen Club" .equals (e .message .getUnformattedText ()) && Configuration .autoQueue ) {
39+ String clean = e .message .getUnformattedText ();
40+ if (!inPractice && "Minemen Club" .equals (clean ) && Configuration .autoQueue ) {
3941 String [] split = mc .getCurrentServerData ().serverIP .split (".minemen.club" );
4042 String mmcProxy = split [0 ].length () == 2 ? split [0 ] : "na" ;
4143 mc .thePlayer .sendChatMessage ("/joinqueue " + mmcProxy + "-practice" );
4244 inPractice = true ;
4345 }
4446
45- if (!inPartyChat && ALL_PROXY .contains (e . message . getUnformattedText () ) && Configuration .autoPartyChat ) {
47+ if (!inPartyChat && ALL_PROXY .contains (clean ) && Configuration .autoPartyChat ) {
4648 mc .thePlayer .sendChatMessage ("/p chat" );
4749 inPartyChat = true ;
4850 }
51+
52+ if (!inBridgingGame ) {
53+ if (BRIDGING_GAMES .contains (clean ))
54+ inBridgingGame = true ;
55+ } else if (clean .startsWith ("Match Results" )) {
56+ inBridgingGame = false ;
57+ }
4958 }
5059
5160}
0 commit comments