diff options
author | md_5 <git@md-5.net> | 2016-12-12 09:35:31 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-12-12 09:35:31 +1100 |
commit | 4f479728ee68a15a6d2df78fce8cf9e514e43b65 (patch) | |
tree | c5b86f7ad98f429d8a1483a3bd2eb066f88b57c5 | |
parent | c4baa9cdf9e29a565b822209f0b5f7251f3a02ad (diff) | |
download | craftbukkit-4f479728ee68a15a6d2df78fce8cf9e514e43b65.tar craftbukkit-4f479728ee68a15a6d2df78fce8cf9e514e43b65.tar.gz craftbukkit-4f479728ee68a15a6d2df78fce8cf9e514e43b65.tar.lz craftbukkit-4f479728ee68a15a6d2df78fce8cf9e514e43b65.tar.xz craftbukkit-4f479728ee68a15a6d2df78fce8cf9e514e43b65.zip |
SPIGOT-2912: Fix enchanting with ID of 0
-rw-r--r-- | nms-patches/ContainerEnchantTable.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nms-patches/ContainerEnchantTable.patch b/nms-patches/ContainerEnchantTable.patch index b2526812..95f4e2a7 100644 --- a/nms-patches/ContainerEnchantTable.patch +++ b/nms-patches/ContainerEnchantTable.patch @@ -72,8 +72,8 @@ + CraftItemStack item = CraftItemStack.asCraftMirror(itemstack); + org.bukkit.enchantments.EnchantmentOffer[] offers = new EnchantmentOffer[3]; + for (i = 0; i < 3; ++i) { -+ org.bukkit.enchantments.Enchantment enchantment = (this.h[i] > 0) ? org.bukkit.enchantments.Enchantment.getById(this.h[i]) : null; -+ offers[i] = enchantment != null ? new EnchantmentOffer(enchantment, this.i[i], this.costs[i]) : null; ++ org.bukkit.enchantments.Enchantment enchantment = (this.h[i] >= 0) ? org.bukkit.enchantments.Enchantment.getById(this.h[i]) : null; ++ offers[i] = (enchantment != null) ? new EnchantmentOffer(enchantment, this.i[i], this.costs[i]) : null; + } + + PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), this.world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()), item, offers, i); |