Force sounds/entity effects to sync in an effort ot hopefully fix a rare crash #361

This commit is contained in:
libraryaddict 2019-06-03 21:24:50 +12:00
parent c66e0a88e4
commit 823bf4f7c8

View File

@ -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);
}
}
}