public TabListener() { ProtocolLibrary.getProtocolManager() .addPacketListener( new PacketAdapter( Gearz.getInstance(), ListenerPriority.NORMAL, PacketType.Play.Client.TAB_COMPLETE) { @Override public void onPacketReceiving(PacketEvent event) { if (event.getPacketType() == PacketType.Play.Client.TAB_COMPLETE) { try { if (event.getPlayer().hasPermission("gearz.staff")) return; PacketContainer packet = event.getPacket(); String message = packet.getSpecificModifier(String.class).read(0); if ((message.startsWith("/"))) event.setCancelled(true); } catch (FieldAccessException ignored) { } } } }); }
@Override public void handleCommandStatus( TCommandStatus status, CommandSender sender, TCommandSender senderType) { Gearz.handleCommandStatus(status, sender); }