From f6b72830b72fcb9d4a3716a3e3a879209efe4ebd Mon Sep 17 00:00:00 2001 From: LemADEC Date: Thu, 7 Jan 2016 05:06:28 +0100 Subject: [PATCH] Fixed hull glass rendering with grass and glass --- .../warpdrive/block/hull/BlockHullGlass.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java index 9898f119..d0698a75 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java @@ -2,8 +2,10 @@ package cr0s.warpdrive.block.hull; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockGlass; import net.minecraft.block.material.Material; import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.config.WarpDriveConfig; @@ -35,12 +37,16 @@ public class BlockHullGlass extends BlockColored { @Override public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - Block sideBlock = world.getBlock(x, y, z); - if (sideBlock == this) { - return false; + if (world.isAirBlock(x, y, z)) { + return true; } - - return world.isAirBlock(x, y, z); + ForgeDirection direction = ForgeDirection.getOrientation(side).getOpposite(); + Block sideBlock = world.getBlock(x, y, z); + if (sideBlock instanceof BlockGlass || sideBlock instanceof BlockHullGlass) { + return world.getBlockMetadata(x, y, z) + != world.getBlockMetadata(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ); + } + return !world.isSideSolid(x, y, z, direction, false); } @Override