From 5ae8f13fdedbdfcc8204111a557fd9e1ad392220 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Wed, 1 Feb 2012 04:22:05 -0600 Subject: [PATCH] Fixed items losing their enchantments under certain circumstances. --- src/main/java/net/minecraft/server/BlockFurnace.java | 2 +- src/main/java/net/minecraft/server/EntityMinecart.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java index e56cca58c2..819d493eca 100644 --- a/src/main/java/net/minecraft/server/BlockFurnace.java +++ b/src/main/java/net/minecraft/server/BlockFurnace.java @@ -133,7 +133,7 @@ public class BlockFurnace extends BlockContainer { } itemstack.count -= i1; - EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, i1, itemstack.getData())); + EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, i1, itemstack.getData(), itemstack.getEnchantments())); // CraftBukkit - include enchantments in new itemstack float f3 = 0.05F; entityitem.motX = (double) ((float) this.a.nextGaussian() * f3); diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 75abecc7d3..49e1bf0388 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -153,7 +153,7 @@ public class EntityMinecart extends Entity implements IInventory { } itemstack.count -= k; - EntityItem entityitem = new EntityItem(this.world, this.locX + (double) f, this.locY + (double) f1, this.locZ + (double) f2, new ItemStack(itemstack.id, k, itemstack.getData())); + EntityItem entityitem = new EntityItem(this.world, this.locX + (double) f, this.locY + (double) f1, this.locZ + (double) f2, new ItemStack(itemstack.id, k, itemstack.getData(), itemstack.getEnchantments())); // CraftBukkit - include enchantments in the new itemstack float f3 = 0.05F; entityitem.motX = (double) ((float) this.random.nextGaussian() * f3); @@ -197,7 +197,7 @@ public class EntityMinecart extends Entity implements IInventory { } itemstack.count -= j; - EntityItem entityitem = new EntityItem(this.world, this.locX + (double) f, this.locY + (double) f1, this.locZ + (double) f2, new ItemStack(itemstack.id, j, itemstack.getData())); + EntityItem entityitem = new EntityItem(this.world, this.locX + (double) f, this.locY + (double) f1, this.locZ + (double) f2, new ItemStack(itemstack.id, j, itemstack.getData(), itemstack.getEnchantments())); // CraftBukkit - include enchantments in the new itemstack float f3 = 0.05F; entityitem.motX = (double) ((float) this.random.nextGaussian() * f3);