From efaa44a6f422e6f8c1efbe7409037ea22dab5398 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Fri, 31 Oct 2014 17:26:22 +0100 Subject: [PATCH] Add check when placing multiblocks near the sky limit or bedrock level --- .../render/blocks/RenderBlockCraftingCPU.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index ee29604f..19571987 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -4,6 +4,7 @@ import java.util.EnumSet; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; @@ -22,8 +23,8 @@ import appeng.tile.crafting.TileCraftingTile; public class RenderBlockCraftingCPU extends BaseBlockRender { - protected RenderBlockCraftingCPU(boolean useTesr, int range) { - super( useTesr, range ); + protected RenderBlockCraftingCPU(boolean useTESR, int range) { + super( useTESR, range ); } public RenderBlockCraftingCPU() { @@ -303,6 +304,16 @@ public class RenderBlockCraftingCPU extends BaseBlockRender private boolean isConnected(IBlockAccess w, int x, int y, int z, ForgeDirection side) { - return w.getTileEntity( x + side.offsetX, y + side.offsetY, z + side.offsetZ ) instanceof TileCraftingTile; + final int tileYPos = y + side.offsetY; + if ( 0 <= tileYPos && tileYPos <= 255) + { + final TileEntity tile = w.getTileEntity( x + side.offsetX, y + side.offsetY, z + side.offsetZ ); + + return tile instanceof TileCraftingTile; + } + else + { + return false; + } } }