Block bounds for Laser and Logistical Sorter
@@ -37,6 +37,7 @@ import mekanism.common.security.ISecurityTile;
import mekanism.common.tile.TileEntityChargepad;
import mekanism.common.tile.TileEntityFactory;
import mekanism.common.tile.TileEntityFluidTank;
+import mekanism.common.tile.TileEntityLaser;
import mekanism.common.tile.TileEntityLaserAmplifier;
import mekanism.common.tile.TileEntityLogisticalSorter;
import mekanism.common.tile.TileEntityMetallurgicInfuser;
@@ -46,6 +47,7 @@ import mekanism.common.tile.prefab.TileEntityContainerBlock;
import mekanism.common.util.FluidContainerUtils;
import mekanism.common.util.ItemDataUtils;
import mekanism.common.util.MekanismUtils;
+import mekanism.common.util.MultipartUtils;
import mekanism.common.util.PipeUtils;
import mekanism.common.util.SecurityUtils;
import mekanism.common.util.StackUtils;
@@ -139,6 +141,8 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock
private static final AxisAlignedBB CHARGEPAD_BOUNDS = new AxisAlignedBB(0.0F, 0.0F, 0.0F, 1.0F, 0.06F, 1.0F);
private static final AxisAlignedBB TANK_BOUNDS = new AxisAlignedBB(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
+ private static final AxisAlignedBB LASER_BOUNDS = new AxisAlignedBB(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
+ private static final AxisAlignedBB LOGISTICAL_SORTER_BOUNDS = new AxisAlignedBB(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
public BlockMachine()
{
@@ -989,6 +993,7 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
{
MachineType type = MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
+ TileEntity tile = world.getTileEntity(pos);
if(type == null)
{
@@ -1001,6 +1006,16 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock
return CHARGEPAD_BOUNDS;
case FLUID_TANK:
return TANK_BOUNDS;
+ case LASER:
+ if(tile instanceof TileEntityLaser)
+ {
+ return MultipartUtils.rotate(LASER_BOUNDS.offset(-0.5, -0.5, -0.5), ((TileEntityLaser)tile).facing).offset(0.5, 0.5, 0.5);
+ }
+ case LOGISTICAL_SORTER:
+ if(tile instanceof TileEntityLogisticalSorter)
+ {
+ return MultipartUtils.rotate(LOGISTICAL_SORTER_BOUNDS.offset(-0.5, -0.5, -0.5), ((TileEntityLogisticalSorter)tile).facing).offset(0.5, 0.5, 0.5);
+ }
default:
return super.getBoundingBox(state, world, pos);
}
