@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);
 }
Esempio n. 2
0
 @SuppressWarnings("deprecation")
 public void l4(final Player player) {
   Util.resetInv(player);
   addArmor(
       player,
       new ItemStack(Material.DIAMOND_HELMET),
       new ItemStack(Material.IRON_CHESTPLATE),
       new ItemStack(Material.DIAMOND_LEGGINGS),
       new ItemStack(Material.DIAMOND_BOOTS));
   player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
   addSoup(player);
   player.updateInventory();
 }
Esempio n. 3
0
 @SuppressWarnings("deprecation")
 public void l5(final Player player) {
   Util.resetInv(player);
   ItemStack knife = new ItemStack(Material.FIRE);
   ItemMeta knifeMeta = knife.getItemMeta();
   knifeMeta.setDisplayName(ChatColor.GOLD + "Tanks Fire Helm");
   knife.setItemMeta(knifeMeta);
   int knifeEffect = 0;
   int knifeEnhantmentLevel = 2;
   EnchantmentWrapper knifeEnhantment = new EnchantmentWrapper(knifeEffect);
   knife.addUnsafeEnchantment(knifeEnhantment, knifeEnhantmentLevel);
   addArmor(
       player,
       knife,
       new ItemStack(Material.DIAMOND_CHESTPLATE),
       new ItemStack(Material.DIAMOND_LEGGINGS),
       new ItemStack(Material.DIAMOND_BOOTS));
   player.getInventory().addItem(new ItemStack(Material.IRON_SWORD));
   addSoup(player);
   player.updateInventory();
 }