Config option ReduceRenderMachines, gl d->f, replace Random in XSTR

This commit is contained in:
Bogdan 2020-01-28 02:36:20 +03:00 committed by maggi373
parent 33537a1772
commit 62e48003e1
56 changed files with 741 additions and 216 deletions

View file

@ -82,6 +82,7 @@ public class MekanismConfig
public static boolean enableAmbientLighting;
public static int ambientLightingLevel;
public static boolean opaqueTransmitters = false;
public static boolean reducerendermachines = false;
}
public static class machines

View file

@ -228,6 +228,7 @@ public class ClientProxy extends CommonProxy
client.enableAmbientLighting = Mekanism.configuration.get("client", "EnableAmbientLighting", true).getBoolean();
client.ambientLightingLevel = Mekanism.configuration.get("client", "AmbientLightingLevel", 15).getInt();
client.opaqueTransmitters = Mekanism.configuration.get("client", "OpaqueTransmitterRender", false).getBoolean();
client.reducerendermachines = Mekanism.configuration.get("client", "ReduceRenderMachines", false).getBoolean();
if(Mekanism.configuration.hasChanged())
{

View file

@ -17,7 +17,7 @@ public class SparkleAnimation
{
public TileEntity pointer;
public Random random = new Random();
public Random random = new org.bogdang.modifications.random.XSTR();
public Set<Coord4D> iteratedNodes = new HashSet<Coord4D>();

View file

@ -58,14 +58,14 @@ public class EntityLaser extends EntityFX
break;
case WEST:
case EAST:
GL11.glRotated(90, 0, 0, 1);
GL11.glRotatef(90f, 0f, 0f, 1f);
break;
case NORTH:
case SOUTH:
GL11.glRotated(90, 1, 0, 0);
GL11.glRotatef(90f, 1f, 0f, 0f);
break;
}
GL11.glRotated(45, 0, 1, 0);
GL11.glRotatef(45f, 0f, 1f, 0f);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, particleAlpha);
tessellator.addVertexWithUV(-particleScale, -length/2, 0, 0, 0);
@ -74,7 +74,7 @@ public class EntityLaser extends EntityFX
tessellator.addVertexWithUV(particleScale, -length/2, 0, 1, 0);
tessellator.draw();
GL11.glRotated(90, 0, 1, 0);
GL11.glRotatef(90f, 0f, 1f, 0f);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, particleAlpha);
tessellator.addVertexWithUV(-particleScale, -length/2, 0, 0, 0);

View file

