Changed naming style of fields of Particle Generator to camel case

This commit is contained in:
Alexander Anishin committed 2023-06-13 14:13:59 +03:00
1 parent a4f00d8a47
commit ec956b0d2e
6 files changed
+279 -301

No files matched your search

@@ -20,24 +20,28 @@ import cpw.mods.fml.client.FMLClientHandler;
*/
public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
private static final ResourceLocation iner_model_texture = new ResourceLocation(
private static final ResourceLocation InnerModelTexture = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/power_sphere_layer_1.png");
private static final ResourceLocation outer_model_texture = new ResourceLocation(
private static final ResourceLocation OuterModelTexture = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/power_sphere_layer_2.png");
private IModelCustom iner_model;
private final IModelCustom innerModel;
public RenderTileEnergyStorageCore() {
iner_model = AdvancedModelLoader
innerModel = AdvancedModelLoader
.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
}
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) {
if (tile == null || !(tile instanceof TileEnergyStorageCore)) return;
if (!(tile instanceof TileEnergyStorageCore)) {
return;
}
TileEnergyStorageCore core = (TileEnergyStorageCore) tile;
if (!core.isOnline()) return;
if (!core.isOnline()) {
return;
}
float scale = 0;
float rotation = core.modelRotation + (timeSinceLastTick / 2F);
@@ -71,44 +75,29 @@ public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture);
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(InnerModelTexture);
double colour = (double) ((TileEnergyStorageCore) tile).getEnergyStored()
/ (double) ((TileEnergyStorageCore) tile).getMaxEnergyStored();
double color = (double) core.getEnergyStored() / core.getMaxEnergyStored();
float brightness = (float) Math.abs(Math.sin((float) Minecraft.getSystemTime() / 3000f) * 100f);
colour = 1f - colour;
color = 1f - color;
GL11.glScalef(scale, scale, scale);
GL11.glPushMatrix();
GL11.glRotatef(rotation, 0F, 1F, 0.5F);
GL11.glColor4d(1F, colour * 0.3f, colour * 0.7f, 1F);
GL11.glColor4d(1F, color * 0.3f, color * 0.7f, 1F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 80f + brightness, 80f + brightness);
iner_model.renderAll();
innerModel.renderAll();
GL11.glPopMatrix();
// GL11.glPushMatrix();
// GL11.glScalef(0.8F, 0.8F, 0.8F);
// GL11.glColor4d(1F, 1f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
//
// GL11.glPushMatrix();
// GL11.glScalef(0.9F, 0.9F, 0.9F);
// GL11.glColor4d(1F, 0f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
GL11.glScalef(1.1F, 1.1F, 1.1F);
GL11.glDepthMask(false);
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture);
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(OuterModelTexture);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glRotatef(rotation * 0.5F, 0F, -1F, -0.5F);
GL11.glColor4f(0.5F, 2F, 2F, 0.7F);
iner_model.renderAll();
innerModel.renderAll();
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_LIGHTING);
@@ -54,8 +54,8 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
public void renderBlock(TileParticleGenerator tl, float f3) {
Tessellator tessellator = Tessellator.instance;
boolean inverted = tl.inverted;
boolean stabilizerMode = tl.stabalizerMode;
boolean inverted = tl.isInverted;
boolean stabilizerMode = tl.isInStabilizerMode;
GL11.glPushMatrix();
@@ -104,7 +104,7 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
drawEnergyBeam(tessellator, tl, f3);
}
if (tl.beam_enabled) preRenderBeam(tessellator, tl, f3);
if (tl.isBeamEnabled) preRenderBeam(tessellator, tl, f3);
}
private void drawEnergyBeam(Tessellator tess, TileParticleGenerator gen, float f) {
@@ -144,12 +144,12 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glColor4f(0.0F, 2.0F, 0.0F, 1F);
GL11.glTranslated(0.5, 0, 0.5);
GL11.glScalef(0.4F, 0.4F, 0.4F);
if (!tile.stabalizerMode) {
float red = (float) tile.beam_red / 255F;
float green = (float) tile.beam_green / 255F;
float blue = (float) tile.beam_blue / 255F;
if (!tile.isInStabilizerMode) {
float red = (float) tile.beamRed / 255F;
float green = (float) tile.beamGreen / 255F;
float blue = (float) tile.beamBlue / 255F;
GL11.glColor4f(red, green, blue, 1F);
GL11.glScalef(tile.beam_scale, tile.beam_scale, tile.beam_scale);
GL11.glScalef(tile.beamScale, tile.beamScale, tile.beamScale);
}
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200);
@@ -166,10 +166,10 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F);
if (!tile.stabalizerMode) {
float red = (float) tile.beam_red / 255F;
float green = (float) tile.beam_green / 255F;
float blue = (float) tile.beam_blue / 255F;
if (!tile.isInStabilizerMode) {
float red = (float) tile.beamRed / 255F;
float green = (float) tile.beamGreen / 255F;
float blue = (float) tile.beamBlue / 255F;
GL11.glColor4f(red, green, blue, 0.5F);
}
GL11.glEnable(GL11.GL_BLEND);
@@ -491,17 +491,17 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslated(0, 0.5, 0.5);
GL11.glRotatef(90F + gen.beam_pitch, 1F, 0F, 0F);
GL11.glRotatef(90F + gen.beamPitch, 1F, 0F, 0F);
GL11.glTranslated(0, 0, -0.5);
GL11.glTranslated(0.5, 0, 0);
GL11.glRotatef(gen.beam_yaw, 0F, 0F, 1F);
GL11.glRotatef(gen.beamYaw, 0F, 0F, 1F);
GL11.glTranslated(-0.5, 0, 0);
renderBeam(tess, gen, f);
GL11.glPopMatrix();
if (gen.render_core) {
if (gen.shouldRenderCore) {
GL11.glPushMatrix();
GL11.glTranslated(0, 0.5, 0);
renderStabilizerSphere(gen);
@@ -513,10 +513,10 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
int x = 0;
int y = 0;
int z = 0;
double length = tile.beam_length;
float red = (float) tile.beam_red / 255F;
float green = (float) tile.beam_green / 255F;
float blue = (float) tile.beam_blue / 255F;
double length = tile.beamLength;
float red = (float) tile.beamRed / 255F;
float green = (float) tile.beamGreen / 255F;
float blue = (float) tile.beamBlue / 255F;
GL11.glPushMatrix();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
@@ -533,14 +533,14 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
// float time = (float)tile.getWorldObj().getTotalWorldTime() + f;
float time = tile.rotation + f;
float upMot = -time * 0.2F - (float) MathHelper.floor_float(-time * 0.1F);
float rotValue = tile.beam_rotation * (tile.rotation + f * 0.5F);
float rotValue = tile.beamRotation * (tile.rotation + f * 0.5F);
double rotation = rotValue;
tess.startDrawingQuads();
tess.setBrightness(200);
tess.setColorRGBA(tile.beam_red, tile.beam_green, tile.beam_blue, 32);
tess.setColorRGBA(tile.beamRed, tile.beamGreen, tile.beamBlue, 32);
double scale = (double) tile.beam_scale * 0.2D;
double scale = (double) tile.beamScale * 0.2D;
double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; // x point 1
double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; // z point 1
double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; // x point 2
@@ -620,10 +620,10 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glDepthMask(false);
GL11.glTranslated(0.5, 0, 0.5);
GL11.glScalef(tile.beam_scale, 1f, tile.beam_scale);
GL11.glScalef(tile.beamScale, 1f, tile.beamScale);
GL11.glTranslated(-0.5, -0, -0.5);
tess.startDrawingQuads();
tess.setColorRGBA(tile.beam_red, tile.beam_green, tile.beam_blue, 32);
tess.setColorRGBA(tile.beamRed, tile.beamGreen, tile.beamBlue, 32);
double d30 = 0.2D;
double d4 = 0.2D;
double d6 = 0.8D;
@@ -27,35 +27,23 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) {
TileReactorCore tile = (TileReactorCore) tileEntity;
// tile.renderList.clear();
TileReactorCore core = (TileReactorCore) tileEntity;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
renderReactorCore(tile, partialTick);
// for (MultiblockHelper.TileOffset offset : tile.stabilizerLocations){
// if (!(offset.getTileEntity(tileEntity) instanceof TileReactorStabilizer)) continue;
// GL11.glPushMatrix();
//
// TileReactorStabilizer stabilizer = (TileReactorStabilizer)offset.getTileEntity(tileEntity);
// GL11.glTranslated(-offset.offsetX, -offset.offsetY, -offset.offsetZ);
// //RenderTileReactorStabilizer.renderCore(stabilizer, partialTick);
// //RenderTileReactorStabilizer.renderEffects(stabilizer, partialTick);
//
// GL11.glPopMatrix();
// }
renderReactorCore(core, partialTick);
GL11.glPopMatrix();
}
public void renderReactorCore(TileReactorCore tile, float partialTick) {
float rotation = (tile.renderRotation * 0.2F) + (partialTick * (tile.renderSpeed * 0.2F));
double ff = tile.maxFieldCharge > 0 ? tile.fieldCharge / tile.maxFieldCharge : 0;
double r = ff < 0.5 ? 1 - (ff * 2) : 0;
double g = ff > 0.5 ? (ff - 0.5) * 2 : 0;
double b = ff * 2;
double a = ff < 0.1 ? (ff * 10) : 1;
public void renderReactorCore(TileReactorCore core, float partialTick) {
float rotation = core.renderRotation * 0.2F + partialTick * (core.renderSpeed * 0.2F);
double fieldChargePercentage = core.maxFieldCharge > 0 ? core.fieldCharge / core.maxFieldCharge : 0;
double r = fieldChargePercentage < 0.5 ? 1 - fieldChargePercentage * 2 : 0;
double g = fieldChargePercentage > 0.5 ? (fieldChargePercentage - 0.5) * 2 : 0;
double b = fieldChargePercentage * 2;
double a = fieldChargePercentage < 0.1 ? fieldChargePercentage * 10 : 1;
// Pre Render
GL11.glPushMatrix();
@@ -65,7 +53,7 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
// Render inner
if (tile.reactorFuel + tile.convertedFuel < 144) {
if (core.reactorFuel + core.convertedFuel < 144) {
ResourceHandler.bindResource("textures/blocks/draconic_block_blank.png");
GL11.glPushMatrix();
GL11.glScaled(0.1, 0.1, 0.1);
@@ -77,8 +65,8 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
GL11.glColor4d(1, 1, 1, 1);
GL11.glRotatef(rotation, 0.5F, 1F, 0.5F);
GL11.glScaled(0.5, 0.5, 0.5);
double r3 = tile.getCoreDiameter();
GL11.glScaled(r3, r3, r3);
double diameter = core.getCoreDiameter();
GL11.glScaled(diameter, diameter, diameter);
reactorModel.renderAll();
// Mid Render
@@ -87,10 +75,11 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
if (tile.reactionTemperature < 2000) {
if (core.reactionTemperature < 2000) {
ResourceHandler.bindResource("textures/blocks/draconic_block_blank.png");
if (tile.reactionTemperature > 1000)
GL11.glColor4d(1F, 1F, 1F, 1D - ((tile.reactionTemperature - 1000) / 1000D));
if (core.reactionTemperature > 1000) {
GL11.glColor4d(1F, 1F, 1F, 1D - (core.reactionTemperature - 1000) / 1000D);
}
reactorModel.renderAll();
}
@@ -87,7 +87,7 @@ public class ParticleGenerator extends BlockDE {
public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block block) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileParticleGenerator) {
((TileParticleGenerator) tile).signal = world.isBlockIndirectlyGettingPowered(x, y, z);
((TileParticleGenerator) tile).hasRedstoneSignal = world.isBlockIndirectlyGettingPowered(x, y, z);
world.markBlockForUpdate(x, y, z);
}
}
@@ -23,80 +23,80 @@ import cpw.mods.fml.relauncher.SideOnly;
public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
public boolean particles_enabled = true;
public static final int MAXIMUM_PARTICLE_INDEX = 3;
public boolean isParticlesEnabled = true;
public int red = 0;
public int green = 0;
public int blue = 0;
public int random_red = 0;
public int random_green = 0;
public int random_blue = 0;
public float motion_x = 0.0F;
public float motion_y = 0.0F;
public float motion_z = 0.0F;
public float random_motion_x = 0.0F;
public float random_motion_y = 0.0F;
public float random_motion_z = 0.0F;
public int randomRed = 0;
public int randomGreen = 0;
public int randomBlue = 0;
public float motionX = 0.0F;
public float motionY = 0.0F;
public float motionZ = 0.0F;
public float randomMotionX = 0.0F;
public float randomMotionY = 0.0F;
public float randomMotionZ = 0.0F;
public float scale = 1F;
public float random_scale = 0F;
public float randomScale = 0F;
public int life = 100;
public int random_life = 0;
public float spawn_x = 0;
public float spawn_y = 0;
public float spawn_z = 0;
public float random_spawn_x = 0;
public float random_spawn_y = 0;
public float random_spawn_z = 0;
public int randomLife = 0;
public float spawnX = 0;
public float spawnY = 0;
public float spawnZ = 0;
public float randomSpawnX = 0;
public float randomSpawnY = 0;
public float randomSpawnZ = 0;
public int page = 1;
public int fade = 0;
public int spawn_rate = 1;
public boolean collide = false;
public int selected_particle = 1;
public int selected_max = 3;
public int spawnRate = 1;
public boolean canParticleCollide = false;
public int selectedParticle = 1;
public float gravity = 0F;
public boolean active = true;
public boolean signal = false;
public boolean inverted = false;
public boolean isActive = true;
public boolean hasRedstoneSignal = false;
public boolean isInverted = false;
TileLocation master = new TileLocation();
public float rotation = 0;
public boolean stabalizerMode = false;
public boolean isInStabilizerMode = false;
// beam
public boolean beam_enabled = false;
public boolean render_core = false;
public boolean isBeamEnabled = false;
public boolean shouldRenderCore = false;
public int beam_red = 0;
public int beam_green = 0;
public int beam_blue = 0;
public float beam_scale = 1F;
public float beam_pitch = 0F;
public float beam_yaw = 0F;
public float beam_length = 0F;
public float beam_rotation = 0F;
public int beamRed = 0;
public int beamGreen = 0;
public int beamBlue = 0;
public float beamScale = 1F;
public float beamPitch = 0F;
public float beamYaw = 0F;
public float beamLength = 0F;
public float beamRotation = 0F;
private int tick = 0;
@SideOnly(Side.SERVER)
@Override
@SideOnly(Side.SERVER)
public boolean canUpdate() {
return false;
}
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public void updateEntity() {
if (!worldObj.isRemote) {
return;
}
rotation += 0.5F;
if (stabalizerMode) {
if (isInStabilizerMode) {
spawnStabilizerParticle();
return;
}
active = signal != inverted;
isActive = hasRedstoneSignal != isInverted;
if (tick < spawn_rate || !active || !particles_enabled) {
if (tick < spawnRate || !isActive || !isParticlesEnabled) {
tick++;
return;
}
@@ -104,13 +104,13 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
tick = 0;
Random rand = worldObj.rand;
float motionX = motion_x + (random_motion_x * rand.nextFloat());
float motionY = motion_y + (random_motion_y * rand.nextFloat());
float motionZ = motion_z + (random_motion_z * rand.nextFloat());
float scale = this.scale + (random_scale * rand.nextFloat());
double spawnX = xCoord + spawn_x + (random_spawn_x * rand.nextFloat());
double spawnY = yCoord + spawn_y + (random_spawn_y * rand.nextFloat());
double spawnZ = zCoord + spawn_z + (random_spawn_z * rand.nextFloat());
float motionX = this.motionX + (randomMotionX * rand.nextFloat());
float motionY = this.motionY + (randomMotionY * rand.nextFloat());
float motionZ = this.motionZ + (randomMotionZ * rand.nextFloat());
float scale = this.scale + (randomScale * rand.nextFloat());
double spawnX = xCoord + this.spawnX + (randomSpawnX * rand.nextFloat());
double spawnY = yCoord + this.spawnY + (randomSpawnY * rand.nextFloat());
double spawnZ = zCoord + this.spawnZ + (randomSpawnZ * rand.nextFloat());
ParticleCustom particle = new ParticleCustom(
worldObj,
@@ -121,12 +121,12 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
motionY,
motionZ,
scale,
collide,
this.selected_particle);
particle.red = this.red + rand.nextInt(random_red + 1);
particle.green = this.green + rand.nextInt(random_green + 1);
particle.blue = this.blue + rand.nextInt(random_blue + 1);
particle.maxAge = this.life + rand.nextInt(random_life + 1);
canParticleCollide,
this.selectedParticle);
particle.red = this.red + rand.nextInt(randomRed + 1);
particle.green = this.green + rand.nextInt(randomGreen + 1);
particle.blue = this.blue + rand.nextInt(randomBlue + 1);
particle.maxAge = this.life + rand.nextInt(randomLife + 1);
particle.fadeTime = this.fade;
particle.fadeLength = this.fade;
particle.gravity = this.gravity;
@@ -176,7 +176,7 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
}
public void toggleInverted() {
inverted = !inverted;
isInverted = !isInverted;
}
@Override
@@ -195,7 +195,7 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
@Override
public void writeToNBT(NBTTagCompound compound) {
master.writeToNBT(compound, "Key");
compound.setBoolean("StabalizerMode", stabalizerMode);
compound.setBoolean("StabalizerMode", isInStabilizerMode);
getBlockNBT(compound);
super.writeToNBT(compound);
@@ -204,7 +204,7 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
@Override
public void readFromNBT(NBTTagCompound compound) {
master.readFromNBT(compound, "Key");
stabalizerMode = compound.getBoolean("StabalizerMode");
isInStabilizerMode = compound.getBoolean("StabalizerMode");
setBlockNBT(compound);
super.readFromNBT(compound);
}
@@ -227,92 +227,92 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
compound.setInteger("Red", red);
compound.setInteger("Green", green);
compound.setInteger("Blue", blue);
compound.setInteger("RandomRed", random_red);
compound.setInteger("RandomGreen", random_green);
compound.setInteger("RandomBlue", random_blue);
compound.setFloat("MotionX", motion_x);
compound.setFloat("MotionY", motion_y);
compound.setFloat("MotionZ", motion_z);
compound.setFloat("RandomMotionX", random_motion_x);
compound.setFloat("RandomMotionY", random_motion_y);
compound.setFloat("RandomMotionZ", random_motion_z);
compound.setInteger("RandomRed", randomRed);
compound.setInteger("RandomGreen", randomGreen);
compound.setInteger("RandomBlue", randomBlue);
compound.setFloat("MotionX", motionX);
compound.setFloat("MotionY", motionY);
compound.setFloat("MotionZ", motionZ);
compound.setFloat("RandomMotionX", randomMotionX);
compound.setFloat("RandomMotionY", randomMotionY);
compound.setFloat("RandomMotionZ", randomMotionZ);
compound.setFloat("Scale", scale);
compound.setFloat("RandomScale", random_scale);
compound.setFloat("RandomScale", randomScale);
compound.setInteger("Life", life);
compound.setInteger("RandomLife", random_life);
compound.setFloat("SpawnX", spawn_x);
compound.setFloat("SpawnY", spawn_y);
compound.setFloat("SpawnZ", spawn_z);
compound.setFloat("RandomSpawnX", random_spawn_x);
compound.setFloat("RandomSpawnY", random_spawn_y);
compound.setFloat("RandomSpawnZ", random_spawn_z);
compound.setInteger("RandomLife", randomLife);
compound.setFloat("SpawnX", spawnX);
compound.setFloat("SpawnY", spawnY);
compound.setFloat("SpawnZ", spawnZ);
compound.setFloat("RandomSpawnX", randomSpawnX);
compound.setFloat("RandomSpawnY", randomSpawnY);
compound.setFloat("RandomSpawnZ", randomSpawnZ);
compound.setInteger("Page", page);
compound.setInteger("SpawnRate", spawn_rate);
compound.setBoolean("CanCollide", collide);
compound.setInteger("SpawnRate", spawnRate);
compound.setBoolean("CanCollide", canParticleCollide);
compound.setInteger("Fade", fade);
compound.setInteger("SelectedParticle", selected_particle);
compound.setInteger("SelectedParticle", selectedParticle);
compound.setFloat("Gravity", gravity);
compound.setBoolean("Active", active);
compound.setBoolean("Signal", signal);
compound.setBoolean("Inverted", inverted);
compound.setBoolean("particles_enabled", particles_enabled);
compound.setBoolean("Active", isActive);
compound.setBoolean("Signal", hasRedstoneSignal);
compound.setBoolean("Inverted", isInverted);
compound.setBoolean("particles_enabled", isParticlesEnabled);
compound.setBoolean("beam_enabled", beam_enabled);
compound.setBoolean("render_core", render_core);
compound.setInteger("beam_red", beam_red);
compound.setInteger("beam_green", beam_green);
compound.setInteger("beam_blue", beam_blue);
compound.setFloat("beam_scale", beam_scale);
compound.setFloat("beam_pitch", beam_pitch);
compound.setFloat("beam_yaw", beam_yaw);
compound.setFloat("beam_length", beam_length);
compound.setFloat("beam_rotation", beam_rotation);
compound.setBoolean("beam_enabled", isBeamEnabled);
compound.setBoolean("render_core", shouldRenderCore);
compound.setInteger("beam_red", beamRed);
compound.setInteger("beam_green", beamGreen);
compound.setInteger("beam_blue", beamBlue);
compound.setFloat("beam_scale", beamScale);
compound.setFloat("beam_pitch", beamPitch);
compound.setFloat("beam_yaw", beamYaw);
compound.setFloat("beam_length", beamLength);
compound.setFloat("beam_rotation", beamRotation);
}
public void setBlockNBT(NBTTagCompound compound) {
red = compound.getInteger("Red");
green = compound.getInteger("Green");
blue = compound.getInteger("Blue");
random_red = compound.getInteger("RandomRed");
random_green = compound.getInteger("RandomGreen");
random_blue = compound.getInteger("RandomBlue");
motion_x = compound.getFloat("MotionX");
motion_y = compound.getFloat("MotionY");
motion_z = compound.getFloat("MotionZ");
random_motion_x = compound.getFloat("RandomMotionX");
random_motion_y = compound.getFloat("RandomMotionY");
random_motion_z = compound.getFloat("RandomMotionZ");
randomRed = compound.getInteger("RandomRed");
randomGreen = compound.getInteger("RandomGreen");
randomBlue = compound.getInteger("RandomBlue");
motionX = compound.getFloat("MotionX");
motionY = compound.getFloat("MotionY");
motionZ = compound.getFloat("MotionZ");
randomMotionX = compound.getFloat("RandomMotionX");
randomMotionY = compound.getFloat("RandomMotionY");
randomMotionZ = compound.getFloat("RandomMotionZ");
scale = compound.getFloat("Scale");
random_scale = compound.getFloat("RandomScale");
randomScale = compound.getFloat("RandomScale");
life = compound.getInteger("Life");
random_life = compound.getInteger("RandomLife");
spawn_x = compound.getFloat("SpawnX");
spawn_y = compound.getFloat("SpawnY");
spawn_z = compound.getFloat("SpawnZ");
random_spawn_x = compound.getFloat("RandomSpawnX");
random_spawn_y = compound.getFloat("RandomSpawnY");
random_spawn_z = compound.getFloat("RandomSpawnZ");
randomLife = compound.getInteger("RandomLife");
spawnX = compound.getFloat("SpawnX");
spawnY = compound.getFloat("SpawnY");
spawnZ = compound.getFloat("SpawnZ");
randomSpawnX = compound.getFloat("RandomSpawnX");
randomSpawnY = compound.getFloat("RandomSpawnY");
randomSpawnZ = compound.getFloat("RandomSpawnZ");
page = compound.getInteger("Page");
spawn_rate = compound.getInteger("SpawnRate");
collide = compound.getBoolean("CanCollide");
spawnRate = compound.getInteger("SpawnRate");
canParticleCollide = compound.getBoolean("CanCollide");
fade = compound.getInteger("Fade");
selected_particle = compound.getInteger("SelectedParticle");
selectedParticle = compound.getInteger("SelectedParticle");
gravity = compound.getFloat("Gravity");
active = compound.getBoolean("Active");
signal = compound.getBoolean("Signal");
inverted = compound.getBoolean("Inverted");
particles_enabled = compound.getBoolean("particles_enabled");
isActive = compound.getBoolean("Active");
hasRedstoneSignal = compound.getBoolean("Signal");
isInverted = compound.getBoolean("Inverted");
isParticlesEnabled = compound.getBoolean("particles_enabled");
beam_enabled = compound.getBoolean("beam_enabled");
render_core = compound.getBoolean("render_core");
beam_red = compound.getInteger("beam_red");
beam_green = compound.getInteger("beam_green");
beam_blue = compound.getInteger("beam_blue");
beam_scale = compound.getFloat("beam_scale");
beam_pitch = compound.getFloat("beam_pitch");
beam_yaw = compound.getFloat("beam_yaw");
beam_length = compound.getFloat("beam_length");
beam_rotation = compound.getFloat("beam_rotation");
isBeamEnabled = compound.getBoolean("beam_enabled");
shouldRenderCore = compound.getBoolean("render_core");
beamRed = compound.getInteger("beam_red");
beamGreen = compound.getInteger("beam_green");
beamBlue = compound.getInteger("beam_blue");
beamScale = compound.getFloat("beam_scale");
beamPitch = compound.getFloat("beam_pitch");
beamYaw = compound.getFloat("beam_yaw");
beamLength = compound.getFloat("beam_length");
beamRotation = compound.getFloat("beam_rotation");
}
@SideOnly(Side.CLIENT)
@@ -349,7 +349,7 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
/* Particles */
if (args[0].equals("particles_enabled") && args[1] instanceof Boolean) {
particles_enabled = (Boolean) args[1];
isParticlesEnabled = (boolean) args[1];
} else if (args[0].equals("red") && args[1] instanceof Double) {
red = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("green") && args[1] instanceof Double) {
@@ -357,75 +357,75 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
} else if (args[0].equals("blue") && args[1] instanceof Double) {
blue = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("random_red") && args[1] instanceof Double) {
random_red = limit(((Double) args[1]).intValue(), 0, 255);
randomRed = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("random_green") && args[1] instanceof Double) {
random_green = limit(((Double) args[1]).intValue(), 0, 255);
randomGreen = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("random_blue") && args[1] instanceof Double) {
random_blue = limit(((Double) args[1]).intValue(), 0, 255);
randomBlue = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("motion_x") && args[1] instanceof Double) {
motion_x = (float) limit((Double) args[1], -5F, 5F);
motionX = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("motion_y") && args[1] instanceof Double) {
motion_y = (float) limit((Double) args[1], -5F, 5F);
motionY = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("motion_z") && args[1] instanceof Double) {
motion_z = (float) limit((Double) args[1], -5F, 5F);
motionZ = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("random_motion_x") && args[1] instanceof Double) {
random_motion_x = (float) limit((Double) args[1], -5F, 5F);
randomMotionX = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("random_motion_y") && args[1] instanceof Double) {
random_motion_y = (float) limit((Double) args[1], -5F, 5F);
randomMotionY = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("random_motion_z") && args[1] instanceof Double) {
random_motion_z = (float) limit((Double) args[1], -5F, 5F);
randomMotionZ = (float) limit((Double) args[1], -5F, 5F);
} else if (args[0].equals("scale") && args[1] instanceof Double) {
scale = (float) limit((Double) args[1], 0.01F, 50F);
} else if (args[0].equals("random_scale") && args[1] instanceof Double) {
random_scale = (float) limit((Double) args[1], 0.01F, 50F);
randomScale = (float) limit((Double) args[1], 0.01F, 50F);
} else if (args[0].equals("life") && args[1] instanceof Double) {
life = limit(((Double) args[1]).intValue(), 0, 1000);
} else if (args[0].equals("random_life") && args[1] instanceof Double) {
random_life = limit(((Double) args[1]).intValue(), 0, 1000);
randomLife = limit(((Double) args[1]).intValue(), 0, 1000);
} else if (args[0].equals("spawn_x") && args[1] instanceof Double) {
spawn_x = (float) limit((Double) args[1], -50F, 50F);
spawnX = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("spawn_y") && args[1] instanceof Double) {
spawn_y = (float) limit((Double) args[1], -50F, 50F);
spawnY = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("spawn_z") && args[1] instanceof Double) {
spawn_z = (float) limit((Double) args[1], -50F, 50F);
spawnZ = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("random_spawn_x") && args[1] instanceof Double) {
random_spawn_x = (float) limit((Double) args[1], -50F, 50F);
randomSpawnX = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("random_spawn_y") && args[1] instanceof Double) {
random_spawn_y = (float) limit((Double) args[1], -50F, 50F);
randomSpawnY = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("random_spawn_z") && args[1] instanceof Double) {
random_spawn_z = (float) limit((Double) args[1], -50F, 50F);
randomSpawnZ = (float) limit((Double) args[1], -50F, 50F);
} else if (args[0].equals("fade") && args[1] instanceof Double) {
fade = limit(((Double) args[1]).intValue(), 0, 100);
} else if (args[0].equals("spawn_rate") && args[1] instanceof Double) {
spawn_rate = limit(((Double) args[1]).intValue(), 1, 200);
spawnRate = limit(((Double) args[1]).intValue(), 1, 200);
} else if (args[0].equals("collide") && args[1] instanceof Boolean) {
collide = (Boolean) args[1];
canParticleCollide = (Boolean) args[1];
} else if (args[0].equals("selected_particle") && args[1] instanceof Double) {
selected_particle = limit(((Double) args[1]).intValue(), 1, selected_max);
selectedParticle = limit(((Double) args[1]).intValue(), 1, MAXIMUM_PARTICLE_INDEX);
} else if (args[0].equals("gravity") && args[1] instanceof Double) {
gravity = (float) limit((Double) args[1], -5F, 5F);
}
/* Beam */
else if (args[0].equals("beam_enabled") && args[1] instanceof Boolean) {
beam_enabled = (Boolean) args[1];
isBeamEnabled = (Boolean) args[1];
} else if (args[0].equals("render_core") && args[1] instanceof Boolean) {
render_core = (Boolean) args[1];
shouldRenderCore = (Boolean) args[1];
} else if (args[0].equals("beam_red") && args[1] instanceof Double) {
beam_red = limit(((Double) args[1]).intValue(), 0, 255);
beamRed = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("beam_green") && args[1] instanceof Double) {
beam_green = limit(((Double) args[1]).intValue(), 0, 255);
beamGreen = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("beam_blue") && args[1] instanceof Double) {
beam_blue = limit(((Double) args[1]).intValue(), 0, 255);
beamBlue = limit(((Double) args[1]).intValue(), 0, 255);
} else if (args[0].equals("beam_scale") && args[1] instanceof Double) {
beam_scale = (float) limit((Double) args[1], -0F, 5F);
beamScale = (float) limit((Double) args[1], -0F, 5F);
} else if (args[0].equals("beam_pitch") && args[1] instanceof Double) {
beam_pitch = (float) limit((Double) args[1], -180F, 180F);
beamPitch = (float) limit((Double) args[1], -180F, 180F);
} else if (args[0].equals("beam_yaw") && args[1] instanceof Double) {
beam_yaw = (float) limit((Double) args[1], -180F, 180F);
beamYaw = (float) limit((Double) args[1], -180F, 180F);
} else if (args[0].equals("beam_length") && args[1] instanceof Double) {
beam_length = (float) limit((Double) args[1], -0F, 320F);
beamLength = (float) limit((Double) args[1], -0F, 320F);
} else if (args[0].equals("beam_rotation") && args[1] instanceof Double) {
beam_rotation = (float) limit((Double) args[1], -1F, 1F);
beamRotation = (float) limit((Double) args[1], -1F, 1F);
} else {
return new Object[] { false };
}
@@ -436,91 +436,91 @@ public class TileParticleGenerator extends TileEntity implements IDEPeripheral {
Map<Object, Object> map = new HashMap<>();
/* Particles */
map.put("particles_enabled", particles_enabled);
map.put("particles_enabled", isParticlesEnabled);
map.put("red", red);
map.put("green", green);
map.put("blue", blue);
map.put("random_red", random_red);
map.put("random_green", random_green);
map.put("random_blue", random_blue);
map.put("motion_x", motion_x);
map.put("motion_y", motion_y);
map.put("motion_z", motion_z);
map.put("random_motion_x", random_motion_x);
map.put("random_motion_y", random_motion_y);
map.put("random_motion_z", random_motion_z);
map.put("random_red", randomRed);
map.put("random_green", randomGreen);
map.put("random_blue", randomBlue);
map.put("motion_x", motionX);
map.put("motion_y", motionY);
map.put("motion_z", motionZ);
map.put("random_motion_x", randomMotionX);
map.put("random_motion_y", randomMotionY);
map.put("random_motion_z", randomMotionZ);
map.put("scale", scale);
map.put("random_scale", random_scale);
map.put("random_scale", randomScale);
map.put("life", life);
map.put("random_life", random_life);
map.put("spawn_x", spawn_x);
map.put("spawn_y", spawn_y);
map.put("spawn_z", spawn_z);
map.put("random_spawn_x", random_spawn_x);
map.put("random_spawn_y", random_spawn_y);
map.put("random_spawn_z", random_spawn_z);
map.put("random_life", randomLife);
map.put("spawn_x", spawnX);
map.put("spawn_y", spawnY);
map.put("spawn_z", spawnZ);
map.put("random_spawn_x", randomSpawnX);
map.put("random_spawn_y", randomSpawnY);
map.put("random_spawn_z", randomSpawnZ);
map.put("fade", fade);
map.put("spawn_rate", spawn_rate);
map.put("collide", collide);
map.put("selected_particle", selected_particle);
map.put("spawn_rate", spawnRate);
map.put("collide", canParticleCollide);
map.put("selected_particle", selectedParticle);
map.put("gravity", gravity);
/* Beam */
map.put("beam_enabled", beam_enabled);
map.put("render_core", render_core);
map.put("beam_red", beam_red);
map.put("beam_green", beam_green);
map.put("beam_blue", beam_blue);
map.put("beam_scale", beam_scale);
map.put("beam_pitch", beam_pitch);
map.put("beam_yaw", beam_yaw);
map.put("beam_length", beam_length);
map.put("beam_rotation", beam_rotation);
map.put("beam_enabled", isBeamEnabled);
map.put("render_core", shouldRenderCore);
map.put("beam_red", beamRed);
map.put("beam_green", beamGreen);
map.put("beam_blue", beamBlue);
map.put("beam_scale", beamScale);
map.put("beam_pitch", beamPitch);
map.put("beam_yaw", beamYaw);
map.put("beam_length", beamLength);
map.put("beam_rotation", beamRotation);
return new Object[] { map };
} else if (method.startsWith("resetGeneratorState")) {
particles_enabled = true;
isParticlesEnabled = true;
red = 0;
green = 0;
blue = 0;
random_red = 0;
random_green = 0;
random_blue = 0;
motion_x = 0.0F;
motion_y = 0.0F;
motion_z = 0.0F;
random_motion_x = 0.0F;
random_motion_y = 0.0F;
random_motion_z = 0.0F;
randomRed = 0;
randomGreen = 0;
randomBlue = 0;
motionX = 0.0F;
motionY = 0.0F;
motionZ = 0.0F;
randomMotionX = 0.0F;
randomMotionY = 0.0F;
randomMotionZ = 0.0F;
scale = 1F;
random_scale = 0F;
randomScale = 0F;
life = 100;
random_life = 0;
spawn_x = 0;
spawn_y = 0;
spawn_z = 0;
random_spawn_x = 0;
random_spawn_y = 0;
random_spawn_z = 0;
randomLife = 0;
spawnX = 0;
spawnY = 0;
spawnZ = 0;
randomSpawnX = 0;
randomSpawnY = 0;
randomSpawnZ = 0;
page = 1;
fade = 0;
spawn_rate = 1;
collide = false;
selected_particle = 1;
spawnRate = 1;
canParticleCollide = false;
selectedParticle = 1;
gravity = 0F;
// beam
beam_enabled = false;
render_core = false;
isBeamEnabled = false;
shouldRenderCore = false;
beam_red = 0;
beam_green = 0;
beam_blue = 0;
beam_scale = 1F;
beam_pitch = 0F;
beam_yaw = 0F;
beam_length = 0F;
beam_rotation = 0F;
beamRed = 0;
beamGreen = 0;
beamBlue = 0;
beamScale = 1F;
beamPitch = 0F;
beamYaw = 0F;
beamLength = 0F;
beamRotation = 0F;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return new Object[] { true };
@@ -370,7 +370,7 @@ public class TileEnergyStorageCore extends TileObjectSync {
return;
}
TileParticleGenerator generator = (TileParticleGenerator) tile;
generator.stabalizerMode = true;
generator.isInStabilizerMode = true;
generator.setMaster(new TileLocation(xCoord, yCoord, zCoord));
worldObj.setBlockMetadataWithNotify(
stabilizer.getXCoord(),
@@ -416,7 +416,7 @@ public class TileEnergyStorageCore extends TileObjectSync {
TileEntity tile = stabilizer.getTileEntity(worldObj);
if (tile instanceof TileParticleGenerator) {
TileParticleGenerator generator = (TileParticleGenerator) tile;
generator.stabalizerMode = false;
generator.isInStabilizerMode = false;
worldObj.setBlockMetadataWithNotify(
stabilizer.getXCoord(),
stabilizer.getYCoord(),
@@ -434,7 +434,7 @@ public class TileEnergyStorageCore extends TileObjectSync {
return false;
}
TileParticleGenerator generator = (TileParticleGenerator) tile;
if (!generator.stabalizerMode || stabilizer.getBlockMetadata(worldObj) != 1) {
if (!generator.isInStabilizerMode || stabilizer.getBlockMetadata(worldObj) != 1) {
return false;
}
TileEnergyStorageCore core = generator.getMaster();