Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static List<Player> Frozen = new ArrayList<Player>();
- public static final HashMap<Player, ArrayList<Block>> FrostyKit = new HashMap<Player, ArrayList<Block>>();
- @EventHandler
- public void onFrost(EntityDamageByEntityEvent e) {
- final Player victim = (Player)e.getEntity();
- Snowball snowball = (Snowball)e.getDamager();
- if(FrostyKit.containsKey(snowball.getShooter())) {
- if(((victim instanceof Player)) && (snowball instanceof Snowball)){
- Frozen.add(victim);
- }else if(Frozen.contains(victim)){
- victim.teleport(victim.getPlayer().getLocation());
- victim.sendMessage(ChatColor.AQUA + "You are frozen in time!");
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- Frozen.remove(victim);
- victim.sendMessage(ChatColor.AQUA + "You are unfrozen!");
- }
- }, 100L);
- }
- }
- }
- if(cmd.getName().equalsIgnoreCase("frosty")) {
- if(!p.hasPermission("pixel.frosty")) {
- p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] " +
- ChatColor.RED + "You dont have permission to this kit!");
- return true;
- }
- if(Kits.HasKit.containsKey(p)){
- p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] " +
- ChatColor.RED + "You already have a kit!");
- return true;
- }else{
- Kits.HasKit.put(p, null);
- }
- Kits.FrostyKit.put(p, null);
- p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] "
- + ChatColor.GRAY + "You have obtainted the " + ChatColor.AQUA + "Frosty" + ChatColor.GRAY + " kit!");
- p.removePotionEffect(PotionEffectType.SPEED);
- p.removePotionEffect(PotionEffectType.POISON);
- p.removePotionEffect(PotionEffectType.JUMP);
- p.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- p.removePotionEffect(PotionEffectType.INVISIBILITY);
- p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- p.removePotionEffect(PotionEffectType.SLOW);
- p.removePotionEffect(PotionEffectType.REGENERATION);
- p.removePotionEffect(PotionEffectType.WEAKNESS);
- p.removePotionEffect(PotionEffectType.FAST_DIGGING);
- pi.clear();
- pi.setHelmet(null);
- pi.setChestplate(null);
- pi.setLeggings(null);
- pi.setBoots(null);
- ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
- ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
- ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
- ItemStack isword = new ItemStack(Material.IRON_SWORD);
- p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 1000000, 0));
- helm.addEnchantment(Enchantment.DURABILITY, 3);
- helm.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- chest.addEnchantment(Enchantment.DURABILITY, 3);
- chest.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- leg.addEnchantment(Enchantment.DURABILITY, 3);
- leg.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- boots.addEnchantment(Enchantment.DURABILITY, 3);
- boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- isword.addEnchantment(Enchantment.DAMAGE_ALL, 3);
- LeatherArmorMeta meta = (LeatherArmorMeta)helm.getItemMeta();
- meta.setColor(Color.WHITE);
- helm.setItemMeta(meta);
- LeatherArmorMeta meta2 = (LeatherArmorMeta)chest.getItemMeta();
- meta2.setColor(Color.WHITE);
- chest.setItemMeta(meta2);
- LeatherArmorMeta meta3 = (LeatherArmorMeta)leg.getItemMeta();
- meta3.setColor(Color.WHITE);
- leg.setItemMeta(meta3);
- LeatherArmorMeta meta4 = (LeatherArmorMeta)boots.getItemMeta();
- meta4.setColor(Color.WHITE);
- boots.setItemMeta(meta4);
- pi.setHelmet(helm);
- pi.setChestplate(chest);
- pi.setLeggings(leg);
- pi.setBoots(boots);
- pi.addItem(isword);
- pi.addItem(new ItemStack(Material.SNOW_BALL, 16));
- giveSoup(p, 32);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement