Advertisement
Guest User

Untitled

a guest
Sep 17th, 2013
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. static List<Player> Frozen = new ArrayList<Player>();
  2. public static final HashMap<Player, ArrayList<Block>> FrostyKit = new HashMap<Player, ArrayList<Block>>();
  3.  
  4.  
  5. @EventHandler
  6. public void onFrost(EntityDamageByEntityEvent e) {
  7. final Player victim = (Player)e.getEntity();
  8. Snowball snowball = (Snowball)e.getDamager();
  9. if(FrostyKit.containsKey(snowball.getShooter())) {
  10. if(((victim instanceof Player)) && (snowball instanceof Snowball)){
  11. Frozen.add(victim);
  12.  
  13. }else if(Frozen.contains(victim)){
  14. victim.teleport(victim.getPlayer().getLocation());
  15. victim.sendMessage(ChatColor.AQUA + "You are frozen in time!");
  16. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  17. public void run() {
  18. Frozen.remove(victim);
  19. victim.sendMessage(ChatColor.AQUA + "You are unfrozen!");
  20. }
  21. }, 100L);
  22. }
  23. }
  24. }
  25.  
  26.  
  27.  
  28.  
  29. if(cmd.getName().equalsIgnoreCase("frosty")) {
  30. if(!p.hasPermission("pixel.frosty")) {
  31. p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] " +
  32. ChatColor.RED + "You dont have permission to this kit!");
  33. return true;
  34. }
  35. if(Kits.HasKit.containsKey(p)){
  36. p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] " +
  37. ChatColor.RED + "You already have a kit!");
  38. return true;
  39. }else{
  40. Kits.HasKit.put(p, null);
  41. }
  42.  
  43. Kits.FrostyKit.put(p, null);
  44.  
  45. p.sendMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "PixelKits" + ChatColor.GRAY + "] "
  46. + ChatColor.GRAY + "You have obtainted the " + ChatColor.AQUA + "Frosty" + ChatColor.GRAY + " kit!");
  47. p.removePotionEffect(PotionEffectType.SPEED);
  48. p.removePotionEffect(PotionEffectType.POISON);
  49. p.removePotionEffect(PotionEffectType.JUMP);
  50. p.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
  51. p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
  52. p.removePotionEffect(PotionEffectType.INVISIBILITY);
  53. p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
  54. p.removePotionEffect(PotionEffectType.SLOW);
  55. p.removePotionEffect(PotionEffectType.REGENERATION);
  56. p.removePotionEffect(PotionEffectType.WEAKNESS);
  57. p.removePotionEffect(PotionEffectType.FAST_DIGGING);
  58. pi.clear();
  59. pi.setHelmet(null);
  60. pi.setChestplate(null);
  61. pi.setLeggings(null);
  62. pi.setBoots(null);
  63.  
  64. ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
  65. ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
  66. ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
  67. ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
  68. ItemStack isword = new ItemStack(Material.IRON_SWORD);
  69.  
  70. p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 1000000, 0));
  71.  
  72. helm.addEnchantment(Enchantment.DURABILITY, 3);
  73. helm.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
  74. chest.addEnchantment(Enchantment.DURABILITY, 3);
  75. chest.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
  76. leg.addEnchantment(Enchantment.DURABILITY, 3);
  77. leg.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
  78. boots.addEnchantment(Enchantment.DURABILITY, 3);
  79. boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
  80. isword.addEnchantment(Enchantment.DAMAGE_ALL, 3);
  81.  
  82. LeatherArmorMeta meta = (LeatherArmorMeta)helm.getItemMeta();
  83. meta.setColor(Color.WHITE);
  84. helm.setItemMeta(meta);
  85. LeatherArmorMeta meta2 = (LeatherArmorMeta)chest.getItemMeta();
  86. meta2.setColor(Color.WHITE);
  87. chest.setItemMeta(meta2);
  88. LeatherArmorMeta meta3 = (LeatherArmorMeta)leg.getItemMeta();
  89. meta3.setColor(Color.WHITE);
  90. leg.setItemMeta(meta3);
  91. LeatherArmorMeta meta4 = (LeatherArmorMeta)boots.getItemMeta();
  92. meta4.setColor(Color.WHITE);
  93. boots.setItemMeta(meta4);
  94.  
  95. pi.setHelmet(helm);
  96. pi.setChestplate(chest);
  97. pi.setLeggings(leg);
  98. pi.setBoots(boots);
  99.  
  100. pi.addItem(isword);
  101. pi.addItem(new ItemStack(Material.SNOW_BALL, 16));
  102. giveSoup(p, 32);
  103. return true;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement