From bb83252f38f33d1c4a0abf15e6c6a1cbff69d38f Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 8 Aug 2014 01:36:50 -0500 Subject: [PATCH] Pulled out getPrimaryBox from Facade. --- facade/FacadePart.java | 21 ++------------------- util/Platform.java | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/facade/FacadePart.java b/facade/FacadePart.java index 0a23bb6f6..d6a00f4f7 100644 --- a/facade/FacadePart.java +++ b/facade/FacadePart.java @@ -30,6 +30,7 @@ import appeng.core.AELog; import appeng.core.AppEng; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IBC; +import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -469,25 +470,7 @@ public class FacadePart implements IFacadePart @Override public AxisAlignedBB getPrimaryBox() { - switch (side) - { - 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 ); + return Platform.getPrimaryBox( side, getFacadeThickness() ); } @Override diff --git a/util/Platform.java b/util/Platform.java index 5f06feac7..051651b15 100644 --- a/util/Platform.java +++ b/util/Platform.java @@ -1768,4 +1768,27 @@ public class Platform 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 ); + } }