55import com .google .gson .JsonObject ;
66import com .google .gson .JsonSyntaxException ;
77import net .minecraftforge .client .event .ClientChatReceivedEvent ;
8+ import net .minecraftforge .fml .common .eventhandler .EventPriority ;
89import net .minecraftforge .fml .common .eventhandler .SubscribeEvent ;
910
1011import java .util .Date ;
@@ -40,9 +41,7 @@ public LocrawWrapper(LocrawListenerCallback callback) {
4041 this .listening = true ;
4142 this .cancel = true ;
4243
43- // Send the /locraw command
4444 Quickplay .INSTANCE .chatBuffer .push ("/locraw" );
45- System .out .println ("QUICKPLAY DEBUG > Locraw sent! " + new Date ().getTime () + " " + this .hashCode ());
4645 // If a /locraw isn't received within 120 ticks (30 seconds), don't cancel the message
4746 new TickDelay (this ::stopCancelling , 600 );
4847 // If a /locraw isn't received within 1200 ticks (60 seconds), stop listening
@@ -54,7 +53,6 @@ public LocrawWrapper(LocrawListenerCallback callback) {
5453 * in, but still listen & call the callback
5554 */
5655 public void stopCancelling () {
57- System .out .println ("QUICKPLAY DEBUG > Cancelling stopped! " + new Date ().getTime () + " " + this .hashCode ());
5856 this .cancel = false ;
5957 }
6058
@@ -72,7 +70,8 @@ public void stopListening(String instance) {
7270 }
7371 }
7472
75- @ SubscribeEvent (receiveCanceled = true )
73+ // Hytilities forces high priority - receiveCancelled seems to cause the message to be uncancelable...
74+ @ SubscribeEvent (priority = EventPriority .HIGH )
7675 public void onChat (ClientChatReceivedEvent event ) {
7776 final String message = event .message .getUnformattedText ();
7877 // Regex for the /locraw response
@@ -85,7 +84,6 @@ public void onChat(ClientChatReceivedEvent event) {
8584 matcher .find () &&
8685 listening
8786 ) {
88- System .out .println ("QUICKPLAY DEBUG > Locraw received! " + new Date ().getTime () + " " + this .hashCode ());
8987
9088 if (this .cancel ) {
9189 event .setCanceled (true );
0 commit comments