summaryrefslogtreecommitdiffstats
path: root/nms-patches/Enchantment.patch
blob: 8cece08345a1e7565416bd2385d23e004fd104fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java
@@ -154,10 +154,15 @@
         a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
         a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
         a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));
+        // CraftBukkit start
+        for (Object enchantment : IRegistry.ENCHANTMENT) {
+            org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment((Enchantment) enchantment));
+        }
+        // CraftBukkit end
     }
 
     private static void a(String s, Enchantment enchantment) {
-        IRegistry.ENCHANTMENT.a(new MinecraftKey(s), (Object) enchantment);
+        IRegistry.ENCHANTMENT.a(new MinecraftKey(s), enchantment); // CraftBukkit - decompile error
     }
 
     public static enum Rarity {