From c6875da6571235eaa9b0eabecbba183e22e09f5a Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 28 Jul 2014 10:38:10 +1200 Subject: [PATCH] Revert "Use async packet listener for sounds packets. Prevents async concurrent modification exception. May be replaced later." This reverts commit 4c85f6c319742d01aed134a0c3664a7bae44c9aa. --- .../libraryaddict/disguise/utilities/PacketsManager.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index f4f31c9a..d3c24db6 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -41,7 +41,6 @@ import org.bukkit.util.Vector; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; -import com.comphenix.protocol.async.AsyncListenerHandler; import com.comphenix.protocol.events.ListenerPriority; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; @@ -55,7 +54,6 @@ import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.comphenix.protocol.wrappers.WrappedWatchableObject; public class PacketsManager { - private static AsyncListenerHandler asyncSoundsListener; /** * This is a fix for the stupidity that is * "I can't separate the sounds from the sounds the player heard, and the sounds of the entity tracker heard" @@ -1064,10 +1062,9 @@ public class PacketsManager { if (soundsListenerEnabled != enabled) { soundsListenerEnabled = enabled; if (soundsListenerEnabled) { - asyncSoundsListener = ProtocolLibrary.getProtocolManager().getAsynchronousManager() - .registerAsyncHandler(soundsListener); + ProtocolLibrary.getProtocolManager().addPacketListener(soundsListener); } else { - ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandler(asyncSoundsListener); + ProtocolLibrary.getProtocolManager().removePacketListener(soundsListener); } } }