use of mekanism.common.tile.TileEntityEnergyCube in project Mekanism by mekanism.
the class BlockEnergyCube method getShape.
@Nonnull
@Override
@Deprecated
public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nonnull ISelectionContext context) {
TileEntityEnergyCube energyCube = WorldUtils.getTileEntity(TileEntityEnergyCube.class, world, pos, true);
int index;
if (energyCube == null) {
// Default to facing north all enabled
index = getIndex(1, 1, 1, 1, 1, 1, false, false);
} else {
ConfigInfo energyConfig = energyCube.configComponent.getConfig(TransmissionType.ENERGY);
if (energyConfig == null) {
// Default to facing north all enabled
index = getIndex(1, 1, 1, 1, 1, 1, false, false);
} else {
Direction facing = Attribute.get(this, AttributeStateFacing.class).getDirection(state);
index = getIndex(// top
isSideEnabled(energyConfig, facing, Direction.UP), // bottom
isSideEnabled(energyConfig, facing, Direction.DOWN), // front
isSideEnabled(energyConfig, facing, Direction.SOUTH), // back
isSideEnabled(energyConfig, facing, Direction.NORTH), // left
isSideEnabled(energyConfig, facing, Direction.EAST), // right
isSideEnabled(energyConfig, facing, Direction.WEST), facing == Direction.EAST || facing == Direction.WEST, facing == Direction.DOWN || facing == Direction.UP);
}
}
return bounds[index];
}
Aggregations