Don't register client packets sync

This commit is contained in:
libraryaddict 2019-06-08 14:09:18 +12:00
parent f4294c609b
commit e338a44ed5

View File

@ -35,8 +35,7 @@ public class PacketsManager {
clientInteractEntityListener = new PacketListenerClientInteract(libsDisguises);
PacketListener tabListListener = new PacketListenerTabList(libsDisguises);
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(clientInteractEntityListener)
.syncStart();
ProtocolLibrary.getProtocolManager().addPacketListener(clientInteractEntityListener);
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(tabListListener).syncStart();
// Now I call this and the main listener is registered!
@ -91,10 +90,9 @@ public class PacketsManager {
inventoryModifierEnabled = enabled;
if (inventoryModifierEnabled) {
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(inventoryListener)
.syncStart();
ProtocolLibrary.getProtocolManager().addPacketListener(inventoryListener);
} else {
ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandler(inventoryListener);
ProtocolLibrary.getProtocolManager().addPacketListener(inventoryListener);
}
for (Player player : Bukkit.getOnlinePlayers()) {