Pulled out getPrimaryBox from Facade.

This commit is contained in:
AlgorithmX2 2014-08-08 01:36:50 -05:00
parent e03fa60687
commit bb83252f38
2 changed files with 25 additions and 19 deletions

View file

@ -30,6 +30,7 @@ import appeng.core.AELog;
import appeng.core.AppEng; import appeng.core.AppEng;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -469,25 +470,7 @@ public class FacadePart implements IFacadePart
@Override @Override
public AxisAlignedBB getPrimaryBox() public AxisAlignedBB getPrimaryBox()
{ {
switch (side) return Platform.getPrimaryBox( side, getFacadeThickness() );
{
case DOWN:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, (getFacadeThickness()) / 16.0, 1.0 );
case EAST:
return AxisAlignedBB.getBoundingBox( (16.0 - getFacadeThickness()) / 16.0, 0.0, 0.0, 1.0, 1.0, 1.0 );
case NORTH:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, (getFacadeThickness()) / 16.0 );
case SOUTH:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, (16.0 - getFacadeThickness()) / 16.0, 1.0, 1.0, 1.0 );
case UP:
return AxisAlignedBB.getBoundingBox( 0.0, (16.0 - getFacadeThickness()) / 16.0, 0.0, 1.0, 1.0, 1.0 );
case WEST:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, (getFacadeThickness()) / 16.0, 1.0, 1.0 );
default:
break;
}
return AxisAlignedBB.getBoundingBox( 0, 0, 0, 1, 1, 1 );
} }
@Override @Override

View file

@ -1768,4 +1768,27 @@ public class Platform
AELog.error( t ); AELog.error( t );
} }
} }
public static AxisAlignedBB getPrimaryBox(ForgeDirection side, int facadeThickness)
{
switch (side)
{
case DOWN:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, (facadeThickness) / 16.0, 1.0 );
case EAST:
return AxisAlignedBB.getBoundingBox( (16.0 - facadeThickness) / 16.0, 0.0, 0.0, 1.0, 1.0, 1.0 );
case NORTH:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, (facadeThickness) / 16.0 );
case SOUTH:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, (16.0 - facadeThickness) / 16.0, 1.0, 1.0, 1.0 );
case UP:
return AxisAlignedBB.getBoundingBox( 0.0, (16.0 - facadeThickness) / 16.0, 0.0, 1.0, 1.0, 1.0 );
case WEST:
return AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, (facadeThickness) / 16.0, 1.0, 1.0 );
default:
break;
}
return AxisAlignedBB.getBoundingBox( 0, 0, 0, 1, 1, 1 );
}
} }