diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java index 1fbac70a7..44f2086be 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java @@ -33,7 +33,7 @@ public class PacketHandler extends MiniPlugin @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) - { + { _playerVerifierMap.put(event.getPlayer(), new PacketVerifier(event.getPlayer(), this)); ((CraftPlayer) event.getPlayer()).getHandle().playerConnection.PacketVerifier.setPacketVerifier(_playerVerifierMap @@ -41,11 +41,11 @@ public class PacketHandler extends MiniPlugin } public boolean handlePacket(Player player, Packet packet) - { + { if (!_playerVerifierMap.containsKey(player)) - { + { return true; - } + } PacketVerifier verifier = _playerVerifierMap.get(player); @@ -56,7 +56,7 @@ public class PacketHandler extends MiniPlugin { if (!_packetHandlers.containsKey(packetInfo.getPacket().getClass())) { - // aSystem.err.print("Received packet " + packetInfo.getPacket().getClass() + " but am not listening for it!"); + System.err.print("Received packet " + packetInfo.getPacket().getClass() + " but am not listening for it!"); return true; } @@ -66,11 +66,11 @@ public class PacketHandler extends MiniPlugin { handler.handle(packetInfo); } - catch (Exception ex) - { - ex.printStackTrace(); + catch (Exception ex) + { + ex.printStackTrace(); + } } - } return !packetInfo.isCancelled(); } @@ -106,7 +106,7 @@ public class PacketHandler extends MiniPlugin if (packetsToListen.length == 0) { throw new IllegalArgumentException("When registering a new packet listener, add the packets its going to listen to"); - } + } for (Class c : packetsToListen) { @@ -123,7 +123,7 @@ public class PacketHandler extends MiniPlugin if (!_packetHandlers.containsKey(c)) { _packetHandlers.put(c, new ArrayList()); - } + } _packetHandlers.get(c).add(packetHandler); PacketProcessor.addPacket(c, forceMainThread || _forceMainThread.containsKey(c));