From 959d878c629c6d90d7ba1be52ccc84a1498b69a3 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 18 Jan 2017 16:22:11 -1000 Subject: [PATCH] Fix Charcoal Pile Igniter incorrectly comparing Blocks against IBlockStates --- .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 18ea0a4f..3dbf7092 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -11,6 +11,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.common.tools.GT_Tool; import gregtech.common.GT_Pollution; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -140,7 +141,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aX + 1 < 6 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX + 1, aY, aZ)) && (!aList2.contains(new BlockPos(aX + 1, aY, aZ)))) p1 = true; - } else if (!(tBlock == Blocks.DIRT || tBlock == Blocks.GRASS)) { + } else if (!isDirt(tBlock)) { return false; } @@ -148,7 +149,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aX - 1 > -6 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX - 1, aY, aZ)) && (!aList2.contains(new BlockPos(aX - 1, aY, aZ)))) p2 = true; - } else if (!(tBlock == Blocks.DIRT || tBlock == Blocks.GRASS)) { + } else if (!isDirt(tBlock)) { return false; } @@ -156,7 +157,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aY + 1 < 1 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX, aY + 1, aZ)) && (!aList2.contains(new BlockPos(aX, aY + 1, aZ)))) p3 = true; - } else if (!(tBlock == Blocks.DIRT || tBlock == Blocks.GRASS || (aX == 0 && aY == -1 && aZ == 0 && tBlock == GregTech_API.sBlockMachines))) { + } else if (!(isDirt(tBlock) || (aX == 0 && aY == -1 && aZ == 0 && tBlock.getBlock() == GregTech_API.sBlockMachines))) { return false; } @@ -164,7 +165,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aY - 1 > -6 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX, aY - 1, aZ)) && (!aList2.contains(new BlockPos(aX, aY - 1, aZ)))) p4 = true; - } else if (tBlock != Blocks.BRICK_BLOCK) { + } else if (tBlock.getBlock() != Blocks.BRICK_BLOCK) { return false; } @@ -172,7 +173,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aZ + 1 < 6 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX, aY, aZ + 1)) && (!aList2.contains(new BlockPos(aX, aY, aZ + 1)))) p5 = true; - } else if (!(tBlock == Blocks.DIRT || tBlock == Blocks.GRASS)) { + } else if (!isDirt(tBlock)) { return false; } @@ -180,7 +181,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock if (aZ - 1 > -6 && (isWoodLog(tBlock))) { if (!aList1.contains(new BlockPos(aX, aY, aZ - 1)) && (!aList2.contains(new BlockPos(aX, aY, aZ - 1)))) p6 = true; - } else if (!(tBlock == Blocks.DIRT || tBlock == Blocks.GRASS)) { + } else if (!isDirt(tBlock)) { return false; } aList1.add(new BlockPos(aX, aY, aZ)); @@ -200,6 +201,11 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock (log.getMaterial() == Material.WOOD); } + private boolean isDirt(IBlockState dirt) { + Block b = dirt.getBlock(); + return (b == Blocks.DIRT || b == Blocks.GRASS); + } + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mWrench = true; mScrewdriver = true;