|
12 | 12 | private final EntityEquipmentSlot[] applicableEquipmentTypes; |
13 | 13 | private final Enchantment.Rarity rarity; |
14 | 14 | @Nullable |
15 | | -@@ -49,7 +49,7 @@ |
16 | | - |
17 | | - public List<ItemStack> getEntityEquipment(EntityLivingBase entityIn) |
18 | | - { |
19 | | -- List<ItemStack> list = Lists.newArrayList(); |
20 | | -+ List<ItemStack> list = Lists.<ItemStack>newArrayList(); |
21 | | - |
22 | | - for (EntityEquipmentSlot entityequipmentslot : this.applicableEquipmentTypes) |
23 | | - { |
24 | 15 | @@ -134,7 +134,7 @@ |
25 | 16 |
|
26 | 17 | public boolean canApply(ItemStack stack) |
|
30 | 21 | } |
31 | 22 |
|
32 | 23 | public void onEntityDamaged(EntityLivingBase user, Entity target, int level) |
33 | | -@@ -155,78 +155,59 @@ |
| 24 | +@@ -153,6 +153,26 @@ |
| 25 | + public boolean isCurse() |
| 26 | + { |
34 | 27 | return false; |
35 | | - } |
36 | | - |
| 28 | ++ } |
| 29 | ++ |
37 | 30 | + /** |
38 | 31 | + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} |
39 | 32 | + * applies for <i>all possible</i> enchantments. |
|
52 | 45 | + public boolean isAllowedOnBooks() |
53 | 46 | + { |
54 | 47 | + return true; |
55 | | -+ } |
56 | | -+ |
57 | | - public static void registerEnchantments() |
58 | | - { |
59 | | -- EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] |
60 | | -- { |
61 | | -- EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET |
62 | | -- }; |
63 | | -- REGISTRY.register( |
64 | | -- 0, new ResourceLocation("protection"), new EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.ALL, aentityequipmentslot) |
65 | | -- ); |
66 | | -- REGISTRY.register( |
67 | | -- 1, |
68 | | -- new ResourceLocation("fire_protection"), |
69 | | -- new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FIRE, aentityequipmentslot) |
70 | | -- ); |
71 | | -- REGISTRY.register( |
72 | | -- 2, |
73 | | -- new ResourceLocation("feather_falling"), |
74 | | -- new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FALL, aentityequipmentslot) |
75 | | -- ); |
76 | | -- REGISTRY.register( |
77 | | -- 3, |
78 | | -- new ResourceLocation("blast_protection"), |
79 | | -- new EnchantmentProtection(Enchantment.Rarity.RARE, EnchantmentProtection.Type.EXPLOSION, aentityequipmentslot) |
80 | | -- ); |
81 | | -- REGISTRY.register( |
82 | | -- 4, |
83 | | -- new ResourceLocation("projectile_protection"), |
84 | | -- new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.PROJECTILE, aentityequipmentslot) |
85 | | -- ); |
86 | | -+ EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; |
87 | | -+ REGISTRY.register(0, new ResourceLocation("protection"), new EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.ALL, aentityequipmentslot)); |
88 | | -+ REGISTRY.register(1, new ResourceLocation("fire_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FIRE, aentityequipmentslot)); |
89 | | -+ REGISTRY.register(2, new ResourceLocation("feather_falling"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FALL, aentityequipmentslot)); |
90 | | -+ REGISTRY.register(3, new ResourceLocation("blast_protection"), new EnchantmentProtection(Enchantment.Rarity.RARE, EnchantmentProtection.Type.EXPLOSION, aentityequipmentslot)); |
91 | | -+ REGISTRY.register(4, new ResourceLocation("projectile_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.PROJECTILE, aentityequipmentslot)); |
92 | | - REGISTRY.register(5, new ResourceLocation("respiration"), new EnchantmentOxygen(Enchantment.Rarity.RARE, aentityequipmentslot)); |
93 | | - REGISTRY.register(6, new ResourceLocation("aqua_affinity"), new EnchantmentWaterWorker(Enchantment.Rarity.RARE, aentityequipmentslot)); |
94 | | - REGISTRY.register(7, new ResourceLocation("thorns"), new EnchantmentThorns(Enchantment.Rarity.VERY_RARE, aentityequipmentslot)); |
95 | | - REGISTRY.register(8, new ResourceLocation("depth_strider"), new EnchantmentWaterWalker(Enchantment.Rarity.RARE, aentityequipmentslot)); |
96 | | -- REGISTRY.register(9, new ResourceLocation("frost_walker"), new EnchantmentFrostWalker(Enchantment.Rarity.RARE, EntityEquipmentSlot.FEET)); |
97 | | -+ REGISTRY.register(9, new ResourceLocation("frost_walker"), new EnchantmentFrostWalker(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.FEET})); |
98 | | - REGISTRY.register(10, new ResourceLocation("binding_curse"), new EnchantmentBindingCurse(Enchantment.Rarity.VERY_RARE, aentityequipmentslot)); |
99 | | -- REGISTRY.register(16, new ResourceLocation("sharpness"), new EnchantmentDamage(Enchantment.Rarity.COMMON, 0, EntityEquipmentSlot.MAINHAND)); |
100 | | -- REGISTRY.register(17, new ResourceLocation("smite"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 1, EntityEquipmentSlot.MAINHAND)); |
101 | | -- REGISTRY.register( |
102 | | -- 18, new ResourceLocation("bane_of_arthropods"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 2, EntityEquipmentSlot.MAINHAND) |
103 | | -- ); |
104 | | -- REGISTRY.register(19, new ResourceLocation("knockback"), new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, EntityEquipmentSlot.MAINHAND)); |
105 | | -- REGISTRY.register(20, new ResourceLocation("fire_aspect"), new EnchantmentFireAspect(Enchantment.Rarity.RARE, EntityEquipmentSlot.MAINHAND)); |
106 | | -- REGISTRY.register( |
107 | | -- 21, new ResourceLocation("looting"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.WEAPON, EntityEquipmentSlot.MAINHAND) |
108 | | -- ); |
109 | | -- REGISTRY.register(22, new ResourceLocation("sweeping"), new EnchantmentSweepingEdge(Enchantment.Rarity.RARE, EntityEquipmentSlot.MAINHAND)); |
110 | | -- REGISTRY.register(32, new ResourceLocation("efficiency"), new EnchantmentDigging(Enchantment.Rarity.COMMON, EntityEquipmentSlot.MAINHAND)); |
111 | | -- REGISTRY.register( |
112 | | -- 33, new ResourceLocation("silk_touch"), new EnchantmentUntouching(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.MAINHAND) |
113 | | -- ); |
114 | | -- REGISTRY.register(34, new ResourceLocation("unbreaking"), new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, EntityEquipmentSlot.MAINHAND)); |
115 | | -- REGISTRY.register( |
116 | | -- 35, new ResourceLocation("fortune"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.DIGGER, EntityEquipmentSlot.MAINHAND) |
117 | | -- ); |
118 | | -- REGISTRY.register(48, new ResourceLocation("power"), new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, EntityEquipmentSlot.MAINHAND)); |
119 | | -- REGISTRY.register(49, new ResourceLocation("punch"), new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, EntityEquipmentSlot.MAINHAND)); |
120 | | -- REGISTRY.register(50, new ResourceLocation("flame"), new EnchantmentArrowFire(Enchantment.Rarity.RARE, EntityEquipmentSlot.MAINHAND)); |
121 | | -- REGISTRY.register( |
122 | | -- 51, new ResourceLocation("infinity"), new EnchantmentArrowInfinite(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.MAINHAND) |
123 | | -- ); |
124 | | -- REGISTRY.register( |
125 | | -- 61, |
126 | | -- new ResourceLocation("luck_of_the_sea"), |
127 | | -- new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, EntityEquipmentSlot.MAINHAND) |
128 | | -- ); |
129 | | -- REGISTRY.register( |
130 | | -- 62, new ResourceLocation("lure"), new EnchantmentFishingSpeed(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, EntityEquipmentSlot.MAINHAND) |
131 | | -- ); |
132 | | -+ REGISTRY.register(16, new ResourceLocation("sharpness"), new EnchantmentDamage(Enchantment.Rarity.COMMON, 0, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
133 | | -+ REGISTRY.register(17, new ResourceLocation("smite"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 1, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
134 | | -+ REGISTRY.register(18, new ResourceLocation("bane_of_arthropods"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 2, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
135 | | -+ REGISTRY.register(19, new ResourceLocation("knockback"), new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
136 | | -+ REGISTRY.register(20, new ResourceLocation("fire_aspect"), new EnchantmentFireAspect(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
137 | | -+ REGISTRY.register(21, new ResourceLocation("looting"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.WEAPON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
138 | | -+ REGISTRY.register(22, new ResourceLocation("sweeping"), new EnchantmentSweepingEdge(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
139 | | -+ REGISTRY.register(32, new ResourceLocation("efficiency"), new EnchantmentDigging(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
140 | | -+ REGISTRY.register(33, new ResourceLocation("silk_touch"), new EnchantmentUntouching(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
141 | | -+ REGISTRY.register(34, new ResourceLocation("unbreaking"), new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
142 | | -+ REGISTRY.register(35, new ResourceLocation("fortune"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.DIGGER, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
143 | | -+ REGISTRY.register(48, new ResourceLocation("power"), new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
144 | | -+ REGISTRY.register(49, new ResourceLocation("punch"), new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
145 | | -+ REGISTRY.register(50, new ResourceLocation("flame"), new EnchantmentArrowFire(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
146 | | -+ REGISTRY.register(51, new ResourceLocation("infinity"), new EnchantmentArrowInfinite(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
147 | | -+ REGISTRY.register(61, new ResourceLocation("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
148 | | -+ REGISTRY.register(62, new ResourceLocation("lure"), new EnchantmentFishingSpeed(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND})); |
149 | | - REGISTRY.register(70, new ResourceLocation("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EntityEquipmentSlot.values())); |
150 | | -- REGISTRY.register( |
151 | | -- 71, new ResourceLocation("vanishing_curse"), new EnchantmentVanishingCurse(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.values()) |
152 | | -- ); |
153 | | -+ REGISTRY.register(71, new ResourceLocation("vanishing_curse"), new EnchantmentVanishingCurse(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.values())); |
154 | 48 | } |
155 | 49 |
|
156 | | - public static enum Rarity |
| 50 | + public static void registerEnchantments() |
0 commit comments