Rollback the packetlistener changes, its broke. I hate paper.

This commit is contained in:
libraryaddict 2020-03-25 23:08:03 +13:00
parent 356519be19
commit 912ca85aff
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
3 changed files with 6 additions and 15 deletions

View File

@ -109,8 +109,7 @@ public class PacketsManager {
public static void setupMainPacketsListener() {
if (clientInteractEntityListener != null) {
if (mainListener != null) {
// ProtocolLibrary.getProtocolManager().removePacketListener(mainListener);
ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandler(mainListener);
ProtocolLibrary.getProtocolManager().removePacketListener(mainListener);
}
ArrayList<PacketType> packetsToListen = new ArrayList<>();
@ -163,9 +162,7 @@ public class PacketsManager {
mainListener = new PacketListenerMain(LibsDisguises.getInstance(), packetsToListen);
// ProtocolLibrary.getProtocolManager().addPacketListener(mainListener);
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(mainListener)
.syncStart(10, TimeUnit.SECONDS);
ProtocolLibrary.getProtocolManager().addPacketListener(mainListener);
}
}
@ -174,13 +171,9 @@ public class PacketsManager {
viewDisguisesListenerEnabled = enabled;
if (viewDisguisesListenerEnabled) {
//ProtocolLibrary.getProtocolManager().addPacketListener(viewDisguisesListener);
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
.registerAsyncHandler(viewDisguisesListener).syncStart(10, TimeUnit.SECONDS);
ProtocolLibrary.getProtocolManager().addPacketListener(viewDisguisesListener);
} else {
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
.unregisterAsyncHandler(viewDisguisesListener);
// ProtocolLibrary.getProtocolManager().removePacketListener(viewDisguisesListener);
ProtocolLibrary.getProtocolManager().removePacketListener(viewDisguisesListener);
}
for (Player player : Bukkit.getOnlinePlayers()) {

View File

@ -29,8 +29,7 @@ public class PacketListenerMain extends PacketAdapter {
final Player observer = event.getPlayer();
if (observer == null || observer.getName() == null ||
observer.getName().contains("UNKNOWN[")) // If the player is temporary
if (observer.getName().contains("UNKNOWN[")) // If the player is temporary
return;
// First get the entity, the one sending this packet

View File

@ -40,8 +40,7 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter {
try {
final Player observer = event.getPlayer();
if (observer == null || observer.getName() == null ||
observer.getName().contains("UNKNOWN[")) {// If the player is temporary
if (observer.getName().contains("UNKNOWN[")) {// If the player is temporary
return;
}