PaperMC/nms-patches/Enchantment.patch
2016-03-01 09:32:45 +11:00

23 lines
1.2 KiB
Diff

--- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java
@@ -16,7 +16,7 @@
}
public static int getId(Enchantment enchantment) {
- return Enchantment.enchantments.a((Object) enchantment);
+ return Enchantment.enchantments.a(enchantment); // CraftBukkit - fix decompile error
}
public static Enchantment b(String s) {
@@ -135,6 +135,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 (Enchantment enchantment : Enchantment.enchantments) {
+ org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment(enchantment));
+ }
+ // CraftBukkit end
}
public static enum Rarity {