mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-05 09:09:40 +01:00
Rollback the packetlistener changes, its broke. I hate paper.
This commit is contained in:
parent
356519be19
commit
912ca85aff
@ -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()) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user