PaperMC/paper-server/nms-patches/net/minecraft/world/item/enchantment/Enchantments.patch

15 lines
686 B
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/item/enchantment/Enchantments.java
+++ b/net/minecraft/world/item/enchantment/Enchantments.java
@@ -50,6 +50,10 @@
public Enchantments() {}
private static Enchantment register(String s, Enchantment enchantment) {
- return (Enchantment) IRegistry.register(BuiltInRegistries.ENCHANTMENT, s, enchantment);
+ // CraftBukkit start
+ enchantment = (Enchantment) IRegistry.register(BuiltInRegistries.ENCHANTMENT, s, enchantment);
+ org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment(enchantment));
+ return enchantment;
+ // CraftBukkit end
}
}