Advertisement
riking

Untitled

Aug 28th, 2013
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static final ItemStack[][] equipment;
  2. static {
  3. // note - any extra items are ignored in the setArmorContents() method, which we use to compactly store the desired weapon
  4. equipment = new ItemStack[][6];
  5. equipment[0] = new ItemStack[5];
  6. equipment[1] = new ItemStack[] { new ItemStack(Material.LEATHER_BOOTS), new ItemStack(Material.LEATHER_LEGGINGS), new ItemStack(Material.LEATHER_CHESTPLATE), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.WOOD_AXE) };
  7. equipment[2] = new ItemStack[] { new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET), new ItemStack(Material.WOOD_SWORD) };
  8. equipment[3] = new ItemStack[] { new ItemStack(Material.IRON_BOOTS), new ItemStack(Material.IRON_LEGGINGS), new ItemStack(Material.IRON_CHESTPLATE), new ItemStack(Material.IRON_HELMET), new ItemStack(Material.IRON_SWORD) };
  9. equipment[4] = new ItemStack[] { new ItemStack(Material.GOLD_BOOTS), new ItemStack(Material.GOLD_LEGGINGS), new ItemStack(Material.GOLD_CHESTPLATE), new ItemStack(Material.GOLD_HELMET), new ItemStack(Material.GOLD_SWORD) };
  10. equipment[5] = new ItemStack[] { new ItemStack(Material.DIAMOND_BOOTS), new ItemStack(Material.DIAMOND_LEGGINGS), new ItemStack(Material.DIAMOND_CHESTPLATE), new ItemStack(Material.DIAMOND_HELMET), new ItemStack(Material.DIAMOND_SWORD) };
  11. }
  12.  
  13. ....
  14.  
  15. if (wave >= 5) {
  16. ItemStack[] waveEquip = equipment[0];
  17.  
  18. if (wave < 10) {
  19. waveEquip = equipment[1];
  20. } else if (wave < 15) {
  21. waveEquip = equipment[2];
  22. } else if (wave < 20) {
  23. waveEquip = equipment[3];
  24. } else if (wave < 25) {
  25. waveEquip = equipment[4];
  26. } else {
  27. waveEquip = equipment[5];
  28. }
  29. for (ControllableMob<LivingEntity> cm : monsters) {
  30. LivingEntity e = cm.getEntity();
  31. if (!e.getType().equals(EntityType.CREEPER)
  32. && !e.getType().equals(EntityType.WITCH)) {
  33. EntityEquipment equip = e.getEquipment();
  34. equip.setArmorContents(waveEquip);
  35. equip.setItemInHand(waveEquip[4]);
  36.  
  37. equip.setBootsDropChance(0);
  38. equip.setChestplateDropChance(0);
  39. equip.setHelmetDropChance(0);
  40. equip.setLeggingsDropChance(0);
  41. equip.setItemInHandDropChance(0);
  42.  
  43. if (Math.ulp(e.getMaxHealth()) <= 0.0625) { // soft-cap increases
  44. e.setMaxHealth(e.getMaxHealth() + amplifier);
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement