Renamed constants
This commit is contained in:
@@ -61,7 +61,7 @@ public class BaseBlockRender
|
||||
|
||||
final double MAX_DISTANCE;
|
||||
final public boolean hasTESR;
|
||||
final static private byte[][][] OrientationMap = new byte[6][6][6];
|
||||
private static final byte[][][] ORIENTATION_MAP = new byte[6][6][6];
|
||||
|
||||
protected int adjustBrightness(int v, double d)
|
||||
{
|
||||
@@ -91,184 +91,184 @@ public class BaseBlockRender
|
||||
int b = forward.ordinal();
|
||||
int c = up.ordinal();
|
||||
|
||||
return OrientationMap[a][b][c];
|
||||
return ORIENTATION_MAP[a][b][c];
|
||||
}
|
||||
|
||||
static public void setOriMap()
|
||||
{
|
||||
// pointed up...
|
||||
OrientationMap[0][3][1] = 0;
|
||||
OrientationMap[1][3][1] = 0;
|
||||
OrientationMap[2][3][1] = 0;
|
||||
OrientationMap[3][3][1] = 0;
|
||||
OrientationMap[4][3][1] = 0;
|
||||
OrientationMap[5][3][1] = 0;
|
||||
ORIENTATION_MAP[0][3][1] = 0;
|
||||
ORIENTATION_MAP[1][3][1] = 0;
|
||||
ORIENTATION_MAP[2][3][1] = 0;
|
||||
ORIENTATION_MAP[3][3][1] = 0;
|
||||
ORIENTATION_MAP[4][3][1] = 0;
|
||||
ORIENTATION_MAP[5][3][1] = 0;
|
||||
|
||||
OrientationMap[0][5][1] = 1;
|
||||
OrientationMap[1][5][1] = 2;
|
||||
OrientationMap[2][5][1] = 0;
|
||||
OrientationMap[3][5][1] = 0;
|
||||
OrientationMap[4][5][1] = 0;
|
||||
OrientationMap[5][5][1] = 0;
|
||||
ORIENTATION_MAP[0][5][1] = 1;
|
||||
ORIENTATION_MAP[1][5][1] = 2;
|
||||
ORIENTATION_MAP[2][5][1] = 0;
|
||||
ORIENTATION_MAP[3][5][1] = 0;
|
||||
ORIENTATION_MAP[4][5][1] = 0;
|
||||
ORIENTATION_MAP[5][5][1] = 0;
|
||||
|
||||
OrientationMap[0][2][1] = 3;
|
||||
OrientationMap[1][2][1] = 3;
|
||||
OrientationMap[2][2][1] = 0;
|
||||
OrientationMap[3][2][1] = 0;
|
||||
OrientationMap[4][2][1] = 0;
|
||||
OrientationMap[5][2][1] = 0;
|
||||
ORIENTATION_MAP[0][2][1] = 3;
|
||||
ORIENTATION_MAP[1][2][1] = 3;
|
||||
ORIENTATION_MAP[2][2][1] = 0;
|
||||
ORIENTATION_MAP[3][2][1] = 0;
|
||||
ORIENTATION_MAP[4][2][1] = 0;
|
||||
ORIENTATION_MAP[5][2][1] = 0;
|
||||
|
||||
OrientationMap[0][4][1] = 2;
|
||||
OrientationMap[1][4][1] = 1;
|
||||
OrientationMap[2][4][1] = 0;
|
||||
OrientationMap[3][4][1] = 0;
|
||||
OrientationMap[4][4][1] = 0;
|
||||
OrientationMap[5][4][1] = 0;
|
||||
ORIENTATION_MAP[0][4][1] = 2;
|
||||
ORIENTATION_MAP[1][4][1] = 1;
|
||||
ORIENTATION_MAP[2][4][1] = 0;
|
||||
ORIENTATION_MAP[3][4][1] = 0;
|
||||
ORIENTATION_MAP[4][4][1] = 0;
|
||||
ORIENTATION_MAP[5][4][1] = 0;
|
||||
|
||||
// upside down
|
||||
OrientationMap[0][3][0] = FLIP_H_BIT;
|
||||
OrientationMap[1][3][0] = FLIP_H_BIT;
|
||||
OrientationMap[2][3][0] = 3;
|
||||
OrientationMap[3][3][0] = 3;
|
||||
OrientationMap[4][3][0] = 3;
|
||||
OrientationMap[5][3][0] = 3;
|
||||
ORIENTATION_MAP[0][3][0] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][3][0] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][3][0] = 3;
|
||||
ORIENTATION_MAP[3][3][0] = 3;
|
||||
ORIENTATION_MAP[4][3][0] = 3;
|
||||
ORIENTATION_MAP[5][3][0] = 3;
|
||||
|
||||
OrientationMap[0][4][0] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[1][4][0] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[2][4][0] = 3;
|
||||
OrientationMap[3][4][0] = 3;
|
||||
OrientationMap[4][4][0] = 3;
|
||||
OrientationMap[5][4][0] = 3;
|
||||
ORIENTATION_MAP[0][4][0] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][4][0] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][4][0] = 3;
|
||||
ORIENTATION_MAP[3][4][0] = 3;
|
||||
ORIENTATION_MAP[4][4][0] = 3;
|
||||
ORIENTATION_MAP[5][4][0] = 3;
|
||||
|
||||
OrientationMap[0][5][0] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][5][0] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[2][5][0] = 3;
|
||||
OrientationMap[3][5][0] = 3;
|
||||
OrientationMap[4][5][0] = 3;
|
||||
OrientationMap[5][5][0] = 3;
|
||||
ORIENTATION_MAP[0][5][0] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][5][0] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][5][0] = 3;
|
||||
ORIENTATION_MAP[3][5][0] = 3;
|
||||
ORIENTATION_MAP[4][5][0] = 3;
|
||||
ORIENTATION_MAP[5][5][0] = 3;
|
||||
|
||||
OrientationMap[0][2][0] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[1][2][0] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[2][2][0] = 3;
|
||||
OrientationMap[3][2][0] = 3;
|
||||
OrientationMap[4][2][0] = 3;
|
||||
OrientationMap[5][2][0] = 3;
|
||||
ORIENTATION_MAP[0][2][0] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][2][0] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][2][0] = 3;
|
||||
ORIENTATION_MAP[3][2][0] = 3;
|
||||
ORIENTATION_MAP[4][2][0] = 3;
|
||||
ORIENTATION_MAP[5][2][0] = 3;
|
||||
|
||||
// side 1
|
||||
OrientationMap[0][3][5] = 1 | FLIP_V_BIT;
|
||||
OrientationMap[1][3][5] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[2][3][5] = 1;
|
||||
OrientationMap[3][3][5] = 1;
|
||||
OrientationMap[4][3][5] = 1;
|
||||
OrientationMap[5][3][5] = 1 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[0][3][5] = 1 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[1][3][5] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][3][5] = 1;
|
||||
ORIENTATION_MAP[3][3][5] = 1;
|
||||
ORIENTATION_MAP[4][3][5] = 1;
|
||||
ORIENTATION_MAP[5][3][5] = 1 | FLIP_V_BIT;
|
||||
|
||||
OrientationMap[0][1][5] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][1][5] = 1;
|
||||
OrientationMap[2][1][5] = 3 | FLIP_V_BIT;
|
||||
OrientationMap[3][1][5] = 3;
|
||||
OrientationMap[4][1][5] = 1 | FLIP_V_BIT;
|
||||
OrientationMap[5][1][5] = 1;
|
||||
ORIENTATION_MAP[0][1][5] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][1][5] = 1;
|
||||
ORIENTATION_MAP[2][1][5] = 3 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[3][1][5] = 3;
|
||||
ORIENTATION_MAP[4][1][5] = 1 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[5][1][5] = 1;
|
||||
|
||||
OrientationMap[0][2][5] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][2][5] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[2][2][5] = 1;
|
||||
OrientationMap[3][2][5] = 2 | FLIP_V_BIT;
|
||||
OrientationMap[4][2][5] = 1 | FLIP_V_BIT;
|
||||
OrientationMap[5][2][5] = 1;
|
||||
ORIENTATION_MAP[0][2][5] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][2][5] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][2][5] = 1;
|
||||
ORIENTATION_MAP[3][2][5] = 2 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[4][2][5] = 1 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[5][2][5] = 1;
|
||||
|
||||
OrientationMap[0][0][5] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][0][5] = 1;
|
||||
OrientationMap[2][0][5] = 0;
|
||||
OrientationMap[3][0][5] = FLIP_V_BIT;
|
||||
OrientationMap[4][0][5] = 1;
|
||||
OrientationMap[5][0][5] = 1 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[0][0][5] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][0][5] = 1;
|
||||
ORIENTATION_MAP[2][0][5] = 0;
|
||||
ORIENTATION_MAP[3][0][5] = FLIP_V_BIT;
|
||||
ORIENTATION_MAP[4][0][5] = 1;
|
||||
ORIENTATION_MAP[5][0][5] = 1 | FLIP_V_BIT;
|
||||
|
||||
// side 2
|
||||
OrientationMap[0][1][2] = FLIP_H_BIT;
|
||||
OrientationMap[1][1][2] = 0;
|
||||
OrientationMap[2][1][2] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[3][1][2] = 1;
|
||||
OrientationMap[4][1][2] = 3;
|
||||
OrientationMap[5][1][2] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][1][2] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][1][2] = 0;
|
||||
ORIENTATION_MAP[2][1][2] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][1][2] = 1;
|
||||
ORIENTATION_MAP[4][1][2] = 3;
|
||||
ORIENTATION_MAP[5][1][2] = 3 | FLIP_H_BIT;
|
||||
|
||||
OrientationMap[0][4][2] = FLIP_H_BIT;
|
||||
OrientationMap[1][4][2] = FLIP_H_BIT;
|
||||
OrientationMap[2][4][2] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[3][4][2] = 1;
|
||||
OrientationMap[4][4][2] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[5][4][2] = 2;
|
||||
ORIENTATION_MAP[0][4][2] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][4][2] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][4][2] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][4][2] = 1;
|
||||
ORIENTATION_MAP[4][4][2] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][4][2] = 2;
|
||||
|
||||
OrientationMap[0][0][2] = FLIP_V_BIT;
|
||||
OrientationMap[1][0][2] = 0;
|
||||
OrientationMap[2][0][2] = 2;
|
||||
OrientationMap[3][0][2] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[4][0][2] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[5][0][2] = 0;
|
||||
ORIENTATION_MAP[0][0][2] = FLIP_V_BIT;
|
||||
ORIENTATION_MAP[1][0][2] = 0;
|
||||
ORIENTATION_MAP[2][0][2] = 2;
|
||||
ORIENTATION_MAP[3][0][2] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][0][2] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][0][2] = 0;
|
||||
|
||||
OrientationMap[0][5][2] = FLIP_H_BIT;
|
||||
OrientationMap[1][5][2] = FLIP_H_BIT;
|
||||
OrientationMap[2][5][2] = 2;
|
||||
OrientationMap[3][5][2] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[4][5][2] = 2;
|
||||
OrientationMap[5][5][2] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][5][2] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][5][2] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[2][5][2] = 2;
|
||||
ORIENTATION_MAP[3][5][2] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][5][2] = 2;
|
||||
ORIENTATION_MAP[5][5][2] = 1 | FLIP_H_BIT;
|
||||
|
||||
// side 3
|
||||
OrientationMap[0][0][3] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[1][0][3] = 3;
|
||||
OrientationMap[2][0][3] = 1;
|
||||
OrientationMap[3][0][3] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[4][0][3] = 0;
|
||||
OrientationMap[5][0][3] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][0][3] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][0][3] = 3;
|
||||
ORIENTATION_MAP[2][0][3] = 1;
|
||||
ORIENTATION_MAP[3][0][3] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][0][3] = 0;
|
||||
ORIENTATION_MAP[5][0][3] = FLIP_H_BIT;
|
||||
|
||||
OrientationMap[0][4][3] = 3;
|
||||
OrientationMap[1][4][3] = 3;
|
||||
OrientationMap[2][4][3] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[3][4][3] = 2;
|
||||
OrientationMap[4][4][3] = 1;
|
||||
OrientationMap[5][4][3] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][4][3] = 3;
|
||||
ORIENTATION_MAP[1][4][3] = 3;
|
||||
ORIENTATION_MAP[2][4][3] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][4][3] = 2;
|
||||
ORIENTATION_MAP[4][4][3] = 1;
|
||||
ORIENTATION_MAP[5][4][3] = 2 | FLIP_H_BIT;
|
||||
|
||||
OrientationMap[0][1][3] = 3 | FLIP_V_BIT;
|
||||
OrientationMap[1][1][3] = 3;
|
||||
OrientationMap[2][1][3] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[3][1][3] = 2;
|
||||
OrientationMap[4][1][3] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[5][1][3] = 0;
|
||||
ORIENTATION_MAP[0][1][3] = 3 | FLIP_V_BIT;
|
||||
ORIENTATION_MAP[1][1][3] = 3;
|
||||
ORIENTATION_MAP[2][1][3] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][1][3] = 2;
|
||||
ORIENTATION_MAP[4][1][3] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][1][3] = 0;
|
||||
|
||||
OrientationMap[0][5][3] = 3;
|
||||
OrientationMap[1][5][3] = 3;
|
||||
OrientationMap[2][5][3] = 1;
|
||||
OrientationMap[3][5][3] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[4][5][3] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[5][5][3] = 1;
|
||||
ORIENTATION_MAP[0][5][3] = 3;
|
||||
ORIENTATION_MAP[1][5][3] = 3;
|
||||
ORIENTATION_MAP[2][5][3] = 1;
|
||||
ORIENTATION_MAP[3][5][3] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][5][3] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][5][3] = 1;
|
||||
|
||||
// side 4
|
||||
OrientationMap[0][3][4] = 1;
|
||||
OrientationMap[1][3][4] = 2;
|
||||
OrientationMap[2][3][4] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[3][3][4] = 1;
|
||||
OrientationMap[4][3][4] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[5][3][4] = 1;
|
||||
ORIENTATION_MAP[0][3][4] = 1;
|
||||
ORIENTATION_MAP[1][3][4] = 2;
|
||||
ORIENTATION_MAP[2][3][4] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][3][4] = 1;
|
||||
ORIENTATION_MAP[4][3][4] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][3][4] = 1;
|
||||
|
||||
OrientationMap[0][0][4] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][0][4] = 2;
|
||||
OrientationMap[2][0][4] = 0;
|
||||
OrientationMap[3][0][4] = FLIP_H_BIT;
|
||||
OrientationMap[4][0][4] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[5][0][4] = 1;
|
||||
ORIENTATION_MAP[0][0][4] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][0][4] = 2;
|
||||
ORIENTATION_MAP[2][0][4] = 0;
|
||||
ORIENTATION_MAP[3][0][4] = FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][0][4] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[5][0][4] = 1;
|
||||
|
||||
OrientationMap[0][1][4] = 1 | FLIP_H_BIT;
|
||||
OrientationMap[1][1][4] = 2;
|
||||
OrientationMap[2][1][4] = 3 | FLIP_H_BIT;
|
||||
OrientationMap[3][1][4] = 3;
|
||||
OrientationMap[4][1][4] = 2;
|
||||
OrientationMap[5][1][4] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][1][4] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[1][1][4] = 2;
|
||||
ORIENTATION_MAP[2][1][4] = 3 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[3][1][4] = 3;
|
||||
ORIENTATION_MAP[4][1][4] = 2;
|
||||
ORIENTATION_MAP[5][1][4] = 1 | FLIP_H_BIT;
|
||||
|
||||
OrientationMap[0][2][4] = 1;
|
||||
OrientationMap[1][2][4] = 2;
|
||||
OrientationMap[2][2][4] = 1;
|
||||
OrientationMap[3][2][4] = 2 | FLIP_H_BIT;
|
||||
OrientationMap[4][2][4] = 2;
|
||||
OrientationMap[5][2][4] = 1 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[0][2][4] = 1;
|
||||
ORIENTATION_MAP[1][2][4] = 2;
|
||||
ORIENTATION_MAP[2][2][4] = 1;
|
||||
ORIENTATION_MAP[3][2][4] = 2 | FLIP_H_BIT;
|
||||
ORIENTATION_MAP[4][2][4] = 2;
|
||||
ORIENTATION_MAP[5][2][4] = 1 | FLIP_H_BIT;
|
||||
}
|
||||
|
||||
public BaseBlockRender() {
|
||||
|
||||
@@ -43,7 +43,7 @@ import appeng.core.features.AEFeature;
|
||||
public class BusRenderHelper implements IPartRenderHelper
|
||||
{
|
||||
|
||||
final public static BusRenderHelper instance = new BusRenderHelper();
|
||||
final public static BusRenderHelper INSTANCE = new BusRenderHelper();
|
||||
|
||||
double minX = 0;
|
||||
double minY = 0;
|
||||
@@ -162,7 +162,7 @@ public class BusRenderHelper implements IPartRenderHelper
|
||||
@Override
|
||||
public void normalRendering()
|
||||
{
|
||||
RenderBlocksWorkaround rbw = BusRenderer.instance.renderer;
|
||||
RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
|
||||
rbw.calculations = true;
|
||||
rbw.useTextures = true;
|
||||
rbw.enableAO = false;
|
||||
@@ -171,7 +171,7 @@ public class BusRenderHelper implements IPartRenderHelper
|
||||
@Override
|
||||
public ISimplifiedBundle useSimplifiedRendering(int x, int y, int z, IBoxProvider p, ISimplifiedBundle sim)
|
||||
{
|
||||
RenderBlocksWorkaround rbw = BusRenderer.instance.renderer;
|
||||
RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
|
||||
|
||||
if ( sim != null && rbw.similarLighting( this.blk, rbw.blockAccess, x, y, z, sim ) )
|
||||
{
|
||||
@@ -350,8 +350,8 @@ public class BusRenderHelper implements IPartRenderHelper
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) AEApi.instance().blocks().blockMultiPart.block();
|
||||
BlockRenderInfo info = blk.getRendererInstance();
|
||||
ForgeDirection forward = BusRenderHelper.instance.az;
|
||||
ForgeDirection up = BusRenderHelper.instance.ay;
|
||||
ForgeDirection forward = BusRenderHelper.INSTANCE.az;
|
||||
ForgeDirection up = BusRenderHelper.INSTANCE.ay;
|
||||
|
||||
renderer.uvRotateBottom = info.getTexture( ForgeDirection.DOWN ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.DOWN, forward, up ) );
|
||||
renderer.uvRotateTop = info.getTexture( ForgeDirection.UP ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.UP, forward, up ) );
|
||||
@@ -387,7 +387,7 @@ public class BusRenderHelper implements IPartRenderHelper
|
||||
@Override
|
||||
public void setFacesToRender(EnumSet<ForgeDirection> faces)
|
||||
{
|
||||
BusRenderer.instance.renderer.renderFaces = faces;
|
||||
BusRenderer.INSTANCE.renderer.renderFaces = faces;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,21 +45,21 @@ import appeng.util.Platform;
|
||||
public class BusRenderer implements IItemRenderer
|
||||
{
|
||||
|
||||
public static final BusRenderer instance = new BusRenderer();
|
||||
public static final BusRenderer INSTANCE = new BusRenderer();
|
||||
|
||||
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
||||
public static final HashMap<Integer, IPart> renderPart = new HashMap<Integer, IPart>();
|
||||
public static final HashMap<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
|
||||
|
||||
public IPart getRenderer(ItemStack is, IPartItem c)
|
||||
{
|
||||
int id = (Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET) | is.getItemDamage();
|
||||
|
||||
IPart part = renderPart.get( id );
|
||||
IPart part = RENDER_PART.get( id );
|
||||
if ( part == null )
|
||||
{
|
||||
part = c.createPartFromItemStack( is );
|
||||
if ( part != null )
|
||||
renderPart.put( id, part );
|
||||
RENDER_PART.put( id, part );
|
||||
}
|
||||
|
||||
return part;
|
||||
@@ -126,12 +126,12 @@ public class BusRenderer implements IItemRenderer
|
||||
Tessellator.instance.setColorOpaque_F( 1, 1, 1 );
|
||||
Tessellator.instance.setBrightness( 14 << 20 | 14 << 4 );
|
||||
|
||||
BusRenderHelper.instance.setBounds( 0, 0, 0, 1, 1, 1 );
|
||||
BusRenderHelper.instance.setTexture( null );
|
||||
BusRenderHelper.instance.setInvColor( 0xffffff );
|
||||
BusRenderHelper.INSTANCE.setBounds( 0, 0, 0, 1, 1, 1 );
|
||||
BusRenderHelper.INSTANCE.setTexture( null );
|
||||
BusRenderHelper.INSTANCE.setInvColor( 0xffffff );
|
||||
this.renderer.blockAccess = ClientHelper.proxy.getWorld();
|
||||
|
||||
BusRenderHelper.instance.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
BusRenderHelper.INSTANCE.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
|
||||
this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0;
|
||||
this.renderer.useInventoryTint = false;
|
||||
@@ -149,7 +149,7 @@ public class BusRenderer implements IItemRenderer
|
||||
}
|
||||
|
||||
if ( fp != null )
|
||||
fp.renderInventory( BusRenderHelper.instance, this.renderer );
|
||||
fp.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -162,7 +162,7 @@ public class BusRenderer implements IItemRenderer
|
||||
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * (8 - depth) - 0.06f );
|
||||
}
|
||||
|
||||
ip.renderInventory( BusRenderHelper.instance, this.renderer );
|
||||
ip.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ import appeng.parts.CableBusContainer;
|
||||
public class CableRenderHelper
|
||||
{
|
||||
|
||||
private static final CableRenderHelper instance = new CableRenderHelper();
|
||||
private static final CableRenderHelper INSTANCE = new CableRenderHelper();
|
||||
|
||||
public static CableRenderHelper getInstance()
|
||||
{
|
||||
return instance;
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private void setSide(ForgeDirection s)
|
||||
@@ -87,16 +87,16 @@ public class CableRenderHelper
|
||||
break;
|
||||
}
|
||||
|
||||
BusRenderHelper.instance.setOrientation( ax, ay, az );
|
||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||
}
|
||||
|
||||
public void renderStatic(CableBusContainer cableBusContainer, IFacadeContainer iFacadeContainer)
|
||||
{
|
||||
TileEntity te = cableBusContainer.getTile();
|
||||
RenderBlocksWorkaround renderer = BusRenderer.instance.renderer;
|
||||
RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer;
|
||||
|
||||
if ( renderer.overrideBlockTexture != null )
|
||||
BusRenderHelper.instance.setPass( 0 );
|
||||
BusRenderHelper.INSTANCE.setPass( 0 );
|
||||
|
||||
if ( renderer.blockAccess == null )
|
||||
renderer.blockAccess = Minecraft.getMinecraft().theWorld;
|
||||
@@ -112,7 +112,7 @@ public class CableRenderHelper
|
||||
renderer.flipTexture = false;
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
|
||||
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer );
|
||||
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer );
|
||||
|
||||
renderer.faces = EnumSet.allOf( ForgeDirection.class );
|
||||
renderer.calculations = true;
|
||||
@@ -132,7 +132,7 @@ public class CableRenderHelper
|
||||
if ( part != null )
|
||||
{
|
||||
this.setSide( s );
|
||||
BusRenderHelper brh = BusRenderHelper.instance;
|
||||
BusRenderHelper brh = BusRenderHelper.INSTANCE;
|
||||
BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true );
|
||||
part.getBoxes( bch );
|
||||
}
|
||||
@@ -186,7 +186,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,
|
||||
fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer, iFacadeContainer, b,
|
||||
cableBusContainer.getPart( s ) == null );
|
||||
}
|
||||
}
|
||||
@@ -247,8 +247,8 @@ public class CableRenderHelper
|
||||
break;
|
||||
}
|
||||
|
||||
BusRenderHelper.instance.setOrientation( ax, ay, az );
|
||||
part.renderDynamic( x, y, z, BusRenderHelper.instance, BusRenderer.instance.renderer );
|
||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||
part.renderDynamic( x, y, z, BusRenderHelper.INSTANCE, BusRenderer.INSTANCE.renderer );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
public class ItemRenderer implements IItemRenderer
|
||||
{
|
||||
|
||||
public static final ItemRenderer instance = new ItemRenderer();
|
||||
public static final ItemRenderer INSTANCE = new ItemRenderer();
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
@@ -56,7 +56,7 @@ public class ItemRenderer implements IItemRenderer
|
||||
if ( type == ItemRenderType.INVENTORY )
|
||||
GL11.glTranslatef( 0.0f, -0.1f, 0.0f );
|
||||
|
||||
WorldRender.instance.renderItemBlock( item, type, data );
|
||||
WorldRender.INSTANCE.renderItemBlock( item, type, data );
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraftforge.client.IRenderHandler;
|
||||
public class SpatialSkyRender extends IRenderHandler
|
||||
{
|
||||
|
||||
private static final SpatialSkyRender instance = new SpatialSkyRender();
|
||||
private static final SpatialSkyRender INSTANCE = new SpatialSkyRender();
|
||||
|
||||
private final Random random = new Random();
|
||||
private long cycle = 0;
|
||||
@@ -185,7 +185,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
|
||||
public static IRenderHandler getInstance()
|
||||
{
|
||||
return instance;
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler
|
||||
|
||||
private final RenderBlocks renderer = new RenderBlocks();
|
||||
final int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static final WorldRender instance = new WorldRender();
|
||||
public static final WorldRender INSTANCE = new WorldRender();
|
||||
boolean hasError = false;
|
||||
|
||||
public final HashMap<AEBaseBlock, BaseBlockRender> blockRenders = new HashMap<AEBaseBlock, BaseBlockRender>();
|
||||
|
||||
@@ -201,14 +201,14 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||
return false;
|
||||
}
|
||||
|
||||
BusRenderer.instance.renderer.blockAccess = renderer.blockAccess;
|
||||
renderer = BusRenderer.instance.renderer;
|
||||
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
|
||||
renderer = BusRenderer.INSTANCE.renderer;
|
||||
|
||||
this.preRenderInWorld( block, world, x, y, z, renderer );
|
||||
|
||||
tma.lightCache = BusRenderHelper.instance.useSimplifiedRendering( x, y, z, this, tma.lightCache );
|
||||
tma.lightCache = BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.lightCache );
|
||||
|
||||
BusRenderer.instance.renderer.isFacade = true;
|
||||
BusRenderer.INSTANCE.renderer.isFacade = true;
|
||||
IOrientable te = this.getOrientable( block, world, x, y, z );
|
||||
|
||||
ForgeDirection fdy = te.getUp();
|
||||
@@ -262,12 +262,12 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||
this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, fdx, fdy, fdz );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
|
||||
BusRenderHelper.instance.normalRendering();
|
||||
BusRenderHelper.INSTANCE.normalRendering();
|
||||
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
|
||||
renderer.renderAllFaces = false;
|
||||
BusRenderer.instance.renderer.isFacade = false;
|
||||
BusRenderer.INSTANCE.renderer.isFacade = false;
|
||||
|
||||
this.postRenderInWorld( renderer );
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
|
||||
if ( formed && renderer.overrideBlockTexture == null )
|
||||
{
|
||||
renderer = BusRenderer.instance.renderer;
|
||||
BusRenderHelper i = BusRenderHelper.instance;
|
||||
BusRenderer.instance.renderer.isFacade = true;
|
||||
renderer = BusRenderer.INSTANCE.renderer;
|
||||
BusRenderHelper i = BusRenderHelper.INSTANCE;
|
||||
BusRenderer.INSTANCE.renderer.isFacade = true;
|
||||
|
||||
renderer.blockAccess = w;
|
||||
i.setPass( 0 );
|
||||
@@ -122,7 +122,7 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
this.handleSide( blk, meta, x, y, z, i, renderer, ct.getForward() == side ? theIcon : nonForward, LocalEmit, isMonitor, side, w );
|
||||
}
|
||||
|
||||
BusRenderer.instance.renderer.isFacade = false;
|
||||
BusRenderer.INSTANCE.renderer.isFacade = false;
|
||||
i.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
|
||||
i.normalRendering();
|
||||
|
||||
|
||||
@@ -108,11 +108,11 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
int x = (int) p.posX;
|
||||
int y = (int) p.posY;
|
||||
int z = (int) p.posZ;
|
||||
CompassResult cr = CompassManager.instance.getCompassDirection( 0, x, y, z );
|
||||
CompassResult cr = CompassManager.INSTANCE.getCompassDirection( 0, x, y, z );
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < 3; j++)
|
||||
CompassManager.instance.getCompassDirection( 0, x + i - 1, y, z + j - 1 );
|
||||
CompassManager.INSTANCE.getCompassDirection( 0, x + i - 1, y, z + j - 1 );
|
||||
|
||||
if ( cr.hasResult )
|
||||
{
|
||||
@@ -187,7 +187,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
|
||||
CompassResult cr = null;
|
||||
if ( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN )
|
||||
cr = CompassManager.instance.getCompassDirection( 0, tile.xCoord, tile.yCoord, tile.zCoord );
|
||||
cr = CompassManager.INSTANCE.getCompassDirection( 0, tile.xCoord, tile.yCoord, tile.zCoord );
|
||||
else
|
||||
cr = new CompassResult( false, true, 0 );
|
||||
|
||||
|
||||
@@ -51,14 +51,14 @@ public class RendererCableBus extends BaseBlockRender
|
||||
|
||||
if ( t instanceof TileCableBus )
|
||||
{
|
||||
BusRenderer.instance.renderer.renderAllFaces = true;
|
||||
BusRenderer.instance.renderer.blockAccess = renderer.blockAccess;
|
||||
BusRenderer.instance.renderer.overrideBlockTexture = renderer.overrideBlockTexture;
|
||||
BusRenderer.INSTANCE.renderer.renderAllFaces = true;
|
||||
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
|
||||
BusRenderer.INSTANCE.renderer.overrideBlockTexture = renderer.overrideBlockTexture;
|
||||
((TileCableBus) t).cb.renderStatic( x, y, z );
|
||||
BusRenderer.instance.renderer.renderAllFaces = false;
|
||||
BusRenderer.INSTANCE.renderer.renderAllFaces = false;
|
||||
}
|
||||
|
||||
return BusRenderHelper.instance.getItemsRendered() > 0;
|
||||
return BusRenderHelper.INSTANCE.getItemsRendered() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,7 +66,7 @@ public class RendererCableBus extends BaseBlockRender
|
||||
{
|
||||
if ( t instanceof TileCableBus )
|
||||
{
|
||||
BusRenderer.instance.renderer.overrideBlockTexture = null;
|
||||
BusRenderer.INSTANCE.renderer.overrideBlockTexture = null;
|
||||
((TileCableBus) t).cb.renderDynamic( x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LightningArcFX extends LightningFX
|
||||
{
|
||||
private static final Random RANDOM_GENERATOR = new Random();
|
||||
|
||||
final double rx;
|
||||
final double ry;
|
||||
@@ -48,9 +51,9 @@ public class LightningArcFX extends LightningFX
|
||||
double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ );
|
||||
for (int s = 0; s < this.steps; s++)
|
||||
{
|
||||
this.Steps[s][0] = (lastDirectionX + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
this.Steps[s][1] = (lastDirectionY + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
this.Steps[s][2] = (lastDirectionZ + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
this.Steps[s][0] = (lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
this.Steps[s][1] = (lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
this.Steps[s][2] = (lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5) * len * 1.2) / 2.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class LightningFX extends EntityFX
|
||||
{
|
||||
|
||||
final int steps = this.getSteps();
|
||||
static final Random rng = new Random();
|
||||
private static final Random RANDOM_GENERATOR = new Random();
|
||||
final double[][] Steps;
|
||||
|
||||
protected LightningFX(World w, double x, double y, double z, double r, double g, double b, int maxAge) {
|
||||
@@ -64,14 +64,14 @@ public class LightningFX extends EntityFX
|
||||
|
||||
protected void regen()
|
||||
{
|
||||
double lastDirectionX = (rng.nextDouble() - 0.5) * 0.9;
|
||||
double lastDirectionY = (rng.nextDouble() - 0.5) * 0.9;
|
||||
double lastDirectionZ = (rng.nextDouble() - 0.5) * 0.9;
|
||||
double lastDirectionX = ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9;
|
||||
double lastDirectionY = ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9;
|
||||
double lastDirectionZ = ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9;
|
||||
for (int s = 0; s < this.steps; s++)
|
||||
{
|
||||
this.Steps[s][0] = lastDirectionX = (lastDirectionX + (rng.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
this.Steps[s][1] = lastDirectionY = (lastDirectionY + (rng.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
this.Steps[s][2] = lastDirectionZ = (lastDirectionZ + (rng.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
this.Steps[s][0] = lastDirectionX = (lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
this.Steps[s][1] = lastDirectionY = (lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
this.Steps[s][2] = lastDirectionZ = (lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user