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() {
|
public static void setupMainPacketsListener() {
|
||||||
if (clientInteractEntityListener != null) {
|
if (clientInteractEntityListener != null) {
|
||||||
if (mainListener != null) {
|
if (mainListener != null) {
|
||||||
// ProtocolLibrary.getProtocolManager().removePacketListener(mainListener);
|
ProtocolLibrary.getProtocolManager().removePacketListener(mainListener);
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandler(mainListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<PacketType> packetsToListen = new ArrayList<>();
|
ArrayList<PacketType> packetsToListen = new ArrayList<>();
|
||||||
@ -163,9 +162,7 @@ public class PacketsManager {
|
|||||||
|
|
||||||
mainListener = new PacketListenerMain(LibsDisguises.getInstance(), packetsToListen);
|
mainListener = new PacketListenerMain(LibsDisguises.getInstance(), packetsToListen);
|
||||||
|
|
||||||
// ProtocolLibrary.getProtocolManager().addPacketListener(mainListener);
|
ProtocolLibrary.getProtocolManager().addPacketListener(mainListener);
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(mainListener)
|
|
||||||
.syncStart(10, TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,13 +171,9 @@ public class PacketsManager {
|
|||||||
viewDisguisesListenerEnabled = enabled;
|
viewDisguisesListenerEnabled = enabled;
|
||||||
|
|
||||||
if (viewDisguisesListenerEnabled) {
|
if (viewDisguisesListenerEnabled) {
|
||||||
//ProtocolLibrary.getProtocolManager().addPacketListener(viewDisguisesListener);
|
ProtocolLibrary.getProtocolManager().addPacketListener(viewDisguisesListener);
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
|
|
||||||
.registerAsyncHandler(viewDisguisesListener).syncStart(10, TimeUnit.SECONDS);
|
|
||||||
} else {
|
} else {
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
|
ProtocolLibrary.getProtocolManager().removePacketListener(viewDisguisesListener);
|
||||||
.unregisterAsyncHandler(viewDisguisesListener);
|
|
||||||
// ProtocolLibrary.getProtocolManager().removePacketListener(viewDisguisesListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
|
@ -29,8 +29,7 @@ public class PacketListenerMain extends PacketAdapter {
|
|||||||
|
|
||||||
final Player observer = event.getPlayer();
|
final Player observer = event.getPlayer();
|
||||||
|
|
||||||
if (observer == null || observer.getName() == null ||
|
if (observer.getName().contains("UNKNOWN[")) // If the player is temporary
|
||||||
observer.getName().contains("UNKNOWN[")) // If the player is temporary
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// First get the entity, the one sending this packet
|
// First get the entity, the one sending this packet
|
||||||
|
@ -40,8 +40,7 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter {
|
|||||||
try {
|
try {
|
||||||
final Player observer = event.getPlayer();
|
final Player observer = event.getPlayer();
|
||||||
|
|
||||||
if (observer == null || observer.getName() == null ||
|
if (observer.getName().contains("UNKNOWN[")) {// If the player is temporary
|
||||||
observer.getName().contains("UNKNOWN[")) {// If the player is temporary
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user