Synchronizing Techhider to prevent block-bug
Dieser Commit ist enthalten in:
Ursprung
40589ec351
Commit
3247ea737c
@ -77,7 +77,7 @@ public class TechHider {
|
||||
if(Config.event())
|
||||
threadMultiplier = 4;
|
||||
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ITEM) {
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ITEM) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
@ -86,8 +86,8 @@ public class TechHider {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}).start(threadMultiplier);
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ENTITY) {
|
||||
});
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ENTITY) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
@ -96,7 +96,7 @@ public class TechHider {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}).start(threadMultiplier);
|
||||
});
|
||||
}
|
||||
|
||||
public static void start(){
|
||||
@ -109,7 +109,7 @@ public class TechHider {
|
||||
|
||||
Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), packetCache::clear, 1, 1);
|
||||
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MAP_CHUNK) {
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MAP_CHUNK) {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent e) {
|
||||
PacketContainer packet = e.getPacket();
|
||||
@ -220,8 +220,8 @@ public class TechHider {
|
||||
byteArray.write(0, data);
|
||||
}
|
||||
}
|
||||
}).start(4 * threadMultiplier);
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.BLOCK_CHANGE) {
|
||||
});
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.BLOCK_CHANGE) {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent e) {
|
||||
PacketContainer packet = e.getPacket();
|
||||
@ -247,8 +247,8 @@ public class TechHider {
|
||||
blockStructure.write(0, block);
|
||||
}
|
||||
}
|
||||
}).start(threadMultiplier);
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MULTI_BLOCK_CHANGE) {
|
||||
});
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MULTI_BLOCK_CHANGE) {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent e) {
|
||||
PacketContainer packet = e.getPacket();
|
||||
@ -283,8 +283,8 @@ public class TechHider {
|
||||
blockStructure.write(0, changes);
|
||||
}
|
||||
}
|
||||
}).start(threadMultiplier);
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.BLOCK_ACTION) {
|
||||
});
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.BLOCK_ACTION) {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent e) {
|
||||
PacketContainer packet = e.getPacket();
|
||||
@ -296,7 +296,7 @@ public class TechHider {
|
||||
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}).start();
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean bypass(Player p, int chunkX, int chunkZ){
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren