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
+47 -47
View File
@@ -77,7 +77,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@SideOnly( Side.CLIENT )
BlockRenderInfo renderInfo;
protected AEBaseBlock( Material mat )
protected AEBaseBlock( final Material mat )
{
this( mat, Optional.<String>absent() );
this.setLightOpacity( 255 );
@@ -86,7 +86,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
this.setHarvestLevel( "pickaxe", 0 );
}
protected AEBaseBlock( Material mat, Optional<String> subName )
protected AEBaseBlock( final Material mat, final Optional<String> subName )
{
super( mat );
@@ -139,11 +139,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.renderInfo;
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e );
}
@@ -155,12 +155,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return BaseBlockRender.class;
}
public IIcon unmappedGetIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return super.getIcon( w, x, y, z, s );
}
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
@@ -172,7 +172,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.handler;
}
protected final void setHandler( IFeatureHandler handler )
protected final void setHandler( final IFeatureHandler handler )
{
this.handler = handler;
}
@@ -202,19 +202,19 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return this.getIcon( this.mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
protected ICustomCollision getCustomCollision( World w, int x, int y, int z )
protected ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
if( this instanceof ICustomCollision )
{
@@ -226,15 +226,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SuppressWarnings( "unchecked" )
// NOTE: WAS FINAL, changed for Immibis
public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
public void addCollisionBoxesToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
if( collisionHandler != null && bb != null )
{
List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
collisionHandler.addCollidingBlockToList( w, x, y, z, bb, tmp, e );
for( AxisAlignedBB b : tmp )
for( final AxisAlignedBB b : tmp )
{
b.minX += x;
b.minY += y;
@@ -256,7 +256,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( final World w, final int x, final int y, final int z )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
@@ -272,11 +272,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
double lastDist = 0;
for( AxisAlignedBB bb : bbs )
for( final AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
@@ -305,7 +305,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
for( final AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
{
final double minX = Math.min( b.minX, bx.minX );
final double minY = Math.min( b.minY, bx.minY );
@@ -332,7 +332,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b )
public MovingObjectPosition collisionRayTrace( final World w, final int x, final int y, final int z, final Vec3 a, final Vec3 b )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
@@ -343,21 +343,21 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
double lastDist = 0;
for( AxisAlignedBB bb : bbs )
for( final AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
double xLen = ( a.xCoord - r.hitVec.xCoord );
double yLen = ( a.yCoord - r.hitVec.yCoord );
double zLen = ( a.zCoord - r.hitVec.zCoord );
final double xLen = ( a.xCoord - r.hitVec.xCoord );
final double yLen = ( a.yCoord - r.hitVec.yCoord );
final double zLen = ( a.zCoord - r.hitVec.zCoord );
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
{
lastDist = thisDist;
@@ -378,7 +378,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return super.collisionRayTrace( w, x, y, z, a, b );
}
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
return false;
}
@@ -386,7 +386,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void getSubBlocks( Item item, CreativeTabs tabs, List itemStacks )
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
{
this.getCheckedSubBlocks( item, tabs, itemStacks );
}
@@ -398,14 +398,14 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s )
{
return 0;
}
@Override
@SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
@@ -422,12 +422,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public final boolean isNormalCube( IBlockAccess world, int x, int y, int z )
public final boolean isNormalCube( final IBlockAccess world, final int x, final int y, final int z )
{
return this.isFullSize;
}
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
if( this instanceof IOrientableBlock )
{
@@ -437,7 +437,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
public final boolean rotateBlock( final World w, final int x, final int y, final int z, final ForgeDirection axis )
{
final IOrientable rotatable = this.getOrientable( w, x, y, z );
@@ -475,24 +475,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return false;
}
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
{
}
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return true;
}
@Override
public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z )
{
return new ForgeDirection[0];
}
@SideOnly( Side.CLIENT )
private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute )
private FlippableIcon optionalIcon( final IIconRegister ir, final String name, IIcon substitute )
{
// if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon )
@@ -507,13 +507,13 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
ResourceLocation resLoc = new ResourceLocation( name );
resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) );
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
final IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null )
{
return new FlippableIcon( ir.registerIcon( name ) );
}
}
catch( Throwable e )
catch( final Throwable e )
{
return new FlippableIcon( substitute );
}
@@ -523,12 +523,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getSubBlocks( item, tabs, itemStacks );
}
int mapRotation( IBlockAccess w, int x, int y, int z, int s )
int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
final IOrientable ori = this.getOrientable( w, x, y, z );
@@ -540,7 +540,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return s;
}
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
public ForgeDirection mapRotation( final IOrientable ori, final ForgeDirection dir )
{
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -557,12 +557,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return dir;
}
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
ForgeDirection west = ForgeDirection.UNKNOWN;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
{
@@ -601,17 +601,17 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@SideOnly( Side.CLIENT )
public void setRenderStateByMeta( int itemDamage )
public void setRenderStateByMeta( final int itemDamage )
{
}
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
return this.getUnlocalizedName();
}
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
{
}
@@ -49,7 +49,7 @@ public class AEBaseItemBlock extends ItemBlock
private final AEBaseBlock blockType;
public AEBaseItemBlock( Block id )
public AEBaseItemBlock( final Block id )
{
super( id );
this.blockType = (AEBaseBlock) id;
@@ -62,7 +62,7 @@ public class AEBaseItemBlock extends ItemBlock
}
@Override
public int getMetadata( int dmg )
public int getMetadata( final int dmg )
{
if( this.hasSubtypes )
{
@@ -74,31 +74,31 @@ public class AEBaseItemBlock extends ItemBlock
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips )
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
{
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
}
@SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
{
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
}
@Override
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 )
{
return false;
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
return this.blockType.getUnlocalizedName( is );
}
@Override
public boolean placeBlockAt( ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata )
public boolean placeBlockAt( final ItemStack stack, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata )
{
ForgeDirection up = ForgeDirection.UNKNOWN;
ForgeDirection forward = ForgeDirection.UNKNOWN;
@@ -133,7 +133,7 @@ public class AEBaseItemBlock extends ItemBlock
{
up = ForgeDirection.UP;
byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
switch( rotation )
{
@@ -186,7 +186,7 @@ public class AEBaseItemBlock extends ItemBlock
{
if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) )
{
AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
final AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
ori = tile;
if( tile == null )
@@ -42,18 +42,18 @@ import appeng.util.Platform;
public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage
{
public AEBaseItemBlockChargeable( Block id )
public AEBaseItemBlockChargeable( final Block id )
{
super( id );
}
@Override
@SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
{
final NBTTagCompound tag = itemStack.getTagCompound();
double internalCurrentPower = 0;
double internalMaxPower = this.getMaxEnergyCapacity();
final double internalMaxPower = this.getMaxEnergyCapacity();
if( tag != null )
{
@@ -69,7 +69,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
{
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
for( Block block : energyCell.maybeBlock().asSet() )
for( final Block block : energyCell.maybeBlock().asSet() )
{
if( blockID == block )
{
@@ -85,10 +85,10 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double injectAEPower( ItemStack is, double amt )
public double injectAEPower( final ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
double internalMaxPower = this.getMaxEnergyCapacity();
final double internalMaxPower = this.getMaxEnergyCapacity();
internalCurrentPower += amt;
if( internalCurrentPower > internalMaxPower )
{
@@ -102,20 +102,20 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
return 0;
}
private double getInternal( ItemStack is )
private double getInternal( final ItemStack is )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( ItemStack is, double amt )
private void setInternal( final ItemStack is, final double amt )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
}
@Override
public double extractAEPower( ItemStack is, double amt )
public double extractAEPower( final ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
if( internalCurrentPower > amt )
@@ -131,19 +131,19 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double getAEMaxPower( ItemStack is )
public double getAEMaxPower( final ItemStack is )
{
return this.getMaxEnergyCapacity();
}
@Override
public double getAECurrentPower( ItemStack is )
public double getAECurrentPower( final ItemStack is )
{
return this.getInternal( is );
}
@Override
public AccessRestriction getPowerFlow( ItemStack is )
public AccessRestriction getPowerFlow( final ItemStack is )
{
return AccessRestriction.WRITE;
}
@@ -9,7 +9,7 @@ import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab
{
public AEBaseItemBlockSlab( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab )
public AEBaseItemBlockSlab( final Block block, final AEBaseSlabBlock singleSlab, final AEBaseSlabBlock doubleSlab, final Boolean isDoubleSlab )
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
@@ -45,7 +45,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
private AEBaseSlabBlock doubleSlabs;
private final String name;
public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet<AEFeature> features, boolean isDoubleSlab, String name )
public AEBaseSlabBlock( final AEBaseBlock block, final int meta, final EnumSet<AEFeature> features, final boolean isDoubleSlab, final String name )
{
super( isDoubleSlab, block.getMaterial() );
this.block = block;
@@ -63,7 +63,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs( AEBaseSlabBlock slabs )
public AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
{
this.slabs = slabs;
return this;
@@ -92,30 +92,30 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
}
@Override
public IIcon getIcon( int dir, int meta )
public IIcon getIcon( final int dir, final int meta )
{
return this.block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b( int p_150002_1_ )
public String func_150002_b( final int p_150002_1_ )
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons( IIconRegister reg )
public void registerBlockIcons( final IIconRegister reg )
{
}
@Override
public Item getItemDropped( int meta, Random rand, int fortune )
public Item getItemDropped( final int meta, final Random rand, final int fortune )
{
return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z )
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
@@ -128,7 +128,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
block = this.slabs;
}
int meta = world.getBlockMetadata( x, y, z ) & 7;
final int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
}
@@ -36,7 +36,7 @@ public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature
{
private final IFeatureHandler features;
protected AEBaseStairBlock( Block block, int meta, EnumSet<AEFeature> features )
protected AEBaseStairBlock( final Block block, final int meta, final EnumSet<AEFeature> features )
{
super( block, meta );
+19 -19
View File
@@ -68,24 +68,24 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
@Nonnull
private Class<? extends TileEntity> tileEntityType;
public AEBaseTileBlock( Material mat )
public AEBaseTileBlock( final Material mat )
{
super( mat );
}
protected AEBaseTileBlock( Material mat, Optional<String> subName )
protected AEBaseTileBlock( final Material mat, final Optional<String> subName )
{
super( mat, subName );
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
protected void setTileEntity( Class<? extends TileEntity> c )
protected void setTileEntity( final Class<? extends TileEntity> c )
{
this.tileEntityType = c;
this.isInventory = IInventory.class.isAssignableFrom( c );
@@ -93,7 +93,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
// update Block value.
private void setTileProvider( boolean b )
private void setTileProvider( final boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
@@ -109,7 +109,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Nullable
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final int z )
{
if( !this.hasBlockTileEntity() )
{
@@ -126,7 +126,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
public final TileEntity createNewTileEntity( final World var1, final int var2 )
{
if( this.hasBlockTileEntity() )
{
@@ -134,11 +134,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
@@ -148,7 +148,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
@@ -172,7 +172,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public final ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z )
{
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
@@ -184,7 +184,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
{
final TileEntity te = this.getTileEntity( world, x, y, z );
@@ -206,7 +206,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
@@ -217,7 +217,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public boolean onBlockEventReceived( World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_ )
public boolean onBlockEventReceived( final World p_149696_1_, final int p_149696_2_, final int p_149696_3_, final int p_149696_4_, final int p_149696_5_, final int p_149696_6_ )
{
super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ );
final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ );
@@ -225,7 +225,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
public void onBlockPlacedBy( final World w, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack is )
{
if( is.hasDisplayName() )
{
@@ -238,7 +238,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public final boolean onBlockActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player != null )
{
@@ -264,7 +264,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
final ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
for( final ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
@@ -328,13 +328,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return this.getTileEntity( w, x, y, z );
}
@Override
public ICustomCollision getCustomCollision( World w, int x, int y, int z )
public ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
@@ -26,7 +26,7 @@ import net.minecraft.world.IBlockAccess;
public class AEDecorativeBlock extends AEBaseBlock
{
public AEDecorativeBlock( Material mat )
public AEDecorativeBlock( final Material mat )
{
super( mat );
}
@@ -38,7 +38,7 @@ public class AEDecorativeBlock extends AEBaseBlock
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return super.unmappedGetIcon( w, x, y, z, s );
}
@@ -52,11 +52,11 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
if( direction != ForgeDirection.SOUTH.ordinal() )
{
for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
for( final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
{
return craftingUnitBlock.getIcon( direction, metadata );
}
@@ -74,7 +74,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -47,7 +47,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata & ( ~4 ) )
{
@@ -75,7 +75,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
@@ -84,7 +84,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -65,7 +65,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -82,9 +82,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileCraftingTile tg = this.getTileEntity( w, x, y, z );
final TileCraftingTile tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
@@ -101,24 +101,24 @@ public class BlockCraftingUnit extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
}
@Override
public void setRenderStateByMeta( int itemDamage )
public void setRenderStateByMeta( final int itemDamage )
{
IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
final IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
final IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.breakCluster();
@@ -128,7 +128,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -138,15 +138,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
return this.getItemUnlocalizedName( is );
}
protected String getItemUnlocalizedName( ItemStack is )
protected String getItemUnlocalizedName( final ItemStack is )
{
return super.getUnlocalizedName( is );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.updateMultiBlock();
@@ -154,15 +154,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public int damageDropped( int meta )
public int damageDropped( final int meta )
{
return meta & 3;
}
@Override
public int getDamageValue( World w, int x, int y, int z )
public int getDamageValue( final World w, final int x, final int y, final int z )
{
int meta = w.getBlockMetadata( x, y, z );
final int meta = w.getBlockMetadata( x, y, z );
return this.damageDropped( meta );
}
}
@@ -60,7 +60,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
@Override
public boolean canRenderInPass( int pass )
public boolean canRenderInPass( final int pass )
{
booleanAlphaPass = pass == 1;
return pass == 0 || pass == 1;
@@ -74,9 +74,9 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
final TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
@@ -31,15 +31,15 @@ import appeng.core.features.AEFeature;
public class ItemCraftingStorage extends AEBaseItemBlock
{
public ItemCraftingStorage( Block id )
public ItemCraftingStorage( final Block id )
{
super( id );
}
@Override
public ItemStack getContainerItem( ItemStack itemStack )
public ItemStack getContainerItem( final ItemStack itemStack )
{
for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
for( final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
{
return stack;
}
@@ -48,7 +48,7 @@ public class ItemCraftingStorage extends AEBaseItemBlock
}
@Override
public boolean hasContainerItem( ItemStack stack )
public boolean hasContainerItem( final ItemStack stack )
{
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
}
@@ -62,7 +62,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player instanceof FakePlayer || player == null )
{
@@ -70,7 +70,7 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCrank )
{
if( ( (TileCrank) tile ).power() )
@@ -82,19 +82,19 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
private void dropCrank( World world, int x, int y, int z )
private void dropCrank( final World world, final int x, final int y, final int z )
{
world.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true );
world.markBlockForUpdate( x, y, z );
}
@Override
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack )
public void onBlockPlacedBy( final World world, final int x, final int y, final int z, final EntityLivingBase placer, final ItemStack itemStack )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
ForgeDirection mnt = this.findCrankable( world, x, y, z );
final ForgeDirection mnt = this.findCrankable( world, x, y, z );
ForgeDirection forward = ForgeDirection.UP;
if( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
{
@@ -109,15 +109,15 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World world, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
TileEntity te = world.getTileEntity( x, y, z );
final TileEntity te = world.getTileEntity( x, y, z );
return !( te instanceof TileCrank ) || this.isCrankable( world, x, y, z, up.getOpposite() );
}
private ForgeDirection findCrankable( World world, int x, int y, int z )
private ForgeDirection findCrankable( final World world, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.isCrankable( world, x, y, z, dir ) )
{
@@ -127,17 +127,17 @@ public class BlockCrank extends AEBaseTileBlock
return ForgeDirection.UNKNOWN;
}
private boolean isCrankable( World world, int x, int y, int z, ForgeDirection offset )
private boolean isCrankable( final World world, final int x, final int y, final int z, final ForgeDirection offset )
{
TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
final TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
return te instanceof ICrankable && ( (ICrankable) te ).canCrankAttach( offset.getOpposite() );
}
@Override
public void onNeighborBlockChange( World world, int x, int y, int z, Block block )
public void onNeighborBlockChange( final World world, final int x, final int y, final int z, final Block block )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
if( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) )
@@ -152,7 +152,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean canPlaceBlockAt( World world, int x, int y, int z )
public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z )
{
return this.findCrankable( world, x, y, z ) != ForgeDirection.UNKNOWN;
}
@@ -46,9 +46,9 @@ public class BlockGrinder extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileGrinder tg = this.getTileEntity( w, x, y, z );
final TileGrinder tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
@@ -45,14 +45,14 @@ public class BlockCellWorkbench extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
final TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -69,7 +69,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -78,7 +78,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
if( Platform.isServer() )
{
TileCharger tc = this.getTileEntity( w, x, y, z );
final TileCharger tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.activate( player );
@@ -90,7 +90,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -102,22 +102,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCharger )
{
TileCharger tc = (TileCharger) tile;
final TileCharger tc = (TileCharger) tile;
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
{
double xOff = 0.0;
double yOff = 0.0;
double zOff = 0.0;
final double xOff = 0.0;
final double yOff = 0.0;
final double zOff = 0.0;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -126,15 +126,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileCharger tile = this.getTileEntity( w, x, y, z );
final TileCharger tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
double twoPixels = 2.0 / 16.0;
ForgeDirection up = tile.getUp();
ForgeDirection forward = tile.getForward();
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
final double twoPixels = 2.0 / 16.0;
final ForgeDirection up = tile.getUp();
final ForgeDirection forward = tile.getForward();
final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
if( up.offsetX != 0 )
{
@@ -182,7 +182,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
@@ -45,7 +45,7 @@ public class BlockCondenser extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -54,7 +54,7 @@ public class BlockCondenser extends AEBaseTileBlock
if( Platform.isServer() )
{
TileCondenser tc = this.getTileEntity( w, x, y, z );
final TileCondenser tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CONDENSER );
@@ -55,14 +55,14 @@ public class BlockInscriber extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInscriber tg = this.getTileEntity( w, x, y, z );
final TileInscriber tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -54,14 +54,14 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInterface tg = this.getTileEntity( w, x, y, z );
final TileInterface tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -80,7 +80,7 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
{
if( rotatable instanceof TileInterface )
{
@@ -61,7 +61,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
{
@@ -72,11 +72,11 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void onNeighborChange( IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ )
public void onNeighborChange( final IBlockAccess world, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
{
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ );
TileLightDetector tld = this.getTileEntity( world, x, y, z );
final TileLightDetector tld = this.getTileEntity( world, x, y, z );
if( tld != null )
{
tld.updateLight();
@@ -85,7 +85,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
// cancel out lightning
}
@@ -97,28 +97,28 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
@@ -127,16 +127,16 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -144,9 +144,9 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
+12 -12
View File
@@ -66,27 +66,27 @@ public class BlockPaint extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z )
public AxisAlignedBB getCollisionBoundingBoxFromPool( final World world, final int x, final int y, final int z )
{
return null;
}
@Override
public boolean canCollideCheck( int metadata, boolean isHoldingRightClick )
public boolean canCollideCheck( final int metadata, final boolean isHoldingRightClick )
{
return false;
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TilePaint tp = this.getTileEntity( w, x, y, z );
final TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -95,19 +95,19 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public Item getItemDropped( int meta, Random random, int fortune )
public Item getItemDropped( final int meta, final Random random, final int fortune )
{
return null;
}
@Override
public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune )
public void dropBlockAsItemWithChance( final World world, final int x, final int y, final int z, final int meta, final float chance, final int fortune )
{
}
@Override
public void fillWithRain( World w, int x, int y, int z )
public void fillWithRain( final World w, final int x, final int y, final int z )
{
if( Platform.isServer() )
{
@@ -116,9 +116,9 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public int getLightValue( IBlockAccess w, int x, int y, int z )
public int getLightValue( final IBlockAccess w, final int x, final int y, final int z )
{
TilePaint tp = this.getTileEntity( w, x, y, z );
final TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -129,13 +129,13 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
{
return true;
}
@Override
public boolean isAir( IBlockAccess world, int x, int y, int z )
public boolean isAir( final IBlockAccess world, final int x, final int y, final int z )
{
return true;
}
@@ -62,23 +62,23 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
{
double d0 = r.nextFloat() - 0.5F;
double d1 = r.nextFloat() - 0.5F;
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;
ForgeDirection up = cga.getUp();
ForgeDirection forward = cga.getForward();
ForgeDirection west = Platform.crossProduct( forward, up );
final ForgeDirection up = cga.getUp();
final ForgeDirection forward = cga.getForward();
final ForgeDirection west = Platform.crossProduct( forward, up );
double rx = 0.5 + x;
double ry = 0.5 + y;
@@ -134,7 +134,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
ry += dz * forward.offsetY;
rz += dz * forward.offsetZ;
LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -69,28 +69,28 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
@@ -100,7 +100,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -112,15 +112,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
return;
}
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@@ -128,16 +128,16 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -145,9 +145,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -53,14 +53,14 @@ public class BlockSecurity extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSecurity tg = this.getTileEntity( w, x, y, z );
final TileSecurity tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isClient() )
@@ -64,21 +64,21 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return Blocks.iron_block.getIcon( direction, metadata );
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
// :P
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
if( sc != null )
{
return false;
@@ -86,23 +86,23 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
ForgeDirection up = sc.getForward();
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
final ForgeDirection up = sc.getForward();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -110,9 +110,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -123,12 +123,12 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileSkyCompass tile = this.getTileEntity( w, x, y, z );
final TileSkyCompass tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -185,7 +185,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{
}
@@ -83,13 +83,13 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return new FullIcon( Blocks.tnt.getIcon( direction, metadata ) );
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
{
@@ -105,23 +105,23 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
// no images required.
}
public void startFuse( World w, int x, int y, int z, EntityLivingBase igniter )
public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter )
{
if( !w.isRemote )
{
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
}
}
@Override
public void onBlockAdded( World w, int x, int y, int z )
public void onBlockAdded( final World w, final int x, final int y, final int z )
{
super.onBlockAdded( w, x, y, z );
@@ -133,7 +133,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
if( w.isBlockIndirectlyGettingPowered( x, y, z ) )
{
@@ -143,22 +143,22 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onBlockDestroyedByExplosion( World w, int x, int y, int z, Explosion exp )
public void onBlockDestroyedByExplosion( final World w, final int x, final int y, final int z, final Explosion exp )
{
if( !w.isRemote )
{
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8;
w.spawnEntityInWorld( primedTinyTNTEntity );
}
}
@Override
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity entity )
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity entity )
{
if( entity instanceof EntityArrow && !w.isRemote )
{
EntityArrow entityarrow = (EntityArrow) entity;
final EntityArrow entityarrow = (EntityArrow) entity;
if( entityarrow.isBurning() )
{
@@ -169,19 +169,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public boolean canDropFromExplosion( Explosion exp )
public boolean canDropFromExplosion( final Explosion exp )
{
return false;
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
return Collections.singletonList( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
@@ -51,10 +51,10 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
IIcon ico = super.getIcon( w, x, y, z, s );
TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
final IIcon ico = super.getIcon( w, x, y, z, s );
final TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) )
{
@@ -65,7 +65,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -74,7 +74,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
if( Platform.isServer() )
{
TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
final TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
@@ -86,36 +86,36 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileVibrationChamber )
{
TileVibrationChamber tc = (TileVibrationChamber) tile;
final TileVibrationChamber tc = (TileVibrationChamber) tile;
if( tc.isOn )
{
float f1 = x + 0.5F;
float f2 = y + 0.5F;
float f3 = z + 0.5F;
ForgeDirection forward = tc.getForward();
ForgeDirection up = tc.getUp();
final ForgeDirection forward = tc.getForward();
final ForgeDirection up = tc.getUp();
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
f1 += forward.offsetX * 0.6;
f2 += forward.offsetY * 0.6;
f3 += forward.offsetZ * 0.6;
float ox = r.nextFloat();
float oy = r.nextFloat() * 0.2f;
final float ox = r.nextFloat();
final float oy = r.nextFloat() * 0.2f;
f1 += up.offsetX * ( -0.3 + oy );
f2 += up.offsetY * ( -0.3 + oy );
@@ -102,19 +102,19 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void randomDisplayTick( World world, int x, int y, int z, Random r )
public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r )
{
this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block meh )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block meh )
{
this.cb( w, x, y, z ).onNeighborChanged();
}
@Override
public Item getItemDropped( int i, Random r, int k )
public Item getItemDropped( final int i, final Random r, final int k )
{
return null;
}
@@ -130,13 +130,13 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public int colorMultiplier( IBlockAccess world, int x, int y, int z )
public int colorMultiplier( final IBlockAccess world, final int x, final int y, final int z )
{
return this.myColorMultiplier;
}
@Override
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@@ -148,21 +148,21 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity e )
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity e )
{
this.cb( w, x, y, z ).onEntityCollision( e );
}
@Override
public int isProvidingStrongPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingStrongPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@Override
public int getLightValue( IBlockAccess world, int x, int y, int z )
public int getLightValue( final IBlockAccess world, final int x, final int y, final int z )
{
Block block = world.getBlock( x, y, z );
final Block block = world.getBlock( x, y, z );
if( block != null && block != this )
{
return block.getLightValue( world, x, y, z );
@@ -175,30 +175,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean isLadder( IBlockAccess world, int x, int y, int z, EntityLivingBase entity )
public boolean isLadder( final IBlockAccess world, final int x, final int y, final int z, final EntityLivingBase entity )
{
return this.cb( world, x, y, z ).isLadder( entity );
}
@Override
public boolean isSideSolid( IBlockAccess w, int x, int y, int z, ForgeDirection side )
public boolean isSideSolid( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side )
{
return this.cb( w, x, y, z ).isSolidOnSide( side );
}
@Override
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
{
return this.cb( world, x, y, z ).isEmpty();
}
@SuppressWarnings( "deprecation" )
@Override
public boolean removedByPlayer( World world, EntityPlayer player, int x, int y, int z )
public boolean removedByPlayer( final World world, final EntityPlayer player, final int x, final int y, final int z )
{
if( player.capabilities.isCreativeMode )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
tile.disableDrops();
@@ -209,7 +209,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canConnectRedstone( IBlockAccess w, int x, int y, int z, int side )
public boolean canConnectRedstone( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
switch( side )
{
@@ -229,7 +229,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canRenderInPass( int pass )
public boolean canRenderInPass( final int pass )
{
BusRenderHelper.INSTANCE.setPass( pass );
@@ -242,10 +242,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player )
{
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
final Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
final SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
if( sp.part != null )
{
@@ -261,24 +261,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addHitEffects( World world, MovingObjectPosition target, EffectRenderer effectRenderer )
public boolean addHitEffects( final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer )
{
Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
final Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
if( object instanceof IPartHost )
{
IPartHost host = (IPartHost) object;
final IPartHost host = (IPartHost) object;
for( ForgeDirection side : ForgeDirection.values() )
for( final ForgeDirection side : ForgeDirection.values() )
{
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
final byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -286,14 +286,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
double d0 = target.blockX + ( i1 + 0.5D ) / b0;
double d1 = target.blockY + ( j1 + 0.5D ) / b0;
double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
final double d0 = target.blockX + ( i1 + 0.5D ) / b0;
final double d1 = target.blockY + ( j1 + 0.5D ) / b0;
final double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
double dd0 = target.hitVec.xCoord;
double dd1 = target.hitVec.yCoord;
double dd2 = target.hitVec.zCoord;
EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
final double dd0 = target.hitVec.xCoord;
final double dd1 = target.hitVec.yCoord;
final double dd2 = target.hitVec.zCoord;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
fx.setParticleIcon( ico );
@@ -309,24 +309,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addDestroyEffects( World world, int x, int y, int z, int meta, EffectRenderer effectRenderer )
public boolean addDestroyEffects( final World world, final int x, final int y, final int z, final int meta, final EffectRenderer effectRenderer )
{
Object object = this.cb( world, x, y, z );
final Object object = this.cb( world, x, y, z );
if( object instanceof IPartHost )
{
IPartHost host = (IPartHost) object;
final IPartHost host = (IPartHost) object;
for( ForgeDirection side : ForgeDirection.values() )
for( final ForgeDirection side : ForgeDirection.values() )
{
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = 3;
final byte b0 = 3;
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -334,10 +334,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
double d0 = x + ( i1 + 0.5D ) / b0;
double d1 = y + ( j1 + 0.5D ) / b0;
double d2 = z + ( k1 + 0.5D ) / b0;
EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
final double d0 = x + ( i1 + 0.5D ) / b0;
final double d1 = y + ( j1 + 0.5D ) / b0;
final double d2 = z + ( k1 + 0.5D ) / b0;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
fx.setParticleIcon( ico );
@@ -352,7 +352,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
public void onNeighborChange( final IBlockAccess w, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
{
if( Platform.isServer() )
{
@@ -360,7 +360,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
}
private IIcon getIcon( IPart p )
private IIcon getIcon( final IPart p )
{
if( p == null )
{
@@ -369,18 +369,18 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
try
{
IIcon ico = p.getBreakingTexture();
final IIcon ico = p.getBreakingTexture();
if( ico != null )
{
return ico;
}
}
catch( Throwable t )
catch( final Throwable t )
{
// nothing.
}
ItemStack is = p.getItemStack( PartItemStack.Network );
final ItemStack is = p.getItemStack( PartItemStack.Network );
if( is == null || is.getItem() == null )
{
return null;
@@ -389,9 +389,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return is.getItem().getIcon( is, 0 );
}
private ICableBusContainer cb( IBlockAccess w, int x, int y, int z )
private ICableBusContainer cb( final IBlockAccess w, final int x, final int y, final int z )
{
TileEntity te = w.getTileEntity( x, y, z );
final TileEntity te = w.getTileEntity( x, y, z );
ICableBusContainer out = null;
if( te instanceof TileCableBus )
@@ -413,15 +413,15 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return this.getIcon( s, 0 );
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
IIcon i = super.getIcon( direction, metadata );
final IIcon i = super.getIcon( direction, metadata );
if( i != null )
{
return i;
@@ -431,30 +431,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
{
return this.recolourBlock( world, x, y, z, side, colour, null );
}
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour, final EntityPlayer who )
{
try
{
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( Throwable ignored )
catch( final Throwable ignored )
{
}
return false;
@@ -462,15 +462,15 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final int z )
{
TileEntity te = w.getTileEntity( x, y, z );
final TileEntity te = w.getTileEntity( x, y, z );
if( noTesrTile.isInstance( te ) )
{
@@ -486,7 +486,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
@@ -507,12 +507,12 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@Method( iname = IntegrationType.MFR )
public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side )
public RedNetConnectionType getConnectionType( final World world, final int x, final int y, final int z, final ForgeDirection side )
{
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
}
public void setRenderColor( int color )
public void setRenderColor( final int color )
{
this.myColorMultiplier = color;
}
@@ -44,9 +44,9 @@ public class BlockController extends AEBaseTileBlock
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block neighborBlock )
{
TileController tc = this.getTileEntity( w, x, y, z );
final TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.onNeighborChange( false );
@@ -38,7 +38,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -61,7 +61,7 @@ public class BlockEnergyCell extends AEBaseTileBlock
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -87,12 +87,12 @@ public class BlockEnergyCell extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
ItemStack charged = new ItemStack( this, 1 );
NBTTagCompound tag = Platform.openNbtData( charged );
final ItemStack charged = new ItemStack( this, 1 );
final NBTTagCompound tag = Platform.openNbtData( charged );
tag.setDouble( "internalCurrentPower", this.getMaxPower() );
tag.setDouble( "internalMaxPower", this.getMaxPower() );
@@ -60,14 +60,14 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileWireless tg = this.getTileEntity( w, x, y, z );
final TileWireless tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -80,12 +80,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileWireless tile = this.getTileEntity( w, x, y, z );
final TileWireless tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -142,12 +142,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
TileWireless tile = this.getTileEntity( w, x, y, z );
final TileWireless tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -35,11 +35,11 @@ import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
public BlockQuantumBase( Material mat )
public BlockQuantumBase( final Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
final float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
@@ -47,9 +47,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
@@ -57,9 +57,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
@@ -50,9 +50,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int bx, int by, int bz, Random r )
public void randomDisplayTick( final World w, final int bx, final int by, final int bz, final Random r )
{
TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz );
final TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz );
if( bridge != null )
{
if( bridge.hasQES() )
@@ -66,14 +66,14 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
final TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -86,16 +86,16 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
double onePixel = 2.0 / 16.0;
final double onePixel = 2.0 / 16.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
double onePixel = 2.0 / 16.0;
final double onePixel = 2.0 / 16.0;
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
}
@@ -39,10 +39,10 @@ public class BlockQuantumRing extends BlockQuantumBase
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
onePixel = 4.0 / 16.0;
@@ -55,10 +55,10 @@ public class BlockQuantumRing extends BlockQuantumBase
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
onePixel = 4.0 / 16.0;
@@ -52,9 +52,9 @@ public class BlockQuartzGlass extends AEBaseBlock
}
@Override
public boolean shouldSideBeRendered( IBlockAccess w, int x, int y, int z, int side )
public boolean shouldSideBeRendered( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
Material mat = w.getBlock( x, y, z ).getMaterial();
final Material mat = w.getBlock( x, y, z ).getMaterial();
if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE )
{
if( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
@@ -46,7 +46,7 @@ public class BlockQuartzLamp extends BlockQuartzGlass
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -55,11 +55,11 @@ public class BlockQuartzLamp extends BlockQuartzGlass
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
double d0 = ( r.nextFloat() - 0.5F ) * 0.96D;
double d1 = ( r.nextFloat() - 0.5F ) * 0.96D;
double d2 = ( r.nextFloat() - 0.5F ) * 0.96D;
final double d0 = ( r.nextFloat() - 0.5F ) * 0.96D;
final double d1 = ( r.nextFloat() - 0.5F ) * 0.96D;
final double d2 = ( r.nextFloat() - 0.5F ) * 0.96D;
VibrantFX fx = new VibrantFX( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D );
final VibrantFX fx = new VibrantFX( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@@ -78,11 +78,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@SubscribeEvent
public void breakFaster( PlayerEvent.BreakSpeed event )
public void breakFaster( final PlayerEvent.BreakSpeed event )
{
if( event.block == this && event.entityPlayer != null )
{
ItemStack is = event.entityPlayer.inventory.getCurrentItem();
final ItemStack is = event.entityPlayer.inventory.getCurrentItem();
int level = -1;
if( is != null && is.getItem() != null )
@@ -98,13 +98,13 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public int damageDropped( int meta )
public int damageDropped( final int meta )
{
return meta;
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player )
{
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
@@ -113,7 +113,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public void onBlockAdded( World w, int x, int y, int z )
public void onBlockAdded( final World w, final int x, final int y, final int z )
{
super.onBlockAdded( w, x, y, z );
if( Platform.isServer() )
@@ -140,7 +140,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -162,7 +162,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
@Override
@SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister ir )
public void registerBlockIcons( final IIconRegister ir )
{
super.registerBlockIcons( ir );
this.block = ir.registerIcon( this.getTextureName() + ".Block" );
@@ -172,7 +172,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
if( metadata == 1 )
{
@@ -190,14 +190,14 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public void setRenderStateByMeta( int metadata )
public void setRenderStateByMeta( final int metadata )
{
this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) );
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
@@ -207,7 +207,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public void breakBlock( World w, int x, int y, int z, Block b, int metadata )
public void breakBlock( final World w, final int x, final int y, final int z, final Block b, final int metadata )
{
super.breakBlock( w, x, y, z, b, metadata );
if( Platform.isServer() )
@@ -63,7 +63,7 @@ public class OreQuartz extends AEBaseBlock
}
@Override
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
public int getMixedBrightnessForBlock( final IBlockAccess par1iBlockAccess, final int par2, final int par3, final int par4 )
{
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
if( this.enhanceBrightness )
@@ -89,16 +89,16 @@ public class OreQuartz extends AEBaseBlock
}
@Override
public int quantityDropped( Random rand )
public int quantityDropped( final Random rand )
{
return 1 + rand.nextInt( 2 );
}
@Nullable
@Override
public Item getItemDropped( int id, Random rand, int meta )
public Item getItemDropped( final int id, final Random rand, final int meta )
{
for( Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() )
for( final Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() )
{
return crystalItem;
}
@@ -107,22 +107,22 @@ public class OreQuartz extends AEBaseBlock
}
@Override
public void dropBlockAsItemWithChance( World w, int x, int y, int z, int blockID, float something, int meta )
public void dropBlockAsItemWithChance( final World w, final int x, final int y, final int z, final int blockID, final float something, final int meta )
{
super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta );
if( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) )
{
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
final int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
this.dropXpOnBlockBreak( w, x, y, z, xp );
}
}
@Override
public int damageDropped( int id )
public int damageDropped( final int id )
{
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() )
for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
@@ -131,7 +131,7 @@ public class OreQuartz extends AEBaseBlock
}
@Override
public int quantityDroppedWithBonus( int fortune, Random rand )
public int quantityDroppedWithBonus( final int fortune, final Random rand )
{
if( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) )
{
@@ -150,17 +150,17 @@ public class OreQuartz extends AEBaseBlock
}
}
public void setBoostBrightnessLow( int boostBrightnessLow )
public void setBoostBrightnessLow( final int boostBrightnessLow )
{
this.boostBrightnessLow = boostBrightnessLow;
}
public void setBoostBrightnessHigh( int boostBrightnessHigh )
public void setBoostBrightnessHigh( final int boostBrightnessHigh )
{
this.boostBrightnessHigh = boostBrightnessHigh;
}
public void setEnhanceBrightness( boolean enhanceBrightness )
public void setEnhanceBrightness( final boolean enhanceBrightness )
{
this.enhanceBrightness = enhanceBrightness;
}
@@ -49,9 +49,9 @@ public class OreQuartzCharged extends OreQuartz
@Nullable
@Override
public Item getItemDropped( int id, Random rand, int meta )
public Item getItemDropped( final int id, final Random rand, final int meta )
{
for( Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() )
for( final Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() )
{
return charged;
}
@@ -60,9 +60,9 @@ public class OreQuartzCharged extends OreQuartz
}
@Override
public int damageDropped( int id )
public int damageDropped( final int id )
{
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
@@ -72,7 +72,7 @@ public class OreQuartzCharged extends OreQuartz
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -110,7 +110,7 @@ public class OreQuartzCharged extends OreQuartz
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f );
final ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -64,45 +64,45 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
return Arrays.asList( new AxisAlignedBB[] {} );// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 )
// } );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
@Override
public boolean canPlaceBlockAt( World world, int x, int y, int z )
public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z )
{
return false;
}
@Override
public void onBlockExploded( World world, int x, int y, int z, Explosion explosion )
public void onBlockExploded( final World world, final int x, final int y, final int z, final Explosion explosion )
{
// Don't explode.
}
@Override
public boolean canEntityDestroy( IBlockAccess world, int x, int y, int z, Entity entity )
public boolean canEntityDestroy( final IBlockAccess world, final int x, final int y, final int z, final Entity entity )
{
return false;
}
@@ -45,9 +45,9 @@ public class BlockSpatialIOPort extends AEBaseTileBlock
}
@Override
public final void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public final void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
final TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
@@ -55,14 +55,14 @@ public class BlockSpatialIOPort extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
final TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -44,9 +44,9 @@ public class BlockSpatialPylon extends AEBaseTileBlock
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
final TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
tsp.onNeighborBlockChange();
@@ -54,9 +54,9 @@ public class BlockSpatialPylon extends AEBaseTileBlock
}
@Override
public int getLightValue( IBlockAccess w, int x, int y, int z )
public int getLightValue( final IBlockAccess w, final int x, final int y, final int z )
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
final TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
return tsp.getLightValue();
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class ChiseledQuartzStairBlock extends AEBaseStairBlock
{
public ChiseledQuartzStairBlock( Block block )
public ChiseledQuartzStairBlock( final Block block )
{
super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class FluixStairBlock extends AEBaseStairBlock
{
public FluixStairBlock( Block block )
public FluixStairBlock( final Block block )
{
super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class QuartzPillarStairBlock extends AEBaseStairBlock
{
public QuartzPillarStairBlock( Block block )
public QuartzPillarStairBlock( final Block block )
{
super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class QuartzStairBlock extends AEBaseStairBlock
{
public QuartzStairBlock( Block block )
public QuartzStairBlock( final Block block )
{
super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class SkyStoneBlockStairBlock extends AEBaseStairBlock
{
public SkyStoneBlockStairBlock( Block block, Integer meta )
public SkyStoneBlockStairBlock( final Block block, final Integer meta )
{
super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class SkyStoneBrickStairBlock extends AEBaseStairBlock
{
public SkyStoneBrickStairBlock( Block block, Integer meta )
public SkyStoneBrickStairBlock( final Block block, final Integer meta )
{
super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class SkyStoneSmallBrickStairBlock extends AEBaseStairBlock
{
public SkyStoneSmallBrickStairBlock( Block block, int meta )
public SkyStoneSmallBrickStairBlock( final Block block, final int meta )
{
super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -29,7 +29,7 @@ import appeng.core.features.AEFeature;
public class SkyStoneStairBlock extends AEBaseStairBlock
{
public SkyStoneStairBlock( Block block, Integer meta )
public SkyStoneStairBlock( final Block block, final Integer meta )
{
super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -56,9 +56,9 @@ public class BlockChest extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileChest tg = this.getTileEntity( w, x, y, z );
final TileChest tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
if( Platform.isClient() )
@@ -72,10 +72,10 @@ public class BlockChest extends AEBaseTileBlock
}
else
{
ItemStack cell = tg.getStackInSlot( 1 );
final ItemStack cell = tg.getStackInSlot( 1 );
if( cell != null )
{
ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
tg.openGui( p, ch, cell, side );
}
@@ -52,14 +52,14 @@ public class BlockDrive extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileDrive tg = this.getTileEntity( w, x, y, z );
final TileDrive tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -45,9 +45,9 @@ public class BlockIOPort extends AEBaseTileBlock
}
@Override
public final void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public final void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TileIOPort te = this.getTileEntity( w, x, y, z );
final TileIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
@@ -55,14 +55,14 @@ public class BlockIOPort extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileIOPort tg = this.getTileEntity( w, x, y, z );
final TileIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -68,13 +68,13 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
}
@Override
public int damageDropped( int metadata )
public int damageDropped( final int metadata )
{
return metadata;
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player )
{
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
@@ -90,9 +90,9 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
for( Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() )
for( final Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() )
{
return skyStoneBlock.getIcon( direction, metadata );
}
@@ -101,7 +101,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( Platform.isServer() )
{
@@ -112,13 +112,13 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
@@ -126,7 +126,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -137,9 +137,9 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileSkyChest sk = this.getTileEntity( w, x, y, z );
final TileSkyChest sk = this.getTileEntity( w, x, y, z );
ForgeDirection o = ForgeDirection.UNKNOWN;
if( sk != null )
@@ -147,16 +147,16 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
o = sk.getUp();
}
double offsetX = o.offsetX == 0 ? 0.06 : 0.0;
double offsetY = o.offsetY == 0 ? 0.06 : 0.0;
double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0;
final double offsetX = o.offsetX == 0 ? 0.06 : 0.0;
final double offsetY = o.offsetY == 0 ? 0.06 : 0.0;
final double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0;
double sc = 0.06;
final double sc = 0.06;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
}
+56 -56
View File
@@ -92,16 +92,16 @@ public class ClientHelper extends ServerHelper
private static final RenderBlocks BLOCK_RENDERER = new RenderBlocks();
@SubscribeEvent
public void postPlayerRender( RenderLivingEvent.Pre p )
public void postPlayerRender( final RenderLivingEvent.Pre p )
{
PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() );
final PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() );
if( player != null )
{
AEColor col = player.myColor;
final AEColor col = player.myColor;
float r = 0xff & ( col.mediumVariant >> 16 );
float g = 0xff & ( col.mediumVariant >> 8 );
float b = 0xff & ( col.mediumVariant );
final float r = 0xff & ( col.mediumVariant >> 16 );
final float g = 0xff & ( col.mediumVariant >> 8 );
final float b = 0xff & ( col.mediumVariant );
GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f );
}
}
@@ -126,9 +126,9 @@ public class ClientHelper extends ServerHelper
}
@Override
public void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk )
public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk )
{
BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
final BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
if( bbr.hasTESR() && tile != null )
{
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );
@@ -140,7 +140,7 @@ public class ClientHelper extends ServerHelper
{
if( Platform.isClient() )
{
List<EntityPlayer> o = new ArrayList<EntityPlayer>();
final List<EntityPlayer> o = new ArrayList<EntityPlayer>();
o.add( Minecraft.getMinecraft().thePlayer );
return o;
}
@@ -151,7 +151,7 @@ public class ClientHelper extends ServerHelper
}
@Override
public void spawnEffect( EffectType effect, World worldObj, double posX, double posY, double posZ, Object o )
public void spawnEffect( final EffectType effect, final World worldObj, final double posX, final double posY, final double posZ, final Object o )
{
if( AEConfig.instance.enableEffects )
{
@@ -180,34 +180,34 @@ public class ClientHelper extends ServerHelper
}
}
private void spawnAssembler( World worldObj, double posX, double posY, double posZ, Object o )
private void spawnAssembler( final World worldObj, final double posX, final double posY, final double posZ, final Object o )
{
PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o;
final PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o;
AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is );
final AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
private void spawnVibrant( World w, double x, double y, double z )
private void spawnVibrant( final World w, final double x, final double y, final double z )
{
if( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) )
{
double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
double d2 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
final double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
final double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
final double d2 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D;
VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D );
final VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
private void spawnCrafting( World w, double posX, double posY, double posZ )
private void spawnCrafting( final World w, final double posX, final double posY, final double posZ )
{
float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond );
final CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond );
fx.motionX = -x * 0.2;
fx.motionY = -y * 0.2;
@@ -216,13 +216,13 @@ public class ClientHelper extends ServerHelper
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
private void spawnEnergy( World w, double posX, double posY, double posZ )
private void spawnEnergy( final World w, final double posX, final double posY, final double posZ )
{
float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f;
EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond );
final EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond );
fx.motionX = -x * 0.1;
fx.motionY = -y * 0.1;
@@ -231,22 +231,22 @@ public class ClientHelper extends ServerHelper
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
private void spawnLightning( World worldObj, double posX, double posY, double posZ )
private void spawnLightning( final World worldObj, final double posX, final double posY, final double posZ )
{
LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f );
final LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
private void spawnLightningArc( World worldObj, double posX, double posY, double posZ, Vec3 second )
private void spawnLightningArc( final World worldObj, final double posX, final double posY, final double posZ, final Vec3 second )
{
LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f );
final LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@Override
public boolean shouldAddParticles( Random r )
public boolean shouldAddParticles( final Random r )
{
int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
final int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
if( setting == 2 )
{
return false;
@@ -265,11 +265,11 @@ public class ClientHelper extends ServerHelper
}
@Override
public void doRenderItem( ItemStack itemstack, World w )
public void doRenderItem( final ItemStack itemstack, final World w )
{
if( itemstack != null )
{
EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack );
final EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack );
entityitem.getEntityItem().stackSize = 1;
// set all this stuff and then do shit? meh?
@@ -290,7 +290,7 @@ public class ClientHelper extends ServerHelper
GL11.glScalef( 1.0f, -1.0f, 0.005f );
// GL11.glScalef( 1.0f , -1.0f, 1.0f );
Block block = Block.getBlockFromItem( itemstack.getItem() );
final Block block = Block.getBlockFromItem( itemstack.getItem() );
if( ( itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( block.getRenderType() ) ) )
{
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
@@ -298,7 +298,7 @@ public class ClientHelper extends ServerHelper
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
}
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY );
final IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY );
if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) )
{
if( customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D ) )
@@ -333,7 +333,7 @@ public class ClientHelper extends ServerHelper
GL11.glScalef( 1.0f, 1.0f, 0.005f );
RenderItem.renderInFrame = false;
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
if( !ForgeHooksClient.renderInventoryItem( BLOCK_RENDERER, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0 ) )
{
ITEM_RENDERER.renderItemIntoGUI( fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false );
@@ -360,8 +360,8 @@ public class ClientHelper extends ServerHelper
return super.getRenderMode();
}
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
final Minecraft mc = Minecraft.getMinecraft();
final EntityPlayer player = mc.thePlayer;
return this.renderModeForPlayer( player );
}
@@ -369,19 +369,19 @@ public class ClientHelper extends ServerHelper
@Override
public void triggerUpdates()
{
Minecraft mc = Minecraft.getMinecraft();
final Minecraft mc = Minecraft.getMinecraft();
if( mc == null || mc.thePlayer == null || mc.theWorld == null )
{
return;
}
EntityPlayer player = mc.thePlayer;
final EntityPlayer player = mc.thePlayer;
int x = (int) player.posX;
int y = (int) player.posY;
int z = (int) player.posZ;
final int x = (int) player.posX;
final int y = (int) player.posY;
final int z = (int) player.posZ;
int range = 16 * 16;
final int range = 16 * 16;
mc.theWorld.markBlockRangeForRenderUpdate( x - range, y - range, z - range, x + range, y + range, z + range );
}
@@ -393,16 +393,16 @@ public class ClientHelper extends ServerHelper
}
@SubscribeEvent
public void wheelEvent( MouseEvent me )
public void wheelEvent( final MouseEvent me )
{
if( me.isCanceled() || me.dwheel == 0 )
{
return;
}
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
ItemStack is = player.getHeldItem();
final Minecraft mc = Minecraft.getMinecraft();
final EntityPlayer player = mc.thePlayer;
final ItemStack is = player.getHeldItem();
if( is != null && is.getItem() instanceof IMouseWheelItem && player.isSneaking() )
{
@@ -411,7 +411,7 @@ public class ClientHelper extends ServerHelper
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Item", me.dwheel > 0 ? "WheelUp" : "WheelDown" ) );
me.setCanceled( true );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -419,11 +419,11 @@ public class ClientHelper extends ServerHelper
}
@SubscribeEvent
public void updateTextureSheet( TextureStitchEvent.Pre ev )
public void updateTextureSheet( final TextureStitchEvent.Pre ev )
{
if( ev.map.getTextureType() == 1 )
{
for( ExtraItemTextures et : ExtraItemTextures.values() )
for( final ExtraItemTextures et : ExtraItemTextures.values() )
{
et.registerIcon( ev.map );
}
@@ -431,12 +431,12 @@ public class ClientHelper extends ServerHelper
if( ev.map.getTextureType() == 0 )
{
for( ExtraBlockTextures et : ExtraBlockTextures.values() )
for( final ExtraBlockTextures et : ExtraBlockTextures.values() )
{
et.registerIcon( ev.map );
}
for( CableBusTextures cb : CableBusTextures.values() )
for( final CableBusTextures cb : CableBusTextures.values() )
{
cb.registerIcon( ev.map );
}
+91 -91
View File
@@ -96,28 +96,28 @@ public abstract class AEBaseGui extends GuiContainer
boolean useNEI = false;
private boolean subGui;
public AEBaseGui( Container container )
public AEBaseGui( final Container container )
{
super( container );
this.subGui = switchingGuis;
switchingGuis = false;
}
protected static String join( Collection<String> toolTip, String delimiter )
protected static String join( final Collection<String> toolTip, final String delimiter )
{
final Joiner joiner = Joiner.on( delimiter );
return joiner.join( toolTip );
}
protected int getQty( GuiButton btn )
protected int getQty( final GuiButton btn )
{
try
{
DecimalFormat df = new DecimalFormat( "+#;-#" );
final DecimalFormat df = new DecimalFormat( "+#;-#" );
return df.parse( btn.displayString ).intValue();
}
catch( ParseException e )
catch( final ParseException e )
{
return 0;
}
@@ -134,7 +134,7 @@ public abstract class AEBaseGui extends GuiContainer
super.initGui();
final List<Slot> slots = this.getInventorySlots();
Iterator<Slot> i = slots.iterator();
final Iterator<Slot> i = slots.iterator();
while( i.hasNext() )
{
if( i.next() instanceof SlotME )
@@ -143,7 +143,7 @@ public abstract class AEBaseGui extends GuiContainer
}
}
for( InternalSlotME me : this.meSlots )
for( final InternalSlotME me : this.meSlots )
{
slots.add( new SlotME( me ) );
}
@@ -156,22 +156,22 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
super.drawScreen( mouseX, mouseY, btn );
boolean hasClicked = Mouse.isButtonDown( 0 );
final boolean hasClicked = Mouse.isButtonDown( 0 );
if( hasClicked && this.myScrollBar != null )
{
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
}
for( Object c : this.buttonList )
for( final Object c : this.buttonList )
{
if( c instanceof ITooltip )
{
ITooltip tooltip = (ITooltip) c;
int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
final ITooltip tooltip = (ITooltip) c;
final int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition;
if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() )
@@ -183,7 +183,7 @@ public abstract class AEBaseGui extends GuiContainer
y = 15;
}
String msg = tooltip.getMessage();
final String msg = tooltip.getMessage();
if( msg != null )
{
this.drawTooltip( x + 11, y + 4, 0, msg );
@@ -194,14 +194,14 @@ public abstract class AEBaseGui extends GuiContainer
}
}
public void drawTooltip( int par2, int par3, int forceWidth, String message )
public void drawTooltip( final int par2, final int par3, final int forceWidth, final String message )
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
RenderHelper.disableStandardItemLighting();
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL11.GL_DEPTH_TEST );
String[] var4 = message.split( "\n" );
final String[] var4 = message.split( "\n" );
if( var4.length > 0 )
{
@@ -240,14 +240,14 @@ public abstract class AEBaseGui extends GuiContainer
this.zLevel = 300.0F;
itemRender.zLevel = 300.0F;
int var10 = -267386864;
final int var10 = -267386864;
this.drawGradientRect( var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10 );
this.drawGradientRect( var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10 );
this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10 );
this.drawGradientRect( var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10 );
this.drawGradientRect( var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10 );
int var11 = 1347420415;
int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216;
final int var11 = 1347420415;
final int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216;
this.drawGradientRect( var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12 );
this.drawGradientRect( var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12 );
this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11 );
@@ -283,10 +283,10 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected final void drawGuiContainerForegroundLayer( int x, int y )
protected final void drawGuiContainerForegroundLayer( final int x, final int y )
{
int ox = this.guiLeft; // (width - xSize) / 2;
int oy = this.guiTop; // (height - ySize) / 2;
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
if( this.myScrollBar != null )
@@ -300,19 +300,19 @@ public abstract class AEBaseGui extends GuiContainer
public abstract void drawFG( int offsetX, int offsetY, int mouseX, int mouseY );
@Override
protected final void drawGuiContainerBackgroundLayer( float f, int x, int y )
protected final void drawGuiContainerBackgroundLayer( final float f, final int x, final int y )
{
int ox = this.guiLeft; // (width - xSize) / 2;
int oy = this.guiTop; // (height - ySize) / 2;
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
this.drawBG( ox, oy, x, y );
final List<Slot> slots = this.getInventorySlots();
for( Slot slot : slots )
for( final Slot slot : slots )
{
if( slot instanceof OptionalSlotFake )
{
OptionalSlotFake fs = (OptionalSlotFake) slot;
final OptionalSlotFake fs = (OptionalSlotFake) slot;
if( fs.renderDisabled() )
{
if( fs.isEnabled() )
@@ -334,15 +334,15 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected void mouseClicked( int xCoord, int yCoord, int btn )
protected void mouseClicked( final int xCoord, final int yCoord, final int btn )
{
this.drag_click.clear();
if( btn == 1 )
{
for( Object o : this.buttonList )
for( final Object o : this.buttonList )
{
GuiButton guibutton = (GuiButton) o;
final GuiButton guibutton = (GuiButton) o;
if( guibutton.mousePressed( this.mc, xCoord, yCoord ) )
{
super.mouseClicked( xCoord, yCoord, 0 );
@@ -355,19 +355,19 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected void mouseClickMove( int x, int y, int c, long d )
protected void mouseClickMove( final int x, final int y, final int c, final long d )
{
Slot slot = this.getSlot( x, y );
ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack();
final Slot slot = this.getSlot( x, y );
final ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack();
if( slot instanceof SlotFake && itemstack != null )
{
this.drag_click.add( slot );
if( this.drag_click.size() > 1 )
{
for( Slot dr : this.drag_click )
for( final Slot dr : this.drag_click )
{
PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
NetworkHandler.instance.sendToServer( p );
}
}
@@ -379,9 +379,9 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected void handleMouseClick( Slot slot, int slotIdx, int ctrlDown, int key )
protected void handleMouseClick( final Slot slot, final int slotIdx, final int ctrlDown, final int key )
{
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if( slot instanceof SlotFake )
{
@@ -392,7 +392,7 @@ public abstract class AEBaseGui extends GuiContainer
return;
}
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
return;
@@ -409,7 +409,7 @@ public abstract class AEBaseGui extends GuiContainer
{
NetworkHandler.instance.sendToServer( ( (SlotPatternTerm) slot ).getRequest( key == 1 ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -431,7 +431,7 @@ public abstract class AEBaseGui extends GuiContainer
action = ctrlDown == 1 ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
}
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
return;
@@ -455,7 +455,7 @@ public abstract class AEBaseGui extends GuiContainer
}
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
NetworkHandler.instance.sendToServer( p );
return;
}
@@ -490,7 +490,7 @@ public abstract class AEBaseGui extends GuiContainer
if( action != null )
{
PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id );
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id );
NetworkHandler.instance.sendToServer( p );
}
@@ -528,7 +528,7 @@ public abstract class AEBaseGui extends GuiContainer
}
else if( player.capabilities.isCreativeMode )
{
IAEItemStack slotItem = ( (SlotME) slot ).getAEStack();
final IAEItemStack slotItem = ( (SlotME) slot ).getAEStack();
if( slotItem != null )
{
action = InventoryAction.CREATIVE_DUPLICATE;
@@ -544,7 +544,7 @@ public abstract class AEBaseGui extends GuiContainer
if( action != null )
{
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
NetworkHandler.instance.sendToServer( p );
}
@@ -574,7 +574,7 @@ public abstract class AEBaseGui extends GuiContainer
// a replica of the weird broken vanilla feature.
final List<Slot> slots = this.getInventorySlots();
for( Slot inventorySlot : slots )
for( final Slot inventorySlot : slots )
{
if( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, this.dbl_whichItem, true ) )
{
@@ -590,15 +590,15 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected boolean checkHotbarKeys( int keyCode )
protected boolean checkHotbarKeys( final int keyCode )
{
Slot theSlot;
final Slot theSlot;
try
{
theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" );
}
catch( Throwable t )
catch( final Throwable t )
{
return false;
}
@@ -610,7 +610,7 @@ public abstract class AEBaseGui extends GuiContainer
if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
{
final List<Slot> slots = this.getInventorySlots();
for( Slot s : slots )
for( final Slot s : slots )
{
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
{
@@ -628,7 +628,7 @@ public abstract class AEBaseGui extends GuiContainer
}
else
{
for( Slot s : slots )
for( final Slot s : slots )
{
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
{
@@ -651,10 +651,10 @@ public abstract class AEBaseGui extends GuiContainer
this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
}
protected Slot getSlot( int mouseX, int mouseY )
protected Slot getSlot( final int mouseX, final int mouseY )
{
final List<Slot> slots = this.getInventorySlots();
for( Slot slot : slots )
for( final Slot slot : slots )
{
// isPointInRegion
if( this.func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) )
@@ -673,11 +673,11 @@ public abstract class AEBaseGui extends GuiContainer
{
super.handleMouseInput();
int i = Mouse.getEventDWheel();
final int i = Mouse.getEventDWheel();
if( i != 0 && isShiftKeyDown() )
{
int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
final int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
}
else if( i != 0 && this.myScrollBar != null )
@@ -686,21 +686,21 @@ public abstract class AEBaseGui extends GuiContainer
}
}
protected void mouseWheelEvent( int x, int y, int wheel )
protected void mouseWheelEvent( final int x, final int y, final int wheel )
{
Slot slot = this.getSlot( x, y );
final Slot slot = this.getSlot( x, y );
if( slot instanceof SlotME )
{
IAEItemStack item = ( (SlotME) slot ).getAEStack();
final IAEItemStack item = ( (SlotME) slot ).getAEStack();
if( item != null )
{
( (AEBaseContainer) this.inventorySlots ).setTargetStack( item );
InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
int times = Math.abs( wheel );
final InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
final int times = Math.abs( wheel );
final int inventorySize = this.getInventorySlots().size();
for( int h = 0; h < times; h++ )
{
PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 );
final PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 );
NetworkHandler.instance.sendToServer( p );
}
}
@@ -712,13 +712,13 @@ public abstract class AEBaseGui extends GuiContainer
return true;
}
public void bindTexture( String base, String file )
public void bindTexture( final String base, final String file )
{
ResourceLocation loc = new ResourceLocation( base, "textures/" + file );
final ResourceLocation loc = new ResourceLocation( base, "textures/" + file );
this.mc.getTextureManager().bindTexture( loc );
}
protected void drawItem( int x, int y, ItemStack is )
protected void drawItem( final int x, final int y, final ItemStack is )
{
this.zLevel = 100.0F;
itemRender.zLevel = 100.0F;
@@ -735,7 +735,7 @@ public abstract class AEBaseGui extends GuiContainer
this.zLevel = 0.0F;
}
protected String getGuiDisplayName( String in )
protected String getGuiDisplayName( final String in )
{
return this.hasCustomInventoryName() ? this.getInventoryName() : in;
}
@@ -754,16 +754,16 @@ public abstract class AEBaseGui extends GuiContainer
return ( (AEBaseContainer) this.inventorySlots ).customName;
}
public void a( Slot s )
public void a( final Slot s )
{
this.drawSlot( s );
}
public void drawSlot( Slot s )
public void drawSlot( final Slot s )
{
if( s instanceof SlotME )
{
RenderItem pIR = this.setItemRender( this.aeRenderItem );
final RenderItem pIR = this.setItemRender( this.aeRenderItem );
try
{
this.zLevel = 100.0F;
@@ -783,7 +783,7 @@ public abstract class AEBaseGui extends GuiContainer
this.safeDrawSlot( s );
}
catch( Exception err )
catch( final Exception err )
{
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
}
@@ -794,45 +794,45 @@ public abstract class AEBaseGui extends GuiContainer
{
try
{
ItemStack is = s.getStack();
final ItemStack is = s.getStack();
if( s instanceof AppEngSlot && ( ( (AppEngSlot) s ).renderIconWithItem() || is == null ) && ( ( (AppEngSlot) s ).shouldDisplay() ) )
{
AppEngSlot aes = (AppEngSlot) s;
final AppEngSlot aes = (AppEngSlot) s;
if( aes.getIcon() >= 0 )
{
this.bindTexture( "guis/states.png" );
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
Tessellator tessellator = Tessellator.instance;
final Tessellator tessellator = Tessellator.instance;
try
{
int uv_y = (int) Math.floor( aes.getIcon() / 16 );
int uv_x = aes.getIcon() - uv_y * 16;
final int uv_y = (int) Math.floor( aes.getIcon() / 16 );
final int uv_x = aes.getIcon() - uv_y * 16;
GL11.glEnable( GL11.GL_BLEND );
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glEnable( GL11.GL_TEXTURE_2D );
GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
float par1 = aes.xDisplayPosition;
float par2 = aes.yDisplayPosition;
float par3 = uv_x * 16;
float par4 = uv_y * 16;
final float par1 = aes.xDisplayPosition;
final float par2 = aes.yDisplayPosition;
final float par3 = uv_x * 16;
final float par4 = uv_y * 16;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() );
float f1 = 0.00390625F;
float f = 0.00390625F;
float par6 = 16;
final float f1 = 0.00390625F;
final float f = 0.00390625F;
final float par6 = 16;
tessellator.addVertexWithUV( par1 + 0, par2 + par6, this.zLevel, ( par3 + 0 ) * f, ( par4 + par6 ) * f1 );
float par5 = 16;
final float par5 = 16;
tessellator.addVertexWithUV( par1 + par5, par2 + par6, this.zLevel, ( par3 + par5 ) * f, ( par4 + par6 ) * f1 );
tessellator.addVertexWithUV( par1 + par5, par2 + 0, this.zLevel, ( par3 + par5 ) * f, ( par4 + 0 ) * f1 );
tessellator.addVertexWithUV( par1 + 0, par2 + 0, this.zLevel, ( par3 + 0 ) * f, ( par4 + 0 ) * f1 );
tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, 1.0f );
tessellator.draw();
}
catch( Exception err )
catch( final Exception err )
{
}
GL11.glPopAttrib();
@@ -850,7 +850,7 @@ public abstract class AEBaseGui extends GuiContainer
{
isValid = ( (SlotRestrictedInput) s ).isValid( is, this.mc.theWorld );
}
catch( Exception err )
catch( final Exception err )
{
AELog.error( err );
}
@@ -884,7 +884,7 @@ public abstract class AEBaseGui extends GuiContainer
return;
}
catch( Exception err )
catch( final Exception err )
{
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
}
@@ -893,7 +893,7 @@ public abstract class AEBaseGui extends GuiContainer
this.safeDrawSlot( s );
}
private RenderItem setItemRender( RenderItem item )
private RenderItem setItemRender( final RenderItem item )
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
{
@@ -901,7 +901,7 @@ public abstract class AEBaseGui extends GuiContainer
}
else
{
RenderItem ri = itemRender;
final RenderItem ri = itemRender;
itemRender = item;
return ri;
}
@@ -912,24 +912,24 @@ public abstract class AEBaseGui extends GuiContainer
return true;
}
private void safeDrawSlot( Slot s )
private void safeDrawSlot( final Slot s )
{
try
{
GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
}
catch( Exception err )
catch( final Exception err )
{
}
}
public void bindTexture( String file )
public void bindTexture( final String file )
{
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file );
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file );
this.mc.getTextureManager().bindTexture( loc );
}
public void func_146977_a( Slot s )
public void func_146977_a( final Slot s )
{
this.drawSlot( s );
}
@@ -36,28 +36,28 @@ import appeng.core.localization.ButtonToolTips;
public abstract class AEBaseMEGui extends AEBaseGui
{
public AEBaseMEGui( Container container )
public AEBaseMEGui( final Container container )
{
super( container );
}
public List<String> handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List<String> currentToolTip )
public List<String> handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List<String> currentToolTip )
{
if( stack != null )
{
Slot s = this.getSlot( mouseX, mouseY );
final Slot s = this.getSlot( mouseX, mouseY );
if( s instanceof SlotME )
{
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
IAEItemStack myStack = null;
try
{
SlotME theSlotField = (SlotME) s;
final SlotME theSlotField = (SlotME) s;
myStack = theSlotField.getAEStack();
}
catch( Throwable ignore )
catch( final Throwable ignore )
{
}
@@ -97,28 +97,28 @@ public abstract class AEBaseMEGui extends AEBaseGui
// Vanilla version...
// protected void drawItemStackTooltip(ItemStack stack, int x, int y)
@Override
protected void renderToolTip( ItemStack stack, int x, int y )
protected void renderToolTip( final ItemStack stack, final int x, final int y )
{
Slot s = this.getSlot( x, y );
final Slot s = this.getSlot( x, y );
if( s instanceof SlotME && stack != null )
{
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
IAEItemStack myStack = null;
try
{
SlotME theSlotField = (SlotME) s;
final SlotME theSlotField = (SlotME) s;
myStack = theSlotField.getAEStack();
}
catch( Throwable ignore )
catch( final Throwable ignore )
{
}
if( myStack != null )
{
@SuppressWarnings( "unchecked" )
List<String> currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
final List<String> currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
{
@@ -134,7 +134,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
}
else if( stack.stackSize > BigNumber )
{
List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
final List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) );
this.drawTooltip( x, y, 0, join( var4, "\n" ) );
return;
+3 -3
View File
@@ -25,18 +25,18 @@ import net.minecraft.inventory.Container;
public class GuiNull extends AEBaseGui
{
public GuiNull( Container container )
public GuiNull( final Container container )
{
super( container );
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
}
@@ -36,16 +36,16 @@ import appeng.core.AppEng;
public class AEConfigGui extends GuiConfig
{
public AEConfigGui( GuiScreen parent )
public AEConfigGui( final GuiScreen parent )
{
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance.getFilePath() ) );
}
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
final List<IConfigElement> list = new ArrayList<IConfigElement>();
for( String cat : AEConfig.instance.getCategoryNames() )
for( final String cat : AEConfig.instance.getCategoryNames() )
{
if( cat.equals( "versionchecker" ) )
{
@@ -57,14 +57,14 @@ public class AEConfigGui extends GuiConfig
continue;
}
ConfigCategory cc = AEConfig.instance.getCategory( cat );
final ConfigCategory cc = AEConfig.instance.getCategory( cat );
if( cc.isChild() )
{
continue;
}
ConfigElement ce = new ConfigElement( cc );
final ConfigElement ce = new ConfigElement( cc );
list.add( ce );
}
@@ -31,7 +31,7 @@ public class AEConfigGuiFactory implements IModGuiFactory
{
@Override
public void initialize( Minecraft minecraftInstance )
public void initialize( final Minecraft minecraftInstance )
{
}
@@ -49,7 +49,7 @@ public class AEConfigGuiFactory implements IModGuiFactory
}
@Override
public RuntimeOptionGuiHandler getHandlerFor( RuntimeOptionCategoryElement element )
public RuntimeOptionGuiHandler getHandlerFor( final RuntimeOptionCategoryElement element )
{
return null;
}
@@ -54,7 +54,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
GuiImgButton partition;
GuiToggleButton copyMode;
public GuiCellWorkbench( InventoryPlayer inventoryPlayer, TileCellWorkbench te )
public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te )
{
super( new ContainerCellWorkbench( inventoryPlayer, te ) );
this.workbench = (ContainerCellWorkbench) this.inventorySlots;
@@ -77,7 +77,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.handleButtonVisibility();
@@ -95,7 +95,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18 );
this.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7 );
int dx = this.workbench.availableUpgrades() - 8;
final int dx = this.workbench.availableUpgrades() - 8;
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
@@ -114,7 +114,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18 );
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7 );
int dx = this.workbench.availableUpgrades() - 16;
final int dx = this.workbench.availableUpgrades() - 16;
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
@@ -138,10 +138,10 @@ public class GuiCellWorkbench extends GuiUpgradeable
this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE );
boolean hasFuzzy = false;
IInventory inv = this.workbench.getCellUpgradeInventory();
final IInventory inv = this.workbench.getCellUpgradeInventory();
for( int x = 0; x < inv.getSizeInventory(); x++ )
{
ItemStack is = inv.getStackInSlot( x );
final ItemStack is = inv.getStackInSlot( x );
if( is != null && is.getItem() instanceof IUpgradeModule )
{
if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY )
@@ -172,7 +172,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
try
{
@@ -190,7 +190,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
}
else if( btn == this.fuzzyMode )
{
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue();
fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() );
@@ -202,7 +202,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
super.actionPerformed( btn );
}
}
catch( IOException ignored )
catch( final IOException ignored )
{
}
}
@@ -37,14 +37,14 @@ public class GuiChest extends AEBaseGui
GuiTabButton priority;
public GuiChest( InventoryPlayer inventoryPlayer, TileChest te )
public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te )
{
super( new ContainerChest( inventoryPlayer, te ) );
this.ySize = 166;
}
@Override
protected void actionPerformed( GuiButton par1GuiButton )
protected void actionPerformed( final GuiButton par1GuiButton )
{
super.actionPerformed( par1GuiButton );
@@ -63,14 +63,14 @@ public class GuiChest extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/chest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -43,7 +43,7 @@ public class GuiCondenser extends AEBaseGui
GuiProgressBar pb;
GuiImgButton mode;
public GuiCondenser( InventoryPlayer inventoryPlayer, TileCondenser te )
public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te )
{
super( new ContainerCondenser( inventoryPlayer, te ) );
this.cvc = (ContainerCondenser) this.inventorySlots;
@@ -51,11 +51,11 @@ public class GuiCondenser extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( this.mode == btn )
{
@@ -77,7 +77,7 @@ public class GuiCondenser extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -87,7 +87,7 @@ public class GuiCondenser extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/condenser.png" );
@@ -64,7 +64,7 @@ public class GuiCraftAmount extends AEBaseGui
private GuiBridge originalGui;
@Reflected
public GuiCraftAmount( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiCraftAmount( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( new ContainerCraftAmount( inventoryPlayer, te ) );
}
@@ -74,10 +74,10 @@ public class GuiCraftAmount extends AEBaseGui
{
super.initGui();
int a = AEConfig.instance.craftItemsByStackAmounts( 0 );
int b = AEConfig.instance.craftItemsByStackAmounts( 1 );
int c = AEConfig.instance.craftItemsByStackAmounts( 2 );
int d = AEConfig.instance.craftItemsByStackAmounts( 3 );
final int a = AEConfig.instance.craftItemsByStackAmounts( 0 );
final int b = AEConfig.instance.craftItemsByStackAmounts( 1 );
final int c = AEConfig.instance.craftItemsByStackAmounts( 2 );
final int d = AEConfig.instance.craftItemsByStackAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) );
@@ -92,13 +92,13 @@ public class GuiCraftAmount extends AEBaseGui
this.buttonList.add( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) );
ItemStack myIcon = null;
Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
final IDefinitions definitions = AEApi.instance().definitions();
final IParts parts = definitions.parts();
if( target instanceof WirelessTerminalGuiObject )
{
for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
{
myIcon = wirelessTerminalStack;
}
@@ -108,7 +108,7 @@ public class GuiCraftAmount extends AEBaseGui
if( target instanceof PartTerminal )
{
for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
{
myIcon = stack;
}
@@ -117,7 +117,7 @@ public class GuiCraftAmount extends AEBaseGui
if( target instanceof PartCraftingTerminal )
{
for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
{
myIcon = stack;
}
@@ -126,7 +126,7 @@ public class GuiCraftAmount extends AEBaseGui
if( target instanceof PartPatternTerminal )
{
for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
{
myIcon = stack;
}
@@ -148,13 +148,13 @@ public class GuiCraftAmount extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal();
@@ -166,7 +166,7 @@ public class GuiCraftAmount extends AEBaseGui
Long.parseLong( this.amountToCraft.getText() );
this.next.enabled = this.amountToCraft.getText().length() > 0;
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
this.next.enabled = false;
}
@@ -175,7 +175,7 @@ public class GuiCraftAmount extends AEBaseGui
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -206,13 +206,13 @@ public class GuiCraftAmount extends AEBaseGui
out = "0";
}
long result = Long.parseLong( out );
final long result = Long.parseLong( out );
if( result < 0 )
{
this.amountToCraft.setText( "1" );
}
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
// :P
}
@@ -225,7 +225,7 @@ public class GuiCraftAmount extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
@@ -242,14 +242,14 @@ public class GuiCraftAmount extends AEBaseGui
NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
}
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
// nope..
this.amountToCraft.setText( "1" );
}
boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
@@ -257,7 +257,7 @@ public class GuiCraftAmount extends AEBaseGui
}
}
private void addQty( int i )
private void addQty( final int i )
{
try
{
@@ -297,7 +297,7 @@ public class GuiCraftAmount extends AEBaseGui
Integer.parseInt( out );
this.amountToCraft.setText( out );
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
// :P
}
@@ -74,7 +74,7 @@ public class GuiCraftConfirm extends AEBaseGui
GuiButton selectCPU;
int tooltip = -1;
public GuiCraftConfirm( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( new ContainerCraftConfirm( inventoryPlayer, te ) );
this.xSize = 238;
@@ -131,25 +131,25 @@ public class GuiCraftConfirm extends AEBaseGui
}
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
this.updateCPUButtonText();
this.start.enabled = !( this.ccc.noCPU || this.isSimulation() );
this.selectCPU.enabled = !this.isSimulation();
int gx = ( this.width - this.xSize ) / 2;
int gy = ( this.height - this.ySize ) / 2;
final int gx = ( this.width - this.xSize ) / 2;
final int gy = ( this.height - this.ySize ) / 2;
this.tooltip = -1;
int offY = 23;
final int offY = 23;
int y = 0;
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY;
final int minX = gx + 9 + x * 67;
final int minY = gy + 22 + y * offY;
if( minX < mouseX && minX + 67 > mouseX )
{
@@ -179,7 +179,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
if( this.ccc.myName.length() > 0 )
{
String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) );
final String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) );
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
}
else
@@ -202,11 +202,11 @@ public class GuiCraftConfirm extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
long BytesUsed = this.ccc.bytesUsed;
String byteUsed = NumberFormat.getInstance().format( BytesUsed );
String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
final long BytesUsed = this.ccc.bytesUsed;
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
String dsp = null;
@@ -220,36 +220,36 @@ public class GuiCraftConfirm extends AEBaseGui
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
}
int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
this.fontRendererObj.drawString( dsp, offset, 165, 4210752 );
int sectionLength = 67;
final int sectionLength = 67;
int x = 0;
int y = 0;
int xo = 9;
int yo = 22;
int viewStart = this.myScrollBar.getCurrentScroll() * 3;
int viewEnd = viewStart + 3 * this.rows;
final int xo = 9;
final int yo = 22;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
final int viewEnd = viewStart + 3 * this.rows;
String dspToolTip = "";
List<String> lineList = new LinkedList<String>();
final List<String> lineList = new LinkedList<String>();
int toolPosX = 0;
int toolPosY = 0;
int offY = 23;
final int offY = 23;
for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ )
{
IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
if( refStack != null )
{
GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 );
IAEItemStack stored = this.storage.findPrecise( refStack );
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
IAEItemStack missingStack = this.missing.findPrecise( refStack );
final IAEItemStack stored = this.storage.findPrecise( refStack );
final IAEItemStack pendingStack = this.pending.findPrecise( refStack );
final IAEItemStack missingStack = this.missing.findPrecise( refStack );
int lines = 0;
@@ -266,7 +266,7 @@ public class GuiCraftConfirm extends AEBaseGui
lines++;
}
int negY = ( ( lines - 1 ) * 5 ) / 2;
final int negY = ( ( lines - 1 ) * 5 ) / 2;
int downY = 0;
if( stored != null && stored.getStackSize() > 0 )
@@ -282,7 +282,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
str = GuiText.FromStorage.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
@@ -307,7 +307,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
str = GuiText.Missing.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
@@ -332,7 +332,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
str = GuiText.ToCraft.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
@@ -342,10 +342,10 @@ public class GuiCraftConfirm extends AEBaseGui
}
GL11.glPopMatrix();
int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
int posY = y * offY + yo;
final int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
final int posY = y * offY + yo;
ItemStack is = refStack.copy().getItemStack();
final ItemStack is = refStack.copy().getItemStack();
if( this.tooltip == z - viewStart )
{
@@ -364,8 +364,8 @@ public class GuiCraftConfirm extends AEBaseGui
if( red )
{
int startX = x * ( 1 + sectionLength ) + xo;
int startY = posY - 4;
final int startX = x * ( 1 + sectionLength ) + xo;
final int startY = posY - 4;
drawRect( startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000 );
}
@@ -388,7 +388,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.setScrollBar();
this.bindTexture( "guis/craftingreport.png" );
@@ -397,41 +397,41 @@ public class GuiCraftConfirm extends AEBaseGui
private void setScrollBar()
{
int size = this.visual.size();
final int size = this.visual.size();
this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
}
public void postUpdate( List<IAEItemStack> list, byte ref )
public void postUpdate( final List<IAEItemStack> list, final byte ref )
{
switch( ref )
{
case 0:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
case 2:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.missing, l );
}
break;
}
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
long amt = this.getTotal( l );
final long amt = this.getTotal( l );
if( amt <= 0 )
{
@@ -439,7 +439,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
else
{
IAEItemStack is = this.findVisualStack( l );
final IAEItemStack is = this.findVisualStack( l );
is.setStackSize( amt );
}
}
@@ -447,7 +447,7 @@ public class GuiCraftConfirm extends AEBaseGui
this.setScrollBar();
}
private void handleInput( IItemList<IAEItemStack> s, IAEItemStack l )
private void handleInput( final IItemList<IAEItemStack> s, final IAEItemStack l )
{
IAEItemStack a = s.findPrecise( l );
@@ -473,11 +473,11 @@ public class GuiCraftConfirm extends AEBaseGui
}
}
private long getTotal( IAEItemStack is )
private long getTotal( final IAEItemStack is )
{
IAEItemStack a = this.storage.findPrecise( is );
IAEItemStack c = this.pending.findPrecise( is );
IAEItemStack m = this.missing.findPrecise( is );
final IAEItemStack a = this.storage.findPrecise( is );
final IAEItemStack c = this.pending.findPrecise( is );
final IAEItemStack m = this.missing.findPrecise( is );
long total = 0;
@@ -499,12 +499,12 @@ public class GuiCraftConfirm extends AEBaseGui
return total;
}
private void deleteVisualStack( IAEItemStack l )
private void deleteVisualStack( final IAEItemStack l )
{
Iterator<IAEItemStack> i = this.visual.iterator();
final Iterator<IAEItemStack> i = this.visual.iterator();
while( i.hasNext() )
{
IAEItemStack o = i.next();
final IAEItemStack o = i.next();
if( o.equals( l ) )
{
i.remove();
@@ -513,9 +513,9 @@ public class GuiCraftConfirm extends AEBaseGui
}
}
private IAEItemStack findVisualStack( IAEItemStack l )
private IAEItemStack findVisualStack( final IAEItemStack l )
{
for( IAEItemStack o : this.visual )
for( final IAEItemStack o : this.visual )
{
if( o.equals( l ) )
{
@@ -523,13 +523,13 @@ public class GuiCraftConfirm extends AEBaseGui
}
}
IAEItemStack stack = l.copy();
final IAEItemStack stack = l.copy();
this.visual.add( stack );
return stack;
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -542,11 +542,11 @@ public class GuiCraftConfirm extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.selectCPU )
{
@@ -554,7 +554,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -571,7 +571,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) );
}
catch( Throwable e )
catch( final Throwable e )
{
AELog.error( e );
}
@@ -92,12 +92,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private GuiButton cancel;
private int tooltip = -1;
public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te )
public GuiCraftingCPU( final InventoryPlayer inventoryPlayer, final Object te )
{
this( new ContainerCraftingCPU( inventoryPlayer, te ) );
}
protected GuiCraftingCPU( ContainerCraftingCPU container )
protected GuiCraftingCPU( final ContainerCraftingCPU container )
{
super( container );
this.craftingCpu = container;
@@ -115,7 +115,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
@@ -125,7 +125,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -143,14 +143,14 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private void setScrollBar()
{
int size = this.visual.size();
final int size = this.visual.size();
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
}
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
this.cancel.enabled = !this.visual.isEmpty();
@@ -164,8 +164,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY;
final int minX = gx + 9 + x * 67;
final int minY = gy + 22 + y * offY;
if( minX < mouseX && minX + 67 > mouseX )
{
@@ -189,7 +189,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
@@ -208,16 +208,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
final int viewEnd = viewStart + 3 * 6;
String dspToolTip = "";
List<String> lineList = new LinkedList<String>();
final List<String> lineList = new LinkedList<String>();
int toolPosX = 0;
int toolPosY = 0;
int offY = 23;
final int offY = 23;
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ )
{
IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
if( refStack != null )
{
GL11.glPushMatrix();
@@ -248,19 +248,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
{
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA;
int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2;
final int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA;
final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
final int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2;
drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor );
}
int negY = ( ( lines - 1 ) * 5 ) / 2;
final int negY = ( ( lines - 1 ) * 5 ) / 2;
int downY = 0;
if( stored != null && stored.getStackSize() > 0 )
{
final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() );
int w = 4 + this.fontRendererObj.getStringWidth( str );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
if( this.tooltip == z - viewStart )
@@ -300,10 +300,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
GL11.glPopMatrix();
int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19;
int posY = y * offY + ITEMSTACK_TOP_OFFSET;
final int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19;
final int posY = y * offY + ITEMSTACK_TOP_OFFSET;
ItemStack is = refStack.copy().getItemStack();
final ItemStack is = refStack.copy().getItemStack();
if( this.tooltip == z - viewStart )
{
@@ -339,41 +339,41 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/craftingcpu.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
}
public void postUpdate( List<IAEItemStack> list, byte ref )
public void postUpdate( final List<IAEItemStack> list, final byte ref )
{
switch( ref )
{
case 0:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.active, l );
}
break;
case 2:
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
}
for( IAEItemStack l : list )
for( final IAEItemStack l : list )
{
long amt = this.getTotal( l );
final long amt = this.getTotal( l );
if( amt <= 0 )
{
@@ -381,7 +381,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
else
{
IAEItemStack is = this.findVisualStack( l );
final IAEItemStack is = this.findVisualStack( l );
is.setStackSize( amt );
}
}
@@ -389,7 +389,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
this.setScrollBar();
}
private void handleInput( IItemList<IAEItemStack> s, IAEItemStack l )
private void handleInput( final IItemList<IAEItemStack> s, final IAEItemStack l )
{
IAEItemStack a = s.findPrecise( l );
@@ -415,7 +415,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
}
private long getTotal( IAEItemStack is )
private long getTotal( final IAEItemStack is )
{
final IAEItemStack a = this.storage.findPrecise( is );
final IAEItemStack b = this.active.findPrecise( is );
@@ -441,13 +441,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
return total;
}
private void deleteVisualStack( IAEItemStack l )
private void deleteVisualStack( final IAEItemStack l )
{
final Iterator<IAEItemStack> i = this.visual.iterator();
while( i.hasNext() )
{
IAEItemStack o = i.next();
final IAEItemStack o = i.next();
if( o.equals( l ) )
{
i.remove();
@@ -456,9 +456,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
}
private IAEItemStack findVisualStack( IAEItemStack l )
private IAEItemStack findVisualStack( final IAEItemStack l )
{
for( IAEItemStack o : this.visual )
for( final IAEItemStack o : this.visual )
{
if( o.equals( l ) )
{
@@ -59,18 +59,18 @@ public class GuiCraftingStatus extends GuiCraftingCPU
GuiBridge originalGui;
ItemStack myIcon = null;
public GuiCraftingStatus( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( new ContainerCraftingStatus( inventoryPlayer, te ) );
this.status = (ContainerCraftingStatus) this.inventorySlots;
Object target = this.status.getTarget();
final Object target = this.status.getTarget();
final IDefinitions definitions = AEApi.instance().definitions();
final IParts parts = definitions.parts();
if( target instanceof WirelessTerminalGuiObject )
{
for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
{
this.myIcon = wirelessTerminalStack;
}
@@ -80,7 +80,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
if( target instanceof PartTerminal )
{
for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
{
this.myIcon = stack;
}
@@ -89,7 +89,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
if( target instanceof PartCraftingTerminal )
{
for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
{
this.myIcon = stack;
}
@@ -98,7 +98,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
if( target instanceof PartPatternTerminal )
{
for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
{
this.myIcon = stack;
}
@@ -107,11 +107,11 @@ public class GuiCraftingStatus extends GuiCraftingCPU
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.selectCPU )
{
@@ -119,7 +119,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -148,7 +148,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
}
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
this.updateCPUButtonText();
super.drawScreen( mouseX, mouseY, btn );
@@ -162,7 +162,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
{
if( this.status.myName.length() > 0 )
{
String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) );
final String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) );
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
}
else
@@ -180,7 +180,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
}
@Override
protected String getGuiDisplayName( String in )
protected String getGuiDisplayName( final String in )
{
return in; // the cup name is on the button
}
@@ -41,22 +41,22 @@ public class GuiCraftingTerm extends GuiMEMonitorable
GuiImgButton clearBtn;
public GuiCraftingTerm( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) );
this.reservedSpace = 73;
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
if( this.clearBtn == btn )
{
Slot s = null;
Container c = this.inventorySlots;
for( Object j : c.inventorySlots )
final Container c = this.inventorySlots;
for( final Object j : c.inventorySlots )
{
if( j instanceof SlotCraftingMatrix )
{
@@ -66,7 +66,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
if( s != null )
{
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
NetworkHandler.instance.sendToServer( p );
}
}
@@ -81,7 +81,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
@@ -37,14 +37,14 @@ public class GuiDrive extends AEBaseGui
GuiTabButton priority;
public GuiDrive( InventoryPlayer inventoryPlayer, TileDrive te )
public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te )
{
super( new ContainerDrive( inventoryPlayer, te ) );
this.ySize = 199;
}
@Override
protected void actionPerformed( GuiButton par1GuiButton )
protected void actionPerformed( final GuiButton par1GuiButton )
{
super.actionPerformed( par1GuiButton );
@@ -63,14 +63,14 @@ public class GuiDrive extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/drive.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -44,7 +44,7 @@ public class GuiFormationPlane extends GuiUpgradeable
GuiTabButton priority;
GuiImgButton placeMode;
public GuiFormationPlane( InventoryPlayer inventoryPlayer, PartFormationPlane te )
public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te )
{
super( new ContainerFormationPlane( inventoryPlayer, te ) );
this.ySize = 251;
@@ -63,7 +63,7 @@ public class GuiFormationPlane extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -86,11 +86,11 @@ public class GuiFormationPlane extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.priority )
{
@@ -30,21 +30,21 @@ import appeng.tile.grindstone.TileGrinder;
public class GuiGrinder extends AEBaseGui
{
public GuiGrinder( InventoryPlayer inventoryPlayer, TileGrinder te )
public GuiGrinder( final InventoryPlayer inventoryPlayer, final TileGrinder te )
{
super( new ContainerGrinder( inventoryPlayer, te ) );
this.ySize = 176;
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/grinder.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -45,7 +45,7 @@ public class GuiIOPort extends GuiUpgradeable
GuiImgButton fullMode;
GuiImgButton operationMode;
public GuiIOPort( InventoryPlayer inventoryPlayer, TileIOPort te )
public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te )
{
super( new ContainerIOPort( inventoryPlayer, te ) );
this.ySize = 166;
@@ -64,7 +64,7 @@ public class GuiIOPort extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -86,18 +86,18 @@ public class GuiIOPort extends GuiUpgradeable
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawBG( offsetX, offsetY, mouseX, mouseY );
final IDefinitions definitions = AEApi.instance().definitions();
for( ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() )
for( final ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() )
{
this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack );
}
for( ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() )
for( final ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() )
{
this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack );
}
@@ -110,11 +110,11 @@ public class GuiIOPort extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.fullMode )
{
@@ -36,7 +36,7 @@ public class GuiInscriber extends AEBaseGui
final ContainerInscriber cvc;
GuiProgressBar pb;
public GuiInscriber( InventoryPlayer inventoryPlayer, TileInscriber te )
public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te )
{
super( new ContainerInscriber( inventoryPlayer, te ) );
this.cvc = (ContainerInscriber) this.inventorySlots;
@@ -59,7 +59,7 @@ public class GuiInscriber extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" );
@@ -68,7 +68,7 @@ public class GuiInscriber extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/inscriber.png" );
this.pb.xPosition = 135 + this.guiLeft;
@@ -45,7 +45,7 @@ public class GuiInterface extends GuiUpgradeable
GuiImgButton BlockMode;
GuiToggleButton interfaceMode;
public GuiInterface( InventoryPlayer inventoryPlayer, IInterfaceHost te )
public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te )
{
super( new ContainerInterface( inventoryPlayer, te ) );
this.ySize = 211;
@@ -65,7 +65,7 @@ public class GuiInterface extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
if( this.BlockMode != null )
{
@@ -93,11 +93,11 @@ public class GuiInterface extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.priority )
{
@@ -67,7 +67,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
private boolean refreshList = false;
private MEGuiTextField searchField;
public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartInterfaceTerminal te )
public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te )
{
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
this.myScrollBar = new GuiScrollbar();
@@ -93,14 +93,14 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
int ex = this.myScrollBar.getCurrentScroll();
final int ex = this.myScrollBar.getCurrentScroll();
Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
final Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
while( o.hasNext() )
{
if( o.next() instanceof SlotDisconnected )
@@ -112,10 +112,10 @@ public class GuiInterfaceTerminal extends AEBaseGui
int offset = 17;
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
{
Object lineObj = this.lines.get( ex + x );
final Object lineObj = this.lines.get( ex + x );
if( lineObj instanceof ClientDCInternalInv )
{
ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
for( int z = 0; z < inv.inv.getSizeInventory(); z++ )
{
this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
@@ -124,7 +124,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
else if( lineObj instanceof String )
{
String name = (String) lineObj;
int rows = this.byName.get( name ).size();
final int rows = this.byName.get( name ).size();
if( rows > 1 )
{
name = name + " (" + rows + ')';
@@ -142,7 +142,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
@Override
protected void mouseClicked( int xCoord, int yCoord, int btn )
protected void mouseClicked( final int xCoord, final int yCoord, final int btn )
{
this.searchField.mouseClicked( xCoord, yCoord, btn );
@@ -156,23 +156,23 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/interfaceterminal.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
int offset = 17;
int ex = this.myScrollBar.getCurrentScroll();
final int ex = this.myScrollBar.getCurrentScroll();
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
{
Object lineObj = this.lines.get( ex + x );
final Object lineObj = this.lines.get( ex + x );
if( lineObj instanceof ClientDCInternalInv )
{
ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
GL11.glColor4f( 1, 1, 1, 1 );
int width = inv.inv.getSizeInventory() * 18;
final int width = inv.inv.getSizeInventory() * 18;
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
}
offset += 18;
@@ -185,7 +185,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -205,7 +205,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
}
public void postUpdate( NBTTagCompound in )
public void postUpdate( final NBTTagCompound in )
{
if( in.getBoolean( "clear" ) )
{
@@ -213,27 +213,27 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.refreshList = true;
}
for( Object oKey : in.func_150296_c() )
for( final Object oKey : in.func_150296_c() )
{
String key = (String) oKey;
final String key = (String) oKey;
if( key.startsWith( "=" ) )
{
try
{
long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX );
NBTTagCompound invData = in.getCompoundTag( key );
ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
final long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX );
final NBTTagCompound invData = in.getCompoundTag( key );
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
for( int x = 0; x < current.inv.getSizeInventory(); x++ )
{
String which = Integer.toString( x );
final String which = Integer.toString( x );
if( invData.hasKey( which ) )
{
current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
}
}
}
catch( NumberFormatException ignored )
catch( final NumberFormatException ignored )
{
}
}
@@ -262,7 +262,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
final Set<Object> cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase );
final boolean rebuild = cachedSearch.isEmpty();
for( ClientDCInternalInv entry : this.byId.values() )
for( final ClientDCInternalInv entry : this.byId.values() )
{
// ignore inventory if not doing a full rebuild or cache already marks it as miss.
if( !rebuild && !cachedSearch.contains( entry ) )
@@ -276,7 +276,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
// Search if the current inventory holds a pattern containing the search term.
if( !found && !searchFilterLowerCase.isEmpty() )
{
for( ItemStack itemStack : entry.inv )
for( final ItemStack itemStack : entry.inv )
{
found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase );
if( found )
@@ -306,11 +306,11 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.lines.clear();
this.lines.ensureCapacity( this.getMaxRows() );
for( String n : this.names )
for( final String n : this.names )
{
this.lines.add( n );
ArrayList<ClientDCInternalInv> clientInventories = new ArrayList<ClientDCInternalInv>();
final ArrayList<ClientDCInternalInv> clientInventories = new ArrayList<ClientDCInternalInv>();
clientInventories.addAll( this.byName.get( n ) );
Collections.sort( clientInventories );
@@ -320,14 +320,14 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 );
}
private boolean itemStackMatchesSearchTerm( ItemStack itemStack, String searchTerm )
private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm )
{
if( itemStack == null )
{
return false;
}
NBTTagCompound encodedValue = itemStack.getTagCompound();
final NBTTagCompound encodedValue = itemStack.getTagCompound();
if( encodedValue == null )
{
@@ -336,15 +336,15 @@ public class GuiInterfaceTerminal extends AEBaseGui
// Potential later use to filter by input
// NBTTagList inTag = encodedValue.getTagList( "in", 10 );
NBTTagList outTag = encodedValue.getTagList( "out", 10 );
final NBTTagList outTag = encodedValue.getTagList( "out", 10 );
for( int i = 0; i < outTag.tagCount(); i++ )
{
ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) );
final ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) );
if( parsedItemStack != null )
{
String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase();
final String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase();
if( displayName.contains( searchTerm ) )
{
return true;
@@ -364,14 +364,14 @@ public class GuiInterfaceTerminal extends AEBaseGui
*
* @return a Set matching a superset of the search term
*/
private Set<Object> getCacheForSearchTerm( String searchTerm )
private Set<Object> getCacheForSearchTerm( final String searchTerm )
{
if( !this.cachedSearches.containsKey( searchTerm ) )
{
this.cachedSearches.put( searchTerm, new HashSet<Object>() );
}
Set<Object> cache = this.cachedSearches.get( searchTerm );
final Set<Object> cache = this.cachedSearches.get( searchTerm );
if( cache.isEmpty() && searchTerm.length() > 1 )
{
@@ -392,7 +392,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
return this.names.size() + this.byId.size();
}
private ClientDCInternalInv getById( long id, long sortBy, String string )
private ClientDCInternalInv getById( final long id, final long sortBy, final String string )
{
ClientDCInternalInv o = this.byId.get( id );
@@ -61,7 +61,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
GuiImgButton levelMode;
GuiImgButton craftingMode;
public GuiLevelEmitter( InventoryPlayer inventoryPlayer, PartLevelEmitter te )
public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te )
{
super( new ContainerLevelEmitter( inventoryPlayer, te ) );
}
@@ -88,10 +88,10 @@ public class GuiLevelEmitter extends GuiUpgradeable
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
int a = AEConfig.instance.levelByStackAmounts( 0 );
int b = AEConfig.instance.levelByStackAmounts( 1 );
int c = AEConfig.instance.levelByStackAmounts( 2 );
int d = AEConfig.instance.levelByStackAmounts( 3 );
final int a = AEConfig.instance.levelByStackAmounts( 0 );
final int b = AEConfig.instance.levelByStackAmounts( 1 );
final int c = AEConfig.instance.levelByStackAmounts( 2 );
final int d = AEConfig.instance.levelByStackAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
@@ -110,9 +110,9 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0;
final boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0;
// configure enabled status...
this.level.setEnabled( notCraftingMode );
@@ -141,7 +141,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawBG( offsetX, offsetY, mouseX, mouseY );
this.level.drawTextBox();
@@ -167,11 +167,11 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.craftingMode )
{
@@ -183,8 +183,8 @@ public class GuiLevelEmitter extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
}
boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
@@ -192,7 +192,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
}
private void addQty( long i )
private void addQty( final long i )
{
try
{
@@ -226,19 +226,19 @@ public class GuiLevelEmitter extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
// nope..
this.level.setText( "0" );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -267,7 +267,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -37,7 +37,7 @@ public class GuiMAC extends GuiUpgradeable
final ContainerMAC container;
GuiProgressBar pb;
public GuiMAC( InventoryPlayer inventoryPlayer, TileMolecularAssembler te )
public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te )
{
super( new ContainerMAC( inventoryPlayer, te ) );
this.ySize = 197;
@@ -61,14 +61,14 @@ public class GuiMAC extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.pb.setFullMsg( this.container.getCurrentProgress() + "%" );
super.drawFG( offsetX, offsetY, mouseX, mouseY );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.pb.xPosition = 148 + this.guiLeft;
this.pb.yPosition = 48 + this.guiTop;
@@ -96,12 +96,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
GuiImgButton searchBoxSettings;
GuiImgButton terminalStyleBox;
public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) );
}
public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c )
public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerMEMonitorable c )
{
super( c );
@@ -145,9 +145,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
}
public void postUpdate( List<IAEItemStack> list )
public void postUpdate( final List<IAEItemStack> list )
{
for( IAEItemStack is : list )
for( final IAEItemStack is : list )
{
this.repo.postUpdate( is );
}
@@ -163,7 +163,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
if( btn == this.craftingStatusBtn )
{
@@ -172,13 +172,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( btn instanceof GuiImgButton )
{
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
GuiImgButton iBtn = (GuiImgButton) btn;
final GuiImgButton iBtn = (GuiImgButton) btn;
if( iBtn.getSetting() != Settings.ACTIONS )
{
Enum cv = iBtn.getCurrentValue();
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
final Enum cv = iBtn.getCurrentValue();
final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
if( btn == this.terminalStyleBox )
{
@@ -194,7 +194,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -224,13 +224,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.maxRows = this.getMaxRows();
this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI );
final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI );
int NEI = hasNEI ? 0 : 0;
final int NEI = hasNEI ? 0 : 0;
int top = hasNEI ? 22 : 0;
int magicNumber = 114 + 1;
int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace;
final int magicNumber = 114 + 1;
final int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace;
this.rows = (int) Math.floor( extraSpace / 18 );
if( this.rows > this.maxRows )
@@ -274,7 +274,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.ySize = magicNumber + this.rows * 18 + this.reservedSpace;
// this.guiTop = top;
int unusedSpace = this.height - this.ySize;
final int unusedSpace = this.height - this.ySize;
this.guiTop = (int) Math.floor( unusedSpace / ( unusedSpace < 0 ? 3.8f : 2.0f ) );
int offset = this.guiTop + 8;
@@ -315,7 +315,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting );
if( this.isSubGui() )
@@ -329,7 +329,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
CraftingGridOffsetX = Integer.MAX_VALUE;
CraftingGridOffsetY = Integer.MAX_VALUE;
for( Object s : this.inventorySlots.inventorySlots )
for( final Object s : this.inventorySlots.inventorySlots )
{
if( s instanceof AppEngSlot )
{
@@ -341,7 +341,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix )
{
Slot g = (Slot) s;
final Slot g = (Slot) s;
if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 )
{
CraftingGridOffsetX = Math.min( CraftingGridOffsetX, g.xDisplayPosition );
@@ -355,16 +355,16 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
protected void mouseClicked( int xCoord, int yCoord, int btn )
protected void mouseClicked( final int xCoord, final int yCoord, final int btn )
{
Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH )
{
@@ -391,11 +391,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( this.getBackground() );
int x_width = 197;
final int x_width = 197;
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
if( this.viewCell || ( this instanceof GuiSecurity ) )
@@ -451,13 +451,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
}
protected void repositionSlot( AppEngSlot s )
protected void repositionSlot( final AppEngSlot s )
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -505,7 +505,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
{
if( this.SortByBox != null )
{
@@ -28,7 +28,7 @@ import appeng.container.implementations.ContainerMEPortableCell;
public class GuiMEPortableCell extends GuiMEMonitorable
{
public GuiMEPortableCell( InventoryPlayer inventoryPlayer, IPortableCell te )
public GuiMEPortableCell( final InventoryPlayer inventoryPlayer, final IPortableCell te )
{
super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, te ) );
}
@@ -55,7 +55,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
GuiImgButton units;
int tooltip = -1;
public GuiNetworkStatus( InventoryPlayer inventoryPlayer, INetworkTool te )
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te )
{
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
this.ySize = 153;
@@ -66,11 +66,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.units )
{
@@ -89,11 +89,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
int gx = ( this.width - this.xSize ) / 2;
int gy = ( this.height - this.ySize ) / 2;
final int gx = ( this.width - this.xSize ) / 2;
final int gy = ( this.height - this.ySize ) / 2;
this.tooltip = -1;
@@ -101,8 +101,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 14 + x * 31;
int minY = gy + 41 + y * 18;
final int minX = gx + 14 + x * 31;
final int minY = gy + 41 + y * 18;
if( minX < mouseX && minX + 28 > mouseX )
{
@@ -126,9 +126,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots;
final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots;
this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
@@ -138,14 +138,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 );
this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 );
int sectionLength = 30;
final int sectionLength = 30;
int x = 0;
int y = 0;
int xo = 12;
int yo = 42;
int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
int viewEnd = viewStart + 5 * 4;
final int xo = 12;
final int yo = 42;
final int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
final int viewEnd = viewStart + 5 * 4;
String toolTip = "";
int toolPosX = 0;
@@ -153,7 +153,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
for( int z = viewStart; z < Math.min( viewEnd, this.repo.size() ); z++ )
{
IAEItemStack refStack = this.repo.getReferenceItem( z );
final IAEItemStack refStack = this.repo.getReferenceItem( z );
if( refStack != null )
{
GL11.glPushMatrix();
@@ -165,12 +165,12 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
str = Long.toString( refStack.getStackSize() / 1000 ) + 'k';
}
int w = this.fontRendererObj.getStringWidth( str );
final int w = this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2, 4210752 );
GL11.glPopMatrix();
int posX = x * sectionLength + xo + sectionLength - 18;
int posY = y * 18 + yo;
final int posX = x * sectionLength + xo + sectionLength - 18;
final int posY = y * 18 + yo;
if( this.tooltip == z - viewStart )
{
@@ -207,17 +207,17 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/networkstatus.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
}
public void postUpdate( List<IAEItemStack> list )
public void postUpdate( final List<IAEItemStack> list )
{
this.repo.clear();
for( IAEItemStack is : list )
for( final IAEItemStack is : list )
{
this.repo.postUpdate( is );
}
@@ -228,27 +228,27 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
private void setScrollBar()
{
int size = this.repo.size();
final int size = this.repo.size();
this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 );
this.myScrollBar.setRange( 0, ( size + 4 ) / 5 - this.rows, 1 );
}
// @Override - NEI
public List<String> handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List<String> currentToolTip )
public List<String> handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List<String> currentToolTip )
{
if( stack != null )
{
Slot s = this.getSlot( mouseX, mouseY );
final Slot s = this.getSlot( mouseX, mouseY );
if( s instanceof SlotME )
{
IAEItemStack myStack = null;
try
{
SlotME theSlotField = (SlotME) s;
final SlotME theSlotField = (SlotME) s;
myStack = theSlotField.getAEStack();
}
catch( Throwable ignore )
catch( final Throwable ignore )
{
}
@@ -265,25 +265,25 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
// Vanilla version...
protected void drawItemStackTooltip( ItemStack stack, int x, int y )
protected void drawItemStackTooltip( final ItemStack stack, final int x, final int y )
{
Slot s = this.getSlot( x, y );
final Slot s = this.getSlot( x, y );
if( s instanceof SlotME && stack != null )
{
IAEItemStack myStack = null;
try
{
SlotME theSlotField = (SlotME) s;
final SlotME theSlotField = (SlotME) s;
myStack = theSlotField.getAEStack();
}
catch( Throwable ignore )
catch( final Throwable ignore )
{
}
if( myStack != null )
{
List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
final List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
while( currentToolTip.size() > 1 )
{
@@ -39,14 +39,14 @@ public class GuiNetworkTool extends AEBaseGui
GuiToggleButton tFacades;
public GuiNetworkTool( InventoryPlayer inventoryPlayer, INetworkTool te )
public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te )
{
super( new ContainerNetworkTool( inventoryPlayer, te ) );
this.ySize = 166;
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
@@ -57,7 +57,7 @@ public class GuiNetworkTool extends AEBaseGui
NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
}
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -74,7 +74,7 @@ public class GuiNetworkTool extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
if( this.tFacades != null )
{
@@ -86,7 +86,7 @@ public class GuiNetworkTool extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/toolbox.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -49,7 +49,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
GuiImgButton encodeBtn;
GuiImgButton clearBtn;
public GuiPatternTerm( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiPatternTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
this.container = (ContainerPatternTerm) this.inventorySlots;
@@ -57,7 +57,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
@@ -79,7 +79,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
}
}
catch( IOException e )
catch( final IOException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
@@ -109,7 +109,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
if( !this.container.craftingMode )
{
@@ -137,7 +137,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
}
@Override
protected void repositionSlot( AppEngSlot s )
protected void repositionSlot( final AppEngSlot s )
{
if( s.isPlayerSide() )
{
@@ -67,7 +67,7 @@ public class GuiPriority extends AEBaseGui
GuiBridge OriginalGui;
public GuiPriority( InventoryPlayer inventoryPlayer, IPriorityHost te )
public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te )
{
super( new ContainerPriority( inventoryPlayer, te ) );
}
@@ -77,10 +77,10 @@ public class GuiPriority extends AEBaseGui
{
super.initGui();
int a = AEConfig.instance.priorityByStacksAmounts( 0 );
int b = AEConfig.instance.priorityByStacksAmounts( 1 );
int c = AEConfig.instance.priorityByStacksAmounts( 2 );
int d = AEConfig.instance.priorityByStacksAmounts( 3 );
final int a = AEConfig.instance.priorityByStacksAmounts( 0 );
final int b = AEConfig.instance.priorityByStacksAmounts( 1 );
final int c = AEConfig.instance.priorityByStacksAmounts( 2 );
final int d = AEConfig.instance.priorityByStacksAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
@@ -93,14 +93,14 @@ public class GuiPriority extends AEBaseGui
this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
ItemStack myIcon = null;
Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
final IDefinitions definitions = AEApi.instance().definitions();
final IParts parts = definitions.parts();
final IBlocks blocks = definitions.blocks();
if( target instanceof PartStorageBus )
{
for( ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() )
for( final ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() )
{
myIcon = storageBusStack;
}
@@ -109,7 +109,7 @@ public class GuiPriority extends AEBaseGui
if( target instanceof PartFormationPlane )
{
for( ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() )
for( final ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() )
{
myIcon = formationPlaneStack;
}
@@ -118,7 +118,7 @@ public class GuiPriority extends AEBaseGui
if( target instanceof TileDrive )
{
for( ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() )
for( final ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() )
{
myIcon = driveStack;
}
@@ -128,7 +128,7 @@ public class GuiPriority extends AEBaseGui
if( target instanceof TileChest )
{
for( ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() )
for( final ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() )
{
myIcon = chestStack;
}
@@ -138,7 +138,7 @@ public class GuiPriority extends AEBaseGui
if( target instanceof TileInterface )
{
for( ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() )
for( final ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() )
{
myIcon = interfaceStack;
}
@@ -148,7 +148,7 @@ public class GuiPriority extends AEBaseGui
if( target instanceof PartInterface )
{
for( ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() )
for( final ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() )
{
myIcon = interfaceStack;
}
@@ -170,13 +170,13 @@ public class GuiPriority extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/priority.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -185,7 +185,7 @@ public class GuiPriority extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
@@ -194,8 +194,8 @@ public class GuiPriority extends AEBaseGui
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
}
boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
@@ -203,7 +203,7 @@ public class GuiPriority extends AEBaseGui
}
}
private void addQty( int i )
private void addQty( final int i )
{
try
{
@@ -233,19 +233,19 @@ public class GuiPriority extends AEBaseGui
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
// nope..
this.priority.setText( "0" );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( !this.checkHotbarKeys( key ) )
{
@@ -274,7 +274,7 @@ public class GuiPriority extends AEBaseGui
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -30,21 +30,21 @@ import appeng.tile.qnb.TileQuantumBridge;
public class GuiQNB extends AEBaseGui
{
public GuiQNB( InventoryPlayer inventoryPlayer, TileQuantumBridge te )
public GuiQNB( final InventoryPlayer inventoryPlayer, final TileQuantumBridge te )
{
super( new ContainerQNB( inventoryPlayer, te ) );
this.ySize = 166;
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/chest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -38,7 +38,7 @@ public class GuiQuartzKnife extends AEBaseGui
GuiTextField name;
public GuiQuartzKnife( InventoryPlayer inventoryPlayer, QuartzKnifeObj te )
public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te )
{
super( new ContainerQuartzKnife( inventoryPlayer, te ) );
this.ySize = 184;
@@ -58,14 +58,14 @@ public class GuiQuartzKnife extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/quartzknife.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -73,17 +73,17 @@ public class GuiQuartzKnife extends AEBaseGui
}
@Override
protected void keyTyped( char character, int key )
protected void keyTyped( final char character, final int key )
{
if( this.name.textboxKeyTyped( character, key ) )
{
try
{
String Out = this.name.getText();
final String Out = this.name.getText();
( (ContainerQuartzKnife) this.inventorySlots ).setName( Out );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -43,7 +43,7 @@ public class GuiSecurity extends GuiMEMonitorable
GuiToggleButton build;
GuiToggleButton security;
public GuiSecurity( InventoryPlayer inventoryPlayer, ITerminalHost te )
public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) );
this.customSortOrder = false;
@@ -55,7 +55,7 @@ public class GuiSecurity extends GuiMEMonitorable
}
@Override
protected void actionPerformed( net.minecraft.client.gui.GuiButton btn )
protected void actionPerformed( final net.minecraft.client.gui.GuiButton btn )
{
super.actionPerformed( btn );
@@ -88,7 +88,7 @@ public class GuiSecurity extends GuiMEMonitorable
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileSecurity.ToggleOption", toggleSetting.name() ) );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -100,7 +100,7 @@ public class GuiSecurity extends GuiMEMonitorable
{
super.initGui();
int top = this.guiTop + this.ySize - 116;
final int top = this.guiTop + this.ySize - 116;
this.buttonList.add( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT.getUnlocalizedName(), SecurityPermissions.INJECT.getUnlocalizedTip() ) );
this.buttonList.add( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT.getUnlocalizedName(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) );
@@ -113,7 +113,7 @@ public class GuiSecurity extends GuiMEMonitorable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
@@ -122,7 +122,7 @@ public class GuiSecurity extends GuiMEMonitorable
@Override
protected String getBackground()
{
ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
this.inject.setState( ( cs.security & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
this.extract.setState( ( cs.security & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
@@ -32,21 +32,21 @@ import appeng.tile.storage.TileSkyChest;
public class GuiSkyChest extends AEBaseGui
{
public GuiSkyChest( InventoryPlayer inventoryPlayer, TileSkyChest te )
public GuiSkyChest( final InventoryPlayer inventoryPlayer, final TileSkyChest te )
{
super( new ContainerSkyChest( inventoryPlayer, te ) );
this.ySize = 195;
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 );
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/skychest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -40,7 +40,7 @@ public class GuiSpatialIOPort extends AEBaseGui
final ContainerSpatialIOPort container;
GuiImgButton units;
public GuiSpatialIOPort( InventoryPlayer inventoryPlayer, TileSpatialIOPort te )
public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te )
{
super( new ContainerSpatialIOPort( inventoryPlayer, te ) );
this.ySize = 199;
@@ -48,11 +48,11 @@ public class GuiSpatialIOPort extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.units )
{
@@ -71,7 +71,7 @@ public class GuiSpatialIOPort extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 );
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 );
@@ -83,7 +83,7 @@ public class GuiSpatialIOPort extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/spatialio.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -53,7 +53,7 @@ public class GuiStorageBus extends GuiUpgradeable
GuiImgButton partition;
GuiImgButton clear;
public GuiStorageBus( InventoryPlayer inventoryPlayer, PartStorageBus te )
public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te )
{
super( new ContainerStorageBus( inventoryPlayer, te ) );
this.ySize = 251;
@@ -78,7 +78,7 @@ public class GuiStorageBus extends GuiUpgradeable
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -106,11 +106,11 @@ public class GuiStorageBus extends GuiUpgradeable
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
try
{
@@ -135,7 +135,7 @@ public class GuiStorageBus extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
}
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -52,12 +52,12 @@ public class GuiUpgradeable extends AEBaseGui
GuiImgButton craftMode;
GuiImgButton schedulingMode;
public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te )
public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te )
{
this( new ContainerUpgradeable( inventoryPlayer, te ) );
}
public GuiUpgradeable( ContainerUpgradeable te )
public GuiUpgradeable( final ContainerUpgradeable te )
{
super( te );
this.cvb = te;
@@ -93,7 +93,7 @@ public class GuiUpgradeable extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -120,7 +120,7 @@ public class GuiUpgradeable extends AEBaseGui
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.handleButtonVisibility();
@@ -172,11 +172,11 @@ public class GuiUpgradeable extends AEBaseGui
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.redstoneMode )
{
@@ -37,7 +37,7 @@ public class GuiVibrationChamber extends AEBaseGui
final ContainerVibrationChamber cvc;
GuiProgressBar pb;
public GuiVibrationChamber( InventoryPlayer inventoryPlayer, TileVibrationChamber te )
public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te )
{
super( new ContainerVibrationChamber( inventoryPlayer, te ) );
this.cvc = (ContainerVibrationChamber) this.inventorySlots;
@@ -54,7 +54,7 @@ public class GuiVibrationChamber extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -63,17 +63,17 @@ public class GuiVibrationChamber extends AEBaseGui
if( this.cvc.getCurrentProgress() > 0 )
{
int i1 = this.cvc.getCurrentProgress();
final int i1 = this.cvc.getCurrentProgress();
this.bindTexture( "guis/vibchamber.png" );
GL11.glColor3f( 1, 1, 1 );
int l = -15;
int k = 25;
final int l = -15;
final int k = 25;
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
}
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/vibchamber.png" );
this.pb.xPosition = 99 + this.guiLeft;
@@ -39,18 +39,18 @@ public class GuiWireless extends AEBaseGui
GuiImgButton units;
public GuiWireless( InventoryPlayer inventoryPlayer, TileWireless te )
public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te )
{
super( new ContainerWireless( inventoryPlayer, te ) );
this.ySize = 166;
}
@Override
protected void actionPerformed( GuiButton btn )
protected void actionPerformed( final GuiButton btn )
{
super.actionPerformed( btn );
boolean backwards = Mouse.isButtonDown( 1 );
final boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.units )
{
@@ -69,27 +69,27 @@ public class GuiWireless extends AEBaseGui
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
ContainerWireless cw = (ContainerWireless) this.inventorySlots;
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
if( cw.range > 0 )
{
String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m";
String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true );
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m";
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true );
int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 );
this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 );
}
}
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/wireless.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
@@ -27,7 +27,7 @@ import appeng.api.implementations.guiobjects.IPortableCell;
public class GuiWirelessTerm extends GuiMEPortableCell
{
public GuiWirelessTerm( InventoryPlayer inventoryPlayer, IPortableCell te )
public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te )
{
super( inventoryPlayer, te );
this.maxRows = Integer.MAX_VALUE;
@@ -62,7 +62,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
public String fillVar;
private Enum currentValue;
public GuiImgButton( int x, int y, Enum idx, Enum val )
public GuiImgButton( final int x, final int y, final Enum idx, final Enum val )
{
super( 0, 0, 16, "" );
@@ -166,27 +166,27 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
private void registerApp( int iconIndex, Settings setting, Enum val, ButtonToolTips title, Object hint )
private void registerApp( final int iconIndex, final Settings setting, final Enum val, final ButtonToolTips title, final Object hint )
{
ButtonAppearance a = new ButtonAppearance();
final ButtonAppearance a = new ButtonAppearance();
a.displayName = title.getUnlocalized();
a.displayValue = (String) ( hint instanceof String ? hint : ( (ButtonToolTips) hint ).getUnlocalized() );
a.index = iconIndex;
appearances.put( new EnumPair( setting, val ), a );
}
public void setVisibility( boolean vis )
public void setVisibility( final boolean vis )
{
this.visible = vis;
this.enabled = vis;
}
@Override
public void drawButton( Minecraft par1Minecraft, int par2, int par3 )
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
{
if( this.visible )
{
int iconIndex = this.getIconIndex();
final int iconIndex = this.getIconIndex();
if( this.halfSize )
{
@@ -209,8 +209,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) );
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int uv_y = (int) Math.floor( iconIndex / 16 );
int uv_x = iconIndex - uv_y * 16;
final int uv_y = (int) Math.floor( iconIndex / 16 );
final int uv_x = iconIndex - uv_y * 16;
this.drawTexturedModalRect( 0, 0, 256 - 16, 256 - 16, 16, 16 );
this.drawTexturedModalRect( 0, 0, uv_x * 16, uv_y * 16, 16, 16 );
@@ -232,8 +232,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) );
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int uv_y = (int) Math.floor( iconIndex / 16 );
int uv_x = iconIndex - uv_y * 16;
final int uv_y = (int) Math.floor( iconIndex / 16 );
final int uv_x = iconIndex - uv_y * 16;
this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 );
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 );
@@ -247,7 +247,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
{
if( this.buttonSetting != null && this.currentValue != null )
{
ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
final ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
if( app == null )
{
return 256 - 1;
@@ -275,7 +275,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
if( this.buttonSetting != null && this.currentValue != null )
{
ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
final ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
if( buttonAppearance == null )
{
return "No Such Message";
@@ -305,7 +305,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
StringBuilder sb = new StringBuilder( value );
final StringBuilder sb = new StringBuilder( value );
int i = sb.lastIndexOf( "\n" );
if( i <= 0 )
@@ -352,7 +352,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
return this.visible;
}
public void set( Enum e )
public void set( final Enum e )
{
if( this.currentValue != e )
{
@@ -366,7 +366,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
final Enum setting;
final Enum value;
EnumPair( Enum a, Enum b )
EnumPair( final Enum a, final Enum b )
{
this.setting = a;
this.value = b;
@@ -379,7 +379,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
if( obj == null )
{
@@ -389,7 +389,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
{
return false;
}
EnumPair other = (EnumPair) obj;
final EnumPair other = (EnumPair) obj;
return other.setting == this.setting && other.value == this.value;
}
}
@@ -28,16 +28,16 @@ public class GuiNumberBox extends GuiTextField
final Class type;
public GuiNumberBox( FontRenderer fontRenderer, int x, int y, int width, int height, Class type )
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
{
super( fontRenderer, x, y, width, height );
this.type = type;
}
@Override
public void writeText( String selectedText )
public void writeText( final String selectedText )
{
String original = this.getText();
final String original = this.getText();
super.writeText( selectedText );
try
@@ -55,7 +55,7 @@ public class GuiNumberBox extends GuiTextField
Double.parseDouble( this.getText() );
}
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
this.setText( original );
}
@@ -38,12 +38,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip
private final String titleName;
private String fullMsg;
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir )
public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir )
{
this( source, texture, posX, posY, u, y, width, height, dir, null );
}
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir, String title )
public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir, final String title )
{
super( posX, posY, width, "" );
this.source = source;
@@ -59,22 +59,22 @@ public class GuiProgressBar extends GuiButton implements ITooltip
}
@Override
public void drawButton( Minecraft par1Minecraft, int par2, int par3 )
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
{
if( this.visible )
{
par1Minecraft.getTextureManager().bindTexture( this.texture );
int max = this.source.getMaxProgress();
int current = this.source.getCurrentProgress();
final int max = this.source.getMaxProgress();
final int current = this.source.getCurrentProgress();
if( this.layout == Direction.VERTICAL )
{
int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 );
final int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 );
this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, this.fill_u, this.fill_v + diff, this.width, this.height - diff );
}
else
{
int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 );
final int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 );
this.drawTexturedModalRect( this.xPosition, this.yPosition, this.fill_u + diff, this.fill_v, this.width - diff, this.height );
}
@@ -82,7 +82,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip
}
}
public void setFullMsg( String msg )
public void setFullMsg( final String msg )
{
this.fullMsg = msg;
}
@@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource
private int minScroll = 0;
private int currentScroll = 0;
public void draw( AEBaseGui g )
public void draw( final AEBaseGui g )
{
g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
@@ -48,7 +48,7 @@ public class GuiScrollbar implements IScrollSource
}
else
{
int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange();
final int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange();
g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 );
}
}
@@ -63,7 +63,7 @@ public class GuiScrollbar implements IScrollSource
return this.displayX;
}
public GuiScrollbar setLeft( int v )
public GuiScrollbar setLeft( final int v )
{
this.displayX = v;
return this;
@@ -74,7 +74,7 @@ public class GuiScrollbar implements IScrollSource
return this.displayY;
}
public GuiScrollbar setTop( int v )
public GuiScrollbar setTop( final int v )
{
this.displayY = v;
return this;
@@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource
return this.width;
}
public GuiScrollbar setWidth( int v )
public GuiScrollbar setWidth( final int v )
{
this.width = v;
return this;
@@ -96,13 +96,13 @@ public class GuiScrollbar implements IScrollSource
return this.height;
}
public GuiScrollbar setHeight( int v )
public GuiScrollbar setHeight( final int v )
{
this.height = v;
return this;
}
public void setRange( int min, int max, int pageSize )
public void setRange( final int min, final int max, final int pageSize )
{
this.minScroll = min;
this.maxScroll = max;
@@ -127,7 +127,7 @@ public class GuiScrollbar implements IScrollSource
return this.currentScroll;
}
public void click( AEBaseGui aeBaseGui, int x, int y )
public void click( final AEBaseGui aeBaseGui, final int x, final int y )
{
if( this.getRange() == 0 )
{
@@ -40,7 +40,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
private int myIcon = -1;
private ItemStack myItem;
public GuiTabButton( int x, int y, int ico, String message, RenderItem ir )
public GuiTabButton( final int x, final int y, final int ico, final String message, final RenderItem ir )
{
super( 0, 0, 16, "" );
@@ -62,7 +62,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
* @param message mouse over message
* @param ir renderer
*/
public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir )
public GuiTabButton( final int x, final int y, final ItemStack ico, final String message, final RenderItem ir )
{
super( 0, 0, 16, "" );
this.xPosition = x;
@@ -75,7 +75,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
}
@Override
public void drawButton( Minecraft minecraft, int x, int y )
public void drawButton( final Minecraft minecraft, final int x, final int y )
{
if( this.visible )
{
@@ -85,13 +85,13 @@ public class GuiTabButton extends GuiButton implements ITooltip
int uv_x = ( this.hideEdge > 0 ? 11 : 13 );
int offsetX = this.hideEdge > 0 ? 1 : 0;
final int offsetX = this.hideEdge > 0 ? 1 : 0;
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, 0, 25, 22 );
if( this.myIcon >= 0 )
{
int uv_y = (int) Math.floor( this.myIcon / 16 );
final int uv_y = (int) Math.floor( this.myIcon / 16 );
uv_x = this.myIcon - uv_y * 16;
this.drawTexturedModalRect( offsetX + this.xPosition + 3, this.yPosition + 3, uv_x * 16, uv_y * 16, 16, 16 );
@@ -107,7 +107,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
RenderHelper.enableGUIStandardItemLighting();
FontRenderer fontrenderer = minecraft.fontRenderer;
final FontRenderer fontrenderer = minecraft.fontRenderer;
this.itemRenderer.renderItemAndEffectIntoGUI( fontrenderer, minecraft.renderEngine, this.myItem, offsetX + this.xPosition + 3, this.yPosition + 3 );
GL11.glDisable( GL11.GL_LIGHTING );

Some files were not shown because too many files have changed in this diff Show More