Facebook
From sdfsdf, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 232
  1. import org.bukkit.entity.Player;
  2.  
  3. import com.comphenix.protocol.PacketType;
  4. import com.comphenix.protocol.events.PacketAdapter;
  5. import com.comphenix.protocol.events.PacketEvent;
  6.  
  7. import pl.luckyman_68.cuddihosting.antycrasher.Main;
  8.  
  9. public class Packet12 extends PacketAdapter {
  10.  
  11.         Main plugin;
  12.        
  13.           public Packet12()
  14.           {
  15.             super(Main.getInst(), new PacketType[] { PacketType.Play.Client.STEER_VEHICLE});
  16.           }
  17.        
  18.        
  19.             @Override
  20.             public void onPacketReceiving(PacketEvent event) {
  21.                     Player player = event.getPlayer();
  22.                     int packets = Main.packets.get(player);
  23.                     if (packets > 30)
  24.                     {
  25.                           event.setCancelled(true);
  26.                               player.kickPlayer("§cZostales rozlaczony z serwerem z powodu wysylania zbyt duzej ilosci pakietow do serwera.");
  27.                               Main.sendalladmin("§cGracz §6" + player.getName() + " §cwysylal zbyt duzo pakietow " + "§c(ost. SET_CREATIVE_SLOT");
  28.                               return;
  29.                     }
  30.                     Main.addpacket(player);
  31.                 }
  32. }
  33.