final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 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.getBlockState( new BlockPos( j, i, k ) ).getBlock().getMaterial();
final Material mat = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock().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.fromBounds( 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.fromBounds( 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 );
@@ -32,7 +32,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;
@@ -60,7 +60,7 @@ public final class EntityFloatingItem extends EntityItem
this.setNoDespawn();
}
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 );
this.setNoDespawn();
@@ -63,23 +63,23 @@ public final class EntityGrowingCrystal extends EntityItem
return;
}
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.getBlockState( new BlockPos( j, i, k ) ).getBlock();
Material mat = blk.getMaterial();
IGrowableCrystal cry = (IGrowableCrystal) is.getItem();
final Block blk = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock();
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() )
{
@@ -148,7 +148,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;
@@ -188,9 +188,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( new BlockPos( x, y, z ) );
final TileEntity te = this.worldObj.getTileEntity( new BlockPos( 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 )
{
@@ -44,18 +44,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() )
{
@@ -78,24 +78,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.fromBounds( 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.fromBounds( 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 ) )
{
@@ -107,7 +107,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 ) )
{
@@ -127,9 +127,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.fromBounds( 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.fromBounds( 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, false, false );
final Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f, false, false );
for( int x = (int) ( this.posX - 2 ); x <= this.posX + 2; x++ )
{
@@ -147,14 +147,14 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
{
for( int z = (int) ( this.posZ - 2 ); z <= this.posZ + 2; z++ )
{
BlockPos point = new BlockPos( x,y,z);
IBlockState state = this.worldObj.getBlockState( point );
Block block = state.getBlock();
final BlockPos point = new BlockPos( x,y,z);
final IBlockState state = this.worldObj.getBlockState( point );
final Block block = state.getBlock();
if( block != null && !block.isAir( this.worldObj, point ) )
{
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.worldObj, point, this, ex );
final float resistance = block.getExplosionResistance( this.worldObj, point, this, ex );
strength -= ( resistance + 0.3F ) * 0.11f;
if( strength > 0.01 )
@@ -179,13 +179,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();
}
@@ -39,7 +39,7 @@ public class RenderFloatingItem extends RenderEntityItem
public static DoubleBuffer buffer = ByteBuffer.allocateDirect( 8 * 4 ).asDoubleBuffer();
public RenderFloatingItem(RenderManager manager)
public RenderFloatingItem( final RenderManager manager)
{
super(manager,Minecraft.getMinecraft().getRenderItem());
this.shadowOpaque = 0.0F;
@@ -47,16 +47,16 @@ public class RenderFloatingItem extends RenderEntityItem
@Override
public void doRender(
Entity entityItem,
double x,
double y,
double z,
float yaw,
float partialTick )
final Entity 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();
@@ -42,21 +42,21 @@ public class RenderTinyTNTPrimed extends Render
private final ModelGenerator blockRenderer = new ModelGenerator();
public RenderTinyTNTPrimed(RenderManager p_i46134_1_)
public RenderTinyTNTPrimed( final RenderManager p_i46134_1_)
{
super(p_i46134_1_);
this.shadowSize = 0.5F;
}
@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, unused, life );
}
public void renderPrimedTNT( EntityTinyTNTPrimed tnt, double x, double y, double z, float unused, float life )
public void renderPrimedTNT( final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float unused, final float life )
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
final BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y + 0.5F, (float)z);
float f2;
@@ -77,7 +77,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 );
}
@@ -111,7 +111,7 @@ public class RenderTinyTNTPrimed extends Render
}
@Override
protected ResourceLocation getEntityTexture( Entity entity )
protected ResourceLocation getEntityTexture( final Entity entity )
{
return TextureMap.locationBlocksTexture;
}