From 823bf4f7c8ae7cd584c4be30d0a61d194cc57b41 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 3 Jun 2019 21:24:50 +1200 Subject: [PATCH] Force sounds/entity effects to sync in an effort ot hopefully fix a rare crash #361 --- .../disguise/utilities/packets/PacketsManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java index 9b85b00a..0b4be7c3 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java @@ -77,9 +77,10 @@ public class PacketsManager { soundsListenerEnabled = enabled; if (soundsListenerEnabled) { - ProtocolLibrary.getProtocolManager().addPacketListener(soundsListener); + ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(soundsListener) + .syncStart(); } else { - ProtocolLibrary.getProtocolManager().removePacketListener(soundsListener); + ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandler(soundsListener); } } }