@ -76,18 +76,23 @@ public class ModelChargepad extends ModelBase
}
public void render(float size, TextureManager manager)
{
render(size, manager, false);
}
public void render(float size, TextureManager manager, boolean inventory)
{
GL11.glPushMatrix();
MekanismRenderer.blendOn();
doRender(size);
doRender(size, inventory);
manager.bindTexture(OVERLAY);
GL11.glScalef(1.001F, 1.001F, 1.001F);
GL11.glTranslatef(0, -0.0011F, 0);
MekanismRenderer.glowOn();
doRender(size);
doRender(size, inventory);
MekanismRenderer.glowOff();
MekanismRenderer.blendOff();
@ -95,14 +100,19 @@ public class ModelChargepad extends ModelBase
}
private void doRender(float size)
{
doRender(size, false);
}
private void doRender(float size, boolean inventory)
{
base.render(size);
port.render(size);
if (!inventory) { port.render(size);
plug.render(size);
connector.render(size);
stand.render(size);
pillar2.render(size);
pillar1.render(size);
pillar1.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -137,11 +137,16 @@ public class ModelChemicalCrystallizer extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
MekanismRenderer.blendOn();
tray.render(size);
support4.render(size);
if (!inventory) { support4.render(size);
rimBack.render(size);
portRight.render(size);
rimRight.render(size);
@ -150,11 +155,11 @@ public class ModelChemicalCrystallizer extends ModelBase
portLeft.render(size);
support3.render(size);
support2.render(size);
support1.render(size);
support1.render(size);}
tank.render(size);
rod1.render(size);
if (!inventory) { rod1.render(size);
rod2.render(size);
rod3.render(size);
rod3.render(size);}
base.render(size);
Shape1.render(size);

View file

@ -228,25 +228,30 @@ public class ModelChemicalDissolutionChamber extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
MekanismRenderer.blendOn();
support2.render(size);
vat5.render(size);
if (!inventory) { vat5.render(size);
top2.render(size);
top.render(size);
top.render(size);}
base.render(size);
vat2.render(size);
if (!inventory) { vat2.render(size);
vat3.render(size);
vat6.render(size);
vat9.render(size);
vat8.render(size);
vat7.render(size);
vat4.render(size);
vat4.render(size);}
backEdge2.render(size);
back.render(size);
backEdge1.render(size);
vents.render(size);
if (!inventory) { vents.render(size);
support1.render(size);
vat1.render(size);
nozzle8.render(size);
@ -260,7 +265,7 @@ public class ModelChemicalDissolutionChamber extends ModelBase
nozzle1.render(size);
glass.render(size);
portToggle1.render(size);
portToggle2.render(size);
portToggle2.render(size);}
MekanismRenderer.blendOff();
}

View file

@ -220,9 +220,14 @@ public class ModelChemicalInfuser extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
base.render(size);
tank2.render(size);
if (!inventory) { tank2.render(size);
portRight.render(size);
portBack.render(size);
portLeft.render(size);
@ -232,9 +237,9 @@ public class ModelChemicalInfuser extends ModelBase
pipeAngle2.render(size);
connectorAngle.render(size);
pipe2.render(size);
connector.render(size);
connector.render(size);}
compressor.render(size);
tube10.render(size);
if (!inventory) { tube10.render(size);
tube8.render(size);
tube9.render(size);
tube7.render(size);
@ -249,7 +254,7 @@ public class ModelChemicalInfuser extends ModelBase
exhaust4.render(size);
exhaust3.render(size);
exhaust2.render(size);
exhaust1.render(size);
exhaust1.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -87,17 +87,22 @@ public class ModelChemicalOxidizer extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
stand.render(size);
tank.render(size);
pipe2.render(size);
if (!inventory) { pipe2.render(size);
bridge.render(size);
pipe1.render(size);
pipe1.render(size);}
tower2.render(size);
tower1.render(size);
base.render(size);
connector.render(size);
connectorToggle.render(size);
if (!inventory) { connector.render(size);
connectorToggle.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -178,10 +178,15 @@ public class ModelChemicalWasher extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
tankBack.render(size);
base.render(size);
portTop.render(size);
if (!inventory) { portTop.render(size);
pipe1.render(size);
pipe2b.render(size);
portRight.render(size);
@ -190,18 +195,18 @@ public class ModelChemicalWasher extends ModelBase
bridge3.render(size);
conduit.render(size);
bridge4.render(size);
pipe2.render(size);
pipe2.render(size);}
tankLeft.render(size);
connectorRight.render(size);
if (!inventory) { connectorRight.render(size);
portLeft.render(size);
connectorLeft.render(size);
connectorLeft.render(size);}
tankRight.render(size);
tubeLeft1.render(size);
if (!inventory) { tubeLeft1.render(size);
tubeLeft2.render(size);
tubeRight3.render(size);
tubeRight1.render(size);
tubeRight2.render(size);
tubeLeft3.render(size);
tubeLeft3.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -423,18 +423,23 @@ public class ModelDigitalMiner extends ModelBase
}
public void render(float size, boolean on, TextureManager manager)
{
render(size, on, manager, false);
}
public void render(float size, boolean on, TextureManager manager, boolean inventory)
{
GL11.glPushMatrix();
MekanismRenderer.blendOn();
doRender(size);
doRender(size, inventory);
manager.bindTexture(on ? OVERLAY_ON : OVERLAY_OFF);
GL11.glScalef(1.001F, 1.001F, 1.001F);
GL11.glTranslatef(0, -0.0011F, 0);
MekanismRenderer.glowOn();
doRender(size);
doRender(size, inventory);
MekanismRenderer.glowOff();
MekanismRenderer.blendOff();
@ -443,7 +448,12 @@ public class ModelDigitalMiner extends ModelBase
private void doRender(float size)
{
keyboard.render(size);
doRender(size, false);
}
private void doRender(float size, boolean inventory)
{
if (!inventory) { keyboard.render(size);
keyboardBottom.render(size);
keyboardSupportExt1.render(size);
keyboardSupportExt2.render(size);
@ -461,10 +471,10 @@ public class ModelDigitalMiner extends ModelBase
monitor2.render(size);
monitor3.render(size);
monitorMount1.render(size);
monitorMount2.render(size);
monitorMount2.render(size);}
frame1.render(size);
frame3.render(size);
plate5.render(size);
if (!inventory) { plate5.render(size);
bracket1.render(size);
bracket2.render(size);
bracket3.render(size);
@ -476,17 +486,17 @@ public class ModelDigitalMiner extends ModelBase
bracketPlate1.render(size);
bracketPlate2.render(size);
bracketPlate3.render(size);
bracketPlate4.render(size);
bracketPlate4.render(size);}
supportBeam1.render(size);
supportBeam2.render(size);
supportBeam3.render(size);
supportBeam4.render(size);
foot1.render(size);
if (!inventory) { foot1.render(size);
foot2.render(size);
foot3.render(size);
foot4.render(size);
foot4.render(size);}
core.render(size);
powerCable1a.render(size);
if (!inventory) { powerCable1a.render(size);
powerCable1b.render(size);
powerCable2.render(size);
powerCable3.render(size);
@ -494,7 +504,7 @@ public class ModelDigitalMiner extends ModelBase
powerConnector2a.render(size);
powerConnector2b.render(size);
powerCpnnector3a.render(size);
powerConnector3b.render(size);
powerConnector3b.render(size);}
frame2a.render(size);
frame2b.render(size);
frame2c.render(size);

View file

@ -158,16 +158,21 @@ public class ModelElectricPump extends ModelBase
public void render(float size)
{
pumpRingTop.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) pumpRingTop.render(size);
pumpPortTop.render(size);
pumpCasing.render(size);
pumpBase.render(size);
powerPort.render(size);
powerConnector.render(size);
powerConnectorFrame4.render(size);
if (!inventory) { powerConnectorFrame4.render(size);
powerConnectorFrame3.render(size);
powerConnectorFrame2.render(size);
powerConnectorFrame1.render(size);
powerConnectorFrame1.render(size);}
/*pipeToggleBack.render(size);
pipeToggleRingBack.render(size);
pipeTogglePortBack.render(size);

View file

@ -136,24 +136,29 @@ public class ModelElectrolyticSeparator extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
tank2.render(size);
tank1.render(size);
tank3.render(size);
tube6.render(size);
if (!inventory) { tube6.render(size);
tube5.render(size);
tube4.render(size);
tube3.render(size);
tube2.render(size);
tube1.render(size);
tube1.render(size);}
base.render(size);
portToggle1.render(size);
if (!inventory) { portToggle1.render(size);
portToggle2a.render(size);
portToggle2b.render(size);
portToggle3a.render(size);
portToggle3b.render(size);
portToggle4a.render(size);
portToggle4b.render(size);
portToggle4b.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -352,6 +352,11 @@ public class ModelEnergyCube extends ModelBase
}
public void render(float size, EnergyCubeTier tier, TextureManager manager)
{
render(size, tier, manager, false);
}
public void render(float size, EnergyCubeTier tier, TextureManager manager, boolean inventory)
{
frame12.render(size);
frame11.render(size);
@ -366,14 +371,14 @@ public class ModelEnergyCube extends ModelBase
frame2.render(size);
frame1.render(size);
corner8.render(size);
if (!inventory) { corner8.render(size);
corner7.render(size);
corner6.render(size);
corner5.render(size);
corner4.render(size);
corner3.render(size);
corner2.render(size);
corner1.render(size);
corner1.render(size);}
GL11.glPushMatrix();
GL11.glScalef(1.0001F, 1.0001F, 1.0001F);
@ -381,14 +386,14 @@ public class ModelEnergyCube extends ModelBase
manager.bindTexture(RenderEnergyCube.resources.get(tier));
MekanismRenderer.glowOn();
corner8.render(size);
if (!inventory) { corner8.render(size);
corner7.render(size);
corner6.render(size);
corner5.render(size);
corner4.render(size);
corner3.render(size);
corner2.render(size);
corner1.render(size);
corner1.render(size);}
MekanismRenderer.glowOff();
GL11.glPopMatrix();
@ -452,7 +457,12 @@ public class ModelEnergyCube extends ModelBase
public void render(float size)
{
cube.render(0.0625F);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) cube.render(0.0625F);
}
}
}

View file

@ -123,21 +123,26 @@ public class ModelFluidicPlenisher extends ModelBase
public void render(float size)
{
bearingRight.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) { bearingRight.render(size);
ringTank.render(size);
portTop.render(size);
portBack.render(size);
Connector.render(size);
//pipeToggle.render(size);
ringTop.render(size);
ringBottom.render(size);
ringBottom.render(size);}
tank.render(size);
bearingLeft.render(size);
if (!inventory) { bearingLeft.render(size);
connectorRing.render(size);
rod4.render(size);
rod3.render(size);
rod2.render(size);
rod1.render(size);
rod1.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -155,26 +155,31 @@ public class ModelLaser extends ModelBase
public void render(float size)
{
connector.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) connector.render(size);
center.render(size);
shaft.render(size);
ring1.render(size);
if (!inventory) { ring1.render(size);
port.render(size);
rod1.render(size);
fin1.render(size);
fin2.render(size);
fin3.render(size);
fin4.render(size);
ring2.render(size);
ring2.render(size);}
body.render(size);
rod2.render(size);
if (!inventory) { rod2.render(size);
wire.render(size);
rod3.render(size);
fin5.render(size);
fin6.render(size);
fin7.render(size);
fin8.render(size);
rod4.render(size);
rod4.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -67,13 +67,18 @@ public class ModelLaserAmplifier extends ModelBase
public void render(float size)
{
S1.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) { S1.render(size);
S2.render(size);
S3.render(size);
S4.render(size);
S5.render(size);
S5.render(size);}
Base.render(size);
S6.render(size);
if (!inventory) S6.render(size);
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -200,26 +200,31 @@ public class ModelLogisticalSorter extends ModelBase
}
public void render(float size, boolean active)
{
render(size, active, false);
}
public void render(float size, boolean active, boolean inventory)
{
portBack.render(size);
portBackLarge.render(size);
connectorBack.render(size);
if (!inventory) connectorBack.render(size);
portFront.render(size);
ring1.render(size);
if (!inventory) { ring1.render(size);
ring2.render(size);
ring3.render(size);
ring4.render(size);
ring5.render(size);
ring6.render(size);
ring7.render(size);
pistonBar1.render(size);
pistonBar1.render(size);}
pipe.render(size);
pistonBase1.render(size);
pistonBrace1.render(size);
pistonConnector1.render(size);
if (!inventory) pistonConnector1.render(size);
pistonBrace2.render(size);
pistonConnector2.render(size);
pistonBar2.render(size);
if (!inventory) { pistonConnector2.render(size);
pistonBar2.render(size);}
pistonBase2.render(size);
panel2.render(size);
@ -228,10 +233,10 @@ public class ModelLogisticalSorter extends ModelBase
MekanismRenderer.glowOn();
}
led4.render(size);
if (!inventory) { led4.render(size);
led3.render(size);
led2.render(size);
led1.render(size);
led1.render(size);}
if(active)
{

View file

@ -136,24 +136,29 @@ public class ModelMetallurgicInfuser extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
base.render(size);
back.render(size);
connector1.render(size);
connector2.render(size);
if (!inventory) { connector1.render(size);
connector2.render(size);}
sideRight.render(size);
top.render(size);
sideLeft.render(size);
tap1.render(size);
tap2.render(size);
if (!inventory) { tap1.render(size);
tap2.render(size);}
tapBase1.render(size);
tapBase2.render(size);
divider.render(size);
plate1.render(size);
if (!inventory) { plate1.render(size);
plate2.render(size);
plate3.render(size);
bar1.render(size);
bar2.render(size);
bar2.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -87,16 +87,21 @@ public class ModelPressurizedReactionChamber extends ModelBase
}
public void render(float size)
{
render(size, false);
}
public void render(float size, boolean inventory)
{
frontDivider1.render(size);
base.render(size);
front.render(size);
bar1.render(size);
if (!inventory) bar1.render(size);
body.render(size);
bar5.render(size);
if (!inventory) { bar5.render(size);
bar4.render(size);
bar3.render(size);
bar2.render(size);
bar2.render(size);}
frontDivider2.render(size);
}

View file

@ -314,18 +314,23 @@ public class ModelQuantumEntangloporter extends ModelBase
}
public void render(float size, TextureManager manager)
{
render(size, manager, false);
}
public void render(float size, TextureManager manager, boolean inventory)
{
GL11.glPushMatrix();
MekanismRenderer.blendOn();
doRender(size);
doRender(size, inventory);
manager.bindTexture(OVERLAY);
GL11.glScalef(1.001F, 1.001F, 1.001F);
GL11.glTranslatef(0, -0.0011F, 0);
MekanismRenderer.glowOn();
doRender(size);
doRender(size, inventory);
MekanismRenderer.glowOff();
MekanismRenderer.blendOff();
@ -334,14 +339,19 @@ public class ModelQuantumEntangloporter extends ModelBase
public void doRender(float size)
{
portTop.render(size);
doRender(size, false);
}
public void doRender(float size, boolean inventory)
{
if (!inventory) { portTop.render(size);
portBottom.render(size);
portLeft.render(size);
portRight.render(size);
portBack.render(size);
portFront.render(size);
portFront.render(size);}
energyCubeCore.render(size);
frameEdge1.render(size);
if (!inventory) { frameEdge1.render(size);
frameEdge2.render(size);
frameEdge3.render(size);
frameEdge4.render(size);
@ -372,7 +382,7 @@ public class ModelQuantumEntangloporter extends ModelBase
corner5.render(size);
corner6.render(size);
corner7.render(size);
corner8.render(size);
corner8.render(size);}
//portRightLarge.render(size);
//portLeftLarge.render(size);
}

View file

@ -168,18 +168,23 @@ public class ModelResistiveHeater extends ModelBase
}
public void render(float size, boolean on, TextureManager manager)
{
render(size, on, manager, false);
}
public void render(float size, boolean on, TextureManager manager, boolean inventory)
{
GL11.glPushMatrix();
MekanismRenderer.blendOn();
doRender(size);
doRender(size, inventory);
manager.bindTexture(on ? OVERLAY_ON : OVERLAY_OFF);
GL11.glScalef(1.001F, 1.001F, 1.001F);
GL11.glTranslatef(0, -0.0011F, 0);
MekanismRenderer.glowOn();
doRender(size);
doRender(size, inventory);
MekanismRenderer.glowOff();
MekanismRenderer.blendOff();
@ -187,10 +192,15 @@ public class ModelResistiveHeater extends ModelBase
}
private void doRender(float size)
{
doRender(size, false);
}
private void doRender(float size, boolean inventory)
{
wallLeft.render(size);
base.render(size);
fin10.render(size);
if (!inventory) { fin10.render(size);
portRight.render(size);
fin9.render(size);
fin2.render(size);
@ -205,9 +215,9 @@ public class ModelResistiveHeater extends ModelBase
fin1.render(size);
bar1.render(size);
bar4.render(size);
bar3.render(size);
bar3.render(size);}
wallRight.render(size);
portLeft.render(size);
if (!inventory) portLeft.render(size);
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -172,24 +172,29 @@ public class ModelRotaryCondensentrator extends ModelBase
public void render(float size)
{
portRight.render(size);
tankRight.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) { portRight.render(size);
tankRight.render(size);}
base.render(size);
pipe.render(size);
if (!inventory) pipe.render(size);
middle.render(size);
shaft.render(size);
portLeft.render(size);
tankLeft.render(size);
if (!inventory) { portLeft.render(size);
tankLeft.render(size);}
support4.render(size);
bridge.render(size);
tube8.render(size);
if (!inventory) { tube8.render(size);
tube7.render(size);
tube6.render(size);
tube5.render(size);
tube4.render(size);
tube3.render(size);
tube2.render(size);
tube1.render(size);
tube1.render(size);}
top.render(size);
support3.render(size);
support2.render(size);

View file

@ -333,36 +333,41 @@ public class ModelSeismicVibrator extends ModelBase
public void render(float size)
{
plate3.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) plate3.render(size);
baseBack.render(size);
motor.render(size);
port.render(size);
if (!inventory) port.render(size);
pole4.render(size);
shaft2.render(size);
shaft1.render(size);
arm3.render(size);
if (!inventory) { arm3.render(size);
plate2.render(size);
arm2.render(size);
arm1.render(size);
arm1.render(size);}
top.render(size);
frameBack5.render(size);
if (!inventory) frameBack5.render(size);
pole3.render(size);
frameRight5.render(size);
if (!inventory) frameRight5.render(size);
baseRight.render(size);
baseFront.render(size);
baseLeft.render(size);
frameRight3.render(size);
if (!inventory) frameRight3.render(size);
pole1.render(size);
frameRight4.render(size);
if (!inventory) { frameRight4.render(size);
frameRight1.render(size);
frameRight2.render(size);
frameLeft5.render(size);
frameLeft4.render(size);
frameBack3.render(size);
frameLeft2.render(size);
frameLeft1.render(size);
frameLeft1.render(size);}
pole2.render(size);
frameBack1.render(size);
if (!inventory) { frameBack1.render(size);
frameBack2.render(size);
frameBack4.render(size);
frameLeft3.render(size);
@ -377,7 +382,7 @@ public class ModelSeismicVibrator extends ModelBase
rivet3.render(size);
rivet8.render(size);
rivet4.render(size);
rivet9.render(size);
rivet9.render(size);}
}
public void renderWithPiston(float piston, float size)

View file

@ -347,36 +347,41 @@ public class ModelSolarNeutronActivator extends ModelBase
public void render(float size)
{
pole.render(size);
render(size, false);
}
public void render(float size, boolean inventory)
{
if (!inventory) { pole.render(size);
panel3.render(size);
port.render(size);
panel1.render(size);
panel2.render(size);
panel2.render(size);}
panelBase.render(size);
panelBraceLeft2.render(size);
panelBraceRight2.render(size);
panelBraceLeft1.render(size);
panelBraceRight1.render(size);
panelBrace.render(size);
bridge.render(size);
if (!inventory) bridge.render(size);
platform.render(size);
hole2.render(size);
if (!inventory) { hole2.render(size);
hole4.render(size);
hole1.render(size);
hole3.render(size);
hole3.render(size);}
brace2.render(size);
tube2c.render(size);
if (!inventory) { tube2c.render(size);
tube1b.render(size);
tube1c.render(size);
tube2b.render(size);
tube2a.render(size);
tube1a.render(size);
conduit.render(size);
conduit.render(size);}
brace1.render(size);
tank.render(size);
laser.render(size);
if (!inventory) laser.render(size);
base.render(size);
support1.render(size);
if (!inventory) { support1.render(size);
support2.render(size);
support3.render(size);
support4.render(size);
@ -393,7 +398,7 @@ public class ModelSolarNeutronActivator extends ModelBase
support15.render(size);
support16.render(size);
portConnector.render(size);
laserBeamToggle.render(size);
laserBeamToggle.render(size);}
}
private void setRotation(ModelRenderer model, float x, float y, float z)

View file

@ -527,7 +527,11 @@ public class MekanismRenderer
public static void renderCustomItem(RenderBlocks renderer, ItemStack stack)
{
//if (mekanism.api.MekanismConfig.client.reducerendermachines) renderItem(stack);
/*if (mekanism.api.MekanismConfig.client.reducerendermachines) {
Block block = Block.getBlockFromItem(stack.getItem());
if (block instanceof ICustomBlockIcon) RenderManager.instance.itemRenderer.renderItemIn2D(Tessellator.instance, ((ICustomBlockIcon)block).getIcon(stack, 2).getMaxU(), ((ICustomBlockIcon)block).getIcon(stack, 2).getMinV(), ((ICustomBlockIcon)block).getIcon(stack, 2).getMinU(), ((ICustomBlockIcon)block).getIcon(stack, 2).getMaxV(), ((ICustomBlockIcon)block).getIcon(stack, 2).getIconWidth(), ((ICustomBlockIcon)block).getIcon(stack, 2).getIconHeight(), 0.0625F);
} else {*/Block block = Block.getBlockFromItem(stack.getItem());
if(block instanceof ICustomBlockIcon)
{
@ -535,6 +539,76 @@ public class MekanismRenderer
prepareItemRender(renderer, stack.getItemDamage(), Block.getBlockFromItem(stack.getItem()));
try {
//if (!mekanism.api.MekanismConfig.client.reducerendermachines) {
if (mekanism.api.MekanismConfig.client.reducerendermachines) {
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, custom.getIcon(stack, 1));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, custom.getIcon(stack, 2));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, custom.getIcon(stack, 4));
tessellator.draw();
//GL11.glPushMatrix();
double xStart = 0, yStart = 0;
double xEnd = 1, yEnd = 1;
double z = 1;
float nx = 0f, ny = 0f, nz = 0f;
IIcon icon = custom.getIcon(stack, 2);
float minU = icon.getMinU();
float maxU = icon.getMaxU();
float minV = icon.getMinV();
float maxV = icon.getMaxV();
/*tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)maxU, (double)maxV);
tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)minU, (double)maxV);
tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)minU, (double)minV);
tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)maxU, (double)minV);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - 0.0625F), (double)maxU, (double)minV);
tessellator.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - 0.0625F), (double)minU, (double)minV);
tessellator.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - 0.0625F), (double)minU, (double)maxV);
tessellator.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - 0.0625F), (double)maxU, (double)maxV);
tessellator.draw();*/
/*tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
//0.5000098 0.5156152 0.71876955 0.74998045
tessellator.addVertexWithUV(0D, 1D, z, minU, maxV);
tessellator.addVertexWithUV(1D, 1D, z, maxU, maxV);
tessellator.addVertexWithUV(1D, 0D, z, maxU, minV);
tessellator.addVertexWithUV(0D, 0D, z, minU, minV);*/
/*tessellator.setNormal(nx, ny, nz);
if (nz > 0.0F)
{
tessellator.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
}
else
{
tessellator.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
tessellator.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
}*/
/*tessellator.draw();*/
GL11.glPopMatrix();
} else {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
@ -559,11 +633,34 @@ public class MekanismRenderer
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, custom.getIcon(stack, 5));
/*} else {
Tessellator tessellator = Tessellator.instance;
IIcon iicon = custom.getIcon(stack, 0);
float minU = iicon.getMinU();
float maxU = iicon.getMaxU();
float minV = iicon.getMinV();
float maxV = iicon.getMaxV();
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)maxU, (double)maxV);
tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)minU, (double)maxV);
tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)minU, (double)minV);
tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)maxU, (double)minV);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - 0.0625F), (double)maxU, (double)minV);
tessellator.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - 0.0625F), (double)minU, (double)minV);
tessellator.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - 0.0625F), (double)minU, (double)maxV);
tessellator.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - 0.0625F), (double)maxU, (double)maxV);
tessellator.draw();
}*/}
} catch(Exception e) {}
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
//}
}
/**
@ -578,6 +675,21 @@ public class MekanismRenderer
prepareItemRender(renderer, metadata, block);
try {
if (mekanism.api.MekanismConfig.client.reducerendermachines) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, metadata));
tessellator.draw();
} else {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
@ -603,6 +715,7 @@ public class MekanismRenderer
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
tessellator.draw();
}
} catch(Exception e) {}
GL11.glTranslatef(0.5F, 0.5F, 0.5F);

View file

@ -27,7 +27,7 @@ public final class MinerVisualRenderer
public static void render(TileEntityDigitalMiner miner)
{
GL11.glPushMatrix();
GL11.glTranslated(getX(miner.xCoord), getY(miner.yCoord), getZ(miner.zCoord));
GL11.glTranslatef((float)getX(miner.xCoord), (float)getY(miner.yCoord), (float)getZ(miner.zCoord));
MekanismRenderer.blendOn();
MekanismRenderer.glowOn();
GL11.glEnable(GL11.GL_CULL_FACE);

View file

@ -178,7 +178,7 @@ public class RenderPartTransmitter implements IIconSelfRegister
float[] pos = TransporterUtils.getStackPosition(transporter.getTransmitter(), stack, partialTick*transporter.tier.speed);
GL11.glTranslated(vec.x + pos[0], vec.y + pos[1] - entityItem.yOffset, vec.z + pos[2]);
GL11.glTranslatef((float)vec.x + pos[0], (float)vec.y + pos[1] - entityItem.yOffset, (float)vec.z + pos[2]);
GL11.glScalef(0.75F, 0.75F, 0.75F);
renderer.doRender(entityItem, 0, 0, 0, 0, 0);
@ -250,7 +250,7 @@ public class RenderPartTransmitter implements IIconSelfRegister
CCRenderState.reset();
CCRenderState.useNormals = true;
CCRenderState.startDrawing();
GL11.glTranslated(pos.x, pos.y, pos.z);
GL11.glTranslatef((float)pos.x, (float)pos.y, (float)pos.z);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
@ -274,7 +274,7 @@ public class RenderPartTransmitter implements IIconSelfRegister
CCRenderState.reset();
CCRenderState.useNormals = true;
CCRenderState.startDrawing();
GL11.glTranslated(pos.x, pos.y, pos.z);
GL11.glTranslatef((float)pos.x, (float)pos.y, (float)pos.z);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
@ -332,7 +332,7 @@ public class RenderPartTransmitter implements IIconSelfRegister
MekanismRenderer.colorFluid(fluid);
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
GL11.glTranslated(pos.x, pos.y, pos.z);
GL11.glTranslatef((float)pos.x, (float)pos.y, (float)pos.z);
boolean gas = fluid.isGaseous();
@ -520,7 +520,7 @@ public class RenderPartTransmitter implements IIconSelfRegister
CCRenderState.reset();
CCRenderState.useNormals = true;
CCRenderState.startDrawing();
GL11.glTranslated(pos.x, pos.y, pos.z);
GL11.glTranslatef((float)pos.x, (float)pos.y, (float)pos.z);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{

View file

@ -33,7 +33,7 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderTickHandler
{
public Random rand = new Random();
public Random rand = new org.bogdang.modifications.random.XSTR();
public Minecraft mc = Minecraft.getMinecraft();
@SubscribeEvent

View file

@ -87,6 +87,7 @@ public class BasicRenderingHandler implements ISimpleBlockRenderingHandler
@Override
public boolean shouldRender3DInInventory(int modelId)
{
if (mekanism.api.MekanismConfig.client.reducerendermachines) return false;
return true;
}
}

View file

@ -91,6 +91,7 @@ public class CTMRenderingHandler implements ISimpleBlockRenderingHandler
@Override
public boolean shouldRender3DInInventory(int renderId)
{
if (mekanism.api.MekanismConfig.client.reducerendermachines) return false;
return true;
}

View file

@ -80,7 +80,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.png"));
electricPump.render(0.0560F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) electricPump.render(0.0560F, true);
else electricPump.render(0.0560F);
}
else if(type == MachineType.METALLURGIC_INFUSER)
{
@ -88,14 +89,16 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "MetallurgicInfuser.png"));
metallurgicInfuser.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) metallurgicInfuser.render(0.0625F, true);
else metallurgicInfuser.render(0.0625F);
}
else if(type == MachineType.CHARGEPAD)
{
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "Chargepad.png"));
chargepad.render(0.0625F, mc.renderEngine);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chargepad.render(0.0625F, mc.renderEngine, true);
else chargepad.render(0.0625F, mc.renderEngine);
}
else if(type == MachineType.LOGISTICAL_SORTER)
{
@ -103,7 +106,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalSorter.png"));
logisticalSorter.render(0.0625F, false);
if (mekanism.api.MekanismConfig.client.reducerendermachines) logisticalSorter.render(0.0625F, false, true);
else logisticalSorter.render(0.0625F, false);
}
else if(type == MachineType.DIGITAL_MINER)
{
@ -111,7 +115,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(-180F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.35F, 0.1F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner.png"));
digitalMiner.render(0.022F, false, mc.renderEngine);
if (mekanism.api.MekanismConfig.client.reducerendermachines) digitalMiner.render(0.022F, false, mc.renderEngine, true);
else digitalMiner.render(0.022F, false, mc.renderEngine);
}
else if(type == MachineType.ROTARY_CONDENSENTRATOR)
{
@ -119,7 +124,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RotaryCondensentrator.png"));
rotaryCondensentrator.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) rotaryCondensentrator.render(0.0625F, true);
else rotaryCondensentrator.render(0.0625F);
}
else if(type == MachineType.CHEMICAL_OXIDIZER)
{
@ -127,7 +133,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.00F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalOxidizer.png"));
chemicalOxidizer.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chemicalOxidizer.render(0.0625F, true);
else chemicalOxidizer.render(0.0625F);
}
else if(type == MachineType.CHEMICAL_INFUSER)
{
@ -135,15 +142,17 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180f, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalInfuser.png"));
chemicalInfuser.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chemicalInfuser.render(0.0625F, true);
else chemicalInfuser.render(0.0625F);
}
else if(type == MachineType.ELECTROLYTIC_SEPARATOR)
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
GL11.glTranslated(0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectrolyticSeparator.png"));
electrolyticSeparator.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) electrolyticSeparator.render(0.0625F, true);
else electrolyticSeparator.render(0.0625F);
}
else if(type == MachineType.CHEMICAL_DISSOLUTION_CHAMBER)
{
@ -151,7 +160,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalDissolutionChamber.png"));
chemicalDissolutionChamber.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chemicalDissolutionChamber.render(0.0625F, true);
else chemicalDissolutionChamber.render(0.0625F);
}
else if(type == MachineType.CHEMICAL_WASHER)
{
@ -159,7 +169,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalWasher.png"));
chemicalWasher.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chemicalWasher.render(0.0625F, true);
else chemicalWasher.render(0.0625F);
}
else if(type == MachineType.CHEMICAL_CRYSTALLIZER)
{
@ -167,7 +178,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalCrystallizer.png"));
chemicalCrystallizer.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) chemicalCrystallizer.render(0.0625F, true);
else chemicalCrystallizer.render(0.0625F);
}
else if(type == MachineType.SEISMIC_VIBRATOR)
{
@ -176,7 +188,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glScalef(0.6F, 0.6F, 0.6F);
GL11.glTranslatef(0.0F, -0.55F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SeismicVibrator.png"));
seismicVibrator.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) seismicVibrator.render(0.0625F, true);
else seismicVibrator.render(0.0625F);
}
else if(type == MachineType.PRESSURIZED_REACTION_CHAMBER)
{
@ -184,7 +197,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "PressurizedReactionChamber.png"));
pressurizedReactionChamber.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) pressurizedReactionChamber.render(0.0625F, true);
else pressurizedReactionChamber.render(0.0625F);
}
else if(type == MachineType.FLUIDIC_PLENISHER)
{
@ -192,7 +206,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "FluidicPlenisher.png"));
fluidicPlenisher.render(0.0560F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) fluidicPlenisher.render(0.0560F, true);
else fluidicPlenisher.render(0.0560F);
}
else if(type == MachineType.LASER)
{
@ -200,7 +215,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "Laser.png"));
laser.render(0.0560F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) laser.render(0.0560F, true);
else laser.render(0.0560F);
}
else if(type == MachineType.LASER_AMPLIFIER)
{
@ -208,7 +224,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LaserAmplifier.png"));
laserAmplifier.render(0.0560F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) laserAmplifier.render(0.0560F, true);
else laserAmplifier.render(0.0560F);
}
else if(type == MachineType.LASER_TRACTOR_BEAM)
{
@ -216,7 +233,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LaserTractorBeam.png"));
laserAmplifier.render(0.0560F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) laserAmplifier.render(0.0560F, true);
else laserAmplifier.render(0.0560F);
}
else if(type == MachineType.RESISTIVE_HEATER)
{
@ -224,7 +242,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.05F, -0.96F, 0.05F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ResistiveHeater.png"));
resistiveHeater.render(0.0625F, false, mc.renderEngine);
if (mekanism.api.MekanismConfig.client.reducerendermachines) resistiveHeater.render(0.0625F, false, mc.renderEngine, true);
else resistiveHeater.render(0.0625F, false, mc.renderEngine);
}
else if(type == MachineType.SOLAR_NEUTRON_ACTIVATOR)
{
@ -233,7 +252,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glScalef(0.6F, 0.6F, 0.6F);
GL11.glTranslatef(0.0F, -0.55F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SolarNeutronActivator.png"));
solarNeutronActivator.render(0.0625F);
if (mekanism.api.MekanismConfig.client.reducerendermachines) solarNeutronActivator.render(0.0625F, true);
else solarNeutronActivator.render(0.0625F);
}
else if(type == MachineType.QUANTUM_ENTANGLOPORTER)
{
@ -241,7 +261,8 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "QuantumEntangloporter.png"));
quantumEntangloporter.render(0.0625F, mc.renderEngine);
if (mekanism.api.MekanismConfig.client.reducerendermachines) quantumEntangloporter.render(0.0625F, mc.renderEngine, true);
else quantumEntangloporter.render(0.0625F, mc.renderEngine);
}
else {
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
@ -261,6 +282,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
@Override
public boolean shouldRender3DInInventory(int modelId)
{
if (mekanism.api.MekanismConfig.client.reducerendermachines) return false;
return true;
}

View file

@ -91,6 +91,7 @@ public class PlasticRenderingHandler implements ISimpleBlockRenderingHandler
@Override
public boolean shouldRender3DInInventory(int modelId)
{
if (mekanism.api.MekanismConfig.client.reducerendermachines) return false;
return true;
}
}

View file

@ -53,7 +53,7 @@ public class RenderBalloon extends Render
public void render(EnumColor color, double x, double y, double z)
{
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glRotatef(180, 1, 0, 0);
GL11.glTranslatef(0, 0.9F, 0);

View file

@ -137,7 +137,7 @@ public class ItemRenderingHandler implements IItemRenderer
MekanismRenderer.blendOn();
energyCube.render(0.0625F, tier, mc.renderEngine);
energyCube.render(0.0625F, tier, mc.renderEngine, true);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
@ -148,7 +148,7 @@ public class ItemRenderingHandler implements IItemRenderer
MekanismRenderer.blendOff();
GL11.glPushMatrix();
GL11.glTranslated(0.0, 1.0, 0.0);
GL11.glTranslatef(0.0f, 1.0f, 0.0f);
mc.renderEngine.bindTexture(RenderEnergyCube.coreTexture);
GL11.glShadeModel(GL11.GL_SMOOTH);
@ -165,7 +165,7 @@ public class ItemRenderingHandler implements IItemRenderer
GL11.glTranslatef(0, (float)Math.sin(Math.toRadians((MekanismClient.ticksPassed + MekanismRenderer.getPartialTick()) * 3)) / 7, 0);
GL11.glRotatef((MekanismClient.ticksPassed + MekanismRenderer.getPartialTick()) * 4, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + MekanismRenderer.getPartialTick()) * 4, 0, 1, 1);
energyCore.render(0.0625F);
energyCore.render(0.0625F, true);
GL11.glPopMatrix();
MekanismRenderer.glowOff();
@ -225,7 +225,7 @@ public class ItemRenderingHandler implements IItemRenderer
GL11.glTranslatef(-0.22F, -0.2F, -0.22F);
}
GL11.glTranslated(0.73, 0.08, 0.44);
GL11.glTranslatef(0.73f, 0.08f, 0.44f);
GL11.glRotatef(90, 0, 1, 0);
float scale = 0.03125F;
@ -260,7 +260,7 @@ public class ItemRenderingHandler implements IItemRenderer
if(type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.ENTITY)
{
GL11.glTranslated(-0.5, -0.4, -0.5);
GL11.glTranslatef(-0.5f, -0.4f, -0.5f);
}
GL11.glTranslatef(0, 0.9F, 1);
@ -467,7 +467,7 @@ public class ItemRenderingHandler implements IItemRenderer
else if(item.getItem() instanceof ItemPartTransmitter)
{
GL11.glPushMatrix();
GL11.glTranslated(-0.5, -0.5, -0.5);
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
MekanismRenderer.blendOn();
GL11.glDisable(GL11.GL_CULL_FACE);
RenderPartTransmitter.getInstance().renderItem(TransmitterType.values()[item.getItemDamage()]);
@ -479,11 +479,11 @@ public class ItemRenderingHandler implements IItemRenderer
{
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glTranslated(-0.5, -0.5, -0.5);
double d = 0.15;
GL11.glTranslated(d, d, d);
GL11.glScaled(2, 2, 2);
GL11.glTranslated(0.4-2*d, -2*d, -2*d);
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
float d = 0.15f;
GL11.glTranslatef(d, d, d);
GL11.glScalef(2, 2, 2);
GL11.glTranslatef(0.4f-2f*d, -2f*d, -2f*d);
GL11.glDisable(GL11.GL_CULL_FACE);
RenderHelper.disableStandardItemLighting();
RenderGlowPanel.getInstance().renderItem(item.getItemDamage());

View file

@ -59,18 +59,18 @@ public class RenderBin extends TileEntitySpecialRenderer
switch(ForgeDirection.getOrientation(tileEntity.facing))
{
case NORTH:
GL11.glTranslated(x + 0.73, y + 0.83, z - 0.01);
GL11.glTranslatef((float)x + 0.73f, (float)y + 0.83f, (float)z - 0.01f);
break;
case SOUTH:
GL11.glTranslated(x + 0.27, y + 0.83, z + 1.01);
GL11.glTranslatef((float)x + 0.27f, (float)y + 0.83f, (float)z + 1.01f);
GL11.glRotatef(180, 0, 1, 0);
break;
case WEST:
GL11.glTranslated(x - 0.01, y + 0.83, z + 0.27);
GL11.glTranslatef((float)x - 0.01f, (float)y + 0.83f, (float)z + 0.27f);
GL11.glRotatef(90, 0, 1, 0);
break;
case EAST:
GL11.glTranslated(x + 1.01, y + 0.83, z + 0.73);
GL11.glTranslatef((float)x + 1.01f, (float)y + 0.83f, (float)z + 0.73f);
GL11.glRotatef(-90, 0, 1, 0);
break;
}
@ -107,7 +107,7 @@ public class RenderBin extends TileEntitySpecialRenderer
float displayWidth = 1 - (2 / 16);
float displayHeight = 1 - (2 / 16);
GL11.glTranslated(x, y, z);
GL11.glTranslatef((float)x, (float)y, (float)z);
switch(side)
{

View file

@ -52,7 +52,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(data.location.xCoord), getY(data.location.yCoord), getZ(data.location.zCoord));
GL11.glTranslatef((float)getX(data.location.xCoord), (float)getY(data.location.yCoord), (float)getZ(data.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());
MekanismRenderer.colorFluid(tileEntity.structure.fluidStored.getFluid());
@ -77,7 +77,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(valveData.location.xCoord), getY(valveData.location.yCoord), getZ(valveData.location.zCoord));
GL11.glTranslatef((float)getX(valveData.location.xCoord), (float)getY(valveData.location.yCoord), (float)getZ(valveData.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());

View file

@ -92,7 +92,7 @@ public class RenderEnergyCube extends TileEntitySpecialRenderer
if(tileEntity.getEnergy()/tileEntity.getMaxEnergy() > 0.1)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
GL11.glTranslatef((float)x + 0.5f, (float)y + 0.5f, (float)z + 0.5f);
bindTexture(coreTexture);
MekanismRenderer.blendOn();

View file

@ -50,7 +50,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer
push();
bindTexture(MekanismRenderer.getBlocksTexture());
GL11.glTranslated(x, y, z);
GL11.glTranslatef((float)x, (float)y, (float)z);
MekanismRenderer.glowOn(fluid.getLuminosity());
MekanismRenderer.colorFluid(fluid);
@ -77,7 +77,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer
push();
bindTexture(MekanismRenderer.getBlocksTexture());
GL11.glTranslated(x, y, z);
GL11.glTranslatef((float)x, (float)y, (float)z);
MekanismRenderer.glowOn(valveFluid.getLuminosity());
MekanismRenderer.colorFluid(valveFluid);

View file

@ -49,7 +49,7 @@ public class RenderThermalEvaporationController extends TileEntitySpecialRendere
push();
GL11.glTranslated(getX(renderLoc.xCoord), getY(renderLoc.yCoord), getZ(renderLoc.zCoord));
GL11.glTranslatef((float)getX(renderLoc.xCoord), (float)getY(renderLoc.yCoord), (float)getZ(renderLoc.zCoord));
MekanismRenderer.glowOn(tileEntity.inputTank.getFluid().getFluid().getLuminosity());

View file

@ -59,7 +59,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(data.location.xCoord), getY(data.location.yCoord), getZ(data.location.zCoord));
GL11.glTranslatef((float)getX(data.location.xCoord), (float)getY(data.location.yCoord), (float)getZ(data.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.waterStored.getFluid().getLuminosity());
MekanismRenderer.colorFluid(tileEntity.structure.waterStored.getFluid());
@ -84,7 +84,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(valveData.location.xCoord), getY(valveData.location.yCoord), getZ(valveData.location.zCoord));
GL11.glTranslatef((float)getX(valveData.location.xCoord), (float)getY(valveData.location.yCoord), (float)getZ(valveData.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.waterStored.getFluid().getLuminosity());
@ -113,7 +113,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(data.location.xCoord), getY(data.location.yCoord), getZ(data.location.zCoord));
GL11.glTranslatef((float)getX(data.location.xCoord), (float)getY(data.location.yCoord), (float)getZ(data.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.steamStored.getFluid().getLuminosity());
MekanismRenderer.colorFluid(tileEntity.structure.steamStored.getFluid());

View file

@ -105,7 +105,7 @@ public class CommonWorldTickHandler
break;
}
Random fmlRandom = new Random(world.getSeed());
Random fmlRandom = new org.bogdang.modifications.random.XSTR(world.getSeed());
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
fmlRandom.setSeed((xSeed*nextChunk.chunkXPos + zSeed*nextChunk.chunkZPos) ^ world.getSeed());

View file

@ -28,7 +28,7 @@ public class EntityObsidianTNT extends Entity
setPosition(x, y, z);
float randPi = (float)(Math.random()*Math.PI*2);
float randPi = (float)((new org.bogdang.modifications.random.XSTR()).nextFloat()*Math.PI*2);
motionX = -(Math.sin(randPi))*0.02F;
motionY = 0.2;

View file

@ -439,7 +439,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
for(int l = 0; l < 8; l++)
{
world.spawnParticle("largesmoke", x + Math.random(), y + Math.random(), z + Math.random(), 0.0D, 0.0D, 0.0D);
world.spawnParticle("largesmoke", x + (new org.bogdang.modifications.random.XSTR()).nextFloat(), y + (new org.bogdang.modifications.random.XSTR()).nextFloat(), z + (new org.bogdang.modifications.random.XSTR()).nextFloat(), 0.0D, 0.0D, 0.0D);
}
}
else {

View file

@ -46,7 +46,7 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool
public final int ENERGY_PER_CONFIGURE = 400;
public final int ENERGY_PER_ITEM_DUMP = 8;
private Random random = new Random();
private Random random = new org.bogdang.modifications.random.XSTR();
public ItemConfigurator()
{

View file

@ -19,7 +19,7 @@ public class PacketPortalFX implements IMessageHandler<PortalFXMessage, IMessage
{
EntityPlayer player = PacketHandler.getPlayer(context);
Random random = new Random();
Random random = new org.bogdang.modifications.random.XSTR();
for(int i = 0; i < 50; i++)
{

View file

@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
public class ChanceOutput extends MachineOutput<ChanceOutput>
{
private static Random rand = new Random();
private static Random rand = new org.bogdang.modifications.random.XSTR();
public ItemStack primaryOutput;

View file

@ -23,7 +23,7 @@ public class TileEntityAmbientAccumulator extends TileEntityContainerBlock imple
public int cachedDimensionId = 0;
public AmbientGasRecipe cachedRecipe;
public static Random gasRand = new Random();
public static Random gasRand = new org.bogdang.modifications.random.XSTR();
public TileEntityAmbientAccumulator()
{

View file

@ -35,7 +35,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
public boolean prevActive;
public Random random = new Random();
public Random random = new org.bogdang.modifications.random.XSTR();
public TileEntityChargepad()
{

View file

@ -11,7 +11,7 @@ import java.util.Random;
public class StatUtils
{
public static Random rand = new Random();
public static Random rand = new org.bogdang.modifications.random.XSTR();
public static int inversePoisson(double mean)
{

View file

@ -45,7 +45,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
if(metadata == GeneratorType.BIO_GENERATOR.meta)
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslated(0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "BioGenerator.png"));
bioGenerator.render(0.0625F);
}
@ -61,14 +61,14 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
GL11.glTranslated(0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SolarGenerator.png"));
solarGenerator.render(0.0625F);
}
else if(metadata == GeneratorType.HEAT_GENERATOR.meta)
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslated(0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "HeatGenerator.png"));
heatGenerator.render(0.0625F, false, mc.renderEngine);
}
@ -76,7 +76,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
{
GL11.glRotatef(180F, 0.0F, 1.0F, 1.0F);
GL11.glRotatef(90F, -1.0F, 0.0F, 0.0F);
GL11.glTranslated(0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "GasGenerator.png"));
gasGenerator.render(0.0625F);

View file

@ -75,7 +75,7 @@ public class RenderIndustrialTurbine extends TileEntitySpecialRenderer
{
push();
GL11.glTranslated(getX(data.location.xCoord), getY(data.location.yCoord), getZ(data.location.zCoord));
GL11.glTranslatef((float)getX(data.location.xCoord), (float)getY(data.location.yCoord), (float)getZ(data.location.zCoord));
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());
MekanismRenderer.colorFluid(tileEntity.structure.fluidStored.getFluid());

View file

@ -31,34 +31,34 @@ public class RenderReactor extends TileEntitySpecialRenderer
if(tileEntity.isBurning())
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y - 1.5, z + 0.5);
GL11.glTranslatef((float)x + 0.5f, (float)y - 1.5f, (float)z + 0.5f);
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "EnergyCore.png"));
MekanismRenderer.blendOn();
MekanismRenderer.glowOn();
EnumColor c;
double scale;
float scale;
long scaledTemp = Math.round(tileEntity.getPlasmaTemp() / 1E8);
c = EnumColor.AQUA;
GL11.glPushMatrix();
scale = 1 + 0.7 * Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 3.14 * scaledTemp + 135F));
GL11.glScaled(scale, scale, scale);
scale = 1f + 0.7f * (float)Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 3.14 * scaledTemp + 135F));
GL11.glScalef(scale, scale, scale);
GL11.glColor4f(c.getColor(0), c.getColor(1), c.getColor(2), 1);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * -6 * scaledTemp, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + partialTick) * -7 * scaledTemp, 0, 1, 1);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * -6f * scaledTemp, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + partialTick) * -7f * scaledTemp, 0, 1, 1);
core.render(0.0625F);
GL11.glPopMatrix();
c = EnumColor.RED;
GL11.glPushMatrix();
scale = 1 + 0.8 * Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 3 * scaledTemp));
GL11.glScaled(scale, scale, scale);
scale = 1f + 0.8f * (float)Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 3f * scaledTemp));
GL11.glScalef(scale, scale, scale);
GL11.glColor4f(c.getColor(0), c.getColor(1), c.getColor(2), 1);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * 4 * scaledTemp, 0, 1, 0);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * 4f * scaledTemp, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + partialTick) * 4 * scaledTemp, 0, 1, 1);
core.render(0.0625F);
GL11.glPopMatrix();
@ -66,11 +66,11 @@ public class RenderReactor extends TileEntitySpecialRenderer
c = EnumColor.ORANGE;
GL11.glPushMatrix();
scale = 1 - 0.9 * Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 4 * scaledTemp + 90F));
GL11.glScaled(scale, scale, scale);
scale = 1f - 0.9f * (float)Math.sin(Math.toRadians((MekanismClient.ticksPassed + partialTick) * 4 * scaledTemp + 90F));
GL11.glScalef(scale, scale, scale);
GL11.glColor4f(c.getColor(0), c.getColor(1), c.getColor(2), 1);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * 5 * scaledTemp - 35F, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + partialTick) * -3 * scaledTemp + 70F, 0, 1, 1);
GL11.glRotatef((MekanismClient.ticksPassed + partialTick) * 5f * scaledTemp - 35F, 0, 1, 0);
GL11.glRotatef(36F + (MekanismClient.ticksPassed + partialTick) * -3f * scaledTemp + 70F, 0, 1, 1);
core.render(0.0625F);
GL11.glPopMatrix();

View file

@ -57,7 +57,7 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer
if(tileEntity.getHousedBlades() > 0)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y - 1, z + 0.5);
GL11.glTranslatef((float)x + 0.5f, (float)y - 1f, (float)z + 0.5f);
GL11.glRotatef(tileEntity.rotationLower, 0.0F, 1.0F, 0.0F);
model.render(0.0625F, baseIndex);
GL11.glPopMatrix();
@ -66,7 +66,7 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer
if(tileEntity.getHousedBlades() == 2)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y - 0.5, z + 0.5);
GL11.glTranslatef((float)x + 0.5f, (float)y - 0.5f, (float)z + 0.5f);
GL11.glRotatef(tileEntity.rotationUpper, 0.0F, 1.0F, 0.0F);
model.render(0.0625F, baseIndex+1);
GL11.glPopMatrix();

View file

@ -91,7 +91,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
public IIcon BASE_ICON;
public Random machineRand = new Random();
public Random machineRand = new org.bogdang.modifications.random.XSTR();
public BlockGenerator()
{

View file

@ -0,0 +1,255 @@
package org.bogdang.modifications.random;
import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
/**
* A subclass of java.util.random that implements the Xorshift random number
* generator
*
* - it is 30% faster than the generator from Java's library - it produces
* random sequences of higher quality than java.util.Random - this class also
* provides a clone() function
*
* Usage: XSRandom rand = new XSRandom(); //Instantiation x = rand.nextInt();
* //pull a random number
*
* To use the class in legacy code, you may also instantiate an XSRandom object
* and assign it to a java.util.Random object: java.util.Random rand = new
* XSRandom();
*
* for an explanation of the algorithm, see
* http://demesos.blogspot.com/2011/09/pseudo-random-number-generators.html
*
* @author Wilfried Elmenreich University of Klagenfurt/Lakeside Labs
* http://www.elmenreich.tk
*
* This code is released under the GNU Lesser General Public License Version 3
* http://www.gnu.org/licenses/lgpl-3.0.txt
*/
/**
* XSTR - Xorshift ThermiteRandom
* Modified by Bogdan-G
* 03.06.2016
* version 0.0.4
*/
public class XSTR extends Random {
private static final long serialVersionUID = 6208727693524452904L;
private long seed;
private long last;
private static final long GAMMA = 0x9e3779b97f4a7c15L;
private static final int PROBE_INCREMENT = 0x9e3779b9;
private static final long SEEDER_INCREMENT = 0xbb67ae8584caa73bL;
private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53)
private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24)
/*
MODIFIED BY: Robotia
Modification: Implemented Random class seed generator
*/
/**
* Creates a new pseudo random number generator. The seed is initialized to
* the current time, as if by
* <code>setSeed(System.currentTimeMillis());</code>.
*/
public XSTR() {
this(seedUniquifier() ^ System.nanoTime());
}
private static final AtomicLong seedUniquifier
= new AtomicLong(8682522807148012L);
private static long seedUniquifier() {
// L'Ecuyer, "Tables of Linear Congruential Generators of
// Different Sizes and Good Lattice Structure", 1999
for (;;) {
long current = seedUniquifier.get();
long next = current * 181783497276652981L;
if (seedUniquifier.compareAndSet(current, next)) {
return next;
}
}
}
/**
* Creates a new pseudo random number generator, starting with the specified
* seed, using <code>setSeed(seed);</code>.
*
* @param seed the initial seed
*/
public XSTR(long seed) {
this.seed = seed;
}
public boolean nextBoolean() {
return next(1) != 0;
}
public double nextDouble() {
return (((long)(next(26)) << 27) + next(27)) * DOUBLE_UNIT;
}
/**
* Returns the current state of the seed, can be used to clone the object
*
* @return the current seed
*/
public synchronized long getSeed() {
return seed;
}
/**
* Sets the seed for this pseudo random number generator. As described
* above, two instances of the same random class, starting with the same
* seed, produce the same results, if the same methods are called.
*
* @param seed the new seed
*/
public synchronized void setSeed(long seed) {
this.seed = seed;
}
/**
* @return Returns an XSRandom object with the same state as the original
*/
@Override
public XSTR clone() {
return new XSTR(getSeed());
}
/**
* Implementation of George Marsaglia's elegant Xorshift random generator
* 30% faster and better quality than the built-in java.util.random see also
* see http://www.javamex.com/tutorials/random_numbers/xorshift.shtml
*
* @param nbits
* @return
*/
public int next(int nbits) {
long x = seed;
x ^= (x << 21);
x ^= (x >>> 35);
x ^= (x << 4);
seed = x;
x &= ((1L << nbits) - 1);
return (int) x;
}
boolean haveNextNextGaussian = false;
double nextNextGaussian = 0;
synchronized public double nextGaussian() {
// See Knuth, ACP, Section 3.4.1 Algorithm C.
if (haveNextNextGaussian) {
haveNextNextGaussian = false;
return nextNextGaussian;
} else {
double v1, v2, s;
do {
v1 = 2 * nextDouble() - 1; // between -1 and 1
v2 = 2 * nextDouble() - 1; // between -1 and 1
s = v1 * v1 + v2 * v2;
} while (s >= 1 || s == 0);
double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s)/s);
nextNextGaussian = v2 * multiplier;
haveNextNextGaussian = true;
return v1 * multiplier;
}
}
/**
* Returns a pseudorandom, uniformly distributed {@code int} value between 0
* (inclusive) and the specified value (exclusive), drawn from this random
* number generator's sequence. The general contract of {@code nextInt} is
* that one {@code int} value in the specified range is pseudorandomly
* generated and returned. All {@code bound} possible {@code int} values are
* produced with (approximately) equal probability. The method
* {@code nextInt(int bound)} is implemented by class {@code Random} as if
* by:
* <pre> {@code
* public int nextInt(int bound) {
* if (bound <= 0)
* throw new IllegalArgumentException("bound must be positive");
*
* if ((bound & -bound) == bound) // i.e., bound is a power of 2
* return (int)((bound * (long)next(31)) >> 31);
*
* int bits, val;
* do {
* bits = next(31);
* val = bits % bound;
* } while (bits - val + (bound-1) < 0);
* return val;
* }}</pre>
*
* <p>The hedge "approx
* imately" is used in the foregoing description only because the next
* method is only approximately an unbiased source of independently chosen
* bits. If it were a perfect source of randomly chosen bits, then the
* algorithm shown would choose {@code int} values from the stated range
* with perfect uniformity.
* <p>
* The algorithm is slightly tricky. It rejects values that would result in
* an uneven distribution (due to the fact that 2^31 is not divisible by n).
* The probability of a value being rejected depends on n. The worst case is
* n=2^30+1, for which the probability of a reject is 1/2, and the expected
* number of iterations before the loop terminates is 2.
* <p>
* The algorithm treats the case where n is a power of two specially: it
* returns the correct number of high-order bits from the underlying
* pseudo-random number generator. In the absence of special treatment, the
* correct number of <i>low-order</i> bits would be returned. Linear
* congruential pseudo-random number generators such as the one implemented
* by this class are known to have short periods in the sequence of values
* of their low-order bits. Thus, this special case greatly increases the
* length of the sequence of values returned by successive calls to this
* method if n is a small power of two.
*
* @param bound the upper bound (exclusive). Must be positive.
* @return the next pseudorandom, uniformly distributed {@code int} value
* between zero (inclusive) and {@code bound} (exclusive) from this random
* number generator's sequence
* @throws IllegalArgumentException if bound is not positive
* @since 1.2
*/
public int nextInt(int bound) {
//if (bound <= 0) {
//throw new RuntimeException("BadBound");
//}
/*int r = next(31);
int m = bound - 1;
if ((bound & m) == 0) // i.e., bound is a power of 2
{
r = (int) ((bound * (long) r) >> 31);
} else {
for (int u = r;
u - (r = u % bound) + m < 0;
u = next(31))
;
}
return r;*/
//speedup, new nextInt ~+40%
last = seed ^ (seed << 21);
last ^= (last >>> 35);
last ^= (last << 4);
seed = last;
int out = (int) last % bound;
return (out < 0) ? -out : out;
}
public int nextInt() {
return next(32);
}
public float nextFloat() {
return next(24) * FLOAT_UNIT;
}
public long nextLong() {
// it's okay that the bottom word remains signed.
return ((long)(next(32)) << 32) + next(32);
}
public void nextBytes(byte[] bytes_arr) {
for (int iba = 0, lenba = bytes_arr.length; iba < lenba; )
for (int rndba = nextInt(),
nba = Math.min(lenba - iba, Integer.SIZE/Byte.SIZE);
nba-- > 0; rndba >>= Byte.SIZE)
bytes_arr[iba++] = (byte)rndba;
}
}