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