SHOW:
|
|
- or go back to the newest paste.
1 | static final ItemStack[][] equipment; | |
2 | - | ItemStack helmet; |
2 | + | static { |
3 | - | ItemStack chestplate; |
3 | + | // note - any extra items are ignored in the setArmorContents() method, which we use to compactly store the desired weapon |
4 | - | ItemStack leggings; |
4 | + | equipment = new ItemStack[][6]; |
5 | - | ItemStack boots; |
5 | + | equipment[0] = new ItemStack[5]; |
6 | - | ItemStack weapon; |
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 | - | helmet = new ItemStack(Material.LEATHER_HELMET); |
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 | - | chestplate = new ItemStack(Material.LEATHER_CHESTPLATE); |
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 | - | leggings = new ItemStack(Material.LEATHER_LEGGINGS); |
11 | + | } |
12 | - | boots = new ItemStack(Material.LEATHER_BOOTS); |
12 | + | |
13 | - | weapon = new ItemStack(Material.WOOD_SWORD); |
13 | + | .... |
14 | ||
15 | if (wave >= 5) { | |
16 | - | helmet = new ItemStack(Material.CHAINMAIL_HELMET); |
16 | + | ItemStack[] waveEquip = equipment[0]; |
17 | - | chestplate = new ItemStack(Material.CHAINMAIL_CHESTPLATE); |
17 | + | |
18 | - | leggings = new ItemStack(Material.CHAINMAIL_LEGGINGS); |
18 | + | |
19 | - | boots = new ItemStack(Material.CHAINMAIL_BOOTS); |
19 | + | waveEquip = equipment[1]; |
20 | - | weapon = new ItemStack(Material.WOOD_AXE); |
20 | + | |
21 | waveEquip = equipment[2]; | |
22 | } else if (wave < 20) { | |
23 | - | helmet = new ItemStack(Material.IRON_HELMET); |
23 | + | waveEquip = equipment[3]; |
24 | - | chestplate = new ItemStack(Material.IRON_CHESTPLATE); |
24 | + | |
25 | - | leggings = new ItemStack(Material.IRON_LEGGINGS); |
25 | + | waveEquip = equipment[4]; |
26 | - | boots = new ItemStack(Material.IRON_BOOTS); |
26 | + | |
27 | - | weapon = new ItemStack(Material.IRON_SWORD); |
27 | + | waveEquip = equipment[5]; |
28 | } | |
29 | for (ControllableMob<LivingEntity> cm : monsters) { | |
30 | - | helmet = new ItemStack(Material.GOLD_HELMET); |
30 | + | |
31 | - | chestplate = new ItemStack(Material.GOLD_CHESTPLATE); |
31 | + | |
32 | - | leggings = new ItemStack(Material.GOLD_LEGGINGS); |
32 | + | |
33 | - | boots = new ItemStack(Material.GOLD_BOOTS); |
33 | + | |
34 | - | weapon = new ItemStack(Material.GOLD_SWORD); |
34 | + | equip.setArmorContents(waveEquip); |
35 | equip.setItemInHand(waveEquip[4]); | |
36 | ||
37 | - | helmet = new ItemStack(Material.DIAMOND_HELMET); |
37 | + | |
38 | - | chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE); |
38 | + | |
39 | - | leggings = new ItemStack(Material.DIAMOND_LEGGINGS); |
39 | + | |
40 | - | boots = new ItemStack(Material.DIAMOND_BOOTS); |
40 | + | |
41 | - | weapon = new ItemStack(Material.DIAMOND_SWORD); |
41 | + | |
42 | ||
43 | if (Math.ulp(e.getMaxHealth()) <= 0.0625) { // soft-cap increases | |
44 | e.setMaxHealth(e.getMaxHealth() + amplifier); | |
45 | } | |
46 | } | |
47 | } | |
48 | } |