Make fields final if possible to ensure immutability

This commit is contained in:
thatsIch
2014-09-29 09:54:34 +02:00
parent 35f6c84d9f
commit 474596f095
261 changed files with 607 additions and 597 deletions
@@ -11,10 +11,10 @@ import appeng.entity.EntityFloatingItem;
public class AssemblerFX extends EntityFX
{
IAEItemStack item;
EntityFloatingItem fi;
final IAEItemStack item;
final EntityFloatingItem fi;
float time = 0;
float speed;
final float speed;
public AssemblerFX(World w, double x, double y, double z, double r, double g, double b, float speed, IAEItemStack is) {
super( w, x, y, z, r, g, b );
@@ -15,11 +15,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class CraftingFx extends EntityBreakingFX
{
private IIcon particleTextureIndex;
private final IIcon particleTextureIndex;
private int startBlkX;
private int startBlkY;
private int startBlkZ;
private final int startBlkX;
private final int startBlkY;
private final int startBlkZ;
@Override
public int getFXLayer()
@@ -15,11 +15,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EnergyFx extends EntityBreakingFX
{
private IIcon particleTextureIndex;
private final IIcon particleTextureIndex;
private int startBlkX;
private int startBlkY;
private int startBlkZ;
private final int startBlkX;
private final int startBlkY;
private final int startBlkZ;
@Override
public int getFXLayer()
@@ -5,7 +5,9 @@ import net.minecraft.world.World;
public class LightningArcFX extends LightningFX
{
double rx, ry, rz;
final double rx;
final double ry;
final double rz;
public LightningArcFX(World w, double x, double y, double z, double ex, double ey, double ez, double r, double g, double b) {
super( w, x, y, z, r, g, b, 6 );
@@ -13,8 +13,8 @@ public class LightningFX extends EntityFX
{
final int steps = getSteps();
static Random rng = new Random();
double[][] Steps;
static final Random rng = new Random();
final double[][] Steps;
protected LightningFX(World w, double x, double y, double z, double r, double g, double b, int maxAge) {
super( w, x, y, z, r, g, b );
@@ -172,8 +172,8 @@ public class LightningFX extends EntityFX
}
boolean hasData = false;
double[] I = new double[3];
double[] K = new double[3];
final double[] I = new double[3];
final double[] K = new double[3];
private void draw(Tessellator tess, double[] a, double[] b, double f6, double f8)
{
@@ -11,7 +11,7 @@ import appeng.client.texture.ExtraBlockTextures;
public class MatterCannonFX extends EntityBreakingFX
{
private IIcon particleTextureIndex;
private final IIcon particleTextureIndex;
public MatterCannonFX(World par1World, double par2, double par4, double par6, Item par8Item) {
super( par1World, par2, par4, par6, par8Item );