final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 deletions
@@ -30,18 +30,18 @@ import net.minecraft.world.World;
public abstract class AEBaseEntityItem extends EntityItem
{
public AEBaseEntityItem( World world )
public AEBaseEntityItem( final World world )
{
super( world );
}
public AEBaseEntityItem( World world, double x, double y, double z, ItemStack stack )
public AEBaseEntityItem( final World world, final double x, final double y, final double z, final ItemStack stack )
{
super( world, x, y, z, stack );
}
@SuppressWarnings( "unchecked" )
public List<Entity> getCheckedEntitiesWithinAABBExcludingEntity( AxisAlignedBB region )
public List<Entity> getCheckedEntitiesWithinAABBExcludingEntity( final AxisAlignedBB region )
{
return this.worldObj.getEntitiesWithinAABBExcludingEntity( this, region );
}
@@ -47,12 +47,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
int transformTime = 0;
@Reflected
public EntityChargedQuartz( World w )
public EntityChargedQuartz( final World w )
{
super( w );
}
public EntityChargedQuartz( World w, double x, double y, double z, ItemStack is )
public EntityChargedQuartz( final World w, final double x, final double y, final double z, final ItemStack is )
{
super( w, x, y, z, is );
}
@@ -74,11 +74,11 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
}
this.delay++;
int j = MathHelper.floor_double( this.posX );
int i = MathHelper.floor_double( this.posY );
int k = MathHelper.floor_double( this.posZ );
final int j = MathHelper.floor_double( this.posX );
final int i = MathHelper.floor_double( this.posY );
final int k = MathHelper.floor_double( this.posZ );
Material mat = this.worldObj.getBlock( j, i, k ).getMaterial();
final Material mat = this.worldObj.getBlock( j, i, k ).getMaterial();
if( Platform.isServer() && mat.isLiquid() )
{
this.transformTime++;
@@ -98,22 +98,22 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
public boolean transform()
{
ItemStack item = this.getEntityItem();
final ItemStack item = this.getEntityItem();
final IMaterials materials = AEApi.instance().definitions().materials();
if( materials.certusQuartzCrystalCharged().isSameAs( item ) )
{
AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 );
List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 );
final List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
EntityItem redstone = null;
EntityItem netherQuartz = null;
for( Entity e : l )
for( final Entity e : l )
{
if( e instanceof EntityItem && !e.isDead )
{
ItemStack other = ( (EntityItem) e ).getEntityItem();
final ItemStack other = ( (EntityItem) e ).getEntityItem();
if( other != null && other.stackSize > 0 )
{
if( Platform.isSameItem( other, new ItemStack( Items.redstone ) ) )
@@ -150,7 +150,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
netherQuartz.setDead();
}
for( ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() )
for( final ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() )
{
final EntityItem entity = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, fluixCrystalStack );
@@ -33,7 +33,7 @@ public final class EntityFloatingItem extends EntityItem
int superDeath = 0;
float progress = 0;
public EntityFloatingItem( Entity parent, World world, double x, double y, double z, ItemStack stack )
public EntityFloatingItem( final Entity parent, final World world, final double x, final double y, final double z, final ItemStack stack )
{
super( world, x, y, z, stack );
this.motionX = this.motionY = this.motionZ = 0.0d;
@@ -61,7 +61,7 @@ public final class EntityFloatingItem extends EntityItem
this.age = ageStatic;
}
public void setProgress( float progress )
public void setProgress( final float progress )
{
this.progress = progress;
if( this.progress > 0.99 )
@@ -42,12 +42,12 @@ public final class EntityGrowingCrystal extends EntityItem
private int progress_1000 = 0;
public EntityGrowingCrystal( World w )
public EntityGrowingCrystal( final World w )
{
super( w );
}
public EntityGrowingCrystal( World w, double x, double y, double z, ItemStack is )
public EntityGrowingCrystal( final World w, final double x, final double y, final double z, final ItemStack is )
{
super( w, x, y, z, is );
}
@@ -67,23 +67,23 @@ public final class EntityGrowingCrystal extends EntityItem
this.age = 100;
}
ItemStack is = this.getEntityItem();
Item gc = is.getItem();
final ItemStack is = this.getEntityItem();
final Item gc = is.getItem();
if( gc instanceof IGrowableCrystal ) // if it changes this just stops being an issue...
{
int j = MathHelper.floor_double( this.posX );
int i = MathHelper.floor_double( this.posY );
int k = MathHelper.floor_double( this.posZ );
final int j = MathHelper.floor_double( this.posX );
final int i = MathHelper.floor_double( this.posY );
final int k = MathHelper.floor_double( this.posZ );
Block blk = this.worldObj.getBlock( j, i, k );
Material mat = blk.getMaterial();
IGrowableCrystal cry = (IGrowableCrystal) is.getItem();
final Block blk = this.worldObj.getBlock( j, i, k );
final Material mat = blk.getMaterial();
final IGrowableCrystal cry = (IGrowableCrystal) is.getItem();
float multiplier = cry.getMultiplier( blk, mat );
int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier );
final float multiplier = cry.getMultiplier( blk, mat );
final int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier );
boolean isClient = Platform.isClient();
final boolean isClient = Platform.isClient();
if( mat.isLiquid() )
{
@@ -152,7 +152,7 @@ public final class EntityGrowingCrystal extends EntityItem
}
}
private int getSpeed( int x, int y, int z )
private int getSpeed( final int x, final int y, final int z )
{
final int per = 80;
final float mul = 0.3f;
@@ -192,9 +192,9 @@ public final class EntityGrowingCrystal extends EntityItem
return qty;
}
private boolean isAccelerated( int x, int y, int z )
private boolean isAccelerated( final int x, final int y, final int z )
{
TileEntity te = this.worldObj.getTileEntity( x, y, z );
final TileEntity te = this.worldObj.getTileEntity( x, y, z );
return te instanceof ICrystalGrowthAccelerator && ( (ICrystalGrowthAccelerator) te ).isPowered();
}
+1 -1
View File
@@ -33,7 +33,7 @@ public final class EntityIds
{
}
public static int get( Class<? extends Entity> droppedEntity )
public static int get( final Class<? extends Entity> droppedEntity )
{
if( droppedEntity == EntityTinyTNTPrimed.class )
{
@@ -45,18 +45,18 @@ public final class EntitySingularity extends AEBaseEntityItem
private static int randTickSeed = 0;
@Reflected
public EntitySingularity( World w )
public EntitySingularity( final World w )
{
super( w );
}
public EntitySingularity( World w, double x, double y, double z, ItemStack is )
public EntitySingularity( final World w, final double x, final double y, final double z, final ItemStack is )
{
super( w, x, y, z, is );
}
@Override
public boolean attackEntityFrom( DamageSource src, float dmg )
public boolean attackEntityFrom( final DamageSource src, final float dmg )
{
if( src.isExplosion() )
{
@@ -79,24 +79,24 @@ public final class EntitySingularity extends AEBaseEntityItem
return;
}
ItemStack item = this.getEntityItem();
final ItemStack item = this.getEntityItem();
final IMaterials materials = AEApi.instance().definitions().materials();
if( materials.singularity().isSameAs( item ) )
{
AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
final List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
for( Entity e : l )
for( final Entity e : l )
{
if( e instanceof EntityItem )
{
ItemStack other = ( (EntityItem) e ).getEntityItem();
final ItemStack other = ( (EntityItem) e ).getEntityItem();
if( other != null )
{
boolean matches = false;
for( ItemStack is : OreDictionary.getOres( "dustEnder" ) )
for( final ItemStack is : OreDictionary.getOres( "dustEnder" ) )
{
if( OreDictionary.itemMatches( other, is, false ) )
{
@@ -108,7 +108,7 @@ public final class EntitySingularity extends AEBaseEntityItem
// check... other name.
if( !matches )
{
for( ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) )
for( final ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) )
{
if( OreDictionary.itemMatches( other, is, false ) )
{
@@ -128,9 +128,9 @@ public final class EntitySingularity extends AEBaseEntityItem
e.setDead();
}
for( ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() )
for( final ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() )
{
NBTTagCompound cmp = Platform.openNbtData( singularityStack );
final NBTTagCompound cmp = Platform.openNbtData( singularityStack );
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
randTickSeed++;
item.stackSize--;
@@ -47,13 +47,13 @@ import appeng.util.Platform;
public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData
{
@Reflected
public EntityTinyTNTPrimed( World w )
public EntityTinyTNTPrimed( final World w )
{
super( w );
this.setSize( 0.35F, 0.35F );
}
public EntityTinyTNTPrimed( World w, double x, double y, double z, EntityLivingBase igniter )
public EntityTinyTNTPrimed( final World w, final double x, final double y, final double z, final EntityLivingBase igniter )
{
super( w, x, y, z, igniter );
this.setSize( 0.55F, 0.55F );
@@ -86,7 +86,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
if( this.isInWater() && Platform.isServer() ) // put out the fuse.
{
for( ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() )
for( final ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() )
{
final EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, tntStack );
@@ -128,7 +128,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
return;
}
for( Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.getBoundingBox( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) )
for( final Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.getBoundingBox( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) )
{
if( e instanceof Entity )
{
@@ -139,7 +139,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
if( AEConfig.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) )
{
this.posY -= 0.25;
Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f );
final Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f );
for( int x = (int) ( this.posX - 2 ); x <= this.posX + 2; x++ )
{
@@ -147,12 +147,12 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
{
for( int z = (int) ( this.posZ - 2 ); z <= this.posZ + 2; z++ )
{
Block block = this.worldObj.getBlock( x, y, z );
final Block block = this.worldObj.getBlock( x, y, z );
if( block != null && !block.isAir( this.worldObj, x, y, z ) )
{
float strength = (float) ( 2.3f - ( ( ( x + 0.5f ) - this.posX ) * ( ( x + 0.5f ) - this.posX ) + ( ( y + 0.5f ) - this.posY ) * ( ( y + 0.5f ) - this.posY ) + ( ( z + 0.5f ) - this.posZ ) * ( ( z + 0.5f ) - this.posZ ) ) );
float resistance = block.getExplosionResistance( this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ );
final float resistance = block.getExplosionResistance( this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ );
strength -= ( resistance + 0.3F ) * 0.11f;
if( strength > 0.01 )
@@ -177,13 +177,13 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
}
@Override
public void writeSpawnData( ByteBuf data )
public void writeSpawnData( final ByteBuf data )
{
data.writeByte( this.fuse );
}
@Override
public void readSpawnData( ByteBuf data )
public void readSpawnData( final ByteBuf data )
{
this.fuse = data.readByte();
}
@@ -46,11 +46,11 @@ public class RenderFloatingItem extends RenderItem
}
@Override
public void doRender( EntityItem entityItem, double x, double y, double z, float yaw, float partialTick )
public void doRender( final EntityItem entityItem, final double x, final double y, final double z, final float yaw, final float partialTick )
{
if( entityItem instanceof EntityFloatingItem )
{
EntityFloatingItem efi = (EntityFloatingItem) entityItem;
final EntityFloatingItem efi = (EntityFloatingItem) entityItem;
if( efi.progress > 0.0 )
{
GL11.glPushMatrix();
@@ -46,12 +46,12 @@ public class RenderTinyTNTPrimed extends Render
}
@Override
public void doRender( Entity tnt, double x, double y, double z, float unused, float life )
public void doRender( final Entity tnt, final double x, final double y, final double z, final float unused, final float life )
{
this.renderPrimedTNT( (EntityTinyTNTPrimed) tnt, x, y, z, life );
}
public void renderPrimedTNT( EntityTinyTNTPrimed tnt, double x, double y, double z, float life )
public void renderPrimedTNT( final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float life )
{
GL11.glPushMatrix();
GL11.glTranslatef( (float) x, (float) y - 0.25f, (float) z );
@@ -73,7 +73,7 @@ public class RenderTinyTNTPrimed extends Render
f2 *= f2;
f2 *= f2;
float f3 = 1.0F + f2 * 0.3F;
final float f3 = 1.0F + f2 * 0.3F;
GL11.glScalef( f3, f3, f3 );
}
@@ -100,7 +100,7 @@ public class RenderTinyTNTPrimed extends Render
}
@Override
protected ResourceLocation getEntityTexture( Entity entity )
protected ResourceLocation getEntityTexture( final Entity entity )
{
return TextureMap.locationBlocksTexture;
}