Fixed hull glass rendering with grass and glass

This commit is contained in:
LemADEC 2016-01-07 05:06:28 +01:00
parent 0d7c04d9ae
commit f6b72830b7

View file

@ -2,8 +2,10 @@ package cr0s.warpdrive.block.hull;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockColored; import net.minecraft.block.BlockColored;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.config.WarpDriveConfig;
@ -35,12 +37,16 @@ public class BlockHullGlass extends BlockColored {
@Override @Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
Block sideBlock = world.getBlock(x, y, z); if (world.isAirBlock(x, y, z)) {
if (sideBlock == this) { return true;
return false;
} }
ForgeDirection direction = ForgeDirection.getOrientation(side).getOpposite();
return world.isAirBlock(x, y, z); 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 @Override