Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
@@ -33,6 +34,7 @@ import appeng.api.parts.IPart;
|
||||
import appeng.parts.BusCollisionHelper;
|
||||
import appeng.parts.CableBusContainer;
|
||||
|
||||
|
||||
public class CableRenderHelper
|
||||
{
|
||||
|
||||
@@ -43,70 +45,21 @@ public class CableRenderHelper
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private void setSide(ForgeDirection s)
|
||||
{
|
||||
ForgeDirection ax;
|
||||
ForgeDirection ay;
|
||||
ForgeDirection az;
|
||||
|
||||
switch (s)
|
||||
{
|
||||
case DOWN:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.NORTH;
|
||||
az = ForgeDirection.DOWN;
|
||||
break;
|
||||
case UP:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.SOUTH;
|
||||
az = ForgeDirection.UP;
|
||||
break;
|
||||
case EAST:
|
||||
ax = ForgeDirection.SOUTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.EAST;
|
||||
break;
|
||||
case WEST:
|
||||
ax = ForgeDirection.NORTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.WEST;
|
||||
break;
|
||||
case NORTH:
|
||||
ax = ForgeDirection.WEST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.NORTH;
|
||||
break;
|
||||
case SOUTH:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
}
|
||||
|
||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||
}
|
||||
|
||||
public void renderStatic(CableBusContainer cableBusContainer, IFacadeContainer iFacadeContainer)
|
||||
public void renderStatic( CableBusContainer cableBusContainer, IFacadeContainer iFacadeContainer )
|
||||
{
|
||||
TileEntity te = cableBusContainer.getTile();
|
||||
RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer;
|
||||
|
||||
if ( renderer.overrideBlockTexture != null )
|
||||
if( renderer.overrideBlockTexture != null )
|
||||
BusRenderHelper.INSTANCE.setPass( 0 );
|
||||
|
||||
if ( renderer.blockAccess == null )
|
||||
if( renderer.blockAccess == null )
|
||||
renderer.blockAccess = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
for (ForgeDirection s : ForgeDirection.values())
|
||||
for( ForgeDirection s : ForgeDirection.values() )
|
||||
{
|
||||
IPart part = cableBusContainer.getPart( s );
|
||||
if ( part != null )
|
||||
if( part != null )
|
||||
{
|
||||
this.setSide( s );
|
||||
renderer.renderAllFaces = true;
|
||||
@@ -122,16 +75,16 @@ public class CableRenderHelper
|
||||
}
|
||||
}
|
||||
|
||||
if ( !iFacadeContainer.isEmpty() )
|
||||
if( !iFacadeContainer.isEmpty() )
|
||||
{
|
||||
/**
|
||||
* snag list of boxes...
|
||||
*/
|
||||
List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
for (ForgeDirection s : ForgeDirection.values())
|
||||
for( ForgeDirection s : ForgeDirection.values() )
|
||||
{
|
||||
IPart part = cableBusContainer.getPart( s );
|
||||
if ( part != null )
|
||||
if( part != null )
|
||||
{
|
||||
this.setSide( s );
|
||||
BusRenderHelper brh = BusRenderHelper.INSTANCE;
|
||||
@@ -144,7 +97,7 @@ public class CableRenderHelper
|
||||
double min = 2.0 / 16.0;
|
||||
double max = 14.0 / 16.0;
|
||||
|
||||
for (AxisAlignedBB bb : boxes)
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
{
|
||||
int o = 0;
|
||||
o += bb.maxX > max ? 1 : 0;
|
||||
@@ -154,23 +107,23 @@ public class CableRenderHelper
|
||||
o += bb.minY < min ? 1 : 0;
|
||||
o += bb.minZ < min ? 1 : 0;
|
||||
|
||||
if ( o >= 2 )
|
||||
if( o >= 2 )
|
||||
useThinFacades = true;
|
||||
}
|
||||
|
||||
for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection s : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IFacadePart fPart = iFacadeContainer.getFacade( s );
|
||||
if ( fPart != null )
|
||||
if( fPart != null )
|
||||
{
|
||||
AxisAlignedBB b = null;
|
||||
fPart.setThinFacades( useThinFacades );
|
||||
AxisAlignedBB pb = fPart.getPrimaryBox();
|
||||
for (AxisAlignedBB bb : boxes)
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
{
|
||||
if ( bb.intersectsWith( pb ) )
|
||||
if( bb.intersectsWith( pb ) )
|
||||
{
|
||||
if ( b == null )
|
||||
if( b == null )
|
||||
b = bb;
|
||||
else
|
||||
{
|
||||
@@ -188,8 +141,7 @@ public class CableRenderHelper
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
|
||||
this.setSide( s );
|
||||
fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer, iFacadeContainer, b,
|
||||
cableBusContainer.getPart( s ) == null );
|
||||
fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer, iFacadeContainer, b, cableBusContainer.getPart( s ) == null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,55 +152,104 @@ public class CableRenderHelper
|
||||
}
|
||||
}
|
||||
|
||||
public void renderDynamic(CableBusContainer cableBusContainer, double x, double y, double z)
|
||||
private void setSide( ForgeDirection s )
|
||||
{
|
||||
for (ForgeDirection s : ForgeDirection.values())
|
||||
ForgeDirection ax;
|
||||
ForgeDirection ay;
|
||||
ForgeDirection az;
|
||||
|
||||
switch( s )
|
||||
{
|
||||
case DOWN:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.NORTH;
|
||||
az = ForgeDirection.DOWN;
|
||||
break;
|
||||
case UP:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.SOUTH;
|
||||
az = ForgeDirection.UP;
|
||||
break;
|
||||
case EAST:
|
||||
ax = ForgeDirection.SOUTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.EAST;
|
||||
break;
|
||||
case WEST:
|
||||
ax = ForgeDirection.NORTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.WEST;
|
||||
break;
|
||||
case NORTH:
|
||||
ax = ForgeDirection.WEST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.NORTH;
|
||||
break;
|
||||
case SOUTH:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
}
|
||||
|
||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||
}
|
||||
|
||||
public void renderDynamic( CableBusContainer cableBusContainer, double x, double y, double z )
|
||||
{
|
||||
for( ForgeDirection s : ForgeDirection.values() )
|
||||
{
|
||||
IPart part = cableBusContainer.getPart( s );
|
||||
if ( part != null )
|
||||
if( part != null )
|
||||
{
|
||||
ForgeDirection ax;
|
||||
ForgeDirection ay;
|
||||
ForgeDirection az;
|
||||
|
||||
switch (s)
|
||||
switch( s )
|
||||
{
|
||||
case DOWN:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.NORTH;
|
||||
az = ForgeDirection.DOWN;
|
||||
break;
|
||||
case UP:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.SOUTH;
|
||||
az = ForgeDirection.UP;
|
||||
break;
|
||||
case EAST:
|
||||
ax = ForgeDirection.SOUTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.EAST;
|
||||
break;
|
||||
case WEST:
|
||||
ax = ForgeDirection.NORTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.WEST;
|
||||
break;
|
||||
case NORTH:
|
||||
ax = ForgeDirection.WEST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.NORTH;
|
||||
break;
|
||||
case SOUTH:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case DOWN:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.NORTH;
|
||||
az = ForgeDirection.DOWN;
|
||||
break;
|
||||
case UP:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.SOUTH;
|
||||
az = ForgeDirection.UP;
|
||||
break;
|
||||
case EAST:
|
||||
ax = ForgeDirection.SOUTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.EAST;
|
||||
break;
|
||||
case WEST:
|
||||
ax = ForgeDirection.NORTH;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.WEST;
|
||||
break;
|
||||
case NORTH:
|
||||
ax = ForgeDirection.WEST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.NORTH;
|
||||
break;
|
||||
case SOUTH:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
ax = ForgeDirection.EAST;
|
||||
ay = ForgeDirection.UP;
|
||||
az = ForgeDirection.SOUTH;
|
||||
break;
|
||||
}
|
||||
|
||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||
@@ -256,5 +257,4 @@ public class CableRenderHelper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user