diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/TileEntityFurnace.java')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityFurnace.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java index 10db2c76..62bcc828 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -143,7 +143,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory { return this.burnTime > 0; } - public void q_() { + public void g() { boolean flag = this.burnTime > 0; boolean flag1 = false; @@ -189,7 +189,9 @@ public class TileEntityFurnace extends TileEntity implements IInventory { if (this.items[1] != null) { --this.items[1].count; if (this.items[1].count == 0) { - this.items[1] = null; + Item item = this.items[1].getItem().q(); + + this.items[1] = item != null ? new ItemStack(item) : null; } } } @@ -223,7 +225,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory { if (this.items[0] == null) { return false; } else { - ItemStack itemstack = FurnaceRecipes.getInstance().getResult(this.items[0].getItem().id); + ItemStack itemstack = RecipesFurnace.getInstance().getResult(this.items[0].getItem().id); // CraftBukkit - consider resultant count instead of current count return itemstack == null ? false : (this.items[2] == null ? true : (!this.items[2].doMaterialsMatch(itemstack) ? false : (this.items[2].count + itemstack.count <= this.getMaxStackSize() && this.items[2].count < this.items[2].getMaxStackSize() ? true : this.items[2].count + itemstack.count <= itemstack.getMaxStackSize()))); @@ -232,7 +234,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory { public void burn() { if (this.canBurn()) { - ItemStack itemstack = FurnaceRecipes.getInstance().getResult(this.items[0].getItem().id); + ItemStack itemstack = RecipesFurnace.getInstance().getResult(this.items[0].getItem().id); // CraftBukkit start CraftItemStack source = new CraftItemStack(this.items[0]); @@ -269,8 +271,21 @@ public class TileEntityFurnace extends TileEntity implements IInventory { return 0; } else { int i = itemstack.getItem().id; + Item item = itemstack.getItem(); + + if (i < 256 && Block.byId[i] != null) { + Block block = Block.byId[i]; - return i < 256 && Block.byId[i].material == Material.WOOD ? 300 : (i == Item.STICK.id ? 100 : (i == Item.COAL.id ? 1600 : (i == Item.LAVA_BUCKET.id ? 20000 : (i == Block.SAPLING.id ? 100 : (i == Item.BLAZE_ROD.id ? 2400 : 0))))); + if (block == Block.WOOD_STEP) { + return 150; + } + + if (block.material == Material.WOOD) { + return 300; + } + } + + return item instanceof ItemTool && ((ItemTool) item).e().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword) item).f().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe) item).f().equals("WOOD") ? 200 : (i == Item.STICK.id ? 100 : (i == Item.COAL.id ? 1600 : (i == Item.LAVA_BUCKET.id ? 20000 : (i == Block.SAPLING.id ? 100 : (i == Item.BLAZE_ROD.id ? 2400 : 0))))))); } } @@ -282,7 +297,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory { return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D; } - public void f() {} + public void startOpen() {} - public void g() {} + public void f() {} } |