Exemplo n.º 1
0
 @EventHandler
 public void onArmorSlot(InventoryClickEvent e) {
   if (e.getSlotType().equals(InventoryType.SlotType.ARMOR)) {
     HumanEntity entity = (HumanEntity) e.getWhoClicked();
     Player player = (Player) entity;
     String pn = player.getName();
     String kit = Main.getKit().get(pn);
     if (kit.equalsIgnoreCase("hidden")) {
       e.setCancelled(true);
     }
     return;
   }
   return;
 }
Exemplo n.º 2
0
 @EventHandler(priority = EventPriority.HIGH)
 public void hurtVoid(EntityDamageEvent e) {
   DamageCause cause = e.getCause();
   Entity entity = e.getEntity();
   if (cause.equals(EntityDamageEvent.DamageCause.VOID)) {
     if (entity instanceof Player) {
       Player player = (Player) entity;
       if (player.hasPermission("kitpvp.coal")) {
         player.setHealth(20.0);
         player.setFallDistance(0.0F);
         player.teleport(Bukkit.getServer().getWorld("world").getSpawnLocation());
         Main.getKSC().put(player.getName(), 0);
         Util.msg(player, "You have fell off the map!");
         Util.ksm(player, "Your KillStreak was reset!");
         return;
       }
     }
   } else if (entity instanceof Player && cause == DamageCause.FALL) e.setCancelled(true);
 }