summaryrefslogtreecommitdiffstats
path: root/nms-patches/Enchantment.patch
blob: e339cfd62eab717614c5eb1e820a2592a29823b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java
@@ -18,7 +18,7 @@
     }
 
     public static int getId(Enchantment enchantment) {
-        return Enchantment.enchantments.a((Object) enchantment);
+        return Enchantment.enchantments.a(enchantment); // CraftBukkit - fix decompile error
     }
 
     @Nullable
@@ -139,6 +139,11 @@
         Enchantment.enchantments.a(61, new MinecraftKey("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
         Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
         Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
+        // CraftBukkit start
+        for (Object enchantment : Enchantment.enchantments) {
+            org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment((Enchantment) enchantment));
+        }
+        // CraftBukkit end
     }
 
     public static enum Rarity {