Only use getter when needed

This commit is contained in:
Raoul Van den Berge
2016-08-06 02:43:50 +02:00
parent 23d997203d
commit 2ee2573ee6

View File

@@ -110,13 +110,12 @@ public class BlockCable extends BlockCoverable {
} }
private boolean hasConnectionWith(IBlockAccess world, BlockPos pos, EnumFacing direction) { private boolean hasConnectionWith(IBlockAccess world, BlockPos pos, EnumFacing direction) {
TileMultipartNode tile = (TileMultipartNode) world.getTileEntity(pos);
TileEntity facing = world.getTileEntity(pos.offset(direction)); TileEntity facing = world.getTileEntity(pos.offset(direction));
if (facing instanceof INetworkMaster || facing instanceof INetworkNode) { if (facing instanceof INetworkMaster || facing instanceof INetworkNode) {
// Do not render a cable extension where our cable "head" is (e.g. importer, exporter, external storage cubes). // Do not render a cable extension where our cable "head" is (e.g. importer, exporter, external storage cubes).
if (getPlacementType() != null) { if (getPlacementType() != null) {
return tile.getFacingTile() != facing; return ((TileMultipartNode) world.getTileEntity(pos)).getFacingTile() != facing;
} }
return !TileMultipartNode.hasBlockingMicroblock(world, pos, direction) && !TileMultipartNode.hasBlockingMicroblock(world, pos.offset(direction), direction.getOpposite()); return !TileMultipartNode.hasBlockingMicroblock(world, pos, direction) && !TileMultipartNode.hasBlockingMicroblock(world, pos.offset(direction), direction.getOpposite());