diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index 52ae17788..20bfc9172 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -102,11 +102,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature protected AEBaseBlock( Class c, Material mat ) { this( c, mat, Optional. absent() ); - setLightOpacity( 255 ); - setLightLevel( 0 ); - setHardness( 2.2F ); - setTileProvider( false ); - setHarvestLevel( "pickaxe", 0 ); + this.setLightOpacity( 255 ); + this.setLightLevel( 0 ); + this.setHardness( 2.2F ); + this.setTileProvider( false ); + this.setHarvestLevel( "pickaxe", 0 ); } protected AEBaseBlock( Class c, Material mat, Optional subName ) @@ -114,27 +114,27 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature super( mat ); if ( mat == AEGlassMaterial.instance || mat == Material.glass ) - setStepSound( Block.soundTypeGlass ); + this.setStepSound( Block.soundTypeGlass ); else if ( mat == Material.rock ) - setStepSound( Block.soundTypeStone ); + this.setStepSound( Block.soundTypeStone ); else if ( mat == Material.wood ) - setStepSound( Block.soundTypeWood ); + this.setStepSound( Block.soundTypeWood ); else - setStepSound( Block.soundTypeMetal ); + this.setStepSound( Block.soundTypeMetal ); - featureFullName = new FeatureNameExtractor( c, subName ).get(); - featureSubName = subName; + this.featureFullName = new FeatureNameExtractor( c, subName ).get(); + this.featureSubName = subName; } @Override public String toString() { - return featureFullName; + return this.featureFullName; } public void registerNoIcons() { - BlockRenderInfo info = getRendererInstance(); + BlockRenderInfo info = this.getRendererInstance(); FlippableIcon i = new FlippableIcon( new MissingIcon( this ) ); info.updateIcons( i, i, i, i, i, i ); } @@ -147,9 +147,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature protected void setTileEntity( Class c ) { AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) ); - GameRegistry.registerTileEntity( tileEntityType = c, featureFullName ); - isInventory = IInventory.class.isAssignableFrom( c ); - setTileProvider( hasBlockTileEntity() ); + GameRegistry.registerTileEntity( this.tileEntityType = c, this.featureFullName ); + this.isInventory = IInventory.class.isAssignableFrom( c ); + this.setTileProvider( this.hasBlockTileEntity() ); } // update Block value. @@ -166,7 +166,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override final public IFeatureHandler handler() { - return handler; + return this.handler; } @Override @@ -177,13 +177,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature public boolean isOpaque() { - return isOpaque; + return this.isOpaque; } @Override public boolean renderAsNormalBlock() { - return isFullSize && isOpaque; + return this.isFullSize && this.isOpaque; } @Override @@ -196,17 +196,17 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) { - return getIcon( mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) ); + 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 ) { - if ( renderIcon != null ) - return renderIcon; + if ( this.renderIcon != null ) + return this.renderIcon; - return getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) ); + return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) ); } @Override @@ -220,7 +220,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature collisionHandler = ( ICustomCollision ) this; else { - AEBaseTile te = getTileEntity( w, x, y, z ); + AEBaseTile te = this.getTileEntity( w, x, y, z ); if ( te instanceof ICustomCollision ) collisionHandler = ( ICustomCollision ) te; } @@ -256,7 +256,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature collisionHandler = ( ICustomCollision ) this; else { - AEBaseTile te = getTileEntity( w, x, y, z ); + AEBaseTile te = this.getTileEntity( w, x, y, z ); if ( te instanceof ICustomCollision ) collisionHandler = ( ICustomCollision ) te; } @@ -275,11 +275,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature for ( AxisAlignedBB bb : bbs ) { - setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ ); + 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 ); - setBlockBounds( 0, 0, 0, 1, 1, 1 ); + this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); if ( r != null ) { @@ -330,7 +330,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override final public boolean isOpaqueCube() { - return isOpaque; + return this.isOpaque; } @Override @@ -342,7 +342,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature collisionHandler = ( ICustomCollision ) this; else { - AEBaseTile te = getTileEntity( w, x, y, z ); + AEBaseTile te = this.getTileEntity( w, x, y, z ); if ( te instanceof ICustomCollision ) collisionHandler = ( ICustomCollision ) te; } @@ -356,11 +356,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature for ( AxisAlignedBB bb : bbs ) { - setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ ); + 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 ); - setBlockBounds( 0, 0, 0, 1, 1, 1 ); + this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); if ( r != null ) { @@ -384,7 +384,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature return null; } - setBlockBounds( 0, 0, 0, 1, 1, 1 ); + this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); return super.collisionRayTrace( w, x, y, z, a, b ); } @@ -401,7 +401,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature Block id = w.getBlock( x, y, z ); if ( id != null ) { - AEBaseTile tile = getTileEntity( w, x, y, z ); + AEBaseTile tile = this.getTileEntity( w, x, y, z ); ItemStack[] drops = Platform.getBlockDrops( w, x, y, z ); if ( tile == null ) @@ -436,10 +436,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature IMemoryCard memoryCard = ( IMemoryCard ) is.getItem(); if ( player.isSneaking() ) { - AEBaseTile t = getTileEntity( w, x, y, z ); + AEBaseTile t = this.getTileEntity( w, x, y, z ); if ( t != null ) { - String name = getUnlocalizedName(); + String name = this.getUnlocalizedName(); NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD ); if ( data != null ) { @@ -453,9 +453,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature { String name = memoryCard.getSettingsName( is ); NBTTagCompound data = memoryCard.getData( is ); - if ( getUnlocalizedName().equals( name ) ) + if ( this.getUnlocalizedName().equals( name ) ) { - AEBaseTile t = getTileEntity( w, x, y, z ); + AEBaseTile t = this.getTileEntity( w, x, y, z ); t.uploadSettings( SettingsFrom.MEMORY_CARD, data ); memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); } @@ -467,7 +467,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature } } - return onActivated( w, x, y, z, player, side, hitX, hitY, hitZ ); + return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ ); } public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) @@ -480,7 +480,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature { if ( is.hasDisplayName() ) { - TileEntity te = getTileEntity( w, x, y, z ); + TileEntity te = this.getTileEntity( w, x, y, z ); if ( te instanceof AEBaseTile ) ( ( AEBaseTile ) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() ); } @@ -497,13 +497,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override public boolean hasComparatorInputOverride() { - return isInventory; + return this.isInventory; } @Override public int getComparatorInputOverride( World w, int x, int y, int z, int s ) { - TileEntity te = getTileEntity( w, x, y, z ); + TileEntity te = this.getTileEntity( w, x, y, z ); if ( te instanceof IInventory ) return Container.calcRedstoneFromInventory( ( IInventory ) te ); return 0; @@ -513,7 +513,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @SideOnly( Side.CLIENT ) public void registerBlockIcons( IIconRegister iconRegistry ) { - BlockRenderInfo info = getRendererInstance(); + BlockRenderInfo info = this.getRendererInstance(); FlippableIcon topIcon; FlippableIcon bottomIcon; FlippableIcon sideIcon; @@ -522,13 +522,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature FlippableIcon southIcon; FlippableIcon northIcon; - this.blockIcon = topIcon = optionalIcon( iconRegistry, this.getTextureName(), null ); - bottomIcon = optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon ); - sideIcon = optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon ); - eastIcon = optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon ); - westIcon = optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon ); - southIcon = optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon ); - northIcon = optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon ); + this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null ); + bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon ); + sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon ); + eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon ); + westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon ); + southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon ); + northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon ); info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon ); } @@ -536,7 +536,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override final public boolean isNormalCube( IBlockAccess world, int x, int y, int z ) { - return isFullSize; + return this.isFullSize; } @Override @@ -544,9 +544,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature { IOrientable rotatable = null; - if ( hasBlockTileEntity() ) + if ( this.hasBlockTileEntity() ) { - rotatable = ( AEBaseTile ) getTileEntity( w, x, y, z ); + rotatable = ( AEBaseTile ) this.getTileEntity( w, x, y, z ); } else if ( this instanceof IOrientableBlock ) { @@ -555,9 +555,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature if ( rotatable != null && rotatable.canBeRotated() ) { - if ( hasCustomRotation() ) + if ( this.hasCustomRotation() ) { - customRotateBlock( rotatable, axis ); + this.customRotateBlock( rotatable, axis ); return true; } else @@ -600,9 +600,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override final public ForgeDirection[] getValidRotations( World w, int x, int y, int z ) { - if ( hasBlockTileEntity() ) + if ( this.hasBlockTileEntity() ) { - AEBaseTile obj = getTileEntity( w, x, y, z ); + AEBaseTile obj = this.getTileEntity( w, x, y, z ); if ( obj != null && obj.canBeRotated() ) { return ForgeDirection.VALID_DIRECTIONS; @@ -615,7 +615,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour ) { - TileEntity te = getTileEntity( world, x, y, z ); + TileEntity te = this.getTileEntity( world, x, y, z ); if ( te instanceof IColorableTile ) { @@ -637,12 +637,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @SideOnly( Side.CLIENT ) public BlockRenderInfo getRendererInstance() { - if ( renderInfo != null ) - return renderInfo; + if ( this.renderInfo != null ) + return this.renderInfo; try { - return renderInfo = new BlockRenderInfo( getRenderer().newInstance() ); + return this.renderInfo = new BlockRenderInfo( this.getRenderer().newInstance() ); } catch ( Throwable t ) { @@ -694,9 +694,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature { IOrientable ori = null; - if ( hasBlockTileEntity() ) + if ( this.hasBlockTileEntity() ) { - ori = ( AEBaseTile ) getTileEntity( w, x, y, z ); + ori = ( AEBaseTile ) this.getTileEntity( w, x, y, z ); } else if ( this instanceof IOrientableBlock ) { @@ -705,7 +705,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature if ( ori != null && ori.canBeRotated() ) { - return mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal(); + return this.mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal(); } return s; @@ -713,16 +713,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature public boolean hasBlockTileEntity() { - return tileEntityType != null; + return this.tileEntityType != null; } public T getTileEntity( IBlockAccess w, int x, int y, int z ) { - if ( !hasBlockTileEntity() ) + if ( !this.hasBlockTileEntity() ) return null; TileEntity te = w.getTileEntity( x, y, z ); - if ( tileEntityType.isInstance( te ) ) + if ( this.tileEntityType.isInstance( te ) ) return ( T ) te; return null; @@ -772,7 +772,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature public Class getTileEntityClass() { - return tileEntityType; + return this.tileEntityType; } @SideOnly( Side.CLIENT ) @@ -784,11 +784,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override final public TileEntity createNewTileEntity( World var1, int var2 ) { - if ( hasBlockTileEntity() ) + if ( this.hasBlockTileEntity() ) { try { - return tileEntityType.newInstance(); + return this.tileEntityType.newInstance(); } catch ( Throwable e ) { @@ -801,7 +801,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override public void breakBlock( World w, int x, int y, int z, Block a, int b ) { - AEBaseTile te = getTileEntity( w, x, y, z ); + AEBaseTile te = this.getTileEntity( w, x, y, z ); if ( te != null ) { ArrayList drops = new ArrayList(); @@ -821,7 +821,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature public String getUnlocalizedName( ItemStack is ) { - return getUnlocalizedName(); + return this.getUnlocalizedName(); } public void addInformation( ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips ) @@ -836,6 +836,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature public boolean hasSubtypes() { - return hasSubtypes; + return this.hasSubtypes; } } diff --git a/src/main/java/appeng/block/AEBaseItemBlock.java b/src/main/java/appeng/block/AEBaseItemBlock.java index e2f771542..12323d9b5 100644 --- a/src/main/java/appeng/block/AEBaseItemBlock.java +++ b/src/main/java/appeng/block/AEBaseItemBlock.java @@ -48,8 +48,8 @@ public class AEBaseItemBlock extends ItemBlock public AEBaseItemBlock(Block id) { super( id ); - blockType = (AEBaseBlock) id; - hasSubtypes = blockType.hasSubtypes; + this.blockType = (AEBaseBlock) id; + this.hasSubtypes = this.blockType.hasSubtypes; if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance ); @@ -58,7 +58,7 @@ public class AEBaseItemBlock extends ItemBlock @Override public int getMetadata(int dmg) { - if ( hasSubtypes ) + if ( this.hasSubtypes ) return dmg; return 0; } @@ -66,7 +66,7 @@ public class AEBaseItemBlock extends ItemBlock @Override public String getUnlocalizedName(ItemStack is) { - return blockType.getUnlocalizedName( is ); + return this.blockType.getUnlocalizedName( is ); } @Override @@ -91,9 +91,9 @@ public class AEBaseItemBlock extends ItemBlock IOrientable ori = null; - if ( blockType.hasBlockTileEntity() ) + if ( this.blockType.hasBlockTileEntity() ) { - if ( blockType instanceof BlockLightDetector ) + if ( this.blockType instanceof BlockLightDetector ) { up = ForgeDirection.getOrientation( side ); if ( up == ForgeDirection.UP || up == ForgeDirection.DOWN ) @@ -101,7 +101,7 @@ public class AEBaseItemBlock extends ItemBlock else forward = ForgeDirection.UP; } - else if ( blockType instanceof BlockWireless || blockType instanceof BlockSkyCompass ) + else if ( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass ) { forward = ForgeDirection.getOrientation( side ); if ( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN ) @@ -145,9 +145,9 @@ public class AEBaseItemBlock extends ItemBlock } } - if ( blockType instanceof IOrientableBlock ) + if ( this.blockType instanceof IOrientableBlock ) { - ori = ((IOrientableBlock) blockType).getOrientable( w, x, y, z ); + ori = ((IOrientableBlock) this.blockType).getOrientable( w, x, y, z ); up = ForgeDirection.getOrientation( side ); forward = ForgeDirection.SOUTH; if ( up.offsetY == 0 ) @@ -156,20 +156,20 @@ public class AEBaseItemBlock extends ItemBlock ori.setOrientation( forward, up ); } - if ( !blockType.isValidOrientation( w, x, y, z, forward, up ) ) + if ( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) ) return false; if ( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) ) { - if ( blockType.hasBlockTileEntity() && !(blockType instanceof BlockLightDetector) ) + if ( this.blockType.hasBlockTileEntity() && !(this.blockType instanceof BlockLightDetector) ) { - AEBaseTile tile = blockType.getTileEntity( w, x, y, z ); + AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z ); ori = tile; if ( tile == null ) return true; - if ( ori.canBeRotated() && !blockType.hasCustomRotation() ) + if ( ori.canBeRotated() && !this.blockType.hasCustomRotation() ) { if ( ori.getForward() == null || ori.getUp() == null || // null tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN ) @@ -183,7 +183,7 @@ public class AEBaseItemBlock extends ItemBlock tile.onPlacement( stack, player, side ); } - else if ( blockType instanceof IOrientableBlock ) + else if ( this.blockType instanceof IOrientableBlock ) { ori.setOrientation( forward, up ); } diff --git a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java index 04d2b05dc..df5016e06 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java +++ b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java @@ -88,47 +88,47 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte @Override public double injectAEPower(ItemStack is, double amt) { - double internalCurrentPower = getInternal( is ); - double internalMaxPower = getMaxEnergyCapacity(); + double internalCurrentPower = this.getInternal( is ); + double internalMaxPower = this.getMaxEnergyCapacity(); internalCurrentPower += amt; if ( internalCurrentPower > internalMaxPower ) { amt = internalCurrentPower - internalMaxPower; internalCurrentPower = internalMaxPower; - setInternal( is, internalCurrentPower ); + this.setInternal( is, internalCurrentPower ); return amt; } - setInternal( is, internalCurrentPower ); + this.setInternal( is, internalCurrentPower ); return 0; } @Override public double extractAEPower(ItemStack is, double amt) { - double internalCurrentPower = getInternal( is ); + double internalCurrentPower = this.getInternal( is ); if ( internalCurrentPower > amt ) { internalCurrentPower -= amt; - setInternal( is, internalCurrentPower ); + this.setInternal( is, internalCurrentPower ); return amt; } amt = internalCurrentPower; - setInternal( is, 0 ); + this.setInternal( is, 0 ); return amt; } @Override public double getAEMaxPower(ItemStack is) { - return getMaxEnergyCapacity(); + return this.getMaxEnergyCapacity(); } @Override public double getAECurrentPower(ItemStack is) { - return getInternal( is ); + return this.getInternal( is ); } @Override diff --git a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java index 71b1b0746..65f2d1d52 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java @@ -35,7 +35,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit { super( BlockCraftingStorage.class ); - setTileEntity( TileCraftingStorageTile.class ); + this.setTileEntity( TileCraftingStorageTile.class ); } @Override @@ -56,7 +56,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit if ( is.getItemDamage() == 3 ) return "tile.appliedenergistics2.BlockCraftingStorage64k"; - return getItemUnlocalizedName( is ); + return this.getItemUnlocalizedName( is ); } @Override diff --git a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java index 07297e9ee..c80284d28 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java @@ -49,21 +49,21 @@ public class BlockCraftingUnit extends AEBaseBlock { super( childClass, Material.iron ); - hasSubtypes = true; - setFeature( EnumSet.of( AEFeature.CraftingCPU ) ); + this.hasSubtypes = true; + this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) ); } public BlockCraftingUnit() { this( BlockCraftingUnit.class ); - setTileEntity( TileCraftingTile.class ); + this.setTileEntity( TileCraftingTile.class ); } @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) { - TileCraftingTile tg = getTileEntity( w, x, y, z ); + TileCraftingTile tg = this.getTileEntity( w, x, y, z ); if ( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() ) { if ( Platform.isClient() ) @@ -80,7 +80,7 @@ public class BlockCraftingUnit extends AEBaseBlock public int getDamageValue(World w, int x, int y, int z) { int meta = w.getBlockMetadata( x, y, z ); - return damageDropped( meta ); + return this.damageDropped( meta ); } @Override @@ -95,7 +95,7 @@ public class BlockCraftingUnit extends AEBaseBlock if ( is.getItemDamage() == 1 ) return "tile.appliedenergistics2.BlockCraftingAccelerator"; - return getItemUnlocalizedName( is ); + return this.getItemUnlocalizedName( is ); } protected String getItemUnlocalizedName(ItemStack is) @@ -106,9 +106,9 @@ public class BlockCraftingUnit extends AEBaseBlock @Override public void setRenderStateByMeta(int itemDamage) { - IIcon front = getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage ); - IIcon other = getIcon( ForgeDirection.NORTH.ordinal(), itemDamage ); - getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other ); + IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage ); + IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage ); + this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other ); } @Override @@ -137,7 +137,7 @@ public class BlockCraftingUnit extends AEBaseBlock @Override public void breakBlock(World w, int x, int y, int z, Block a, int b) { - TileCraftingTile cp = getTileEntity( w, x, y, z ); + TileCraftingTile cp = this.getTileEntity( w, x, y, z ); if ( cp != null ) cp.breakCluster(); @@ -147,7 +147,7 @@ public class BlockCraftingUnit extends AEBaseBlock @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) { - TileCraftingTile cp = getTileEntity( w, x, y, z ); + TileCraftingTile cp = this.getTileEntity( w, x, y, z ); if ( cp != null ) cp.updateMultiBlock(); } diff --git a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java index cb3a3e3af..346549b35 100644 --- a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java +++ b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java @@ -39,10 +39,10 @@ public class BlockMolecularAssembler extends AEBaseBlock public BlockMolecularAssembler() { super( BlockMolecularAssembler.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.MolecularAssembler ) ); - setTileEntity( TileMolecularAssembler.class ); - isOpaque = false; - lightOpacity = 1; + this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) ); + this.setTileEntity( TileMolecularAssembler.class ); + this.isOpaque = false; + this.lightOpacity = 1; } public static boolean booleanAlphaPass = false; @@ -70,7 +70,7 @@ public class BlockMolecularAssembler extends AEBaseBlock @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) { - TileMolecularAssembler tg = getTileEntity( w, x, y, z ); + TileMolecularAssembler tg = this.getTileEntity( w, x, y, z ); if ( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC ); diff --git a/src/main/java/appeng/block/grindstone/BlockCrank.java b/src/main/java/appeng/block/grindstone/BlockCrank.java index f73f94187..c1f3d95fd 100644 --- a/src/main/java/appeng/block/grindstone/BlockCrank.java +++ b/src/main/java/appeng/block/grindstone/BlockCrank.java @@ -43,10 +43,10 @@ public class BlockCrank extends AEBaseBlock public BlockCrank() { super( BlockCrank.class, Material.wood ); - setFeature( EnumSet.of( AEFeature.GrindStone ) ); - setTileEntity( TileCrank.class ); - setLightOpacity( 0 ); - isFullSize = isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.GrindStone ) ); + this.setTileEntity( TileCrank.class ); + this.setLightOpacity( 0 ); + this.isFullSize = this.isOpaque = false; } @Override @@ -54,11 +54,11 @@ public class BlockCrank extends AEBaseBlock { if ( player instanceof FakePlayer || player == null ) { - dropCrank(w, x, y, z); + this.dropCrank(w, x, y, z); return true; } - AEBaseTile tile = getTileEntity( w, x, y, z ); + AEBaseTile tile = this.getTileEntity( w, x, y, z ); if ( tile instanceof TileCrank ) { if ( ((TileCrank) tile).power() ) @@ -86,7 +86,7 @@ public class BlockCrank extends AEBaseBlock private ForgeDirection findCrankable( World world, int x, int y, int z ) { for ( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) - if ( isCrankable( world, x, y, z, dir ) ) + if ( this.isCrankable( world, x, y, z, dir ) ) { return dir; } @@ -96,14 +96,14 @@ public class BlockCrank extends AEBaseBlock @Override public boolean canPlaceBlockAt( World world, int x, int y, int z ) { - return findCrankable( world , x, y, z ) != ForgeDirection.UNKNOWN; + return this.findCrankable( world , x, y, z ) != ForgeDirection.UNKNOWN; } @Override public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) { TileEntity te = world.getTileEntity( x, y, z ); - return !(te instanceof TileCrank) || isCrankable( world, x, y, z, up.getOpposite() ); + return !(te instanceof TileCrank) || this.isCrankable( world, x, y, z, up.getOpposite() ); } private void dropCrank( World world, int x, int y, int z ) @@ -115,10 +115,10 @@ public class BlockCrank extends AEBaseBlock @Override public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack ) { - AEBaseTile tile = getTileEntity( world, x, y, z ); + AEBaseTile tile = this.getTileEntity( world, x, y, z ); if ( tile != null ) { - ForgeDirection mnt = findCrankable( world, x, y, z ); + ForgeDirection mnt = this.findCrankable( world, x, y, z ); ForgeDirection forward = ForgeDirection.UP; if ( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN ) { @@ -128,24 +128,24 @@ public class BlockCrank extends AEBaseBlock } else { - dropCrank( world, x, y, z ); + this.dropCrank( world, x, y, z ); } } @Override public void onNeighborBlockChange (World world, int x, int y, int z, Block block ) { - AEBaseTile tile = getTileEntity( world, x, y, z ); + AEBaseTile tile = this.getTileEntity( world, x, y, z ); if ( tile != null ) { - if ( !isCrankable( world, x, y, z, tile.getUp().getOpposite() ) ) + if ( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) ) { - dropCrank( world, x, y, z ); + this.dropCrank( world, x, y, z ); } } else { - dropCrank( world, x, y, z ); + this.dropCrank( world, x, y, z ); } } diff --git a/src/main/java/appeng/block/grindstone/BlockGrinder.java b/src/main/java/appeng/block/grindstone/BlockGrinder.java index e90b026a6..30d40b7bc 100644 --- a/src/main/java/appeng/block/grindstone/BlockGrinder.java +++ b/src/main/java/appeng/block/grindstone/BlockGrinder.java @@ -35,15 +35,15 @@ public class BlockGrinder extends AEBaseBlock public BlockGrinder() { super( BlockGrinder.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.GrindStone ) ); - setTileEntity( TileGrinder.class ); - setHardness( 3.2F ); + this.setFeature( EnumSet.of( AEFeature.GrindStone ) ); + this.setTileEntity( TileGrinder.class ); + this.setHardness( 3.2F ); } @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) { - TileGrinder tg = getTileEntity( w, x, y, z ); + TileGrinder tg = this.getTileEntity( w, x, y, z ); if ( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER ); diff --git a/src/main/java/appeng/block/misc/BlockCellWorkbench.java b/src/main/java/appeng/block/misc/BlockCellWorkbench.java index 127f6a74b..5b3bbae30 100644 --- a/src/main/java/appeng/block/misc/BlockCellWorkbench.java +++ b/src/main/java/appeng/block/misc/BlockCellWorkbench.java @@ -35,8 +35,8 @@ public class BlockCellWorkbench extends AEBaseBlock public BlockCellWorkbench() { super( BlockCellWorkbench.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.StorageCells ) ); - setTileEntity( TileCellWorkbench.class ); + this.setFeature( EnumSet.of( AEFeature.StorageCells ) ); + this.setTileEntity( TileCellWorkbench.class ); } @Override @@ -45,7 +45,7 @@ public class BlockCellWorkbench extends AEBaseBlock if ( p.isSneaking() ) return false; - TileCellWorkbench tg = getTileEntity( w, x, y, z ); + TileCellWorkbench tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockCharger.java b/src/main/java/appeng/block/misc/BlockCharger.java index 5484bdbc6..2f8376a7f 100644 --- a/src/main/java/appeng/block/misc/BlockCharger.java +++ b/src/main/java/appeng/block/misc/BlockCharger.java @@ -53,10 +53,10 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision public BlockCharger() { super( BlockCharger.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileCharger.class ); - setLightOpacity( 2 ); - isFullSize = isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileCharger.class ); + this.setLightOpacity( 2 ); + this.isFullSize = this.isOpaque = false; } @Override @@ -67,7 +67,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision if ( Platform.isServer() ) { - TileCharger tc = getTileEntity( w, x, y, z ); + TileCharger tc = this.getTileEntity( w, x, y, z ); if ( tc != null ) { tc.activate( player ); @@ -93,7 +93,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision if ( r.nextFloat() < 0.98 ) return; - AEBaseTile tile = getTileEntity( w, x, y, z ); + AEBaseTile tile = this.getTileEntity( w, x, y, z ); if ( tile instanceof TileCharger ) { TileCharger tc = (TileCharger) tile; @@ -120,7 +120,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - TileCharger tile = getTileEntity( w, x, y, z ); + TileCharger tile = this.getTileEntity( w, x, y, z ); if ( tile != null ) { double twoPixels = 2.0 / 16.0; diff --git a/src/main/java/appeng/block/misc/BlockCondenser.java b/src/main/java/appeng/block/misc/BlockCondenser.java index 0243013be..bb3c1d01d 100644 --- a/src/main/java/appeng/block/misc/BlockCondenser.java +++ b/src/main/java/appeng/block/misc/BlockCondenser.java @@ -35,8 +35,8 @@ public class BlockCondenser extends AEBaseBlock public BlockCondenser() { super( BlockCondenser.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileCondenser.class ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileCondenser.class ); } @Override @@ -47,7 +47,7 @@ public class BlockCondenser extends AEBaseBlock if ( Platform.isServer() ) { - TileCondenser tc = getTileEntity( w, x, y, z ); + TileCondenser tc = this.getTileEntity( w, x, y, z ); if ( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, ForgeDirection.getOrientation(side), GuiBridge.GUI_CONDENSER ); diff --git a/src/main/java/appeng/block/misc/BlockInscriber.java b/src/main/java/appeng/block/misc/BlockInscriber.java index 362157ff4..a1acdb1b2 100644 --- a/src/main/java/appeng/block/misc/BlockInscriber.java +++ b/src/main/java/appeng/block/misc/BlockInscriber.java @@ -37,10 +37,10 @@ public class BlockInscriber extends AEBaseBlock public BlockInscriber() { super( BlockInscriber.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Inscriber ) ); - setTileEntity( TileInscriber.class ); - setLightOpacity( 2 ); - isFullSize = isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.Inscriber ) ); + this.setTileEntity( TileInscriber.class ); + this.setLightOpacity( 2 ); + this.isFullSize = this.isOpaque = false; } @Override @@ -55,7 +55,7 @@ public class BlockInscriber extends AEBaseBlock if ( p.isSneaking() ) return false; - TileInscriber tg = getTileEntity( w, x, y, z ); + TileInscriber tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockInterface.java b/src/main/java/appeng/block/misc/BlockInterface.java index 7e1dd1837..0a1848373 100644 --- a/src/main/java/appeng/block/misc/BlockInterface.java +++ b/src/main/java/appeng/block/misc/BlockInterface.java @@ -38,8 +38,8 @@ public class BlockInterface extends AEBaseBlock public BlockInterface() { super( BlockInterface.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileInterface.class ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileInterface.class ); } @Override @@ -69,7 +69,7 @@ public class BlockInterface extends AEBaseBlock if ( p.isSneaking() ) return false; - TileInterface tg = getTileEntity( w, x, y, z ); + TileInterface tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockLightDetector.java b/src/main/java/appeng/block/misc/BlockLightDetector.java index a87a26b68..7b63735f6 100644 --- a/src/main/java/appeng/block/misc/BlockLightDetector.java +++ b/src/main/java/appeng/block/misc/BlockLightDetector.java @@ -33,8 +33,8 @@ public class BlockLightDetector extends BlockQuartzTorch public BlockLightDetector() { super( BlockLightDetector.class ); - setFeature( EnumSet.of( AEFeature.LightDetector ) ); - setTileEntity( TileLightDetector.class ); + this.setFeature( EnumSet.of( AEFeature.LightDetector ) ); + this.setTileEntity( TileLightDetector.class ); } @Override @@ -42,7 +42,7 @@ public class BlockLightDetector extends BlockQuartzTorch { super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ ); - TileLightDetector tld = getTileEntity( world, x, y, z ); + TileLightDetector tld = this.getTileEntity( world, x, y, z ); if ( tld != null ) tld.updateLight(); } @@ -50,7 +50,7 @@ public class BlockLightDetector extends BlockQuartzTorch @Override public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) { - if ( w instanceof World && ((TileLightDetector) getTileEntity( w, x, y, z )).isReady() ) + if ( w instanceof World && ((TileLightDetector) this.getTileEntity( w, x, y, z )).isReady() ) return ((World) w).getBlockLightValue( x, y, z ) - 6; return 0; diff --git a/src/main/java/appeng/block/misc/BlockPaint.java b/src/main/java/appeng/block/misc/BlockPaint.java index 6c3577dc6..79d82e291 100644 --- a/src/main/java/appeng/block/misc/BlockPaint.java +++ b/src/main/java/appeng/block/misc/BlockPaint.java @@ -45,11 +45,11 @@ public class BlockPaint extends AEBaseBlock public BlockPaint() { super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) ); - setFeature( EnumSet.of( AEFeature.PaintBalls ) ); - setTileEntity( TilePaint.class ); - setLightOpacity( 0 ); - isFullSize = false; - isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.PaintBalls ) ); + this.setTileEntity( TilePaint.class ); + this.setLightOpacity( 0 ); + this.isFullSize = false; + this.isOpaque = false; } @Override @@ -61,7 +61,7 @@ public class BlockPaint extends AEBaseBlock @Override public int getLightValue(IBlockAccess w, int x, int y, int z) { - TilePaint tp = getTileEntity( w, x, y, z ); + TilePaint tp = this.getTileEntity( w, x, y, z ); if ( tp != null ) { @@ -88,7 +88,7 @@ public class BlockPaint extends AEBaseBlock @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) { - TilePaint tp = getTileEntity( w, x, y, z ); + TilePaint tp = this.getTileEntity( w, x, y, z ); if ( tp != null ) tp.onNeighborBlockChange(); diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index 7a1065e12..b1920e027 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -47,9 +47,9 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient public BlockQuartzGrowthAccelerator() { super( BlockQuartzGrowthAccelerator.class, Material.rock ); - setStepSound( Block.soundTypeMetal ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileQuartzGrowthAccelerator.class ); + this.setStepSound( Block.soundTypeMetal ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileQuartzGrowthAccelerator.class ); } @Override @@ -71,7 +71,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient if ( !AEConfig.instance.enableEffects ) return; - TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = getTileEntity( w, x, y, z ); + TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z ); if ( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) { diff --git a/src/main/java/appeng/block/misc/BlockQuartzTorch.java b/src/main/java/appeng/block/misc/BlockQuartzTorch.java index c8c5b0e87..70b38f0c1 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -53,14 +53,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I protected BlockQuartzTorch(Class which) { super( which, Material.circuits ); - setLightOpacity( 0 ); - isFullSize = isOpaque = false; + this.setLightOpacity( 0 ); + this.isFullSize = this.isOpaque = false; } public BlockQuartzTorch() { this( BlockQuartzTorch.class ); - setFeature( EnumSet.of( AEFeature.DecorativeLights ) ); - setLightLevel( 0.9375F ); + this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) ); + this.setLightLevel( 0.9375F ); } @Override @@ -86,7 +86,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I public boolean canPlaceBlockAt(World w, int x, int y, int z) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - if ( canPlaceAt( w, x, y, z, dir ) ) + if ( this.canPlaceAt( w, x, y, z, dir ) ) return true; return false; } @@ -99,21 +99,21 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up) { - return canPlaceAt( w, x, y, z, up.getOpposite() ); + return this.canPlaceAt( w, x, y, z, up.getOpposite() ); } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block id) { - ForgeDirection up = getOrientable( w, x, y, z ).getUp(); - if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) ) - dropTorch( w, x, y, z ); + ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) ) + this.dropTorch( w, x, y, z ); } @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - ForgeDirection up = getOrientable( w, x, y, z ).getUp(); + 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; @@ -139,7 +139,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I if ( r.nextFloat() < 0.98 ) return; - ForgeDirection up = getOrientable( w, x, y, z ).getUp(); + 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; diff --git a/src/main/java/appeng/block/misc/BlockSecurity.java b/src/main/java/appeng/block/misc/BlockSecurity.java index c80993b8a..2f3eb320b 100644 --- a/src/main/java/appeng/block/misc/BlockSecurity.java +++ b/src/main/java/appeng/block/misc/BlockSecurity.java @@ -37,8 +37,8 @@ public class BlockSecurity extends AEBaseBlock public BlockSecurity() { super( BlockSecurity.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Security ) ); - setTileEntity( TileSecurity.class ); + this.setFeature( EnumSet.of( AEFeature.Security ) ); + this.setTileEntity( TileSecurity.class ); } @Override @@ -53,7 +53,7 @@ public class BlockSecurity extends AEBaseBlock if ( p.isSneaking() ) return false; - TileSecurity tg = getTileEntity( w, x, y, z ); + TileSecurity tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isClient() ) diff --git a/src/main/java/appeng/block/misc/BlockSkyCompass.java b/src/main/java/appeng/block/misc/BlockSkyCompass.java index 94f10827e..272ba84d8 100644 --- a/src/main/java/appeng/block/misc/BlockSkyCompass.java +++ b/src/main/java/appeng/block/misc/BlockSkyCompass.java @@ -48,10 +48,10 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision public BlockSkyCompass() { super( BlockSkyCompass.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) ); - setTileEntity( TileSkyCompass.class ); - isOpaque = isFullSize = false; - lightOpacity = 0; + this.setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) ); + this.setTileEntity( TileSkyCompass.class ); + this.isOpaque = this.isFullSize = false; + this.lightOpacity = 0; } @Override @@ -78,7 +78,7 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision public boolean canPlaceBlockAt(World w, int x, int y, int z) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - if ( canPlaceAt( w, x, y, z, dir ) ) + if ( this.canPlaceAt( w, x, y, z, dir ) ) return true; return false; } @@ -91,25 +91,25 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision @Override public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up) { - TileSkyCompass sc = getTileEntity( w, x, y, z ); + TileSkyCompass sc = this.getTileEntity( w, x, y, z ); if ( sc != null ) return false; - return canPlaceAt( w, x, y, z, forward.getOpposite() ); + return this.canPlaceAt( w, x, y, z, forward.getOpposite() ); } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block id) { - TileSkyCompass sc = getTileEntity( w, x, y, z ); + TileSkyCompass sc = this.getTileEntity( w, x, y, z ); ForgeDirection up = sc.getForward(); - if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) ) - dropTorch( w, x, y, z ); + if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) ) + this.dropTorch( w, x, y, z ); } @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - TileSkyCompass tile = getTileEntity( w, x, y, z ); + TileSkyCompass tile = this.getTileEntity( w, x, y, z ); if ( tile != null ) { ForgeDirection forward = tile.getForward(); diff --git a/src/main/java/appeng/block/misc/BlockTinyTNT.java b/src/main/java/appeng/block/misc/BlockTinyTNT.java index e1cc179ca..d87a8e901 100644 --- a/src/main/java/appeng/block/misc/BlockTinyTNT.java +++ b/src/main/java/appeng/block/misc/BlockTinyTNT.java @@ -57,12 +57,12 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision public BlockTinyTNT() { super( BlockTinyTNT.class, Material.tnt ); - setFeature( EnumSet.of( AEFeature.TinyTNT ) ); - setLightOpacity( 1 ); - setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); - isFullSize = isOpaque = false; - setStepSound( soundTypeGrass ); - setHardness( 0F ); + this.setFeature( EnumSet.of( AEFeature.TinyTNT ) ); + this.setLightOpacity( 1 ); + this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); + this.isFullSize = this.isOpaque = false; + this.setStepSound( soundTypeGrass ); + this.setHardness( 0F ); EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true ); } diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index b43550440..291d25d4c 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -41,9 +41,9 @@ public class BlockVibrationChamber extends AEBaseBlock public BlockVibrationChamber() { super( BlockVibrationChamber.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.PowerGen ) ); - setTileEntity( TileVibrationChamber.class ); - setHardness( 4.2F ); + this.setFeature( EnumSet.of( AEFeature.PowerGen ) ); + this.setTileEntity( TileVibrationChamber.class ); + this.setHardness( 4.2F ); } @Override @@ -54,7 +54,7 @@ public class BlockVibrationChamber extends AEBaseBlock if ( Platform.isServer() ) { - TileVibrationChamber tc = getTileEntity( w, x, y, z ); + TileVibrationChamber tc = this.getTileEntity( w, x, y, z ); if ( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER ); @@ -69,9 +69,9 @@ public class BlockVibrationChamber extends AEBaseBlock public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s) { IIcon ico = super.getIcon( w, x, y, z, s ); - TileVibrationChamber tvc = getTileEntity( w, x, y, z ); + TileVibrationChamber tvc = this.getTileEntity( w, x, y, z ); - if ( tvc != null && tvc.isOn && ico == getRendererInstance().getTexture( ForgeDirection.SOUTH ) ) + if ( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) ) { return ExtraBlockTextures.BlockVibrationChamberFrontOn.getIcon(); } @@ -85,7 +85,7 @@ public class BlockVibrationChamber extends AEBaseBlock if ( !AEConfig.instance.enableEffects ) return; - AEBaseTile tile = getTileEntity( w, x, y, z ); + AEBaseTile tile = this.getTileEntity( w, x, y, z ); if ( tile instanceof TileVibrationChamber ) { TileVibrationChamber tc = (TileVibrationChamber) tile; diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index a207fff62..38bbbfd64 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -95,9 +95,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection public BlockCableBus() { super( BlockCableBus.class, AEGlassMaterial.instance ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setLightOpacity( 0 ); - isFullSize = isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setLightOpacity( 0 ); + this.isFullSize = this.isOpaque = false; } @Override @@ -112,7 +112,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @SideOnly(Side.CLIENT) public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer) { - Object object = cb( world, target.blockX, target.blockY, target.blockZ ); + Object object = this.cb( world, target.blockX, target.blockY, target.blockZ ); if ( object instanceof IPartHost ) { IPartHost host = (IPartHost) object; @@ -120,7 +120,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection for (ForgeDirection side : ForgeDirection.values()) { IPart p = host.getPart( side ); - IIcon ico = getIcon( p ); + IIcon ico = this.getIcon( p ); if ( ico == null ) continue; @@ -159,7 +159,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @SideOnly(Side.CLIENT) public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) { - Object object = cb( world, x, y, z ); + Object object = this.cb( world, x, y, z ); if ( object instanceof IPartHost ) { IPartHost host = (IPartHost) object; @@ -167,7 +167,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection for (ForgeDirection side : ForgeDirection.values()) { IPart p = host.getPart( side ); - IIcon ico = getIcon( p ); + IIcon ico = this.getIcon( p ); if ( ico == null ) continue; @@ -235,20 +235,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) { - return cb( world, x, y, z ).isLadder( entity ); + return this.cb( world, x, y, z ).isLadder( entity ); } @Override public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) { - return recolourBlock( world, x, y, z, side, colour, null ); + 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) { try { - return cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who ); + return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who ); } catch (Throwable ignored) { @@ -259,7 +259,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public void randomDisplayTick(World world, int x, int y, int z, Random r) { - cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r ); + this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r ); } @Override @@ -272,14 +272,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection } if ( block == null ) return 0; - return cb( world, x, y, z ).getLightValue(); + return this.cb( world, x, y, z ).getLightValue(); } @Override public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { Vec3 v3 = target.hitVec.addVector( -x, -y, -z ); - SelectedPart sp = cb( world, x, y, z ).selectPart( v3 ); + SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 ); if ( sp.part != null ) return sp.part.getItemStack( PartItemStack.Pick ); @@ -292,7 +292,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public boolean isReplaceable(IBlockAccess world, int x, int y, int z) { - return cb( world, x, y, z ).isEmpty(); + return this.cb( world, x, y, z ).isEmpty(); } @SuppressWarnings("deprecation") @@ -301,7 +301,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection { if ( player.capabilities.isCreativeMode ) { - AEBaseTile tile = getTileEntity( world, x, y, z ); + AEBaseTile tile = this.getTileEntity( world, x, y, z ); if ( tile != null ) tile.disableDrops(); // maybe ray trace? @@ -312,7 +312,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s) { - return getIcon( s, 0 ); + return this.getIcon( s, 0 ); } @Override @@ -346,20 +346,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public boolean isSideSolid(IBlockAccess w, int x, int y, int z, ForgeDirection side) { - return cb( w, x, y, z ).isSolidOnSide( side ); + return this.cb( w, x, y, z ).isSolidOnSide( side ); } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block meh) { - cb( w, x, y, z ).onNeighborChanged(); + this.cb( w, x, y, z ).onNeighborChanged(); } @Override public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ) { if ( Platform.isServer() ) - cb( w, x, y, z ).onNeighborChanged(); + this.cb( w, x, y, z ).onNeighborChanged(); } @Override @@ -371,13 +371,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - return cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); + return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); } @Override public void onEntityCollidedWithBlock(World w, int x, int y, int z, Entity e) { - cb( w, x, y, z ).onEntityCollision( e ); + this.cb( w, x, y, z ).onEntityCollision( e ); } @Override @@ -387,15 +387,15 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection { case -1: case 4: - return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ); + return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ); case 0: - return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.NORTH ) ); + return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.NORTH ) ); case 1: - return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.EAST ) ); + return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.EAST ) ); case 2: - return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.SOUTH ) ); + return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.SOUTH ) ); case 3: - return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.WEST ) ); + return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.WEST ) ); } return false; } @@ -403,13 +403,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Override public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) { - return cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() ); + return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() ); } @Override public int isProvidingStrongPower(IBlockAccess w, int x, int y, int z, int side) { - return cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() ); + return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() ); } @Override @@ -421,7 +421,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection public void setupTile() { - setTileEntity( noTesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBus.class.getName() ) ); + this.setTileEntity( noTesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBus.class.getName() ) ); if ( Platform.isClient() ) { tesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() ); @@ -453,20 +453,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection @Method(iname = "MFR") public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side) { - return cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None; + return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None; } int myColorMultiplier = 0xffffff; public void setRenderColor(int color) { - myColorMultiplier = color; + this.myColorMultiplier = color; } @Override public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { - return myColorMultiplier; + return this.myColorMultiplier; } } diff --git a/src/main/java/appeng/block/networking/BlockController.java b/src/main/java/appeng/block/networking/BlockController.java index 6bf0255ea..b11a5f158 100644 --- a/src/main/java/appeng/block/networking/BlockController.java +++ b/src/main/java/appeng/block/networking/BlockController.java @@ -34,15 +34,15 @@ public class BlockController extends AEBaseBlock public BlockController() { super( BlockController.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Channels ) ); - setTileEntity( TileController.class ); - setHardness( 6 ); + this.setFeature( EnumSet.of( AEFeature.Channels ) ); + this.setTileEntity( TileController.class ); + this.setHardness( 6 ); } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block id_junk) { - TileController tc = getTileEntity( w, x, y, z ); + TileController tc = this.getTileEntity( w, x, y, z ); if ( tc != null ) tc.onNeighborChange( false ); } diff --git a/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java b/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java index 6c7d9368e..3441c13a9 100644 --- a/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java @@ -30,8 +30,8 @@ public class BlockCreativeEnergyCell extends AEBaseBlock public BlockCreativeEnergyCell() { super( BlockCreativeEnergyCell.class, AEGlassMaterial.instance ); - setFeature( EnumSet.of( AEFeature.Creative ) ); - setTileEntity( TileCreativeEnergyCell.class ); + this.setFeature( EnumSet.of( AEFeature.Creative ) ); + this.setTileEntity( TileCreativeEnergyCell.class ); } } diff --git a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java index 6a04342a0..58640f144 100644 --- a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java @@ -36,8 +36,8 @@ public class BlockDenseEnergyCell extends BlockEnergyCell public BlockDenseEnergyCell() { super( BlockDenseEnergyCell.class ); - setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) ); - setTileEntity( TileDenseEnergyCell.class ); + this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) ); + this.setTileEntity( TileDenseEnergyCell.class ); } @Override diff --git a/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java b/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java index cd13876ba..db6c73784 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java +++ b/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java @@ -30,8 +30,8 @@ public class BlockEnergyAcceptor extends AEBaseBlock public BlockEnergyAcceptor() { super( BlockEnergyAcceptor.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileEnergyAcceptor.class ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileEnergyAcceptor.class ); } } diff --git a/src/main/java/appeng/block/networking/BlockEnergyCell.java b/src/main/java/appeng/block/networking/BlockEnergyCell.java index c19d2d21f..c0a206893 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockEnergyCell.java @@ -53,8 +53,8 @@ public class BlockEnergyCell extends AEBaseBlock public BlockEnergyCell() { this( BlockEnergyCell.class ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setTileEntity( TileEnergyCell.class ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setTileEntity( TileEnergyCell.class ); } @Override @@ -65,8 +65,8 @@ public class BlockEnergyCell extends AEBaseBlock ItemStack charged = new ItemStack( this, 1 ); NBTTagCompound tag = Platform.openNbtData( charged ); - tag.setDouble( "internalCurrentPower", getMaxPower() ); - tag.setDouble( "internalMaxPower", getMaxPower() ); + tag.setDouble( "internalCurrentPower", this.getMaxPower() ); + tag.setDouble( "internalMaxPower", this.getMaxPower() ); itemStacks.add( charged ); } diff --git a/src/main/java/appeng/block/networking/BlockWireless.java b/src/main/java/appeng/block/networking/BlockWireless.java index da36dfbb2..cc8853464 100644 --- a/src/main/java/appeng/block/networking/BlockWireless.java +++ b/src/main/java/appeng/block/networking/BlockWireless.java @@ -44,11 +44,11 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision public BlockWireless() { super( BlockWireless.class, AEGlassMaterial.instance ); - setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) ); - setTileEntity( TileWireless.class ); - setLightOpacity( 0 ); - isFullSize = false; - isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) ); + this.setTileEntity( TileWireless.class ); + this.setLightOpacity( 0 ); + this.isFullSize = false; + this.isOpaque = false; } @Override @@ -60,7 +60,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - TileWireless tile = getTileEntity( w, x, y, z ); + TileWireless tile = this.getTileEntity( w, x, y, z ); if ( tile != null ) { ForgeDirection forward = tile.getForward(); @@ -122,7 +122,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision @Override public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e) { - TileWireless tile = getTileEntity( w, x, y, z ); + TileWireless tile = this.getTileEntity( w, x, y, z ); if ( tile != null ) { ForgeDirection forward = tile.getForward(); @@ -188,7 +188,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision if ( p.isSneaking() ) return false; - TileWireless tg = getTileEntity( w, x, y, z ); + TileWireless tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index 5fd18e0df..53e0397d3 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -51,19 +51,19 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli public BlockQuantumLinkChamber() { super( BlockQuantumLinkChamber.class, AEGlassMaterial.instance ); - setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); - setTileEntity( TileQuantumBridge.class ); + this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); + this.setTileEntity( TileQuantumBridge.class ); float shave = 2.0f / 16.0f; - setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); - setLightOpacity( 0 ); - isFullSize = isOpaque = false; + this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); + this.setLightOpacity( 0 ); + this.isFullSize = this.isOpaque = false; } @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World w, int bx, int by, int bz, Random r) { - TileQuantumBridge bridge = getTileEntity( w, bx, by, bz ); + TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz ); if ( bridge != null ) { if ( bridge.hasQES() ) @@ -77,7 +77,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) { - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null ) bridge.neighborUpdate(); } @@ -85,7 +85,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli @Override public void breakBlock(World w, int x, int y, int z, Block a, int b) { - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null ) bridge.breakCluster(); @@ -104,7 +104,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli if ( p.isSneaking() ) return false; - TileQuantumBridge tg = getTileEntity( w, x, y, z ); + TileQuantumBridge tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index a8f830b81..9d0b06e0f 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -41,18 +41,18 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision public BlockQuantumRing() { super( BlockQuantumRing.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); - setTileEntity( TileQuantumBridge.class ); + this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); + this.setTileEntity( TileQuantumBridge.class ); float shave = 2.0f / 16.0f; - setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); - setLightOpacity( 1 ); - isFullSize = isOpaque = false; + this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); + this.setLightOpacity( 1 ); + this.isFullSize = this.isOpaque = false; } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) { - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null ) bridge.neighborUpdate(); } @@ -60,7 +60,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision @Override public void breakBlock(World w, int x, int y, int z, Block a, int b) { - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null ) bridge.breakCluster(); @@ -77,7 +77,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { double OnePx = 2.0 / 16.0; - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null && bridge.isCorner() ) { OnePx = 4.0 / 16.0; @@ -93,7 +93,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e) { double OnePx = 2.0 / 16.0; - TileQuantumBridge bridge = getTileEntity( w, x, y, z ); + TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if ( bridge != null && bridge.isCorner() ) { OnePx = 4.0 / 16.0; diff --git a/src/main/java/appeng/block/solids/BlockFluix.java b/src/main/java/appeng/block/solids/BlockFluix.java index 6e62f8715..4fe683b71 100644 --- a/src/main/java/appeng/block/solids/BlockFluix.java +++ b/src/main/java/appeng/block/solids/BlockFluix.java @@ -32,6 +32,6 @@ public class BlockFluix extends AEDecorativeBlock public BlockFluix() { super( BlockFluix.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } } diff --git a/src/main/java/appeng/block/solids/BlockQuartz.java b/src/main/java/appeng/block/solids/BlockQuartz.java index 3b0b61ee7..724bbbd06 100644 --- a/src/main/java/appeng/block/solids/BlockQuartz.java +++ b/src/main/java/appeng/block/solids/BlockQuartz.java @@ -29,7 +29,7 @@ public class BlockQuartz extends AEDecorativeBlock public BlockQuartz() { super( BlockQuartz.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } } diff --git a/src/main/java/appeng/block/solids/BlockQuartzChiseled.java b/src/main/java/appeng/block/solids/BlockQuartzChiseled.java index 1faf12c33..a7f24d57f 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzChiseled.java +++ b/src/main/java/appeng/block/solids/BlockQuartzChiseled.java @@ -29,7 +29,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock public BlockQuartzChiseled() { super( BlockQuartzChiseled.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } } diff --git a/src/main/java/appeng/block/solids/BlockQuartzGlass.java b/src/main/java/appeng/block/solids/BlockQuartzGlass.java index 732e8011d..75daf55af 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzGlass.java +++ b/src/main/java/appeng/block/solids/BlockQuartzGlass.java @@ -58,9 +58,9 @@ public class BlockQuartzGlass extends AEBaseBlock public BlockQuartzGlass(Class c) { super( c, Material.glass ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); - setLightOpacity( 0 ); - isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); + this.setLightOpacity( 0 ); + this.isOpaque = false; } } diff --git a/src/main/java/appeng/block/solids/BlockQuartzLamp.java b/src/main/java/appeng/block/solids/BlockQuartzLamp.java index fa0cb88ec..5f47ab59e 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzLamp.java +++ b/src/main/java/appeng/block/solids/BlockQuartzLamp.java @@ -35,9 +35,9 @@ public class BlockQuartzLamp extends BlockQuartzGlass public BlockQuartzLamp() { super( BlockQuartzLamp.class ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) ); - setLightLevel( 1.0f ); - setBlockTextureName( "BlockQuartzGlass" ); + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) ); + this.setLightLevel( 1.0f ); + this.setBlockTextureName( "BlockQuartzGlass" ); } @Override diff --git a/src/main/java/appeng/block/solids/BlockQuartzPillar.java b/src/main/java/appeng/block/solids/BlockQuartzPillar.java index 969f3e068..ca9901723 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzPillar.java +++ b/src/main/java/appeng/block/solids/BlockQuartzPillar.java @@ -33,7 +33,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock public BlockQuartzPillar() { super( BlockQuartzPillar.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); + this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } @Override diff --git a/src/main/java/appeng/block/solids/BlockSkyStone.java b/src/main/java/appeng/block/solids/BlockSkyStone.java index b37a6b9e1..e04ece0cd 100644 --- a/src/main/java/appeng/block/solids/BlockSkyStone.java +++ b/src/main/java/appeng/block/solids/BlockSkyStone.java @@ -81,11 +81,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public BlockSkyStone() { super( BlockSkyStone.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setHardness( 50 ); - hasSubtypes = true; - blockResistance = 150.0f; - setHarvestLevel( "pickaxe", 3, 0 ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setHardness( 50 ); + this.hasSubtypes = true; + this.blockResistance = 150.0f; + this.setHarvestLevel( "pickaxe", 3, 0 ); MinecraftForge.EVENT_BUS.register( this ); } @@ -99,15 +99,15 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public String getUnlocalizedName(ItemStack is) { if ( is.getItemDamage() == 1 ) - return getUnlocalizedName() + ".Block"; + return this.getUnlocalizedName() + ".Block"; if ( is.getItemDamage() == 2 ) - return getUnlocalizedName() + ".Brick"; + return this.getUnlocalizedName() + ".Brick"; if ( is.getItemDamage() == 3 ) - return getUnlocalizedName() + ".SmallBrick"; + return this.getUnlocalizedName() + ".SmallBrick"; - return getUnlocalizedName(); + return this.getUnlocalizedName(); } @Override @@ -135,9 +135,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public void registerBlockIcons(IIconRegister ir) { super.registerBlockIcons( ir ); - Block = ir.registerIcon( getTextureName() + ".Block" ); - Brick = ir.registerIcon( getTextureName() + ".Brick" ); - SmallBrick = ir.registerIcon( getTextureName() + ".SmallBrick" ); + this.Block = ir.registerIcon( this.getTextureName() + ".Block" ); + this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" ); + this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" ); } @Override @@ -145,18 +145,18 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public IIcon getIcon(int direction, int metadata) { if ( metadata == 1 ) - return Block; + return this.Block; if ( metadata == 2 ) - return Brick; + return this.Brick; if ( metadata == 3 ) - return SmallBrick; + return this.SmallBrick; return super.getIcon( direction, metadata ); } @Override public void setRenderStateByMeta(int metadata) { - getRendererInstance().setTemporaryRenderIcon( getIcon( 0, metadata ) ); + this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) ); } @Override @@ -197,7 +197,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock // use AE2's renderer, no rotatable blocks. int getRealRenderType() { - return getRenderType(); + return this.getRenderType(); } @Override diff --git a/src/main/java/appeng/block/solids/OreQuartz.java b/src/main/java/appeng/block/solids/OreQuartz.java index ff06b674f..279666346 100644 --- a/src/main/java/appeng/block/solids/OreQuartz.java +++ b/src/main/java/appeng/block/solids/OreQuartz.java @@ -43,12 +43,12 @@ public class OreQuartz extends AEBaseBlock public OreQuartz(Class self) { super( self, Material.rock ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setHardness( 3.0F ); - setResistance( 5.0F ); - boostBrightnessLow = 0; - boostBrightnessHigh = 1; - enhanceBrightness = false; + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setHardness( 3.0F ); + this.setResistance( 5.0F ); + this.boostBrightnessLow = 0; + this.boostBrightnessHigh = 1; + this.enhanceBrightness = false; } @Override @@ -67,14 +67,14 @@ public class OreQuartz extends AEBaseBlock public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 ); - if ( enhanceBrightness ) + if ( this.enhanceBrightness ) { j1 = Math.max( j1 >> 20, j1 >> 4 ); if ( j1 > 4 ) - j1 += boostBrightnessHigh; + j1 += this.boostBrightnessHigh; else - j1 += boostBrightnessLow; + j1 += this.boostBrightnessLow; if ( j1 > 15 ) j1 = 15; @@ -95,13 +95,13 @@ public class OreQuartz extends AEBaseBlock @Override public Item getItemDropped(int id, Random rand, int meta) { - return getItemDropped().getItem(); + return this.getItemDropped().getItem(); } @Override public int damageDropped(int id) { - return getItemDropped().getItemDamage(); + return this.getItemDropped().getItemDamage(); } @Override @@ -113,7 +113,7 @@ public class OreQuartz extends AEBaseBlock @Override public int quantityDroppedWithBonus(int fortune, Random rand) { - if ( fortune > 0 && Item.getItemFromBlock( this ) != getItemDropped( 0, rand, fortune ) ) + if ( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) ) { int j = rand.nextInt( fortune + 2 ) - 1; @@ -135,7 +135,7 @@ public class OreQuartz extends AEBaseBlock { super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta ); - if ( getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) ) + if ( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) ) { int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); diff --git a/src/main/java/appeng/block/solids/OreQuartzCharged.java b/src/main/java/appeng/block/solids/OreQuartzCharged.java index 6a14f4eb2..838bab963 100644 --- a/src/main/java/appeng/block/solids/OreQuartzCharged.java +++ b/src/main/java/appeng/block/solids/OreQuartzCharged.java @@ -35,8 +35,8 @@ public class OreQuartzCharged extends OreQuartz public OreQuartzCharged() { super( OreQuartzCharged.class ); - boostBrightnessLow = 2; - boostBrightnessHigh = 5; + this.boostBrightnessLow = 2; + this.boostBrightnessHigh = 5; } @Override diff --git a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java index d40dc8544..3706f398b 100644 --- a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java +++ b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java @@ -45,11 +45,11 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision public BlockMatrixFrame() { super( BlockMatrixFrame.class, Material.anvil ); - setFeature( EnumSet.of( AEFeature.SpatialIO ) ); - setResistance( 6000000.0F ); - setBlockUnbreakable(); - setLightOpacity( 0 ); - isOpaque = false; + this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); + this.setResistance( 6000000.0F ); + this.setBlockUnbreakable(); + this.setLightOpacity( 0 ); + this.isOpaque = false; } @Override diff --git a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java index 4453e74ff..218d53673 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java @@ -36,14 +36,14 @@ public class BlockSpatialIOPort extends AEBaseBlock public BlockSpatialIOPort() { super( BlockSpatialIOPort.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.SpatialIO ) ); - setTileEntity( TileSpatialIOPort.class ); + this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); + this.setTileEntity( TileSpatialIOPort.class ); } @Override public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk) { - TileSpatialIOPort te = getTileEntity( w, x, y, z ); + TileSpatialIOPort te = this.getTileEntity( w, x, y, z ); if ( te != null ) te.updateRedstoneState(); } @@ -54,7 +54,7 @@ public class BlockSpatialIOPort extends AEBaseBlock if ( p.isSneaking() ) return false; - TileSpatialIOPort tg = getTileEntity( w, x, y, z ); + TileSpatialIOPort tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java index 04f0e1e6d..8abbf0c30 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java @@ -35,14 +35,14 @@ public class BlockSpatialPylon extends AEBaseBlock public BlockSpatialPylon() { super( BlockSpatialPylon.class, AEGlassMaterial.instance ); - setFeature( EnumSet.of( AEFeature.SpatialIO ) ); - setTileEntity( TileSpatialPylon.class ); + this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); + this.setTileEntity( TileSpatialPylon.class ); } @Override public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) { - TileSpatialPylon tsp = getTileEntity( w, x, y, z ); + TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); if ( tsp != null ) tsp.onNeighborBlockChange(); } @@ -50,7 +50,7 @@ public class BlockSpatialPylon extends AEBaseBlock @Override public int getLightValue(IBlockAccess w, int x, int y, int z) { - TileSpatialPylon tsp = getTileEntity( w, x, y, z ); + TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); if ( tsp != null ) return tsp.getLightValue(); return super.getLightValue( w, x, y, z ); diff --git a/src/main/java/appeng/block/storage/BlockChest.java b/src/main/java/appeng/block/storage/BlockChest.java index 5a396ee15..6ae1cd132 100644 --- a/src/main/java/appeng/block/storage/BlockChest.java +++ b/src/main/java/appeng/block/storage/BlockChest.java @@ -41,8 +41,8 @@ public class BlockChest extends AEBaseBlock public BlockChest() { super( BlockChest.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) ); - setTileEntity( TileChest.class ); + this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) ); + this.setTileEntity( TileChest.class ); } @Override @@ -54,7 +54,7 @@ public class BlockChest extends AEBaseBlock @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) { - TileChest tg = getTileEntity( w, x, y, z ); + TileChest tg = this.getTileEntity( w, x, y, z ); if ( tg != null && !p.isSneaking() ) { if ( Platform.isClient() ) diff --git a/src/main/java/appeng/block/storage/BlockDrive.java b/src/main/java/appeng/block/storage/BlockDrive.java index 55dac80ec..4c5433fb0 100644 --- a/src/main/java/appeng/block/storage/BlockDrive.java +++ b/src/main/java/appeng/block/storage/BlockDrive.java @@ -37,8 +37,8 @@ public class BlockDrive extends AEBaseBlock public BlockDrive() { super( BlockDrive.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) ); - setTileEntity( TileDrive.class ); + this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) ); + this.setTileEntity( TileDrive.class ); } @Override @@ -53,7 +53,7 @@ public class BlockDrive extends AEBaseBlock if ( p.isSneaking() ) return false; - TileDrive tg = getTileEntity( w, x, y, z ); + TileDrive tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockIOPort.java b/src/main/java/appeng/block/storage/BlockIOPort.java index f2a621b57..c900f7bf3 100644 --- a/src/main/java/appeng/block/storage/BlockIOPort.java +++ b/src/main/java/appeng/block/storage/BlockIOPort.java @@ -36,14 +36,14 @@ public class BlockIOPort extends AEBaseBlock public BlockIOPort() { super( BlockIOPort.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) ); - setTileEntity( TileIOPort.class ); + this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) ); + this.setTileEntity( TileIOPort.class ); } @Override public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk) { - TileIOPort te = getTileEntity( w, x, y, z ); + TileIOPort te = this.getTileEntity( w, x, y, z ); if ( te != null ) te.updateRedstoneState(); } @@ -54,7 +54,7 @@ public class BlockIOPort extends AEBaseBlock if ( p.isSneaking() ) return false; - TileIOPort tg = getTileEntity( w, x, y, z ); + TileIOPort tg = this.getTileEntity( w, x, y, z ); if ( tg != null ) { if ( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index c8b9ddc1d..f3e771735 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -54,22 +54,22 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision public BlockSkyChest() { super( BlockSkyChest.class, Material.rock ); - setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) ); - setTileEntity( TileSkyChest.class ); - isOpaque = isFullSize = false; - lightOpacity = 0; - hasSubtypes = true; - setHardness( 50 ); - blockResistance = 150.0f; + this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) ); + this.setTileEntity( TileSkyChest.class ); + this.isOpaque = this.isFullSize = false; + this.lightOpacity = 0; + this.hasSubtypes = true; + this.setHardness( 50 ); + this.blockResistance = 150.0f; } @Override public String getUnlocalizedName(ItemStack is) { if ( is.getItemDamage() == 1 ) - return getUnlocalizedName() + ".Block"; + return this.getUnlocalizedName() + ".Block"; - return getUnlocalizedName(); + return this.getUnlocalizedName(); } @Override @@ -107,7 +107,7 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if ( Platform.isServer() ) - Platform.openGUI( player, getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST ); + Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST ); return true; } @@ -121,7 +121,7 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - TileSkyChest sk = getTileEntity( w, x, y, z ); + TileSkyChest sk = this.getTileEntity( w, x, y, z ); double sc = 0.06; ForgeDirection o = ForgeDirection.UNKNOWN; diff --git a/src/main/java/appeng/client/ClientHelper.java b/src/main/java/appeng/client/ClientHelper.java index b7db34965..39e98037e 100644 --- a/src/main/java/appeng/client/ClientHelper.java +++ b/src/main/java/appeng/client/ClientHelper.java @@ -100,7 +100,7 @@ public class ClientHelper extends ServerHelper Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.thePlayer; - return renderModeForPlayer( player ); + return this.renderModeForPlayer( player ); } @Override @@ -314,22 +314,22 @@ public class ClientHelper extends ServerHelper switch (effect) { case Assembler: - spawnAssembler( worldObj, posX, posY, posZ, o ); + this.spawnAssembler( worldObj, posX, posY, posZ, o ); return; case Vibrant: - spawnVibrant( worldObj, posX, posY, posZ ); + this.spawnVibrant( worldObj, posX, posY, posZ ); return; case Crafting: - spawnCrafting( worldObj, posX, posY, posZ ); + this.spawnCrafting( worldObj, posX, posY, posZ ); return; case Energy: - spawnEnergy( worldObj, posX, posY, posZ ); + this.spawnEnergy( worldObj, posX, posY, posZ ); return; case Lightning: - spawnLightning( worldObj, posX, posY, posZ ); + this.spawnLightning( worldObj, posX, posY, posZ ); return; case LightningArc: - spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o ); + this.spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o ); return; default: } diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index 686798d19..1f5893e27 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -92,7 +92,7 @@ public abstract class AEBaseGui extends GuiContainer public AEBaseGui(Container container) { super( container ); - subGui = switchingGuis; + this.subGui = switchingGuis; switchingGuis = false; } @@ -111,7 +111,7 @@ public abstract class AEBaseGui extends GuiContainer public boolean isSubGui() { - return subGui; + return this.subGui; } @Override @@ -125,7 +125,7 @@ public abstract class AEBaseGui extends GuiContainer if ( i.next() instanceof SlotME ) i.remove(); - for (InternalSlotME me : meSlots) + for (InternalSlotME me : this.meSlots) slots.add( new SlotME( me ) ); } @@ -145,21 +145,21 @@ public abstract class AEBaseGui extends GuiContainer { int x = Mouse.getEventX() * this.width / this.mc.displayWidth; int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; - mouseWheelEvent( x, y, i / Math.abs( i ) ); + this.mouseWheelEvent( x, y, i / Math.abs( i ) ); } - else if ( i != 0 && myScrollBar != null ) - myScrollBar.wheel( i ); + else if ( i != 0 && this.myScrollBar != null ) + this.myScrollBar.wheel( i ); } protected void mouseWheelEvent(int x, int y, int wheel) { - Slot slot = getSlot( x, y ); + Slot slot = this.getSlot( x, y ); if ( slot instanceof SlotME ) { IAEItemStack item = ((SlotME) slot).getAEStack(); if ( item != null ) { - ((AEBaseContainer) inventorySlots).setTargetStack( item ); + ((AEBaseContainer) this.inventorySlots).setTargetStack( item ); InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; int times = Math.abs( wheel ); final int inventorySize = this.getInventorySlots().size(); @@ -176,13 +176,13 @@ public abstract class AEBaseGui extends GuiContainer public void onGuiClosed() { super.onGuiClosed(); - subGui = true; // in case the gui is reopened later ( i'm looking at you NEI ) + this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI ) } @Override protected void mouseClicked(int xCoord, int yCoord, int btn) { - drag_click.clear(); + this.drag_click.clear(); if ( btn == 1 ) { @@ -217,7 +217,7 @@ public abstract class AEBaseGui extends GuiContainer { final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; - if ( drag_click.size() > 1 ) + if ( this.drag_click.size() > 1 ) return; PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); @@ -259,7 +259,7 @@ public abstract class AEBaseGui extends GuiContainer if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) ) { - if ( enableSpaceClicking() ) + if ( this.enableSpaceClicking() ) { IAEItemStack stack = null; if ( slot instanceof SlotME ) @@ -270,7 +270,7 @@ public abstract class AEBaseGui extends GuiContainer if ( !(slot instanceof SlotME) && slot != null ) slotNum = slot.slotNumber; - ((AEBaseContainer) inventorySlots).setTargetStack( stack ); + ((AEBaseContainer) this.inventorySlots).setTargetStack( stack ); PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); NetworkHandler.instance.sendToServer( p ); return; @@ -356,7 +356,7 @@ public abstract class AEBaseGui extends GuiContainer if ( action != null ) { - ((AEBaseContainer) inventorySlots).setTargetStack( stack ); + ((AEBaseContainer) this.inventorySlots).setTargetStack( stack ); PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); NetworkHandler.instance.sendToServer( p ); } @@ -364,21 +364,21 @@ public abstract class AEBaseGui extends GuiContainer return; } - if ( !disableShiftClick && isShiftKeyDown() ) + if ( !this.disableShiftClick && isShiftKeyDown() ) { - disableShiftClick = true; + this.disableShiftClick = true; - if ( dbl_whichItem == null || bl_clicked != slot || dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 ) + if ( this.dbl_whichItem == null || this.bl_clicked != slot || this.dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 ) { // some simple double click logic. - bl_clicked = slot; - dbl_clickTimer = Stopwatch.createStarted(); + this.bl_clicked = slot; + this.dbl_clickTimer = Stopwatch.createStarted(); if ( slot != null ) - dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null; + this.dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null; else - dbl_whichItem = null; + this.dbl_whichItem = null; } - else if ( dbl_whichItem != null ) + else if ( this.dbl_whichItem != null ) { // a replica of the weird broken vanilla feature. @@ -386,14 +386,14 @@ public abstract class AEBaseGui extends GuiContainer for (Slot inventorySlot : slots) { if ( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() - && inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, dbl_whichItem, true ) ) + && inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, this.dbl_whichItem, true ) ) { this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, ctrlDown, 1 ); } } } - disableShiftClick = false; + this.disableShiftClick = false; } super.handleMouseClick( slot, slotIdx, ctrlDown, key ); @@ -407,10 +407,10 @@ public abstract class AEBaseGui extends GuiContainer if ( slot instanceof SlotFake && itemstack != null ) { - drag_click.add( slot ); - if ( drag_click.size() > 1 ) + this.drag_click.add( slot ); + if ( this.drag_click.size() > 1 ) { - for (Slot dr : drag_click) + for (Slot dr : this.drag_click) { PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); @@ -450,9 +450,9 @@ public abstract class AEBaseGui extends GuiContainer final List slots = this.getInventorySlots(); for (Slot s : slots) { - if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) inventorySlots).getPlayerInv() ) + if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) this.inventorySlots).getPlayerInv() ) { - if ( !s.canTakeStack( ((AEBaseContainer) inventorySlots).getPlayerInv().player ) ) + if ( !s.canTakeStack( ((AEBaseContainer) this.inventorySlots).getPlayerInv().player ) ) { return false; } @@ -468,7 +468,7 @@ public abstract class AEBaseGui extends GuiContainer { for (Slot s : slots) { - if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) inventorySlots).getPlayerInv() ) + if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) this.inventorySlots).getPlayerInv() ) { NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) ); return true; @@ -488,10 +488,10 @@ public abstract class AEBaseGui extends GuiContainer super.drawScreen( mouse_x, mouse_y, btn ); boolean hasClicked = Mouse.isButtonDown( 0 ); - if ( hasClicked && myScrollBar != null ) - myScrollBar.click( this, mouse_x - guiLeft, mouse_y - guiTop ); + if ( hasClicked && this.myScrollBar != null ) + this.myScrollBar.click( this, mouse_x - this.guiLeft, mouse_y - this.guiTop ); - for (Object c : buttonList) + for (Object c : this.buttonList) { if ( c instanceof ITooltip ) { @@ -508,7 +508,7 @@ public abstract class AEBaseGui extends GuiContainer String msg = tooltip.getMessage(); if ( msg != null ) - drawTooltip( x + 11, y + 4, 0, msg ); + this.drawTooltip( x + 11, y + 4, 0, msg ); } } } @@ -532,7 +532,7 @@ public abstract class AEBaseGui extends GuiContainer for (var6 = 0; var6 < var4.length; ++var6) { - var7 = fontRendererObj.getStringWidth( var4[var6] ); + var7 = this.fontRendererObj.getStringWidth( var4[var6] ); if ( var7 > var5 ) { @@ -637,10 +637,10 @@ public abstract class AEBaseGui extends GuiContainer @Override final protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int ox = guiLeft; // (width - xSize) / 2; - int oy = guiTop; // (height - ySize) / 2; + int ox = this.guiLeft; // (width - xSize) / 2; + int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); - drawBG( ox, oy, x, y ); + this.drawBG( ox, oy, x, y ); final List slots = this.getInventorySlots(); for (Slot slot : slots) @@ -671,30 +671,30 @@ public abstract class AEBaseGui extends GuiContainer @Override final protected void drawGuiContainerForegroundLayer(int x, int y) { - int ox = guiLeft; // (width - xSize) / 2; - int oy = guiTop; // (height - ySize) / 2; + int ox = this.guiLeft; // (width - xSize) / 2; + int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); - if ( myScrollBar != null ) - myScrollBar.draw( this ); + if ( this.myScrollBar != null ) + this.myScrollBar.draw( this ); - drawFG( ox, oy, x, y ); + this.drawFG( ox, oy, x, y ); } protected String getGuiDisplayName(String in) { - return hasCustomInventoryName() ? getInventoryName() : in; + return this.hasCustomInventoryName() ? this.getInventoryName() : in; } private String getInventoryName() { - return ((AEBaseContainer) inventorySlots).customName; + return ((AEBaseContainer) this.inventorySlots).customName; } private boolean hasCustomInventoryName() { - if ( inventorySlots instanceof AEBaseContainer ) - return ((AEBaseContainer) inventorySlots).customName != null; + if ( this.inventorySlots instanceof AEBaseContainer ) + return ((AEBaseContainer) this.inventorySlots).customName != null; return false; } @@ -704,7 +704,7 @@ public abstract class AEBaseGui extends GuiContainer for (Slot slot : slots) { // isPointInRegion - if ( func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) ) + if ( this.func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) ) { return slot; } @@ -761,25 +761,25 @@ public abstract class AEBaseGui extends GuiContainer public void a(Slot s) { - drawSlot( s ); + this.drawSlot( s ); } public void func_146977_a(Slot s) { - drawSlot( s ); + this.drawSlot( s ); } public void drawSlot(Slot s) { if ( s instanceof SlotME ) { - RenderItem pIR = setItemRender( aeRenderItem ); + RenderItem pIR = this.setItemRender( this.aeRenderItem ); try { this.zLevel = 100.0F; itemRender.zLevel = 100.0F; - if ( !isPowered() ) + if ( !this.isPowered() ) { GL11.glDisable( GL11.GL_LIGHTING ); drawRect( s.xDisplayPosition, s.yDisplayPosition, 16 + s.xDisplayPosition, 16 + s.yDisplayPosition, 0x66111111 ); @@ -789,9 +789,9 @@ public abstract class AEBaseGui extends GuiContainer this.zLevel = 0.0F; itemRender.zLevel = 0.0F; - aeRenderItem.aeStack = ((SlotME) s).getAEStack(); + this.aeRenderItem.aeStack = ((SlotME) s).getAEStack(); - safeDrawSlot( s ); + this.safeDrawSlot( s ); } catch (Exception err) { @@ -799,7 +799,7 @@ public abstract class AEBaseGui extends GuiContainer if ( Platform.isDrawing( Tessellator.instance ) ) Tessellator.instance.draw(); } - setItemRender( pIR ); + this.setItemRender( pIR ); return; } else @@ -812,7 +812,7 @@ public abstract class AEBaseGui extends GuiContainer AppEngSlot aes = (AppEngSlot) s; if ( aes.getIcon() >= 0 ) { - bindTexture( "guis/states.png" ); + this.bindTexture( "guis/states.png" ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); Tessellator tessellator = Tessellator.instance; @@ -894,10 +894,10 @@ public abstract class AEBaseGui extends GuiContainer if ( s instanceof AppEngSlot ) { ((AppEngSlot) s).isDisplay = true; - safeDrawSlot( s ); + this.safeDrawSlot( s ); } else - safeDrawSlot( s ); + this.safeDrawSlot( s ); return; } @@ -907,7 +907,7 @@ public abstract class AEBaseGui extends GuiContainer } } // do the usual for non-ME Slots. - safeDrawSlot( s ); + this.safeDrawSlot( s ); } } diff --git a/src/main/java/appeng/client/gui/AEBaseMEGui.java b/src/main/java/appeng/client/gui/AEBaseMEGui.java index 6a18ec69c..651a75ad4 100644 --- a/src/main/java/appeng/client/gui/AEBaseMEGui.java +++ b/src/main/java/appeng/client/gui/AEBaseMEGui.java @@ -40,7 +40,7 @@ public abstract class AEBaseMEGui extends AEBaseGui { if ( stack != null ) { - Slot s = getSlot( mouseX, mouseY ); + Slot s = this.getSlot( mouseX, mouseY ); if ( s instanceof SlotME ) { int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; @@ -78,7 +78,7 @@ public abstract class AEBaseMEGui extends AEBaseGui @Override protected void renderToolTip(ItemStack stack, int x, int y) { - Slot s = getSlot( x, y ); + Slot s = this.getSlot( x, y ); if ( s instanceof SlotME && stack != null ) { int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; @@ -105,13 +105,13 @@ public abstract class AEBaseMEGui extends AEBaseGui if ( myStack.getCountRequestable() > 0 ) currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); - drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); + this.drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); } else if ( stack.stackSize > BigNumber ) { List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); - drawTooltip( x, y, 0, join( var4, "\n" ) ); + this.drawTooltip( x, y, 0, join( var4, "\n" ) ); return; } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java index c6ab6e2c9..33a4147ef 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java @@ -54,37 +54,37 @@ public class GuiCellWorkbench extends GuiUpgradeable public GuiCellWorkbench(InventoryPlayer inventoryPlayer, TileCellWorkbench te) { super( new ContainerCellWorkbench( inventoryPlayer, te ) ); - workbench = (ContainerCellWorkbench) inventorySlots; - ySize = 251; - tcw = te; + this.workbench = (ContainerCellWorkbench) this.inventorySlots; + this.ySize = 251; + this.tcw = te; } @Override protected boolean drawUpgrades() { - return workbench.availableUpgrades() > 0; + return this.workbench.availableUpgrades() > 0; } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - handleButtonVisibility(); + this.handleButtonVisibility(); - bindTexture( getBackground() ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); - if ( drawUpgrades() ) + this.bindTexture( this.getBackground() ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize ); + if ( this.drawUpgrades() ) { - if ( workbench.availableUpgrades() <= 8 ) + if ( this.workbench.availableUpgrades() <= 8 ) { - this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + workbench.availableUpgrades() * 18 ); - this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (workbench.availableUpgrades()) * 18), 177, 151, 35, 7 ); + this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + this.workbench.availableUpgrades() * 18 ); + this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (this.workbench.availableUpgrades()) * 18), 177, 151, 35, 7 ); } - else if ( workbench.availableUpgrades() <= 16 ) + else if ( this.workbench.availableUpgrades() <= 16 ) { 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 = workbench.availableUpgrades() - 8; + int dx = this.workbench.availableUpgrades() - 8; this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if ( dx == 8 ) this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); @@ -100,7 +100,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 = workbench.availableUpgrades() - 16; + int dx = this.workbench.availableUpgrades() - 16; this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if ( dx == 8 ) this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); @@ -108,8 +108,8 @@ public class GuiCellWorkbench extends GuiUpgradeable this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8, 7 ); } } - if ( hasToolbox() ) - this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, 161, 68, 68 ); + if ( this.hasToolbox() ) + this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 ); } @Override @@ -117,23 +117,23 @@ public class GuiCellWorkbench extends GuiUpgradeable { try { - if ( btn == copyMode ) + if ( btn == this.copyMode ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "CopyMode" ) ); } - else if ( btn == partition ) + else if ( btn == this.partition ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Partition" ) ); } - else if ( btn == clear ) + else if ( btn == this.clear ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) ); } - else if ( btn == fuzzyMode ) + else if ( btn == this.fuzzyMode ) { boolean backwards = Mouse.isButtonDown( 1 ); - FuzzyMode fz = (FuzzyMode) fuzzyMode.getCurrentValue(); + FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue(); fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) ); @@ -149,24 +149,24 @@ public class GuiCellWorkbench extends GuiUpgradeable @Override protected void addButtons() { - clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); - partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); - copyMode = new GuiToggleButton( this.guiLeft - 18, guiTop + 48, 11 * 16 + 5, 12 * 16 + 5, GuiText.CopyMode.getLocal(), GuiText.CopyModeDesc.getLocal() ); - fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.clear = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); + this.partition = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); + this.copyMode = new GuiToggleButton( this.guiLeft - 18, this.guiTop + 48, 11 * 16 + 5, 12 * 16 + 5, GuiText.CopyMode.getLocal(), GuiText.CopyModeDesc.getLocal() ); + this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - buttonList.add( fuzzyMode ); - buttonList.add( partition ); - buttonList.add( clear ); - buttonList.add( copyMode ); + this.buttonList.add( this.fuzzyMode ); + this.buttonList.add( this.partition ); + this.buttonList.add( this.clear ); + this.buttonList.add( this.copyMode ); } @Override protected void handleButtonVisibility() { - copyMode.setState( workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); + this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); boolean hasFuzzy = false; - IInventory inv = workbench.getCellUpgradeInventory(); + IInventory inv = this.workbench.getCellUpgradeInventory(); for (int x = 0; x < inv.getSizeInventory(); x++) { ItemStack is = inv.getStackInSlot( x ); @@ -176,7 +176,7 @@ public class GuiCellWorkbench extends GuiUpgradeable hasFuzzy = true; } } - fuzzyMode.setVisibility( hasFuzzy ); + this.fuzzyMode.setVisibility( hasFuzzy ); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiChest.java b/src/main/java/appeng/client/gui/implementations/GuiChest.java index e92d22c83..846c2805e 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiChest.java @@ -39,7 +39,7 @@ public class GuiChest extends AEBaseGui { super.actionPerformed( par1GuiButton ); - if ( par1GuiButton == priority ) + if ( par1GuiButton == this.priority ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); } @@ -50,7 +50,7 @@ public class GuiChest extends AEBaseGui { super.initGui(); - buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); + this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); } public GuiChest(InventoryPlayer inventoryPlayer, TileChest te) { @@ -61,15 +61,15 @@ public class GuiChest extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/chest.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/chest.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java index f681a9583..73e099e3e 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java @@ -45,7 +45,7 @@ public class GuiCondenser extends AEBaseGui public GuiCondenser(InventoryPlayer inventoryPlayer, TileCondenser te) { super( new ContainerCondenser( inventoryPlayer, te ) ); - cvc = (ContainerCondenser) inventorySlots; + this.cvc = (ContainerCondenser) this.inventorySlots; this.ySize = 197; } @@ -56,7 +56,7 @@ public class GuiCondenser extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( mode == btn ) + if ( this.mode == btn ) { NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) ); } @@ -67,30 +67,30 @@ public class GuiCondenser extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( cvc, "guis/condenser.png", 120 + guiLeft, 25 + guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() ); + this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() ); - mode = new GuiImgButton( 128 + guiLeft, 52 + guiTop, Settings.CONDENSER_OUTPUT, cvc.output ); + this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.output ); - this.buttonList.add( pb ); - this.buttonList.add( mode ); + this.buttonList.add( this.pb ); + this.buttonList.add( this.mode ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/condenser.png" ); + this.bindTexture( "guis/condenser.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - mode.set( cvc.output ); - mode.fillVar = String.valueOf( cvc.output.requiredPower ); + this.mode.set( this.cvc.output ); + this.mode.fillVar = String.valueOf( this.cvc.output.requiredPower ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java index 4d2908350..eb374a533 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java @@ -66,55 +66,55 @@ public class GuiCraftAmount extends AEBaseGui int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); - buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) ); - buttonList.add( plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) ); - buttonList.add( plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 26, 32, 20, "+" + c ) ); - buttonList.add( plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 26, 38, 20, "+" + d ) ); + 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 ) ); + this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 26, 32, 20, "+" + c ) ); + this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 26, 38, 20, "+" + d ) ); - buttonList.add( minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 75, 22, 20, "-" + a ) ); - buttonList.add( minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 75, 28, 20, "-" + b ) ); - buttonList.add( minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 75, 32, 20, "-" + c ) ); - buttonList.add( minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 75, 38, 20, "-" + d ) ); + this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 75, 22, 20, "-" + a ) ); + this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 75, 28, 20, "-" + b ) ); + this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 75, 32, 20, "-" + c ) ); + this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 75, 38, 20, "-" + d ) ); - buttonList.add( next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) ); + 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) inventorySlots).getTarget(); + Object target = ((AEBaseContainer) this.inventorySlots).getTarget(); if ( target instanceof WirelessTerminalGuiObject ) { myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_WIRELESS_TERM; + this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM; } if ( target instanceof PartTerminal ) { myIcon = AEApi.instance().parts().partTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_ME; + this.OriginalGui = GuiBridge.GUI_ME; } if ( target instanceof PartCraftingTerminal ) { myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; + this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; } if ( target instanceof PartPatternTerminal ) { myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; + this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; } - if ( OriginalGui != null ) - buttonList.add( originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); + if ( this.OriginalGui != null ) + this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); - amountToCraft = new GuiNumberBox( fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, fontRendererObj.FONT_HEIGHT, Integer.class ); - amountToCraft.setEnableBackgroundDrawing( false ); - amountToCraft.setMaxStringLength( 16 ); - amountToCraft.setTextColor( 0xFFFFFF ); - amountToCraft.setVisible( true ); - amountToCraft.setFocused( true ); - amountToCraft.setText( "1" ); + this.amountToCraft = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT, Integer.class ); + this.amountToCraft.setEnableBackgroundDrawing( false ); + this.amountToCraft.setMaxStringLength( 16 ); + this.amountToCraft.setTextColor( 0xFFFFFF ); + this.amountToCraft.setVisible( true ); + this.amountToCraft.setFocused( true ); + this.amountToCraft.setText( "1" ); } @Override @@ -125,12 +125,12 @@ public class GuiCraftAmount extends AEBaseGui try { - if ( btn == originalGuiBtn ) + if ( btn == this.originalGuiBtn ) { - NetworkHandler.instance.sendToServer( new PacketSwitchGuis( OriginalGui ) ); + NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } - if ( btn == next ) + if ( btn == this.next ) { NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) ); } @@ -139,21 +139,21 @@ public class GuiCraftAmount extends AEBaseGui catch (NumberFormatException e) { // nope.. - amountToCraft.setText( "1" ); + this.amountToCraft.setText( "1" ); } - boolean isPlus = btn == plus1 || btn == plus10 || btn == plus100 || btn == plus1000; - boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; + 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; if ( isPlus || isMinus ) - addQty( getQty( btn ) ); + this.addQty( this.getQty( btn ) ); } private void addQty(int i) { try { - String Out = amountToCraft.getText(); + String Out = this.amountToCraft.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -163,7 +163,7 @@ public class GuiCraftAmount extends AEBaseGui } if ( Fixed ) - amountToCraft.setText( Out ); + this.amountToCraft.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -179,7 +179,7 @@ public class GuiCraftAmount extends AEBaseGui Out = Long.toString( result ); Integer.parseInt( Out ); - amountToCraft.setText( Out ); + this.amountToCraft.setText( Out ); } catch (NumberFormatException e) { @@ -194,14 +194,14 @@ public class GuiCraftAmount extends AEBaseGui { if ( key == 28 ) { - actionPerformed( next ); + this.actionPerformed( this.next ); } if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character )) - && amountToCraft.textboxKeyTyped( character, key ) ) + && this.amountToCraft.textboxKeyTyped( character, key ) ) { try { - String Out = amountToCraft.getText(); + String Out = this.amountToCraft.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -211,7 +211,7 @@ public class GuiCraftAmount extends AEBaseGui } if ( Fixed ) - amountToCraft.setText( Out ); + this.amountToCraft.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -219,7 +219,7 @@ public class GuiCraftAmount extends AEBaseGui long result = Long.parseLong( Out ); if ( result < 0 ) { - amountToCraft.setText( "1" ); + this.amountToCraft.setText( "1" ); } } catch (NumberFormatException e) @@ -237,22 +237,22 @@ public class GuiCraftAmount extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal(); + this.next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal(); - bindTexture( "guis/craftAmt.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/craftAmt.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); try { - Long.parseLong( amountToCraft.getText() ); - next.enabled = amountToCraft.getText().length() > 0; + Long.parseLong( this.amountToCraft.getText() ); + this.next.enabled = this.amountToCraft.getText().length() > 0; } catch (NumberFormatException e) { - next.enabled = false; + this.next.enabled = false; } - amountToCraft.drawTextBox(); + this.amountToCraft.drawTextBox(); } protected String getBackground() @@ -263,6 +263,6 @@ public class GuiCraftAmount extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java index da2aa9663..20a16b048 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java @@ -71,33 +71,33 @@ public class GuiCraftConfirm extends AEBaseGui boolean isAutoStart() { - return ((ContainerCraftConfirm) inventorySlots).autoStart; + return ((ContainerCraftConfirm) this.inventorySlots).autoStart; } boolean isSimulation() { - return ((ContainerCraftConfirm) inventorySlots).simulation; + return ((ContainerCraftConfirm) this.inventorySlots).simulation; } public GuiCraftConfirm(InventoryPlayer inventoryPlayer, ITerminalHost te) { super( new ContainerCraftConfirm( inventoryPlayer, te ) ); - xSize = 238; - ySize = 206; - myScrollBar = new GuiScrollbar(); + this.xSize = 238; + this.ySize = 206; + this.myScrollBar = new GuiScrollbar(); - ccc = (ContainerCraftConfirm) this.inventorySlots; + this.ccc = (ContainerCraftConfirm) this.inventorySlots; if ( te instanceof WirelessTerminalGuiObject ) - OriginalGui = GuiBridge.GUI_WIRELESS_TERM; + this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM; if ( te instanceof PartTerminal ) - OriginalGui = GuiBridge.GUI_ME; + this.OriginalGui = GuiBridge.GUI_ME; if ( te instanceof PartCraftingTerminal ) - OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; + this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; if ( te instanceof PartPatternTerminal ) - OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; + this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; } @@ -110,39 +110,39 @@ public class GuiCraftConfirm extends AEBaseGui { super.initGui(); - start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + ySize - 25, 50, 20, GuiText.Start.getLocal() ); - start.enabled = false; - buttonList.add( start ); + this.start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal() ); + this.start.enabled = false; + this.buttonList.add( this.start ); - selectCPU = new GuiButton( 0, this.guiLeft + (219 - 180) / 2, this.guiTop + ySize - 68, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + this.selectCPU = new GuiButton( 0, this.guiLeft + (219 - 180) / 2, this.guiTop + this.ySize - 68, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic ); - selectCPU.enabled = false; - buttonList.add( selectCPU ); + this.selectCPU.enabled = false; + this.buttonList.add( this.selectCPU ); - if ( OriginalGui != null ) - cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); + if ( this.OriginalGui != null ) + this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); - buttonList.add( cancel ); + this.buttonList.add( this.cancel ); } private void updateCPUButtonText() { String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal(); - if ( ccc.selectedCpu >= 0 )// && ccc.selectedCpu < ccc.cpus.size() ) + if ( this.ccc.selectedCpu >= 0 )// && ccc.selectedCpu < ccc.cpus.size() ) { - if ( ccc.myName.length() > 0 ) + if ( this.ccc.myName.length() > 0 ) { - String name = ccc.myName.substring( 0, Math.min( 20, ccc.myName.length() ) ); + String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name; } else - btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + ccc.selectedCpu; + btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu; } - if ( ccc.noCPU ) + if ( this.ccc.noCPU ) btnTextText = GuiText.NoCraftingCPUs.getLocal(); - selectCPU.displayString = btnTextText; + this.selectCPU.displayString = btnTextText; } @Override @@ -152,7 +152,7 @@ public class GuiCraftConfirm extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == selectCPU ) + if ( btn == this.selectCPU ) { try { @@ -164,12 +164,12 @@ public class GuiCraftConfirm extends AEBaseGui } } - if ( btn == cancel ) + if ( btn == this.cancel ) { - NetworkHandler.instance.sendToServer( new PacketSwitchGuis( OriginalGui ) ); + NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } - if ( btn == start ) + if ( btn == this.start ) { try { @@ -185,9 +185,9 @@ public class GuiCraftConfirm extends AEBaseGui private long getTotal(IAEItemStack is) { - IAEItemStack a = storage.findPrecise( is ); - IAEItemStack c = pending.findPrecise( is ); - IAEItemStack m = missing.findPrecise( is ); + IAEItemStack a = this.storage.findPrecise( is ); + IAEItemStack c = this.pending.findPrecise( is ); + IAEItemStack m = this.missing.findPrecise( is ); long total = 0; @@ -209,34 +209,34 @@ public class GuiCraftConfirm extends AEBaseGui { case 0: for (IAEItemStack l : list) - handleInput( storage, l ); + this.handleInput( this.storage, l ); break; case 1: for (IAEItemStack l : list) - handleInput( pending, l ); + this.handleInput( this.pending, l ); break; case 2: for (IAEItemStack l : list) - handleInput( missing, l ); + this.handleInput( this.missing, l ); break; } for (IAEItemStack l : list) { - long amt = getTotal( l ); + long amt = this.getTotal( l ); if ( amt <= 0 ) - deleteVisualStack( l ); + this.deleteVisualStack( l ); else { - IAEItemStack is = findVisualStack( l ); + IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } - setScrollBar(); + this.setScrollBar(); } private void handleInput(IItemList s, IAEItemStack l) @@ -263,7 +263,7 @@ public class GuiCraftConfirm extends AEBaseGui private IAEItemStack findVisualStack(IAEItemStack l) { - for (IAEItemStack o : visual) + for (IAEItemStack o : this.visual) { if ( o.equals( l ) ) { @@ -272,13 +272,13 @@ public class GuiCraftConfirm extends AEBaseGui } IAEItemStack stack = l.copy(); - visual.add( stack ); + this.visual.add( stack ); return stack; } private void deleteVisualStack(IAEItemStack l) { - Iterator i = visual.iterator(); + Iterator i = this.visual.iterator(); while (i.hasNext()) { IAEItemStack o = i.next(); @@ -292,10 +292,10 @@ public class GuiCraftConfirm extends AEBaseGui private void setScrollBar() { - int size = visual.size(); + int size = this.visual.size(); - myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 ); - myScrollBar.setRange( 0, (size + 2) / 3 - rows, 1 ); + this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 ); + this.myScrollBar.setRange( 0, (size + 2) / 3 - this.rows, 1 ); } @Override @@ -305,7 +305,7 @@ public class GuiCraftConfirm extends AEBaseGui { if ( key == 28 ) { - actionPerformed( start ); + this.actionPerformed( this.start ); } super.keyTyped( character, key ); } @@ -314,9 +314,9 @@ public class GuiCraftConfirm extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - setScrollBar(); - bindTexture( "guis/craftingreport.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.setScrollBar(); + this.bindTexture( "guis/craftingreport.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } int tooltip = -1; @@ -324,19 +324,19 @@ public class GuiCraftConfirm extends AEBaseGui @Override public void drawScreen(int mouse_x, int mouse_y, float btn) { - updateCPUButtonText(); + this.updateCPUButtonText(); - start.enabled = !(ccc.noCPU || isSimulation()); - selectCPU.enabled = !isSimulation(); + this.start.enabled = !(this.ccc.noCPU || this.isSimulation()); + this.selectCPU.enabled = !this.isSimulation(); int x = 0; int y = 0; - int gx = (width - xSize) / 2; - int gy = (height - ySize) / 2; + int gx = (this.width - this.xSize) / 2; + int gy = (this.height - this.ySize) / 2; int offY = 23; - tooltip = -1; + this.tooltip = -1; for (int z = 0; z <= 4 * 5; z++) { @@ -347,7 +347,7 @@ public class GuiCraftConfirm extends AEBaseGui { if ( minY < mouse_y && minY + offY - 2 > mouse_y ) { - tooltip = z; + this.tooltip = z; break; } @@ -368,21 +368,21 @@ public class GuiCraftConfirm extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - long BytesUsed = ccc.bytesUsed; + long BytesUsed = this.ccc.bytesUsed; String byteUsed = NumberFormat.getInstance().format( BytesUsed ); String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal()) : GuiText.CalculatingWait.getLocal(); - fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 ); + this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 ); String dsp = null; - if ( isSimulation() ) + if ( this.isSimulation() ) dsp = GuiText.Simulation.getLocal(); else - dsp = ccc.cpuBytesAvail > 0 ? (GuiText.Bytes.getLocal() + ": " + ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + ccc.cpuCoProcessors) + 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 - fontRendererObj.getStringWidth( dsp )) / 2; - fontRendererObj.drawString( dsp, offset, 165, 4210752 ); + int offset = (219 - this.fontRendererObj.getStringWidth( dsp )) / 2; + this.fontRendererObj.drawString( dsp, offset, 165, 4210752 ); int sectionLength = 67; @@ -390,8 +390,8 @@ public class GuiCraftConfirm extends AEBaseGui int y = 0; int xo = 9; int yo = 22; - int viewStart = myScrollBar.getCurrentScroll() * 3; - int viewEnd = viewStart + 3 * rows; + int viewStart = this.myScrollBar.getCurrentScroll() * 3; + int viewEnd = viewStart + 3 * this.rows; String dspToolTip = ""; List lineList = new LinkedList(); @@ -400,17 +400,17 @@ public class GuiCraftConfirm extends AEBaseGui int offY = 23; - for (int z = viewStart; z < Math.min( viewEnd, visual.size() ); z++) + for (int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++) { - IAEItemStack refStack = visual.get( z );// repo.getReferenceItem( z ); + IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if ( refStack != null ) { GL11.glPushMatrix(); GL11.glScaled( 0.5, 0.5, 0.5 ); - IAEItemStack stored = storage.findPrecise( refStack ); - IAEItemStack pendingStack = pending.findPrecise( refStack ); - IAEItemStack missingStack = missing.findPrecise( refStack ); + IAEItemStack stored = this.storage.findPrecise( refStack ); + IAEItemStack pendingStack = this.pending.findPrecise( refStack ); + IAEItemStack missingStack = this.missing.findPrecise( refStack ); int lines = 0; @@ -434,11 +434,11 @@ public class GuiCraftConfirm extends AEBaseGui str = Long.toString( stored.getStackSize() / 1000000 ) + 'm'; str = GuiText.FromStorage.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); downY += 5; @@ -453,11 +453,11 @@ public class GuiCraftConfirm extends AEBaseGui str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm'; str = GuiText.Missing.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) ); red = true; @@ -473,11 +473,11 @@ public class GuiCraftConfirm extends AEBaseGui str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm'; str = GuiText.ToCraft.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); } @@ -488,7 +488,7 @@ public class GuiCraftConfirm extends AEBaseGui ItemStack is = refStack.copy().getItemStack(); - if ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) { dspToolTip = Platform.getItemDisplayName( is ); @@ -499,7 +499,7 @@ public class GuiCraftConfirm extends AEBaseGui toolPosY = y * offY + yo; } - drawItem( posX, posY, is ); + this.drawItem( posX, posY, is ); if ( red ) { @@ -519,10 +519,10 @@ public class GuiCraftConfirm extends AEBaseGui } - if ( tooltip >= 0 && dspToolTip.length() > 0 ) + if ( this.tooltip >= 0 && dspToolTip.length() > 0 ) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); + this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); GL11.glPopAttrib(); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java index feb1e756c..5b1e258d2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java @@ -62,17 +62,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource public void clearItems() { - storage = AEApi.instance().storage().createItemList(); - active = AEApi.instance().storage().createItemList(); - pending = AEApi.instance().storage().createItemList(); - visual = new ArrayList(); + this.storage = AEApi.instance().storage().createItemList(); + this.active = AEApi.instance().storage().createItemList(); + this.pending = AEApi.instance().storage().createItemList(); + this.visual = new ArrayList(); } protected GuiCraftingCPU(ContainerCraftingCPU container) { super( container ); this.ySize = 184; this.xSize = 238; - myScrollBar = new GuiScrollbar(); + this.myScrollBar = new GuiScrollbar(); } public GuiCraftingCPU(InventoryPlayer inventoryPlayer, Object te) { @@ -86,7 +86,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource { super.actionPerformed( btn ); - if ( cancel == btn ) + if ( this.cancel == btn ) { try { @@ -103,16 +103,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource public void initGui() { super.initGui(); - setScrollBar(); - cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); - buttonList.add( cancel ); + this.setScrollBar(); + this.cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); + this.buttonList.add( this.cancel ); } private long getTotal(IAEItemStack is) { - IAEItemStack a = storage.findPrecise( is ); - IAEItemStack b = active.findPrecise( is ); - IAEItemStack c = pending.findPrecise( is ); + IAEItemStack a = this.storage.findPrecise( is ); + IAEItemStack b = this.active.findPrecise( is ); + IAEItemStack c = this.pending.findPrecise( is ); long total = 0; @@ -134,34 +134,34 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource { case 0: for (IAEItemStack l : list) - handleInput( storage, l ); + this.handleInput( this.storage, l ); break; case 1: for (IAEItemStack l : list) - handleInput( active, l ); + this.handleInput( this.active, l ); break; case 2: for (IAEItemStack l : list) - handleInput( pending, l ); + this.handleInput( this.pending, l ); break; } for (IAEItemStack l : list) { - long amt = getTotal( l ); + long amt = this.getTotal( l ); if ( amt <= 0 ) - deleteVisualStack( l ); + this.deleteVisualStack( l ); else { - IAEItemStack is = findVisualStack( l ); + IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } - setScrollBar(); + this.setScrollBar(); } private void handleInput(IItemList s, IAEItemStack l) @@ -188,7 +188,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private IAEItemStack findVisualStack(IAEItemStack l) { - for (IAEItemStack o : visual) + for (IAEItemStack o : this.visual) { if ( o.equals( l ) ) { @@ -197,13 +197,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } IAEItemStack stack = l.copy(); - visual.add( stack ); + this.visual.add( stack ); return stack; } private void deleteVisualStack(IAEItemStack l) { - Iterator i = visual.iterator(); + Iterator i = this.visual.iterator(); while (i.hasNext()) { IAEItemStack o = i.next(); @@ -217,17 +217,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private void setScrollBar() { - int size = visual.size(); + int size = this.visual.size(); - myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 ); - myScrollBar.setRange( 0, (size + 2) / 3 - rows, 1 ); + this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 ); + this.myScrollBar.setRange( 0, (size + 2) / 3 - this.rows, 1 ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/craftingcpu.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/craftingcpu.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } int tooltip = -1; @@ -235,16 +235,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource @Override public void drawScreen(int mouse_x, int mouse_y, float btn) { - cancel.enabled = !visual.isEmpty(); + this.cancel.enabled = !this.visual.isEmpty(); int x = 0; int y = 0; - int gx = (width - xSize) / 2; - int gy = (height - ySize) / 2; + int gx = (this.width - this.xSize) / 2; + int gy = (this.height - this.ySize) / 2; int offY = 23; - tooltip = -1; + this.tooltip = -1; for (int z = 0; z <= 4 * 5; z++) { @@ -255,7 +255,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource { if ( minY < mouse_y && minY + offY - 2 > mouse_y ) { - tooltip = z; + this.tooltip = z; break; } @@ -276,7 +276,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, 4210752 ); int sectionLength = 67; @@ -284,7 +284,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int y = 0; int xo = 9; int yo = 22; - int viewStart = myScrollBar.getCurrentScroll() * 3; + int viewStart = this.myScrollBar.getCurrentScroll() * 3; int viewEnd = viewStart + 3 * 6; String dspToolTip = ""; @@ -294,17 +294,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int offY = 23; - for (int z = viewStart; z < Math.min( viewEnd, visual.size() ); z++) + for (int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++) { - IAEItemStack refStack = visual.get( z );// repo.getReferenceItem( z ); + IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if ( refStack != null ) { GL11.glPushMatrix(); GL11.glScaled( 0.5, 0.5, 0.5 ); - IAEItemStack stored = storage.findPrecise( refStack ); - IAEItemStack activeStack = active.findPrecise( refStack ); - IAEItemStack pendingStack = pending.findPrecise( refStack ); + IAEItemStack stored = this.storage.findPrecise( refStack ); + IAEItemStack activeStack = this.active.findPrecise( refStack ); + IAEItemStack pendingStack = this.pending.findPrecise( refStack ); int lines = 0; @@ -327,11 +327,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = Long.toString( stored.getStackSize() / 1000000 ) + 'm'; str = GuiText.Stored.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); downY += 5; @@ -346,11 +346,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm'; str = GuiText.Crafting.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) ); downY += 5; @@ -365,11 +365,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm'; str = GuiText.Scheduled.getLocal() + ": " + str; - int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + 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 ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); } @@ -380,7 +380,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource ItemStack is = refStack.copy().getItemStack(); - if ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) { dspToolTip = Platform.getItemDisplayName( is ); @@ -391,7 +391,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource toolPosY = y * offY + yo; } - drawItem( posX, posY, is ); + this.drawItem( posX, posY, is ); x++; @@ -404,10 +404,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } - if ( tooltip >= 0 && dspToolTip.length() > 0 ) + if ( this.tooltip >= 0 && dspToolTip.length() > 0 ) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); + this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); GL11.glPopAttrib(); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java index 556afbfae..53a431342 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java @@ -57,31 +57,31 @@ public class GuiCraftingStatus extends GuiCraftingCPU public GuiCraftingStatus(InventoryPlayer inventoryPlayer, ITerminalHost te) { super( new ContainerCraftingStatus( inventoryPlayer, te ) ); - ccc = (ContainerCraftingStatus) inventorySlots; - Object target = ccc.getTarget(); + this.ccc = (ContainerCraftingStatus) this.inventorySlots; + Object target = this.ccc.getTarget(); if ( target instanceof WirelessTerminalGuiObject ) { - myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_WIRELESS_TERM; + this.myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 ); + this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM; } if ( target instanceof PartTerminal ) { - myIcon = AEApi.instance().parts().partTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_ME; + this.myIcon = AEApi.instance().parts().partTerminal.stack( 1 ); + this.OriginalGui = GuiBridge.GUI_ME; } if ( target instanceof PartCraftingTerminal ) { - myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; + this.myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 ); + this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; } if ( target instanceof PartPatternTerminal ) { - myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 ); - OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; + this.myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 ); + this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; } } @@ -92,7 +92,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == selectCPU ) + if ( btn == this.selectCPU ) { try { @@ -104,9 +104,9 @@ public class GuiCraftingStatus extends GuiCraftingCPU } } - if ( btn == originalGuiBtn ) + if ( btn == this.originalGuiBtn ) { - NetworkHandler.instance.sendToServer( new PacketSwitchGuis( OriginalGui ) ); + NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } } @@ -121,14 +121,14 @@ public class GuiCraftingStatus extends GuiCraftingCPU { super.initGui(); - selectCPU = new GuiButton( 0, this.guiLeft + 8, this.guiTop + ySize - 25, 150, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs ); + this.selectCPU = new GuiButton( 0, this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs ); // selectCPU.enabled = false; - buttonList.add( selectCPU ); + this.buttonList.add( this.selectCPU ); - if ( myIcon != null ) + if ( this.myIcon != null ) { - buttonList.add( originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, myIcon, myIcon.getDisplayName(), itemRender ) ); - originalGuiBtn.hideEdge = 13; + this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), itemRender ) ); + this.originalGuiBtn.hideEdge = 13; } } @@ -136,27 +136,27 @@ public class GuiCraftingStatus extends GuiCraftingCPU { String btnTextText = GuiText.NoCraftingJobs.getLocal(); - if ( ccc.selectedCpu >= 0 )// && ccc.selectedCpu < ccc.cpus.size() ) + if ( this.ccc.selectedCpu >= 0 )// && ccc.selectedCpu < ccc.cpus.size() ) { - if ( ccc.myName.length() > 0 ) + if ( this.ccc.myName.length() > 0 ) { - String name = ccc.myName.substring( 0, Math.min( 20, ccc.myName.length() ) ); + String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); btnTextText = GuiText.CPUs.getLocal() + ": " + name; } else - btnTextText = GuiText.CPUs.getLocal() + ": #" + ccc.selectedCpu; + btnTextText = GuiText.CPUs.getLocal() + ": #" + this.ccc.selectedCpu; } - if ( ccc.noCPU ) + if ( this.ccc.noCPU ) btnTextText = GuiText.NoCraftingJobs.getLocal(); - selectCPU.displayString = btnTextText; + this.selectCPU.displayString = btnTextText; } @Override public void drawScreen(int mouse_x, int mouse_y, float btn) { - updateCPUButtonText(); + this.updateCPUButtonText(); super.drawScreen( mouse_x, mouse_y, btn ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java index 7b1e95040..4cd6f24fa 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java @@ -42,8 +42,8 @@ public class GuiCraftingTerm extends GuiMEMonitorable public void initGui() { super.initGui(); - buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) ); - clearBtn.halfSize = true; + this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) ); + this.clearBtn.halfSize = true; } @Override @@ -51,10 +51,10 @@ public class GuiCraftingTerm extends GuiMEMonitorable { super.actionPerformed( btn ); - if ( clearBtn == btn ) + if ( this.clearBtn == btn ) { Slot s = null; - Container c = inventorySlots; + Container c = this.inventorySlots; for (Object j : c.inventorySlots) { if ( j instanceof SlotCraftingMatrix ) @@ -72,7 +72,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable public GuiCraftingTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) { super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) ); - reservedSpace = 73; + this.reservedSpace = 73; } @Override @@ -85,7 +85,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); - fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, ySize - 96 + 1 - reservedSpace, 4210752 ); + this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiDrive.java b/src/main/java/appeng/client/gui/implementations/GuiDrive.java index 8e586ccfa..d5153c87b 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiDrive.java +++ b/src/main/java/appeng/client/gui/implementations/GuiDrive.java @@ -39,7 +39,7 @@ public class GuiDrive extends AEBaseGui { super.actionPerformed( par1GuiButton ); - if ( par1GuiButton == priority ) + if ( par1GuiButton == this.priority ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); } @@ -50,7 +50,7 @@ public class GuiDrive extends AEBaseGui { super.initGui(); - buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); + this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); } public GuiDrive(InventoryPlayer inventoryPlayer, TileDrive te) { @@ -61,15 +61,15 @@ public class GuiDrive extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/drive.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/drive.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index 15edf1b91..8f971cf28 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -44,21 +44,21 @@ public class GuiFormationPlane extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - if ( fuzzyMode != null ) - fuzzyMode.set( cvb.fzMode ); + if ( this.fuzzyMode != null ) + this.fuzzyMode.set( this.cvb.fzMode ); } @Override protected void addButtons() { - fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); + this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); - buttonList.add( fuzzyMode ); + this.buttonList.add( this.fuzzyMode ); } @Override @@ -66,7 +66,7 @@ public class GuiFormationPlane extends GuiUpgradeable { super.actionPerformed( btn ); - if ( btn == priority ) + if ( btn == this.priority ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java index 0167ef23d..513a8bbce 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java +++ b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java @@ -35,15 +35,15 @@ public class GuiGrinder extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/grinder.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/grinder.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java index 4503094dc..f6d27fe45 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java @@ -57,29 +57,29 @@ public class GuiIOPort extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - if ( redstoneMode != null ) - redstoneMode.set( cvb.rsMode ); + if ( this.redstoneMode != null ) + this.redstoneMode.set( this.cvb.rsMode ); - if ( operationMode != null ) - operationMode.set( ((ContainerIOPort) cvb).opMode ); + if ( this.operationMode != null ) + this.operationMode.set( ((ContainerIOPort) this.cvb).opMode ); - if ( fullMode != null ) - fullMode.set( ((ContainerIOPort) cvb).fMode ); + if ( this.fullMode != null ) + this.fullMode.set( ((ContainerIOPort) this.cvb).fMode ); } @Override protected void addButtons() { - redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - fullMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY ); - operationMode = new GuiImgButton( this.guiLeft + 80, guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY ); + this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.fullMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY ); + this.operationMode = new GuiImgButton( this.guiLeft + 80, this.guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY ); - buttonList.add( operationMode ); - buttonList.add( redstoneMode ); - buttonList.add( fullMode ); + this.buttonList.add( this.operationMode ); + this.buttonList.add( this.redstoneMode ); + this.buttonList.add( this.fullMode ); } @Override @@ -89,11 +89,11 @@ public class GuiIOPort extends GuiUpgradeable boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == fullMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( fullMode.getSetting(), backwards ) ); + if ( btn == this.fullMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) ); - if ( btn == operationMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( operationMode.getSetting(), backwards ) ); + if ( btn == this.operationMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) ); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java index 9f2cf6550..bebb60b32 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java @@ -36,9 +36,9 @@ public class GuiInscriber extends AEBaseGui public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te) { super( new ContainerInscriber( inventoryPlayer, te ) ); - cvc = (ContainerInscriber) inventorySlots; + this.cvc = (ContainerInscriber) this.inventorySlots; this.ySize = 176; - this.xSize = hasToolbox() ? 246 : 211; + this.xSize = this.hasToolbox() ? 246 : 211; } @Override @@ -46,32 +46,32 @@ public class GuiInscriber extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL ); - this.buttonList.add( pb ); + this.pb = new GuiProgressBar( this.cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL ); + this.buttonList.add( this.pb ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/inscriber.png" ); - pb.xPosition = 135 + guiLeft; - pb.yPosition = 39 + guiTop; + this.bindTexture( "guis/inscriber.png" ); + this.pb.xPosition = 135 + this.guiLeft; + this.pb.yPosition = 39 + this.guiTop; - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize ); - if ( drawUpgrades() ) - this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + cvc.availableUpgrades() * 18 ); - if ( hasToolbox() ) - this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, ySize - 90, 68, 68 ); + if ( this.drawUpgrades() ) + this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18 ); + if ( this.hasToolbox() ) + this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - pb.setFullMsg( cvc.getCurrentProgress() * 100 / cvc.getMaxProgress() + "%" ); + this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" ); - fontRendererObj.drawString( getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } protected boolean drawUpgrades() @@ -81,7 +81,7 @@ public class GuiInscriber extends AEBaseGui protected boolean hasToolbox() { - return ((ContainerUpgradeable) inventorySlots).hasToolbox(); + return ((ContainerUpgradeable) this.inventorySlots).hasToolbox(); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterface.java b/src/main/java/appeng/client/gui/implementations/GuiInterface.java index 3a2f8b2e0..a2a2584ff 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterface.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterface.java @@ -55,30 +55,30 @@ public class GuiInterface extends GuiUpgradeable boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == priority ) + if ( btn == this.priority ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); } - if ( btn == interfaceMode ) + if ( btn == this.interfaceMode ) NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) ); - if ( btn == BlockMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( BlockMode.getSetting(), backwards ) ); + if ( btn == this.BlockMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) ); } @Override protected void addButtons() { - priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ); - buttonList.add( priority ); + this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ); + this.buttonList.add( this.priority ); - BlockMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.BLOCK, YesNo.NO ); - buttonList.add( BlockMode ); + this.BlockMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO ); + this.buttonList.add( this.BlockMode ); - interfaceMode = new GuiToggleButton( this.guiLeft - 18, guiTop + 26, 84, 85, GuiText.InterfaceTerminal.getLocal(), + this.interfaceMode = new GuiToggleButton( this.guiLeft - 18, this.guiTop + 26, 84, 85, GuiText.InterfaceTerminal.getLocal(), GuiText.InterfaceTerminalHint.getLocal() ); - buttonList.add( interfaceMode ); + this.buttonList.add( this.interfaceMode ); } @Override @@ -90,18 +90,18 @@ public class GuiInterface extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - if ( BlockMode != null ) - BlockMode.set( ((ContainerInterface) cvb).bMode ); + if ( this.BlockMode != null ) + this.BlockMode.set( ((ContainerInterface) this.cvb).bMode ); - if ( interfaceMode != null ) - interfaceMode.setState( ((ContainerInterface) cvb).iTermMode == YesNo.YES ); + if ( this.interfaceMode != null ) + this.interfaceMode.setState( ((ContainerInterface) this.cvb).iTermMode == YesNo.YES ); - fontRendererObj.drawString( getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 ); - fontRendererObj.drawString( GuiText.StoredItems.getLocal(), 18, 6 + 60 + 7, 4210752 ); - fontRendererObj.drawString( GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752 ); + this.fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 ); + this.fontRendererObj.drawString( GuiText.StoredItems.getLocal(), 18, 6 + 60 + 7, 4210752 ); + this.fontRendererObj.drawString( GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java index ce43f3731..d10127cb8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java @@ -79,24 +79,24 @@ public class GuiInterfaceTerminal extends AEBaseGui { super.initGui(); - myScrollBar.setLeft( 175 ); - myScrollBar.setHeight( 106 ); - myScrollBar.setTop( 18 ); + this.myScrollBar.setLeft( 175 ); + this.myScrollBar.setHeight( 106 ); + this.myScrollBar.setTop( 18 ); - searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 104, offsetX ), this.guiTop + 4, 65, 12 ); - searchField.setEnableBackgroundDrawing( false ); - searchField.setMaxStringLength( 25 ); - searchField.setTextColor( 0xFFFFFF ); - searchField.setVisible( true ); - searchField.setFocused( true ); + this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 ); + this.searchField.setEnableBackgroundDrawing( false ); + this.searchField.setMaxStringLength( 25 ); + this.searchField.setTextColor( 0xFFFFFF ); + this.searchField.setVisible( true ); + this.searchField.setFocused( true ); } @Override protected void mouseClicked(int xCoord, int yCoord, int btn) { - searchField.mouseClicked( xCoord, yCoord, btn ); + this.searchField.mouseClicked( xCoord, yCoord, btn ); - if ( btn == 1 && searchField.isMouseIn( xCoord, yCoord ) ) + if ( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) ) { this.searchField.setText( "" ); this.refreshList(); @@ -113,9 +113,9 @@ public class GuiInterfaceTerminal extends AEBaseGui if ( character == ' ' && this.searchField.getText().length() == 0 ) return; - if ( searchField.textboxKeyTyped( character, key ) ) + if ( this.searchField.textboxKeyTyped( character, key ) ) { - refreshList(); + this.refreshList(); } else { @@ -127,15 +127,15 @@ public class GuiInterfaceTerminal extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/interfaceterminal.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/interfaceterminal.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); int offset = 17; - int ex = myScrollBar.getCurrentScroll(); + int ex = this.myScrollBar.getCurrentScroll(); - for (int x = 0; x < LINES_ON_PAGE && ex + x < lines.size(); x++) + for (int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++) { - Object lineObj = lines.get( ex + x ); + Object lineObj = this.lines.get( ex + x ); if ( lineObj instanceof ClientDCInternalInv ) { ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; @@ -147,48 +147,48 @@ public class GuiInterfaceTerminal extends AEBaseGui offset += 18; } - if ( searchField != null ) - searchField.drawTextBox(); + if ( this.searchField != null ) + this.searchField.drawTextBox(); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); int offset = 17; - int ex = myScrollBar.getCurrentScroll(); + int ex = this.myScrollBar.getCurrentScroll(); - Iterator o = inventorySlots.inventorySlots.iterator(); + Iterator o = this.inventorySlots.inventorySlots.iterator(); while (o.hasNext()) { if ( o.next() instanceof SlotDisconnected ) o.remove(); } - for (int x = 0; x < LINES_ON_PAGE && ex + x < lines.size(); x++) + for (int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++) { - Object lineObj = lines.get( ex + x ); + Object lineObj = this.lines.get( ex + x ); if ( lineObj instanceof ClientDCInternalInv ) { ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; for (int z = 0; z < inv.inv.getSizeInventory(); z++) { - inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) ); + this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) ); } } else if ( lineObj instanceof String ) { String name = (String) lineObj; - int rows = byName.get( name ).size(); + int rows = this.byName.get( name ).size(); if ( rows > 1 ) name = name + " (" + rows + ')'; - while (name.length() > 2 && fontRendererObj.getStringWidth( name ) > 155) + while (name.length() > 2 && this.fontRendererObj.getStringWidth( name ) > 155) name = name.substring( 0, name.length() - 1 ); - fontRendererObj.drawString( name, 10, 6 + offset, 4210752 ); + this.fontRendererObj.drawString( name, 10, 6 + offset, 4210752 ); } offset += 18; } @@ -198,8 +198,8 @@ public class GuiInterfaceTerminal extends AEBaseGui { if ( in.getBoolean( "clear" ) ) { - byId.clear(); - refreshList = true; + this.byId.clear(); + this.refreshList = true; } for (Object oKey : in.func_150296_c()) @@ -211,7 +211,7 @@ public class GuiInterfaceTerminal extends AEBaseGui { long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); NBTTagCompound invData = in.getCompoundTag( key ); - ClientDCInternalInv current = getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); + ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); for (int x = 0; x < current.inv.getSizeInventory(); x++) { @@ -226,12 +226,12 @@ public class GuiInterfaceTerminal extends AEBaseGui } } - if ( refreshList ) + if ( this.refreshList ) { - refreshList = false; + this.refreshList = false; // invalid caches on refresh - cachedSearches.clear(); - refreshList(); + this.cachedSearches.clear(); + this.refreshList(); } } @@ -242,14 +242,14 @@ public class GuiInterfaceTerminal extends AEBaseGui */ private void refreshList() { - byName.clear(); + this.byName.clear(); - final String searchFilterLowerCase = searchField.getText().toLowerCase(); + final String searchFilterLowerCase = this.searchField.getText().toLowerCase(); final Set cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase ); final boolean rebuild = cachedSearch.isEmpty(); - for (ClientDCInternalInv entry : byId.values()) + for (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 ) ) @@ -265,7 +265,7 @@ public class GuiInterfaceTerminal extends AEBaseGui { for (ItemStack itemStack : entry.inv) { - found = itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase ); + found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase ); if ( found ) { break; @@ -276,7 +276,7 @@ public class GuiInterfaceTerminal extends AEBaseGui // if found, filter skipped or machine name matching the search term, add it if ( found || entry.getName().toLowerCase().contains( searchFilterLowerCase ) ) { - byName.put( entry.getName(), entry ); + this.byName.put( entry.getName(), entry ); cachedSearch.add( entry ); } else @@ -285,26 +285,26 @@ public class GuiInterfaceTerminal extends AEBaseGui } } - names.clear(); - names.addAll( byName.keySet() ); + this.names.clear(); + this.names.addAll( this.byName.keySet() ); - Collections.sort( names ); + Collections.sort( this.names ); - lines.clear(); - lines.ensureCapacity( getMaxRows() ); + this.lines.clear(); + this.lines.ensureCapacity( this.getMaxRows() ); - for (String n : names) + for (String n : this.names) { - lines.add( n ); + this.lines.add( n ); ArrayList clientInventories = new ArrayList(); - clientInventories.addAll( byName.get( n ) ); + clientInventories.addAll( this.byName.get( n ) ); Collections.sort( clientInventories ); - lines.addAll( clientInventories ); + this.lines.addAll( clientInventories ); } - myScrollBar.setRange( 0, lines.size() - LINES_ON_PAGE, 2 ); + this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 ); } private boolean itemStackMatchesSearchTerm(ItemStack itemStack, String searchTerm) @@ -354,16 +354,16 @@ public class GuiInterfaceTerminal extends AEBaseGui */ private Set getCacheForSearchTerm(String searchTerm) { - if ( !cachedSearches.containsKey( searchTerm ) ) + if ( !this.cachedSearches.containsKey( searchTerm ) ) { - cachedSearches.put( searchTerm, new HashSet() ); + this.cachedSearches.put( searchTerm, new HashSet() ); } - Set cache = cachedSearches.get( searchTerm ); + Set cache = this.cachedSearches.get( searchTerm ); if ( cache.isEmpty() && searchTerm.length() > 1 ) { - cache.addAll( getCacheForSearchTerm( searchTerm.substring( 0, searchTerm.length() - 1 ) ) ); + cache.addAll( this.getCacheForSearchTerm( searchTerm.substring( 0, searchTerm.length() - 1 ) ) ); return cache; } @@ -377,17 +377,17 @@ public class GuiInterfaceTerminal extends AEBaseGui */ private int getMaxRows() { - return names.size() + byId.size(); + return this.names.size() + this.byId.size(); } private ClientDCInternalInv getById(long id, long sortBy, String string) { - ClientDCInternalInv o = byId.get( id ); + ClientDCInternalInv o = this.byId.get( id ); if ( o == null ) { - byId.put( id, o = new ClientDCInternalInv( 9, id, sortBy, string ) ); - refreshList = true; + this.byId.put( id, o = new ClientDCInternalInv( 9, id, sortBy, string ) ); + this.refreshList = true; } return o; diff --git a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java index b31a5cd91..5c464f7f2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java @@ -62,42 +62,42 @@ public class GuiLevelEmitter extends GuiUpgradeable { super.initGui(); - level = new GuiNumberBox( fontRendererObj, this.guiLeft + 24, this.guiTop + 43, 79, fontRendererObj.FONT_HEIGHT, Long.class ); - level.setEnableBackgroundDrawing( false ); - level.setMaxStringLength( 16 ); - level.setTextColor( 0xFFFFFF ); - level.setVisible( true ); - level.setFocused( true ); - ((ContainerLevelEmitter) inventorySlots).setTextField( level ); + this.level = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 24, this.guiTop + 43, 79, this.fontRendererObj.FONT_HEIGHT, Long.class ); + this.level.setEnableBackgroundDrawing( false ); + this.level.setMaxStringLength( 16 ); + this.level.setTextColor( 0xFFFFFF ); + this.level.setVisible( true ); + this.level.setFocused( true ); + ((ContainerLevelEmitter) this.inventorySlots).setTextField( this.level ); } @Override protected void addButtons() { - levelMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL ); - redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL ); - fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - craftingMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); + this.levelMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL ); + this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL ); + 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 ); - buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) ); - buttonList.add( plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) ); - buttonList.add( plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c ) ); - buttonList.add( plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d ) ); + 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 ) ); + this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c ) ); + this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d ) ); - buttonList.add( minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a ) ); - buttonList.add( minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b ) ); - buttonList.add( minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c ) ); - buttonList.add( minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) ); + this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a ) ); + this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b ) ); + this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c ) ); + this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) ); - buttonList.add( levelMode ); - buttonList.add( redstoneMode ); - buttonList.add( fuzzyMode ); - buttonList.add( craftingMode ); + this.buttonList.add( this.levelMode ); + this.buttonList.add( this.redstoneMode ); + this.buttonList.add( this.fuzzyMode ); + this.buttonList.add( this.craftingMode ); } @Override @@ -107,24 +107,24 @@ public class GuiLevelEmitter extends GuiUpgradeable boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == craftingMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( craftingMode.getSetting(), backwards ) ); + if ( btn == this.craftingMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) ); - if ( btn == levelMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( levelMode.getSetting(), backwards ) ); + if ( btn == this.levelMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) ); - boolean isPlus = btn == plus1 || btn == plus10 || btn == plus100 || btn == plus1000; - boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; + 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; if ( isPlus || isMinus ) - addQty( getQty( btn ) ); + this.addQty( this.getQty( btn ) ); } private void addQty(long i) { try { - String Out = level.getText(); + String Out = this.level.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -134,7 +134,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } if ( Fixed ) - level.setText( Out ); + this.level.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -144,14 +144,14 @@ public class GuiLevelEmitter extends GuiUpgradeable if ( result < 0 ) result = 0; - level.setText( Out = Long.toString( result ) ); + this.level.setText( Out = Long.toString( result ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) ); } catch (NumberFormatException e) { // nope.. - level.setText( "0" ); + this.level.setText( "0" ); } catch (IOException e) { @@ -162,8 +162,8 @@ public class GuiLevelEmitter extends GuiUpgradeable @Override protected void handleButtonVisibility() { - craftingMode.setVisibility( bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); - fuzzyMode.setVisibility( bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); + this.craftingMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); + this.fuzzyMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); } @Override @@ -171,11 +171,11 @@ public class GuiLevelEmitter extends GuiUpgradeable { if ( !this.checkHotbarKeys( key ) ) { - if ( (key == 211 || key == 205 || key == 203 || key == 14 || Character.isDigit( character )) && level.textboxKeyTyped( character, key ) ) + if ( (key == 211 || key == 205 || key == 203 || key == 14 || Character.isDigit( character )) && this.level.textboxKeyTyped( character, key ) ) { try { - String Out = level.getText(); + String Out = this.level.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -185,7 +185,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } if ( Fixed ) - level.setText( Out ); + this.level.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -207,35 +207,35 @@ public class GuiLevelEmitter extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - boolean notCraftingMode = bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; + boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; // configure enabled status... - level.setEnabled( notCraftingMode ); - plus1.enabled = notCraftingMode; - plus10.enabled = notCraftingMode; - plus100.enabled = notCraftingMode; - plus1000.enabled = notCraftingMode; - minus1.enabled = notCraftingMode; - minus10.enabled = notCraftingMode; - minus100.enabled = notCraftingMode; - minus1000.enabled = notCraftingMode; - levelMode.enabled = notCraftingMode; - redstoneMode.enabled = notCraftingMode; + this.level.setEnabled( notCraftingMode ); + this.plus1.enabled = notCraftingMode; + this.plus10.enabled = notCraftingMode; + this.plus100.enabled = notCraftingMode; + this.plus1000.enabled = notCraftingMode; + this.minus1.enabled = notCraftingMode; + this.minus10.enabled = notCraftingMode; + this.minus100.enabled = notCraftingMode; + this.minus1000.enabled = notCraftingMode; + this.levelMode.enabled = notCraftingMode; + this.redstoneMode.enabled = notCraftingMode; super.drawFG( offsetX, offsetY, mouseX, mouseY ); - if ( craftingMode != null ) - craftingMode.set( ((ContainerLevelEmitter) cvb).cmType ); + if ( this.craftingMode != null ) + this.craftingMode.set( ((ContainerLevelEmitter) this.cvb).cmType ); - if ( levelMode != null ) - levelMode.set( ((ContainerLevelEmitter) cvb).lvType ); + if ( this.levelMode != null ) + this.levelMode.set( ((ContainerLevelEmitter) this.cvb).lvType ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); - level.drawTextBox(); + this.level.drawTextBox(); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiMAC.java b/src/main/java/appeng/client/gui/implementations/GuiMAC.java index 7338cb079..a5e7c4ab8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMAC.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMAC.java @@ -39,30 +39,30 @@ public class GuiMAC extends GuiUpgradeable { super.initGui(); - pb = new GuiProgressBar( container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL ); - this.buttonList.add( pb ); + this.pb = new GuiProgressBar( this.container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL ); + this.buttonList.add( this.pb ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - pb.xPosition = 148 + guiLeft; - pb.yPosition = 48 + guiTop; + this.pb.xPosition = 148 + this.guiLeft; + this.pb.yPosition = 48 + this.guiTop; super.drawBG( offsetX, offsetY, mouseX, mouseY ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - pb.setFullMsg( container.getCurrentProgress() + "%" ); + this.pb.setFullMsg( this.container.getCurrentProgress() + "%" ); super.drawFG( offsetX, offsetY, mouseX, mouseY ); } @Override protected void addButtons() { - redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - buttonList.add( redstoneMode ); + this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.buttonList.add( this.redstoneMode ); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 449ab063e..254b7a6c2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -110,47 +110,47 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c) { super( c ); - myScrollBar = new GuiScrollbar(); - repo = new ItemRepo( myScrollBar, this ); + this.myScrollBar = new GuiScrollbar(); + this.repo = new ItemRepo( this.myScrollBar, this ); - xSize = 185; - ySize = 204; + this.xSize = 185; + this.ySize = 204; if ( te instanceof IViewCellStorage ) - xSize += 33; + this.xSize += 33; - standardSize = xSize; + this.standardSize = this.xSize; - configSrc = ((IConfigurableObject) inventorySlots).getConfigManager(); - (monitorableContainer = (ContainerMEMonitorable) inventorySlots).gui = this; + this.configSrc = ((IConfigurableObject) this.inventorySlots).getConfigManager(); + (this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots).gui = this; - viewCell = te instanceof IViewCellStorage; + this.viewCell = te instanceof IViewCellStorage; if ( te instanceof TileSecurity ) - myName = GuiText.Security; + this.myName = GuiText.Security; else if ( te instanceof WirelessTerminalGuiObject ) - myName = GuiText.WirelessTerminal; + this.myName = GuiText.WirelessTerminal; else if ( te instanceof IPortableCell ) - myName = GuiText.PortableCell; + this.myName = GuiText.PortableCell; else if ( te instanceof IMEChest ) - myName = GuiText.Chest; + this.myName = GuiText.Chest; else if ( te instanceof PartTerminal ) - myName = GuiText.Terminal; + this.myName = GuiText.Terminal; } public void postUpdate(List list) { for (IAEItemStack is : list) - repo.postUpdate( is ); + this.repo.postUpdate( is ); - repo.updateView(); - setScrollBar(); + this.repo.updateView(); + this.setScrollBar(); } private void setScrollBar() { - myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( rows * 18 - 2 ); - myScrollBar.setRange( 0, (repo.size() + perRow - 1) / perRow - rows, Math.max( 1, rows / 6 ) ); + this.myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 ); + this.myScrollBar.setRange( 0, (this.repo.size() + this.perRow - 1) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) ); } public void re_init() @@ -163,14 +163,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi public void onGuiClosed() { super.onGuiClosed(); - memoryText = searchField.getText(); + memoryText = this.searchField.getText(); } @Override public void initGui() { - maxRows = getMaxRows(); - perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((width - standardSize) / 18); + this.maxRows = this.getMaxRows(); + this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((this.width - this.standardSize) / 18); boolean hasNEI = AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ); @@ -178,106 +178,106 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi int top = hasNEI ? 22 : 0; int magicNumber = 114 + 1; - int extraSpace = height - magicNumber - NEI - top - reservedSpace; + int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace; - rows = (int) Math.floor( extraSpace / 18 ); - if ( rows > maxRows ) + this.rows = (int) Math.floor( extraSpace / 18 ); + if ( this.rows > this.maxRows ) { - top += (rows - maxRows) * 18 / 2; - rows = maxRows; + top += (this.rows - this.maxRows) * 18 / 2; + this.rows = this.maxRows; } if ( hasNEI ) - rows--; + this.rows--; - if ( rows < 3 ) - rows = 3; + if ( this.rows < 3 ) + this.rows = 3; - meSlots.clear(); - for (int y = 0; y < rows; y++) + this.meSlots.clear(); + for (int y = 0; y < this.rows; y++) { - for (int x = 0; x < perRow; x++) + for (int x = 0; x < this.perRow; x++) { - meSlots.add( new InternalSlotME( repo, x + y * perRow, offsetX + x * 18, 18 + y * 18 ) ); + this.meSlots.add( new InternalSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) ); } } if ( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ) - this.xSize = standardSize + ((perRow - 9) * 18); + this.xSize = this.standardSize + ((this.perRow - 9) * 18); else - this.xSize = standardSize; + this.xSize = this.standardSize; super.initGui(); // full size : 204 // extra slots : 72 // slot 18 - this.ySize = magicNumber + rows * 18 + reservedSpace; + this.ySize = magicNumber + this.rows * 18 + this.reservedSpace; // this.guiTop = top; - int unusedSpace = height - ySize; - guiTop = (int) Math.floor( unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f) ); + int unusedSpace = this.height - this.ySize; + this.guiTop = (int) Math.floor( unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f) ); - int offset = guiTop + 8; + int offset = this.guiTop + 8; - if ( customSortOrder ) + if ( this.customSortOrder ) { - buttonList.add( SortByBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, configSrc.getSetting( Settings.SORT_BY ) ) ); + this.buttonList.add( this.SortByBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting( Settings.SORT_BY ) ) ); offset += 20; } - if ( viewCell || this instanceof GuiWirelessTerm ) + if ( this.viewCell || this instanceof GuiWirelessTerm ) { - buttonList.add( ViewBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.VIEW_MODE, configSrc.getSetting( Settings.VIEW_MODE ) ) ); + this.buttonList.add( this.ViewBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.VIEW_MODE, this.configSrc.getSetting( Settings.VIEW_MODE ) ) ); offset += 20; } - buttonList.add( SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, configSrc.getSetting( Settings.SORT_DIRECTION ) ) ); + this.buttonList.add( this.SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc.getSetting( Settings.SORT_DIRECTION ) ) ); offset += 20; - buttonList.add( searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings + this.buttonList.add( this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings .getSetting( Settings.SEARCH_MODE ) ) ); offset += 20; if ( !(this instanceof GuiMEPortableCell) || this instanceof GuiWirelessTerm ) { - buttonList.add( terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings + this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings .getSetting( Settings.TERMINAL_STYLE ) ) ); } - searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 80, offsetX ), this.guiTop + 4, 90, 12 ); - searchField.setEnableBackgroundDrawing( false ); - searchField.setMaxStringLength( 25 ); - searchField.setTextColor( 0xFFFFFF ); - searchField.setVisible( true ); + this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 ); + this.searchField.setEnableBackgroundDrawing( false ); + this.searchField.setMaxStringLength( 25 ); + this.searchField.setTextColor( 0xFFFFFF ); + this.searchField.setVisible( true ); - if ( viewCell || this instanceof GuiWirelessTerm ) + if ( this.viewCell || this instanceof GuiWirelessTerm ) { - buttonList.add( craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus.getLocal(), + this.buttonList.add( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus.getLocal(), itemRender ) ); - craftingStatusBtn.hideEdge = 13; + this.craftingStatusBtn.hideEdge = 13; } // Enum setting = AEConfig.instance.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH ); Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); - searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting ); + this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting ); - if ( isSubGui() ) + if ( this.isSubGui() ) { - searchField.setText( memoryText ); - repo.searchString = memoryText; - repo.updateView(); - setScrollBar(); + this.searchField.setText( memoryText ); + this.repo.searchString = memoryText; + this.repo.updateView(); + this.setScrollBar(); } CraftingGridOffsetX = Integer.MAX_VALUE; CraftingGridOffsetY = Integer.MAX_VALUE; - for (Object s : inventorySlots.inventorySlots) + for (Object s : this.inventorySlots.inventorySlots) { if ( s instanceof AppEngSlot ) { if ( ((AppEngSlot) s).xDisplayPosition < 197 ) - repositionSlot( (AppEngSlot) s ); + this.repositionSlot( (AppEngSlot) s ); } if ( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix ) @@ -297,13 +297,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi protected void repositionSlot(AppEngSlot s) { - s.yDisplayPosition = s.defY + ySize - 78 - 5; + s.yDisplayPosition = s.defY + this.ySize - 78 - 5; } @Override protected void actionPerformed(GuiButton btn) { - if ( btn == craftingStatusBtn ) + if ( btn == this.craftingStatusBtn ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) ); } @@ -318,9 +318,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi Enum cv = iBtn.getCurrentValue(); Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); - if ( btn == terminalStyleBox ) + if ( btn == this.terminalStyleBox ) AEConfig.instance.settings.putSetting( iBtn.getSetting(), next ); - else if ( btn == searchBoxSettings ) + else if ( btn == this.searchBoxSettings ) AEConfig.instance.settings.putSetting( iBtn.getSetting(), next ); else { @@ -337,7 +337,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi iBtn.set( next ); if ( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) - re_init(); + this.re_init(); } } } @@ -349,15 +349,15 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if ( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH ) { - searchField.mouseClicked( xCoord, yCoord, btn ); + this.searchField.mouseClicked( xCoord, yCoord, btn ); } - if ( btn == 1 && searchField.isMouseIn( xCoord, yCoord ) ) + if ( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) ) { - searchField.setText( "" ); - repo.searchString = ""; - repo.updateView(); - setScrollBar(); + this.searchField.setText( "" ); + this.repo.searchString = ""; + this.repo.updateView(); + this.setScrollBar(); } super.mouseClicked( xCoord, yCoord, btn ); @@ -371,11 +371,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if ( character == ' ' && this.searchField.getText().length() == 0 ) return; - if ( searchField.textboxKeyTyped( character, key ) ) + if ( this.searchField.textboxKeyTyped( character, key ) ) { - repo.searchString = this.searchField.getText(); - repo.updateView(); - setScrollBar(); + this.repo.searchString = this.searchField.getText(); + this.repo.updateView(); + this.setScrollBar(); } else { @@ -387,7 +387,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi @Override public void updateScreen() { - repo.setPower( monitorableContainer.hasPower ); + this.repo.setPower( this.monitorableContainer.hasPower ); super.updateScreen(); } @@ -396,36 +396,36 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi { int x_width = 197; - bindTexture( getBackground() ); + this.bindTexture( this.getBackground() ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 ); - if ( viewCell || (this instanceof GuiSecurity) ) + if ( this.viewCell || (this instanceof GuiSecurity) ) this.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128 ); - for (int x = 0; x < rows; x++) + for (int x = 0; x < this.rows; x++) this.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18 ); - this.drawTexturedModalRect( offsetX, offsetY + 16 + rows * 18 + lowerTextureOffset, 0, 106 - 18 - 18, x_width, 99 + reservedSpace - lowerTextureOffset ); + this.drawTexturedModalRect( offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width, 99 + this.reservedSpace - this.lowerTextureOffset ); - if ( viewCell ) + if ( this.viewCell ) { boolean update = false; for (int i = 0; i < 5; i++) { - if ( myCurrentViewCells[i] != monitorableContainer.cellView[i].getStack() ) + if ( this.myCurrentViewCells[i] != this.monitorableContainer.cellView[i].getStack() ) { update = true; - myCurrentViewCells[i] = monitorableContainer.cellView[i].getStack(); + this.myCurrentViewCells[i] = this.monitorableContainer.cellView[i].getStack(); } } if ( update ) - repo.setViewCell( myCurrentViewCells ); + this.repo.setViewCell( this.myCurrentViewCells ); } - if ( searchField != null ) - searchField.drawTextBox(); + if ( this.searchField != null ) + this.searchField.drawTextBox(); } protected String getBackground() @@ -436,47 +436,47 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( myName.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override public Enum getSortBy() { - return configSrc.getSetting( Settings.SORT_BY ); + return this.configSrc.getSetting( Settings.SORT_BY ); } @Override public Enum getSortDir() { - return configSrc.getSetting( Settings.SORT_DIRECTION ); + return this.configSrc.getSetting( Settings.SORT_DIRECTION ); } @Override public Enum getSortDisplay() { - return configSrc.getSetting( Settings.VIEW_MODE ); + return this.configSrc.getSetting( Settings.VIEW_MODE ); } @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - if ( SortByBox != null ) - SortByBox.set( configSrc.getSetting( Settings.SORT_BY ) ); + if ( this.SortByBox != null ) + this.SortByBox.set( this.configSrc.getSetting( Settings.SORT_BY ) ); - if ( SortDirBox != null ) - SortDirBox.set( configSrc.getSetting( Settings.SORT_DIRECTION ) ); + if ( this.SortDirBox != null ) + this.SortDirBox.set( this.configSrc.getSetting( Settings.SORT_DIRECTION ) ); - if ( ViewBox != null ) - ViewBox.set( configSrc.getSetting( Settings.VIEW_MODE ) ); + if ( this.ViewBox != null ) + this.ViewBox.set( this.configSrc.getSetting( Settings.VIEW_MODE ) ); - repo.updateView(); + this.repo.updateView(); } @Override protected boolean isPowered() { - return repo.hasPower(); + return this.repo.hasPower(); } int getMaxRows() diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index 46faaf1e8..ce7c1b133 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -58,9 +58,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource super( new ContainerNetworkStatus( inventoryPlayer, te ) ); this.ySize = 153; this.xSize = 195; - myScrollBar = new GuiScrollbar(); - repo = new ItemRepo( myScrollBar, this ); - repo.rowSize = 5; + this.myScrollBar = new GuiScrollbar(); + this.repo = new ItemRepo( this.myScrollBar, this ); + this.repo.rowSize = 5; } @Override @@ -70,10 +70,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == units ) + if ( btn == this.units ) { AEConfig.instance.nextPowerUnit( backwards ); - units.set( AEConfig.instance.selectedPowerUnit() ); + this.units.set( AEConfig.instance.selectedPowerUnit() ); } } @@ -82,33 +82,33 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource { super.initGui(); - units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); - buttonList.add( units ); + this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); + this.buttonList.add( this.units ); } public void postUpdate(List list) { - repo.clear(); + this.repo.clear(); for (IAEItemStack is : list) - repo.postUpdate( is ); + this.repo.postUpdate( is ); - repo.updateView(); - setScrollBar(); + this.repo.updateView(); + this.setScrollBar(); } private void setScrollBar() { - int size = repo.size(); - myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 ); - myScrollBar.setRange( 0, (size + 4) / 5 - rows, 1 ); + int size = this.repo.size(); + this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 ); + this.myScrollBar.setRange( 0, (size + 4) / 5 - this.rows, 1 ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/networkstatus.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/networkstatus.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } int tooltip = -1; @@ -119,10 +119,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource int x = 0; int y = 0; - int gx = (width - xSize) / 2; - int gy = (height - ySize) / 2; + int gx = (this.width - this.xSize) / 2; + int gy = (this.height - this.ySize) / 2; - tooltip = -1; + this.tooltip = -1; for (int z = 0; z <= 4 * 5; z++) { @@ -133,7 +133,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource { if ( minY < mouse_y && minY + 20 > mouse_y ) { - tooltip = z; + this.tooltip = z; break; } @@ -154,15 +154,15 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - ContainerNetworkStatus ns = (ContainerNetworkStatus) inventorySlots; + ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; - fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.currentPower, false ), 13, 16, 4210752 ); - fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.maxPower, false ), 13, 26, 4210752 ); + this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.currentPower, false ), 13, 16, 4210752 ); + this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.maxPower, false ), 13, 26, 4210752 ); - fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 ); - fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 ); + 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; @@ -177,9 +177,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource int toolPosX = 0; int toolPosY = 0; - for (int z = viewStart; z < Math.min( viewEnd, repo.size() ); z++) + for (int z = viewStart; z < Math.min( viewEnd, this.repo.size() ); z++) { - IAEItemStack refStack = repo.getReferenceItem( z ); + IAEItemStack refStack = this.repo.getReferenceItem( z ); if ( refStack != null ) { GL11.glPushMatrix(); @@ -189,17 +189,17 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource if ( refStack.getStackSize() >= 10000 ) str = Long.toString( refStack.getStackSize() / 1000 ) + 'k'; - int w = fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * 18 + yo + 6) * 2, + 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; - if ( tooltip == z - viewStart ) + if ( this.tooltip == z - viewStart ) { - ToolTip = Platform.getItemDisplayName( repo.getItem( z ) ); + ToolTip = Platform.getItemDisplayName( this.repo.getItem( z ) ); ToolTip = ToolTip + ( '\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize())); if ( refStack.getCountRequestable() > 0 ) @@ -209,7 +209,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource toolPosY = y * 18 + yo; } - drawItem( posX, posY, repo.getItem( z ) ); + this.drawItem( posX, posY, this.repo.getItem( z ) ); x++; @@ -222,10 +222,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } - if ( tooltip >= 0 && ToolTip.length() > 0 ) + if ( this.tooltip >= 0 && ToolTip.length() > 0 ) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip ); + this.drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip ); GL11.glPopAttrib(); } @@ -236,7 +236,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource { if ( stack != null ) { - Slot s = getSlot( mouseX, mouseY ); + Slot s = this.getSlot( mouseX, mouseY ); if ( s instanceof SlotME ) { IAEItemStack myStack = null; @@ -264,7 +264,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource // Vanilla version... protected void drawItemStackTooltip(ItemStack stack, int x, int y) { - Slot s = getSlot( x, y ); + Slot s = this.getSlot( x, y ); if ( s instanceof SlotME && stack != null ) { IAEItemStack myStack = null; @@ -288,7 +288,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource currentToolTip.add( GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()) ); currentToolTip.add( GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( myStack.getCountRequestable(), true ) ); - drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); + this.drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); } } // super.drawItemStackTooltip( stack, x, y ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java index ed727b2e3..f62bf30f1 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java @@ -48,7 +48,7 @@ public class GuiNetworkTool extends AEBaseGui try { - if ( btn == tFacades ) + if ( btn == this.tFacades ) NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) ); } catch (IOException e) @@ -62,26 +62,26 @@ public class GuiNetworkTool extends AEBaseGui { super.initGui(); - tFacades = new GuiToggleButton( this.guiLeft - 18, guiTop + 8, 23, 22, GuiText.TransparentFacades.getLocal(), GuiText.TransparentFacadesHint.getLocal() ); + this.tFacades = new GuiToggleButton( this.guiLeft - 18, this.guiTop + 8, 23, 22, GuiText.TransparentFacades.getLocal(), GuiText.TransparentFacadesHint.getLocal() ); - buttonList.add( tFacades ); + this.buttonList.add( this.tFacades ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/toolbox.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/toolbox.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - if ( tFacades != null ) - tFacades.setState( ((ContainerNetworkTool) inventorySlots).facadeMode ); + if ( this.tFacades != null ) + this.tFacades.setState( ((ContainerNetworkTool) this.inventorySlots).facadeMode ); - fontRendererObj.drawString( getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java index c4fb2fae0..05827277f 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java @@ -50,19 +50,19 @@ public class GuiPatternTerm extends GuiMEMonitorable public void initGui() { super.initGui(); - buttonList.add( tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.crafting_table ), + this.buttonList.add( this.tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.crafting_table ), GuiText.CraftingPattern.getLocal(), itemRender ) ); - buttonList.add( tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.furnace ), + this.buttonList.add( this.tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.furnace ), GuiText.ProcessingPattern.getLocal(), itemRender ) ); // buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, // Settings.ACTIONS, ActionItems.SUBSTITUTION ) ); // substitutionsBtn.halfSize = true; - buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) ); - clearBtn.halfSize = true; + this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) ); + this.clearBtn.halfSize = true; - buttonList.add( encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE ) ); + this.buttonList.add( this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE ) ); } @Override @@ -73,17 +73,17 @@ public class GuiPatternTerm extends GuiMEMonitorable try { - if ( tabCraftButton == btn || tabProcessButton == btn ) + if ( this.tabCraftButton == btn || this.tabProcessButton == btn ) { - NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", tabProcessButton == btn ? "1" : "0" ) ); + NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? "1" : "0" ) ); } - if ( encodeBtn == btn ) + if ( this.encodeBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) ); } - if ( clearBtn == btn ) + if ( this.clearBtn == btn ) { NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); } @@ -105,21 +105,21 @@ public class GuiPatternTerm extends GuiMEMonitorable protected void repositionSlot(AppEngSlot s) { if ( s.isPlayerSide() ) - s.yDisplayPosition = s.defY + ySize - 78 - 5; + s.yDisplayPosition = s.defY + this.ySize - 78 - 5; else - s.yDisplayPosition = s.defY + ySize - 78 - 3; + s.yDisplayPosition = s.defY + this.ySize - 78 - 3; } public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) { super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) ); - container = (ContainerPatternTerm) this.inventorySlots; - reservedSpace = 81; + this.container = (ContainerPatternTerm) this.inventorySlots; + this.reservedSpace = 81; } @Override protected String getBackground() { - if ( container.craftingMode ) + if ( this.container.craftingMode ) return "guis/pattern.png"; return "guis/pattern2.png"; } @@ -127,19 +127,19 @@ public class GuiPatternTerm extends GuiMEMonitorable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - if ( !container.craftingMode ) + if ( !this.container.craftingMode ) { - tabCraftButton.visible = false; - tabProcessButton.visible = true; + this.tabCraftButton.visible = false; + this.tabProcessButton.visible = true; } else { - tabCraftButton.visible = true; - tabProcessButton.visible = false; + this.tabCraftButton.visible = true; + this.tabProcessButton.visible = false; } super.drawFG( offsetX, offsetY, mouseX, mouseY ); - fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, ySize - 96 + 2 - reservedSpace, 4210752 ); + this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.reservedSpace, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiPriority.java b/src/main/java/appeng/client/gui/implementations/GuiPriority.java index 357506880..744ce47cc 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPriority.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPriority.java @@ -69,65 +69,65 @@ public class GuiPriority extends AEBaseGui int c = AEConfig.instance.priorityByStacksAmounts( 2 ); int d = AEConfig.instance.priorityByStacksAmounts( 3 ); - buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) ); - buttonList.add( plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) ); - buttonList.add( plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 32, 32, 20, "+" + c ) ); - buttonList.add( plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 32, 38, 20, "+" + d ) ); + 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 ) ); + this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 32, 32, 20, "+" + c ) ); + this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 32, 38, 20, "+" + d ) ); - buttonList.add( minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 69, 22, 20, "-" + a ) ); - buttonList.add( minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 69, 28, 20, "-" + b ) ); - buttonList.add( minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) ); - buttonList.add( minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) ); + this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 69, 22, 20, "-" + a ) ); + this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 69, 28, 20, "-" + b ) ); + this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) ); + this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) ); ItemStack myIcon = null; - Object target = ((AEBaseContainer) inventorySlots).getTarget(); + Object target = ((AEBaseContainer) this.inventorySlots).getTarget(); if ( target instanceof PartStorageBus ) { myIcon = AEApi.instance().parts().partStorageBus.stack( 1 ); - OriginalGui = GuiBridge.GUI_STORAGEBUS; + this.OriginalGui = GuiBridge.GUI_STORAGEBUS; } if ( target instanceof PartFormationPlane ) { myIcon = AEApi.instance().parts().partFormationPlane.stack( 1 ); - OriginalGui = GuiBridge.GUI_FORMATION_PLANE; + this.OriginalGui = GuiBridge.GUI_FORMATION_PLANE; } if ( target instanceof TileDrive ) { myIcon = AEApi.instance().blocks().blockDrive.stack( 1 ); - OriginalGui = GuiBridge.GUI_DRIVE; + this.OriginalGui = GuiBridge.GUI_DRIVE; } if ( target instanceof TileChest ) { myIcon = AEApi.instance().blocks().blockChest.stack( 1 ); - OriginalGui = GuiBridge.GUI_CHEST; + this.OriginalGui = GuiBridge.GUI_CHEST; } if ( target instanceof TileInterface ) { myIcon = AEApi.instance().blocks().blockInterface.stack( 1 ); - OriginalGui = GuiBridge.GUI_INTERFACE; + this.OriginalGui = GuiBridge.GUI_INTERFACE; } if ( target instanceof PartInterface ) { myIcon = AEApi.instance().parts().partInterface.stack( 1 ); - OriginalGui = GuiBridge.GUI_INTERFACE; + this.OriginalGui = GuiBridge.GUI_INTERFACE; } - if ( OriginalGui != null ) - buttonList.add( originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); + if ( this.OriginalGui != null ) + this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); - priority = new GuiNumberBox( fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, fontRendererObj.FONT_HEIGHT, Long.class ); - priority.setEnableBackgroundDrawing( false ); - priority.setMaxStringLength( 16 ); - priority.setTextColor( 0xFFFFFF ); - priority.setVisible( true ); - priority.setFocused( true ); - ((ContainerPriority) inventorySlots).setTextField( priority ); + this.priority = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT, Long.class ); + this.priority.setEnableBackgroundDrawing( false ); + this.priority.setMaxStringLength( 16 ); + this.priority.setTextColor( 0xFFFFFF ); + this.priority.setVisible( true ); + this.priority.setFocused( true ); + ((ContainerPriority) this.inventorySlots).setTextField( this.priority ); } @Override @@ -135,23 +135,23 @@ public class GuiPriority extends AEBaseGui { super.actionPerformed( btn ); - if ( btn == originalGuiBtn ) + if ( btn == this.originalGuiBtn ) { - NetworkHandler.instance.sendToServer( new PacketSwitchGuis( OriginalGui ) ); + NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } - boolean isPlus = btn == plus1 || btn == plus10 || btn == plus100 || btn == plus1000; - boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; + 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; if ( isPlus || isMinus ) - addQty( getQty( btn ) ); + this.addQty( this.getQty( btn ) ); } private void addQty(int i) { try { - String Out = priority.getText(); + String Out = this.priority.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -161,7 +161,7 @@ public class GuiPriority extends AEBaseGui } if ( Fixed ) - priority.setText( Out ); + this.priority.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -169,14 +169,14 @@ public class GuiPriority extends AEBaseGui long result = Long.parseLong( Out ); result += i; - priority.setText( Out = Long.toString( result ) ); + this.priority.setText( Out = Long.toString( result ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", Out ) ); } catch(NumberFormatException e ) { // nope.. - priority.setText( "0" ); + this.priority.setText( "0" ); } catch (IOException e) { @@ -190,11 +190,11 @@ public class GuiPriority extends AEBaseGui if ( !this.checkHotbarKeys( key ) ) { if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character )) - && priority.textboxKeyTyped( character, key ) ) + && this.priority.textboxKeyTyped( character, key ) ) { try { - String Out = priority.getText(); + String Out = this.priority.getText(); boolean Fixed = false; while (Out.startsWith( "0" ) && Out.length() > 1) @@ -204,7 +204,7 @@ public class GuiPriority extends AEBaseGui } if ( Fixed ) - priority.setText( Out ); + this.priority.setText( Out ); if ( Out.length() == 0 ) Out = "0"; @@ -226,10 +226,10 @@ public class GuiPriority extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/priority.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/priority.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); - priority.drawTextBox(); + this.priority.drawTextBox(); } protected String getBackground() @@ -240,6 +240,6 @@ public class GuiPriority extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiQNB.java b/src/main/java/appeng/client/gui/implementations/GuiQNB.java index 21b2dad95..d5c89972c 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQNB.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQNB.java @@ -35,15 +35,15 @@ public class GuiQNB extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/chest.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/chest.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java index 1e2610681..34b4f52db 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java @@ -45,31 +45,31 @@ public class GuiQuartzKnife extends AEBaseGui { super.initGui(); - name = new GuiTextField( fontRendererObj, this.guiLeft + 24, this.guiTop + 32, 79, fontRendererObj.FONT_HEIGHT ); - name.setEnableBackgroundDrawing( false ); - name.setMaxStringLength( 32 ); - name.setTextColor( 0xFFFFFF ); - name.setVisible( true ); - name.setFocused( true ); + this.name = new GuiTextField( this.fontRendererObj, this.guiLeft + 24, this.guiTop + 32, 79, this.fontRendererObj.FONT_HEIGHT ); + this.name.setEnableBackgroundDrawing( false ); + this.name.setMaxStringLength( 32 ); + this.name.setTextColor( 0xFFFFFF ); + this.name.setVisible( true ); + this.name.setFocused( true ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/quartzknife.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); - name.drawTextBox(); + this.bindTexture( "guis/quartzknife.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); + this.name.drawTextBox(); } @Override protected void keyTyped(char character, int key) { - if ( name.textboxKeyTyped( character, key ) ) + if ( this.name.textboxKeyTyped( character, key ) ) { try { - String Out = name.getText(); - ((ContainerQuartzKnife) inventorySlots).setName( Out ); + String Out = this.name.getText(); + ((ContainerQuartzKnife) this.inventorySlots).setName( Out ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) ); } catch (IOException e) @@ -86,8 +86,8 @@ public class GuiQuartzKnife extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java index 76fd6d5b7..8d43525ee 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java @@ -38,12 +38,12 @@ public class GuiSecurity extends GuiMEMonitorable public GuiSecurity(InventoryPlayer inventoryPlayer, ITerminalHost te) { super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) ); - customSortOrder = false; - reservedSpace = 33; + this.customSortOrder = false; + this.reservedSpace = 33; // increase size so that the slot is over the gui. - xSize += 56; - standardSize = xSize; + this.xSize += 56; + this.standardSize = this.xSize; } GuiToggleButton inject, extract, craft, build, security; @@ -54,19 +54,19 @@ public class GuiSecurity extends GuiMEMonitorable super.initGui(); int top = this.guiTop + this.ySize - 116; - buttonList.add( inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT + this.buttonList.add( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT .getUnlocalizedName(), SecurityPermissions.INJECT.getUnlocalizedTip() ) ); - buttonList.add( extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT + this.buttonList.add( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT .getUnlocalizedName(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) ); - buttonList.add( craft = new GuiToggleButton( this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2, SecurityPermissions.CRAFT.getUnlocalizedName(), + this.buttonList.add( this.craft = new GuiToggleButton( this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2, SecurityPermissions.CRAFT.getUnlocalizedName(), SecurityPermissions.CRAFT.getUnlocalizedTip() ) ); - buttonList.add( build = new GuiToggleButton( this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3, SecurityPermissions.BUILD.getUnlocalizedName(), + this.buttonList.add( this.build = new GuiToggleButton( this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3, SecurityPermissions.BUILD.getUnlocalizedName(), SecurityPermissions.BUILD.getUnlocalizedTip() ) ); - buttonList.add( security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY + this.buttonList.add( this.security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY .getUnlocalizedName(), SecurityPermissions.SECURITY.getUnlocalizedTip() ) ); } @@ -77,15 +77,15 @@ public class GuiSecurity extends GuiMEMonitorable SecurityPermissions toggleSetting = null; - if ( btn == inject ) + if ( btn == this.inject ) toggleSetting = SecurityPermissions.INJECT; - if ( btn == extract ) + if ( btn == this.extract ) toggleSetting = SecurityPermissions.EXTRACT; - if ( btn == craft ) + if ( btn == this.craft ) toggleSetting = SecurityPermissions.CRAFT; - if ( btn == build ) + if ( btn == this.build ) toggleSetting = SecurityPermissions.BUILD; - if ( btn == security ) + if ( btn == this.security ) toggleSetting = SecurityPermissions.SECURITY; if ( toggleSetting != null ) @@ -105,13 +105,13 @@ public class GuiSecurity extends GuiMEMonitorable @Override protected String getBackground() { - ContainerSecurity cs = (ContainerSecurity) inventorySlots; + ContainerSecurity cs = (ContainerSecurity) this.inventorySlots; - inject.setState( (cs.security & (1 << SecurityPermissions.INJECT.ordinal())) > 0 ); - extract.setState( (cs.security & (1 << SecurityPermissions.EXTRACT.ordinal())) > 0 ); - craft.setState( (cs.security & (1 << SecurityPermissions.CRAFT.ordinal())) > 0 ); - build.setState( (cs.security & (1 << SecurityPermissions.BUILD.ordinal())) > 0 ); - security.setState( (cs.security & (1 << SecurityPermissions.SECURITY.ordinal())) > 0 ); + this.inject.setState( (cs.security & (1 << SecurityPermissions.INJECT.ordinal())) > 0 ); + this.extract.setState( (cs.security & (1 << SecurityPermissions.EXTRACT.ordinal())) > 0 ); + this.craft.setState( (cs.security & (1 << SecurityPermissions.CRAFT.ordinal())) > 0 ); + this.build.setState( (cs.security & (1 << SecurityPermissions.BUILD.ordinal())) > 0 ); + this.security.setState( (cs.security & (1 << SecurityPermissions.SECURITY.ordinal())) > 0 ); return "guis/security.png"; } @@ -120,7 +120,7 @@ public class GuiSecurity extends GuiMEMonitorable public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); - fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, ySize - 96 + 1 - reservedSpace, 4210752 ); + this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java index 4b655db2c..b1d7a50d8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java @@ -37,15 +37,15 @@ public class GuiSkyChest extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/skychest.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/skychest.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 2, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 ); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java index 97aab99cc..05a353d53 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java @@ -42,7 +42,7 @@ public class GuiSpatialIOPort extends AEBaseGui public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) { super( new ContainerSpatialIOPort( inventoryPlayer, te ) ); this.ySize = 199; - container = (ContainerSpatialIOPort) inventorySlots; + this.container = (ContainerSpatialIOPort) this.inventorySlots; } @Override @@ -52,10 +52,10 @@ public class GuiSpatialIOPort extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == units ) + if ( btn == this.units ) { AEConfig.instance.nextPowerUnit( backwards ); - units.set( AEConfig.instance.selectedPowerUnit() ); + this.units.set( AEConfig.instance.selectedPowerUnit() ); } } @@ -64,27 +64,27 @@ public class GuiSpatialIOPort extends AEBaseGui { super.initGui(); - units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); - buttonList.add( units ); + this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); + this.buttonList.add( this.units ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/spatialio.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/spatialio.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( container.currentPower, false ), 13, 21, 4210752 ); - fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( container.maxPower, false ), 13, 31, 4210752 ); - fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( container.reqPower, false ), 13, 78, 4210752 ); - fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) container.eff) / 100) + '%', 13, 88, 4210752 ); + 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 ); + this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.reqPower, false ), 13, 78, 4210752 ); + this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) this.container.eff) / 100) + '%', 13, 88, 4210752 ); - fontRendererObj.drawString( getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java index 6eaf1f267..d4321513e 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java @@ -59,35 +59,35 @@ public class GuiStorageBus extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - if ( fuzzyMode != null ) - fuzzyMode.set( cvb.fzMode ); + if ( this.fuzzyMode != null ) + this.fuzzyMode.set( this.cvb.fzMode ); - if ( storageFilter != null ) - storageFilter.set( ((ContainerStorageBus) cvb).storageFilter ); + if ( this.storageFilter != null ) + this.storageFilter.set( ((ContainerStorageBus) this.cvb).storageFilter ); - if ( rwMode != null ) - rwMode.set( ((ContainerStorageBus) cvb).rwMode ); + if ( this.rwMode != null ) + this.rwMode.set( ((ContainerStorageBus) this.cvb).rwMode ); } @Override protected void addButtons() { - clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); - partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); - rwMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE ); - storageFilter = new GuiImgButton( this.guiLeft - 18, guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY ); - fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.clear = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); + this.partition = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); + this.rwMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE ); + this.storageFilter = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY ); + this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); + this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); - buttonList.add( storageFilter ); - buttonList.add( fuzzyMode ); - buttonList.add( rwMode ); - buttonList.add( partition ); - buttonList.add( clear ); + this.buttonList.add( this.storageFilter ); + this.buttonList.add( this.fuzzyMode ); + this.buttonList.add( this.rwMode ); + this.buttonList.add( this.partition ); + this.buttonList.add( this.clear ); } @Override @@ -99,20 +99,20 @@ public class GuiStorageBus extends GuiUpgradeable try { - if ( btn == partition ) + if ( btn == this.partition ) NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) ); - else if ( btn == clear ) + else if ( btn == this.clear ) NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) ); - else if ( btn == priority ) + else if ( btn == this.priority ) NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); - else if ( btn == rwMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) ); + else if ( btn == this.rwMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) ); - else if ( btn == storageFilter ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( storageFilter.getSetting(), backwards ) ); + else if ( btn == this.storageFilter ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) ); } catch (IOException e) diff --git a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java index 5673762dc..a05f036e5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java @@ -53,10 +53,10 @@ public class GuiUpgradeable extends AEBaseGui public GuiUpgradeable(ContainerUpgradeable te) { super( te ); - cvb = te; + this.cvb = te; - bc = (IUpgradeableHost) te.getTarget(); - this.xSize = hasToolbox() ? 246 : 211; + this.bc = (IUpgradeableHost) te.getTarget(); + this.xSize = this.hasToolbox() ? 246 : 211; this.ySize = 184; } @@ -64,18 +64,18 @@ public class GuiUpgradeable extends AEBaseGui public void initGui() { super.initGui(); - addButtons(); + this.addButtons(); } protected void addButtons() { - redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - craftMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO ); + this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.craftMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO ); - buttonList.add( craftMode ); - buttonList.add( redstoneMode ); - buttonList.add( fuzzyMode ); + this.buttonList.add( this.craftMode ); + this.buttonList.add( this.redstoneMode ); + this.buttonList.add( this.fuzzyMode ); } @Override @@ -85,32 +85,32 @@ public class GuiUpgradeable extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == redstoneMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( redstoneMode.getSetting(), backwards ) ); + if ( btn == this.redstoneMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) ); - if ( btn == craftMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( craftMode.getSetting(), backwards ) ); + if ( btn == this.craftMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) ); - if ( btn == fuzzyMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( fuzzyMode.getSetting(), backwards ) ); + if ( btn == this.fuzzyMode ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) ); } protected boolean hasToolbox() { - return ((ContainerUpgradeable) inventorySlots).hasToolbox(); + return ((ContainerUpgradeable) this.inventorySlots).hasToolbox(); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - handleButtonVisibility(); + this.handleButtonVisibility(); - bindTexture( getBackground() ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); - if ( drawUpgrades() ) - this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + cvb.availableUpgrades() * 18 ); - if ( hasToolbox() ) - this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, ySize - 90, 68, 68 ); + this.bindTexture( this.getBackground() ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize ); + if ( this.drawUpgrades() ) + this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18 ); + if ( this.hasToolbox() ) + this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 ); } protected boolean drawUpgrades() @@ -125,33 +125,33 @@ public class GuiUpgradeable extends AEBaseGui protected void handleButtonVisibility() { - if ( redstoneMode != null ) - redstoneMode.setVisibility( bc.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 ); - if ( fuzzyMode != null ) - fuzzyMode.setVisibility( bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); - if ( craftMode != null ) - craftMode.setVisibility( bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); + if ( this.redstoneMode != null ) + this.redstoneMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 ); + if ( this.fuzzyMode != null ) + this.fuzzyMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); + if ( this.craftMode != null ) + this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( getName().getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - if ( redstoneMode != null ) - redstoneMode.set( cvb.rsMode ); + if ( this.redstoneMode != null ) + this.redstoneMode.set( this.cvb.rsMode ); - if ( fuzzyMode != null ) - fuzzyMode.set( cvb.fzMode ); + if ( this.fuzzyMode != null ) + this.fuzzyMode.set( this.cvb.fzMode ); - if ( craftMode != null ) - craftMode.set( cvb.cMode ); + if ( this.craftMode != null ) + this.craftMode.set( this.cvb.cMode ); } protected GuiText getName() { - return bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus; + return this.bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus; } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java index f4f8940ee..32d6ac501 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java @@ -38,7 +38,7 @@ public class GuiVibrationChamber extends AEBaseGui public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te) { super( new ContainerVibrationChamber( inventoryPlayer, te ) ); - cvc = (ContainerVibrationChamber) inventorySlots; + this.cvc = (ContainerVibrationChamber) this.inventorySlots; this.ySize = 166; } @@ -47,34 +47,34 @@ public class GuiVibrationChamber extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL ); - this.buttonList.add( pb ); + this.pb = new GuiProgressBar( this.cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL ); + this.buttonList.add( this.pb ); } @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/vibchamber.png" ); - pb.xPosition = 99 + guiLeft; - pb.yPosition = 36 + guiTop; - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/vibchamber.png" ); + this.pb.xPosition = 99 + this.guiLeft; + this.pb.yPosition = 36 + this.guiTop; + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); int k = 25; int l = -15; - pb.setFullMsg( cvc.aePerTick * cvc.getCurrentProgress() / 100 + " ae/t" ); + this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " ae/t" ); - if ( cvc.getCurrentProgress() > 0 ) + if ( this.cvc.getCurrentProgress() > 0 ) { - int i1 = cvc.getCurrentProgress(); - bindTexture( "guis/vibchamber.png" ); + int i1 = this.cvc.getCurrentProgress(); + this.bindTexture( "guis/vibchamber.png" ); GL11.glColor3f( 1, 1, 1 ); this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiWireless.java b/src/main/java/appeng/client/gui/implementations/GuiWireless.java index f40a25730..e21cc93af 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWireless.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWireless.java @@ -44,10 +44,10 @@ public class GuiWireless extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == units ) + if ( btn == this.units ) { AEConfig.instance.nextPowerUnit( backwards ); - units.set( AEConfig.instance.selectedPowerUnit() ); + this.units.set( AEConfig.instance.selectedPowerUnit() ); } } @@ -56,8 +56,8 @@ public class GuiWireless extends AEBaseGui { super.initGui(); - units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); - buttonList.add( units ); + this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); + this.buttonList.add( this.units ); } public GuiWireless(InventoryPlayer inventoryPlayer, TileWireless te) { @@ -68,27 +68,27 @@ public class GuiWireless extends AEBaseGui @Override public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { - bindTexture( "guis/wireless.png" ); - this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); + this.bindTexture( "guis/wireless.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 ); - fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); + 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) inventorySlots; + 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 ); - int strWidth = Math.max( fontRendererObj.getStringWidth( firstMessage ), fontRendererObj.getStringWidth( secondMessage ) ); + int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) ); int cOffset = (this.xSize / 2) - (strWidth / 2); - fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); - fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); + this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); + this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java index 783e96473..ebbde0d85 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java @@ -26,12 +26,12 @@ public class GuiWirelessTerm extends GuiMEPortableCell public GuiWirelessTerm(InventoryPlayer inventoryPlayer, IPortableCell te) { super( inventoryPlayer, te ); - maxRows = Integer.MAX_VALUE; + this.maxRows = Integer.MAX_VALUE; } @Override int getMaxRows() { - return defaultGetMaxRows(); + return this.defaultGetMaxRows(); } } diff --git a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java index f6ed5b457..561d28257 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java +++ b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java @@ -35,21 +35,21 @@ public class GuiNumberBox extends GuiTextField @Override public void writeText(String p_146191_1_) { - String original = getText(); + String original = this.getText(); super.writeText( p_146191_1_ ); try { - if ( type == int.class || type == Integer.class ) - Integer.parseInt( getText() ); - else if ( type == long.class || type == Long.class ) - Long.parseLong( getText() ); - else if ( type == double.class || type == Double.class ) - Double.parseDouble( getText() ); + if ( this.type == int.class || this.type == Integer.class ) + Integer.parseInt( this.getText() ); + else if ( this.type == long.class || this.type == Long.class ) + Long.parseLong( this.getText() ); + else if ( this.type == double.class || this.type == Double.class ) + Double.parseDouble( this.getText() ); } catch(NumberFormatException e ) { - setText( original ); + this.setText( original ); } } diff --git a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java index 22e168bcd..e4e13ca0c 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java @@ -55,12 +55,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip this.xPosition = posX; this.yPosition = posY; this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture ); - width = _width; - height = _height; - fill_u = u; - fill_v = y; - layout = dir; - titleName = title; + this.width = _width; + this.height = _height; + this.fill_u = u; + this.fill_v = y; + this.layout = dir; + this.titleName = title; } @Override @@ -68,19 +68,19 @@ public class GuiProgressBar extends GuiButton implements ITooltip { if ( this.visible ) { - par1Minecraft.getTextureManager().bindTexture( texture ); - int max = source.getMaxProgress(); - int current = source.getCurrentProgress(); + par1Minecraft.getTextureManager().bindTexture( this.texture ); + int max = this.source.getMaxProgress(); + int current = this.source.getCurrentProgress(); - if ( layout == Direction.VERTICAL ) + if ( this.layout == Direction.VERTICAL ) { - int diff = height - (max > 0 ? (height * current) / max : 0); - this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, fill_u, fill_v + diff, width, height - diff ); + 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 = width - (max > 0 ? (width * current) / max : 0); - this.drawTexturedModalRect( this.xPosition, this.yPosition, fill_u + diff, fill_v, width - diff, height ); + 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 ); } this.mouseDragged( par1Minecraft, par2, par3 ); @@ -95,34 +95,34 @@ public class GuiProgressBar extends GuiButton implements ITooltip @Override public String getMessage() { - if ( fullMsg != null ) - return fullMsg; + if ( this.fullMsg != null ) + return this.fullMsg; - return (titleName != null ? titleName : "") + '\n' + source.getCurrentProgress() + ' ' + GuiText.Of.getLocal() + ' ' + source.getMaxProgress(); + return (this.titleName != null ? this.titleName : "") + '\n' + this.source.getCurrentProgress() + ' ' + GuiText.Of.getLocal() + ' ' + this.source.getMaxProgress(); } @Override public int xPos() { - return xPosition - 2; + return this.xPosition - 2; } @Override public int yPos() { - return yPosition - 2; + return this.yPosition - 2; } @Override public int getWidth() { - return width + 4; + return this.width + 4; } @Override public int getHeight() { - return height + 4; + return this.height + 4; } @Override diff --git a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java index 19c10c5f0..5d442be1f 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java @@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource private void applyRange() { - currentScroll = Math.max( Math.min( currentScroll, maxScroll ), minScroll ); + this.currentScroll = Math.max( Math.min( this.currentScroll, this.maxScroll ), this.minScroll ); } public void draw(AEBaseGui g) @@ -45,97 +45,97 @@ public class GuiScrollbar implements IScrollSource g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - if ( getRange() == 0 ) + if ( this.getRange() == 0 ) { - g.drawTexturedModalRect( displayX, displayY, 232 + width, 0, width, 15 ); + g.drawTexturedModalRect( this.displayX, this.displayY, 232 + this.width, 0, this.width, 15 ); } else { - int offset = (currentScroll - minScroll) * (height - 15) / getRange(); - g.drawTexturedModalRect( displayX, offset + displayY, 232, 0, width, 15 ); + int offset = (this.currentScroll - this.minScroll) * (this.height - 15) / this.getRange(); + g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 ); } } public int getRange() { - return maxScroll - minScroll; + return this.maxScroll - this.minScroll; } public int getLeft() { - return displayX; + return this.displayX; } public int getTop() { - return displayY; + return this.displayY; } public int getWidth() { - return width; + return this.width; } public int getHeight() { - return height; + return this.height; } public GuiScrollbar setLeft(int v) { - displayX = v; + this.displayX = v; return this; } public GuiScrollbar setTop(int v) { - displayY = v; + this.displayY = v; return this; } public GuiScrollbar setWidth(int v) { - width = v; + this.width = v; return this; } public GuiScrollbar setHeight(int v) { - height = v; + this.height = v; return this; } public void setRange(int min, int max, int pageSize) { - minScroll = min; - maxScroll = max; + this.minScroll = min; + this.maxScroll = max; this.pageSize = pageSize; - if ( minScroll > maxScroll ) - maxScroll = minScroll; + if ( this.minScroll > this.maxScroll ) + this.maxScroll = this.minScroll; - applyRange(); + this.applyRange(); } @Override public int getCurrentScroll() { - return currentScroll; + return this.currentScroll; } public void click(AEBaseGui aeBaseGui, int x, int y) { - if ( getRange() == 0 ) + if ( this.getRange() == 0 ) return; - if ( x > displayX && x <= displayX + width ) + if ( x > this.displayX && x <= this.displayX + this.width ) { - if ( y > displayY && y <= displayY + height ) + if ( y > this.displayY && y <= this.displayY + this.height ) { - currentScroll = (y - displayY); - currentScroll = minScroll + ((currentScroll * 2 * getRange() / height)); - currentScroll = (currentScroll + 1) >> 1; - applyRange(); + this.currentScroll = (y - this.displayY); + this.currentScroll = this.minScroll + ((this.currentScroll * 2 * this.getRange() / this.height)); + this.currentScroll = (this.currentScroll + 1) >> 1; + this.applyRange(); } } } @@ -143,8 +143,8 @@ public class GuiScrollbar implements IScrollSource public void wheel(int delta) { delta = Math.max( Math.min( -delta, 1 ), -1 ); - currentScroll += delta * pageSize; - applyRange(); + this.currentScroll += delta * this.pageSize; + this.applyRange(); } } diff --git a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java index 30562bd6e..de3442af6 100644 --- a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java +++ b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java @@ -64,7 +64,7 @@ public class MEGuiTextField extends GuiTextField { super.mouseClicked( xPos, yPos, button ); - final boolean requiresFocus = isMouseIn( xPos, yPos ); + final boolean requiresFocus = this.isMouseIn( xPos, yPos ); this.setFocused( requiresFocus ); } diff --git a/src/main/java/appeng/client/me/ClientDCInternalInv.java b/src/main/java/appeng/client/me/ClientDCInternalInv.java index 656b34c36..1b800d9e8 100644 --- a/src/main/java/appeng/client/me/ClientDCInternalInv.java +++ b/src/main/java/appeng/client/me/ClientDCInternalInv.java @@ -31,7 +31,7 @@ public class ClientDCInternalInv implements Comparable final public long sortBy; public ClientDCInternalInv(int size, long id, long sortBy, String unlocalizedName) { - inv = new AppEngInternalInventory( null, size ); + this.inv = new AppEngInternalInventory( null, size ); this.unlocalizedName = unlocalizedName; this.id = id; this.sortBy = sortBy; @@ -39,16 +39,16 @@ public class ClientDCInternalInv implements Comparable public String getName() { - String s = StatCollector.translateToLocal( unlocalizedName + ".name" ); - if ( s.equals( unlocalizedName + ".name" ) ) - return StatCollector.translateToLocal( unlocalizedName ); + String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" ); + if ( s.equals( this.unlocalizedName + ".name" ) ) + return StatCollector.translateToLocal( this.unlocalizedName ); return s; } @Override public int compareTo(ClientDCInternalInv o) { - return ItemSorters.compareLong( sortBy, o.sortBy ); + return ItemSorters.compareLong( this.sortBy, o.sortBy ); } } \ No newline at end of file diff --git a/src/main/java/appeng/client/me/InternalSlotME.java b/src/main/java/appeng/client/me/InternalSlotME.java index c4972a6b3..758cf413f 100644 --- a/src/main/java/appeng/client/me/InternalSlotME.java +++ b/src/main/java/appeng/client/me/InternalSlotME.java @@ -39,16 +39,16 @@ public class InternalSlotME public ItemStack getStack() { - return repo.getItem( offset ); + return this.repo.getItem( this.offset ); } public IAEItemStack getAEStack() { - return repo.getReferenceItem( offset ); + return this.repo.getReferenceItem( this.offset ); } public boolean hasPower() { - return repo.hasPower(); + return this.repo.hasPower(); } } diff --git a/src/main/java/appeng/client/me/ItemRepo.java b/src/main/java/appeng/client/me/ItemRepo.java index 864cdfe28..140f31764 100644 --- a/src/main/java/appeng/client/me/ItemRepo.java +++ b/src/main/java/appeng/client/me/ItemRepo.java @@ -64,30 +64,30 @@ public class ItemRepo public IAEItemStack getReferenceItem(int idx) { - idx += src.getCurrentScroll() * rowSize; + idx += this.src.getCurrentScroll() * this.rowSize; - if ( idx >= view.size() ) + if ( idx >= this.view.size() ) return null; - return view.get( idx ); + return this.view.get( idx ); } public ItemStack getItem(int idx) { - idx += src.getCurrentScroll() * rowSize; + idx += this.src.getCurrentScroll() * this.rowSize; - if ( idx >= dsp.size() ) + if ( idx >= this.dsp.size() ) return null; - return dsp.get( idx ); + return this.dsp.get( idx ); } void setSearch(String search) { - searchString = search == null ? "" : search; + this.searchString = search == null ? "" : search; } public void postUpdate(IAEItemStack is) { - IAEItemStack st = list.findPrecise( is ); + IAEItemStack st = this.list.findPrecise( is ); if ( st != null ) { @@ -95,15 +95,15 @@ public class ItemRepo st.add( is ); } else - list.add( is ); + this.list.add( is ); } IPartitionList myPartitionList; public void setViewCell(ItemStack[] list) { - myPartitionList = ItemViewCell.createFilter( list ); - updateView(); + this.myPartitionList = ItemViewCell.createFilter( list ); + this.updateView(); } private String NEIWord = null; @@ -112,16 +112,16 @@ public class ItemRepo { try { - if ( NEIWord == null || !NEIWord.equals( filter ) ) + if ( this.NEIWord == null || !this.NEIWord.equals( filter ) ) { - Class c = ReflectionHelper.getClass( getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); + Class c = ReflectionHelper.getClass( this.getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); Field fldSearchField = c.getField( "searchField" ); Object searchField = fldSearchField.get( c ); Method a = searchField.getClass().getMethod( "setText", String.class ); Method b = searchField.getClass().getMethod( "onTextChange", String.class ); - NEIWord = filter; + this.NEIWord = filter; a.invoke( searchField, filter ); b.invoke( searchField, "" ); } @@ -134,38 +134,38 @@ public class ItemRepo public void updateView() { - view.clear(); - dsp.clear(); + this.view.clear(); + this.dsp.clear(); - view.ensureCapacity( list.size() ); - dsp.ensureCapacity( list.size() ); + this.view.ensureCapacity( this.list.size() ); + this.dsp.ensureCapacity( this.list.size() ); - Enum viewMode = sortSrc.getSortDisplay(); + Enum viewMode = this.sortSrc.getSortDisplay(); Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if ( searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH ) - updateNEI( searchString ); + this.updateNEI( this.searchString ); - innerSearch = searchString; + this.innerSearch = this.searchString; boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO; // boolean terminalSearchMods = Configuration.instance.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO; boolean searchMod = false; - if ( innerSearch.startsWith( "@" ) ) + if ( this.innerSearch.startsWith( "@" ) ) { searchMod = true; - innerSearch = innerSearch.substring( 1 ); + this.innerSearch = this.innerSearch.substring( 1 ); } Pattern m = null; try { - m = Pattern.compile( innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE ); + m = Pattern.compile( this.innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE ); } catch (Throwable ignore) { try { - m = Pattern.compile( Pattern.quote( innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE ); + m = Pattern.compile( Pattern.quote( this.innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE ); } catch (Throwable __) { @@ -174,11 +174,11 @@ public class ItemRepo } boolean notDone = false; - for (IAEItemStack is : list) + for (IAEItemStack is : this.list) { - if ( myPartitionList != null ) + if ( this.myPartitionList != null ) { - if ( !myPartitionList.isListed( is ) ) + if ( !this.myPartitionList.isListed( is ) ) continue; } @@ -199,7 +199,7 @@ public class ItemRepo if ( m.matcher( dspName.toLowerCase() ).find() ) { - view.add( is ); + this.view.add( is ); notDone = false; } @@ -208,7 +208,7 @@ public class ItemRepo for (Object lp : Platform.getTooltip( is )) if ( lp instanceof String && m.matcher( (String) lp ).find() ) { - view.add( is ); + this.view.add( is ); notDone = false; break; } @@ -220,40 +220,40 @@ public class ItemRepo */ } - Enum SortBy = sortSrc.getSortBy(); - Enum SortDir = sortSrc.getSortDir(); + Enum SortBy = this.sortSrc.getSortBy(); + Enum SortDir = this.sortSrc.getSortDir(); ItemSorters.Direction = (appeng.api.config.SortDir) SortDir; ItemSorters.init(); if ( SortBy == SortOrder.MOD ) - Collections.sort( view, ItemSorters.ConfigBased_SortByMod ); + Collections.sort( this.view, ItemSorters.ConfigBased_SortByMod ); else if ( SortBy == SortOrder.AMOUNT ) - Collections.sort( view, ItemSorters.ConfigBased_SortBySize ); + Collections.sort( this.view, ItemSorters.ConfigBased_SortBySize ); else if ( SortBy == SortOrder.INVTWEAKS ) - Collections.sort( view, ItemSorters.ConfigBased_SortByInvTweaks ); + Collections.sort( this.view, ItemSorters.ConfigBased_SortByInvTweaks ); else - Collections.sort( view, ItemSorters.ConfigBased_SortByName ); + Collections.sort( this.view, ItemSorters.ConfigBased_SortByName ); - for (IAEItemStack is : view) - dsp.add( is.getItemStack() ); + for (IAEItemStack is : this.view) + this.dsp.add( is.getItemStack() ); } public int size() { - return view.size(); + return this.view.size(); } public void clear() { - list.resetStatus(); + this.list.resetStatus(); } private boolean hasPower; public boolean hasPower() { - return hasPower; + return this.hasPower; } public void setPower(boolean hasPower) diff --git a/src/main/java/appeng/client/me/SlotDisconnected.java b/src/main/java/appeng/client/me/SlotDisconnected.java index 5dfd0865a..1410048fd 100644 --- a/src/main/java/appeng/client/me/SlotDisconnected.java +++ b/src/main/java/appeng/client/me/SlotDisconnected.java @@ -32,7 +32,7 @@ public class SlotDisconnected extends AppEngSlot public SlotDisconnected(ClientDCInternalInv me, int which, int x, int y) { super( me.inv, which, x, y ); - mySlot = me; + this.mySlot = me; } @Override @@ -73,7 +73,7 @@ public class SlotDisconnected extends AppEngSlot @Override public boolean getHasStack() { - return getStack() != null; + return this.getStack() != null; } @Override diff --git a/src/main/java/appeng/client/me/SlotME.java b/src/main/java/appeng/client/me/SlotME.java index dfec0c871..480c78fca 100644 --- a/src/main/java/appeng/client/me/SlotME.java +++ b/src/main/java/appeng/client/me/SlotME.java @@ -31,21 +31,21 @@ public class SlotME extends Slot public SlotME(InternalSlotME me) { super( null, 0, me.xPos, me.yPos ); - mySlot = me; + this.mySlot = me; } @Override public ItemStack getStack() { - if ( mySlot.hasPower() ) - return mySlot.getStack(); + if ( this.mySlot.hasPower() ) + return this.mySlot.getStack(); return null; } public IAEItemStack getAEStack() { - if ( mySlot.hasPower() ) - return mySlot.getAEStack(); + if ( this.mySlot.hasPower() ) + return this.mySlot.getAEStack(); return null; } @@ -70,8 +70,8 @@ public class SlotME extends Slot @Override public boolean getHasStack() { - if ( mySlot.hasPower() ) - return getStack() != null; + if ( this.mySlot.hasPower() ) + return this.getStack() != null; return false; } diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index a2bcdcf9b..1b899da54 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -102,7 +102,7 @@ public class AppEngRenderItem extends RenderItem GL11.glEnable( GL11.GL_DEPTH_TEST ); } - long amount = aeStack != null ? aeStack.getStackSize() : is.stackSize; + long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize; if ( amount > 999999999999L ) amount = 999999999999L; diff --git a/src/main/java/appeng/client/render/BaseBlockRender.java b/src/main/java/appeng/client/render/BaseBlockRender.java index 510242051..aeba45c43 100644 --- a/src/main/java/appeng/client/render/BaseBlockRender.java +++ b/src/main/java/appeng/client/render/BaseBlockRender.java @@ -276,14 +276,14 @@ public class BaseBlockRender } public BaseBlockRender(boolean enableTESR, double tileEntitySpecialRendererRange) { - hasTESR = enableTESR; - MAX_DISTANCE = tileEntitySpecialRendererRange; + this.hasTESR = enableTESR; + this.MAX_DISTANCE = tileEntitySpecialRendererRange; setOriMap(); } public double getTesrRenderDistance() { - return MAX_DISTANCE; + return this.MAX_DISTANCE; } public IIcon firstNotNull(IIcon... s) @@ -313,7 +313,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.DOWN ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.DOWN ), block.getIcon( ForgeDirection.DOWN.ordinal(), meta ) ) ); tess.draw(); } @@ -328,7 +328,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.UP ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.UP ), block.getIcon( ForgeDirection.UP.ordinal(), meta ) ) ); tess.draw(); } @@ -343,7 +343,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.NORTH ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.NORTH ), block.getIcon( ForgeDirection.NORTH.ordinal(), meta ) ) ); tess.draw(); } @@ -358,7 +358,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.SOUTH ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.SOUTH ), block.getIcon( ForgeDirection.SOUTH.ordinal(), meta ) ) ); tess.draw(); } @@ -373,7 +373,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.WEST ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.WEST ), block.getIcon( ForgeDirection.WEST.ordinal(), meta ) ) ); tess.draw(); } @@ -388,7 +388,7 @@ public class BaseBlockRender 0.0D, 0.0D, 0.0D, - firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.EAST ), + this.firstNotNull( renderer.overrideBlockTexture, block.getRendererInstance().getTexture( ForgeDirection.EAST ), block.getIcon( ForgeDirection.EAST.ordinal(), meta ) ) ); tess.draw(); } @@ -419,7 +419,7 @@ public class BaseBlockRender getOrientation( ForgeDirection.SOUTH, ForgeDirection.SOUTH, ForgeDirection.UP ) ); } - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), block, item, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), block, item, tess, 0xffffff, renderer ); if ( block.hasSubtypes() ) info.setTemporaryRenderIcon( null ); @@ -442,7 +442,7 @@ public class BaseBlockRender ForgeDirection up = ForgeDirection.UP; BlockRenderInfo info = block.getRendererInstance(); - IOrientable te = getOrientable( block, world, x, y, z ); + IOrientable te = this.getOrientable( block, world, x, y, z ); if ( te != null ) { forward = te.getForward(); @@ -467,11 +467,11 @@ public class BaseBlockRender public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer) { - preRenderInWorld( block, world, x, y, z, renderer ); + this.preRenderInWorld( block, world, x, y, z, renderer ); boolean o = renderer.renderStandardBlock( block, x, y, z ); - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return o; } @@ -489,27 +489,27 @@ public class BaseBlockRender ForgeDirection west = Platform.crossProduct( forward, up ); - rotMat.put( 0, west.offsetX ); - rotMat.put( 1, west.offsetY ); - rotMat.put( 2, west.offsetZ ); - rotMat.put( 3, 0 ); + this.rotMat.put( 0, west.offsetX ); + this.rotMat.put( 1, west.offsetY ); + this.rotMat.put( 2, west.offsetZ ); + this.rotMat.put( 3, 0 ); - rotMat.put( 4, up.offsetX ); - rotMat.put( 5, up.offsetY ); - rotMat.put( 6, up.offsetZ ); - rotMat.put( 7, 0 ); + this.rotMat.put( 4, up.offsetX ); + this.rotMat.put( 5, up.offsetY ); + this.rotMat.put( 6, up.offsetZ ); + this.rotMat.put( 7, 0 ); - rotMat.put( 8, forward.offsetX ); - rotMat.put( 9, forward.offsetY ); - rotMat.put( 10, forward.offsetZ ); - rotMat.put( 11, 0 ); + this.rotMat.put( 8, forward.offsetX ); + this.rotMat.put( 9, forward.offsetY ); + this.rotMat.put( 10, forward.offsetZ ); + this.rotMat.put( 11, 0 ); - rotMat.put( 12, 0 ); - rotMat.put( 13, 0 ); - rotMat.put( 14, 0 ); - rotMat.put( 15, 1 ); + this.rotMat.put( 12, 0 ); + this.rotMat.put( 13, 0 ); + this.rotMat.put( 14, 0 ); + this.rotMat.put( 15, 1 ); GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 ); - GL11.glMultMatrix( rotMat ); + GL11.glMultMatrix( this.rotMat ); GL11.glTranslated( -0.5, -0.5, -0.5 ); GL11.glCullFace( GL11.GL_FRONT ); } @@ -663,25 +663,25 @@ public class BaseBlockRender offsetY += y; offsetZ += z; - renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, + this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, // v -> v 0, edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, + this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0.0, edgeThickness, // v -> v edgeThickness, 1.0 - edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, + this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 1.0 - edgeThickness, 1.0, // v -> v edgeThickness, 1.0 - edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, + this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, // v -> v @@ -721,13 +721,13 @@ public class BaseBlockRender v1 = 16 - v1; v2 = 16 - v2; - double minX = (forward.offsetX > 0 ? 1 : 0) + mapFaceUV( west.offsetX, u1 ) + mapFaceUV( up.offsetX, v1 ); - double minY = (forward.offsetY > 0 ? 1 : 0) + mapFaceUV( west.offsetY, u1 ) + mapFaceUV( up.offsetY, v1 ); - double minZ = (forward.offsetZ > 0 ? 1 : 0) + mapFaceUV( west.offsetZ, u1 ) + mapFaceUV( up.offsetZ, v1 ); + double minX = (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV( west.offsetX, u1 ) + this.mapFaceUV( up.offsetX, v1 ); + double minY = (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV( west.offsetY, u1 ) + this.mapFaceUV( up.offsetY, v1 ); + double minZ = (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV( west.offsetZ, u1 ) + this.mapFaceUV( up.offsetZ, v1 ); - double maxX = (forward.offsetX > 0 ? 1 : 0) + mapFaceUV( west.offsetX, u2 ) + mapFaceUV( up.offsetX, v2 ); - double maxY = (forward.offsetY > 0 ? 1 : 0) + mapFaceUV( west.offsetY, u2 ) + mapFaceUV( up.offsetY, v2 ); - double maxZ = (forward.offsetZ > 0 ? 1 : 0) + mapFaceUV( west.offsetZ, u2 ) + mapFaceUV( up.offsetZ, v2 ); + double maxX = (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV( west.offsetX, u2 ) + this.mapFaceUV( up.offsetX, v2 ); + double maxY = (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV( west.offsetY, u2 ) + this.mapFaceUV( up.offsetY, v2 ); + double maxZ = (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV( west.offsetZ, u2 ) + this.mapFaceUV( up.offsetZ, v2 ); renderer.renderMinX = Math.max( 0.0, Math.min( minX, maxX ) - (forward.offsetX != 0 ? 0 : 0.001) ); renderer.renderMaxX = Math.min( 1.0, Math.max( minX, maxX ) + (forward.offsetX != 0 ? 0 : 0.001) ); @@ -757,7 +757,7 @@ public class BaseBlockRender renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; - applyTESRRotation( x, y, z, forward, up ); + this.applyTESRRotation( x, y, z, forward, up ); Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture ); RenderHelper.disableStandardItemLighting(); diff --git a/src/main/java/appeng/client/render/BlockRenderInfo.java b/src/main/java/appeng/client/render/BlockRenderInfo.java index e1873cf66..e99562560 100644 --- a/src/main/java/appeng/client/render/BlockRenderInfo.java +++ b/src/main/java/appeng/client/render/BlockRenderInfo.java @@ -27,7 +27,7 @@ public class BlockRenderInfo { public BlockRenderInfo(BaseBlockRender inst) { - rendererInstance = inst; + this.rendererInstance = inst; } final public BaseBlockRender rendererInstance; @@ -49,60 +49,60 @@ public class BlockRenderInfo public void updateIcons(FlippableIcon Bottom, FlippableIcon Top, FlippableIcon North, FlippableIcon South, FlippableIcon East, FlippableIcon West) { - topIcon = Top; - bottomIcon = Bottom; - southIcon = South; - northIcon = North; - eastIcon = East; - westIcon = West; + this.topIcon = Top; + this.bottomIcon = Bottom; + this.southIcon = South; + this.northIcon = North; + this.eastIcon = East; + this.westIcon = West; } public void setTemporaryRenderIcon(IIcon IIcon) { if ( IIcon == null ) - useTmp = false; + this.useTmp = false; else { - useTmp = true; - tmpTopIcon.setOriginal( IIcon ); - tmpBottomIcon.setOriginal( IIcon ); - tmpSouthIcon.setOriginal( IIcon ); - tmpNorthIcon.setOriginal( IIcon ); - tmpEastIcon.setOriginal( IIcon ); - tmpWestIcon.setOriginal( IIcon ); + this.useTmp = true; + this.tmpTopIcon.setOriginal( IIcon ); + this.tmpBottomIcon.setOriginal( IIcon ); + this.tmpSouthIcon.setOriginal( IIcon ); + this.tmpNorthIcon.setOriginal( IIcon ); + this.tmpEastIcon.setOriginal( IIcon ); + this.tmpWestIcon.setOriginal( IIcon ); } } public void setTemporaryRenderIcons(IIcon nTopIcon, IIcon nBottomIcon, IIcon nSouthIcon, IIcon nNorthIcon, IIcon nEastIcon, IIcon nWestIcon) { - tmpTopIcon.setOriginal( nTopIcon == null ? getTexture( ForgeDirection.UP ) : nTopIcon ); - tmpBottomIcon.setOriginal( nBottomIcon == null ? getTexture( ForgeDirection.DOWN ) : nBottomIcon ); - tmpSouthIcon.setOriginal( nSouthIcon == null ? getTexture( ForgeDirection.SOUTH ) : nSouthIcon ); - tmpNorthIcon.setOriginal( nNorthIcon == null ? getTexture( ForgeDirection.NORTH ) : nNorthIcon ); - tmpEastIcon.setOriginal( nEastIcon == null ? getTexture( ForgeDirection.EAST ) : nEastIcon ); - tmpWestIcon.setOriginal( nWestIcon == null ? getTexture( ForgeDirection.WEST ) : nWestIcon ); - useTmp = true; + this.tmpTopIcon.setOriginal( nTopIcon == null ? this.getTexture( ForgeDirection.UP ) : nTopIcon ); + this.tmpBottomIcon.setOriginal( nBottomIcon == null ? this.getTexture( ForgeDirection.DOWN ) : nBottomIcon ); + this.tmpSouthIcon.setOriginal( nSouthIcon == null ? this.getTexture( ForgeDirection.SOUTH ) : nSouthIcon ); + this.tmpNorthIcon.setOriginal( nNorthIcon == null ? this.getTexture( ForgeDirection.NORTH ) : nNorthIcon ); + this.tmpEastIcon.setOriginal( nEastIcon == null ? this.getTexture( ForgeDirection.EAST ) : nEastIcon ); + this.tmpWestIcon.setOriginal( nWestIcon == null ? this.getTexture( ForgeDirection.WEST ) : nWestIcon ); + this.useTmp = true; } public FlippableIcon getTexture(ForgeDirection dir) { - if ( useTmp ) + if ( this.useTmp ) { switch (dir) { case DOWN: - return tmpBottomIcon; + return this.tmpBottomIcon; case UP: - return tmpTopIcon; + return this.tmpTopIcon; case NORTH: - return tmpNorthIcon; + return this.tmpNorthIcon; case SOUTH: - return tmpSouthIcon; + return this.tmpSouthIcon; case EAST: - return tmpEastIcon; + return this.tmpEastIcon; case WEST: - return tmpWestIcon; + return this.tmpWestIcon; default: break; } @@ -111,27 +111,27 @@ public class BlockRenderInfo switch (dir) { case DOWN: - return bottomIcon; + return this.bottomIcon; case UP: - return topIcon; + return this.topIcon; case NORTH: - return northIcon; + return this.northIcon; case SOUTH: - return southIcon; + return this.southIcon; case EAST: - return eastIcon; + return this.eastIcon; case WEST: - return westIcon; + return this.westIcon; default: break; } - return topIcon; + return this.topIcon; } public boolean isValid() { - return topIcon != null && bottomIcon != null && southIcon != null && northIcon != null && eastIcon != null && westIcon != null; + return this.topIcon != null && this.bottomIcon != null && this.southIcon != null && this.northIcon != null && this.eastIcon != null && this.westIcon != null; } } diff --git a/src/main/java/appeng/client/render/BusRenderHelper.java b/src/main/java/appeng/client/render/BusRenderHelper.java index 9760d1178..2afa185d1 100644 --- a/src/main/java/appeng/client/render/BusRenderHelper.java +++ b/src/main/java/appeng/client/render/BusRenderHelper.java @@ -75,7 +75,7 @@ public class BusRenderHelper implements IPartRenderHelper @Override public void addBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { - if ( started ) + if ( this.started ) { this.minX = Math.min( this.minX, (float) minX ); this.minY = Math.min( this.minY, (float) minY ); @@ -86,7 +86,7 @@ public class BusRenderHelper implements IPartRenderHelper } else { - started = true; + this.started = true; this.minX = (float) minX; this.minY = (float) minY; this.minZ = (float) minZ; @@ -99,19 +99,19 @@ public class BusRenderHelper implements IPartRenderHelper @Override public ForgeDirection getWorldX() { - return ax; + return BusRenderHelper.this.ax; } @Override public ForgeDirection getWorldY() { - return ay; + return BusRenderHelper.this.ay; } @Override public ForgeDirection getWorldZ() { - return az; + return BusRenderHelper.this.az; } @Override @@ -131,27 +131,27 @@ public class BusRenderHelper implements IPartRenderHelper public int getItemsRendered() { - return itemsRendered; + return this.itemsRendered; } public void setPass(int pass) { - renderingForPass = 0; - currentPass = pass; - itemsRendered = 0; + this.renderingForPass = 0; + this.currentPass = pass; + this.itemsRendered = 0; } @Override public void renderForPass(int pass) { - renderingForPass = pass; + this.renderingForPass = pass; } public boolean renderThis() { - if ( renderingForPass == currentPass || noAlphaPass ) + if ( this.renderingForPass == this.currentPass || this.noAlphaPass ) { - itemsRendered++; + this.itemsRendered++; return true; } return false; @@ -171,7 +171,7 @@ public class BusRenderHelper implements IPartRenderHelper { RenderBlocksWorkaround rbw = BusRenderer.instance.renderer; - if ( sim != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, sim ) ) + if ( sim != null && rbw.similarLighting( this.blk, rbw.blockAccess, x, y, z, sim ) ) { rbw.populate( sim ); rbw.faces = EnumSet.allOf( ForgeDirection.class ); @@ -187,35 +187,35 @@ public class BusRenderHelper implements IPartRenderHelper rbw.calculations = true; rbw.faces.clear(); - bbc.started = false; + this.bbc.started = false; if ( p == null ) { - bbc.minX = bbc.minY = bbc.minZ = 0; - bbc.maxX = bbc.maxY = bbc.maxZ = 16; + this.bbc.minX = this.bbc.minY = this.bbc.minZ = 0; + this.bbc.maxX = this.bbc.maxY = this.bbc.maxZ = 16; } else { - p.getBoxes( bbc ); + p.getBoxes( this.bbc ); - if ( bbc.minX < 1 ) - bbc.minX = 1; - if ( bbc.minY < 1 ) - bbc.minY = 1; - if ( bbc.minZ < 1 ) - bbc.minZ = 1; + if ( this.bbc.minX < 1 ) + this.bbc.minX = 1; + if ( this.bbc.minY < 1 ) + this.bbc.minY = 1; + if ( this.bbc.minZ < 1 ) + this.bbc.minZ = 1; - if ( bbc.maxX > 15 ) - bbc.maxX = 15; - if ( bbc.maxY > 15 ) - bbc.maxY = 15; - if ( bbc.maxZ > 15 ) - bbc.maxZ = 15; + if ( this.bbc.maxX > 15 ) + this.bbc.maxX = 15; + if ( this.bbc.maxY > 15 ) + this.bbc.maxY = 15; + if ( this.bbc.maxZ > 15 ) + this.bbc.maxZ = 15; } - setBounds( bbc.minX, bbc.minY, bbc.minZ, bbc.maxX, bbc.maxY, bbc.maxZ ); + this.setBounds( this.bbc.minX, this.bbc.minY, this.bbc.minZ, this.bbc.maxX, this.bbc.maxY, this.bbc.maxZ ); - bbr.renderBlockBounds( rbw, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az ); - rbw.renderStandardBlock( blk, x, y, z ); + this.bbr.renderBlockBounds( rbw, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); + rbw.renderStandardBlock( this.blk, x, y, z ); rbw.faces = EnumSet.allOf( ForgeDirection.class ); rbw.renderAllFaces = allFaces; @@ -245,17 +245,17 @@ public class BusRenderHelper implements IPartRenderHelper case UNKNOWN: return 0.5; case DOWN: - return minY; + return this.minY; case EAST: - return maxX; + return this.maxX; case NORTH: - return minZ; + return this.minZ; case SOUTH: - return maxZ; + return this.maxZ; case UP: - return maxY; + return this.maxY; case WEST: - return minX; + return this.minX; } } @@ -263,13 +263,13 @@ public class BusRenderHelper implements IPartRenderHelper @Override public void setInvColor(int newColor) { - color = newColor; + this.color = newColor; } @Override public void setTexture(IIcon ico) { - blk.getRendererInstance().setTemporaryRenderIcon( ico ); + this.blk.getRendererInstance().setTemporaryRenderIcon( ico ); } @Override @@ -284,16 +284,16 @@ public class BusRenderHelper implements IPartRenderHelper list[4] = West; list[5] = East; - blk.getRendererInstance().setTemporaryRenderIcons( list[mapRotation( ForgeDirection.UP ).ordinal()], - list[mapRotation( ForgeDirection.DOWN ).ordinal()], list[mapRotation( ForgeDirection.SOUTH ).ordinal()], - list[mapRotation( ForgeDirection.NORTH ).ordinal()], list[mapRotation( ForgeDirection.EAST ).ordinal()], - list[mapRotation( ForgeDirection.WEST ).ordinal()] ); + this.blk.getRendererInstance().setTemporaryRenderIcons( list[this.mapRotation( ForgeDirection.UP ).ordinal()], + list[this.mapRotation( ForgeDirection.DOWN ).ordinal()], list[this.mapRotation( ForgeDirection.SOUTH ).ordinal()], + list[this.mapRotation( ForgeDirection.NORTH ).ordinal()], list[this.mapRotation( ForgeDirection.EAST ).ordinal()], + list[this.mapRotation( ForgeDirection.WEST ).ordinal()] ); } public ForgeDirection mapRotation(ForgeDirection dir) { - ForgeDirection forward = az; - ForgeDirection up = ay; + ForgeDirection forward = this.az; + ForgeDirection up = this.ay; ForgeDirection west = ForgeDirection.UNKNOWN; if ( forward == null || up == null ) @@ -328,22 +328,22 @@ public class BusRenderHelper implements IPartRenderHelper @Override public void renderInventoryBox(RenderBlocks renderer) { - renderer.setRenderBounds( minX / 16.0, minY / 16.0, minZ / 16.0, maxX / 16.0, maxY / 16.0, maxZ / 16.0 ); - bbr.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, null, Tessellator.instance, color, renderer ); + renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); + this.bbr.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), this.blk, null, Tessellator.instance, this.color, renderer ); } @Override public void renderInventoryFace(IIcon IIcon, ForgeDirection face, RenderBlocks renderer) { - renderer.setRenderBounds( minX / 16.0, minY / 16.0, minZ / 16.0, maxX / 16.0, maxY / 16.0, maxZ / 16.0 ); - setTexture( IIcon ); - bbr.renderInvBlock( EnumSet.of( face ), blk, null, Tessellator.instance, color, renderer ); + renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); + this.setTexture( IIcon ); + this.bbr.renderInvBlock( EnumSet.of( face ), this.blk, null, Tessellator.instance, this.color, renderer ); } @Override public void renderBlock(int x, int y, int z, RenderBlocks renderer) { - if ( !renderThis() ) + if ( !this.renderThis() ) return; AEBaseBlock blk = (AEBaseBlock) AEApi.instance().blocks().blockMultiPart.block(); @@ -360,7 +360,7 @@ public class BusRenderHelper implements IPartRenderHelper renderer.uvRotateNorth = info.getTexture( ForgeDirection.NORTH ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.NORTH, forward, up ) ); renderer.uvRotateSouth = info.getTexture( ForgeDirection.SOUTH ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.SOUTH, forward, up ) ); - bbr.renderBlockBounds( renderer, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az ); + this.bbr.renderBlockBounds( renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); renderer.renderStandardBlock( blk, x, y, z ); } @@ -379,7 +379,7 @@ public class BusRenderHelper implements IPartRenderHelper public void prepareBounds(RenderBlocks renderer) { - bbr.renderBlockBounds( renderer, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az ); + this.bbr.renderBlockBounds( renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); } @Override @@ -391,37 +391,37 @@ public class BusRenderHelper implements IPartRenderHelper @Override public void renderBlockCurrentBounds(int x, int y, int z, RenderBlocks renderer) { - if ( !renderThis() ) + if ( !this.renderThis() ) return; - renderer.renderStandardBlock( blk, x, y, z ); + renderer.renderStandardBlock( this.blk, x, y, z ); } @Override public void renderFaceCutout(int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, RenderBlocks renderer) { - if ( !renderThis() ) + if ( !this.renderThis() ) return; switch (face) { case DOWN: - face = ay.getOpposite(); + face = this.ay.getOpposite(); break; case EAST: - face = ax; + face = this.ax; break; case NORTH: - face = az.getOpposite(); + face = this.az.getOpposite(); break; case SOUTH: - face = az; + face = this.az; break; case UP: - face = ay; + face = this.ay; break; case WEST: - face = ax.getOpposite(); + face = this.ax.getOpposite(); break; case UNKNOWN: break; @@ -429,35 +429,35 @@ public class BusRenderHelper implements IPartRenderHelper break; } - bbr.renderCutoutFace( blk, ico, x, y, z, renderer, face, edgeThickness ); + this.bbr.renderCutoutFace( this.blk, ico, x, y, z, renderer, face, edgeThickness ); } @Override public void renderFace(int x, int y, int z, IIcon ico, ForgeDirection face, RenderBlocks renderer) { - if ( !renderThis() ) + if ( !this.renderThis() ) return; - prepareBounds( renderer ); + this.prepareBounds( renderer ); switch (face) { case DOWN: - face = ay.getOpposite(); + face = this.ay.getOpposite(); break; case EAST: - face = ax; + face = this.ax; break; case NORTH: - face = az.getOpposite(); + face = this.az.getOpposite(); break; case SOUTH: - face = az; + face = this.az; break; case UP: - face = ay; + face = this.ay; break; case WEST: - face = ax.getOpposite(); + face = this.ax.getOpposite(); break; case UNKNOWN: break; @@ -465,37 +465,37 @@ public class BusRenderHelper implements IPartRenderHelper break; } - bbr.renderFace( x, y, z, blk, ico, renderer, face ); + this.bbr.renderFace( x, y, z, this.blk, ico, renderer, face ); } @Override public ForgeDirection getWorldX() { - return ax; + return this.ax; } @Override public ForgeDirection getWorldY() { - return ay; + return this.ay; } @Override public ForgeDirection getWorldZ() { - return az; + return this.az; } public void setOrientation(ForgeDirection dx, ForgeDirection dy, ForgeDirection dz) { - ax = dx == null ? ForgeDirection.EAST : dx; - ay = dy == null ? ForgeDirection.UP : dy; - az = dz == null ? ForgeDirection.SOUTH : dz; + this.ax = dx == null ? ForgeDirection.EAST : dx; + this.ay = dy == null ? ForgeDirection.UP : dy; + this.az = dz == null ? ForgeDirection.SOUTH : dz; } public double[] getBounds() { - return new double[] { minX, minY, minZ, maxX, maxY, maxZ }; + return new double[] { this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ }; } public void setBounds(double[] bounds) @@ -503,12 +503,12 @@ public class BusRenderHelper implements IPartRenderHelper if ( bounds == null || bounds.length != 6 ) return; - minX = bounds[0]; - minY = bounds[1]; - minZ = bounds[2]; - maxX = bounds[3]; - maxY = bounds[4]; - maxZ = bounds[5]; + this.minX = bounds[0]; + this.minY = bounds[1]; + this.minZ = bounds[2]; + this.maxX = bounds[3]; + this.maxY = bounds[4]; + this.maxZ = bounds[5]; } } diff --git a/src/main/java/appeng/client/render/BusRenderer.java b/src/main/java/appeng/client/render/BusRenderer.java index edec6b5c3..e473f61e6 100644 --- a/src/main/java/appeng/client/render/BusRenderer.java +++ b/src/main/java/appeng/client/render/BusRenderer.java @@ -128,13 +128,13 @@ public class BusRenderer implements IItemRenderer BusRenderHelper.instance.setBounds( 0, 0, 0, 1, 1, 1 ); BusRenderHelper.instance.setTexture( null ); BusRenderHelper.instance.setInvColor( 0xffffff ); - renderer.blockAccess = ClientHelper.proxy.getWorld(); + this.renderer.blockAccess = ClientHelper.proxy.getWorld(); BusRenderHelper.instance.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - renderer.useInventoryTint = false; - renderer.overrideBlockTexture = null; + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; + this.renderer.useInventoryTint = false; + this.renderer.overrideBlockTexture = null; if ( item.getItem() instanceof IFacadeItem ) { @@ -148,11 +148,11 @@ public class BusRenderer implements IItemRenderer } if ( fp != null ) - fp.renderInventory( BusRenderHelper.instance, renderer ); + fp.renderInventory( BusRenderHelper.instance, this.renderer ); } else { - IPart ip = getRenderer( item, (IPartItem) item.getItem() ); + IPart ip = this.getRenderer( item, (IPartItem) item.getItem() ); if ( ip != null ) { if ( type == ItemRenderType.ENTITY ) @@ -161,11 +161,11 @@ public class BusRenderer implements IItemRenderer GL11.glTranslatef( 0.0f, 0.0f, -0.04f * (8 - depth) - 0.06f ); } - ip.renderInventory( BusRenderHelper.instance, renderer ); + ip.renderInventory( BusRenderHelper.instance, this.renderer ); } } - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; GL11.glPopAttrib(); GL11.glPopMatrix(); diff --git a/src/main/java/appeng/client/render/CableRenderHelper.java b/src/main/java/appeng/client/render/CableRenderHelper.java index 46ae0be40..df0798757 100644 --- a/src/main/java/appeng/client/render/CableRenderHelper.java +++ b/src/main/java/appeng/client/render/CableRenderHelper.java @@ -105,7 +105,7 @@ public class CableRenderHelper IPart part = cableBusContainer.getPart( s ); if ( part != null ) { - setSide( s ); + this.setSide( s ); renderer.renderAllFaces = true; renderer.flipTexture = false; @@ -130,7 +130,7 @@ public class CableRenderHelper IPart part = cableBusContainer.getPart( s ); if ( part != null ) { - setSide( s ); + this.setSide( s ); BusRenderHelper brh = BusRenderHelper.instance; BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true ); part.getBoxes( bch ); @@ -184,7 +184,7 @@ public class CableRenderHelper renderer.flipTexture = false; renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - setSide( s ); + this.setSide( s ); fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer, iFacadeContainer, b, cableBusContainer.getPart( s ) == null ); } diff --git a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java index 534b6c803..a28cfc6b9 100644 --- a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java +++ b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java @@ -77,71 +77,71 @@ public class RenderBlocksWorkaround extends RenderBlocks public int lightHash; public LightingCache(LightingCache secondCSrc) { - rXPos = secondCSrc.rXPos; - rXNeg = secondCSrc.rXNeg; - rYPos = secondCSrc.rYPos; - rYNeg = secondCSrc.rYNeg; - rZPos = secondCSrc.rZPos; - rZNeg = secondCSrc.rZNeg; + this.rXPos = secondCSrc.rXPos; + this.rXNeg = secondCSrc.rXNeg; + this.rYPos = secondCSrc.rYPos; + this.rYNeg = secondCSrc.rYNeg; + this.rZPos = secondCSrc.rZPos; + this.rZNeg = secondCSrc.rZNeg; - isAO = secondCSrc.isAO; + this.isAO = secondCSrc.isAO; - bXPos = secondCSrc.bXPos; - bXNeg = secondCSrc.bXNeg; - bYPos = secondCSrc.bYPos; - bYNeg = secondCSrc.bYNeg; - bZPos = secondCSrc.bZPos; - bZNeg = secondCSrc.bZNeg; + this.bXPos = secondCSrc.bXPos; + this.bXNeg = secondCSrc.bXNeg; + this.bYPos = secondCSrc.bYPos; + this.bYNeg = secondCSrc.bYNeg; + this.bZPos = secondCSrc.bZPos; + this.bZNeg = secondCSrc.bZNeg; - aoXPos = secondCSrc.aoXPos.clone(); - aoXNeg = secondCSrc.aoXNeg.clone(); - aoYPos = secondCSrc.aoYPos.clone(); - aoYNeg = secondCSrc.aoYNeg.clone(); - aoZPos = secondCSrc.aoZPos.clone(); - aoZNeg = secondCSrc.aoZNeg.clone(); + this.aoXPos = secondCSrc.aoXPos.clone(); + this.aoXNeg = secondCSrc.aoXNeg.clone(); + this.aoYPos = secondCSrc.aoYPos.clone(); + this.aoYNeg = secondCSrc.aoYNeg.clone(); + this.aoZPos = secondCSrc.aoZPos.clone(); + this.aoZNeg = secondCSrc.aoZNeg.clone(); - foXPos = secondCSrc.foXPos.clone(); - foXNeg = secondCSrc.foXNeg.clone(); - foYPos = secondCSrc.foYPos.clone(); - foYNeg = secondCSrc.foYNeg.clone(); - foZPos = secondCSrc.foZPos.clone(); - foZNeg = secondCSrc.foZNeg.clone(); + this.foXPos = secondCSrc.foXPos.clone(); + this.foXNeg = secondCSrc.foXNeg.clone(); + this.foYPos = secondCSrc.foYPos.clone(); + this.foYNeg = secondCSrc.foYNeg.clone(); + this.foZPos = secondCSrc.foZPos.clone(); + this.foZNeg = secondCSrc.foZNeg.clone(); - lightHash = secondCSrc.lightHash; + this.lightHash = secondCSrc.lightHash; } public LightingCache() { - rXPos = null; - rXNeg = null; - rYPos = null; - rYNeg = null; - rZPos = null; - rZNeg = null; + this.rXPos = null; + this.rXNeg = null; + this.rYPos = null; + this.rYNeg = null; + this.rZPos = null; + this.rZNeg = null; - isAO = false; + this.isAO = false; - bXPos = 0; - bXNeg = 0; - bYPos = 0; - bYNeg = 0; - bZPos = 0; - bZNeg = 0; + this.bXPos = 0; + this.bXNeg = 0; + this.bYPos = 0; + this.bYNeg = 0; + this.bZPos = 0; + this.bZNeg = 0; - aoXPos = new int[5]; - aoXNeg = new int[5]; - aoYPos = new int[5]; - aoYNeg = new int[5]; - aoZPos = new int[5]; - aoZNeg = new int[5]; + this.aoXPos = new int[5]; + this.aoXNeg = new int[5]; + this.aoYPos = new int[5]; + this.aoYNeg = new int[5]; + this.aoZPos = new int[5]; + this.aoZNeg = new int[5]; - foXPos = new float[12]; - foXNeg = new float[12]; - foYPos = new float[12]; - foYNeg = new float[12]; - foZPos = new float[12]; - foZNeg = new float[12]; + this.foXPos = new float[12]; + this.foXNeg = new float[12]; + this.foYPos = new float[12]; + this.foYNeg = new float[12]; + this.foZPos = new float[12]; + this.foZNeg = new float[12]; - lightHash = 0; + this.lightHash = 0; } } @@ -158,19 +158,19 @@ public class RenderBlocksWorkaround extends RenderBlocks { try { - if ( fColor == null ) + if ( this.fColor == null ) { try { - fColor = Tessellator.class.getDeclaredField( "color" ); + this.fColor = Tessellator.class.getDeclaredField( "color" ); } catch (Throwable t) { - fColor = Tessellator.class.getDeclaredField( "field_78402_m" ); + this.fColor = Tessellator.class.getDeclaredField( "field_78402_m" ); } - fColor.setAccessible( true ); + this.fColor.setAccessible( true ); } - return (Integer) fColor.get( Tessellator.instance ); + return (Integer) this.fColor.get( Tessellator.instance ); } catch (Throwable t) { @@ -182,19 +182,19 @@ public class RenderBlocksWorkaround extends RenderBlocks { try { - if ( fBrightness == null ) + if ( this.fBrightness == null ) { try { - fBrightness = Tessellator.class.getDeclaredField( "brightness" ); + this.fBrightness = Tessellator.class.getDeclaredField( "brightness" ); } catch (Throwable t) { - fBrightness = Tessellator.class.getDeclaredField( "field_78401_l" ); + this.fBrightness = Tessellator.class.getDeclaredField( "field_78401_l" ); } - fBrightness.setAccessible( true ); + this.fBrightness.setAccessible( true ); } - return (Integer) fBrightness.get( Tessellator.instance ); + return (Integer) this.fBrightness.get( Tessellator.instance ); } catch (Throwable t) { @@ -204,90 +204,90 @@ public class RenderBlocksWorkaround extends RenderBlocks public void setTexture(IIcon ico) { - lightState.rXPos = lightState.rXNeg = lightState.rYPos = lightState.rYNeg = lightState.rZPos = lightState.rZNeg = ico; + this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico; } public void setTexture(IIcon rYNeg, IIcon rYPos, IIcon rZNeg, IIcon rZPos, IIcon rXNeg, IIcon rXPos) { - lightState.rXPos = rXPos; - lightState.rXNeg = rXNeg; - lightState.rYPos = rYPos; - lightState.rYNeg = rYNeg; - lightState.rZPos = rZPos; - lightState.rZNeg = rZNeg; + this.lightState.rXPos = rXPos; + this.lightState.rXNeg = rXNeg; + this.lightState.rYPos = rYPos; + this.lightState.rYNeg = rYNeg; + this.lightState.rZPos = rZPos; + this.lightState.rZNeg = rZNeg; } public boolean renderStandardBlockNoCalculations(Block b, int x, int y, int z) { - Tessellator.instance.setBrightness( lightState.bXPos ); - restoreAO( lightState.aoXPos, lightState.foXPos ); - renderFaceXPos( b, x, y, z, useTextures ? lightState.rXPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bXPos ); + this.restoreAO( this.lightState.aoXPos, this.lightState.foXPos ); + this.renderFaceXPos( b, x, y, z, this.useTextures ? this.lightState.rXPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) ); - Tessellator.instance.setBrightness( lightState.bXNeg ); - restoreAO( lightState.aoXNeg, lightState.foXNeg ); - renderFaceXNeg( b, x, y, z, useTextures ? lightState.rXNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bXNeg ); + this.restoreAO( this.lightState.aoXNeg, this.lightState.foXNeg ); + this.renderFaceXNeg( b, x, y, z, this.useTextures ? this.lightState.rXNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) ); - Tessellator.instance.setBrightness( lightState.bYPos ); - restoreAO( lightState.aoYPos, lightState.foYPos ); - renderFaceYPos( b, x, y, z, useTextures ? lightState.rYPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bYPos ); + this.restoreAO( this.lightState.aoYPos, this.lightState.foYPos ); + this.renderFaceYPos( b, x, y, z, this.useTextures ? this.lightState.rYPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) ); - Tessellator.instance.setBrightness( lightState.bYNeg ); - restoreAO( lightState.aoYNeg, lightState.foYNeg ); - renderFaceYNeg( b, x, y, z, useTextures ? lightState.rYNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bYNeg ); + this.restoreAO( this.lightState.aoYNeg, this.lightState.foYNeg ); + this.renderFaceYNeg( b, x, y, z, this.useTextures ? this.lightState.rYNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) ); - Tessellator.instance.setBrightness( lightState.bZPos ); - restoreAO( lightState.aoZPos, lightState.foZPos ); - renderFaceZPos( b, x, y, z, useTextures ? lightState.rZPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bZPos ); + this.restoreAO( this.lightState.aoZPos, this.lightState.foZPos ); + this.renderFaceZPos( b, x, y, z, this.useTextures ? this.lightState.rZPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) ); - Tessellator.instance.setBrightness( lightState.bZNeg ); - restoreAO( lightState.aoZNeg, lightState.foZNeg ); - renderFaceZNeg( b, x, y, z, useTextures ? lightState.rZNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) ); + Tessellator.instance.setBrightness( this.lightState.bZNeg ); + this.restoreAO( this.lightState.aoZNeg, this.lightState.foZNeg ); + this.renderFaceZNeg( b, x, y, z, this.useTextures ? this.lightState.rZNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) ); return true; } private void restoreAO(int[] z, float[] c) { - brightnessBottomLeft = z[0]; - brightnessBottomRight = z[1]; - brightnessTopLeft = z[2]; - brightnessTopRight = z[3]; - Tessellator.instance.setColorRGBA_I( z[4], (int) (opacity * 255) ); + this.brightnessBottomLeft = z[0]; + this.brightnessBottomRight = z[1]; + this.brightnessTopLeft = z[2]; + this.brightnessTopRight = z[3]; + Tessellator.instance.setColorRGBA_I( z[4], (int) (this.opacity * 255) ); - colorRedTopLeft = c[0]; - colorGreenTopLeft = c[1]; - colorBlueTopLeft = c[2]; - colorRedBottomLeft = c[3]; - colorGreenBottomLeft = c[4]; - colorBlueBottomLeft = c[5]; - colorRedBottomRight = c[6]; - colorGreenBottomRight = c[7]; - colorBlueBottomRight = c[8]; - colorRedTopRight = c[9]; - colorGreenTopRight = c[10]; - colorBlueTopRight = c[11]; + this.colorRedTopLeft = c[0]; + this.colorGreenTopLeft = c[1]; + this.colorBlueTopLeft = c[2]; + this.colorRedBottomLeft = c[3]; + this.colorGreenBottomLeft = c[4]; + this.colorBlueBottomLeft = c[5]; + this.colorRedBottomRight = c[6]; + this.colorGreenBottomRight = c[7]; + this.colorBlueBottomRight = c[8]; + this.colorRedTopRight = c[9]; + this.colorGreenTopRight = c[10]; + this.colorBlueTopRight = c[11]; } private void saveAO(int[] z, float[] c) { - z[0] = brightnessBottomLeft; - z[1] = brightnessBottomRight; - z[2] = brightnessTopLeft; - z[3] = brightnessTopRight; - z[4] = getCurrentColor(); + z[0] = this.brightnessBottomLeft; + z[1] = this.brightnessBottomRight; + z[2] = this.brightnessTopLeft; + z[3] = this.brightnessTopRight; + z[4] = this.getCurrentColor(); - c[0] = colorRedTopLeft; - c[1] = colorGreenTopLeft; - c[2] = colorBlueTopLeft; - c[3] = colorRedBottomLeft; - c[4] = colorGreenBottomLeft; - c[5] = colorBlueBottomLeft; - c[6] = colorRedBottomRight; - c[7] = colorGreenBottomRight; - c[8] = colorBlueBottomRight; - c[9] = colorRedTopRight; - c[10] = colorGreenTopRight; - c[11] = colorBlueTopRight; + c[0] = this.colorRedTopLeft; + c[1] = this.colorGreenTopLeft; + c[2] = this.colorBlueTopLeft; + c[3] = this.colorRedBottomLeft; + c[4] = this.colorGreenBottomLeft; + c[5] = this.colorBlueBottomLeft; + c[6] = this.colorRedBottomRight; + c[7] = this.colorGreenBottomRight; + c[8] = this.colorBlueBottomRight; + c[9] = this.colorRedTopRight; + c[10] = this.colorGreenTopRight; + c[11] = this.colorBlueTopRight; } @Override @@ -295,16 +295,16 @@ public class RenderBlocksWorkaround extends RenderBlocks { try { - if ( calculations ) + if ( this.calculations ) { - lightState.lightHash = getLightingHash( blk, this.blockAccess, x, y, z ); + this.lightState.lightHash = this.getLightingHash( blk, this.blockAccess, x, y, z ); return super.renderStandardBlock( blk, x, y, z ); } else { - enableAO = lightState.isAO; - boolean out = renderStandardBlockNoCalculations( blk, x, y, z ); - enableAO = false; + this.enableAO = this.lightState.isAO; + boolean out = this.renderStandardBlockNoCalculations( blk, x, y, z ); + this.enableAO = false; return out; } } @@ -319,12 +319,12 @@ public class RenderBlocksWorkaround extends RenderBlocks @Override public void renderFaceXNeg(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.WEST ) ) + if ( this.faces.contains( ForgeDirection.WEST ) ) { - if ( !renderFaces.contains( ForgeDirection.WEST ) ) + if ( !this.renderFaces.contains( ForgeDirection.WEST ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -341,13 +341,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( renderMaxY, renderMaxZ ); + this.partialLightingColoring( this.renderMaxY, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d13, d15, d4, d5 ); - partialLightingColoring( renderMaxY, renderMinZ ); + this.partialLightingColoring( this.renderMaxY, this.renderMinZ ); tessellator.addVertexWithUV( d11, d13, d14, d3, d5 ); - partialLightingColoring( renderMinY, renderMinZ ); + this.partialLightingColoring( this.renderMinY, this.renderMinZ ); tessellator.addVertexWithUV( d11, d12, d14, d3, d6 ); - partialLightingColoring( renderMinY, renderMaxZ ); + this.partialLightingColoring( this.renderMinY, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d12, d15, d4, d6 ); } else @@ -363,22 +363,22 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rXNeg = par8Icon; - saveAO( lightState.aoXNeg, lightState.foXNeg ); - lightState.bXNeg = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rXNeg = par8Icon; + this.saveAO( this.lightState.aoXNeg, this.lightState.foXNeg ); + this.lightState.bXNeg = this.getCurrentBrightness(); } } @Override public void renderFaceXPos(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.EAST ) ) + if ( this.faces.contains( ForgeDirection.EAST ) ) { - if ( !renderFaces.contains( ForgeDirection.EAST ) ) + if ( !this.renderFaces.contains( ForgeDirection.EAST ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -395,13 +395,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( 1.0 - renderMinY, renderMaxZ ); + this.partialLightingColoring( 1.0 - this.renderMinY, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d12, d15, d4, d6 ); - partialLightingColoring( 1.0 - renderMinY, renderMinZ ); + this.partialLightingColoring( 1.0 - this.renderMinY, this.renderMinZ ); tessellator.addVertexWithUV( d11, d12, d14, d3, d6 ); - partialLightingColoring( 1.0 - renderMaxY, renderMinZ ); + this.partialLightingColoring( 1.0 - this.renderMaxY, this.renderMinZ ); tessellator.addVertexWithUV( d11, d13, d14, d3, d5 ); - partialLightingColoring( 1.0 - renderMaxY, renderMaxZ ); + this.partialLightingColoring( 1.0 - this.renderMaxY, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d13, d15, d4, d5 ); } else @@ -417,50 +417,50 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rXPos = par8Icon; - saveAO( lightState.aoXPos, lightState.foXPos ); - lightState.bXPos = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rXPos = par8Icon; + this.saveAO( this.lightState.aoXPos, this.lightState.foXPos ); + this.lightState.bXPos = this.getCurrentBrightness(); } } private void partialLightingColoring(double u, double v) { - double rA = colorRedTopLeft * u + (1.0 - u) * colorRedTopRight; - double rB = colorRedBottomLeft * u + (1.0 - u) * colorRedBottomRight; + double rA = this.colorRedTopLeft * u + (1.0 - u) * this.colorRedTopRight; + double rB = this.colorRedBottomLeft * u + (1.0 - u) * this.colorRedBottomRight; float r = (float) (rA * v + rB * (1.0 - v)); - double gA = colorGreenTopLeft * u + (1.0 - u) * colorGreenTopRight; - double gB = colorGreenBottomLeft * u + (1.0 - u) * colorGreenBottomRight; + double gA = this.colorGreenTopLeft * u + (1.0 - u) * this.colorGreenTopRight; + double gB = this.colorGreenBottomLeft * u + (1.0 - u) * this.colorGreenBottomRight; float g = (float) (gA * v + gB * (1.0 - v)); - double bA = colorBlueTopLeft * u + (1.0 - u) * colorBlueTopRight; - double bB = colorBlueBottomLeft * u + (1.0 - u) * colorBlueBottomRight; + double bA = this.colorBlueTopLeft * u + (1.0 - u) * this.colorBlueTopRight; + double bB = this.colorBlueBottomLeft * u + (1.0 - u) * this.colorBlueBottomRight; float b = (float) (bA * v + bB * (1.0 - v)); - double highA = (brightnessTopLeft >> 16 & 255) * u + (1.0 - u) * (brightnessTopRight >> 16 & 255); - double highB = (brightnessBottomLeft >> 16 & 255) * u + (1.0 - u) * (brightnessBottomRight >> 16 & 255); + double highA = (this.brightnessTopLeft >> 16 & 255) * u + (1.0 - u) * (this.brightnessTopRight >> 16 & 255); + double highB = (this.brightnessBottomLeft >> 16 & 255) * u + (1.0 - u) * (this.brightnessBottomRight >> 16 & 255); int high = ((int) (highA * v + highB * (1.0 - v))) & 255; - double lowA = ((brightnessTopLeft & 255)) * u + (1.0 - u) * ((brightnessTopRight & 255)); - double lowB = ((brightnessBottomLeft & 255)) * u + (1.0 - u) * ((brightnessBottomRight & 255)); + double lowA = ((this.brightnessTopLeft & 255)) * u + (1.0 - u) * ((this.brightnessTopRight & 255)); + double lowB = ((this.brightnessBottomLeft & 255)) * u + (1.0 - u) * ((this.brightnessBottomRight & 255)); int low = ((int) (lowA * v + lowB * (1.0 - v))) & 255; int out = (high << 16) | low; - Tessellator.instance.setColorRGBA_F( r, g, b, opacity ); + Tessellator.instance.setColorRGBA_F( r, g, b, this.opacity ); Tessellator.instance.setBrightness( out ); } @Override public void renderFaceYNeg(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.DOWN ) ) + if ( this.faces.contains( ForgeDirection.DOWN ) ) { - if ( !renderFaces.contains( ForgeDirection.DOWN ) ) + if ( !this.renderFaces.contains( ForgeDirection.DOWN ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -477,13 +477,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( 1.0 - renderMinX, renderMaxZ ); + this.partialLightingColoring( 1.0 - this.renderMinX, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d13, d15, d3, d6 ); - partialLightingColoring( 1.0 - renderMinX, renderMinZ ); + this.partialLightingColoring( 1.0 - this.renderMinX, this.renderMinZ ); tessellator.addVertexWithUV( d11, d13, d14, d3, d5 ); - partialLightingColoring( 1.0 - renderMaxX, renderMinZ ); + this.partialLightingColoring( 1.0 - this.renderMaxX, this.renderMinZ ); tessellator.addVertexWithUV( d12, d13, d14, d4, d5 ); - partialLightingColoring( 1.0 - renderMaxX, renderMaxZ ); + this.partialLightingColoring( 1.0 - this.renderMaxX, this.renderMaxZ ); tessellator.addVertexWithUV( d12, d13, d15, d4, d6 ); } else @@ -499,22 +499,22 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rYNeg = par8Icon; - saveAO( lightState.aoYNeg, lightState.foYNeg ); - lightState.bYNeg = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rYNeg = par8Icon; + this.saveAO( this.lightState.aoYNeg, this.lightState.foYNeg ); + this.lightState.bYNeg = this.getCurrentBrightness(); } } @Override public void renderFaceYPos(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.UP ) ) + if ( this.faces.contains( ForgeDirection.UP ) ) { - if ( !renderFaces.contains( ForgeDirection.UP ) ) + if ( !this.renderFaces.contains( ForgeDirection.UP ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -531,13 +531,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( this.renderMaxX, renderMaxZ ); + this.partialLightingColoring( this.renderMaxX, this.renderMaxZ ); tessellator.addVertexWithUV( d12, d13, d15, d4, d6 ); - partialLightingColoring( this.renderMaxX, renderMinZ ); + this.partialLightingColoring( this.renderMaxX, this.renderMinZ ); tessellator.addVertexWithUV( d12, d13, d14, d4, d5 ); - partialLightingColoring( this.renderMinX, renderMinZ ); + this.partialLightingColoring( this.renderMinX, this.renderMinZ ); tessellator.addVertexWithUV( d11, d13, d14, d3, d5 ); - partialLightingColoring( this.renderMinX, renderMaxZ ); + this.partialLightingColoring( this.renderMinX, this.renderMaxZ ); tessellator.addVertexWithUV( d11, d13, d15, d3, d6 ); } else @@ -553,22 +553,22 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rYPos = par8Icon; - saveAO( lightState.aoYPos, lightState.foYPos ); - lightState.bYPos = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rYPos = par8Icon; + this.saveAO( this.lightState.aoYPos, this.lightState.foYPos ); + this.lightState.bYPos = this.getCurrentBrightness(); } } @Override public void renderFaceZNeg(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.NORTH ) ) + if ( this.faces.contains( ForgeDirection.NORTH ) ) { - if ( !renderFaces.contains( ForgeDirection.NORTH ) ) + if ( !this.renderFaces.contains( ForgeDirection.NORTH ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -585,13 +585,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( renderMaxY, 1.0 - renderMinX ); + this.partialLightingColoring( this.renderMaxY, 1.0 - this.renderMinX ); tessellator.addVertexWithUV( d11, d14, d15, d3, d5 ); - partialLightingColoring( renderMaxY, 1.0 - renderMaxX ); + this.partialLightingColoring( this.renderMaxY, 1.0 - this.renderMaxX ); tessellator.addVertexWithUV( d12, d14, d15, d4, d5 ); - partialLightingColoring( renderMinY, 1.0 - renderMaxX ); + this.partialLightingColoring( this.renderMinY, 1.0 - this.renderMaxX ); tessellator.addVertexWithUV( d12, d13, d15, d4, d6 ); - partialLightingColoring( renderMinY, 1.0 - renderMinX ); + this.partialLightingColoring( this.renderMinY, 1.0 - this.renderMinX ); tessellator.addVertexWithUV( d11, d13, d15, d3, d6 ); } else @@ -607,22 +607,22 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rZNeg = par8Icon; - saveAO( lightState.aoZNeg, lightState.foZNeg ); - lightState.bZNeg = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rZNeg = par8Icon; + this.saveAO( this.lightState.aoZNeg, this.lightState.foZNeg ); + this.lightState.bZNeg = this.getCurrentBrightness(); } } @Override public void renderFaceZPos(Block par1Block, double par2, double par4, double par6, IIcon par8Icon) { - if ( faces.contains( ForgeDirection.SOUTH ) ) + if ( this.faces.contains( ForgeDirection.SOUTH ) ) { - if ( !renderFaces.contains( ForgeDirection.SOUTH ) ) + if ( !this.renderFaces.contains( ForgeDirection.SOUTH ) ) return; - if ( isFacade ) + if ( this.isFacade ) { Tessellator tessellator = Tessellator.instance; @@ -639,13 +639,13 @@ public class RenderBlocksWorkaround extends RenderBlocks if ( this.enableAO ) { - partialLightingColoring( 1.0 - renderMinX, renderMaxY ); + this.partialLightingColoring( 1.0 - this.renderMinX, this.renderMaxY ); tessellator.addVertexWithUV( d11, d14, d15, d3, d5 ); - partialLightingColoring( 1.0 - renderMinX, renderMinY ); + this.partialLightingColoring( 1.0 - this.renderMinX, this.renderMinY ); tessellator.addVertexWithUV( d11, d13, d15, d3, d6 ); - partialLightingColoring( 1.0 - renderMaxX, renderMinY ); + this.partialLightingColoring( 1.0 - this.renderMaxX, this.renderMinY ); tessellator.addVertexWithUV( d12, d13, d15, d4, d6 ); - partialLightingColoring( 1.0 - renderMaxX, renderMaxY ); + this.partialLightingColoring( 1.0 - this.renderMaxX, this.renderMaxY ); tessellator.addVertexWithUV( d12, d14, d15, d4, d5 ); } else @@ -661,16 +661,16 @@ public class RenderBlocksWorkaround extends RenderBlocks } else { - lightState.isAO = enableAO; - lightState.rZPos = par8Icon; - saveAO( lightState.aoZPos, lightState.foZPos ); - lightState.bZPos = getCurrentBrightness(); + this.lightState.isAO = this.enableAO; + this.lightState.rZPos = par8Icon; + this.saveAO( this.lightState.aoZPos, this.lightState.foZPos ); + this.lightState.bZPos = this.getCurrentBrightness(); } } public boolean similarLighting(Block blk, IBlockAccess w, int x, int y, int z, ISimplifiedBundle sim) { - int lh = getLightingHash( blk, w, x, y, z ); + int lh = this.getLightingHash( blk, w, x, y, z ); return ((LightingCache) sim).lightHash == lh; } @@ -686,19 +686,19 @@ public class RenderBlocksWorkaround extends RenderBlocks for (int k = -1; k <= 1; k++) { - lightHashTmp[o++] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k ); + this.lightHashTmp[o++] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k ); } - return Arrays.hashCode( lightHashTmp ); + return Arrays.hashCode( this.lightHashTmp ); } public void populate(ISimplifiedBundle sim) { - lightState = new LightingCache( (LightingCache) sim ); + this.lightState = new LightingCache( (LightingCache) sim ); } public ISimplifiedBundle getLightingCache() { - return new LightingCache( lightState ); + return new LightingCache( this.lightState ); } } diff --git a/src/main/java/appeng/client/render/SpatialSkyRender.java b/src/main/java/appeng/client/render/SpatialSkyRender.java index 694919b20..ceba22540 100644 --- a/src/main/java/appeng/client/render/SpatialSkyRender.java +++ b/src/main/java/appeng/client/render/SpatialSkyRender.java @@ -40,22 +40,22 @@ public class SpatialSkyRender extends IRenderHandler private final int dspList; public SpatialSkyRender() { - dspList = GLAllocation.generateDisplayLists( 1 ); + this.dspList = GLAllocation.generateDisplayLists( 1 ); } @Override public void render(float partialTicks, WorldClient world, Minecraft mc) { long now = System.currentTimeMillis(); - if ( now - cycle > 2000 ) + if ( now - this.cycle > 2000 ) { - cycle = now; - GL11.glNewList( dspList, GL11.GL_COMPILE ); - renderTwinkles(); + this.cycle = now; + GL11.glNewList( this.dspList, GL11.GL_COMPILE ); + this.renderTwinkles(); GL11.glEndList(); } - float fade = now - cycle; + float fade = now - this.cycle; fade /= 1000; fade = 0.15f * (1.0f - Math.abs( (fade - 1.0f) * (fade - 1.0f) )); @@ -124,7 +124,7 @@ public class SpatialSkyRender extends IRenderHandler GL11.glDepthMask( false ); GL11.glColor4f( fade, fade, fade, 1.0f ); - GL11.glCallList( dspList ); + GL11.glCallList( this.dspList ); } GL11.glPopAttrib(); @@ -139,10 +139,10 @@ public class SpatialSkyRender extends IRenderHandler for (int i = 0; i < 50; ++i) { - double iX = random.nextFloat() * 2.0F - 1.0F; - double iY = random.nextFloat() * 2.0F - 1.0F; - double iZ = random.nextFloat() * 2.0F - 1.0F; - double d3 = 0.05F + random.nextFloat() * 0.1F; + double iX = this.random.nextFloat() * 2.0F - 1.0F; + double iY = this.random.nextFloat() * 2.0F - 1.0F; + double iZ = this.random.nextFloat() * 2.0F - 1.0F; + double d3 = 0.05F + this.random.nextFloat() * 0.1F; double dist = iX * iX + iY * iY + iZ * iZ; if ( dist < 1.0D && dist > 0.01D ) @@ -160,7 +160,7 @@ public class SpatialSkyRender extends IRenderHandler double d11 = Math.atan2( Math.sqrt( iX * iX + iZ * iZ ), iY ); double d12 = Math.sin( d11 ); double d13 = Math.cos( d11 ); - double d14 = random.nextDouble() * Math.PI * 2.0D; + double d14 = this.random.nextDouble() * Math.PI * 2.0D; double d15 = Math.sin( d14 ); double d16 = Math.cos( d14 ); diff --git a/src/main/java/appeng/client/render/TESRWrapper.java b/src/main/java/appeng/client/render/TESRWrapper.java index d33cc6cd3..510c715de 100644 --- a/src/main/java/appeng/client/render/TESRWrapper.java +++ b/src/main/java/appeng/client/render/TESRWrapper.java @@ -43,8 +43,8 @@ public class TESRWrapper extends TileEntitySpecialRenderer final double MAX_DISTANCE; public TESRWrapper(BaseBlockRender render) { - blkRender = render; - MAX_DISTANCE = blkRender.getTesrRenderDistance(); + this.blkRender = render; + this.MAX_DISTANCE = this.blkRender.getTesrRenderDistance(); } @Override @@ -56,7 +56,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer if ( b instanceof AEBaseBlock && ((AEBaseTile) te).requiresTESR() ) { - if ( Math.abs( x ) > MAX_DISTANCE || Math.abs( y ) > MAX_DISTANCE || Math.abs( z ) > MAX_DISTANCE ) + if ( Math.abs( x ) > this.MAX_DISTANCE || Math.abs( y ) > this.MAX_DISTANCE || Math.abs( z ) > this.MAX_DISTANCE ) return; Tessellator tess = Tessellator.instance; @@ -69,8 +69,8 @@ public class TESRWrapper extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - renderBlocksInstance.blockAccess = te.getWorldObj(); - blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, renderBlocksInstance ); + this.renderBlocksInstance.blockAccess = te.getWorldObj(); + this.blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance ); if ( Platform.isDrawing( tess ) ) throw new RuntimeException( "Error during rendering." ); diff --git a/src/main/java/appeng/client/render/WorldRender.java b/src/main/java/appeng/client/render/WorldRender.java index da3087495..f0f278fa6 100644 --- a/src/main/java/appeng/client/render/WorldRender.java +++ b/src/main/java/appeng/client/render/WorldRender.java @@ -45,7 +45,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler void setRender(AEBaseBlock in, BaseBlockRender r) { - blockRenders.put( in, r ); + this.blockRenders.put( in, r ); } private WorldRender() { @@ -62,7 +62,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler { AEBaseBlock blk = (AEBaseBlock) block; renderer.setRenderBoundsFromBlock( block ); - return getRender( blk ).renderInWorld( blk, world, x, y, z, renderer ); + return this.getRender( blk ).renderInWorld( blk, world, x, y, z, renderer ); } @Override @@ -74,7 +74,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler @Override public int getRenderId() { - return renderID; + return this.renderID; } public void renderItemBlock(ItemStack item, ItemRenderType type, Object[] data) @@ -83,17 +83,17 @@ public class WorldRender implements ISimpleBlockRenderingHandler if ( blk instanceof AEBaseBlock ) { AEBaseBlock block = (AEBaseBlock) blk; - renderer.setRenderBoundsFromBlock( block ); + this.renderer.setRenderBoundsFromBlock( block ); - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - getRender( block ).renderInventory( block, item, renderer, type, data ); - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; + this.getRender( block ).renderInventory( block, item, this.renderer, type, data ); + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; } else { - if ( !hasError ) + if ( !this.hasError ) { - hasError = true; + this.hasError = true; AELog.severe( "Invalid render - item/block mismatch" ); AELog.severe( " item: " + item.getUnlocalizedName() ); AELog.severe( " block: " + blk.getUnlocalizedName() ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java index 84dc15392..013c85653 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java @@ -80,42 +80,42 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide { IIcon texture = null; - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.0D, 0.5D - Thickness, 0.5D - Thickness, 0.5D - Thickness - pull, 0.5D + Thickness, 0.5D + Thickness ); renderer.renderStandardBlock( block, x, y, z ); } - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D - Thickness, 1.0D, 0.5D + Thickness, 0.5D + Thickness ); renderer.renderStandardBlock( block, x, y, z ); } - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.5D - Thickness, 0.5D - Thickness, 0.0D, 0.5D + Thickness, 0.5D + Thickness, 0.5D - Thickness - pull ); renderer.renderStandardBlock( block, x, y, z ); } - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.5D - Thickness, 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D + Thickness, 0.5D + Thickness, 1.0D ); renderer.renderStandardBlock( block, x, y, z ); } - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.5D - Thickness, 0.0D, 0.5D - Thickness, 0.5D + Thickness, 0.5D - Thickness - pull, 0.5D + Thickness ); renderer.renderStandardBlock( block, x, y, z ); } - block.getRendererInstance().setTemporaryRenderIcon( texture = getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) ); + block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) ); if ( texture != null ) { renderer.setRenderBounds( 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D + Thickness, 1.0D, 0.5D + Thickness ); @@ -134,44 +134,44 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide { renderer.setOverrideBlockTexture( blk.getIcon( 0, 0 ) ); - setInvRenderBounds( renderer, 2, 14, 0, 14, 16, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 2, 14, 0, 14, 16, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 14, 2, 2, 16, 14 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 14, 2, 2, 16, 14 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 2, 0, 14, 14, 2, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 2, 0, 14, 14, 2, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 14, 0, 2, 16, 2, 14 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 14, 0, 2, 16, 2, 14 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 0, 0, 16, 2, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 0, 0, 16, 2, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 2, 0, 2, 16, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 2, 0, 2, 16, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 0, 2, 2, 2, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 0, 2, 2, 2, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 14, 14, 16, 16, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 14, 14, 16, 16, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 14, 0, 14, 16, 14, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 14, 0, 14, 16, 14, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 14, 14, 0, 16, 16, 14 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 14, 14, 0, 16, 16, 14 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 14, 2, 0, 16, 14, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 14, 2, 0, 16, 14, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 2, 14, 2, 14, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 2, 14, 2, 14, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); - setInvRenderBounds( renderer, 1, 1, 1, 15, 15, 15 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 1, 1, 1, 15, 15, 15 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, Tessellator.instance, 0xffffff, renderer ); renderer.setOverrideBlockTexture( null ); } @@ -186,7 +186,7 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide { if ( tma.isPowered() ) { - renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.SOUTH ); + this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.SOUTH ); TaughtIcon lights = new TaughtIcon( ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), -2.0f ); Tessellator.instance.setColorRGBA_F( 1, 1, 1, 0.3f ); Tessellator.instance.setBrightness( 14 << 20 | 14 << 4 ); @@ -204,12 +204,12 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide BusRenderer.instance.renderer.blockAccess = renderer.blockAccess; renderer = BusRenderer.instance.renderer; - preRenderInWorld( block, world, x, y, z, renderer ); + this.preRenderInWorld( block, world, x, y, z, renderer ); tma.lightCache = BusRenderHelper.instance.useSimplifiedRendering( x, y, z, this, tma.lightCache ); BusRenderer.instance.renderer.isFacade = true; - IOrientable te = getOrientable( block, world, x, y, z ); + IOrientable te = this.getOrientable( block, world, x, y, z ); ForgeDirection fdy = te.getUp(); ForgeDirection fdz = te.getForward(); @@ -217,49 +217,49 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide renderer.renderAllFaces = true; - renderCableAt( 0.11D, world, x, y, z, block, renderer, 0.141D, false ); - renderCableAt( 0.188D, world, x, y, z, block, renderer, 0.1875D, true ); + this.renderCableAt( 0.11D, world, x, y, z, block, renderer, 0.141D, false ); + this.renderCableAt( 0.188D, world, x, y, z, block, renderer, 0.1875D, true ); blk.getRendererInstance().setTemporaryRenderIcon( blk.getIcon( 0, 0 ) ); - renderBlockBounds( renderer, 2, 14, 0, 14, 16, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 2, 14, 0, 14, 16, 2, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 14, 2, 2, 16, 14, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 14, 2, 2, 16, 14, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 2, 0, 14, 14, 2, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 2, 0, 14, 14, 2, 16, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 14, 0, 2, 16, 2, 14, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 14, 0, 2, 16, 2, 14, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); // sides... - renderBlockBounds( renderer, 0, 0, 0, 16, 2, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 0, 0, 16, 2, 2, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 2, 0, 2, 16, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 2, 0, 2, 16, 2, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 0, 2, 2, 2, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 0, 2, 2, 2, 16, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 14, 14, 16, 16, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 14, 14, 16, 16, 16, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 14, 0, 14, 16, 14, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 14, 0, 14, 16, 14, 16, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 14, 14, 0, 16, 16, 14, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 14, 14, 0, 16, 16, 14, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 14, 2, 0, 16, 14, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 14, 2, 0, 16, 14, 2, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 2, 14, 2, 14, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 2, 14, 2, 14, 16, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, fdx, fdy, fdz ); renderer.renderStandardBlock( blk, x, y, z ); BusRenderHelper.instance.normalRendering(); @@ -269,7 +269,7 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide renderer.renderAllFaces = false; BusRenderer.instance.renderer.isFacade = false; - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return true; } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java b/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java index ef49eed75..3bcfa1073 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java @@ -55,26 +55,26 @@ public class RenderBlockCharger extends BaseBlockRender Tessellator tess = Tessellator.instance; renderer.renderAllFaces = true; - setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); blk.getRendererInstance().setTemporaryRenderIcons( ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null, null ); - setInvRenderBounds( renderer, 2, 0, 2, 14, 3, 14 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 2, 0, 2, 14, 3, 14 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 3, 3, 3, 13, 4, 13 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 3, 3, 3, 13, 4, 13 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); blk.getRendererInstance().setTemporaryRenderIcon( null ); blk.getRendererInstance().setTemporaryRenderIcons( null, ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null ); - setInvRenderBounds( renderer, 2, 13, 2, 14, 16, 14 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 2, 13, 2, 14, 16, 14 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 3, 12, 3, 13, 13, 13 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 3, 12, 3, 13, 13, 13 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.renderAllFaces = false; blk.getRendererInstance().setTemporaryRenderIcon( null ); @@ -84,42 +84,42 @@ public class RenderBlockCharger extends BaseBlockRender @Override public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer) { - preRenderInWorld( block, world, x, y, z, renderer ); + this.preRenderInWorld( block, world, x, y, z, renderer ); BlockCharger blk = (BlockCharger) block; - IOrientable te = getOrientable( block, world, x, y, z ); + IOrientable te = this.getOrientable( block, world, x, y, z ); ForgeDirection fdy = te.getUp(); ForgeDirection fdz = te.getForward(); ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite(); renderer.renderAllFaces = true; - renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz ); boolean out = renderer.renderStandardBlock( blk, x, y, z ); blk.getRendererInstance().setTemporaryRenderIcons( ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null, null ); - renderBlockBounds( renderer, 2, 0, 2, 14, 3, 14, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 2, 0, 2, 14, 3, 14, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 3, 3, 3, 13, 4, 13, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 3, 3, 3, 13, 4, 13, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); blk.getRendererInstance().setTemporaryRenderIcon( null ); blk.getRendererInstance().setTemporaryRenderIcons( null, ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null ); - renderBlockBounds( renderer, 2, 13, 2, 14, 16, 14, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 2, 13, 2, 14, 16, 14, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 3, 12, 3, 13, 13, 13, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 3, 12, 3, 13, 13, 13, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); renderer.renderAllFaces = false; blk.getRendererInstance().setTemporaryRenderIcon( null ); - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return out; } @@ -133,7 +133,7 @@ public class RenderBlockCharger extends BaseBlockRender if ( sis != null ) { GL11.glPushMatrix(); - applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); + this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); try { @@ -160,7 +160,7 @@ public class RenderBlockCharger extends BaseBlockRender GL11.glDisable( GL12.GL_RESCALE_NORMAL ); tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f ); - doRenderItem( sis, tile ); + this.doRenderItem( sis, tile ); } catch (Exception err) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockController.java b/src/main/java/appeng/client/render/blocks/RenderBlockController.java index 012ed1afa..03e6e7894 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockController.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockController.java @@ -38,9 +38,9 @@ public class RenderBlockController extends BaseBlockRender public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer) { - boolean xx = getTileEntity( world, x - 1, y, z ) instanceof TileController && getTileEntity( world, x + 1, y, z ) instanceof TileController; - boolean yy = getTileEntity( world, x, y - 1, z ) instanceof TileController && getTileEntity( world, x, y + 1, z ) instanceof TileController; - boolean zz = getTileEntity( world, x, y, z - 1 ) instanceof TileController && getTileEntity( world, x, y, z + 1 ) instanceof TileController; + boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController; + boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1, z ) instanceof TileController; + boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y, z + 1 ) instanceof TileController; int meta = world.getBlockMetadata( x, y, z ); boolean hasPower = meta > 0; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index e82c3ed5f..f17ed07cf 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -90,35 +90,35 @@ public class RenderBlockCraftingCPU extends BaseBlockRender } - float highX = isConnected( w, x, y, z, ForgeDirection.EAST ) ? 16 : 13.01f; - float lowX = isConnected( w, x, y, z, ForgeDirection.WEST ) ? 0 : 2.99f; + float highX = this.isConnected( w, x, y, z, ForgeDirection.EAST ) ? 16 : 13.01f; + float lowX = this.isConnected( w, x, y, z, ForgeDirection.WEST ) ? 0 : 2.99f; - float highY = isConnected( w, x, y, z, ForgeDirection.UP ) ? 16 : 13.01f; - float lowY = isConnected( w, x, y, z, ForgeDirection.DOWN ) ? 0 : 2.99f; + float highY = this.isConnected( w, x, y, z, ForgeDirection.UP ) ? 16 : 13.01f; + float lowY = this.isConnected( w, x, y, z, ForgeDirection.DOWN ) ? 0 : 2.99f; - float highZ = isConnected( w, x, y, z, ForgeDirection.SOUTH ) ? 16 : 13.01f; - float lowZ = isConnected( w, x, y, z, ForgeDirection.NORTH ) ? 0 : 2.99f; + float highZ = this.isConnected( w, x, y, z, ForgeDirection.SOUTH ) ? 16 : 13.01f; + float lowZ = this.isConnected( w, x, y, z, ForgeDirection.NORTH ) ? 0 : 2.99f; - renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.NORTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.SOUTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.WEST, ForgeDirection.NORTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.WEST, ForgeDirection.SOUTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.NORTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.SOUTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.NORTH ); - renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.SOUTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.NORTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.SOUTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.WEST, ForgeDirection.NORTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.UP, ForgeDirection.WEST, ForgeDirection.SOUTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.NORTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.SOUTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.NORTH ); + this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.SOUTH ); for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - i.setBounds( fso( side, lowX, ForgeDirection.WEST ), fso( side, lowY, ForgeDirection.DOWN ), fso( side, lowZ, ForgeDirection.NORTH ), - fso( side, highX, ForgeDirection.EAST ), fso( side, highY, ForgeDirection.UP ), fso( side, highZ, ForgeDirection.SOUTH ) ); + i.setBounds( this.fso( side, lowX, ForgeDirection.WEST ), this.fso( side, lowY, ForgeDirection.DOWN ), this.fso( side, lowZ, ForgeDirection.NORTH ), + this.fso( side, highX, ForgeDirection.EAST ), this.fso( side, highY, ForgeDirection.UP ), this.fso( side, highZ, ForgeDirection.SOUTH ) ); i.prepareBounds( renderer ); boolean LocalEmit = emitsLight; if ( blk instanceof BlockCraftingMonitor && !ct.getForward().equals( side ) ) LocalEmit = false; - handleSide( blk, meta, x, y, z, i, renderer, ct.getForward().equals( side ) ? theIcon : nonForward, LocalEmit, isMonitor, side, w ); + this.handleSide( blk, meta, x, y, z, i, renderer, ct.getForward().equals( side ) ? theIcon : nonForward, LocalEmit, isMonitor, side, w ); } BusRenderer.instance.renderer.isFacade = false; @@ -140,15 +140,15 @@ public class RenderBlockCraftingCPU extends BaseBlockRender private void renderCorner(BusRenderHelper i, RenderBlocks renderer, IBlockAccess w, int x, int y, int z, ForgeDirection up, ForgeDirection east, ForgeDirection south) { - if ( isConnected( w, x, y, z, up ) ) + if ( this.isConnected( w, x, y, z, up ) ) return; - if ( isConnected( w, x, y, z, east ) ) + if ( this.isConnected( w, x, y, z, east ) ) return; - if ( isConnected( w, x, y, z, south ) ) + if ( this.isConnected( w, x, y, z, south ) ) return; - i.setBounds( gso( east, 3, ForgeDirection.WEST ), gso( up, 3, ForgeDirection.DOWN ), gso( south, 3, ForgeDirection.NORTH ), - gso( east, 13, ForgeDirection.EAST ), gso( up, 13, ForgeDirection.UP ), gso( south, 13, ForgeDirection.SOUTH ) ); + i.setBounds( this.gso( east, 3, ForgeDirection.WEST ), this.gso( up, 3, ForgeDirection.DOWN ), this.gso( south, 3, ForgeDirection.NORTH ), + this.gso( east, 13, ForgeDirection.EAST ), this.gso( up, 13, ForgeDirection.UP ), this.gso( south, 13, ForgeDirection.SOUTH ) ); i.prepareBounds( renderer ); i.setTexture( ExtraBlockTextures.BlockCraftingUnitRing.getIcon() ); i.renderBlockCurrentBounds( x, y, z, renderer ); @@ -179,7 +179,7 @@ public class RenderBlockCraftingCPU extends BaseBlockRender private void handleSide(AEBaseBlock blk, int meta, int x, int y, int z, BusRenderHelper i, RenderBlocks renderer, IIcon color, boolean emitsLight, boolean isMonitor, ForgeDirection side, IBlockAccess w) { - if ( isConnected( w, x, y, z, side ) ) + if ( this.isConnected( w, x, y, z, side ) ) return; i.setFacesToRender( EnumSet.of( side ) ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java index 76c212810..801a331a2 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java @@ -72,7 +72,7 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU { cmt.updateList = false; GL11.glNewList( cmt.dspList, GL11.GL_COMPILE_AND_EXECUTE ); - tesrRenderScreen( tess, cmt, ais ); + this.tesrRenderScreen( tess, cmt, ais ); GL11.glEndList(); } else diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java index 66ef952e9..f95b5ab2a 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java @@ -79,7 +79,7 @@ public class RenderBlockCrank extends BaseBlockRender GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); + this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); GL11.glTranslated( 0.5, 0, 0.5 ); GL11.glRotatef( tc.visibleRotation, 0, 1, 0 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java index afc49cc2e..8fedec2ed 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java @@ -59,33 +59,33 @@ public class RenderBlockInscriber extends BaseBlockRender Tessellator tess = Tessellator.instance; renderer.renderAllFaces = true; - setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); // sides... - setInvRenderBounds( renderer, 3, 1, 0, 13, 15, 3 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 3, 1, 0, 13, 15, 3 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 0, 1, 0, 3, 15, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 0, 1, 0, 3, 15, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 13, 1, 0, 16, 15, 16 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 13, 1, 0, 16, 15, 16 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 1, 0, 1, 15, 2, 15 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 1, 0, 1, 15, 2, 15 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 1, 14, 1, 15, 16, 15 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 1, 14, 1, 15, 16, 15 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockInscriberInside.getIcon() ); // press - setInvRenderBounds( renderer, 3, 2, 3, 13, 3, 13 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 3, 2, 3, 13, 3, 13 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - setInvRenderBounds( renderer, 3, 13, 3, 13, 15, 13 ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.setInvRenderBounds( renderer, 3, 13, 3, 13, 15, 13 ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); blk.getRendererInstance().setTemporaryRenderIcon( null ); @@ -97,11 +97,11 @@ public class RenderBlockInscriber extends BaseBlockRender @Override public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer) { - preRenderInWorld( block, world, x, y, z, renderer ); + this.preRenderInWorld( block, world, x, y, z, renderer ); BlockInscriber blk = (BlockInscriber) block; - IOrientable te = getOrientable( block, world, x, y, z ); + IOrientable te = this.getOrientable( block, world, x, y, z ); ForgeDirection fdy = te.getUp(); ForgeDirection fdz = te.getForward(); @@ -110,20 +110,20 @@ public class RenderBlockInscriber extends BaseBlockRender renderer.renderAllFaces = true; // sides... - renderBlockBounds( renderer, 3, 1, 0, 13, 15, 3, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 3, 1, 0, 13, 15, 3, fdx, fdy, fdz ); boolean out = renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 0, 1, 0, 3, 15, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 0, 1, 0, 3, 15, 16, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 13, 1, 0, 16, 15, 16, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 13, 1, 0, 16, 15, 16, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); // top bottom.. - renderBlockBounds( renderer, 1, 0, 1, 15, 4, 15, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 1, 0, 1, 15, 4, 15, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); - renderBlockBounds( renderer, 1, 12, 1, 15, 16, 15, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 1, 12, 1, 15, 16, 15, fdx, fdy, fdz ); out = renderer.renderStandardBlock( blk, x, y, z ); blk.getRendererInstance().setTemporaryRenderIcon( null ); @@ -131,7 +131,7 @@ public class RenderBlockInscriber extends BaseBlockRender renderer.renderAllFaces = false; blk.getRendererInstance().setTemporaryRenderIcon( null ); - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return out; } @@ -141,7 +141,7 @@ public class RenderBlockInscriber extends BaseBlockRender TileInscriber inv = (TileInscriber) tile; GL11.glPushMatrix(); - applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); + this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glDisable( GL11.GL_LIGHTING ); @@ -225,13 +225,13 @@ public class RenderBlockInscriber extends BaseBlockRender is = ir.output.copy(); } - renderItem( is, 0.0f, block, tile, tess, x, y, z, f, renderer ); + this.renderItem( is, 0.0f, block, tile, tess, x, y, z, f, renderer ); } else { - renderItem( inv.getStackInSlot( 0 ), press, block, tile, tess, x, y, z, f, renderer ); - renderItem( inv.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer ); - renderItem( inv.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer ); + this.renderItem( inv.getStackInSlot( 0 ), press, block, tile, tess, x, y, z, f, renderer ); + this.renderItem( inv.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer ); + this.renderItem( inv.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer ); } } @@ -243,7 +243,7 @@ public class RenderBlockInscriber extends BaseBlockRender { sis = sis.copy(); GL11.glPushMatrix(); - applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); + this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); try { @@ -272,7 +272,7 @@ public class RenderBlockInscriber extends BaseBlockRender GL11.glDisable( GL12.GL_RESCALE_NORMAL ); tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f ); - doRenderItem( sis, tile ); + this.doRenderItem( sis, tile ); } catch (Exception err) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java index 104351adf..e41b85cee 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java @@ -62,9 +62,9 @@ public class RenderBlockSkyChest extends BaseBlockRender GL11.glScalef( 1.0F, -1F, -1F ); GL11.glTranslatef( -0.0F, -1.0F, -1.0F ); - model.chestLid.offsetY = -(0.9f / 16.0f); - model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); - model.renderAll(); + this.model.chestLid.offsetY = -(0.9f / 16.0f); + this.model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); + this.model.renderAll(); GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); @@ -122,9 +122,9 @@ public class RenderBlockSkyChest extends BaseBlockRender lidAngle = 1.0F - lidAngle; lidAngle = 1.0F - lidAngle * lidAngle * lidAngle; - model.chestLid.offsetY = -(1.01f / 16.0f); - model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); - model.renderAll(); + this.model.chestLid.offsetY = -(1.01f / 16.0f); + this.model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); + this.model.renderAll(); GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java index 99bdc117f..10e68b2ed 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java @@ -119,7 +119,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender if ( cr.spin ) { now = now % 100000; - model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); + this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } else { @@ -127,27 +127,27 @@ public class RenderBlockSkyCompass extends BaseBlockRender { float offRads = rYaw / 180.0f * (float) Math.PI; float adjustment = (float) Math.PI * 0.74f; - model.renderAll( (float) flipidiy( cr.rad + offRads + adjustment ) ); + this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) ); } else { float offRads = rYaw / 180.0f * (float) Math.PI; float adjustment = (float) Math.PI * -0.74f; - model.renderAll( (float) flipidiy( cr.rad + offRads + adjustment ) ); + this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) ); } } } else { now = now % 1000000; - model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); + this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); } } else { now = now % 100000; - model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); + this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); @@ -196,16 +196,16 @@ public class RenderBlockSkyCompass extends BaseBlockRender if ( cr.spin ) { now = now % 100000; - model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); + this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } else - model.renderAll( (float) (skyCompass.getForward() == ForgeDirection.DOWN ? flipidiy( cr.rad ) : cr.rad) ); + this.model.renderAll( (float) (skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy( cr.rad ) : cr.rad) ); } else { now = now % 1000000; - model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); + this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); } GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java index 20e505e02..05fa84db8 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java @@ -48,11 +48,11 @@ public class RenderBlockWireless extends BaseBlockRender public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj) { this.blk = blk; - centerX = 0; - centerY = 0; - centerZ = 0; - hasChan = false; - hasPower = false; + this.centerX = 0; + this.centerY = 0; + this.centerZ = 0; + this.hasChan = false; + this.hasPower = false; BlockRenderInfo ri = blk.getRendererInstance(); Tessellator tess = Tessellator.instance; @@ -60,17 +60,17 @@ public class RenderBlockWireless extends BaseBlockRender IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon(); ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r ); - renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); r = CableBusTextures.PartWirelessSides.getIcon(); ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r ); - renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); tess.startDrawingQuads(); ri.setTemporaryRenderIcon( null ); - renderTorchAtAngle( renderer, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); + this.renderTorchAtAngle( renderer, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); super.postRenderInWorld( renderer ); tess.draw(); @@ -82,22 +82,22 @@ public class RenderBlockWireless extends BaseBlockRender for (ForgeDirection side : sides) { - renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2 + this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2 + (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2), 8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); } s = 3; for (ForgeDirection side : sides) { - renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1 + this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1 + (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1), 8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); } } @@ -115,8 +115,8 @@ public class RenderBlockWireless extends BaseBlockRender this.blk = blk; if ( tw != null ) { - hasChan = (tw.clientFlags & (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG)) == (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG); - hasPower = (tw.clientFlags & TileWireless.POWERED_FLAG) == TileWireless.POWERED_FLAG; + this.hasChan = (tw.clientFlags & (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG)) == (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG); + this.hasPower = (tw.clientFlags & TileWireless.POWERED_FLAG) == TileWireless.POWERED_FLAG; BlockRenderInfo ri = blk.getRendererInstance(); @@ -128,20 +128,20 @@ public class RenderBlockWireless extends BaseBlockRender IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon(); ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r ); - renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz ); super.renderInWorld( blk, world, x, y, z, renderer ); r = CableBusTextures.PartWirelessSides.getIcon(); ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r ); - renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz ); super.renderInWorld( blk, world, x, y, z, renderer ); - centerX = x; - centerY = y; - centerZ = z; + this.centerX = x; + this.centerY = y; + this.centerZ = z; ri.setTemporaryRenderIcon( null ); - renderTorchAtAngle( renderer, fdx, fdy, fdz ); + this.renderTorchAtAngle( renderer, fdx, fdy, fdz ); super.postRenderInWorld( renderer ); ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r ); @@ -152,7 +152,7 @@ public class RenderBlockWireless extends BaseBlockRender for (ForgeDirection side : sides) { - renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2 + this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2 + (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2), 8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz ); super.renderInWorld( blk, world, x, y, z, renderer ); @@ -161,7 +161,7 @@ public class RenderBlockWireless extends BaseBlockRender s = 3; for (ForgeDirection side : sides) { - renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1 + this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1 + (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1), 8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz ); super.renderInWorld( blk, world, x, y, z, renderer ); @@ -170,15 +170,15 @@ public class RenderBlockWireless extends BaseBlockRender r = CableBusTextures.PartMonitorSidesStatusLights.getIcon(); // ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(), // ExtraTextures.BlockChargerInside.getIcon(), r, r ); - renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz ); + this.renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz ); - if ( hasChan ) + if ( this.hasChan ) { int l = 14; Tessellator.instance.setBrightness( l << 20 | l << 4 ); Tessellator.instance.setColorOpaque_I( AEColor.Transparent.blackVariant ); } - else if ( hasPower ) + else if ( this.hasPower ) { int l = 9; Tessellator.instance.setBrightness( l << 20 | l << 4 ); @@ -212,7 +212,7 @@ public class RenderBlockWireless extends BaseBlockRender private void renderTorchAtAngle(RenderBlocks renderer, ForgeDirection x, ForgeDirection y, ForgeDirection z) { - IIcon r = (hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : blk.getIcon( 0, 0 )); + IIcon r = (this.hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : this.blk.getIcon( 0, 0 )); IIcon sides = new OffsetIcon( r, 0.0f, -2.0f ); switch (z) @@ -252,15 +252,15 @@ public class RenderBlockWireless extends BaseBlockRender } Tessellator.instance.setColorOpaque_I( 0xffffff ); - renderBlockBounds( renderer, 0, 7, 1, 16, 9, 16, x, y, z ); - renderFace( centerX, centerY, centerZ, blk, sides, renderer, y ); - renderFace( centerX, centerY, centerZ, blk, sides, renderer, y.getOpposite() ); + this.renderBlockBounds( renderer, 0, 7, 1, 16, 9, 16, x, y, z ); + this.renderFace( this.centerX, this.centerY, this.centerZ, this.blk, sides, renderer, y ); + this.renderFace( this.centerX, this.centerY, this.centerZ, this.blk, sides, renderer, y.getOpposite() ); - renderBlockBounds( renderer, 7, 0, 1, 9, 16, 16, x, y, z ); - renderFace( centerX, centerY, centerZ, blk, sides, renderer, x ); - renderFace( centerX, centerY, centerZ, blk, sides, renderer, x.getOpposite() ); + this.renderBlockBounds( renderer, 7, 0, 1, 9, 16, 16, x, y, z ); + this.renderFace( this.centerX, this.centerY, this.centerZ, this.blk, sides, renderer, x ); + this.renderFace( this.centerX, this.centerY, this.centerZ, this.blk, sides, renderer, x.getOpposite() ); - renderBlockBounds( renderer, 7, 7, 1, 9, 9, 10.6, x, y, z ); - renderFace( centerX, centerY, centerZ, blk, r, renderer, z ); + this.renderBlockBounds( renderer, 7, 7, 1, 9, 9, 10.6, x, y, z ); + this.renderFace( this.centerX, this.centerY, this.centerZ, this.blk, r, renderer, z ); } } diff --git a/src/main/java/appeng/client/render/blocks/RenderDrive.java b/src/main/java/appeng/client/render/blocks/RenderDrive.java index e02076e76..c12349e99 100644 --- a/src/main/java/appeng/client/render/blocks/RenderDrive.java +++ b/src/main/java/appeng/client/render/blocks/RenderDrive.java @@ -72,7 +72,7 @@ public class RenderDrive extends BaseBlockRender for (int xx = 0; xx < 2; xx++) { int stat = sp.getCellStatus( yy * 2 + (1 - xx) ); - selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 ); + this.selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 ); int spin = 0; @@ -249,9 +249,9 @@ public class RenderDrive extends BaseBlockRender } if ( (forward == ForgeDirection.UP && up == ForgeDirection.SOUTH) || forward == ForgeDirection.DOWN ) - selectFace( renderer, west, up, forward, 3 + xx * 7, 4 + xx * 7, 1 + yy * 3, 2 + yy * 3 ); + this.selectFace( renderer, west, up, forward, 3 + xx * 7, 4 + xx * 7, 1 + yy * 3, 2 + yy * 3 ); else - selectFace( renderer, west, up, forward, 5 + xx * 7, 6 + xx * 7, 2 + yy * 3, 3 + yy * 3 ); + this.selectFace( renderer, west, up, forward, 5 + xx * 7, 6 + xx * 7, 2 + yy * 3, 3 + yy * 3 ); if ( stat != 0 ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderMEChest.java b/src/main/java/appeng/client/render/blocks/RenderMEChest.java index e9b5c11f8..7217891f4 100644 --- a/src/main/java/appeng/client/render/blocks/RenderMEChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderMEChest.java @@ -53,7 +53,7 @@ public class RenderMEChest extends BaseBlockRender this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer ); renderer.overrideBlockTexture = ExtraBlockTextures.MEChest.getIcon(); - this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), + this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), renderer ); renderer.overrideBlockTexture = null; @@ -70,12 +70,12 @@ public class RenderMEChest extends BaseBlockRender ForgeDirection forward = sp.getForward(); ForgeDirection west = Platform.crossProduct( forward, up ); - preRenderInWorld( imb, world, x, y, z, renderer ); + this.preRenderInWorld( imb, world, x, y, z, renderer ); int stat = sp.getCellStatus( 0 ); boolean result = renderer.renderStandardBlock( imb, x, y, z ); - selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 ); + this.selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 ); int offsetU = -4; int offsetV = 8; @@ -105,7 +105,7 @@ public class RenderMEChest extends BaseBlockRender * forward == ForgeDirection.NORTH && up == ForgeDirection.UP ) flippableIcon.setFlip( true, false ); */ - renderFace( x, y, z, imb, flippableIcon, renderer, forward ); + this.renderFace( x, y, z, imb, flippableIcon, renderer, forward ); if ( stat != 0 ) { @@ -122,8 +122,8 @@ public class RenderMEChest extends BaseBlockRender Tessellator.instance.setColorOpaque_I( 0xffaa00 ); if ( stat == 3 ) Tessellator.instance.setColorOpaque_I( 0xff0000 ); - selectFace( renderer, west, up, forward, 9, 10, 11, 12 ); - renderFace( x, y, z, imb, ExtraBlockTextures.White.getIcon(), renderer, forward ); + this.selectFace( renderer, west, up, forward, 9, 10, 11, 12 ); + this.renderFace( x, y, z, imb, ExtraBlockTextures.White.getIcon(), renderer, forward ); } b = world.getLightBrightnessForSkyBlocks( x + up.offsetX, y + up.offsetY, z + up.offsetZ, 0 ); @@ -140,21 +140,21 @@ public class RenderMEChest extends BaseBlockRender Tessellator.instance.setColorOpaque_I( sp.getColor().whiteVariant ); IIcon ico = ch == null ? null : ch.getTopTexture_Light(); - renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); + this.renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); if ( ico != null ) { Tessellator.instance.setColorOpaque_I( sp.getColor().mediumVariant ); ico = ch == null ? null : ch.getTopTexture_Medium(); - renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); + this.renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); Tessellator.instance.setColorOpaque_I( sp.getColor().blackVariant ); ico = ch == null ? null : ch.getTopTexture_Dark(); - renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); + this.renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up ); } renderer.overrideBlockTexture = null; - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return result; } diff --git a/src/main/java/appeng/client/render/blocks/RenderQNB.java b/src/main/java/appeng/client/render/blocks/RenderQNB.java index d6483b958..d830f02b4 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQNB.java +++ b/src/main/java/appeng/client/render/blocks/RenderQNB.java @@ -119,8 +119,8 @@ public class RenderQNB extends BaseBlockRender Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent ); EnumSet sides = tqb.getConnections(); - renderCableAt( 0.11D, world, x, y, z, block, renderer, transparentGlassCable.getIconIndex( glassCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); - renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); + this.renderCableAt( 0.11D, world, x, y, z, block, renderer, transparentGlassCable.getIconIndex( glassCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); + this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); } float renderMin = 2.0f / 16.0f; @@ -146,7 +146,7 @@ public class RenderQNB extends BaseBlockRender AEColoredItemDefinition coveredCableDefinition = AEApi.instance().parts().partCableCovered; Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent ); - renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.05D, + this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.05D, tqb.getConnections() ); float renderMin = 4.0f / 16.0f; @@ -166,7 +166,7 @@ public class RenderQNB extends BaseBlockRender Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F ); Tessellator.instance.setBrightness( bn << 20 | bn << 4 ); for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingCornerLight.getIcon(), renderer, side ); + this.renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingCornerLight.getIcon(), renderer, side ); } } @@ -193,7 +193,7 @@ public class RenderQNB extends BaseBlockRender Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F ); Tessellator.instance.setBrightness( bn << 20 | bn << 4 ); for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingEdgeLight.getIcon(), renderer, side ); + this.renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingEdgeLight.getIcon(), renderer, side ); } } } diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java index 75b9af01f..c8abd522f 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java @@ -50,7 +50,7 @@ public class RenderQuartzGlass extends BaseBlockRender boolean isFlush(AEBaseBlock imb, IBlockAccess world, int x, int y, int z) { - return isGlass( imb, world, x, y, z ); + return this.isGlass( imb, world, x, y, z ); } boolean isGlass(AEBaseBlock imb, IBlockAccess world, int x, int y, int z) @@ -61,9 +61,9 @@ public class RenderQuartzGlass extends BaseBlockRender void renderEdge(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer, ForgeDirection side, ForgeDirection direction) { - if ( !isFlush( imb, world, x + side.offsetX, y + side.offsetY, z + side.offsetZ ) ) + if ( !this.isFlush( imb, world, x + side.offsetX, y + side.offsetY, z + side.offsetZ ) ) { - if ( !isFlush( imb, world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ ) ) + if ( !this.isFlush( imb, world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ ) ) { float minX = 0.5f + (side.offsetX + direction.offsetX) / 2.0f; float minY = 0.5f + (side.offsetY + direction.offsetY) / 2.0f; @@ -171,35 +171,35 @@ public class RenderQuartzGlass extends BaseBlockRender boolean result = renderer.renderStandardBlock( imb, x, y, z ); renderer.overrideBlockTexture = null; - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.EAST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.WEST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.NORTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.SOUTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.EAST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.WEST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.NORTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.UP, ForgeDirection.SOUTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.EAST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.WEST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.NORTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.SOUTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.EAST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.WEST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.NORTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.DOWN, ForgeDirection.SOUTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.UP ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.DOWN ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.NORTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.SOUTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.UP ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.DOWN ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.NORTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.EAST, ForgeDirection.SOUTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.UP ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.DOWN ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.NORTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.SOUTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.UP ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.DOWN ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.NORTH ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.WEST, ForgeDirection.SOUTH ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.EAST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.WEST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.UP ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.DOWN ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.EAST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.WEST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.UP ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.NORTH, ForgeDirection.DOWN ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.EAST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.WEST ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.UP ); - renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.DOWN ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.EAST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.WEST ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.UP ); + this.renderEdge( imb, world, x, y, z, renderer, ForgeDirection.SOUTH, ForgeDirection.DOWN ); return result; } diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java index 43b3568ed..730af14a0 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java @@ -62,30 +62,30 @@ public class RenderQuartzTorch extends BaseBlockRender float zOff = 0.0f; renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.setRenderBounds( Point12 - singlePixel + xOff, renderBottom - singlePixel + yOff, Point12 - singlePixel + zOff, Point12 + xOff, renderBottom + yOff, Point12 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) ); renderer.renderAllFaces = true; renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point3 + zOff, Point3 + xOff, top + yOff, Point12 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.setRenderBounds( Point12 + xOff, bottom + yOff, Point3 + zOff, Point13 + xOff, top + yOff, Point12 + zOff ); - renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); + this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); renderer.renderAllFaces = false; blk.getRendererInstance().setTemporaryRenderIcon( null ); diff --git a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java index 7c21e788b..33dbee4a1 100644 --- a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java +++ b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java @@ -121,12 +121,12 @@ public class RenderSpatialPylon extends BaseBlockRender BlockRenderInfo bri = imb.getRendererInstance(); bri.setTemporaryRenderIcon( null ); - bri.setTemporaryRenderIcons( getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.UP ), - getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.DOWN ), - getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ), - getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.NORTH ), - getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.EAST ), - getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.WEST ) ); + bri.setTemporaryRenderIcons( this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.UP ), + this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.DOWN ), + this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ), + this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.NORTH ), + this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.EAST ), + this.getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.WEST ) ); boolean r = renderer.renderStandardBlock( imb, x, y, z ); @@ -137,17 +137,17 @@ public class RenderSpatialPylon extends BaseBlockRender Tessellator.instance.setColorOpaque_I( 0xffffff ); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - renderFace( x, y, z, imb, getBlockTextureFromSideInside( imb, sp, displayBits, ori, d ), renderer, d ); + this.renderFace( x, y, z, imb, this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, d ), renderer, d ); } else { bri.setTemporaryRenderIcon( null ); - bri.setTemporaryRenderIcons( getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.UP ), - getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.DOWN ), - getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ), - getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.NORTH ), - getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.EAST ), - getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.WEST ) ); + bri.setTemporaryRenderIcons( this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.UP ), + this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.DOWN ), + this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ), + this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.NORTH ), + this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.EAST ), + this.getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.WEST ) ); renderer.renderStandardBlock( imb, x, y, z ); } diff --git a/src/main/java/appeng/client/render/blocks/RendererSecurity.java b/src/main/java/appeng/client/render/blocks/RendererSecurity.java index d639b0f9b..197d78105 100644 --- a/src/main/java/appeng/client/render/blocks/RendererSecurity.java +++ b/src/main/java/appeng/client/render/blocks/RendererSecurity.java @@ -47,7 +47,7 @@ public class RendererSecurity extends BaseBlockRender this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer ); renderer.overrideBlockTexture = ExtraBlockTextures.MEChest.getIcon(); - this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), + this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), renderer ); renderer.overrideBlockTexture = null; @@ -62,7 +62,7 @@ public class RendererSecurity extends BaseBlockRender ForgeDirection up = sp.getUp(); - preRenderInWorld( imb, world, x, y, z, renderer ); + this.preRenderInWorld( imb, world, x, y, z, renderer ); boolean result = renderer.renderStandardBlock( imb, x, y, z ); @@ -78,20 +78,20 @@ public class RendererSecurity extends BaseBlockRender Tessellator.instance.setColorOpaque_I( sp.getColor().whiteVariant ); IIcon ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Light.getIcon() : ExtraBlockTextures.MEChest.getIcon(); - renderFace( x, y, z, imb, ico, renderer, up ); + this.renderFace( x, y, z, imb, ico, renderer, up ); if ( sp.isActive() ) { Tessellator.instance.setColorOpaque_I( sp.getColor().mediumVariant ); ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Medium.getIcon() : ExtraBlockTextures.MEChest.getIcon(); - renderFace( x, y, z, imb, ico, renderer, up ); + this.renderFace( x, y, z, imb, ico, renderer, up ); Tessellator.instance.setColorOpaque_I( sp.getColor().blackVariant ); ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Dark.getIcon() : ExtraBlockTextures.MEChest.getIcon(); - renderFace( x, y, z, imb, ico, renderer, up ); + this.renderFace( x, y, z, imb, ico, renderer, up ); } renderer.overrideBlockTexture = null; - postRenderInWorld( renderer ); + this.postRenderInWorld( renderer ); return result; } diff --git a/src/main/java/appeng/client/render/effects/AssemblerFX.java b/src/main/java/appeng/client/render/effects/AssemblerFX.java index 7d5be167d..3189b928e 100644 --- a/src/main/java/appeng/client/render/effects/AssemblerFX.java +++ b/src/main/java/appeng/client/render/effects/AssemblerFX.java @@ -36,14 +36,14 @@ public class AssemblerFX extends EntityFX public AssemblerFX(World w, double x, double y, double z, double r, double g, double b, float speed, IAEItemStack is) { super( w, x, y, z, r, g, b ); - motionX = 0; - motionY = 0; - motionZ = 0; - item = is; + this.motionX = 0; + this.motionY = 0; + this.motionZ = 0; + this.item = is; this.speed = speed; - fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() ); - w.spawnEntityInWorld( fi ); - particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2; + this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() ); + w.spawnEntityInWorld( this.fi ); + this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2; } @Override @@ -58,25 +58,25 @@ public class AssemblerFX extends EntityFX { super.onUpdate(); - if ( isDead ) - fi.setDead(); + if ( this.isDead ) + this.fi.setDead(); else { float lifeSpan = (float) this.particleAge / (float) this.particleMaxAge; - fi.setProgress( lifeSpan ); + this.fi.setProgress( lifeSpan ); } } @Override public void renderParticle(Tessellator tess, float l, float rX, float rY, float rZ, float rYZ, float rXY) { - time += l; - if ( time > 4.0 ) + this.time += l; + if ( this.time > 4.0 ) { - time -= 4.0; + this.time -= 4.0; // if ( CommonHelper.proxy.shouldAddParticles( r ) ) - for (int x = 0; x < (int) Math.ceil( speed / 5 ); x++) - CommonHelper.proxy.spawnEffect( EffectType.Crafting, worldObj, posX, posY, posZ, null ); + for (int x = 0; x < (int) Math.ceil( this.speed / 5 ); x++) + CommonHelper.proxy.spawnEffect( EffectType.Crafting, this.worldObj, this.posX, this.posY, this.posZ, null ); } } diff --git a/src/main/java/appeng/client/render/effects/CraftingFx.java b/src/main/java/appeng/client/render/effects/CraftingFx.java index baf57b339..ef0b36a9c 100644 --- a/src/main/java/appeng/client/render/effects/CraftingFx.java +++ b/src/main/java/appeng/client/render/effects/CraftingFx.java @@ -47,18 +47,18 @@ public class CraftingFx extends EntityBreakingFX public CraftingFx(World par1World, double par2, double par4, double par6, Item par8Item) { super( par1World, par2, par4, par6, par8Item ); - particleGravity = 0; + this.particleGravity = 0; this.particleBlue = 1; this.particleGreen = 0.9f; this.particleRed = 1; this.particleAlpha = 1.3f; this.particleScale = 1.5f; this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon(); - particleMaxAge /= 1.2; + this.particleMaxAge /= 1.2; - startBlkX = MathHelper.floor_double( posX ); - startBlkY = MathHelper.floor_double( posY ); - startBlkZ = MathHelper.floor_double( posZ ); + this.startBlkX = MathHelper.floor_double( this.posX ); + this.startBlkY = MathHelper.floor_double( this.posY ); + this.startBlkZ = MathHelper.floor_double( this.posZ ); } public void fromItem(ForgeDirection d) @@ -97,7 +97,7 @@ public class CraftingFx extends EntityBreakingFX int blkX = MathHelper.floor_double( offX ); int blkY = MathHelper.floor_double( offY ); int blkZ = MathHelper.floor_double( offZ ); - if ( blkX == startBlkX && blkY == startBlkY && blkZ == startBlkZ ) + if ( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { offX -= interpPosX; offY -= interpPosY; diff --git a/src/main/java/appeng/client/render/effects/EnergyFx.java b/src/main/java/appeng/client/render/effects/EnergyFx.java index 6bba6d8ad..871775692 100644 --- a/src/main/java/appeng/client/render/effects/EnergyFx.java +++ b/src/main/java/appeng/client/render/effects/EnergyFx.java @@ -47,7 +47,7 @@ public class EnergyFx extends EntityBreakingFX public EnergyFx(World par1World, double par2, double par4, double par6, Item par8Item) { super( par1World, par2, par4, par6, par8Item ); - particleGravity = 0; + this.particleGravity = 0; this.particleBlue = 255; this.particleGreen = 255; this.particleRed = 255; @@ -55,9 +55,9 @@ public class EnergyFx extends EntityBreakingFX this.particleScale = 3.5f; this.particleTextureIndex = ExtraBlockTextures.BlockEnergyParticle.getIcon(); - startBlkX = MathHelper.floor_double( posX ); - startBlkY = MathHelper.floor_double( posY ); - startBlkZ = MathHelper.floor_double( posZ ); + this.startBlkX = MathHelper.floor_double( this.posX ); + this.startBlkY = MathHelper.floor_double( this.posY ); + this.startBlkZ = MathHelper.floor_double( this.posZ ); } public void fromItem(ForgeDirection d) @@ -90,11 +90,11 @@ public class EnergyFx extends EntityBreakingFX float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ); float f14 = 1.0F; - int blkX = MathHelper.floor_double( posX ); - int blkY = MathHelper.floor_double( posY ); - int blkZ = MathHelper.floor_double( posZ ); + int blkX = MathHelper.floor_double( this.posX ); + int blkY = MathHelper.floor_double( this.posY ); + int blkZ = MathHelper.floor_double( this.posZ ); - if ( blkX == startBlkX && blkY == startBlkY && blkZ == startBlkZ ) + if ( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, diff --git a/src/main/java/appeng/client/render/effects/LightningArcFX.java b/src/main/java/appeng/client/render/effects/LightningArcFX.java index 058b69ae9..7d45f9d64 100644 --- a/src/main/java/appeng/client/render/effects/LightningArcFX.java +++ b/src/main/java/appeng/client/render/effects/LightningArcFX.java @@ -34,23 +34,23 @@ public class LightningArcFX extends LightningFX this.ry = ey - y; this.rz = ez - z; - regen(); + this.regen(); } @Override protected void regen() { - double i = 1.0 / (steps - 1); - double lastDirectionX = rx * i; - double lastDirectionY = ry * i; - double lastDirectionZ = rz * i; + double i = 1.0 / (this.steps - 1); + double lastDirectionX = this.rx * i; + double lastDirectionY = this.ry * i; + double lastDirectionZ = this.rz * i; double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ ); - for (int s = 0; s < steps; s++) + for (int s = 0; s < this.steps; s++) { - Steps[s][0] = (lastDirectionX + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; - Steps[s][1] = (lastDirectionY + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; - Steps[s][2] = (lastDirectionZ + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; + this.Steps[s][0] = (lastDirectionX + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; + this.Steps[s][1] = (lastDirectionY + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; + this.Steps[s][2] = (lastDirectionZ + (rng.nextDouble() - 0.5) * len * 1.2) / 2.0; } } diff --git a/src/main/java/appeng/client/render/effects/LightningFX.java b/src/main/java/appeng/client/render/effects/LightningFX.java index 56c169ddd..1f6c3b846 100644 --- a/src/main/java/appeng/client/render/effects/LightningFX.java +++ b/src/main/java/appeng/client/render/effects/LightningFX.java @@ -30,17 +30,17 @@ import net.minecraft.world.World; public class LightningFX extends EntityFX { - final int steps = getSteps(); + final int steps = this.getSteps(); static final Random rng = new Random(); final double[][] Steps; protected LightningFX(World w, double x, double y, double z, double r, double g, double b, int maxAge) { super( w, x, y, z, r, g, b ); - Steps = new double[steps][3]; - motionX = 0; - motionY = 0; - motionZ = 0; - particleMaxAge = maxAge; + this.Steps = new double[this.steps][3]; + this.motionX = 0; + this.motionY = 0; + this.motionZ = 0; + this.particleMaxAge = maxAge; } private int getSteps() @@ -50,7 +50,7 @@ public class LightningFX extends EntityFX public LightningFX(World w, double x, double y, double z, double r, double g, double b) { this( w, x, y, z, r, g, b, 6 ); - regen(); + this.regen(); } float currentPoint = 0; @@ -67,11 +67,11 @@ public class LightningFX extends EntityFX double lastDirectionX = (rng.nextDouble() - 0.5) * 0.9; double lastDirectionY = (rng.nextDouble() - 0.5) * 0.9; double lastDirectionZ = (rng.nextDouble() - 0.5) * 0.9; - for (int s = 0; s < steps; s++) + for (int s = 0; s < this.steps; s++) { - Steps[s][0] = lastDirectionX = (lastDirectionX + (rng.nextDouble() - 0.5) * 0.9) / 2.0; - Steps[s][1] = lastDirectionY = (lastDirectionY + (rng.nextDouble() - 0.5) * 0.9) / 2.0; - Steps[s][2] = lastDirectionZ = (lastDirectionZ + (rng.nextDouble() - 0.5) * 0.9) / 2.0; + this.Steps[s][0] = lastDirectionX = (lastDirectionX + (rng.nextDouble() - 0.5) * 0.9) / 2.0; + this.Steps[s][1] = lastDirectionY = (lastDirectionY + (rng.nextDouble() - 0.5) * 0.9) / 2.0; + this.Steps[s][2] = lastDirectionZ = (lastDirectionZ + (rng.nextDouble() - 0.5) * 0.9) / 2.0; } } @@ -80,9 +80,9 @@ public class LightningFX extends EntityFX { float j = 1.0f; tess.setColorRGBA_F( this.particleRed * j * 0.9f, this.particleGreen * j * 0.95f, this.particleBlue * j, this.particleAlpha ); - if ( particleAge == 3 ) + if ( this.particleAge == 3 ) { - regen(); + this.regen(); } double f6 = this.particleTextureIndexX / 16.0; double f7 = f6 + 0.0324375F; @@ -127,17 +127,17 @@ public class LightningFX extends EntityFX for (int cycle = 0; cycle < 3; cycle++) { - clear(); + this.clear(); double x = (this.prevPosX + (this.posX - this.prevPosX) * l - interpPosX) - offX; double y = (this.prevPosY + (this.posY - this.prevPosY) * l - interpPosY) - offY; double z = (this.prevPosZ + (this.posZ - this.prevPosZ) * l - interpPosZ) - offZ; - for (int s = 0; s < steps; s++) + for (int s = 0; s < this.steps; s++) { - double xN = x + Steps[s][0]; - double yN = y + Steps[s][1]; - double zN = z + Steps[s][2]; + double xN = x + this.Steps[s][0]; + double yN = y + this.Steps[s][1]; + double zN = z + this.Steps[s][2]; double xD = xN - x; double yD = yN - y; @@ -162,7 +162,7 @@ public class LightningFX extends EntityFX oz = (xD * 0) - (1 * yD); } - double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ((((double) steps - (double) s) / steps) * scale); + double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ((((double) this.steps - (double) s) / this.steps) * scale); ox /= ss; oy /= ss; oz /= ss; @@ -175,7 +175,7 @@ public class LightningFX extends EntityFX b[1] = y; b[2] = z; - draw( tess, a, b, f6, f8 ); + this.draw( tess, a, b, f6, f8 ); x = xN; y = yN; @@ -195,23 +195,23 @@ public class LightningFX extends EntityFX private void draw(Tessellator tess, double[] a, double[] b, double f6, double f8) { - if ( hasData ) + if ( this.hasData ) { tess.addVertexWithUV( a[0], a[1], a[2], f6, f8 ); - tess.addVertexWithUV( I[0], I[1], I[2], f6, f8 ); - tess.addVertexWithUV( K[0], K[1], K[2], f6, f8 ); + tess.addVertexWithUV( this.I[0], this.I[1], this.I[2], f6, f8 ); + tess.addVertexWithUV( this.K[0], this.K[1], this.K[2], f6, f8 ); tess.addVertexWithUV( b[0], b[1], b[2], f6, f8 ); } - hasData = true; + this.hasData = true; for (int x = 0; x < 3; x++) { - I[x] = a[x]; - K[x] = b[x]; + this.I[x] = a[x]; + this.K[x] = b[x]; } } private void clear() { - hasData = false; + this.hasData = false; } } diff --git a/src/main/java/appeng/client/render/effects/MatterCannonFX.java b/src/main/java/appeng/client/render/effects/MatterCannonFX.java index 66f08f956..2bd353b07 100644 --- a/src/main/java/appeng/client/render/effects/MatterCannonFX.java +++ b/src/main/java/appeng/client/render/effects/MatterCannonFX.java @@ -33,7 +33,7 @@ public class MatterCannonFX extends EntityBreakingFX public MatterCannonFX(World par1World, double par2, double par4, double par6, Item par8Item) { super( par1World, par2, par4, par6, par8Item ); - particleGravity = 0; + this.particleGravity = 0; this.particleBlue = 255; this.particleGreen = 255; this.particleRed = 255; diff --git a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java index c8b41c7ef..517a67d0a 100644 --- a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java +++ b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java @@ -40,7 +40,7 @@ public class ItemEncodedPatternRenderer implements IItemRenderer { boolean isShiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT ); - if ( !recursive && type == IItemRenderer.ItemRenderType.INVENTORY && isShiftHeld ) + if ( !this.recursive && type == IItemRenderer.ItemRenderType.INVENTORY && isShiftHeld ) { ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); if ( iep.getOutput( item ) != null ) @@ -59,7 +59,7 @@ public class ItemEncodedPatternRenderer implements IItemRenderer @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - recursive = true; + this.recursive = true; ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); @@ -68,10 +68,10 @@ public class ItemEncodedPatternRenderer implements IItemRenderer GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); RenderHelper.enableGUIStandardItemLighting(); - ri.renderItemAndEffectIntoGUI( mc.fontRenderer, mc.getTextureManager(), is, 0, 0 ); + this.ri.renderItemAndEffectIntoGUI( mc.fontRenderer, mc.getTextureManager(), is, 0, 0 ); RenderHelper.disableStandardItemLighting(); GL11.glPopAttrib(); - recursive = false; + this.recursive = false; } } diff --git a/src/main/java/appeng/client/render/model/ModelCompass.java b/src/main/java/appeng/client/render/model/ModelCompass.java index 8fffc5af2..70de95b87 100644 --- a/src/main/java/appeng/client/render/model/ModelCompass.java +++ b/src/main/java/appeng/client/render/model/ModelCompass.java @@ -34,60 +34,60 @@ public class ModelCompass extends ModelBase final ModelRenderer Pointer; public ModelCompass() { - textureWidth = 16; - textureHeight = 8; + this.textureWidth = 16; + this.textureHeight = 8; - Ring1 = new ModelRenderer( this, 0, 0 ); - Ring1.addBox( 0F, 0F, 0F, 4, 1, 1 ); - Ring1.setRotationPoint( -2F, 22F, 2F ); - Ring1.setTextureSize( 16, 8 ); - Ring1.mirror = true; - setRotation( Ring1, 0F, 0F, 0F ); + this.Ring1 = new ModelRenderer( this, 0, 0 ); + this.Ring1.addBox( 0F, 0F, 0F, 4, 1, 1 ); + this.Ring1.setRotationPoint( -2F, 22F, 2F ); + this.Ring1.setTextureSize( 16, 8 ); + this.Ring1.mirror = true; + this.setRotation( this.Ring1, 0F, 0F, 0F ); - Ring2 = new ModelRenderer( this, 0, 0 ); - Ring2.addBox( 0F, 0F, 0F, 1, 1, 4 ); - Ring2.setRotationPoint( -3F, 22F, -2F ); - Ring2.setTextureSize( 16, 8 ); - Ring2.mirror = true; - setRotation( Ring2, 0F, 0F, 0F ); + this.Ring2 = new ModelRenderer( this, 0, 0 ); + this.Ring2.addBox( 0F, 0F, 0F, 1, 1, 4 ); + this.Ring2.setRotationPoint( -3F, 22F, -2F ); + this.Ring2.setTextureSize( 16, 8 ); + this.Ring2.mirror = true; + this.setRotation( this.Ring2, 0F, 0F, 0F ); - Ring3 = new ModelRenderer( this, 0, 0 ); - Ring3.addBox( 0F, 0F, 0F, 4, 1, 1 ); - Ring3.setRotationPoint( -2F, 22F, -3F ); - Ring3.setTextureSize( 16, 8 ); - Ring3.mirror = true; - setRotation( Ring3, 0F, 0F, 0F ); + this.Ring3 = new ModelRenderer( this, 0, 0 ); + this.Ring3.addBox( 0F, 0F, 0F, 4, 1, 1 ); + this.Ring3.setRotationPoint( -2F, 22F, -3F ); + this.Ring3.setTextureSize( 16, 8 ); + this.Ring3.mirror = true; + this.setRotation( this.Ring3, 0F, 0F, 0F ); - Ring4 = new ModelRenderer( this, 0, 0 ); - Ring4.addBox( 0F, 0F, 0F, 1, 1, 4 ); - Ring4.setRotationPoint( 2F, 22F, -2F ); - Ring4.setTextureSize( 16, 8 ); - Ring4.mirror = true; - setRotation( Ring4, 0F, 0F, 0F ); + this.Ring4 = new ModelRenderer( this, 0, 0 ); + this.Ring4.addBox( 0F, 0F, 0F, 1, 1, 4 ); + this.Ring4.setRotationPoint( 2F, 22F, -2F ); + this.Ring4.setTextureSize( 16, 8 ); + this.Ring4.mirror = true; + this.setRotation( this.Ring4, 0F, 0F, 0F ); - Middle = new ModelRenderer( this, 0, 0 ); - Middle.addBox( 0F, 0F, 0F, 1, 1, 1 ); - Middle.setRotationPoint( -0.5333334F, 22F, -0.5333334F ); - Middle.setTextureSize( 16, 8 ); - Middle.mirror = true; - setRotation( Middle, 0F, 0F, 0F ); + this.Middle = new ModelRenderer( this, 0, 0 ); + this.Middle.addBox( 0F, 0F, 0F, 1, 1, 1 ); + this.Middle.setRotationPoint( -0.5333334F, 22F, -0.5333334F ); + this.Middle.setTextureSize( 16, 8 ); + this.Middle.mirror = true; + this.setRotation( this.Middle, 0F, 0F, 0F ); - Pointer = new ModelRenderer( this, 0, 0 ); - Pointer.setTextureOffset( 0, 5 ); - Pointer.addBox( -0.5F, 0F, 0F, 1, 1, 2 ); - Pointer.setRotationPoint( 0.5F, 22.5F, 0.5F ); - Pointer.setTextureSize( 16, 8 ); - Pointer.mirror = true; - Pointer.offsetZ = -0.034f; - Pointer.offsetX = -0.034f; - setRotation( Pointer, 0F, 0F, 0F ); + this.Pointer = new ModelRenderer( this, 0, 0 ); + this.Pointer.setTextureOffset( 0, 5 ); + this.Pointer.addBox( -0.5F, 0F, 0F, 1, 1, 2 ); + this.Pointer.setRotationPoint( 0.5F, 22.5F, 0.5F ); + this.Pointer.setTextureSize( 16, 8 ); + this.Pointer.mirror = true; + this.Pointer.offsetZ = -0.034f; + this.Pointer.offsetX = -0.034f; + this.setRotation( this.Pointer, 0F, 0F, 0F ); - Base = new ModelRenderer( this, 0, 0 ); - Base.addBox( 0F, 0F, 0F, 4, 1, 4 ); - Base.setRotationPoint( -2F, 23F, -2F ); - Base.setTextureSize( 16, 8 ); - Base.mirror = true; - setRotation( Base, 0F, 0F, 0F ); + this.Base = new ModelRenderer( this, 0, 0 ); + this.Base.addBox( 0F, 0F, 0F, 4, 1, 4 ); + this.Base.setRotationPoint( -2F, 23F, -2F ); + this.Base.setTextureSize( 16, 8 ); + this.Base.mirror = true; + this.setRotation( this.Base, 0F, 0F, 0F ); } private void setRotation(ModelRenderer model, float x, float y, float z) @@ -99,18 +99,18 @@ public class ModelCompass extends ModelBase public void renderAll(float rad) { - setRotation( Pointer, 0F, 0F, 0F ); + this.setRotation( this.Pointer, 0F, 0F, 0F ); - Pointer.rotateAngleY = rad; + this.Pointer.rotateAngleY = rad; - Base.render( 0.0625F ); - Middle.render( 0.0625F ); + this.Base.render( 0.0625F ); + this.Middle.render( 0.0625F ); - Pointer.render( 0.0625F ); + this.Pointer.render( 0.0625F ); - Ring1.render( 0.0625F ); - Ring2.render( 0.0625F ); - Ring3.render( 0.0625F ); - Ring4.render( 0.0625F ); + this.Ring1.render( 0.0625F ); + this.Ring2.render( 0.0625F ); + this.Ring3.render( 0.0625F ); + this.Ring4.render( 0.0625F ); } } diff --git a/src/main/java/appeng/client/texture/CableBusTextures.java b/src/main/java/appeng/client/texture/CableBusTextures.java index 4656d1bbe..1f8edf28d 100644 --- a/src/main/java/appeng/client/texture/CableBusTextures.java +++ b/src/main/java/appeng/client/texture/CableBusTextures.java @@ -97,7 +97,7 @@ public enum CableBusTextures public String getName() { - return name; + return this.name; } private CableBusTextures(String name) { @@ -106,12 +106,12 @@ public enum CableBusTextures public IIcon getIcon() { - return IIcon; + return this.IIcon; } public void registerIcon(TextureMap map) { - IIcon = map.registerIcon( "appliedenergistics2:" + name ); + this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/client/texture/ExtraBlockTextures.java b/src/main/java/appeng/client/texture/ExtraBlockTextures.java index d56f67c82..946a99e60 100644 --- a/src/main/java/appeng/client/texture/ExtraBlockTextures.java +++ b/src/main/java/appeng/client/texture/ExtraBlockTextures.java @@ -107,7 +107,7 @@ public enum ExtraBlockTextures public String getName() { - return name; + return this.name; } private ExtraBlockTextures(String name) { @@ -116,12 +116,12 @@ public enum ExtraBlockTextures public IIcon getIcon() { - return IIcon; + return this.IIcon; } public void registerIcon(TextureMap map) { - IIcon = map.registerIcon( "appliedenergistics2:" + name ); + this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/client/texture/ExtraItemTextures.java b/src/main/java/appeng/client/texture/ExtraItemTextures.java index 535fa080a..3213fc808 100644 --- a/src/main/java/appeng/client/texture/ExtraItemTextures.java +++ b/src/main/java/appeng/client/texture/ExtraItemTextures.java @@ -45,7 +45,7 @@ public enum ExtraItemTextures public String getName() { - return name; + return this.name; } private ExtraItemTextures(String name) { @@ -54,12 +54,12 @@ public enum ExtraItemTextures public IIcon getIcon() { - return IIcon; + return this.IIcon; } public void registerIcon(TextureMap map) { - IIcon = map.registerIcon( "appliedenergistics2:" + name ); + this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/client/texture/FlippableIcon.java b/src/main/java/appeng/client/texture/FlippableIcon.java index f97188fdd..2f45ce1ca 100644 --- a/src/main/java/appeng/client/texture/FlippableIcon.java +++ b/src/main/java/appeng/client/texture/FlippableIcon.java @@ -32,92 +32,92 @@ public class FlippableIcon implements IIcon if ( o == null ) throw new RuntimeException( "Cannot create a wrapper icon with a null icon." ); - original = o; - flip_u = false; - flip_v = false; + this.original = o; + this.flip_u = false; + this.flip_v = false; } @Override public int getIconWidth() { - return original.getIconWidth(); + return this.original.getIconWidth(); } @Override public int getIconHeight() { - return original.getIconHeight(); + return this.original.getIconHeight(); } @Override public float getMinU() { - if ( flip_u ) - return original.getMaxU(); - return original.getMinU(); + if ( this.flip_u ) + return this.original.getMaxU(); + return this.original.getMinU(); } @Override public float getMaxU() { - if ( flip_u ) - return original.getMinU(); - return original.getMaxU(); + if ( this.flip_u ) + return this.original.getMinU(); + return this.original.getMaxU(); } @Override public float getInterpolatedU(double px) { - if ( flip_u ) - return original.getInterpolatedU( 16 - px ); - return original.getInterpolatedU( px ); + if ( this.flip_u ) + return this.original.getInterpolatedU( 16 - px ); + return this.original.getInterpolatedU( px ); } @Override public float getMinV() { - if ( flip_v ) - return original.getMaxV(); - return original.getMinV(); + if ( this.flip_v ) + return this.original.getMaxV(); + return this.original.getMinV(); } @Override public float getMaxV() { - if ( flip_v ) - return original.getMinV(); - return original.getMaxV(); + if ( this.flip_v ) + return this.original.getMinV(); + return this.original.getMaxV(); } @Override public float getInterpolatedV(double px) { - if ( flip_v ) - return original.getInterpolatedV( 16 - px ); - return original.getInterpolatedV( px ); + if ( this.flip_v ) + return this.original.getInterpolatedV( 16 - px ); + return this.original.getInterpolatedV( px ); } @Override public String getIconName() { - return original.getIconName(); + return this.original.getIconName(); } public IIcon getOriginal() { - return original; + return this.original; } public void setFlip(boolean u, boolean v) { - flip_u = u; - flip_v = v; + this.flip_u = u; + this.flip_v = v; } public int setFlip(int orientation) { - flip_u = (orientation & 8) == 8; - flip_v = (orientation & 16) == 16; + this.flip_u = (orientation & 8) == 8; + this.flip_v = (orientation & 16) == 16; return orientation & 7; } diff --git a/src/main/java/appeng/client/texture/FullIcon.java b/src/main/java/appeng/client/texture/FullIcon.java index e6a8d8b12..5f48bf102 100644 --- a/src/main/java/appeng/client/texture/FullIcon.java +++ b/src/main/java/appeng/client/texture/FullIcon.java @@ -32,21 +32,21 @@ public class FullIcon implements IIcon if ( o == null ) throw new RuntimeException("Cannot create a wrapper icon with a null icon."); - p = o; + this.p = o; } @Override @SideOnly(Side.CLIENT) public float getMinU() { - return p.getMinU(); + return this.p.getMinU(); } @Override @SideOnly(Side.CLIENT) public float getMaxU() { - return p.getMaxU(); + return this.p.getMaxU(); } @Override @@ -54,22 +54,22 @@ public class FullIcon implements IIcon public float getInterpolatedU(double d0) { if ( d0 > 8.0 ) - return p.getMaxU(); - return p.getMinU(); + return this.p.getMaxU(); + return this.p.getMinU(); } @Override @SideOnly(Side.CLIENT) public float getMinV() { - return p.getMinV(); + return this.p.getMinV(); } @Override @SideOnly(Side.CLIENT) public float getMaxV() { - return p.getMaxV(); + return this.p.getMaxV(); } @Override @@ -77,27 +77,27 @@ public class FullIcon implements IIcon public float getInterpolatedV(double d0) { if ( d0 > 8.0 ) - return p.getMaxV(); - return p.getMinV(); + return this.p.getMaxV(); + return this.p.getMinV(); } @Override @SideOnly(Side.CLIENT) public String getIconName() { - return p.getIconName(); + return this.p.getIconName(); } @Override public int getIconWidth() { - return p.getIconWidth(); + return this.p.getIconWidth(); } @Override public int getIconHeight() { - return p.getIconHeight(); + return this.p.getIconHeight(); } } diff --git a/src/main/java/appeng/client/texture/MissingIcon.java b/src/main/java/appeng/client/texture/MissingIcon.java index 333f59af8..7d85cb66d 100644 --- a/src/main/java/appeng/client/texture/MissingIcon.java +++ b/src/main/java/appeng/client/texture/MissingIcon.java @@ -31,68 +31,68 @@ public class MissingIcon implements IIcon final boolean isBlock; public MissingIcon(Object forWhat) { - isBlock = forWhat instanceof Block; + this.isBlock = forWhat instanceof Block; } @SideOnly(Side.CLIENT) public IIcon getMissing() { return ((TextureMap) Minecraft.getMinecraft().getTextureManager() - .getTexture( isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture )).getAtlasSprite( "missingno" ); + .getTexture( this.isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture )).getAtlasSprite( "missingno" ); } @Override public int getIconWidth() { - return getMissing().getIconWidth(); + return this.getMissing().getIconWidth(); } @Override public int getIconHeight() { - return getMissing().getIconHeight(); + return this.getMissing().getIconHeight(); } @Override public float getMinU() { - return getMissing().getMinU(); + return this.getMissing().getMinU(); } @Override public float getMaxU() { - return getMissing().getMaxU(); + return this.getMissing().getMaxU(); } @Override public float getInterpolatedU(double var1) { - return getMissing().getInterpolatedU( var1 ); + return this.getMissing().getInterpolatedU( var1 ); } @Override public float getMinV() { - return getMissing().getMinV(); + return this.getMissing().getMinV(); } @Override public float getMaxV() { - return getMissing().getMaxV(); + return this.getMissing().getMaxV(); } @Override public float getInterpolatedV(double var1) { - return getMissing().getInterpolatedV( var1 ); + return this.getMissing().getInterpolatedV( var1 ); } @Override public String getIconName() { - return getMissing().getIconName(); + return this.getMissing().getIconName(); } } diff --git a/src/main/java/appeng/client/texture/OffsetIcon.java b/src/main/java/appeng/client/texture/OffsetIcon.java index a77b4d6ac..1e5700959 100644 --- a/src/main/java/appeng/client/texture/OffsetIcon.java +++ b/src/main/java/appeng/client/texture/OffsetIcon.java @@ -35,80 +35,80 @@ public class OffsetIcon implements IIcon if ( o == null ) throw new RuntimeException("Cannot create a wrapper icon with a null icon."); - p = o; - offsetX = x; - offsetY = y; + this.p = o; + this.offsetX = x; + this.offsetY = y; } @Override @SideOnly(Side.CLIENT) public float getMinU() { - return u( 0 - offsetX ); + return this.u( 0 - this.offsetX ); } @Override @SideOnly(Side.CLIENT) public float getMaxU() { - return u( 16 - offsetX ); + return this.u( 16 - this.offsetX ); } @Override @SideOnly(Side.CLIENT) public float getInterpolatedU(double d0) { - return u( d0 - offsetX ); + return this.u( d0 - this.offsetX ); } @Override @SideOnly(Side.CLIENT) public float getMinV() { - return v( 0 - offsetY ); + return this.v( 0 - this.offsetY ); } @Override @SideOnly(Side.CLIENT) public float getMaxV() { - return v( 16 - offsetY ); + return this.v( 16 - this.offsetY ); } @Override @SideOnly(Side.CLIENT) public float getInterpolatedV(double d0) { - return v( d0 - offsetY ); + return this.v( d0 - this.offsetY ); } private float v(double d) { - return p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); + return this.p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); } private float u(double d) { - return p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); + return this.p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); } @Override @SideOnly(Side.CLIENT) public String getIconName() { - return p.getIconName(); + return this.p.getIconName(); } @Override public int getIconWidth() { - return p.getIconWidth(); + return this.p.getIconWidth(); } @Override public int getIconHeight() { - return p.getIconHeight(); + return this.p.getIconHeight(); } } diff --git a/src/main/java/appeng/client/texture/TaughtIcon.java b/src/main/java/appeng/client/texture/TaughtIcon.java index 05e0e4e15..9b7bfff9c 100644 --- a/src/main/java/appeng/client/texture/TaughtIcon.java +++ b/src/main/java/appeng/client/texture/TaughtIcon.java @@ -34,7 +34,7 @@ public class TaughtIcon implements IIcon if ( o == null ) throw new RuntimeException("Cannot create a wrapper icon with a null icon."); - p = o; + this.p = o; this.tightness = tightness * 0.4f; } @@ -42,79 +42,79 @@ public class TaughtIcon implements IIcon @SideOnly(Side.CLIENT) public float getMinU() { - return u( 0 ); + return this.u( 0 ); } @Override @SideOnly(Side.CLIENT) public float getMaxU() { - return u( 16 ); + return this.u( 16 ); } @Override @SideOnly(Side.CLIENT) public float getInterpolatedU(double d0) { - return u( d0 ); + return this.u( d0 ); } @Override @SideOnly(Side.CLIENT) public float getMinV() { - return v( 0 ); + return this.v( 0 ); } @Override @SideOnly(Side.CLIENT) public float getMaxV() { - return v( 16 ); + return this.v( 16 ); } @Override @SideOnly(Side.CLIENT) public float getInterpolatedV(double d0) { - return v( d0 ); + return this.v( d0 ); } private float v(double d) { if ( d < 8 ) - d -= tightness; + d -= this.tightness; if ( d > 8 ) - d += tightness; - return p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); + d += this.tightness; + return this.p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); } private float u(double d) { if ( d < 8 ) - d -= tightness; + d -= this.tightness; if ( d > 8 ) - d += tightness; - return p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); + d += this.tightness; + return this.p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); } @Override @SideOnly(Side.CLIENT) public String getIconName() { - return p.getIconName(); + return this.p.getIconName(); } @Override public int getIconWidth() { - return p.getIconWidth(); + return this.p.getIconWidth(); } @Override public int getIconHeight() { - return p.getIconHeight(); + return this.p.getIconHeight(); } } diff --git a/src/main/java/appeng/client/texture/TmpFlippableIcon.java b/src/main/java/appeng/client/texture/TmpFlippableIcon.java index d66f11bfc..722dc438d 100644 --- a/src/main/java/appeng/client/texture/TmpFlippableIcon.java +++ b/src/main/java/appeng/client/texture/TmpFlippableIcon.java @@ -32,7 +32,7 @@ public class TmpFlippableIcon extends FlippableIcon public void setOriginal(IIcon i) { - setFlip( false, false ); + this.setFlip( false, false ); while (i instanceof FlippableIcon) { @@ -47,9 +47,9 @@ public class TmpFlippableIcon extends FlippableIcon } if ( i == null ) - original = nullIcon; + this.original = nullIcon; else - original = i; + this.original = i; } } diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index bee6c1914..4005d352b 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -93,35 +93,35 @@ public abstract class AEBaseContainer extends Container public void postPartial(PacketPartialItem packetPartialItem) { - dataChunks.add( packetPartialItem ); - if ( packetPartialItem.getPageCount() == dataChunks.size() ) - parsePartials(); + this.dataChunks.add( packetPartialItem ); + if ( packetPartialItem.getPageCount() == this.dataChunks.size() ) + this.parsePartials(); } private void parsePartials() { int total = 0; - for (PacketPartialItem ppi : dataChunks) + for (PacketPartialItem ppi : this.dataChunks) total += ppi.getSize(); byte[] buffer = new byte[total]; int cursor = 0; - for (PacketPartialItem ppi : dataChunks) + for (PacketPartialItem ppi : this.dataChunks) cursor = ppi.write( buffer, cursor ); try { NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) ); if ( data != null ) - setTargetStack( AEApi.instance().storage().createItemStack( ItemStack.loadItemStackFromNBT( data ) ) ); + this.setTargetStack( AEApi.instance().storage().createItemStack( ItemStack.loadItemStackFromNBT( data ) ) ); } catch (IOException e) { AELog.error( e ); } - dataChunks.clear(); + this.dataChunks.clear(); } public void setTargetStack(IAEItemStack stack) @@ -130,7 +130,7 @@ public abstract class AEBaseContainer extends Container if ( Platform.isClient() ) { ItemStack a = stack == null ? null : stack.getItemStack(); - ItemStack b = clientRequestedTargetItem == null ? null : clientRequestedTargetItem.getItemStack(); + ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); if ( Platform.isSameItemPrecise( a, b ) ) return; @@ -175,17 +175,17 @@ public abstract class AEBaseContainer extends Container } } - clientRequestedTargetItem = stack == null ? null : stack.copy(); + this.clientRequestedTargetItem = stack == null ? null : stack.copy(); } public IAEItemStack getTargetStack() { - return clientRequestedTargetItem; + return this.clientRequestedTargetItem; } public BaseActionSource getSource() { - return mySrc; + return this.mySrc; } public void verifyPermissions(SecurityPermissions security, boolean requirePower) @@ -193,17 +193,17 @@ public abstract class AEBaseContainer extends Container if ( Platform.isClient() ) return; - ticksSinceCheck++; - if ( ticksSinceCheck < 20 ) + this.ticksSinceCheck++; + if ( this.ticksSinceCheck < 20 ) return; - ticksSinceCheck = 0; - isContainerValid = isContainerValid && hasAccess( security, requirePower ); + this.ticksSinceCheck = 0; + this.isContainerValid = this.isContainerValid && this.hasAccess( security, requirePower ); } protected boolean hasAccess(SecurityPermissions perm, boolean requirePower) { - IActionHost host = getActionHost(); + IActionHost host = this.getActionHost(); if ( host != null ) { @@ -221,7 +221,7 @@ public abstract class AEBaseContainer extends Container } ISecurityGrid sg = g.getCache( ISecurityGrid.class ); - if ( sg.hasPermission( invPlayer.player, perm ) ) + if ( sg.hasPermission( this.invPlayer.player, perm ) ) return true; } } @@ -238,17 +238,17 @@ public abstract class AEBaseContainer extends Container public void lockPlayerInventorySlot(int idx) { - locked.add( idx ); + this.locked.add( idx ); } public Object getTarget() { - if ( tileEntity != null ) - return tileEntity; - if ( part != null ) - return part; - if ( obj != null ) - return obj; + if ( this.tileEntity != null ) + return this.tileEntity; + if ( this.part != null ) + return this.part; + if ( this.obj != null ) + return this.obj; return null; } @@ -257,38 +257,38 @@ public abstract class AEBaseContainer extends Container } public AEBaseContainer(InventoryPlayer ip, TileEntity myTile, IPart myPart, IGuiItemObject gio) { - invPlayer = ip; - tileEntity = myTile; - part = myPart; - obj = gio; - mySrc = new PlayerSource( ip.player, getActionHost() ); - prepareSync(); + this.invPlayer = ip; + this.tileEntity = myTile; + this.part = myPart; + this.obj = gio; + this.mySrc = new PlayerSource( ip.player, this.getActionHost() ); + this.prepareSync(); } public AEBaseContainer(InventoryPlayer ip, Object anchor) { - invPlayer = ip; - tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; - part = anchor instanceof IPart ? (IPart) anchor : null; - obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null; + this.invPlayer = ip; + this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; + this.part = anchor instanceof IPart ? (IPart) anchor : null; + this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null; - if ( tileEntity == null && part == null && obj == null ) + if ( this.tileEntity == null && this.part == null && this.obj == null ) throw new RuntimeException( "Must have a valid anchor" ); - mySrc = new PlayerSource( ip.player, getActionHost() ); + this.mySrc = new PlayerSource( ip.player, this.getActionHost() ); - prepareSync(); + this.prepareSync(); } protected IActionHost getActionHost() { - if ( obj instanceof IActionHost ) - return (IActionHost) obj; + if ( this.obj instanceof IActionHost ) + return (IActionHost) this.obj; - if ( tileEntity instanceof IActionHost ) - return (IActionHost) tileEntity; + if ( this.tileEntity instanceof IActionHost ) + return (IActionHost) this.tileEntity; - if ( part instanceof IActionHost ) - return (IActionHost) part; + if ( this.part instanceof IActionHost ) + return (IActionHost) this.part; return null; } @@ -301,12 +301,12 @@ public abstract class AEBaseContainer extends Container public InventoryPlayer getPlayerInv() { - return invPlayer; + return this.invPlayer; } public TileEntity getTileEntity() { - return tileEntity; + return this.tileEntity; } @Override @@ -325,10 +325,10 @@ public abstract class AEBaseContainer extends Container @Override public boolean canInteractWith(EntityPlayer entityplayer) { - if ( isContainerValid ) + if ( this.isContainerValid ) { - if ( tileEntity instanceof IInventory ) - return ((IInventory) tileEntity).isUseableByPlayer( entityplayer ); + if ( this.tileEntity instanceof IInventory ) + return ((IInventory) this.tileEntity).isUseableByPlayer( entityplayer ); return true; } return false; @@ -374,7 +374,7 @@ public abstract class AEBaseContainer extends Container */ if ( clickSlot.isPlayerSide() ) { - tis = shiftStoreItem( tis ); + tis = this.shiftStoreItem( tis ); // target slots in the container... for (Object inventorySlot : this.inventorySlots) @@ -430,7 +430,7 @@ public abstract class AEBaseContainer extends Container { cs.putStack( tis.copy() ); cs.onSlotChanged(); - updateSlot( cs ); + this.updateSlot( cs ); return null; } } @@ -475,12 +475,12 @@ public abstract class AEBaseContainer extends Container // if ( hasMETiles ) updateClient(); - updateSlot( clickSlot ); - updateSlot( d ); + this.updateSlot( clickSlot ); + this.updateSlot( d ); return null; } else - updateSlot( d ); + this.updateSlot( d ); } } } @@ -523,12 +523,12 @@ public abstract class AEBaseContainer extends Container // worldEntity.markDirty(); // if ( hasMETiles ) updateClient(); - updateSlot( clickSlot ); - updateSlot( d ); + this.updateSlot( clickSlot ); + this.updateSlot( d ); return null; } else - updateSlot( d ); + this.updateSlot( d ); } } else @@ -553,12 +553,12 @@ public abstract class AEBaseContainer extends Container // worldEntity.markDirty(); // if ( hasMETiles ) updateClient(); - updateSlot( clickSlot ); - updateSlot( d ); + this.updateSlot( clickSlot ); + this.updateSlot( d ); return null; } else - updateSlot( d ); + this.updateSlot( d ); } } } @@ -567,14 +567,14 @@ public abstract class AEBaseContainer extends Container clickSlot.putStack( tis != null ? tis.copy() : null ); } - updateSlot( clickSlot ); + this.updateSlot( clickSlot ); return null; } private void updateSlot(Slot clickSlot) { // ??? - detectAndSendChanges(); + this.detectAndSendChanges(); } final HashMap syncData = new HashMap(); @@ -582,7 +582,7 @@ public abstract class AEBaseContainer extends Container @Override public void detectAndSendChanges() { - sendCustomName(); + this.sendCustomName(); if ( Platform.isServer() ) { @@ -590,7 +590,7 @@ public abstract class AEBaseContainer extends Container { ICrafting icrafting = (ICrafting) crafter; - for (SyncData sd : syncData.values()) + for (SyncData sd : this.syncData.values()) sd.tick( icrafting ); } } @@ -601,63 +601,63 @@ public abstract class AEBaseContainer extends Container @Override final public void updateProgressBar(int idx, int value) { - if ( syncData.containsKey( idx ) ) + if ( this.syncData.containsKey( idx ) ) { - syncData.get( idx ).update( (long) value ); + this.syncData.get( idx ).update( (long) value ); } } final public void updateFullProgressBar(int idx, long value) { - if ( syncData.containsKey( idx ) ) + if ( this.syncData.containsKey( idx ) ) { - syncData.get( idx ).update( value ); + this.syncData.get( idx ).update( value ); return; } - updateProgressBar( idx, (int) value ); + this.updateProgressBar( idx, (int) value ); } public void stringSync(int idx, String value) { - if ( syncData.containsKey( idx ) ) + if ( this.syncData.containsKey( idx ) ) { - syncData.get( idx ).update( value ); + this.syncData.get( idx ).update( value ); } } private void prepareSync() { - for (Field f : getClass().getFields()) + for (Field f : this.getClass().getFields()) { if ( f.isAnnotationPresent( GuiSync.class ) ) { GuiSync annotation = f.getAnnotation( GuiSync.class ); - if ( syncData.containsKey( annotation.value() ) ) + if ( this.syncData.containsKey( annotation.value() ) ) AELog.warning( "Channel already in use: " + annotation.value() + " for " + f.getName() ); else - syncData.put( annotation.value(), new SyncData( this, f, annotation ) ); + this.syncData.put( annotation.value(), new SyncData( this, f, annotation ) ); } } } protected void sendCustomName() { - if ( !sentCustomName ) + if ( !this.sentCustomName ) { - sentCustomName = true; + this.sentCustomName = true; if ( Platform.isServer() ) { ICustomNameObject name = null; - if ( part instanceof ICustomNameObject ) - name = (ICustomNameObject) part; + if ( this.part instanceof ICustomNameObject ) + name = (ICustomNameObject) this.part; - if ( tileEntity instanceof ICustomNameObject ) - name = (ICustomNameObject) tileEntity; + if ( this.tileEntity instanceof ICustomNameObject ) + name = (ICustomNameObject) this.tileEntity; - if ( obj instanceof ICustomNameObject ) - name = (ICustomNameObject) obj; + if ( this.obj instanceof ICustomNameObject ) + name = (ICustomNameObject) this.obj; if ( this instanceof ICustomNameObject ) name = (ICustomNameObject) this; @@ -665,13 +665,13 @@ public abstract class AEBaseContainer extends Container if ( name != null ) { if ( name.hasCustomName() ) - customName = name.getCustomName(); + this.customName = name.getCustomName(); - if ( customName != null ) + if ( this.customName != null ) { try { - NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", customName ), (EntityPlayerMP) invPlayer.player ); + NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.customName ), (EntityPlayerMP) this.invPlayer.player ); } catch (IOException e) { @@ -687,29 +687,29 @@ public abstract class AEBaseContainer extends Container { for (int i = 0; i < 9; i++) { - if ( locked.contains( i ) ) - addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) ); + if ( this.locked.contains( i ) ) + this.addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) ); else - addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) ); + this.addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) ); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - if ( locked.contains( j + i * 9 + 9 ) ) - addSlotToContainer( new SlotDisabled( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) ); + if ( this.locked.contains( j + i * 9 + 9 ) ) + this.addSlotToContainer( new SlotDisabled( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) ); else - addSlotToContainer( new SlotPlayerInv( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) ); + this.addSlotToContainer( new SlotPlayerInv( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) ); } } } public ItemStack shiftStoreItem(ItemStack input) { - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return input; - IAEItemStack ais = Platform.poweredInsert( powerSrc, cellInv, AEApi.instance().storage().createItemStack( input ), mySrc ); + IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc ); if ( ais == null ) return null; return ais.getItemStack(); @@ -717,9 +717,9 @@ public abstract class AEBaseContainer extends Container public void doAction(EntityPlayerMP player, InventoryAction action, int slot, long id) { - if ( slot >= 0 && slot < inventorySlots.size() ) + if ( slot >= 0 && slot < this.inventorySlots.size() ) { - Slot s = getSlot( slot ); + Slot s = this.getSlot( slot ); if ( s instanceof SlotCraftingTerm ) { @@ -729,7 +729,7 @@ public abstract class AEBaseContainer extends Container case CRAFT_ITEM: case CRAFT_STACK: ((SlotCraftingTerm) s).doClick( action, player ); - updateHeld( player ); + this.updateHeld( player ); default: } } @@ -796,26 +796,26 @@ public abstract class AEBaseContainer extends Container { List from = new LinkedList(); - for (Object j : inventorySlots) + for (Object j : this.inventorySlots) { if ( j instanceof Slot && j.getClass() == s.getClass() ) from.add( (Slot) j ); } for (Slot fr : from) - transferStackInSlot( player, fr.slotNumber ); + this.transferStackInSlot( player, fr.slotNumber ); } return; } // get target item. - IAEItemStack slotItem = getTargetStack(); + IAEItemStack slotItem = this.getTargetStack(); switch (action) { case SHIFT_CLICK: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; if ( slotItem != null ) @@ -832,13 +832,13 @@ public abstract class AEBaseContainer extends Container if ( myItem != null ) ais.setStackSize( ais.getStackSize() - myItem.stackSize ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais != null ) adp.addItems( ais.getItemStack() ); } break; case ROLL_DOWN: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; int releaseQty = 1; @@ -850,23 +850,23 @@ public abstract class AEBaseContainer extends Container ais.setStackSize( 1 ); IAEItemStack extracted = ais.copy(); - ais = Platform.poweredInsert( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais == null ) { InventoryAdaptor ia = new AdaptorPlayerHand( player ); ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null ); if ( fail == null ) - cellInv.extractItems( extracted, Actionable.MODULATE, mySrc ); + this.cellInv.extractItems( extracted, Actionable.MODULATE, this.mySrc ); - updateHeld( player ); + this.updateHeld( player ); } } break; case ROLL_UP: case PICKUP_SINGLE: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; if ( slotItem != null ) @@ -886,22 +886,22 @@ public abstract class AEBaseContainer extends Container { IAEItemStack ais = slotItem.copy(); ais.setStackSize( 1 ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais != null ) { InventoryAdaptor ia = new AdaptorPlayerHand( player ); ItemStack fail = ia.addItems( ais.getItemStack() ); if ( fail != null ) - cellInv.injectItems( ais, Actionable.MODULATE, mySrc ); + this.cellInv.injectItems( ais, Actionable.MODULATE, this.mySrc ); - updateHeld( player ); + this.updateHeld( player ); } } } break; case PICKUP_OR_SET_DOWN: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; if ( player.inventory.getItemStack() == null ) @@ -910,28 +910,28 @@ public abstract class AEBaseContainer extends Container { IAEItemStack ais = slotItem.copy(); ais.setStackSize( ais.getItemStack().getMaxStackSize() ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais != null ) player.inventory.setItemStack( ais.getItemStack() ); else player.inventory.setItemStack( null ); - updateHeld( player ); + this.updateHeld( player ); } } else { IAEItemStack ais = AEApi.instance().storage().createItemStack( player.inventory.getItemStack() ); - ais = Platform.poweredInsert( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais != null ) player.inventory.setItemStack( ais.getItemStack() ); else player.inventory.setItemStack( null ); - updateHeld( player ); + this.updateHeld( player ); } break; case SPLIT_OR_PLACE_SINGLE: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; if ( player.inventory.getItemStack() == null ) @@ -941,34 +941,34 @@ public abstract class AEBaseContainer extends Container IAEItemStack ais = slotItem.copy(); long maxSize = ais.getItemStack().getMaxStackSize(); ais.setStackSize( maxSize ); - ais = cellInv.extractItems( ais, Actionable.SIMULATE, mySrc ); + ais = this.cellInv.extractItems( ais, Actionable.SIMULATE, this.mySrc ); if ( ais != null ) { long stackSize = Math.min( maxSize, ais.getStackSize() ); ais.setStackSize( (stackSize + 1) >> 1 ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); } if ( ais != null ) player.inventory.setItemStack( ais.getItemStack() ); else player.inventory.setItemStack( null ); - updateHeld( player ); + this.updateHeld( player ); } } else { IAEItemStack ais = AEApi.instance().storage().createItemStack( player.inventory.getItemStack() ); ais.setStackSize( 1 ); - ais = Platform.poweredInsert( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais == null ) { ItemStack is = player.inventory.getItemStack(); is.stackSize--; if ( is.stackSize <= 0 ) player.inventory.setItemStack( null ); - updateHeld( player ); + this.updateHeld( player ); } } @@ -979,12 +979,12 @@ public abstract class AEBaseContainer extends Container ItemStack is = slotItem.getItemStack(); is.stackSize = is.getMaxStackSize(); player.inventory.setItemStack( is ); - updateHeld( player ); + this.updateHeld( player ); } break; case MOVE_REGION: - if ( powerSrc == null || cellInv == null ) + if ( this.powerSrc == null || this.cellInv == null ) return; if ( slotItem != null ) @@ -1004,7 +1004,7 @@ public abstract class AEBaseContainer extends Container if ( myItem != null ) ais.setStackSize( ais.getStackSize() - myItem.stackSize ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if ( ais != null ) adp.addItems( ais.getItemStack() ); else @@ -1036,8 +1036,8 @@ public abstract class AEBaseContainer extends Container public void swapSlotContents(int slotA, int slotB) { - Slot a = getSlot( slotA ); - Slot b = getSlot( slotB ); + Slot a = this.getSlot( slotA ); + Slot b = this.getSlot( slotB ); // NPE protection... if ( a == null || b == null ) @@ -1052,10 +1052,10 @@ public abstract class AEBaseContainer extends Container // can take? - if ( isA != null && !a.canTakeStack( invPlayer.player ) ) + if ( isA != null && !a.canTakeStack( this.invPlayer.player ) ) return; - if ( isB != null && !b.canTakeStack( invPlayer.player ) ) + if ( isB != null && !b.canTakeStack( this.invPlayer.player ) ) return; // swap valid? diff --git a/src/main/java/appeng/container/ContainerOpenContext.java b/src/main/java/appeng/container/ContainerOpenContext.java index bc27ad624..fcef2e84a 100644 --- a/src/main/java/appeng/container/ContainerOpenContext.java +++ b/src/main/java/appeng/container/ContainerOpenContext.java @@ -33,14 +33,14 @@ public class ContainerOpenContext public ContainerOpenContext(Object myItem) { boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity; - isItem = !isWorld; + this.isItem = !isWorld; } public TileEntity getTile() { - if ( isItem ) + if ( this.isItem ) return null; - return w.getTileEntity( x, y, z ); + return this.w.getTileEntity( this.x, this.y, this.z ); } } diff --git a/src/main/java/appeng/container/guisync/SyncData.java b/src/main/java/appeng/container/guisync/SyncData.java index d7856fc8b..bf6bd08a3 100644 --- a/src/main/java/appeng/container/guisync/SyncData.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -41,26 +41,26 @@ public class SyncData private final int channel; public SyncData(AEBaseContainer container, Field field, GuiSync annotation) { - clientVersion = null; + this.clientVersion = null; this.source = container; this.field = field; - channel = annotation.value(); + this.channel = annotation.value(); } public int getChannel() { - return channel; + return this.channel; } public void tick(ICrafting c) { try { - Object val = field.get( source ); - if ( val != null && clientVersion == null ) - send( c, val ); - else if ( !val.equals( clientVersion ) ) - send( c, val ); + Object val = this.field.get( this.source ); + if ( val != null && this.clientVersion == null ) + this.send( c, val ); + else if ( !val.equals( this.clientVersion ) ) + this.send( c, val ); } catch (IllegalArgumentException e) { @@ -80,11 +80,11 @@ public class SyncData { try { - Object oldValue = field.get( source ); + Object oldValue = this.field.get( this.source ); if ( val instanceof String ) - updateString( oldValue, (String) val ); + this.updateString( oldValue, (String) val ); else - updateValue( oldValue, (Long) val ); + this.updateValue( oldValue, (Long) val ); } catch (IllegalArgumentException e) { @@ -101,7 +101,7 @@ public class SyncData { try { - field.set( source, val ); + this.field.set( this.source, val ); } catch (IllegalArgumentException e) { @@ -117,35 +117,35 @@ public class SyncData { try { - if ( field.getType().isEnum() ) + if ( this.field.getType().isEnum() ) { - EnumSet valList = EnumSet.allOf( (Class) field.getType() ); + EnumSet valList = EnumSet.allOf( (Class) this.field.getType() ); for (Enum e : valList) { if ( e.ordinal() == val ) { - field.set( source, e ); + this.field.set( this.source, e ); break; } } } else { - if ( field.getType().equals( int.class ) ) - field.set( source, (int) val ); - else if ( field.getType().equals( long.class ) ) - field.set( source, val ); - else if ( field.getType().equals( boolean.class ) ) - field.set( source, val == 1 ); - else if ( field.getType().equals( Integer.class ) ) - field.set( source, (int) val ); - else if ( field.getType().equals( Long.class ) ) - field.set( source, val ); - else if ( field.getType().equals( Boolean.class ) ) - field.set( source, val == 1 ); + if ( this.field.getType().equals( int.class ) ) + this.field.set( this.source, (int) val ); + else if ( this.field.getType().equals( long.class ) ) + this.field.set( this.source, val ); + else if ( this.field.getType().equals( boolean.class ) ) + this.field.set( this.source, val == 1 ); + else if ( this.field.getType().equals( Integer.class ) ) + this.field.set( this.source, (int) val ); + else if ( this.field.getType().equals( Long.class ) ) + this.field.set( this.source, val ); + else if ( this.field.getType().equals( Boolean.class ) ) + this.field.set( this.source, val == 1 ); } - source.onUpdate( field.getName(), oldValue, field.get( source ) ); + this.source.onUpdate( this.field.getName(), oldValue, this.field.get( this.source ) ); } catch (IllegalArgumentException e) { @@ -162,25 +162,25 @@ public class SyncData if ( val instanceof String ) { if ( o instanceof EntityPlayerMP ) - NetworkHandler.instance.sendTo( new PacketValueConfig( "SyncDat." + channel, (String) val ), (EntityPlayerMP) o ); + NetworkHandler.instance.sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (EntityPlayerMP) o ); } - else if ( field.getType().isEnum() ) + else if ( this.field.getType().isEnum() ) { - o.sendProgressBarUpdate( source, channel, ((Enum) val).ordinal() ); + o.sendProgressBarUpdate( this.source, this.channel, ((Enum) val).ordinal() ); } else if ( val instanceof Long || val.getClass() == long.class ) { - NetworkHandler.instance.sendTo( new PacketProgressBar( channel, (Long) val ), (EntityPlayerMP) o ); + NetworkHandler.instance.sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o ); } else if ( val instanceof Boolean || val.getClass() == boolean.class ) { - o.sendProgressBarUpdate( source, channel, ((Boolean) val) ? 1 : 0 ); + o.sendProgressBarUpdate( this.source, this.channel, ((Boolean) val) ? 1 : 0 ); } else { - o.sendProgressBarUpdate( source, channel, (Integer) val ); + o.sendProgressBarUpdate( this.source, this.channel, (Integer) val ); } - clientVersion = val; + this.clientVersion = val; } } diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index 8673d6fac..2fc9e0e38 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -52,33 +52,33 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public IInventory getCellUpgradeInventory() { - IInventory ri = workBench.getCellUpgradeInventory(); - return ri == null ? ni : ri; + IInventory ri = this.workBench.getCellUpgradeInventory(); + return ri == null ? this.ni : ri; } public void setFuzzy(FuzzyMode valueOf) { - ICellWorkbenchItem cwi = workBench.getCell(); + ICellWorkbenchItem cwi = this.workBench.getCell(); if ( cwi != null ) - cwi.setFuzzyMode( workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ), valueOf ); + cwi.setFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ), valueOf ); } private FuzzyMode getFuzzyMode() { - ICellWorkbenchItem cwi = workBench.getCell(); + ICellWorkbenchItem cwi = this.workBench.getCell(); if ( cwi != null ) - return cwi.getFuzzyMode( workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ) ); + return cwi.getFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ) ); return FuzzyMode.IGNORE_ALL; } public void nextCopyMode() { - workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( getCopyMode() ) ); + this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( this.getCopyMode() ) ); } public CopyMode getCopyMode() { - return (CopyMode) workBench.getConfigManager().getSetting( Settings.COPY_MODE ); + return (CopyMode) this.workBench.getConfigManager().getSetting( Settings.COPY_MODE ); } class Upgrades implements IInventory @@ -87,19 +87,19 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public int getSizeInventory() { - return getCellUpgradeInventory().getSizeInventory(); + return ContainerCellWorkbench.this.getCellUpgradeInventory().getSizeInventory(); } @Override public ItemStack getStackInSlot(int i) { - return getCellUpgradeInventory().getStackInSlot( i ); + return ContainerCellWorkbench.this.getCellUpgradeInventory().getStackInSlot( i ); } @Override public ItemStack decrStackSize(int i, int j) { - IInventory inv = getCellUpgradeInventory(); + IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); ItemStack is = inv.decrStackSize( i, j ); inv.markDirty(); return is; @@ -108,7 +108,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public ItemStack getStackInSlotOnClosing(int i) { - IInventory inv = getCellUpgradeInventory(); + IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); ItemStack is = inv.getStackInSlotOnClosing( i ); inv.markDirty(); return is; @@ -117,7 +117,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - IInventory inv = getCellUpgradeInventory(); + IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); inv.setInventorySlotContents( i, itemstack ); inv.markDirty(); } @@ -165,7 +165,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return getCellUpgradeInventory().isItemValidForSlot( i, itemstack ); + return ContainerCellWorkbench.this.getCellUpgradeInventory().isItemValidForSlot( i, itemstack ); } } @@ -179,7 +179,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public ContainerCellWorkbench(InventoryPlayer ip, TileCellWorkbench te) { super( ip, te ); - workBench = te; + this.workBench = te; } @Override @@ -191,19 +191,19 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public int availableUpgrades() { - ItemStack is = workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); - if ( prevStack != is ) + ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + if ( this.prevStack != is ) { - prevStack = is; - return lastUpgrades = getCellUpgradeInventory().getSizeInventory(); + this.prevStack = is; + return this.lastUpgrades = this.getCellUpgradeInventory().getSizeInventory(); } - return lastUpgrades; + return this.lastUpgrades; } @Override public boolean isSlotEnabled(int idx) { - return idx < availableUpgrades(); + return idx < this.availableUpgrades(); } @Override @@ -213,23 +213,23 @@ public class ContainerCellWorkbench extends ContainerUpgradeable int y = 29; int offset = 0; - IInventory cell = upgradeable.getInventoryByName( "cell" ); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, invPlayer ) ); + IInventory cell = this.upgradeable.getInventoryByName( "cell" ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) ); - IInventory inv = upgradeable.getInventoryByName( "config" ); - UpgradeInventoryWrapper = new Upgrades();// Platform.isServer() ? new Upgrades() : new AppEngInternalInventory( + IInventory inv = this.upgradeable.getInventoryByName( "config" ); + this.UpgradeInventoryWrapper = new Upgrades();// Platform.isServer() ? new Upgrades() : new AppEngInternalInventory( // null, 3 * 8 ); for (int w = 0; w < 7; w++) for (int z = 0; z < 9; z++) - addSlotToContainer( new SlotFakeTypeOnly( inv, offset++, x + z * 18, y + w * 18 ) ); + this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset++, x + z * 18, y + w * 18 ) ); for (int zz = 0; zz < 3; zz++) for (int z = 0; z < 8; z++) { int iSLot = zz * 8 + z; - addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, UpgradeInventoryWrapper, this, iSLot, 187 + zz * 18, - 8 + 18 * z, iSLot, invPlayer ) ); + this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.UpgradeInventoryWrapper, this, iSLot, 187 + zz * 18, + 8 + 18 * z, iSLot, this.invPlayer ) ); } /* * if ( supportCapacity() ) { for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++) addSlotToContainer( new @@ -249,7 +249,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void onUpdate(String field, Object oldValue, Object newValue) { if ( field.equals( "copyMode" ) ) - workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.copyMode ); + this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.copyMode ); super.onUpdate( field, oldValue, newValue ); } @@ -257,17 +257,17 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public void detectAndSendChanges() { - ItemStack is = workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if ( Platform.isServer() ) { for (Object crafter : this.crafters) { ICrafting icrafting = (ICrafting) crafter; - if ( prevStack != is ) + if ( this.prevStack != is ) { // if the bars changed an item was probably made, so just send shit! - for (Object s : inventorySlots) + for (Object s : this.inventorySlots) { if ( s instanceof OptionalSlotRestrictedInput ) { @@ -279,28 +279,28 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } } - this.copyMode = getCopyMode(); - this.fzMode = getFuzzyMode(); + this.copyMode = this.getCopyMode(); + this.fzMode = this.getFuzzyMode(); } - prevStack = is; - standardDetectAndSendChanges(); + this.prevStack = is; + this.standardDetectAndSendChanges(); } public void clear() { - IInventory inv = upgradeable.getInventoryByName( "config" ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); for (int x = 0; x < inv.getSizeInventory(); x++) inv.setInventorySlotContents( x, null ); - detectAndSendChanges(); + this.detectAndSendChanges(); } public void partition() { - IInventory inv = upgradeable.getInventoryByName( "config" ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); IMEInventory cellInv = AEApi.instance().registries().cell() - .getCellInventory( upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); + .getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); Iterator i = new NullIterator(); if ( cellInv != null ) @@ -321,7 +321,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable inv.setInventorySlotContents( x, null ); } - detectAndSendChanges(); + this.detectAndSendChanges(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index bf835b1fc..42d7941da 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -32,9 +32,9 @@ public class ContainerChest extends AEBaseContainer super( ip, chest, null ); this.chest = chest; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, this.invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index 4bac403be..13c0a6258 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -38,11 +38,11 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv super( ip, condenser, null ); this.condenser = condenser; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, condenser, 0, 51, 52, ip ) ); - addSlotToContainer( new SlotOutput( condenser, 1, 105, 52, -1 ) ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, condenser.getInternalInventory(), 2, 101, 26, ip )).setStackLimit( 1 ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, condenser, 0, 51, 52, ip ) ); + this.addSlotToContainer( new SlotOutput( condenser, 1, 105, 52, -1 ) ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, condenser.getInternalInventory(), 2, 101, 26, ip )).setStackLimit( 1 ) ); - bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); } @Override @@ -73,13 +73,13 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv @Override public int getCurrentProgress() { - return (int) storedPower; + return (int) this.storedPower; } @Override public int getMaxProgress() { - return (int) requiredEnergy; + return (int) this.requiredEnergy; } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java index b1f3a6734..4d31794cc 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java @@ -42,17 +42,17 @@ public class ContainerCraftAmount extends AEBaseContainer public ContainerCraftAmount(InventoryPlayer ip, ITerminalHost te) { super( ip, te ); - priHost = te; + this.priHost = te; - craftingItem = new SlotInaccessible( new AppEngInternalInventory( null, 1 ), 0, 34, 53 ); - addSlotToContainer( craftingItem ); + this.craftingItem = new SlotInaccessible( new AppEngInternalInventory( null, 1 ), 0, 34, 53 ); + this.addSlotToContainer( this.craftingItem ); } @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - verifyPermissions( SecurityPermissions.CRAFT, false ); + this.verifyPermissions( SecurityPermissions.CRAFT, false ); } public IGrid getGrid() @@ -63,12 +63,12 @@ public class ContainerCraftAmount extends AEBaseContainer public World getWorld() { - return getPlayerInv().player.worldObj; + return this.getPlayerInv().player.worldObj; } public BaseActionSource getActionSrc() { - return new PlayerSource( getPlayerInv().player, (IActionHost) getTarget() ); + return new PlayerSource( this.getPlayerInv().player, (IActionHost) this.getTarget() ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index 947631535..e68e2d2f5 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -98,51 +98,51 @@ public class ContainerCraftConfirm extends AEBaseContainer public ContainerCraftConfirm(InventoryPlayer ip, ITerminalHost te) { super( ip, te ); - priHost = te; + this.priHost = te; } private void sendCPUs() { - Collections.sort( cpus ); + Collections.sort( this.cpus ); - if ( selectedCpu >= cpus.size() ) + if ( this.selectedCpu >= this.cpus.size() ) { - selectedCpu = -1; - cpuBytesAvail = 0; - cpuCoProcessors = 0; - myName = ""; + this.selectedCpu = -1; + this.cpuBytesAvail = 0; + this.cpuCoProcessors = 0; + this.myName = ""; } - else if ( selectedCpu != -1 ) + else if ( this.selectedCpu != -1 ) { - myName = cpus.get( selectedCpu ).myName; - cpuBytesAvail = cpus.get( selectedCpu ).size; - cpuCoProcessors = cpus.get( selectedCpu ).processors; + this.myName = this.cpus.get( this.selectedCpu ).myName; + this.cpuBytesAvail = this.cpus.get( this.selectedCpu ).size; + this.cpuCoProcessors = this.cpus.get( this.selectedCpu ).processors; } } public void cycleCpu(boolean next) { if ( next ) - selectedCpu++; + this.selectedCpu++; else - selectedCpu--; + this.selectedCpu--; - if ( selectedCpu < -1 ) - selectedCpu = cpus.size() - 1; - else if ( selectedCpu >= cpus.size() ) - selectedCpu = -1; + if ( this.selectedCpu < -1 ) + this.selectedCpu = this.cpus.size() - 1; + else if ( this.selectedCpu >= this.cpus.size() ) + this.selectedCpu = -1; - if ( selectedCpu == -1 ) + if ( this.selectedCpu == -1 ) { - cpuBytesAvail = 0; - cpuCoProcessors = 0; - myName = ""; + this.cpuBytesAvail = 0; + this.cpuCoProcessors = 0; + this.myName = ""; } else { - myName = cpus.get( selectedCpu ).myName; - cpuBytesAvail = cpus.get( selectedCpu ).size; - cpuCoProcessors = cpus.get( selectedCpu ).processors; + this.myName = this.cpus.get( this.selectedCpu ).myName; + this.cpuBytesAvail = this.cpus.get( this.selectedCpu ).size; + this.cpuCoProcessors = this.cpus.get( this.selectedCpu ).processors; } } @@ -152,7 +152,7 @@ public class ContainerCraftConfirm extends AEBaseContainer if ( Platform.isClient() ) return; - ICraftingGrid cc = getGrid().getCache( ICraftingGrid.class ); + ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); ImmutableSet cpuSet = cc.getCpus(); int matches = 0; @@ -160,11 +160,11 @@ public class ContainerCraftConfirm extends AEBaseContainer for (ICraftingCPU c : cpuSet) { boolean found = false; - for (CraftingCPURecord ccr : cpus) + for (CraftingCPURecord ccr : this.cpus) if ( ccr.cpu == c ) found = true; - boolean matched = cpuMatches( c ); + boolean matched = this.cpuMatches( c ); if ( matched ) matches++; @@ -173,50 +173,50 @@ public class ContainerCraftConfirm extends AEBaseContainer changed = true; } - if ( changed || cpus.size() != matches ) + if ( changed || this.cpus.size() != matches ) { - cpus.clear(); + this.cpus.clear(); for (ICraftingCPU c : cpuSet) { - if ( cpuMatches( c ) ) - cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) ); + if ( this.cpuMatches( c ) ) + this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) ); } - sendCPUs(); + this.sendCPUs(); } - noCPU = cpus.size() == 0; + this.noCPU = this.cpus.size() == 0; super.detectAndSendChanges(); - if ( job != null && job.isDone() ) + if ( this.job != null && this.job.isDone() ) { try { - result = job.get(); + this.result = this.job.get(); - if ( !result.isSimulation() ) + if ( !this.result.isSimulation() ) { - simulation = false; - if ( autoStart ) + this.simulation = false; + if ( this.autoStart ) { - startJob(); + this.startJob(); return; } } else - simulation = true; + this.simulation = true; try { PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); - PacketMEInventoryUpdate c = result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; + PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; IItemList plan = AEApi.instance().storage().createItemList(); - result.populatePlan( plan ); + this.result.populatePlan( plan ); - bytesUsed = result.getByteTotal(); + this.bytesUsed = this.result.getByteTotal(); for (IAEItemStack out : plan) { @@ -230,13 +230,13 @@ public class ContainerCraftConfirm extends AEBaseContainer p.reset(); p.setStackSize( out.getCountRequestable() ); - IStorageGrid sg = getGrid().getCache( IStorageGrid.class ); + IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class ); IMEInventory items = sg.getItemInventory(); - if ( c != null && result.isSimulation() ) + if ( c != null && this.result.isSimulation() ) { m = o.copy(); - o = items.extractItems( o, Actionable.SIMULATE, mySrc ); + o = items.extractItems( o, Actionable.SIMULATE, this.mySrc ); if ( o == null ) { @@ -275,27 +275,27 @@ public class ContainerCraftConfirm extends AEBaseContainer } catch (Throwable e) { - getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) ); + this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) ); AELog.error( e ); this.isContainerValid = false; - result = null; + this.result = null; } - job = null; + this.job = null; } - verifyPermissions( SecurityPermissions.CRAFT, false ); + this.verifyPermissions( SecurityPermissions.CRAFT, false ); } private boolean cpuMatches(ICraftingCPU c) { - return c.getAvailableStorage() >= bytesUsed && !c.isBusy(); + return c.getAvailableStorage() >= this.bytesUsed && !c.isBusy(); } public void startJob() { GuiBridge OriginalGui = null; - IActionHost ah = getActionHost(); + IActionHost ah = this.getActionHost(); if ( ah instanceof WirelessTerminalGuiObject ) OriginalGui = GuiBridge.GUI_WIRELESS_TERM; @@ -308,17 +308,17 @@ public class ContainerCraftConfirm extends AEBaseContainer if ( ah instanceof PartPatternTerminal ) OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; - if ( result != null && !simulation ) + if ( this.result != null && !this.simulation ) { - ICraftingGrid cc = getGrid().getCache( ICraftingGrid.class ); - ICraftingLink g = cc.submitJob( result, null, selectedCpu == -1 ? null : cpus.get( selectedCpu ).cpu, true, getActionSrc() ); - autoStart = false; - if ( g != null && OriginalGui != null && openContext != null ) + ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); + ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); + this.autoStart = false; + if ( g != null && OriginalGui != null && this.openContext != null ) { - NetworkHandler.instance.sendTo( new PacketSwitchGuis( OriginalGui ), (EntityPlayerMP) invPlayer.player ); + NetworkHandler.instance.sendTo( new PacketSwitchGuis( OriginalGui ), (EntityPlayerMP) this.invPlayer.player ); - TileEntity te = openContext.getTile(); - Platform.openGUI( invPlayer.player, te, openContext.side, OriginalGui ); + TileEntity te = this.openContext.getTile(); + Platform.openGUI( this.invPlayer.player, te, this.openContext.side, OriginalGui ); } } } @@ -327,10 +327,10 @@ public class ContainerCraftConfirm extends AEBaseContainer public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed( par1EntityPlayer ); - if ( job != null ) + if ( this.job != null ) { - job.cancel( true ); - job = null; + this.job.cancel( true ); + this.job = null; } } @@ -338,10 +338,10 @@ public class ContainerCraftConfirm extends AEBaseContainer public void removeCraftingFromCrafters(ICrafting c) { super.removeCraftingFromCrafters( c ); - if ( job != null ) + if ( this.job != null ) { - job.cancel( true ); - job = null; + this.job.cancel( true ); + this.job = null; } } @@ -353,11 +353,11 @@ public class ContainerCraftConfirm extends AEBaseContainer public World getWorld() { - return getPlayerInv().player.worldObj; + return this.getPlayerInv().player.worldObj; } public BaseActionSource getActionSrc() { - return new PlayerSource( getPlayerInv().player, (IActionHost) getTarget() ); + return new PlayerSource( this.getPlayerInv().player, (IActionHost) this.getTarget() ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index d4e8e6f75..bba2fa857 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -61,25 +61,25 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH if ( host != null ) { - findNode( host, ForgeDirection.UNKNOWN ); + this.findNode( host, ForgeDirection.UNKNOWN ); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - findNode( host, d ); + this.findNode( host, d ); } if ( te instanceof TileCraftingTile ) - setCPU( (ICraftingCPU) ((TileCraftingTile) te).getCluster() ); + this.setCPU( (ICraftingCPU) ((TileCraftingTile) te).getCluster() ); - if ( network == null && Platform.isServer() ) - isContainerValid = false; + if ( this.network == null && Platform.isServer() ) + this.isContainerValid = false; } protected void setCPU(ICraftingCPU c) { - if ( c == monitor ) + if ( c == this.monitor ) return; - if ( monitor != null ) - monitor.removeListener( this ); + if ( this.monitor != null ) + this.monitor.removeListener( this ); for (Object g : this.crafters) { @@ -98,38 +98,38 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH if ( c instanceof CraftingCPUCluster ) { - cpuName = c.getName(); + this.cpuName = c.getName(); - monitor = (CraftingCPUCluster) c; - if ( monitor != null ) + this.monitor = (CraftingCPUCluster) c; + if ( this.monitor != null ) { - list.resetStatus(); - monitor.getListOfItem( list, CraftingItemList.ALL ); - monitor.addListener( this, null ); + this.list.resetStatus(); + this.monitor.getListOfItem( this.list, CraftingItemList.ALL ); + this.monitor.addListener( this, null ); } } else { - monitor = null; - cpuName = ""; + this.monitor = null; + this.cpuName = ""; } } public void cancelCrafting() { - if ( monitor != null ) + if ( this.monitor != null ) { - monitor.cancel(); + this.monitor.cancel(); } } private void findNode(IGridHost host, ForgeDirection d) { - if ( network == null ) + if ( this.network == null ) { IGridNode node = host.getGridNode( d ); if ( node != null ) - network = node.getGrid(); + this.network = node.getGrid(); } } @@ -139,8 +139,8 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH public void onContainerClosed(EntityPlayer player) { super.onContainerClosed( player ); - if ( monitor != null ) - monitor.removeListener( this ); + if ( this.monitor != null ) + this.monitor.removeListener( this ); } @Override @@ -148,14 +148,14 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { super.removeCraftingFromCrafters( c ); - if ( this.crafters.isEmpty() && monitor != null ) - monitor.removeListener( this ); + if ( this.crafters.isEmpty() && this.monitor != null ) + this.monitor.removeListener( this ); } @Override public void detectAndSendChanges() { - if ( Platform.isServer() && monitor != null && !list.isEmpty() ) + if ( Platform.isServer() && this.monitor != null && !this.list.isEmpty() ) { try { @@ -163,14 +163,14 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 ); - for (IAEItemStack out : list) + for (IAEItemStack out : this.list) { - a.appendItem( monitor.getItemStack( out, CraftingItemList.STORAGE ) ); - b.appendItem( monitor.getItemStack( out, CraftingItemList.ACTIVE ) ); - c.appendItem( monitor.getItemStack( out, CraftingItemList.PENDING ) ); + a.appendItem( this.monitor.getItemStack( out, CraftingItemList.STORAGE ) ); + b.appendItem( this.monitor.getItemStack( out, CraftingItemList.ACTIVE ) ); + c.appendItem( this.monitor.getItemStack( out, CraftingItemList.PENDING ) ); } - list.resetStatus(); + this.list.resetStatus(); for (Object g : this.crafters) { @@ -209,7 +209,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { is = is.copy(); is.setStackSize( 1 ); - list.add( is ); + this.list.add( is ); } } @@ -222,12 +222,12 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH @Override public String getCustomName() { - return cpuName; + return this.cpuName; } @Override public boolean hasCustomName() { - return cpuName != null && cpuName.length() > 0; + return this.cpuName != null && this.cpuName.length() > 0; } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java index efefd9af2..73c628217 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java @@ -45,34 +45,34 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU private void sendCPUs() { - Collections.sort( cpus ); + Collections.sort( this.cpus ); - if ( selectedCpu >= cpus.size() ) + if ( this.selectedCpu >= this.cpus.size() ) { - selectedCpu = -1; - myName = ""; + this.selectedCpu = -1; + this.myName = ""; } - else if ( selectedCpu != -1 ) + else if ( this.selectedCpu != -1 ) { - myName = cpus.get( selectedCpu ).myName; + this.myName = this.cpus.get( this.selectedCpu ).myName; } - if ( selectedCpu == -1 && cpus.size() > 0 ) - selectedCpu = 0; + if ( this.selectedCpu == -1 && this.cpus.size() > 0 ) + this.selectedCpu = 0; - if ( selectedCpu != -1 ) + if ( this.selectedCpu != -1 ) { - if ( cpus.get( selectedCpu ).cpu != monitor ) - setCPU( cpus.get( selectedCpu ).cpu ); + if ( this.cpus.get( this.selectedCpu ).cpu != this.monitor ) + this.setCPU( this.cpus.get( this.selectedCpu ).cpu ); } else - setCPU( null ); + this.setCPU( null ); } @Override public void detectAndSendChanges() { - ICraftingGrid cc = network.getCache( ICraftingGrid.class ); + ICraftingGrid cc = this.network.getCache( ICraftingGrid.class ); ImmutableSet cpuSet = cc.getCpus(); int matches = 0; @@ -80,11 +80,11 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU for (ICraftingCPU c : cpuSet) { boolean found = false; - for (CraftingCPURecord ccr : cpus) + for (CraftingCPURecord ccr : this.cpus) if ( ccr.cpu == c ) found = true; - boolean matched = cpuMatches( c ); + boolean matched = this.cpuMatches( c ); if ( matched ) matches++; @@ -93,19 +93,19 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU changed = true; } - if ( changed || cpus.size() != matches ) + if ( changed || this.cpus.size() != matches ) { - cpus.clear(); + this.cpus.clear(); for (ICraftingCPU c : cpuSet) { - if ( cpuMatches( c ) ) - cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) ); + if ( this.cpuMatches( c ) ) + this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) ); } - sendCPUs(); + this.sendCPUs(); } - noCPU = cpus.size() == 0; + this.noCPU = this.cpus.size() == 0; super.detectAndSendChanges(); } @@ -122,27 +122,27 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU public void cycleCpu(boolean next) { if ( next ) - selectedCpu++; + this.selectedCpu++; else - selectedCpu--; + this.selectedCpu--; - if ( selectedCpu < -1 ) - selectedCpu = cpus.size() - 1; - else if ( selectedCpu >= cpus.size() ) - selectedCpu = -1; + if ( this.selectedCpu < -1 ) + this.selectedCpu = this.cpus.size() - 1; + else if ( this.selectedCpu >= this.cpus.size() ) + this.selectedCpu = -1; - if ( selectedCpu == -1 && cpus.size() > 0 ) - selectedCpu = 0; + if ( this.selectedCpu == -1 && this.cpus.size() > 0 ) + this.selectedCpu = 0; - if ( selectedCpu == -1 ) + if ( this.selectedCpu == -1 ) { - myName = ""; - setCPU( null ); + this.myName = ""; + this.setCPU( null ); } else { - myName = cpus.get( selectedCpu ).myName; - setCPU( cpus.get( selectedCpu ).cpu ); + this.myName = this.cpus.get( this.selectedCpu ).myName; + this.setCPU( this.cpus.get( this.selectedCpu ).cpu ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index d765bf6a9..53772f083 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -53,26 +53,26 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 ); for (int x = 0; x < 9; x++) - ic.setInventorySlotContents( x, craftingSlots[x].getStack() ); + ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() ); - outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, getPlayerInv().player.worldObj ) ); + this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ) ); } public ContainerCraftingTerm(InventoryPlayer ip, ITerminalHost monitorable) { super( ip, monitorable, false ); - ct = (PartCraftingTerminal) monitorable; + this.ct = (PartCraftingTerminal) monitorable; - IInventory crafting = ct.getInventoryByName( "crafting" ); + IInventory crafting = this.ct.getInventoryByName( "crafting" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) - addSlotToContainer( craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) ); + this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) ); - addSlotToContainer( outputSlot = new SlotCraftingTerm( getPlayerInv().player, mySrc, powerSrc, monitorable, crafting, crafting, output, 131, -72 + 18, this ) ); + this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.mySrc, this.powerSrc, monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) ); - bindPlayerInventory( ip, 0, 0 ); + this.bindPlayerInventory( ip, 0, 0 ); - onCraftMatrixChanged( crafting ); + this.onCraftMatrixChanged( crafting ); } @Override @@ -92,9 +92,9 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE { if (name.equals("player")) { - return invPlayer; + return this.invPlayer; } - return ct.getInventoryByName( name ); + return this.ct.getInventoryByName( name ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index 116b656b0..73e09b5ea 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -35,10 +35,10 @@ public class ContainerDrive extends AEBaseContainer for (int y = 0; y < 5; y++) for (int x = 0; x < 2; x++) { - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive, x + y * 2, 71 + x * 18, 14 + y * 18, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive, x + y * 2, 71 + x * 18, 14 + y * 18, this.invPlayer ) ); } - bindPlayerInventory( ip, 0, 199 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 199 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index d1ae5cbe8..2476811a1 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -39,7 +39,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable public ContainerFormationPlane(InventoryPlayer ip, PartFormationPlane te) { super( ip, te ); - storageBus = te; + this.storageBus = te; } @Override @@ -63,7 +63,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable @Override public boolean isSlotEnabled(int idx) { - int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } @@ -74,37 +74,37 @@ public class ContainerFormationPlane extends ContainerUpgradeable int xo = 8; int yo = 23 + 6; - IInventory config = upgradeable.getInventoryByName( "config" ); + IInventory config = this.upgradeable.getInventoryByName( "config" ); for (int y = 0; y < 7; y++) { for (int x = 0; x < 9; x++) { if ( y < 2 ) - addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); + this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); else - addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); } } - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, invPlayer )).setNotDraggable() ); + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer )).setNotDraggable() ); } @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); } - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index 9cd42213a..3e8d8d5ae 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -34,17 +34,17 @@ public class ContainerGrinder extends AEBaseContainer super( ip, grinder, null ); this.grinder = grinder; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, invPlayer ) ); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, invPlayer ) ); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, this.invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, this.invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, this.invPlayer ) ); - addSlotToContainer( new SlotInaccessible( grinder, 6, 80, 40 ) ); + this.addSlotToContainer( new SlotInaccessible( grinder, 6, 80, 40 ) ); - addSlotToContainer( new SlotOutput( grinder, 3, 112, 63, 2 * 16 + 15 ) ); - addSlotToContainer( new SlotOutput( grinder, 4, 112 + 18, 63, 2 * 16 + 15 ) ); - addSlotToContainer( new SlotOutput( grinder, 5, 112 + 36, 63, 2 * 16 + 15 ) ); + this.addSlotToContainer( new SlotOutput( grinder, 3, 112, 63, 2 * 16 + 15 ) ); + this.addSlotToContainer( new SlotOutput( grinder, 4, 112 + 18, 63, 2 * 16 + 15 ) ); + this.addSlotToContainer( new SlotOutput( grinder, 5, 112 + 36, 63, 2 * 16 + 15 ) ); - bindPlayerInventory( ip, 0, 176 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 176 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index e26b6dba9..d6d7f2db4 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -45,7 +45,7 @@ public class ContainerIOPort extends ContainerUpgradeable public ContainerIOPort(InventoryPlayer ip, TileIOPort te) { super( ip, te ); - ioPort = te; + this.ioPort = te; } @Override @@ -72,37 +72,37 @@ public class ContainerIOPort extends ContainerUpgradeable int offX = 19; int offY = 17; - IInventory cells = upgradeable.getInventoryByName( "cells" ); + IInventory cells = this.upgradeable.getInventoryByName( "cells" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 2; x++) - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this.invPlayer ) ); offX = 122; offY = 17; for (int y = 0; y < 3; y++) for (int x = 0; x < 2; x++) - addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) ); + this.addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) ); - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); } @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { - this.opMode = (OperationMode) upgradeable.getConfigManager().getSetting( Settings.OPERATION_MODE ); + this.opMode = (OperationMode) this.upgradeable.getConfigManager().getSetting( Settings.OPERATION_MODE ); this.fMode = (FullnessMode) this.upgradeable.getConfigManager().getSetting( Settings.FULLNESS_MODE ); this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); } - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index 830a7d764..14a4998bf 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -49,15 +49,15 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres public ContainerInscriber(InventoryPlayer ip, TileInscriber te) { super( ip, te ); - ti = te; + this.ti = te; - addSlotToContainer( top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, ti, 0, 45, 16, invPlayer ) ); - addSlotToContainer( bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, ti, 1, 45, 62, invPlayer ) ); - addSlotToContainer( middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, ti, 2, 63, 39, invPlayer ) ); + this.addSlotToContainer( this.top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 0, 45, 16, this.invPlayer ) ); + this.addSlotToContainer( this.bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 1, 45, 62, this.invPlayer ) ); + this.addSlotToContainer( this.middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, this.ti, 2, 63, 39, this.invPlayer ) ); - addSlotToContainer( new SlotOutput( ti, 3, 113, 40, -1 ) ); + this.addSlotToContainer( new SlotOutput( this.ti, 3, 113, 40, -1 ) ); - bindPlayerInventory( ip, 0, getHeight() - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, this.getHeight() - /* height of player inventory */82 ); } @@ -85,16 +85,16 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres */ protected void setupConfig() { - setupUpgrades(); + this.setupUpgrades(); } @Override public boolean isValidForSlot(Slot s, ItemStack is) { - ItemStack PlateA = ti.getStackInSlot( 0 ); - ItemStack PlateB = ti.getStackInSlot( 1 ); + ItemStack PlateA = this.ti.getStackInSlot( 0 ); + ItemStack PlateB = this.ti.getStackInSlot( 1 ); - if ( s == middle ) + if ( s == this.middle ) { for (ItemStack i : Inscribe.plates) { @@ -129,14 +129,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres return false; } - if ( (s == top && PlateB != null) || (s == bottom && PlateA != null) ) + if ( (s == this.top && PlateB != null) || (s == this.bottom && PlateA != null) ) { boolean isValid = false; ItemStack otherSlot = null; - if ( s == top ) - otherSlot = bottom.getStack(); + if ( s == this.top ) + otherSlot = this.bottom.getStack(); else - otherSlot = top.getStack(); + otherSlot = this.top.getStack(); // name presses if ( AEApi.instance().materials().materialNamePress.sameAsStack( otherSlot ) ) @@ -168,24 +168,24 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres @Override public void detectAndSendChanges() { - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); if ( Platform.isServer() ) { - this.maxProcessingTime = ti.maxProcessingTime; - this.processingTime = ti.processingTime; + this.maxProcessingTime = this.ti.maxProcessingTime; + this.processingTime = this.ti.processingTime; } } @Override public int getCurrentProgress() { - return processingTime; + return this.processingTime; } @Override public int getMaxProgress() { - return maxProcessingTime; + return this.maxProcessingTime; } } diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index 0d85cf8a4..7fc53663b 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -44,16 +44,16 @@ public class ContainerInterface extends ContainerUpgradeable public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) { super( ip, te.getInterfaceDuality().getHost() ); - myDuality = te.getInterfaceDuality(); + this.myDuality = te.getInterfaceDuality(); for (int x = 0; x < 9; x++) - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.invPlayer ) ); for (int x = 0; x < 8; x++) - addSlotToContainer( new SlotFake( myDuality.getConfig(), x, 17 + 18 * x, 35 ) ); + this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 17 + 18 * x, 35 ) ); for (int x = 0; x < 8; x++) - addSlotToContainer( new SlotNormal( myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) ); + this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) ); } @@ -66,7 +66,7 @@ public class ContainerInterface extends ContainerUpgradeable @Override protected void setupConfig() { - setupUpgrades(); + this.setupUpgrades(); } @Override @@ -85,7 +85,7 @@ public class ContainerInterface extends ContainerUpgradeable @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); super.detectAndSendChanges(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index bb531f762..9b2ad20c2 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -69,8 +69,8 @@ public class ContainerInterfaceTerminal extends AEBaseContainer final String unlocalizedName; public InvTracker(DualityInterface dual, IInventory patterns, String unlocalizedName) { - server = patterns; - client = new AppEngInternalInventory( null, server.getSizeInventory() ); + this.server = patterns; + this.client = new AppEngInternalInventory( null, this.server.getSizeInventory() ); this.unlocalizedName = unlocalizedName; this.sortBy = dual.getSortValue(); } @@ -89,9 +89,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer super( ip, anchor ); if ( Platform.isServer() ) - g = anchor.getActionableNode().getGrid(); + this.g = anchor.getActionableNode().getGrid(); - bindPlayerInventory( ip, 0, 222 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 222 - /* height of player inventory */82 ); } NBTTagCompound data = new NBTTagCompound(); @@ -114,7 +114,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer @Override public void doAction(EntityPlayerMP player, InventoryAction action, int slot, long id) { - InvTracker inv = byId.get( id ); + InvTracker inv = this.byId.get( id ); if ( inv != null ) { ItemStack is = inv.server.getStackInSlot( slot ); @@ -210,7 +210,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer return; } - updateHeld( player ); + this.updateHeld( player ); } } @@ -222,19 +222,19 @@ public class ContainerInterfaceTerminal extends AEBaseContainer super.detectAndSendChanges(); - if ( g == null ) + if ( this.g == null ) return; int total = 0; boolean missing = false; - IActionHost host = getActionHost(); + IActionHost host = this.getActionHost(); if ( host != null ) { IGridNode agn = host.getActionableNode(); if ( agn != null && agn.isActive() ) { - for (IGridNode gn : g.getMachines( TileInterface.class )) + for (IGridNode gn : this.g.getMachines( TileInterface.class )) { if ( gn.isActive() ) { @@ -242,7 +242,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) continue; - InvTracker t = diList.get( ih ); + InvTracker t = this.diList.get( ih ); if ( t == null ) missing = true; @@ -257,7 +257,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer } } - for (IGridNode gn : g.getMachines( PartInterface.class )) + for (IGridNode gn : this.g.getMachines( PartInterface.class )) { if ( gn.isActive() ) { @@ -265,7 +265,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) continue; - InvTracker t = diList.get( ih ); + InvTracker t = this.diList.get( ih ); if ( t == null ) missing = true; @@ -282,33 +282,33 @@ public class ContainerInterfaceTerminal extends AEBaseContainer } } - if ( total != diList.size() || missing ) - regenList( data ); + if ( total != this.diList.size() || missing ) + this.regenList( this.data ); else { - for (Entry en : diList.entrySet()) + for (Entry en : this.diList.entrySet()) { InvTracker inv = en.getValue(); for (int x = 0; x < inv.server.getSizeInventory(); x++) { - if ( isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) ) - addItems( data, inv, x, 1 ); + if ( this.isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) ) + this.addItems( this.data, inv, x, 1 ); } } } - if ( !data.hasNoTags() ) + if ( !this.data.hasNoTags() ) { try { - NetworkHandler.instance.sendTo( new PacketCompressedNBT( data ), (EntityPlayerMP) getPlayerInv().player ); + NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player ); } catch (IOException e) { // :P } - data = new NBTTagCompound(); + this.data = new NBTTagCompound(); } } @@ -325,40 +325,40 @@ public class ContainerInterfaceTerminal extends AEBaseContainer private void regenList(NBTTagCompound data) { - byId.clear(); - diList.clear(); + this.byId.clear(); + this.diList.clear(); - IActionHost host = getActionHost(); + IActionHost host = this.getActionHost(); if ( host != null ) { IGridNode agn = host.getActionableNode(); if ( agn != null && agn.isActive() ) { - for (IGridNode gn : g.getMachines( TileInterface.class )) + for (IGridNode gn : this.g.getMachines( TileInterface.class )) { IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); DualityInterface dual = ih.getInterfaceDuality(); if ( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) - diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); } - for (IGridNode gn : g.getMachines( PartInterface.class )) + for (IGridNode gn : this.g.getMachines( PartInterface.class )) { IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); DualityInterface dual = ih.getInterfaceDuality(); if ( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) - diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); } } } data.setBoolean( "clear", true ); - for (Entry en : diList.entrySet()) + for (Entry en : this.diList.entrySet()) { InvTracker inv = en.getValue(); - byId.put( inv.which, inv ); - addItems( data, inv, 0, inv.server.getSizeInventory() ); + this.byId.put( inv.which, inv ); + this.addItems( data, inv, 0, inv.server.getSizeInventory() ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index b8fde0c29..79d89dbe8 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -50,13 +50,13 @@ public class ContainerLevelEmitter extends ContainerUpgradeable @SideOnly(Side.CLIENT) public void setTextField(GuiTextField level) { - textField = level; - textField.setText( String.valueOf( EmitterValue ) ); + this.textField = level; + this.textField.setText( String.valueOf( this.EmitterValue ) ); } public ContainerLevelEmitter(InventoryPlayer ip, PartLevelEmitter te) { super( ip, te ); - lvlEmitter = te; + this.lvlEmitter = te; } @Override @@ -74,8 +74,8 @@ public class ContainerLevelEmitter extends ContainerUpgradeable public void setLevel(long l, EntityPlayer player) { - lvlEmitter.setReportingValue( l ); - EmitterValue = l; + this.lvlEmitter.setReportingValue( l ); + this.EmitterValue = l; } @Override @@ -84,18 +84,18 @@ public class ContainerLevelEmitter extends ContainerUpgradeable int x = 80 + 44; int y = 40; - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - if ( availableUpgrades() > 0 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 1 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 2 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 3 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + if ( this.availableUpgrades() > 0 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 1 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 2 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 3 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )).setNotDraggable() ); - IInventory inv = upgradeable.getInventoryByName( "config" ); - addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); + this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); } @GuiSync(2) @@ -110,18 +110,18 @@ public class ContainerLevelEmitter extends ContainerUpgradeable @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { - this.EmitterValue = lvlEmitter.getReportingValue(); + this.EmitterValue = this.lvlEmitter.getReportingValue(); this.cmType = (YesNo) this.upgradeable.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ); this.lvType = (LevelType) this.upgradeable.getConfigManager().getSetting( Settings.LEVEL_TYPE ); this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ); } - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } @Override @@ -129,8 +129,8 @@ public class ContainerLevelEmitter extends ContainerUpgradeable { if ( field.equals( "EmitterValue" ) ) { - if ( textField != null ) - textField.setText( String.valueOf( EmitterValue ) ); + if ( this.textField != null ) + this.textField.setText( String.valueOf( this.EmitterValue ) ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerMAC.java b/src/main/java/appeng/container/implementations/ContainerMAC.java index f75614a9b..75361540d 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -46,7 +46,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi public ContainerMAC(InventoryPlayer ip, TileMolecularAssembler te) { super( ip, te ); - tma = te; + this.tma = te; } @Override @@ -72,7 +72,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi public boolean isValidItemForSlot(int slotIndex, ItemStack i) { - IInventory mac = upgradeable.getInventoryByName( "mac" ); + IInventory mac = this.upgradeable.getInventoryByName( "mac" ); ItemStack is = mac.getStackInSlot( 10 ); if ( is == null ) @@ -96,56 +96,56 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi int offX = 29; int offY = 30; - IInventory mac = upgradeable.getInventoryByName( "mac" ); + IInventory mac = this.upgradeable.getInventoryByName( "mac" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) { SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); - addSlotToContainer( s ); + this.addSlotToContainer( s ); } offX = 126; offY = 16; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offX, offY, invPlayer ) ); - addSlotToContainer( new SlotOutput( mac, 9, offX, offY + 32, -1 ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offX, offY, this.invPlayer ) ); + this.addSlotToContainer( new SlotOutput( mac, 9, offX, offY + 32, -1 ) ); offX = 122; offY = 17; - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )) + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )) .setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )) .setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )) .setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )) .setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, invPlayer )) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer )) .setNotDraggable() ); } @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); } - craftProgress = this.tma.getCraftingProgress(); + this.craftProgress = this.tma.getCraftingProgress(); - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } @Override public int getCurrentProgress() { - return craftProgress; + return this.craftProgress; } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index e019118ff..c931f633e 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -88,66 +88,66 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa public IGridNode getNetworkNode() { - return networkNode; + return this.networkNode; } protected ContainerMEMonitorable(InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory) { super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, monitorable instanceof IPart ? (IPart) monitorable : null ); - host = monitorable; - clientCM = new ConfigManager( this ); + this.host = monitorable; + this.clientCM = new ConfigManager( this ); - clientCM.registerSetting( Settings.SORT_BY, SortOrder.NAME ); - clientCM.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); - clientCM.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); + this.clientCM.registerSetting( Settings.SORT_BY, SortOrder.NAME ); + this.clientCM.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); + this.clientCM.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); if ( Platform.isServer() ) { - serverCM = monitorable.getConfigManager(); + this.serverCM = monitorable.getConfigManager(); - monitor = monitorable.getItemInventory(); - if ( monitor != null ) + this.monitor = monitorable.getItemInventory(); + if ( this.monitor != null ) { - monitor.addListener( this, null ); + this.monitor.addListener( this, null ); - cellInv = monitor; + this.cellInv = this.monitor; if ( monitorable instanceof IPortableCell ) - powerSrc = (IPortableCell) monitorable; + this.powerSrc = (IPortableCell) monitorable; else if ( monitorable instanceof IMEChest ) - powerSrc = (IMEChest) monitorable; + this.powerSrc = (IMEChest) monitorable; else if ( monitorable instanceof IGridHost ) { IGridNode node = ((IGridHost) monitorable).getGridNode( ForgeDirection.UNKNOWN ); if ( node != null ) { - networkNode = node; + this.networkNode = node; IGrid g = node.getGrid(); if ( g != null ) - powerSrc = new ChannelPowerSrc( networkNode, (IEnergyGrid) g.getCache( IEnergyGrid.class ) ); + this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergyGrid) g.getCache( IEnergyGrid.class ) ); } } } else - isContainerValid = false; + this.isContainerValid = false; } else - monitor = null; + this.monitor = null; - canAccessViewCells = false; + this.canAccessViewCells = false; if ( monitorable instanceof IViewCellStorage ) { for (int y = 0; y < 5; y++) { - cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEW_CELL, ((IViewCellStorage) monitorable).getViewCellStorage(), y, 206, y * 18 + 8, - invPlayer ); - cellView[y].allowEdit = canAccessViewCells; - addSlotToContainer( cellView[y] ); + this.cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEW_CELL, ((IViewCellStorage) monitorable).getViewCellStorage(), y, 206, y * 18 + 8, + this.invPlayer ); + this.cellView[y].allowEdit = this.canAccessViewCells; + this.addSlotToContainer( this.cellView[y] ); } } if ( bindInventory ) - bindPlayerInventory( ip, 0, 0 ); + this.bindPlayerInventory( ip, 0, 0 ); } public ContainerMEMonitorable(InventoryPlayer ip, ITerminalHost monitorable) { @@ -159,17 +159,17 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { if ( Platform.isServer() ) { - if ( monitor != host.getItemInventory() ) - isContainerValid = false; + if ( this.monitor != this.host.getItemInventory() ) + this.isContainerValid = false; - for (Enum set : serverCM.getSettings()) + for (Enum set : this.serverCM.getSettings()) { - Enum sideLocal = serverCM.getSetting( set ); - Enum sideRemote = clientCM.getSetting( set ); + Enum sideLocal = this.serverCM.getSetting( set ); + Enum sideRemote = this.clientCM.getSetting( set ); if ( sideLocal != sideRemote ) { - clientCM.putSetting( set, sideLocal ); + this.clientCM.putSetting( set, sideLocal ); for (Object crafter : this.crafters) { try @@ -184,15 +184,15 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } } - if ( !items.isEmpty() ) + if ( !this.items.isEmpty() ) { try { - IItemList monitorCache = monitor.getStorageList(); + IItemList monitorCache = this.monitor.getStorageList(); PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - for (IAEItemStack is : items) + for (IAEItemStack is : this.items) { IAEItemStack send = monitorCache.findPrecise( is ); if ( send == null ) @@ -206,7 +206,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa if ( !piu.isEmpty() ) { - items.resetStatus(); + this.items.resetStatus(); for (Object c : this.crafters) { @@ -221,16 +221,16 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } } - updatePowerStatus(); + this.updatePowerStatus(); - boolean oldCanAccessViewCells = canAccessViewCells; - canAccessViewCells = hasAccess( SecurityPermissions.BUILD, false ); - if ( canAccessViewCells != oldCanAccessViewCells ) + boolean oldCanAccessViewCells = this.canAccessViewCells; + this.canAccessViewCells = this.hasAccess( SecurityPermissions.BUILD, false ); + if ( this.canAccessViewCells != oldCanAccessViewCells ) { for (int y = 0; y < 5; y++) { - if ( cellView[y] != null ) - cellView[y].allowEdit = canAccessViewCells; + if ( this.cellView[y] != null ) + this.cellView[y].allowEdit = this.canAccessViewCells; } } @@ -242,12 +242,12 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { try { - if ( networkNode != null ) - hasPower = networkNode.isActive(); - else if ( powerSrc instanceof IEnergyGrid ) - hasPower = ((IEnergyGrid) powerSrc).isNetworkPowered(); + if ( this.networkNode != null ) + this.hasPower = this.networkNode.isActive(); + else if ( this.powerSrc instanceof IEnergyGrid ) + this.hasPower = ((IEnergyGrid) this.powerSrc).isNetworkPowered(); else - hasPower = powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8; + this.hasPower = this.powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8; } catch (Throwable t) { @@ -259,17 +259,17 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa public void addCraftingToCrafters(ICrafting c) { super.addCraftingToCrafters( c ); - queueInventory( c ); + this.queueInventory( c ); } public void queueInventory(ICrafting c) { - if ( Platform.isServer() && c instanceof EntityPlayer && monitor != null ) + if ( Platform.isServer() && c instanceof EntityPlayer && this.monitor != null ) { try { PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - IItemList monitorCache = monitor.getStorageList(); + IItemList monitorCache = this.monitor.getStorageList(); for (IAEItemStack send : monitorCache) { @@ -304,7 +304,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa if ( c instanceof ICrafting ) { ICrafting cr = (ICrafting) c; - queueInventory( cr ); + this.queueInventory( cr ); } } } @@ -315,8 +315,8 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa if ( field.equals( "canAccessViewCells" ) ) { for (int y = 0; y < 5; y++) - if ( cellView[y] != null ) - cellView[y].allowEdit = canAccessViewCells; + if ( this.cellView[y] != null ) + this.cellView[y].allowEdit = this.canAccessViewCells; } super.onUpdate( field, oldValue, newValue ); @@ -326,8 +326,8 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa public void onContainerClosed(EntityPlayer player) { super.onContainerClosed( player ); - if ( monitor != null ) - monitor.removeListener( this ); + if ( this.monitor != null ) + this.monitor.removeListener( this ); } @Override @@ -335,15 +335,15 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { super.removeCraftingFromCrafters( c ); - if ( this.crafters.isEmpty() && monitor != null ) - monitor.removeListener( this ); + if ( this.crafters.isEmpty() && this.monitor != null ) + this.monitor.removeListener( this ); } @Override public void postChange(IBaseMonitor monitor, Iterable change, BaseActionSource source) { for (IAEItemStack is : change) - items.add( is ); + this.items.add( is ); } @Override @@ -355,24 +355,24 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - if ( gui != null ) - gui.updateSetting( manager, settingName, newValue ); + if ( this.gui != null ) + this.gui.updateSetting( manager, settingName, newValue ); } @Override public IConfigManager getConfigManager() { if ( Platform.isServer() ) - return serverCM; - return clientCM; + return this.serverCM; + return this.clientCM; } public ItemStack[] getViewCells() { - ItemStack[] list = new ItemStack[cellView.length]; + ItemStack[] list = new ItemStack[this.cellView.length]; - for (int x = 0; x < cellView.length; x++) - list[x] = cellView[x].getStack(); + for (int x = 0; x < this.cellView.length; x++) + list[x] = this.cellView[x].getStack(); return list; } diff --git a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java index aaadf07fb..6836320ba 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java +++ b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java @@ -33,9 +33,9 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell monitorable) { super( ip, monitorable, false ); - lockPlayerInventorySlot( ip.currentItem ); - civ = monitorable; - bindPlayerInventory( ip, 0, 0 ); + this.lockPlayerInventorySlot( ip.currentItem ); + this.civ = monitorable; + this.bindPlayerInventory( ip, 0, 0 ); } int ticks = 0; @@ -43,32 +43,32 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable @Override public void detectAndSendChanges() { - ItemStack currentItem = getPlayerInv().getCurrentItem(); + ItemStack currentItem = this.getPlayerInv().getCurrentItem(); - if ( civ != null ) + if ( this.civ != null ) { - if ( currentItem != civ.getItemStack() ) + if ( currentItem != this.civ.getItemStack() ) { if ( currentItem != null ) { - if ( Platform.isSameItem( civ.getItemStack(), currentItem ) ) - getPlayerInv().setInventorySlotContents( getPlayerInv().currentItem, civ.getItemStack() ); + if ( Platform.isSameItem( this.civ.getItemStack(), currentItem ) ) + this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.civ.getItemStack() ); else - isContainerValid = false; + this.isContainerValid = false; } else - isContainerValid = false; + this.isContainerValid = false; } } else - isContainerValid = false; + this.isContainerValid = false; // drain 1 ae t - ticks++; - if ( ticks > 10 ) + this.ticks++; + if ( this.ticks > 10 ) { - civ.extractAEPower( powerMultiplier * ticks, Actionable.MODULATE, PowerMultiplier.CONFIG ); - ticks = 0; + this.civ.extractAEPower( this.powerMultiplier * this.ticks, Actionable.MODULATE, PowerMultiplier.CONFIG ); + this.ticks = 0; } super.detectAndSendChanges(); } diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java index 3bed33f8a..89d4a85a9 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java @@ -52,22 +52,22 @@ public class ContainerNetworkStatus extends AEBaseContainer if ( host != null ) { - findNode( host, ForgeDirection.UNKNOWN ); + this.findNode( host, ForgeDirection.UNKNOWN ); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - findNode( host, d ); + this.findNode( host, d ); } - if ( network == null && Platform.isServer() ) - isContainerValid = false; + if ( this.network == null && Platform.isServer() ) + this.isContainerValid = false; } private void findNode(IGridHost host, ForgeDirection d) { - if ( network == null ) + if ( this.network == null ) { IGridNode node = host.getGridNode( d ); if ( node != null ) - network = node.getGrid(); + this.network = node.getGrid(); } } @@ -85,18 +85,18 @@ public class ContainerNetworkStatus extends AEBaseContainer @Override public void detectAndSendChanges() { - delay++; - if ( Platform.isServer() && delay > 15 && network != null ) + this.delay++; + if ( Platform.isServer() && this.delay > 15 && this.network != null ) { - delay = 0; + this.delay = 0; - IEnergyGrid eg = network.getCache( IEnergyGrid.class ); + IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); if ( eg != null ) { - avgAddition = (long) (100.0 * eg.getAvgPowerInjection()); - powerUsage = (long) (100.0 * eg.getAvgPowerUsage()); - currentPower = (long) (100.0 * eg.getStoredPower()); - maxPower = (long) (100.0 * eg.getMaxStoredPower()); + this.avgAddition = (long) (100.0 * eg.getAvgPowerInjection()); + this.powerUsage = (long) (100.0 * eg.getAvgPowerUsage()); + this.currentPower = (long) (100.0 * eg.getStoredPower()); + this.maxPower = (long) (100.0 * eg.getMaxStoredPower()); } PacketMEInventoryUpdate piu; @@ -104,10 +104,10 @@ public class ContainerNetworkStatus extends AEBaseContainer { piu = new PacketMEInventoryUpdate(); - for (Class machineClass : network.getMachinesClasses()) + for (Class machineClass : this.network.getMachinesClasses()) { IItemList list = AEApi.instance().storage().createItemList(); - for (IGridNode machine : network.getMachines( machineClass )) + for (IGridNode machine : this.network.getMachines( machineClass )) { IGridBlock blk = machine.getGridBlock(); ItemStack is = blk.getMachineRepresentation(); diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 99030e71a..a7e8e0a49 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -37,20 +37,20 @@ public class ContainerNetworkTool extends AEBaseContainer public ContainerNetworkTool(InventoryPlayer ip, INetworkTool te) { super( ip, null, null ); - toolInv = te; + this.toolInv = te; - lockPlayerInventorySlot( ip.currentItem ); + this.lockPlayerInventorySlot( ip.currentItem ); for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te, y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, invPlayer )) ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te, y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, this.invPlayer )) ); - bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } public void toggleFacadeMode() { - NBTTagCompound data = Platform.openNbtData( toolInv.getItemStack() ); + NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() ); data.setBoolean( "hideFacades", !data.getBoolean( "hideFacades" ) ); this.detectAndSendChanges(); } @@ -58,27 +58,27 @@ public class ContainerNetworkTool extends AEBaseContainer @Override public void detectAndSendChanges() { - ItemStack currentItem = getPlayerInv().getCurrentItem(); + ItemStack currentItem = this.getPlayerInv().getCurrentItem(); - if ( currentItem != toolInv.getItemStack() ) + if ( currentItem != this.toolInv.getItemStack() ) { if ( currentItem != null ) { - if ( Platform.isSameItem( toolInv.getItemStack(), currentItem ) ) + if ( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) ) { - getPlayerInv().setInventorySlotContents( getPlayerInv().currentItem, toolInv.getItemStack() ); + this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() ); } else - isContainerValid = false; + this.isContainerValid = false; } else - isContainerValid = false; + this.isContainerValid = false; } - if ( isContainerValid ) + if ( this.isContainerValid ) { NBTTagCompound data = Platform.openNbtData( currentItem ); - facadeMode = data.getBoolean( "hideFacades" ); + this.facadeMode = data.getBoolean( "hideFacades" ); } super.detectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index add74ef41..ea9137b3f 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -82,50 +82,50 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public ContainerPatternTerm(InventoryPlayer ip, ITerminalHost monitorable) { super( ip, monitorable, false ); - ct = (PartPatternTerminal) monitorable; + this.ct = (PartPatternTerminal) monitorable; - IInventory patternInv = ct.getInventoryByName( "pattern" ); - IInventory output = ct.getInventoryByName( "output" ); - crafting = ct.getInventoryByName( "crafting" ); + IInventory patternInv = this.ct.getInventoryByName( "pattern" ); + IInventory output = this.ct.getInventoryByName( "output" ); + this.crafting = this.ct.getInventoryByName( "crafting" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) - addSlotToContainer( craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) ); + this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) ); - addSlotToContainer( craftSlot = new SlotPatternTerm( ip.player, mySrc, powerSrc, monitorable, crafting, patternInv, cOut, 110, -76 + 18, this, 2, this ) ); - craftSlot.IIcon = -1; + this.addSlotToContainer( this.craftSlot = new SlotPatternTerm( ip.player, this.mySrc, this.powerSrc, monitorable, this.crafting, patternInv, this.cOut, 110, -76 + 18, this, 2, this ) ); + this.craftSlot.IIcon = -1; for (int y = 0; y < 3; y++) { - addSlotToContainer( outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) ); - outputSlots[y].renderDisabled = false; - outputSlots[y].IIcon = -1; + this.addSlotToContainer( this.outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) ); + this.outputSlots[y].renderDisabled = false; + this.outputSlots[y].IIcon = -1; } - addSlotToContainer( patternSlotIN = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BLANK_PATTERN, patternInv, 0, 147, -72 - 9, invPlayer ) ); - addSlotToContainer( patternSlotOUT = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, patternInv, 1, 147, -72 + 34, invPlayer ) ); + this.addSlotToContainer( this.patternSlotIN = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BLANK_PATTERN, patternInv, 0, 147, -72 - 9, this.invPlayer ) ); + this.addSlotToContainer( this.patternSlotOUT = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, patternInv, 1, 147, -72 + 34, this.invPlayer ) ); - patternSlotOUT.setStackLimit( 1 ); + this.patternSlotOUT.setStackLimit( 1 ); - bindPlayerInventory( ip, 0, 0 ); - updateOrderOfOutputSlots(); + this.bindPlayerInventory( ip, 0, 0 ); + this.updateOrderOfOutputSlots(); } private void updateOrderOfOutputSlots() { - if ( !craftingMode ) + if ( !this.craftingMode ) { - craftSlot.xDisplayPosition = -9000; + this.craftSlot.xDisplayPosition = -9000; for (int y = 0; y < 3; y++) - outputSlots[y].xDisplayPosition = outputSlots[y].defX; + this.outputSlots[y].xDisplayPosition = this.outputSlots[y].defX; } else { - craftSlot.xDisplayPosition = craftSlot.defX; + this.craftSlot.xDisplayPosition = this.craftSlot.defX; for (int y = 0; y < 3; y++) - outputSlots[y].xDisplayPosition = -9000; + this.outputSlots[y].xDisplayPosition = -9000; } } @@ -133,24 +133,24 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public void putStackInSlot(int par1, ItemStack par2ItemStack) { super.putStackInSlot( par1, par2ItemStack ); - getAndUpdateOutput(); + this.getAndUpdateOutput(); } @Override public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { super.putStacksInSlots( par1ArrayOfItemStack ); - getAndUpdateOutput(); + this.getAndUpdateOutput(); } public ItemStack getAndUpdateOutput() { InventoryCrafting ic = new InventoryCrafting( this, 3, 3 ); for (int x = 0; x < ic.getSizeInventory(); x++) - ic.setInventorySlotContents( x, crafting.getStackInSlot( x ) ); + ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) ); ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ); - cOut.setInventorySlotContents( 0, is ); + this.cOut.setInventorySlotContents( 0, is ); return is; } @@ -163,10 +163,10 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA super.detectAndSendChanges(); if ( Platform.isServer() ) { - if ( craftingMode != ct.isCraftingRecipe() ) + if ( this.craftingMode != this.ct.isCraftingRecipe() ) { - craftingMode = ct.isCraftingRecipe(); - updateOrderOfOutputSlots(); + this.craftingMode = this.ct.isCraftingRecipe(); + this.updateOrderOfOutputSlots(); } } } @@ -178,8 +178,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA if ( field.equals( "craftingMode" ) ) { - getAndUpdateOutput(); - updateOrderOfOutputSlots(); + this.getAndUpdateOutput(); + this.updateOrderOfOutputSlots(); } } @@ -191,33 +191,33 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public void encode() { - ItemStack output = patternSlotOUT.getStack(); + ItemStack output = this.patternSlotOUT.getStack(); - ItemStack[] in = getInputs(); - ItemStack[] out = getOutputs(); + ItemStack[] in = this.getInputs(); + ItemStack[] out = this.getOutputs(); // if there is no input, this would be silly. if ( in == null || out == null ) return; // first check the output slots, should either be null, or a pattern - if ( output != null && !isPattern( output ) ) + if ( output != null && !this.isPattern( output ) ) return; // if nothing is there we should snag a new pattern. else if ( output == null ) { - output = patternSlotIN.getStack(); - if ( output == null || !isPattern( output ) ) + output = this.patternSlotIN.getStack(); + if ( output == null || !this.isPattern( output ) ) return; // no blanks. // remove one, and clear the input slot. output.stackSize--; if ( output.stackSize == 0 ) - patternSlotIN.putStack( null ); + this.patternSlotIN.putStack( null ); // add a new encoded pattern. - patternSlotOUT.putStack( output = AEApi.instance().items().itemEncodedPattern.stack( 1 ) ); + this.patternSlotOUT.putStack( output = AEApi.instance().items().itemEncodedPattern.stack( 1 ) ); } // encode the slot. @@ -227,14 +227,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA NBTTagList tagOut = new NBTTagList(); for (ItemStack i : in) - tagIn.appendTag( createItemTag( i ) ); + tagIn.appendTag( this.createItemTag( i ) ); for (ItemStack i : out) - tagOut.appendTag( createItemTag( i ) ); + tagOut.appendTag( this.createItemTag( i ) ); encodedValue.setTag( "in", tagIn ); encodedValue.setTag( "out", tagOut ); - encodedValue.setBoolean( "crafting", craftingMode ); + encodedValue.setBoolean( "crafting", this.craftingMode ); output.setTagCompound( encodedValue ); } @@ -254,9 +254,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA ItemStack[] input = new ItemStack[9]; boolean hasValue = false; - for (int x = 0; x < craftingSlots.length; x++) + for (int x = 0; x < this.craftingSlots.length; x++) { - input[x] = craftingSlots[x].getStack(); + input[x] = this.craftingSlots[x].getStack(); if ( input[x] != null ) hasValue = true; } @@ -269,9 +269,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA private ItemStack[] getOutputs() { - if ( craftingMode ) + if ( this.craftingMode ) { - ItemStack out = getAndUpdateOutput(); + ItemStack out = this.getAndUpdateOutput(); if ( out != null && out.stackSize > 0 ) return new ItemStack[] { out }; } @@ -280,7 +280,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA List list = new ArrayList( 3 ); boolean hasValue = false; - for (OptionalSlotFake outputSlot : outputSlots) + for (OptionalSlotFake outputSlot : this.outputSlots) { ItemStack out = outputSlot.getStack(); if ( out != null && out.stackSize > 0 ) @@ -309,9 +309,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public boolean isSlotEnabled(int idx) { if ( idx == 1 ) - return Platform.isServer() ? !ct.isCraftingRecipe() : !craftingMode; + return Platform.isServer() ? !this.ct.isCraftingRecipe() : !this.craftingMode; else if ( idx == 2 ) - return Platform.isServer() ? ct.isCraftingRecipe() : craftingMode; + return Platform.isServer() ? this.ct.isCraftingRecipe() : this.craftingMode; else return false; } @@ -324,27 +324,27 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public void craftOrGetItem(PacketPatternSlot packetPatternSlot) { - if ( packetPatternSlot.slotItem != null && cellInv != null ) + if ( packetPatternSlot.slotItem != null && this.cellInv != null ) { IAEItemStack out = packetPatternSlot.slotItem.copy(); - InventoryAdaptor inv = new AdaptorPlayerHand( getPlayerInv().player ); - InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( getPlayerInv().player, ForgeDirection.UNKNOWN ); + InventoryAdaptor inv = new AdaptorPlayerHand( this.getPlayerInv().player ); + InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, ForgeDirection.UNKNOWN ); if ( packetPatternSlot.shift ) inv = playerInv; if ( inv.simulateAdd( out.getItemStack() ) != null ) return; - IAEItemStack extracted = Platform.poweredExtraction( powerSrc, cellInv, out, mySrc ); - EntityPlayer p = getPlayerInv().player; + IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc ); + EntityPlayer p = this.getPlayerInv().player; if ( extracted != null ) { inv.addItems( extracted.getItemStack() ); if ( p instanceof EntityPlayerMP ) - updateHeld( (EntityPlayerMP) p ); - detectAndSendChanges(); + this.updateHeld( (EntityPlayerMP) p ); + this.detectAndSendChanges(); return; } @@ -360,7 +360,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA if ( r == null ) return; - IMEMonitor storage = ct.getItemInventory(); + IMEMonitor storage = this.ct.getItemInventory(); IItemList all = storage.getStorageList(); ItemStack is = r.getCraftingResult( ic ); @@ -369,8 +369,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { if ( ic.getStackInSlot( x ) != null ) { - ItemStack pulled = Platform.extractItemsByRecipe( powerSrc, mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, - Actionable.MODULATE, ItemViewCell.createFilter( getViewCells() ) ); + ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, + Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) ); real.setInventorySlotContents( x, pulled ); } } @@ -379,7 +379,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA if ( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) ) { - SlotCrafting sc = new SlotCrafting( p, real, cOut, 0, 0, 0 ); + SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 ); sc.onPickupFromSlot( p, is ); for (int x = 0; x < real.getSizeInventory(); x++) @@ -391,8 +391,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA inv.addItems( is ); if ( p instanceof EntityPlayerMP ) - updateHeld( (EntityPlayerMP) p ); - detectAndSendChanges(); + this.updateHeld( (EntityPlayerMP) p ); + this.detectAndSendChanges(); } else { @@ -401,7 +401,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA ItemStack failed = real.getStackInSlot( x ); if ( failed != null ) { - cellInv.injectItems( AEItemStack.create( failed ), Actionable.MODULATE, new MachineSource( ct ) ); + this.cellInv.injectItems( AEItemStack.create( failed ), Actionable.MODULATE, new MachineSource( this.ct ) ); } } } @@ -412,13 +412,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA @Override public void onSlotChange(Slot s) { - if ( s == patternSlotOUT && Platform.isServer() ) + if ( s == this.patternSlotOUT && Platform.isServer() ) { for (Object crafter : this.crafters) { ICrafting icrafting = (ICrafting) crafter; - for (Object g : inventorySlots) + for (Object g : this.inventorySlots) { if ( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix ) { @@ -428,20 +428,20 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } ((EntityPlayerMP) icrafting).isChangingQuantityOnly = false; } - detectAndSendChanges(); + this.detectAndSendChanges(); } } public void clear() { - for (Slot s : craftingSlots) + for (Slot s : this.craftingSlots) s.putStack( null ); - for (Slot s : outputSlots) + for (Slot s : this.outputSlots) s.putStack( null ); - detectAndSendChanges(); - getAndUpdateOutput(); + this.detectAndSendChanges(); + this.getAndUpdateOutput(); } @Override @@ -449,9 +449,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { if (name.equals("player")) { - return invPlayer; + return this.invPlayer; } - return ct.getInventoryByName( name ); + return this.ct.getInventoryByName( name ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerPriority.java b/src/main/java/appeng/container/implementations/ContainerPriority.java index aa6705b18..586f02e7c 100644 --- a/src/main/java/appeng/container/implementations/ContainerPriority.java +++ b/src/main/java/appeng/container/implementations/ContainerPriority.java @@ -45,13 +45,13 @@ public class ContainerPriority extends AEBaseContainer @SideOnly(Side.CLIENT) public void setTextField(GuiTextField level) { - textField = level; - textField.setText( String.valueOf( PriorityValue ) ); + this.textField = level; + this.textField.setText( String.valueOf( this.PriorityValue ) ); } public ContainerPriority(InventoryPlayer ip, IPriorityHost te) { super( ip, (TileEntity) (te instanceof TileEntity ? te : null), (IPart) (te instanceof IPart ? te : null) ); - priHost = te; + this.priHost = te; } @GuiSync(2) @@ -59,19 +59,19 @@ public class ContainerPriority extends AEBaseContainer public void setPriority(int newValue, EntityPlayer player) { - priHost.setPriority( newValue ); - PriorityValue = newValue; + this.priHost.setPriority( newValue ); + this.PriorityValue = newValue; } @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { - this.PriorityValue = priHost.getPriority(); + this.PriorityValue = this.priHost.getPriority(); } } @@ -80,8 +80,8 @@ public class ContainerPriority extends AEBaseContainer { if ( field.equals( "PriorityValue" ) ) { - if ( textField != null ) - textField.setText( String.valueOf( PriorityValue ) ); + if ( this.textField != null ) + this.textField.setText( String.valueOf( this.PriorityValue ) ); } super.onUpdate( field, oldValue, newValue ); diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index 3da3a756f..9a5376223 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -32,9 +32,9 @@ public class ContainerQNB extends AEBaseContainer super( ip, quantumBridge, null ); this.quantumBridge = quantumBridge; - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge, 0, 80, 37, invPlayer )).setStackLimit( 1 ) ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge, 0, 80, 37, this.invPlayer )).setStackLimit( 1 ) ); - bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index 23a019b60..7cd3178c6 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -47,37 +47,37 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn public void setName(String value) { - myName = value; + this.myName = value; } public ContainerQuartzKnife(InventoryPlayer ip, QuartzKnifeObj te) { super( ip, null, null ); - toolInv = te; + this.toolInv = te; - addSlotToContainer( metals = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, inSlot, 0, 94, 44, ip ) ); - addSlotToContainer( output = new QuartzKnifeOutput( this, 0, 134, 44, -1 ) ); + this.addSlotToContainer( this.metals = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) ); + this.addSlotToContainer( this.output = new QuartzKnifeOutput( this, 0, 134, 44, -1 ) ); - lockPlayerInventorySlot( ip.currentItem ); + this.lockPlayerInventorySlot( ip.currentItem ); - bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 ); } @Override public void detectAndSendChanges() { - ItemStack currentItem = getPlayerInv().getCurrentItem(); + ItemStack currentItem = this.getPlayerInv().getCurrentItem(); - if ( currentItem != toolInv.getItemStack() ) + if ( currentItem != this.toolInv.getItemStack() ) { if ( currentItem != null ) { - if ( Platform.isSameItem( toolInv.getItemStack(), currentItem ) ) - getPlayerInv().setInventorySlotContents( getPlayerInv().currentItem, toolInv.getItemStack() ); + if ( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) ) + this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() ); else - isContainerValid = false; + this.isContainerValid = false; } else - isContainerValid = false; + this.isContainerValid = false; } super.detectAndSendChanges(); @@ -86,8 +86,8 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { - if ( inSlot.getStackInSlot( 0 ) != null ) - par1EntityPlayer.dropPlayerItemWithRandomChoice( inSlot.getStackInSlot( 0 ), false ); + if ( this.inSlot.getStackInSlot( 0 ) != null ) + par1EntityPlayer.dropPlayerItemWithRandomChoice( this.inSlot.getStackInSlot( 0 ), false ); } @Override @@ -111,17 +111,17 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @Override public ItemStack getStackInSlot(int var1) { - ItemStack input = inSlot.getStackInSlot( 0 ); + ItemStack input = this.inSlot.getStackInSlot( 0 ); if ( input == null ) return null; if ( SlotRestrictedInput.isMetalIngot( input ) ) { - if ( myName.length() > 0 ) + if ( this.myName.length() > 0 ) { ItemStack name = AEApi.instance().materials().materialNamePress.stack( 1 ); NBTTagCompound c = Platform.openNbtData( name ); - c.setString( "InscribeName", myName ); + c.setString( "InscribeName", this.myName ); return name; } } @@ -132,10 +132,10 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @Override public ItemStack decrStackSize(int var1, int var2) { - ItemStack is = getStackInSlot( 0 ); + ItemStack is = this.getStackInSlot( 0 ); if ( is != null ) { - if ( makePlate() ) + if ( this.makePlate() ) return is; } return null; @@ -143,15 +143,15 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn private boolean makePlate() { - if ( inSlot.decrStackSize( 0, 1 ) != null ) + if ( this.inSlot.decrStackSize( 0, 1 ) != null ) { - ItemStack item = toolInv.getItemStack(); - item.damageItem( 1, getPlayerInv().player ); + ItemStack item = this.toolInv.getItemStack(); + item.damageItem( 1, this.getPlayerInv().player ); if ( item.stackSize == 0 ) { - getPlayerInv().mainInventory[getPlayerInv().currentItem] = null; - MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( getPlayerInv().player, item ) ); + this.getPlayerInv().mainInventory[this.getPlayerInv().currentItem] = null; + MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.getPlayerInv().player, item ) ); } return true; @@ -169,7 +169,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn public void setInventorySlotContents(int var1, ItemStack var2) { if ( var2 == null && Platform.isServer() ) - makePlate(); + this.makePlate(); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index 22b0b7ef2..529dda6bd 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -54,14 +54,14 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE public ContainerSecurity(InventoryPlayer ip, ITerminalHost monitorable) { super( ip, monitorable, false ); - securityBox = (TileSecurity) monitorable; + this.securityBox = (TileSecurity) monitorable; - addSlotToContainer( configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, securityBox.configSlot, 0, 37, -33, ip ) ); + this.addSlotToContainer( this.configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox.configSlot, 0, 37, -33, ip ) ); - addSlotToContainer( wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, wirelessEncoder, 0, 212, 10, ip ) ); - addSlotToContainer( wirelessOut = new SlotOutput( wirelessEncoder, 1, 212, 68, -1 ) ); + this.addSlotToContainer( this.wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, this.wirelessEncoder, 0, 212, 10, ip ) ); + this.addSlotToContainer( this.wirelessOut = new SlotOutput( this.wirelessEncoder, 1, 212, 68, -1 ) ); - bindPlayerInventory( ip, 0, 0 ); + this.bindPlayerInventory( ip, 0, 0 ); } @GuiSync(0) @@ -72,11 +72,11 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE { super.onContainerClosed( player ); - if ( wirelessIn.getHasStack() ) - player.dropPlayerItemWithRandomChoice( wirelessIn.getStack(), false ); + if ( this.wirelessIn.getHasStack() ) + player.dropPlayerItemWithRandomChoice( this.wirelessIn.getStack(), false ); - if ( wirelessOut.getHasStack() ) - player.dropPlayerItemWithRandomChoice( wirelessOut.getStack(), false ); + if ( this.wirelessOut.getHasStack() ) + player.dropPlayerItemWithRandomChoice( this.wirelessOut.getStack(), false ); } public void toggleSetting(String value, EntityPlayer player) @@ -85,7 +85,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE { SecurityPermissions permission = SecurityPermissions.valueOf( value ); - ItemStack a = configSlot.getStack(); + ItemStack a = this.configSlot.getStack(); if ( a != null && a.getItem() instanceof IBiometricCard ) { IBiometricCard bc = (IBiometricCard) a.getItem(); @@ -104,20 +104,20 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.SECURITY, false ); + this.verifyPermissions( SecurityPermissions.SECURITY, false ); - security = 0; + this.security = 0; - ItemStack a = configSlot.getStack(); + ItemStack a = this.configSlot.getStack(); if ( a != null && a.getItem() instanceof IBiometricCard ) { IBiometricCard bc = (IBiometricCard) a.getItem(); for (SecurityPermissions sp : bc.getPermissions( a )) - security = security | (1 << sp.ordinal()); + this.security = this.security | (1 << sp.ordinal()); } - updatePowerStatus(); + this.updatePowerStatus(); super.detectAndSendChanges(); } @@ -131,11 +131,11 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - if ( !wirelessOut.getHasStack() ) + if ( !this.wirelessOut.getHasStack() ) { - if ( wirelessIn.getHasStack() ) + if ( this.wirelessIn.getHasStack() ) { - ItemStack term = wirelessIn.getStack().copy(); + ItemStack term = this.wirelessIn.getStack().copy(); INetworkEncodable networkEncodable = null; if ( term.getItem() instanceof INetworkEncodable ) @@ -147,17 +147,17 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE if ( networkEncodable != null ) { - networkEncodable.setEncryptionKey( term, String.valueOf( securityBox.securityKey ), "" ); + networkEncodable.setEncryptionKey( term, String.valueOf( this.securityBox.securityKey ), "" ); - wirelessIn.putStack( null ); - wirelessOut.putStack( term ); + this.wirelessIn.putStack( null ); + this.wirelessOut.putStack( term ); // update the two slots in question... for (Object crafter : this.crafters) { ICrafting icrafting = (ICrafting) crafter; - icrafting.sendSlotContents( this, wirelessIn.slotNumber, wirelessIn.getStack() ); - icrafting.sendSlotContents( this, wirelessOut.slotNumber, wirelessOut.getStack() ); + icrafting.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() ); + icrafting.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index cc44516ba..e7531eb11 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -39,19 +39,19 @@ public class ContainerSkyChest extends AEBaseContainer { for (int x = 0; x < 9; x++) { - addSlotToContainer( new SlotNormal( this.chest, y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); + this.addSlotToContainer( new SlotNormal( this.chest, y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); } } this.chest.openInventory(); - bindPlayerInventory( ip, 0, 195 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 195 - /* height of player inventory */82 ); } @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed( par1EntityPlayer ); - chest.closeInventory(); + this.chest.closeInventory(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index 7d3eec7a5..a21663531 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -54,34 +54,34 @@ public class ContainerSpatialIOPort extends AEBaseContainer this.spatialIOPort = spatialIOPort; if ( Platform.isServer() ) - network = spatialIOPort.getGridNode( ForgeDirection.UNKNOWN ).getGrid(); + this.network = spatialIOPort.getGridNode( ForgeDirection.UNKNOWN ).getGrid(); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort, 0, 52, 48, invPlayer ) ); - addSlotToContainer( new SlotOutput( spatialIOPort, 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort, 0, 52, 48, this.invPlayer ) ); + this.addSlotToContainer( new SlotOutput( spatialIOPort, 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) ); - bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); } @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { - delay++; - if ( delay > 15 && network != null ) + this.delay++; + if ( this.delay > 15 && this.network != null ) { - delay = 0; + this.delay = 0; - IEnergyGrid eg = network.getCache( IEnergyGrid.class ); - ISpatialCache sc = network.getCache( ISpatialCache.class ); + IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); + ISpatialCache sc = this.network.getCache( ISpatialCache.class ); if ( eg != null ) { - currentPower = (long) (100.0 * eg.getStoredPower()); - maxPower = (long) (100.0 * eg.getMaxStoredPower()); - reqPower = (long) (100.0 * sc.requiredPower()); - eff = (long) (100.0f * sc.currentEfficiency()); + this.currentPower = (long) (100.0 * eg.getStoredPower()); + this.maxPower = (long) (100.0 * eg.getMaxStoredPower()); + this.reqPower = (long) (100.0 * sc.requiredPower()); + this.eff = (long) (100.0f * sc.currentEfficiency()); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index a28c872b1..0b8ad816c 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -56,7 +56,7 @@ public class ContainerStorageBus extends ContainerUpgradeable public ContainerStorageBus(InventoryPlayer ip, PartStorageBus te) { super( ip, te ); - storageBus = te; + this.storageBus = te; } @Override @@ -80,7 +80,7 @@ public class ContainerStorageBus extends ContainerUpgradeable @Override public boolean isSlotEnabled(int idx) { - int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } @@ -91,30 +91,30 @@ public class ContainerStorageBus extends ContainerUpgradeable int xo = 8; int yo = 23 + 6; - IInventory config = upgradeable.getInventoryByName( "config" ); + IInventory config = this.upgradeable.getInventoryByName( "config" ); for (int y = 0; y < 7; y++) { for (int x = 0; x < 9; x++) { if ( y < 2 ) - addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); + this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); else - addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); } } - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, invPlayer )).setNotDraggable() ); + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer )).setNotDraggable() ); } @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { @@ -123,22 +123,22 @@ public class ContainerStorageBus extends ContainerUpgradeable this.storageFilter = (StorageFilter) this.upgradeable.getConfigManager().getSetting( Settings.STORAGE_FILTER ); } - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } public void clear() { - IInventory inv = upgradeable.getInventoryByName( "config" ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); for (int x = 0; x < inv.getSizeInventory(); x++) inv.setInventorySlotContents( x, null ); - detectAndSendChanges(); + this.detectAndSendChanges(); } public void partition() { - IInventory inv = upgradeable.getInventoryByName( "config" ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IMEInventory cellInv = storageBus.getInternalHandler(); + IMEInventory cellInv = this.storageBus.getInternalHandler(); Iterator i = new NullIterator(); if ( cellInv != null ) @@ -149,7 +149,7 @@ public class ContainerStorageBus extends ContainerUpgradeable for (int x = 0; x < inv.getSizeInventory(); x++) { - if ( i.hasNext() && isSlotEnabled( (x / 9) - 2 ) ) + if ( i.hasNext() && this.isSlotEnabled( (x / 9) - 2 ) ) { ItemStack g = i.next().getItemStack(); g.stackSize = 1; @@ -159,7 +159,7 @@ public class ContainerStorageBus extends ContainerUpgradeable inv.setInventorySlotContents( x, null ); } - detectAndSendChanges(); + this.detectAndSendChanges(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index 6b2f48aa5..2868defdd 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -56,7 +56,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl public ContainerUpgradeable(InventoryPlayer ip, IUpgradeableHost te) { super( ip, (TileEntity) (te instanceof TileEntity ? te : null), (IPart) (te instanceof IPart ? te : null) ); - upgradeable = te; + this.upgradeable = te; World w = null; int xCoord = 0, yCoord = 0, zCoord = 0; @@ -79,65 +79,65 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl zCoord = mk.zCoord; } - IInventory pi = getPlayerInv(); + IInventory pi = this.getPlayerInv(); for (int x = 0; x < pi.getSizeInventory(); x++) { ItemStack pii = pi.getStackInSlot( x ); if ( pii != null && pii.getItem() instanceof ToolNetworkTool ) { - lockPlayerInventorySlot( x ); - tbSlot = x; - tbInventory = (NetworkToolViewer) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoord, yCoord, zCoord ); + this.lockPlayerInventorySlot( x ); + this.tbSlot = x; + this.tbInventory = (NetworkToolViewer) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoord, yCoord, zCoord ); break; } } - if ( hasToolbox() ) + if ( this.hasToolbox() ) { for (int v = 0; v < 3; v++) for (int u = 0; u < 3; u++) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, tbInventory, u + v * 3, 186 + u * 18, getHeight() - 82 + v * 18, - invPlayer )).setPlayerSide() ); + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory, u + v * 3, 186 + u * 18, this.getHeight() - 82 + v * 18, + this.invPlayer )).setPlayerSide() ); } - setupConfig(); + this.setupConfig(); - bindPlayerInventory( ip, 0, getHeight() - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, this.getHeight() - /* height of player inventory */82 ); } protected void setupUpgrades() { - IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); - if ( availableUpgrades() > 0 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 1 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 2 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); - if ( availableUpgrades() > 3 ) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); + IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + if ( this.availableUpgrades() > 0 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 1 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 2 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); + if ( this.availableUpgrades() > 3 ) + this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )).setNotDraggable() ); } protected void setupConfig() { int x = 80; int y = 40; - setupUpgrades(); + this.setupUpgrades(); - IInventory inv = upgradeable.getInventoryByName( "config" ); - addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); + IInventory inv = this.upgradeable.getInventoryByName( "config" ); + this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); - if ( supportCapacity() ) + if ( this.supportCapacity() ) { - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) ); - addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) ); + this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) ); } } @@ -167,21 +167,21 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl public void checkToolbox() { - if ( hasToolbox() ) + if ( this.hasToolbox() ) { - ItemStack currentItem = getPlayerInv().getStackInSlot( tbSlot ); + ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot ); - if ( currentItem != tbInventory.getItemStack() ) + if ( currentItem != this.tbInventory.getItemStack() ) { if ( currentItem != null ) { - if ( Platform.isSameItem( tbInventory.getItemStack(), currentItem ) ) - getPlayerInv().setInventorySlotContents( tbSlot, tbInventory.getItemStack() ); + if ( Platform.isSameItem( this.tbInventory.getItemStack(), currentItem ) ) + this.getPlayerInv().setInventorySlotContents( this.tbSlot, this.tbInventory.getItemStack() ); else - isContainerValid = false; + this.isContainerValid = false; } else - isContainerValid = false; + this.isContainerValid = false; } } } @@ -189,17 +189,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl @Override public void detectAndSendChanges() { - verifyPermissions( SecurityPermissions.BUILD, false ); + this.verifyPermissions( SecurityPermissions.BUILD, false ); if ( Platform.isServer() ) { IConfigManager cm = this.upgradeable.getConfigManager(); - loadSettingsFromHost( cm ); + this.loadSettingsFromHost( cm ); } - checkToolbox(); + this.checkToolbox(); - for (Object o : inventorySlots) + for (Object o : this.inventorySlots) { if ( o instanceof OptionalSlotFake ) { @@ -209,14 +209,14 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl } } - standardDetectAndSendChanges(); + this.standardDetectAndSendChanges(); } protected void loadSettingsFromHost(IConfigManager cm) { this.fzMode = (FuzzyMode) cm.getSetting( Settings.FUZZY_MODE ); this.rsMode = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED ); - if ( upgradeable instanceof PartExportBus ) + if ( this.upgradeable instanceof PartExportBus ) this.cMode = (YesNo) cm.getSetting( Settings.CRAFT_ONLY ); } @@ -227,13 +227,13 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl public boolean hasToolbox() { - return tbInventory != null; + return this.tbInventory != null; } @Override public boolean isSlotEnabled(int idx) { - int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); if ( idx == 1 && upgrades > 0 ) return true; diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index d6d472cfb..bcb179124 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -36,9 +36,9 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr super( ip, vibrationChamber, null ); this.vibrationChamber = vibrationChamber; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber, 0, 80, 37, invPlayer ) ); + this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber, 0, 80, 37, this.invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } public final int aePerTick = 5; @@ -64,7 +64,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr @Override public int getCurrentProgress() { - return burnProgress > 0 ? burnSpeed : 0; + return this.burnProgress > 0 ? this.burnSpeed : 0; } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index 1aa20304e..d64ab7e70 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -40,20 +40,20 @@ public class ContainerWireless extends AEBaseContainer public ContainerWireless(InventoryPlayer ip, TileWireless te) { super( ip, te, null ); - wirelessTerminal = te; + this.wirelessTerminal = te; - addSlotToContainer( boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, wirelessTerminal, 0, 80, 47, invPlayer ) ); + this.addSlotToContainer( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal, 0, 80, 47, this.invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } @Override public void detectAndSendChanges() { - int boosters = boosterSlot.getStack() == null ? 0 : boosterSlot.getStack().stackSize; + int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize; - range = (long) (10 * AEConfig.instance.wireless_getMaxRange( boosters )); - drain = (long) (100 * AEConfig.instance.wireless_getPowerDrain( boosters )); + this.range = (long) (10 * AEConfig.instance.wireless_getMaxRange( boosters )); + this.drain = (long) (100 * AEConfig.instance.wireless_getPowerDrain( boosters )); super.detectAndSendChanges(); } diff --git a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java index 5191b5cb7..f91649b71 100644 --- a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java @@ -39,16 +39,16 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell { super.detectAndSendChanges(); - if ( !wirelessTerminalGUIObject.rangeCheck() ) + if ( !this.wirelessTerminalGUIObject.rangeCheck() ) { - if ( Platform.isServer() && isContainerValid ) - getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() ); + if ( Platform.isServer() && this.isContainerValid ) + this.getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() ); - isContainerValid = false; + this.isContainerValid = false; } else { - powerMultiplier = AEConfig.instance.wireless_getDrainRate( wirelessTerminalGUIObject.getRange() ); + this.powerMultiplier = AEConfig.instance.wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ); } } } diff --git a/src/main/java/appeng/container/implementations/CraftingCPURecord.java b/src/main/java/appeng/container/implementations/CraftingCPURecord.java index 076a91bf5..29d4b33fd 100644 --- a/src/main/java/appeng/container/implementations/CraftingCPURecord.java +++ b/src/main/java/appeng/container/implementations/CraftingCPURecord.java @@ -35,16 +35,16 @@ public class CraftingCPURecord implements Comparable this.size = size; this.processors = coProcessors; this.cpu = server; - myName = server.getName(); + this.myName = server.getName(); } @Override public int compareTo(CraftingCPURecord o) { - int a = ItemSorters.compareLong( o.processors, processors ); + int a = ItemSorters.compareLong( o.processors, this.processors ); if ( a != 0 ) return a; - return ItemSorters.compareLong( o.size, size ); + return ItemSorters.compareLong( o.size, this.size ); } } \ No newline at end of file diff --git a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java index 4a244c9d0..afba32263 100644 --- a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java +++ b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java @@ -150,7 +150,7 @@ public class AppEngCraftingSlot extends AppEngSlot @Override public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { - FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, craftMatrix ); + FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, this.craftMatrix ); this.onCrafting( par2ItemStack ); for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) @@ -167,7 +167,7 @@ public class AppEngCraftingSlot extends AppEngSlot if ( itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage() ) { - MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( thePlayer, itemstack2 ) ); + MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.thePlayer, itemstack2 ) ); continue; } diff --git a/src/main/java/appeng/container/slot/AppEngSlot.java b/src/main/java/appeng/container/slot/AppEngSlot.java index b50c96469..12d1439e4 100644 --- a/src/main/java/appeng/container/slot/AppEngSlot.java +++ b/src/main/java/appeng/container/slot/AppEngSlot.java @@ -39,13 +39,13 @@ public class AppEngSlot extends Slot public Slot setNotDraggable() { - isDraggable = false; + this.isDraggable = false; return this; } public Slot setPlayerSide() { - isPlayerSide = true; + this.isPlayerSide = true; return this; } @@ -57,7 +57,7 @@ public class AppEngSlot extends Slot @Override public boolean func_111238_b() { - return isEnabled(); + return this.isEnabled(); } public boolean isEnabled() @@ -73,19 +73,19 @@ public class AppEngSlot extends Slot @Override public void onSlotChanged() { - if ( inventory instanceof AppEngInternalInventory ) - ((AppEngInternalInventory) inventory).markDirty( getSlotIndex() ); + if ( this.inventory instanceof AppEngInternalInventory ) + ((AppEngInternalInventory) this.inventory).markDirty( this.getSlotIndex() ); else super.onSlotChanged(); - isValid = hasCalculatedValidness.NotAvailable; + this.isValid = hasCalculatedValidness.NotAvailable; } public AppEngSlot(IInventory inv, int idx, int x, int y) { super( inv, idx, x, y ); - defX = x; - defY = y; - isValid = hasCalculatedValidness.NotAvailable; + this.defX = x; + this.defY = y; + this.isValid = hasCalculatedValidness.NotAvailable; } public boolean isDisplay = false; @@ -93,16 +93,16 @@ public class AppEngSlot extends Slot @Override public ItemStack getStack() { - if ( !isEnabled() ) + if ( !this.isEnabled() ) return null; - if ( inventory.getSizeInventory() <= getSlotIndex() ) + if ( this.inventory.getSizeInventory() <= this.getSlotIndex() ) return null; - if ( isDisplay ) + if ( this.isDisplay ) { - isDisplay = false; - return getDisplayStack(); + this.isDisplay = false; + return this.getDisplayStack(); } return super.getStack(); } @@ -110,12 +110,12 @@ public class AppEngSlot extends Slot @Override public void putStack(ItemStack par1ItemStack) { - if ( isEnabled() ) + if ( this.isEnabled() ) { super.putStack( par1ItemStack ); - if ( myContainer != null ) - myContainer.onSlotChange( this ); + if ( this.myContainer != null ) + this.myContainer.onSlotChange( this ); } } @@ -127,7 +127,7 @@ public class AppEngSlot extends Slot @Override public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - if ( isEnabled() ) + if ( this.isEnabled() ) return super.canTakeStack( par1EntityPlayer ); return false; } @@ -135,7 +135,7 @@ public class AppEngSlot extends Slot @Override public boolean isItemValid(ItemStack par1ItemStack) { - if ( isEnabled() ) + if ( this.isEnabled() ) return super.isItemValid( par1ItemStack ); return false; } @@ -157,17 +157,17 @@ public class AppEngSlot extends Slot public int getIcon() { - return IIcon; + return this.IIcon; } public boolean isPlayerSide() { - return isPlayerSide; + return this.isPlayerSide; } public boolean shouldDisplay() { - return isEnabled(); + return this.isEnabled(); } } diff --git a/src/main/java/appeng/container/slot/OptionalSlotFake.java b/src/main/java/appeng/container/slot/OptionalSlotFake.java index f01e5ca49..b2d2f7520 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFake.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFake.java @@ -35,20 +35,20 @@ public class OptionalSlotFake extends SlotFake public OptionalSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum) { super( inv, idx, x + offX * 18, y + offY * 18 ); - srcX = x; - srcY = y; - invSlot = idx; + this.srcX = x; + this.srcY = y; + this.invSlot = idx; this.groupNum = groupNum; - host = containerBus; + this.host = containerBus; } @Override public ItemStack getStack() { - if ( !isEnabled() ) + if ( !this.isEnabled() ) { - if ( getDisplayStack() != null ) - clearStack(); + if ( this.getDisplayStack() != null ) + this.clearStack(); } return super.getStack(); @@ -57,15 +57,15 @@ public class OptionalSlotFake extends SlotFake @Override public boolean isEnabled() { - if ( host == null ) + if ( this.host == null ) return false; - return host.isSlotEnabled( groupNum ); + return this.host.isSlotEnabled( this.groupNum ); } public boolean renderDisabled() { - return renderDisabled; + return this.renderDisabled; } } diff --git a/src/main/java/appeng/container/slot/OptionalSlotNormal.java b/src/main/java/appeng/container/slot/OptionalSlotNormal.java index f7f11b330..ed8af4eb0 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotNormal.java +++ b/src/main/java/appeng/container/slot/OptionalSlotNormal.java @@ -29,16 +29,16 @@ public class OptionalSlotNormal extends AppEngSlot public OptionalSlotNormal(IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum) { super( inv, slot, xPos, yPos ); this.groupNum = groupNum; - host = containerBus; + this.host = containerBus; } @Override public boolean isEnabled() { - if ( host == null ) + if ( this.host == null ) return false; - return host.isSlotEnabled( groupNum ); + return this.host.isSlotEnabled( this.groupNum ); } } diff --git a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java index 2e6e2fa04..1c997f919 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java @@ -37,10 +37,10 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput @Override public boolean isEnabled() { - if ( host == null ) + if ( this.host == null ) return false; - return host.isSlotEnabled( groupNum ); + return this.host.isSlotEnabled( this.groupNum ); } } diff --git a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java index 856a87ce1..74e684cac 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java @@ -42,14 +42,14 @@ public class SlotCraftingMatrix extends AppEngSlot public void clearStack() { super.clearStack(); - c.onCraftMatrixChanged( inventory ); + this.c.onCraftMatrixChanged( this.inventory ); } @Override public ItemStack decrStackSize(int par1) { ItemStack is = super.decrStackSize( par1 ); - c.onCraftMatrixChanged( inventory ); + this.c.onCraftMatrixChanged( this.inventory ); return is; } @@ -57,7 +57,7 @@ public class SlotCraftingMatrix extends AppEngSlot public void putStack(ItemStack par1ItemStack) { super.putStack( par1ItemStack ); - c.onCraftMatrixChanged( inventory ); + this.c.onCraftMatrixChanged( this.inventory ); } } diff --git a/src/main/java/appeng/container/slot/SlotCraftingTerm.java b/src/main/java/appeng/container/slot/SlotCraftingTerm.java index 1220562e1..e51acbcd2 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingTerm.java +++ b/src/main/java/appeng/container/slot/SlotCraftingTerm.java @@ -64,14 +64,14 @@ public class SlotCraftingTerm extends AppEngCraftingSlot this.energySrc = energySrc; this.storage = storage; this.mySrc = mySrc; - pattern = cMatrix; - craftInv = secondMatrix; - container = ccp; + this.pattern = cMatrix; + this.craftInv = secondMatrix; + this.container = ccp; } public IInventory getCraftingMatrix() { - return craftInv; + return this.craftInv; } @Override @@ -92,18 +92,18 @@ public class SlotCraftingTerm extends AppEngCraftingSlot public ItemStack craftItem( EntityPlayer p, ItemStack request, IMEMonitor inv, IItemList all ) { // update crafting matrix... - ItemStack is = getStack(); + ItemStack is = this.getStack(); if ( is != null && Platform.isSameItem( request, is ) ) { - ItemStack[] set = new ItemStack[pattern.getSizeInventory()]; + ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()]; // add one of each item to the items on the board... if ( Platform.isServer() ) { InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); for ( int x = 0; x < 9; x++ ) - ic.setInventorySlotContents( x, pattern.getStackInSlot( x ) ); + ic.setInventorySlotContents( x, this.pattern.getStackInSlot( x ) ); IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); @@ -125,7 +125,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot { super.onPickupFromSlot( p, is ); // actually necessary to cleanup this case... - p.openContainer.onCraftMatrixChanged( getCraftingMatrix() ); + p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() ); return request; } } @@ -136,27 +136,27 @@ public class SlotCraftingTerm extends AppEngCraftingSlot if ( inv != null ) { - for ( int x = 0; x < pattern.getSizeInventory(); x++ ) + for ( int x = 0; x < this.pattern.getSizeInventory(); x++ ) { - if ( pattern.getStackInSlot( x ) != null ) + if ( this.pattern.getStackInSlot( x ) != null ) { - set[x] = Platform.extractItemsByRecipe( energySrc, mySrc, inv, p.worldObj, r, is, ic, pattern.getStackInSlot( x ), x, all, - Actionable.MODULATE, ItemViewCell.createFilter( container.getViewCells() ) ); + set[x] = Platform.extractItemsByRecipe( this.energySrc, this.mySrc, inv, p.worldObj, r, is, ic, this.pattern.getStackInSlot( x ), x, all, + Actionable.MODULATE, ItemViewCell.createFilter( this.container.getViewCells() ) ); ic.setInventorySlotContents( x, set[x] ); } } } } - if ( preCraft( p, inv, set, is ) ) + if ( this.preCraft( p, inv, set, is ) ) { - makeItem( p, is ); + this.makeItem( p, is ); - postCraft( p, inv, set, is ); + this.postCraft( p, inv, set, is ); } // shouldn't be necessary... - p.openContainer.onCraftMatrixChanged( getCraftingMatrix() ); + p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() ); return is; } @@ -177,14 +177,14 @@ public class SlotCraftingTerm extends AppEngCraftingSlot if ( Platform.isServer() ) { // set new items onto the crafting table... - for ( int x = 0; x < getCraftingMatrix().getSizeInventory(); x++ ) + for ( int x = 0; x < this.getCraftingMatrix().getSizeInventory(); x++ ) { - if ( getCraftingMatrix().getStackInSlot( x ) == null ) - getCraftingMatrix().setInventorySlotContents( x, set[x] ); + if ( this.getCraftingMatrix().getStackInSlot( x ) == null ) + this.getCraftingMatrix().setInventorySlotContents( x, set[x] ); else if ( set[x] != null ) { // eek! put it back! - IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, mySrc ); + IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc ); if ( fail != null ) drops.add( fail.getItemStack() ); } @@ -197,25 +197,25 @@ public class SlotCraftingTerm extends AppEngCraftingSlot public void doClick( InventoryAction action, EntityPlayer who ) { - if ( getStack() == null ) + if ( this.getStack() == null ) return; if ( Platform.isClient() ) return; - IMEMonitor inv = storage.getItemInventory(); - int howManyPerCraft = getStack().stackSize; + IMEMonitor inv = this.storage.getItemInventory(); + int howManyPerCraft = this.getStack().stackSize; int maxTimesToCraft = 0; InventoryAdaptor ia = null; if ( action == InventoryAction.CRAFT_SHIFT ) // craft into player inventory... { ia = InventoryAdaptor.getAdaptor( who, null ); - maxTimesToCraft = ( int ) Math.floor( ( double ) getStack().getMaxStackSize() / ( double ) howManyPerCraft ); + maxTimesToCraft = ( int ) Math.floor( ( double ) this.getStack().getMaxStackSize() / ( double ) howManyPerCraft ); } else if ( action == InventoryAction.CRAFT_STACK ) // craft into hand, full stack { ia = new AdaptorPlayerHand( who ); - maxTimesToCraft = ( int ) Math.floor( ( double ) getStack().getMaxStackSize() / ( double ) howManyPerCraft ); + maxTimesToCraft = ( int ) Math.floor( ( double ) this.getStack().getMaxStackSize() / ( double ) howManyPerCraft ); } else // pick up what was crafted... @@ -224,12 +224,12 @@ public class SlotCraftingTerm extends AppEngCraftingSlot maxTimesToCraft = 1; } - maxTimesToCraft = CapCraftingAttempts( maxTimesToCraft ); + maxTimesToCraft = this.CapCraftingAttempts( maxTimesToCraft ); if ( ia == null ) return; - ItemStack rs = Platform.cloneItemStack( getStack() ); + ItemStack rs = Platform.cloneItemStack( this.getStack() ); if ( rs == null ) return; @@ -238,7 +238,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot if ( ia.simulateAdd( rs ) == null ) { IItemList all = inv.getStorageList(); - ItemStack extra = ia.addItems( craftItem( who, rs, inv, all ) ); + ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) ); if ( extra != null ) { List drops = new ArrayList(); diff --git a/src/main/java/appeng/container/slot/SlotFake.java b/src/main/java/appeng/container/slot/SlotFake.java index 7b3496c26..47ecd2f12 100644 --- a/src/main/java/appeng/container/slot/SlotFake.java +++ b/src/main/java/appeng/container/slot/SlotFake.java @@ -29,7 +29,7 @@ public class SlotFake extends AppEngSlot public SlotFake(IInventory inv, int idx, int x, int y) { super( inv, idx, x, y ); - invSlot = idx; + this.invSlot = idx; } @Override diff --git a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java index 5f593e034..bf8d86553 100644 --- a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java +++ b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java @@ -42,9 +42,9 @@ public class SlotFakeBlacklist extends SlotFakeTypeOnly @Override public int getIcon() { - if ( getHasStack() ) + if ( this.getHasStack() ) { - return getStack().stackSize > 0 ? 16 + 14 : 14; + return this.getStack().stackSize > 0 ? 16 + 14 : 14; } return -1; } diff --git a/src/main/java/appeng/container/slot/SlotInaccessible.java b/src/main/java/appeng/container/slot/SlotInaccessible.java index 7f82f2d36..6668f6fbe 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessible.java +++ b/src/main/java/appeng/container/slot/SlotInaccessible.java @@ -34,20 +34,20 @@ public class SlotInaccessible extends AppEngSlot @Override public ItemStack getDisplayStack() { - if ( dspStack == null ) + if ( this.dspStack == null ) { ItemStack dsp = super.getDisplayStack(); if ( dsp != null ) - dspStack = dsp.copy(); + this.dspStack = dsp.copy(); } - return dspStack; + return this.dspStack; } @Override public void onSlotChanged() { super.onSlotChanged(); - dspStack = null; + this.dspStack = null; } @Override diff --git a/src/main/java/appeng/container/slot/SlotMACPattern.java b/src/main/java/appeng/container/slot/SlotMACPattern.java index 29de7a7d3..94adeb2c5 100644 --- a/src/main/java/appeng/container/slot/SlotMACPattern.java +++ b/src/main/java/appeng/container/slot/SlotMACPattern.java @@ -35,7 +35,7 @@ public class SlotMACPattern extends AppEngSlot @Override public boolean isItemValid(ItemStack i) { - return mac.isValidItemForSlot( this.getSlotIndex(), i ); + return this.mac.isValidItemForSlot( this.getSlotIndex(), i ); } } diff --git a/src/main/java/appeng/container/slot/SlotOutput.java b/src/main/java/appeng/container/slot/SlotOutput.java index 91bf033cd..30c8bb63f 100644 --- a/src/main/java/appeng/container/slot/SlotOutput.java +++ b/src/main/java/appeng/container/slot/SlotOutput.java @@ -26,7 +26,7 @@ public class SlotOutput extends AppEngSlot public SlotOutput(IInventory a, int b, int c, int d, int i) { super( a, b, c, d ); - IIcon = i; + this.IIcon = i; } @Override diff --git a/src/main/java/appeng/container/slot/SlotPatternTerm.java b/src/main/java/appeng/container/slot/SlotPatternTerm.java index 9ec985ca1..d1b3f9cc2 100644 --- a/src/main/java/appeng/container/slot/SlotPatternTerm.java +++ b/src/main/java/appeng/container/slot/SlotPatternTerm.java @@ -42,18 +42,18 @@ public class SlotPatternTerm extends SlotCraftingTerm { super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c ); - host = h; - groupNum = groupNumber; + this.host = h; + this.groupNum = groupNumber; } @Override public ItemStack getStack() { - if ( !isEnabled() ) + if ( !this.isEnabled() ) { - if ( getDisplayStack() != null ) - clearStack(); + if ( this.getDisplayStack() != null ) + this.clearStack(); } return super.getStack(); @@ -62,15 +62,15 @@ public class SlotPatternTerm extends SlotCraftingTerm @Override public boolean isEnabled() { - if ( host == null ) + if ( this.host == null ) return false; - return host.isSlotEnabled( groupNum ); + return this.host.isSlotEnabled( this.groupNum ); } public AppEngPacket getRequest(boolean shift) throws IOException { - return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( getStack() ), shift ); + return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( this.getStack() ), shift ); } } diff --git a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java index 8e7f8d66f..29ef47895 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java +++ b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java @@ -25,6 +25,6 @@ public class SlotPlayerHotBar extends AppEngSlot public SlotPlayerHotBar(IInventory par1iInventory, int par2, int par3, int par4) { super( par1iInventory, par2, par3, par4 ); - isPlayerSide = true; + this.isPlayerSide = true; } } diff --git a/src/main/java/appeng/container/slot/SlotPlayerInv.java b/src/main/java/appeng/container/slot/SlotPlayerInv.java index a874d4807..ae959da02 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerInv.java +++ b/src/main/java/appeng/container/slot/SlotPlayerInv.java @@ -28,6 +28,6 @@ public class SlotPlayerInv extends AppEngSlot public SlotPlayerInv(IInventory par1iInventory, int par2, int par3, int par4) { super( par1iInventory, par2, par3, par4 ); - isPlayerSide = true; + this.isPlayerSide = true; } } diff --git a/src/main/java/appeng/container/slot/SlotRestrictedInput.java b/src/main/java/appeng/container/slot/SlotRestrictedInput.java index 8c5e1ff6f..b345ddd23 100644 --- a/src/main/java/appeng/container/slot/SlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/SlotRestrictedInput.java @@ -61,21 +61,21 @@ public class SlotRestrictedInput extends AppEngSlot public final int IIcon; private PlacableItemType(int o) { - IIcon = o; + this.IIcon = o; } } @Override public int getSlotStackLimit() { - if ( stackLimit != -1 ) - return stackLimit; + if ( this.stackLimit != -1 ) + return this.stackLimit; return super.getSlotStackLimit(); } public boolean isValid(ItemStack is, World theWorld) { - if ( which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT ) + if ( this.which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT ) { ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) is.getItem()).getPatternForItem( is, theWorld ) : null; @@ -94,26 +94,26 @@ public class SlotRestrictedInput extends AppEngSlot @Override public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - return allowEdit; + return this.allowEdit; } public Slot setStackLimit(int i) { - stackLimit = i; + this.stackLimit = i; return this; } public SlotRestrictedInput(PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p) { super( i, slotIndex, x, y ); - which = valid; - IIcon = valid.IIcon; + this.which = valid; + this.IIcon = valid.IIcon; this.p = p; } @Override public ItemStack getDisplayStack() { - if ( Platform.isClient() && (which == PlacableItemType.ENCODED_PATTERN) ) + if ( Platform.isClient() && (this.which == PlacableItemType.ENCODED_PATTERN) ) { ItemStack is = super.getStack(); if ( is != null && is.getItem() instanceof ItemEncodedPattern ) @@ -130,7 +130,7 @@ public class SlotRestrictedInput extends AppEngSlot @Override public boolean isItemValid(ItemStack i) { - if ( !myContainer.isValidForSlot( this, i ) ) + if ( !this.myContainer.isValidForSlot( this, i ) ) return false; if ( i == null ) @@ -138,21 +138,21 @@ public class SlotRestrictedInput extends AppEngSlot if ( i.getItem() == null ) return false; - if ( !inventory.isItemValidForSlot( this.getSlotIndex(), i ) ) + if ( !this.inventory.isItemValidForSlot( this.getSlotIndex(), i ) ) return false; IAppEngApi api = AEApi.instance(); - if ( !allowEdit ) + if ( !this.allowEdit ) return false; - switch (which) + switch (this.which) { case ENCODED_CRAFTING_PATTERN: if ( i.getItem() instanceof ICraftingPatternItem ) { ICraftingPatternItem b = (ICraftingPatternItem) i.getItem(); - ICraftingPatternDetails de = b.getPatternForItem( i, p.player.worldObj ); + ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj ); if ( de != null ) return de.isCraftable(); } diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index 7a6fac859..db876f09c 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -77,7 +77,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon public int quartzOresClusterAmount = 15; public int chargedChange = 4; public int minMeteoriteDistance = 707; - public int minMeteoriteDistanceSq = minMeteoriteDistance * minMeteoriteDistance; + public int minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance; private double WirelessBaseCost = 8; private double WirelessCostMultiplier = 1; @@ -90,17 +90,17 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon public double wireless_getDrainRate(double range) { - return WirelessTerminalDrainMultiplier * range; + return this.WirelessTerminalDrainMultiplier * range; } public double wireless_getMaxRange(int boosters) { - return WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp ); + return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp ); } public double wireless_getPowerDrain(int boosters) { - return WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount ); + return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount ); } @Override @@ -161,44 +161,44 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon { if ( eventArgs.modID.equals( AppEng.MOD_ID ) ) { - clientSync(); + this.clientSync(); } } private void clientSync() { - disableColoredCableRecipesInNEI = get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true ); - enableEffects = get( "Client", "enableEffects", true ).getBoolean( true ); - useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false ); + this.disableColoredCableRecipesInNEI = this.get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true ); + this.enableEffects = this.get( "Client", "enableEffects", true ).getBoolean( true ); + this.useLargeFonts = this.get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false ); // load buttons.. for (int btnNum = 0; btnNum < 4; btnNum++) { - Property cmb = get( "Client", "craftAmtButton" + (btnNum + 1), craftByStacks[btnNum] ); - Property pmb = get( "Client", "priorityAmtButton" + (btnNum + 1), priorityByStacks[btnNum] ); - Property lmb = get( "Client", "levelAmtButton" + (btnNum + 1), levelByStacks[btnNum] ); + Property cmb = this.get( "Client", "craftAmtButton" + (btnNum + 1), this.craftByStacks[btnNum] ); + Property pmb = this.get( "Client", "priorityAmtButton" + (btnNum + 1), this.priorityByStacks[btnNum] ); + Property lmb = this.get( "Client", "levelAmtButton" + (btnNum + 1), this.levelByStacks[btnNum] ); int buttonCap = (int) (Math.pow( 10, btnNum + 1 ) - 1); - craftByStacks[btnNum] = Math.abs( cmb.getInt( craftByStacks[btnNum] ) ); - priorityByStacks[btnNum] = Math.abs( pmb.getInt( priorityByStacks[btnNum] ) ); - levelByStacks[btnNum] = Math.abs( pmb.getInt( levelByStacks[btnNum] ) ); + this.craftByStacks[btnNum] = Math.abs( cmb.getInt( this.craftByStacks[btnNum] ) ); + this.priorityByStacks[btnNum] = Math.abs( pmb.getInt( this.priorityByStacks[btnNum] ) ); + this.levelByStacks[btnNum] = Math.abs( pmb.getInt( this.levelByStacks[btnNum] ) ); cmb.comment = "Controls buttons on Crafting Screen : Capped at " + buttonCap; pmb.comment = "Controls buttons on Priority Screen : Capped at " + buttonCap; lmb.comment = "Controls buttons on Level Emitter Screen : Capped at " + buttonCap; - craftByStacks[btnNum] = Math.min( craftByStacks[btnNum], buttonCap ); - priorityByStacks[btnNum] = Math.min( priorityByStacks[btnNum], buttonCap ); - levelByStacks[btnNum] = Math.min( levelByStacks[btnNum], buttonCap ); + this.craftByStacks[btnNum] = Math.min( this.craftByStacks[btnNum], buttonCap ); + this.priorityByStacks[btnNum] = Math.min( this.priorityByStacks[btnNum], buttonCap ); + this.levelByStacks[btnNum] = Math.min( this.levelByStacks[btnNum], buttonCap ); } - for (Enum e : settings.getSettings()) + for (Enum e : this.settings.getSettings()) { String Category = "Client"; // e.getClass().getSimpleName(); - Enum value = settings.getSetting( e ); + Enum value = this.settings.getSetting( e ); - Property p = this.get( Category, e.name(), value.name(), getListComment( value ) ); + Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) ); try { @@ -209,24 +209,24 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" ); } - settings.putSetting( e, value ); + this.settings.putSetting( e, value ); } } public boolean disableColoredCableRecipesInNEI() { - return disableColoredCableRecipesInNEI; + return this.disableColoredCableRecipesInNEI; } public String getFilePath() { - return myPath.toString(); + return this.myPath.toString(); } public AEConfig(String path) { super( new File( path + "AppliedEnergistics2.cfg" ) ); - myPath = new File( path + "AppliedEnergistics2.cfg" ); + this.myPath = new File( path + "AppliedEnergistics2.cfg" ); FMLCommonHandler.instance().bus().register( this ); @@ -236,69 +236,69 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon final double DEFAULT_RF_EXCHANGE = 0.5; final double DEFAULT_MEKANISM_EXCHANGE = 0.2; - PowerUnits.MJ.conversionRatio = get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE ); - PowerUnits.MK.conversionRatio = get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE ); - PowerUnits.EU.conversionRatio = get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE ); - PowerUnits.WA.conversionRatio = get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE ); - PowerUnits.RF.conversionRatio = get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE ); + PowerUnits.MJ.conversionRatio = this.get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE ); + PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE ); + PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE ); + PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE ); + PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE ); - double usageEffective = get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); + double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective ); - CondenserOutput.MATTER_BALLS.requiredPower = get( "Condenser", "MatterBalls", 256 ).getInt( 256 ); - CondenserOutput.SINGULARITY.requiredPower = get( "Condenser", "Singularity", 256000 ).getInt( 256000 ); + CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 ); + CondenserOutput.SINGULARITY.requiredPower = this.get( "Condenser", "Singularity", 256000 ).getInt( 256000 ); - grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList(); - oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage ); + this.grinderOres = this.get( "GrindStone", "grinderOres", this.grinderOres ).getStringList(); + this.oreDoublePercentage = this.get( "GrindStone", "oreDoublePercentage", this.oreDoublePercentage ).getDouble( this.oreDoublePercentage ); - settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES ); - settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL ); - settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH ); + this.settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES ); + this.settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL ); + this.settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH ); - spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance )); - minMeteoriteDistance = get( "worldGen", "minMeteoriteDistance", minMeteoriteDistance ).getInt( minMeteoriteDistance ); - meteoriteClusterChance = get( "worldGen", "meteoriteClusterChance", meteoriteClusterChance ).getDouble( meteoriteClusterChance ); - meteoriteSpawnChance = get( "worldGen", "meteoriteSpawnChance", meteoriteSpawnChance ).getDouble( meteoriteSpawnChance ); - meteoriteDimensionWhitelist = get ("worldGen", "meteoriteDimensionWhitelist", meteoriteDimensionWhitelist).getIntList(); + this.spawnChargedChance = (float) (1.0 - this.get( "worldGen", "spawnChargedChance", 1.0 - this.spawnChargedChance ).getDouble( 1.0 - this.spawnChargedChance )); + this.minMeteoriteDistance = this.get( "worldGen", "minMeteoriteDistance", this.minMeteoriteDistance ).getInt( this.minMeteoriteDistance ); + this.meteoriteClusterChance = this.get( "worldGen", "meteoriteClusterChance", this.meteoriteClusterChance ).getDouble( this.meteoriteClusterChance ); + this.meteoriteSpawnChance = this.get( "worldGen", "meteoriteSpawnChance", this.meteoriteSpawnChance ).getDouble( this.meteoriteSpawnChance ); + this.meteoriteDimensionWhitelist = this.get ("worldGen", "meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist).getIntList(); - quartzOresPerCluster = get( "worldGen", "quartzOresPerCluster", quartzOresPerCluster ).getInt( quartzOresPerCluster ); - quartzOresClusterAmount = get( "worldGen", "quartzOresClusterAmount", quartzOresClusterAmount ).getInt( quartzOresClusterAmount ); + this.quartzOresPerCluster = this.get( "worldGen", "quartzOresPerCluster", this.quartzOresPerCluster ).getInt( this.quartzOresPerCluster ); + this.quartzOresClusterAmount = this.get( "worldGen", "quartzOresClusterAmount", this.quartzOresClusterAmount ).getInt( this.quartzOresClusterAmount ); - minMeteoriteDistanceSq = minMeteoriteDistance * minMeteoriteDistance; + this.minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance; - addCustomCategoryComment( + this.addCustomCategoryComment( "wireless", "Range= WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp )\nPowerDrain= WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount )" ); - WirelessBaseCost = get( "wireless", "WirelessBaseCost", WirelessBaseCost ).getDouble( WirelessBaseCost ); - WirelessCostMultiplier = get( "wireless", "WirelessCostMultiplier", WirelessCostMultiplier ).getDouble( WirelessCostMultiplier ); - WirelessBaseRange = get( "wireless", "WirelessBaseRange", WirelessBaseRange ).getDouble( WirelessBaseRange ); - WirelessBoosterRangeMultiplier = get( "wireless", "WirelessBoosterRangeMultiplier", WirelessBoosterRangeMultiplier ).getDouble( - WirelessBoosterRangeMultiplier ); - WirelessBoosterExp = get( "wireless", "WirelessBoosterExp", WirelessBoosterExp ).getDouble( WirelessBoosterExp ); - WirelessTerminalDrainMultiplier = get( "wireless", "WirelessTerminalDrainMultiplier", WirelessTerminalDrainMultiplier ).getDouble( - WirelessTerminalDrainMultiplier ); + this.WirelessBaseCost = this.get( "wireless", "WirelessBaseCost", this.WirelessBaseCost ).getDouble( this.WirelessBaseCost ); + this.WirelessCostMultiplier = this.get( "wireless", "WirelessCostMultiplier", this.WirelessCostMultiplier ).getDouble( this.WirelessCostMultiplier ); + this.WirelessBaseRange = this.get( "wireless", "WirelessBaseRange", this.WirelessBaseRange ).getDouble( this.WirelessBaseRange ); + this.WirelessBoosterRangeMultiplier = this.get( "wireless", "WirelessBoosterRangeMultiplier", this.WirelessBoosterRangeMultiplier ).getDouble( + this.WirelessBoosterRangeMultiplier ); + this.WirelessBoosterExp = this.get( "wireless", "WirelessBoosterExp", this.WirelessBoosterExp ).getDouble( this.WirelessBoosterExp ); + this.WirelessTerminalDrainMultiplier = this.get( "wireless", "WirelessTerminalDrainMultiplier", this.WirelessTerminalDrainMultiplier ).getDouble( + this.WirelessTerminalDrainMultiplier ); - formationPlaneEntityLimit = get( "automation", "formationPlaneEntityLimit", formationPlaneEntityLimit ).getInt( formationPlaneEntityLimit ); + this.formationPlaneEntityLimit = this.get( "automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit ).getInt( this.formationPlaneEntityLimit ); - wirelessTerminalBattery = get( "battery", "wirelessTerminal", wirelessTerminalBattery ).getInt( wirelessTerminalBattery ); - chargedStaffBattery = get( "battery", "chargedStaff", chargedStaffBattery ).getInt( chargedStaffBattery ); - entropyManipulatorBattery = get( "battery", "entropyManipulator", entropyManipulatorBattery ).getInt( entropyManipulatorBattery ); - portableCellBattery = get( "battery", "portableCell", portableCellBattery ).getInt( portableCellBattery ); - colorApplicatorBattery = get( "battery", "colorApplicator", colorApplicatorBattery ).getInt( colorApplicatorBattery ); - matterCannonBattery = get( "battery", "matterCannon", matterCannonBattery ).getInt( matterCannonBattery ); + this.wirelessTerminalBattery = this.get( "battery", "wirelessTerminal", this.wirelessTerminalBattery ).getInt( this.wirelessTerminalBattery ); + this.chargedStaffBattery = this.get( "battery", "chargedStaff", this.chargedStaffBattery ).getInt( this.chargedStaffBattery ); + this.entropyManipulatorBattery = this.get( "battery", "entropyManipulator", this.entropyManipulatorBattery ).getInt( this.entropyManipulatorBattery ); + this.portableCellBattery = this.get( "battery", "portableCell", this.portableCellBattery ).getInt( this.portableCellBattery ); + this.colorApplicatorBattery = this.get( "battery", "colorApplicator", this.colorApplicatorBattery ).getInt( this.colorApplicatorBattery ); + this.matterCannonBattery = this.get( "battery", "matterCannon", this.matterCannonBattery ).getInt( this.matterCannonBattery ); - clientSync(); + this.clientSync(); for (AEFeature feature : AEFeature.values()) { if ( feature.isVisible ) { - if ( get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) ) - featureFlags.add( feature ); + if ( this.get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) ) + this.featureFlags.add( feature ); } else - featureFlags.add( feature ); + this.featureFlags.add( feature ); } ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); @@ -306,16 +306,16 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon { List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); if ( version.contains( imb.getVersion() ) ) - featureFlags.remove( AEFeature.AlphaPass ); + this.featureFlags.remove( AEFeature.AlphaPass ); } try { - selectedPowerUnit = PowerUnits.valueOf( get( "Client", "PowerUnit", selectedPowerUnit.name(), getListComment( selectedPowerUnit ) ).getString() ); + this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() ); } catch (Throwable t) { - selectedPowerUnit = PowerUnits.AE; + this.selectedPowerUnit = PowerUnits.AE; } for (TickRates tr : TickRates.values()) @@ -323,45 +323,45 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon tr.Load( this ); } - if ( isFeatureEnabled( AEFeature.SpatialIO ) ) + if ( this.isFeatureEnabled( AEFeature.SpatialIO ) ) { - storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID ); - storageProviderID = get( "spatialio", "storageProviderID", storageProviderID ).getInt( storageProviderID ); - spatialPowerMultiplier = get( "spatialio", "spatialPowerMultiplier", spatialPowerMultiplier ).getDouble( spatialPowerMultiplier ); - spatialPowerExponent = get( "spatialio", "spatialPowerExponent", spatialPowerExponent ).getDouble( spatialPowerExponent ); + this.storageBiomeID = this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).getInt( this.storageBiomeID ); + this.storageProviderID = this.get( "spatialio", "storageProviderID", this.storageProviderID ).getInt( this.storageProviderID ); + this.spatialPowerMultiplier = this.get( "spatialio", "spatialPowerMultiplier", this.spatialPowerMultiplier ).getDouble( this.spatialPowerMultiplier ); + this.spatialPowerExponent = this.get( "spatialio", "spatialPowerExponent", this.spatialPowerExponent ).getDouble( this.spatialPowerExponent ); } - if ( isFeatureEnabled( AEFeature.CraftingCPU ) ) + if ( this.isFeatureEnabled( AEFeature.CraftingCPU ) ) { - craftingCalculationTimePerTick = get( "craftingCPU", "craftingCalculationTimePerTick", craftingCalculationTimePerTick ).getInt( - craftingCalculationTimePerTick ); + this.craftingCalculationTimePerTick = this.get( "craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick ).getInt( + this.craftingCalculationTimePerTick ); } - if ( isFeatureEnabled( AEFeature.VersionChecker ) ) + if ( this.isFeatureEnabled( AEFeature.VersionChecker ) ) { try { - latestVersion = get( "VersionChecker", "LatestVersion", "" ).getString(); - latestTimeStamp = Long.parseLong( get( "VersionChecker", "LatestTimeStamp", "" ).getString() ); + this.latestVersion = this.get( "VersionChecker", "LatestVersion", "" ).getString(); + this.latestTimeStamp = Long.parseLong( this.get( "VersionChecker", "LatestTimeStamp", "" ).getString() ); } catch (NumberFormatException err) { - latestTimeStamp = 0; + this.latestTimeStamp = 0; } } - updatable = true; + this.updatable = true; } public boolean useAEVersion(MaterialType mt) { - if ( isFeatureEnabled( AEFeature.WebsiteRecipes ) ) + if ( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) ) return true; - setCategoryComment( + this.setCategoryComment( "OreCamouflage", "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." ); - Property p = get( "OreCamouflage", mt.name(), true ); + Property p = this.get( "OreCamouflage", mt.name(), true ); p.comment = "OreDictionary Names: " + mt.getOreName(); return !p.getBoolean( true ); @@ -391,38 +391,38 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon @Override public void updateSetting(IConfigManager manager, Enum setting, Enum newValue) { - for (Enum e : settings.getSettings()) + for (Enum e : this.settings.getSettings()) { if ( e == setting ) { String Category = "Client"; - Property p = this.get( Category, e.name(), settings.getSetting( e ).name(), getListComment( newValue ) ); + Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) ); p.set( newValue.name() ); } } - if ( updatable ) - save(); + if ( this.updatable ) + this.save(); } @Override public void save() { - if ( isFeatureEnabled( AEFeature.VersionChecker ) ) + if ( this.isFeatureEnabled( AEFeature.VersionChecker ) ) { - get( "VersionChecker", "LatestVersion", latestVersion ).set( latestVersion ); - get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( latestTimeStamp ) ); + this.get( "VersionChecker", "LatestVersion", this.latestVersion ).set( this.latestVersion ); + this.get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( this.latestTimeStamp ) ); } - if ( isFeatureEnabled( AEFeature.SpatialIO ) ) + if ( this.isFeatureEnabled( AEFeature.SpatialIO ) ) { - get( "spatialio", "storageBiomeID", storageBiomeID ).set( storageBiomeID ); - get( "spatialio", "storageProviderID", storageProviderID ).set( storageProviderID ); + this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID ); + this.get( "spatialio", "storageProviderID", this.storageProviderID ).set( this.storageProviderID ); } - get( "Client", "PowerUnit", selectedPowerUnit.name(), getListComment( selectedPowerUnit ) ).set( selectedPowerUnit.name() ); + this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).set( this.selectedPowerUnit.name() ); - if ( hasChanged() ) + if ( this.hasChanged() ) super.save(); } @@ -431,7 +431,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon boolean alreadyUsed = false; int min = 0; - for (Property p : getCategory( Category ).getValues().values()) + for (Property p : this.getCategory( Category ).getValues().values()) { int thisInt = p.getInt(); @@ -454,49 +454,49 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon public int getFreeMaterial(int varID) { - return getFreeIDSLot( varID, "materials" ); + return this.getFreeIDSLot( varID, "materials" ); } public int getFreePart(int varID) { - return getFreeIDSLot( varID, "parts" ); + return this.getFreeIDSLot( varID, "parts" ); } @Override public IConfigManager getConfigManager() { - return settings; + return this.settings; } public boolean isFeatureEnabled(AEFeature f) { - return featureFlags.contains( f ); + return this.featureFlags.contains( f ); } public boolean useTerminalUseLargeFont() { - return useLargeFonts; + return this.useLargeFonts; } public int craftItemsByStackAmounts(int i) { - return craftByStacks[i]; + return this.craftByStacks[i]; } public int priorityByStacksAmounts(int i) { - return priorityByStacks[i]; + return this.priorityByStacks[i]; } public int levelByStackAmounts(int i) { - return levelByStacks[i]; + return this.levelByStacks[i]; } public Enum getSetting(String Category, Class class1, Enum myDefault) { String name = class1.getSimpleName(); - Property p = get( Category, name, myDefault.name() ); + Property p = this.get( Category, name, myDefault.name() ); try { @@ -513,19 +513,19 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon public void setSetting(String Category, Enum s) { String name = s.getClass().getSimpleName(); - get( Category, name, s.name() ).set( s.name() ); - save(); + this.get( Category, name, s.name() ).set( s.name() ); + this.save(); } public PowerUnits selectedPowerUnit() { - return selectedPowerUnit; + return this.selectedPowerUnit; } public void nextPowerUnit(boolean backwards) { - selectedPowerUnit = Platform.rotateEnum( selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() ); - save(); + this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() ); + this.save(); } } diff --git a/src/main/java/appeng/core/Api.java b/src/main/java/appeng/core/Api.java index 6717ecb73..a779db5c5 100644 --- a/src/main/java/appeng/core/Api.java +++ b/src/main/java/appeng/core/Api.java @@ -61,43 +61,43 @@ public class Api implements IAppEngApi @Override public IRegistryContainer registries() { - return rc; + return this.rc; } @Override public Items items() { - return items; + return this.items; } @Override public Materials materials() { - return materials; + return this.materials; } @Override public Blocks blocks() { - return blocks; + return this.blocks; } @Override public Parts parts() { - return parts; + return this.parts; } @Override public IStorageHelper storage() { - return storageHelper; + return this.storageHelper; } @Override public IPartHelper partHelper() { - return partHelper; + return this.partHelper; } @Override diff --git a/src/main/java/appeng/core/CreativeTab.java b/src/main/java/appeng/core/CreativeTab.java index 4eb28ce3f..25e2a4737 100644 --- a/src/main/java/appeng/core/CreativeTab.java +++ b/src/main/java/appeng/core/CreativeTab.java @@ -37,13 +37,13 @@ public final class CreativeTab extends CreativeTabs @Override public Item getTabIconItem() { - return getIconItemStack().getItem(); + return this.getIconItemStack().getItem(); } @Override public ItemStack getIconItemStack() { - return findFirst( AEApi.instance().blocks().blockController, AEApi.instance().blocks().blockChest, AEApi.instance().blocks().blockCellWorkbench, AEApi + return this.findFirst( AEApi.instance().blocks().blockController, AEApi.instance().blocks().blockChest, AEApi.instance().blocks().blockCellWorkbench, AEApi .instance().blocks().blockFluix, AEApi.instance().items().itemCell1k, AEApi.instance().items().itemNetworkTool, AEApi.instance().materials().materialFluixCrystal, AEApi.instance().materials().materialCertusQuartzCrystal ); } diff --git a/src/main/java/appeng/core/CreativeTabFacade.java b/src/main/java/appeng/core/CreativeTabFacade.java index b839b19aa..345819e71 100644 --- a/src/main/java/appeng/core/CreativeTabFacade.java +++ b/src/main/java/appeng/core/CreativeTabFacade.java @@ -36,7 +36,7 @@ public final class CreativeTabFacade extends CreativeTabs @Override public Item getTabIconItem() { - return getIconItemStack().getItem(); + return this.getIconItemStack().getItem(); } @Override diff --git a/src/main/java/appeng/core/FacadeConfig.java b/src/main/java/appeng/core/FacadeConfig.java index 8b0032f9f..6a1826c06 100644 --- a/src/main/java/appeng/core/FacadeConfig.java +++ b/src/main/java/appeng/core/FacadeConfig.java @@ -36,7 +36,7 @@ public class FacadeConfig extends Configuration public FacadeConfig(String path) { super( new File( path + "Facades.cfg" ) ); - replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" ); + this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" ); } public boolean checkEnabled(Block id, int metadata, boolean automatic) @@ -52,7 +52,7 @@ public class FacadeConfig extends Configuration try { if ( f.get( Block.class ) == id ) - return get( "minecraft", f.getName() + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic ); + return this.get( "minecraft", f.getName() + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic ); } catch (Throwable e) { @@ -62,9 +62,9 @@ public class FacadeConfig extends Configuration } else { - Matcher mod = replacementPattern.matcher( blk.modId ); - Matcher name = replacementPattern.matcher( blk.name ); - return get( mod.replaceAll( "" ), name.replaceAll( "" ) + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic ); + Matcher mod = this.replacementPattern.matcher( blk.modId ); + Matcher name = this.replacementPattern.matcher( blk.name ); + return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic ); } return false; diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index cb9102269..516a49c58 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -219,13 +219,13 @@ public class Registration private Registration() { - recipeHandler = new RecipeHandler(); - featuresToEntities = ArrayListMultimap.create(); + this.recipeHandler = new RecipeHandler(); + this.featuresToEntities = ArrayListMultimap.create(); } public void PreInit( FMLPreInitializationEvent event ) { - registerSpatial( false ); + this.registerSpatial( false ); IRecipeHandlerRegistry recipeRegistry = AEApi.instance().registries().recipes(); recipeRegistry.addNewSubItemResolver( new AEItemResolver() ); @@ -257,7 +257,7 @@ public class Registration Parts parts = Api.instance.parts(); Blocks blocks = Api.instance.blocks(); - AEItemDefinition materialItem = addFeature( ItemMultiMaterial.class ); + AEItemDefinition materialItem = this.addFeature( ItemMultiMaterial.class ); Class materialClass = materials.getClass(); for ( MaterialType mat : MaterialType.values() ) @@ -283,7 +283,7 @@ public class Registration } } - AEItemDefinition partItem = addFeature( ItemMultiPart.class ); + AEItemDefinition partItem = this.addFeature( ItemMultiPart.class ); Class partClass = parts.getClass(); for ( PartType type : PartType.values() ) @@ -330,111 +330,111 @@ public class Registration } // very important block! - blocks.blockMultiPart = addFeature( BlockCableBus.class ); + blocks.blockMultiPart = this.addFeature( BlockCableBus.class ); - blocks.blockCraftingUnit = addFeature( BlockCraftingUnit.class ); + blocks.blockCraftingUnit = this.addFeature( BlockCraftingUnit.class ); blocks.blockCraftingAccelerator = new WrappedDamageItemDefinition( blocks.blockCraftingUnit, 1 ); - blocks.blockCraftingMonitor = addFeature( BlockCraftingMonitor.class ); - blocks.blockCraftingStorage1k = addFeature( BlockCraftingStorage.class ); + blocks.blockCraftingMonitor = this.addFeature( BlockCraftingMonitor.class ); + blocks.blockCraftingStorage1k = this.addFeature( BlockCraftingStorage.class ); blocks.blockCraftingStorage4k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 1 ); blocks.blockCraftingStorage16k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 2 ); blocks.blockCraftingStorage64k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 3 ); - blocks.blockMolecularAssembler = addFeature( BlockMolecularAssembler.class ); + blocks.blockMolecularAssembler = this.addFeature( BlockMolecularAssembler.class ); - blocks.blockQuartzOre = addFeature( OreQuartz.class ); - blocks.blockQuartzOreCharged = addFeature( OreQuartzCharged.class ); - blocks.blockMatrixFrame = addFeature( BlockMatrixFrame.class ); - blocks.blockQuartz = addFeature( BlockQuartz.class ); - blocks.blockFluix = addFeature( BlockFluix.class ); - blocks.blockSkyStone = addFeature( BlockSkyStone.class ); - blocks.blockSkyChest = addFeature( BlockSkyChest.class ); - blocks.blockSkyCompass = addFeature( BlockSkyCompass.class ); + blocks.blockQuartzOre = this.addFeature( OreQuartz.class ); + blocks.blockQuartzOreCharged = this.addFeature( OreQuartzCharged.class ); + blocks.blockMatrixFrame = this.addFeature( BlockMatrixFrame.class ); + blocks.blockQuartz = this.addFeature( BlockQuartz.class ); + blocks.blockFluix = this.addFeature( BlockFluix.class ); + blocks.blockSkyStone = this.addFeature( BlockSkyStone.class ); + blocks.blockSkyChest = this.addFeature( BlockSkyChest.class ); + blocks.blockSkyCompass = this.addFeature( BlockSkyCompass.class ); - blocks.blockQuartzGlass = addFeature( BlockQuartzGlass.class ); - blocks.blockQuartzVibrantGlass = addFeature( BlockQuartzLamp.class ); - blocks.blockQuartzPillar = addFeature( BlockQuartzPillar.class ); - blocks.blockQuartzChiseled = addFeature( BlockQuartzChiseled.class ); - blocks.blockQuartzTorch = addFeature( BlockQuartzTorch.class ); - blocks.blockLightDetector = addFeature( BlockLightDetector.class ); - blocks.blockCharger = addFeature( BlockCharger.class ); - blocks.blockQuartzGrowthAccelerator = addFeature( BlockQuartzGrowthAccelerator.class ); + blocks.blockQuartzGlass = this.addFeature( BlockQuartzGlass.class ); + blocks.blockQuartzVibrantGlass = this.addFeature( BlockQuartzLamp.class ); + blocks.blockQuartzPillar = this.addFeature( BlockQuartzPillar.class ); + blocks.blockQuartzChiseled = this.addFeature( BlockQuartzChiseled.class ); + blocks.blockQuartzTorch = this.addFeature( BlockQuartzTorch.class ); + blocks.blockLightDetector = this.addFeature( BlockLightDetector.class ); + blocks.blockCharger = this.addFeature( BlockCharger.class ); + blocks.blockQuartzGrowthAccelerator = this.addFeature( BlockQuartzGrowthAccelerator.class ); - blocks.blockGrindStone = addFeature( BlockGrinder.class ); - blocks.blockCrankHandle = addFeature( BlockCrank.class ); - blocks.blockInscriber = addFeature( BlockInscriber.class ); - blocks.blockWireless = addFeature( BlockWireless.class ); - blocks.blockTinyTNT = addFeature( BlockTinyTNT.class ); + blocks.blockGrindStone = this.addFeature( BlockGrinder.class ); + blocks.blockCrankHandle = this.addFeature( BlockCrank.class ); + blocks.blockInscriber = this.addFeature( BlockInscriber.class ); + blocks.blockWireless = this.addFeature( BlockWireless.class ); + blocks.blockTinyTNT = this.addFeature( BlockTinyTNT.class ); - blocks.blockQuantumRing = addFeature( BlockQuantumRing.class ); - blocks.blockQuantumLink = addFeature( BlockQuantumLinkChamber.class ); + blocks.blockQuantumRing = this.addFeature( BlockQuantumRing.class ); + blocks.blockQuantumLink = this.addFeature( BlockQuantumLinkChamber.class ); - blocks.blockSpatialPylon = addFeature( BlockSpatialPylon.class ); - blocks.blockSpatialIOPort = addFeature( BlockSpatialIOPort.class ); + blocks.blockSpatialPylon = this.addFeature( BlockSpatialPylon.class ); + blocks.blockSpatialIOPort = this.addFeature( BlockSpatialIOPort.class ); - blocks.blockController = addFeature( BlockController.class ); - blocks.blockDrive = addFeature( BlockDrive.class ); - blocks.blockChest = addFeature( BlockChest.class ); - blocks.blockInterface = addFeature( BlockInterface.class ); - blocks.blockCellWorkbench = addFeature( BlockCellWorkbench.class ); - blocks.blockIOPort = addFeature( BlockIOPort.class ); - blocks.blockCondenser = addFeature( BlockCondenser.class ); - blocks.blockEnergyAcceptor = addFeature( BlockEnergyAcceptor.class ); - blocks.blockVibrationChamber = addFeature( BlockVibrationChamber.class ); + blocks.blockController = this.addFeature( BlockController.class ); + blocks.blockDrive = this.addFeature( BlockDrive.class ); + blocks.blockChest = this.addFeature( BlockChest.class ); + blocks.blockInterface = this.addFeature( BlockInterface.class ); + blocks.blockCellWorkbench = this.addFeature( BlockCellWorkbench.class ); + blocks.blockIOPort = this.addFeature( BlockIOPort.class ); + blocks.blockCondenser = this.addFeature( BlockCondenser.class ); + blocks.blockEnergyAcceptor = this.addFeature( BlockEnergyAcceptor.class ); + blocks.blockVibrationChamber = this.addFeature( BlockVibrationChamber.class ); - blocks.blockEnergyCell = addFeature( BlockEnergyCell.class ); - blocks.blockEnergyCellDense = addFeature( BlockDenseEnergyCell.class ); - blocks.blockEnergyCellCreative = addFeature( BlockCreativeEnergyCell.class ); + blocks.blockEnergyCell = this.addFeature( BlockEnergyCell.class ); + blocks.blockEnergyCellDense = this.addFeature( BlockDenseEnergyCell.class ); + blocks.blockEnergyCellCreative = this.addFeature( BlockCreativeEnergyCell.class ); - blocks.blockSecurity = addFeature( BlockSecurity.class ); - blocks.blockPaint = addFeature( BlockPaint.class ); + blocks.blockSecurity = this.addFeature( BlockSecurity.class ); + blocks.blockPaint = this.addFeature( BlockPaint.class ); - items.itemCellCreative = addFeature( ItemCreativeStorageCell.class ); - items.itemViewCell = addFeature( ItemViewCell.class ); - items.itemEncodedPattern = addFeature( ItemEncodedPattern.class ); + items.itemCellCreative = this.addFeature( ItemCreativeStorageCell.class ); + items.itemViewCell = this.addFeature( ItemViewCell.class ); + items.itemEncodedPattern = this.addFeature( ItemEncodedPattern.class ); - items.itemCell1k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell1kPart, 1 ); - items.itemCell4k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell4kPart, 4 ); - items.itemCell16k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell16kPart, 16 ); - items.itemCell64k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell64kPart, 64 ); + items.itemCell1k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell1kPart, 1 ); + items.itemCell4k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell4kPart, 4 ); + items.itemCell16k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell16kPart, 16 ); + items.itemCell64k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell64kPart, 64 ); - items.itemSpatialCell2 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell2SpatialPart, 2 ); - items.itemSpatialCell16 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell16SpatialPart, 16 ); - items.itemSpatialCell128 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell128SpatialPart, 128 ); + items.itemSpatialCell2 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell2SpatialPart, 2 ); + items.itemSpatialCell16 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell16SpatialPart, 16 ); + items.itemSpatialCell128 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell128SpatialPart, 128 ); - items.itemCertusQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.CertusQuartzTools ); - items.itemCertusQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzKnife = this.addFeature( ToolQuartzCuttingKnife.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzWrench = this.addFeature( ToolQuartzWrench.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzAxe = this.addFeature( ToolQuartzAxe.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzHoe = this.addFeature( ToolQuartzHoe.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzPick = this.addFeature( ToolQuartzPickaxe.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzShovel = this.addFeature( ToolQuartzSpade.class, AEFeature.CertusQuartzTools ); + items.itemCertusQuartzSword = this.addFeature( ToolQuartzSword.class, AEFeature.CertusQuartzTools ); - items.itemNetherQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.NetherQuartzTools ); - items.itemNetherQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzKnife = this.addFeature( ToolQuartzCuttingKnife.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzWrench = this.addFeature( ToolQuartzWrench.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzAxe = this.addFeature( ToolQuartzAxe.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzHoe = this.addFeature( ToolQuartzHoe.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzPick = this.addFeature( ToolQuartzPickaxe.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzShovel = this.addFeature( ToolQuartzSpade.class, AEFeature.NetherQuartzTools ); + items.itemNetherQuartzSword = this.addFeature( ToolQuartzSword.class, AEFeature.NetherQuartzTools ); - items.itemMassCannon = addFeature( ToolMassCannon.class ); - items.itemMemoryCard = addFeature( ToolMemoryCard.class ); - items.itemChargedStaff = addFeature( ToolChargedStaff.class ); - items.itemEntropyManipulator = addFeature( ToolEntropyManipulator.class ); - items.itemColorApplicator = addFeature( ToolColorApplicator.class ); + items.itemMassCannon = this.addFeature( ToolMassCannon.class ); + items.itemMemoryCard = this.addFeature( ToolMemoryCard.class ); + items.itemChargedStaff = this.addFeature( ToolChargedStaff.class ); + items.itemEntropyManipulator = this.addFeature( ToolEntropyManipulator.class ); + items.itemColorApplicator = this.addFeature( ToolColorApplicator.class ); - items.itemWirelessTerminal = addFeature( ToolWirelessTerminal.class ); - items.itemNetworkTool = addFeature( ToolNetworkTool.class ); - items.itemPortableCell = addFeature( ToolPortableCell.class ); - items.itemBiometricCard = addFeature( ToolBiometricCard.class ); + items.itemWirelessTerminal = this.addFeature( ToolWirelessTerminal.class ); + items.itemNetworkTool = this.addFeature( ToolNetworkTool.class ); + items.itemPortableCell = this.addFeature( ToolPortableCell.class ); + items.itemBiometricCard = this.addFeature( ToolBiometricCard.class ); - items.itemFacade = addFeature( ItemFacade.class ); - items.itemCrystalSeed = addFeature( ItemCrystalSeed.class ); + items.itemFacade = this.addFeature( ItemFacade.class ); + items.itemCrystalSeed = this.addFeature( ItemCrystalSeed.class ); ColoredItemDefinition paintBall, lumenPaintBall; items.itemPaintBall = paintBall = new ColoredItemDefinition(); items.itemLumenPaintBall = lumenPaintBall = new ColoredItemDefinition(); - AEItemDefinition pb = addFeature( ItemPaintBall.class ); + AEItemDefinition pb = this.addFeature( ItemPaintBall.class ); for ( AEColor c : AEColor.values() ) { @@ -456,14 +456,14 @@ public class Registration this.addFeature( QuartzPillarStairBlock.class, blocks.blockQuartzPillar.block() ); // unsupported developer tools - addFeature( ToolEraser.class ); - addFeature( ToolMeteoritePlacer.class ); - addFeature( ToolDebugCard.class ); - addFeature( ToolReplicatorCard.class ); - addFeature( BlockItemGen.class ); - addFeature( BlockChunkloader.class ); - addFeature( BlockPhantomNode.class ); - addFeature( BlockCubeGenerator.class ); + this.addFeature( ToolEraser.class ); + this.addFeature( ToolMeteoritePlacer.class ); + this.addFeature( ToolDebugCard.class ); + this.addFeature( ToolReplicatorCard.class ); + this.addFeature( BlockItemGen.class ); + this.addFeature( BlockChunkloader.class ); + this.addFeature( BlockPhantomNode.class ); + this.addFeature( BlockCubeGenerator.class ); } private void registerSpatial( boolean force ) @@ -473,7 +473,7 @@ public class Registration AEConfig config = AEConfig.instance; - if ( storageBiome == null ) + if ( this.storageBiome == null ) { if ( force && config.storageBiomeID == -1 ) { @@ -481,12 +481,12 @@ public class Registration if ( config.storageBiomeID == -1 ) throw new RuntimeException( "Biome Array is full, please free up some Biome ID's or disable spatial." ); - storageBiome = new BiomeGenStorage( config.storageBiomeID ); + this.storageBiome = new BiomeGenStorage( config.storageBiomeID ); config.save(); } if ( !force && config.storageBiomeID != -1 ) - storageBiome = new BiomeGenStorage( config.storageBiomeID ); + this.storageBiome = new BiomeGenStorage( config.storageBiomeID ); } if ( config.storageProviderID != -1 ) @@ -543,9 +543,9 @@ public class Registration ItemMultiMaterial.instance.makeUnique(); if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) ) - recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" ); + this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" ); else - recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); + this.recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); IPartHelper ph = AEApi.instance().partHelper(); ph.registerNewLayer( "appeng.parts.layers.LayerISidedInventory", "net.minecraft.inventory.ISidedInventory" ); @@ -594,7 +594,7 @@ public class Registration AEApi.instance().registries().matterCannon().registerAmmo( AEApi.instance().materials().materialMatterBall.stack( 1 ), 32.0 ); - recipeHandler.injectRecipes(); + this.recipeHandler.injectRecipes(); final PlayerStatsRegistration registration = new PlayerStatsRegistration( FMLCommonHandler.instance().bus(), AEConfig.instance ); registration.registerAchievementHandlers(); @@ -609,7 +609,7 @@ public class Registration public void PostInit( FMLPostInitializationEvent event ) { - registerSpatial( true ); + this.registerSpatial( true ); // default settings.. ( ( P2PTunnelRegistry ) AEApi.instance().registries().p2pTunnel() ).configure(); diff --git a/src/main/java/appeng/core/api/ApiPart.java b/src/main/java/appeng/core/api/ApiPart.java index a1b354169..ee2d1636d 100644 --- a/src/main/java/appeng/core/api/ApiPart.java +++ b/src/main/java/appeng/core/api/ApiPart.java @@ -69,7 +69,7 @@ public class ApiPart implements IPartHelper public void initFMPSupport() { - for (Class layerInterface : interfaces2Layer.keySet()) + for (Class layerInterface : this.interfaces2Layer.keySet()) { if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) ) ((IFMP) AppEng.instance.getIntegration( IntegrationType.FMP )).registerPassThrough( layerInterface ); @@ -82,7 +82,7 @@ public class ApiPart implements IPartHelper Class clazz = null; try { - ClassLoader loader = getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); + ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); Class root = ClassLoader.class; Class cls = loader.getClass(); Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class ); @@ -118,7 +118,7 @@ public class ApiPart implements IPartHelper { ClassReader cr; String path = '/' + name.replace( ".", "/" ) + ".class"; - InputStream is = getClass().getResourceAsStream( path ); + InputStream is = this.getClass().getResourceAsStream( path ); cr = new ClassReader( is ); ClassNode cn = new ClassNode(); cr.accept( cn, ClassReader.EXPAND_FRAMES ); @@ -132,7 +132,7 @@ public class ApiPart implements IPartHelper public Class getCombinedInstance(String base) { - if ( desc.size() == 0 ) + if ( this.desc.size() == 0 ) { try { @@ -144,13 +144,13 @@ public class ApiPart implements IPartHelper } } - String description = base + ':' + Joiner.on( ";" ).skipNulls().join( desc.iterator() ); + String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() ); - if ( tileImplementations.get( description ) != null ) + if ( this.tileImplementations.get( description ) != null ) { try { - return tileImplementations.get( description ); + return this.tileImplementations.get( description ); } catch (Throwable t) { @@ -181,12 +181,12 @@ public class ApiPart implements IPartHelper String path = f; - for (String name : desc) + for (String name : this.desc) { try { String newPath = path + ';' + name; - myCLass = getClassByDesc( Addendum, newPath, f, interfaces2Layer.get( Class.forName( name ) ) ); + myCLass = this.getClassByDesc( Addendum, newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) ); path = newPath; } catch (Throwable t) @@ -198,7 +198,7 @@ public class ApiPart implements IPartHelper f = myCLass.getName(); } - tileImplementations.put( description, myCLass ); + this.tileImplementations.put( description, myCLass ); try { @@ -218,7 +218,7 @@ public class ApiPart implements IPartHelper @Override public String map(String typeName) { - String o = inputOutput.get( typeName ); + String o = this.inputOutput.get( typeName ); if ( o == null ) return typeName; return o; @@ -228,11 +228,11 @@ public class ApiPart implements IPartHelper public Class getClassByDesc(String Addendum, String fullPath, String root, String next) { - if ( roots.get( fullPath ) != null ) - return roots.get( fullPath ); + if ( this.roots.get( fullPath ) != null ) + return this.roots.get( fullPath ); ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); - ClassNode n = getReader( next ); + ClassNode n = this.getReader( next ); String originalName = n.name; try @@ -250,7 +250,7 @@ public class ApiPart implements IPartHelper Iterator i = mn.instructions.iterator(); while (i.hasNext()) { - processNode( i.next(), n.superName ); + this.processNode( i.next(), n.superName ); } } @@ -263,7 +263,7 @@ public class ApiPart implements IPartHelper // n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) ); byte[] byteArray = cw.toByteArray(); int size = byteArray.length; - Class clazz = loadClass( n.name.replace( "/", "." ), byteArray ); + Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray ); try { @@ -311,7 +311,7 @@ public class ApiPart implements IPartHelper AELog.error( t ); } - roots.put( fullPath, clazz ); + this.roots.put( fullPath, clazz ); return clazz; } @@ -346,10 +346,10 @@ public class ApiPart implements IPartHelper try { final Class layerInterfaceClass = Class.forName( layerInterface ); - if ( interfaces2Layer.get( layerInterfaceClass ) == null ) + if ( this.interfaces2Layer.get( layerInterfaceClass ) == null ) { - interfaces2Layer.put( layerInterfaceClass, layer ); - desc.add( layerInterface ); + this.interfaces2Layer.put( layerInterfaceClass, layer ); + this.desc.add( layerInterface ); return true; } else diff --git a/src/main/java/appeng/core/crash/CrashEnhancement.java b/src/main/java/appeng/core/crash/CrashEnhancement.java index 77dc62f01..56bb8e210 100644 --- a/src/main/java/appeng/core/crash/CrashEnhancement.java +++ b/src/main/java/appeng/core/crash/CrashEnhancement.java @@ -42,31 +42,31 @@ public class CrashEnhancement implements ICrashCallable if ( Output == CrashInfo.MOD_VERSION ) { - name = "AE2 Version"; - value = ModVersion; + this.name = "AE2 Version"; + this.value = this.ModVersion; } else if ( Output == CrashInfo.INTEGRATION ) { - name = "AE2 Integration"; - value = IntegrationRegistry.INSTANCE.getStatus(); + this.name = "AE2 Integration"; + this.value = IntegrationRegistry.INSTANCE.getStatus(); } else { - name = "AE2_UNKNOWN"; - value = "UNKNOWN_VALUE"; + this.name = "AE2_UNKNOWN"; + this.value = "UNKNOWN_VALUE"; } } @Override public String call() throws Exception { - return value; + return this.value; } @Override public String getLabel() { - return name; + return this.name; } } diff --git a/src/main/java/appeng/core/features/AEFeatureHandler.java b/src/main/java/appeng/core/features/AEFeatureHandler.java index 557c6b855..afc2f0e1c 100644 --- a/src/main/java/appeng/core/features/AEFeatureHandler.java +++ b/src/main/java/appeng/core/features/AEFeatureHandler.java @@ -62,19 +62,19 @@ public class AEFeatureHandler implements AEItemDefinition public void register() { - if ( isFeatureAvailable() ) + if ( this.isFeatureAvailable() ) { - if ( feature instanceof Item ) + if ( this.feature instanceof Item ) { - initItem( ( Item ) feature ); + this.initItem( ( Item ) this.feature ); } else if ( this.feature instanceof BlockStairs ) { this.initStairBlock( ( BlockStairs ) this.feature ); } - else if ( feature instanceof Block ) + else if ( this.feature instanceof Block ) { - initBlock( ( Block ) feature ); + this.initBlock( ( Block ) this.feature ); } } } @@ -83,7 +83,7 @@ public class AEFeatureHandler implements AEItemDefinition { boolean enabled = true; - for ( AEFeature f : features ) + for ( AEFeature f : this.features ) enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); return enabled; @@ -91,9 +91,9 @@ public class AEFeatureHandler implements AEItemDefinition private void initItem( Item i ) { - ItemData = i; + this.ItemData = i; - String name = getName( i.getClass(), subName ); + String name = getName( i.getClass(), this.subName ); i.setTextureName( "appliedenergistics2:" + name ); i.setUnlocalizedName( /* "item." */"appliedenergistics2." + name ); @@ -114,7 +114,7 @@ public class AEFeatureHandler implements AEItemDefinition { this.stairData = stair; - String name = getName( stair.getClass(), subName ); + String name = getName( stair.getClass(), this.subName ); stair.setCreativeTab( CreativeTab.instance ); stair.setBlockName( /* "tile." */"appliedenergistics2." + name ); stair.setBlockTextureName( "appliedenergistics2:" + name ); @@ -124,14 +124,14 @@ public class AEFeatureHandler implements AEItemDefinition private void initBlock( Block b ) { - BlockData = b; + this.BlockData = b; - String name = getName( b.getClass(), subName ); + String name = getName( b.getClass(), this.subName ); b.setCreativeTab( CreativeTab.instance ); b.setBlockName( /* "tile." */"appliedenergistics2." + name ); b.setBlockTextureName( "appliedenergistics2:" + name ); - if ( Platform.isClient() && BlockData instanceof AEBaseBlock ) + if ( Platform.isClient() && this.BlockData instanceof AEBaseBlock ) { AEBaseBlock bb = ( AEBaseBlock ) b; CommonHelper.proxy.bindTileEntitySpecialRenderer( bb.getTileEntityClass(), bb ); @@ -173,13 +173,13 @@ public class AEFeatureHandler implements AEItemDefinition public EnumSet getFeatures() { - return features.clone(); + return this.features.clone(); } @Override public Block block() { - return BlockData; + return this.BlockData; } @Override @@ -204,9 +204,9 @@ public class AEFeatureHandler implements AEItemDefinition @Override public Class entity() { - if ( BlockData instanceof AEBaseBlock ) + if ( this.BlockData instanceof AEBaseBlock ) { - AEBaseBlock bb = ( AEBaseBlock ) BlockData; + AEBaseBlock bb = ( AEBaseBlock ) this.BlockData; return bb.getTileEntityClass(); } @@ -216,14 +216,14 @@ public class AEFeatureHandler implements AEItemDefinition @Override public ItemStack stack( int stackSize ) { - if ( isFeatureAvailable() ) + if ( this.isFeatureAvailable() ) { ItemStack rv; - if ( ItemData != null ) - rv = new ItemStack( ItemData ); + if ( this.ItemData != null ) + rv = new ItemStack( this.ItemData ); else - rv = new ItemStack( BlockData ); + rv = new ItemStack( this.BlockData ); rv.stackSize = stackSize; return rv; @@ -235,7 +235,7 @@ public class AEFeatureHandler implements AEItemDefinition @Override public boolean sameAsStack( ItemStack is ) { - return isFeatureAvailable() && Platform.isSameItemType( is, stack( 1 ) ); + return this.isFeatureAvailable() && Platform.isSameItemType( is, this.stack( 1 ) ); } /** @@ -255,7 +255,7 @@ public class AEFeatureHandler implements AEItemDefinition @Override public boolean sameAsBlock( IBlockAccess world, int x, int y, int z ) { - return isFeatureAvailable() && BlockData != null && world.getBlock( x, y, z ) == BlockData; + return this.isFeatureAvailable() && this.BlockData != null && world.getBlock( x, y, z ) == this.BlockData; } } diff --git a/src/main/java/appeng/core/features/ColoredItemDefinition.java b/src/main/java/appeng/core/features/ColoredItemDefinition.java index 57392a24b..a3838e88f 100644 --- a/src/main/java/appeng/core/features/ColoredItemDefinition.java +++ b/src/main/java/appeng/core/features/ColoredItemDefinition.java @@ -33,7 +33,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition @Override public Item item(AEColor color) { - ItemStackSrc is = colors[color.ordinal()]; + ItemStackSrc is = this.colors[color.ordinal()]; if ( is == null ) return null; @@ -44,7 +44,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition @Override public ItemStack stack(AEColor color, int stackSize) { - ItemStackSrc is = colors[color.ordinal()]; + ItemStackSrc is = this.colors[color.ordinal()]; if ( is == null ) return null; @@ -55,7 +55,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition @Override public boolean sameAs(AEColor color, ItemStack comparableItem) { - ItemStackSrc is = colors[color.ordinal()]; + ItemStackSrc is = this.colors[color.ordinal()]; if ( comparableItem == null || is == null ) return false; @@ -65,7 +65,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition public void add(AEColor v, ItemStackSrc is) { - colors[v.ordinal()] = is; + this.colors[v.ordinal()] = is; } @Override @@ -83,9 +83,9 @@ public class ColoredItemDefinition implements AEColoredItemDefinition @Override public ItemStack[] allStacks(int stackSize) { - ItemStack is[] = new ItemStack[colors.length]; + ItemStack is[] = new ItemStack[this.colors.length]; for (int x = 0; x < is.length; x++) - is[x] = colors[x].stack( 1 ); + is[x] = this.colors[x].stack( 1 ); return is; } diff --git a/src/main/java/appeng/core/features/DamagedItemDefinition.java b/src/main/java/appeng/core/features/DamagedItemDefinition.java index 1fc71aa06..94b4c9b13 100644 --- a/src/main/java/appeng/core/features/DamagedItemDefinition.java +++ b/src/main/java/appeng/core/features/DamagedItemDefinition.java @@ -31,7 +31,7 @@ public class DamagedItemDefinition implements AEItemDefinition final IStackSrc src; public DamagedItemDefinition(IStackSrc is) { - src = is; + this.src = is; } @Override @@ -43,7 +43,7 @@ public class DamagedItemDefinition implements AEItemDefinition @Override public Item item() { - return src.getItem(); + return this.src.getItem(); } @Override @@ -55,7 +55,7 @@ public class DamagedItemDefinition implements AEItemDefinition @Override public ItemStack stack(int stackSize) { - return src.stack( stackSize ); + return this.src.stack( stackSize ); } @Override @@ -64,7 +64,7 @@ public class DamagedItemDefinition implements AEItemDefinition if ( comparableItem == null ) return false; - return comparableItem.getItem() == src.getItem() && comparableItem.getItemDamage() == src.getDamage(); + return comparableItem.getItem() == this.src.getItem() && comparableItem.getItemDamage() == this.src.getDamage(); } @Override diff --git a/src/main/java/appeng/core/features/ItemStackSrc.java b/src/main/java/appeng/core/features/ItemStackSrc.java index b89591cac..119288b0b 100644 --- a/src/main/java/appeng/core/features/ItemStackSrc.java +++ b/src/main/java/appeng/core/features/ItemStackSrc.java @@ -30,25 +30,25 @@ public class ItemStackSrc implements IStackSrc public final int damage; public ItemStackSrc(Item i, int dmg) { - block = null; - item = i; - damage = dmg; + this.block = null; + this.item = i; + this.damage = dmg; } public ItemStackSrc(Block b, int dmg) { - item = null; - block = b; - damage = dmg; + this.item = null; + this.block = b; + this.damage = dmg; } @Override public ItemStack stack(int i) { - if ( block != null ) - return new ItemStack( block, i, damage ); + if ( this.block != null ) + return new ItemStack( this.block, i, this.damage ); - if ( item != null ) - return new ItemStack( item, i, damage ); + if ( this.item != null ) + return new ItemStack( this.item, i, this.damage ); return null; } @@ -56,12 +56,12 @@ public class ItemStackSrc implements IStackSrc @Override public Item getItem() { - return item; + return this.item; } @Override public int getDamage() { - return damage; + return this.damage; } } diff --git a/src/main/java/appeng/core/features/MaterialStackSrc.java b/src/main/java/appeng/core/features/MaterialStackSrc.java index a53f6a03b..ad9adc90c 100644 --- a/src/main/java/appeng/core/features/MaterialStackSrc.java +++ b/src/main/java/appeng/core/features/MaterialStackSrc.java @@ -36,19 +36,19 @@ public class MaterialStackSrc implements IStackSrc @Override public ItemStack stack(int stackSize) { - return src.stack( stackSize ); + return this.src.stack( stackSize ); } @Override public Item getItem() { - return src.itemInstance; + return this.src.itemInstance; } @Override public int getDamage() { - return src.damageValue; + return this.src.damageValue; } } diff --git a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java index 0351438fd..e05b0f27f 100644 --- a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java +++ b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java @@ -32,35 +32,35 @@ public class WrappedDamageItemDefinition implements AEItemDefinition final int damage; public WrappedDamageItemDefinition(AEItemDefinition def, int dmg) { - baseItem = def; - damage = dmg; + this.baseItem = def; + this.damage = dmg; } @Override public Block block() { - return baseItem.block(); + return this.baseItem.block(); } @Override public Item item() { - return baseItem.item(); + return this.baseItem.item(); } @Override public Class entity() { - return baseItem.entity(); + return this.baseItem.entity(); } @Override public ItemStack stack(int stackSize) { - if ( baseItem == null ) + if ( this.baseItem == null ) return null; - return new ItemStack( baseItem.block(), stackSize, damage ); + return new ItemStack( this.baseItem.block(), stackSize, this.damage ); } @Override @@ -69,14 +69,14 @@ public class WrappedDamageItemDefinition implements AEItemDefinition if ( comparableItem == null ) return false; - return comparableItem.getItem() == baseItem.item() && comparableItem.getItemDamage() == damage; + return comparableItem.getItem() == this.baseItem.item() && comparableItem.getItemDamage() == this.damage; } @Override public boolean sameAsBlock(IBlockAccess world, int x, int y, int z) { - if ( block() != null ) - return world.getBlock( x, y, z ) == block() && world.getBlockMetadata( x, y, z ) == damage; + if ( this.block() != null ) + return world.getBlock( x, y, z ) == this.block() && world.getBlockMetadata( x, y, z ) == this.damage; return false; } diff --git a/src/main/java/appeng/core/features/registries/CellRegistry.java b/src/main/java/appeng/core/features/registries/CellRegistry.java index 1187e8b57..6d3859149 100644 --- a/src/main/java/appeng/core/features/registries/CellRegistry.java +++ b/src/main/java/appeng/core/features/registries/CellRegistry.java @@ -34,14 +34,14 @@ public class CellRegistry implements ICellRegistry final List handlers; public CellRegistry() { - handlers = new ArrayList(); + this.handlers = new ArrayList(); } @Override public void addCellHandler(ICellHandler h) { if ( h != null ) - handlers.add( h ); + this.handlers.add( h ); } @Override @@ -49,7 +49,7 @@ public class CellRegistry implements ICellRegistry { if ( is == null ) return false; - for (ICellHandler ch : handlers) + for (ICellHandler ch : this.handlers) if ( ch.isCell( is ) ) return true; return false; @@ -60,7 +60,7 @@ public class CellRegistry implements ICellRegistry { if ( is == null ) return null; - for (ICellHandler ch : handlers) + for (ICellHandler ch : this.handlers) { if ( ch.isCell( is ) ) { @@ -75,7 +75,7 @@ public class CellRegistry implements ICellRegistry { if ( is == null ) return null; - for (ICellHandler ch : handlers) + for (ICellHandler ch : this.handlers) { if ( ch.isCell( is ) ) { diff --git a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java index 4c2c855c8..749f6c095 100644 --- a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java +++ b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java @@ -36,20 +36,20 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry final ExternalIInv lastHandler = new ExternalIInv(); public ExternalStorageRegistry() { - Handlers = new ArrayList(); + this.Handlers = new ArrayList(); } @Override public IExternalStorageHandler getHandler(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc) { - for (IExternalStorageHandler x : Handlers) + for (IExternalStorageHandler x : this.Handlers) { if ( x.canHandle( te, d, chan, mySrc ) ) return x; } - if ( lastHandler.canHandle( te, d, chan, mySrc ) ) - return lastHandler; + if ( this.lastHandler.canHandle( te, d, chan, mySrc ) ) + return this.lastHandler; return null; } @@ -57,7 +57,7 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry @Override public void addExternalStorageInterface(IExternalStorageHandler ei) { - Handlers.add( ei ); + this.Handlers.add( ei ); } } diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index 1d9d5f21d..f538d5750 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -35,7 +35,7 @@ public class GridCacheRegistry implements IGridCacheRegistry public void registerGridCache(Class iface, Class implementation) { if ( iface.isAssignableFrom( implementation ) ) - caches.put( iface, implementation ); + this.caches.put( iface, implementation ); else throw new RuntimeException( "Invalid setup, grid cache must either be the same class, or an interface that the implementation implements" ); } @@ -45,11 +45,11 @@ public class GridCacheRegistry implements IGridCacheRegistry { HashMap, IGridCache> map = new HashMap, IGridCache>(); - for (Class iface : caches.keySet()) + for (Class iface : this.caches.keySet()) { try { - Constructor c = caches.get( iface ).getConstructor( IGrid.class ); + Constructor c = this.caches.get( iface ).getConstructor( IGrid.class ); map.put( iface, c.newInstance( g ) ); } catch (Throwable e) diff --git a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java index b1302004e..60132e41e 100644 --- a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java +++ b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java @@ -49,26 +49,26 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener } public GrinderRecipeManager() { - RecipeList = new ArrayList(); + this.RecipeList = new ArrayList(); - addOre( "Coal", new ItemStack( Items.coal ) ); - addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) ); + this.addOre( "Coal", new ItemStack( Items.coal ) ); + this.addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) ); - addOre( "NetherQuartz", new ItemStack( Blocks.quartz_ore ) ); - addIngot( "NetherQuartz", new ItemStack( Items.quartz ) ); + this.addOre( "NetherQuartz", new ItemStack( Blocks.quartz_ore ) ); + this.addIngot( "NetherQuartz", new ItemStack( Items.quartz ) ); - addOre( "Gold", new ItemStack( Blocks.gold_ore ) ); - addIngot( "Gold", new ItemStack( Items.gold_ingot ) ); + this.addOre( "Gold", new ItemStack( Blocks.gold_ore ) ); + this.addIngot( "Gold", new ItemStack( Items.gold_ingot ) ); - addOre( "Iron", new ItemStack( Blocks.iron_ore ) ); - addIngot( "Iron", new ItemStack( Items.iron_ingot ) ); + this.addOre( "Iron", new ItemStack( Blocks.iron_ore ) ); + this.addIngot( "Iron", new ItemStack( Items.iron_ingot ) ); - addOre( "Obsidian", new ItemStack( Blocks.obsidian ) ); + this.addOre( "Obsidian", new ItemStack( Blocks.obsidian ) ); - addIngot( "Ender", new ItemStack( Items.ender_pearl ) ); - addIngot( "EnderPearl", new ItemStack( Items.ender_pearl ) ); + this.addIngot( "Ender", new ItemStack( Items.ender_pearl ) ); + this.addIngot( "EnderPearl", new ItemStack( Items.ender_pearl ) ); - addIngot( "Wheat", new ItemStack( Items.wheat ) ); + this.addIngot( "Wheat", new ItemStack( Items.wheat ) ); OreDictionaryHandler.instance.observe( this ); } @@ -76,17 +76,17 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener @Override public List getRecipes() { - log( "API - getRecipes" ); - return RecipeList; + this.log( "API - getRecipes" ); + return this.RecipeList; } private void injectRecipe(AppEngGrinderRecipe appEngGrinderRecipe) { - for (IGrinderEntry gr : RecipeList) + for (IGrinderEntry gr : this.RecipeList) if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) ) return; - RecipeList.add( appEngGrinderRecipe ); + this.RecipeList.add( appEngGrinderRecipe ); } @Override @@ -94,12 +94,12 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( in == null || out == null ) { - log( "Invalid Grinder Recipe Specified." ); + this.log( "Invalid Grinder Recipe Specified." ); return; } - log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost ); - injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) ); + this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost ); + this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), cost ) ); } @Override @@ -107,13 +107,13 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( in == null || (optional == null && out == null) ) { - log( "Invalid Grinder Recipe Specified." ); + this.log( "Invalid Grinder Recipe Specified." ); return; } - log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost ); - injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) ); + this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) ); } @Override @@ -121,31 +121,31 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( in == null || (optional == null && out == null && optional2 == null) ) { - log( "Invalid Grinder Recipe Specified." ); + this.log( "Invalid Grinder Recipe Specified." ); return; } - log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost ); - injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) ); + this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) ); } @Override public IGrinderEntry getRecipeForInput(ItemStack input) { - log( "Looking up recipe for " + Platform.getItemDisplayName( input ) ); + this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) ); if ( input != null ) { - for (IGrinderEntry r : RecipeList) + for (IGrinderEntry r : this.RecipeList) { if ( Platform.isSameItem( input, r.getInput() ) ) { - log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) ); + this.log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) ); return r; } } - log( "Could not find recipe for " + Platform.getItemDisplayName( input ) ); + this.log( "Could not find recipe for " + Platform.getItemDisplayName( input ) ); } return null; @@ -175,22 +175,22 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( item == null ) return; - log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) ); + this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) ); - Ores.put( item, name ); + this.Ores.put( item, name ); - if ( Dusts.containsKey( name ) ) + if ( this.Dusts.containsKey( name ) ) { - ItemStack is = Dusts.get( name ).copy(); - int ratio = getDustToOreRatio( name ); + ItemStack is = this.Dusts.get( name ).copy(); + int ratio = this.getDustToOreRatio( name ); if ( ratio > 1 ) { ItemStack extra = is.copy(); extra.stackSize = ratio - 1; - addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 ); + this.addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 ); } else - addRecipe( item, is, 8 ); + this.addRecipe( item, is, 8 ); } } @@ -198,13 +198,13 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( item == null ) return; - log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) ); + this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) ); - Ingots.put( item, name ); + this.Ingots.put( item, name ); - if ( Dusts.containsKey( name ) ) + if ( this.Dusts.containsKey( name ) ) { - addRecipe( item, Dusts.get( name ), 4 ); + this.addRecipe( item, this.Dusts.get( name ), 4 ); } } @@ -212,35 +212,35 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( item == null ) return; - if ( Dusts.containsKey( name ) ) + if ( this.Dusts.containsKey( name ) ) { - log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) ); + this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) ); return; } - log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) ); + this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) ); - Dusts.put( name, item ); + this.Dusts.put( name, item ); - for (Entry d : Ores.entrySet()) + for (Entry d : this.Ores.entrySet()) if ( name.equals( d.getValue() ) ) { ItemStack is = item.copy(); is.stackSize = 1; - int ratio = getDustToOreRatio( name ); + int ratio = this.getDustToOreRatio( name ); if ( ratio > 1 ) { ItemStack extra = is.copy(); extra.stackSize = ratio - 1; - addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 ); + this.addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 ); } else - addRecipe( d.getKey(), is, 8 ); + this.addRecipe( d.getKey(), is, 8 ); } - for (Entry d : Ingots.entrySet()) + for (Entry d : this.Ingots.entrySet()) if ( name.equals( d.getValue() ) ) - addRecipe( d.getKey(), item, 4 ); + this.addRecipe( d.getKey(), item, 4 ); } @Override @@ -252,15 +252,15 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener { if ( name.equals( "ore" + ore ) ) { - addOre( ore, item ); + this.addOre( ore, item ); } else if ( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) ) { - addIngot( ore, item ); + this.addIngot( ore, item ); } else if ( name.equals( "dust" + ore ) ) { - addDust( ore, item ); + this.addDust( ore, item ); } } } diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index 978748075..94177e7eb 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -41,16 +41,16 @@ public class LocatableRegistry implements ILocatableRegistry if ( e.change == LocatableEvent.Register ) { - set.put( e.target.getLocatableSerial(), e.target ); + this.set.put( e.target.getLocatableSerial(), e.target ); } else if ( e.change == LocatableEvent.Unregister ) { - set.remove( e.target.getLocatableSerial() ); + this.set.remove( e.target.getLocatableSerial() ); } } public LocatableRegistry() { - set = new HashMap(); + this.set = new HashMap(); MinecraftForge.EVENT_BUS.register( this ); } @@ -60,7 +60,7 @@ public class LocatableRegistry implements ILocatableRegistry @Override public Object findLocatableBySerial(long ser) { - return set.get( ser ); + return this.set.get( ser ); } } diff --git a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java index 26a6e22da..7d5d61c61 100644 --- a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java +++ b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java @@ -35,14 +35,14 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo @Override public void registerAmmo(ItemStack ammo, double weight) { - DamageModifiers.put( ammo, weight ); + this.DamageModifiers.put( ammo, weight ); } private void considerItem(String ore, ItemStack item, String Name, double weight) { if ( ore.equals( "berry" + Name ) || ore.equals( "nugget" + Name ) ) { - registerAmmo( item, weight ); + this.registerAmmo( item, weight ); } } @@ -53,90 +53,90 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo return; // addNugget( "Cobble", 18 ); // ? - considerItem( name, item, "MeatRaw", 32 ); - considerItem( name, item, "MeatCooked", 32 ); - considerItem( name, item, "Meat", 32 ); - considerItem( name, item, "Chicken", 32 ); - considerItem( name, item, "Beef", 32 ); - considerItem( name, item, "Sheep", 32 ); - considerItem( name, item, "Fish", 32 ); + this.considerItem( name, item, "MeatRaw", 32 ); + this.considerItem( name, item, "MeatCooked", 32 ); + this.considerItem( name, item, "Meat", 32 ); + this.considerItem( name, item, "Chicken", 32 ); + this.considerItem( name, item, "Beef", 32 ); + this.considerItem( name, item, "Sheep", 32 ); + this.considerItem( name, item, "Fish", 32 ); // real world... - considerItem( name, item, "Lithium", 6.941 ); - considerItem( name, item, "Beryllium", 9.0122 ); - considerItem( name, item, "Boron", 10.811 ); - considerItem( name, item, "Carbon", 12.0107 ); - considerItem( name, item, "Coal", 12.0107 ); - considerItem( name, item, "Charcoal", 12.0107 ); - considerItem( name, item, "Sodium", 22.9897 ); - considerItem( name, item, "Magnesium", 24.305 ); - considerItem( name, item, "Aluminum", 26.9815 ); - considerItem( name, item, "Silicon", 28.0855 ); - considerItem( name, item, "Phosphorus", 30.9738 ); - considerItem( name, item, "Sulfur", 32.065 ); - considerItem( name, item, "Potassium", 39.0983 ); - considerItem( name, item, "Calcium", 40.078 ); - considerItem( name, item, "Scandium", 44.9559 ); - considerItem( name, item, "Titanium", 47.867 ); - considerItem( name, item, "Vanadium", 50.9415 ); - considerItem( name, item, "Manganese", 54.938 ); - considerItem( name, item, "Iron", 55.845 ); - considerItem( name, item, "Nickel", 58.6934 ); - considerItem( name, item, "Cobalt", 58.9332 ); - considerItem( name, item, "Copper", 63.546 ); - considerItem( name, item, "Zinc", 65.39 ); - considerItem( name, item, "Gallium", 69.723 ); - considerItem( name, item, "Germanium", 72.64 ); - considerItem( name, item, "Bromine", 79.904 ); - considerItem( name, item, "Krypton", 83.8 ); - considerItem( name, item, "Rubidium", 85.4678 ); - considerItem( name, item, "Strontium", 87.62 ); - considerItem( name, item, "Yttrium", 88.9059 ); - considerItem( name, item, "Zirconiumm", 91.224 ); - considerItem( name, item, "Niobiumm", 92.9064 ); - considerItem( name, item, "Technetium", 98 ); - considerItem( name, item, "Ruthenium", 101.07 ); - considerItem( name, item, "Rhodium", 102.9055 ); - considerItem( name, item, "Palladium", 106.42 ); - considerItem( name, item, "Silver", 107.8682 ); - considerItem( name, item, "Cadmium", 112.411 ); - considerItem( name, item, "Indium", 114.818 ); - considerItem( name, item, "Tin", 118.71 ); - considerItem( name, item, "Antimony", 121.76 ); - considerItem( name, item, "Iodine", 126.9045 ); - considerItem( name, item, "Tellurium", 127.6 ); - considerItem( name, item, "Xenon", 131.293 ); - considerItem( name, item, "Cesium", 132.9055 ); - considerItem( name, item, "Barium", 137.327 ); - considerItem( name, item, "Lanthanum", 138.9055 ); - considerItem( name, item, "Cerium", 140.116 ); - considerItem( name, item, "Tantalum", 180.9479 ); - considerItem( name, item, "Tungsten", 183.84 ); - considerItem( name, item, "Osmium", 190.23 ); - considerItem( name, item, "Iridium", 192.217 ); - considerItem( name, item, "Platinum", 195.078 ); - considerItem( name, item, "Lead", 207.2 ); - considerItem( name, item, "Bismuth", 208.9804 ); - considerItem( name, item, "Uranium", 238.0289 ); - considerItem( name, item, "Plutonium", 244 ); + this.considerItem( name, item, "Lithium", 6.941 ); + this.considerItem( name, item, "Beryllium", 9.0122 ); + this.considerItem( name, item, "Boron", 10.811 ); + this.considerItem( name, item, "Carbon", 12.0107 ); + this.considerItem( name, item, "Coal", 12.0107 ); + this.considerItem( name, item, "Charcoal", 12.0107 ); + this.considerItem( name, item, "Sodium", 22.9897 ); + this.considerItem( name, item, "Magnesium", 24.305 ); + this.considerItem( name, item, "Aluminum", 26.9815 ); + this.considerItem( name, item, "Silicon", 28.0855 ); + this.considerItem( name, item, "Phosphorus", 30.9738 ); + this.considerItem( name, item, "Sulfur", 32.065 ); + this.considerItem( name, item, "Potassium", 39.0983 ); + this.considerItem( name, item, "Calcium", 40.078 ); + this.considerItem( name, item, "Scandium", 44.9559 ); + this.considerItem( name, item, "Titanium", 47.867 ); + this.considerItem( name, item, "Vanadium", 50.9415 ); + this.considerItem( name, item, "Manganese", 54.938 ); + this.considerItem( name, item, "Iron", 55.845 ); + this.considerItem( name, item, "Nickel", 58.6934 ); + this.considerItem( name, item, "Cobalt", 58.9332 ); + this.considerItem( name, item, "Copper", 63.546 ); + this.considerItem( name, item, "Zinc", 65.39 ); + this.considerItem( name, item, "Gallium", 69.723 ); + this.considerItem( name, item, "Germanium", 72.64 ); + this.considerItem( name, item, "Bromine", 79.904 ); + this.considerItem( name, item, "Krypton", 83.8 ); + this.considerItem( name, item, "Rubidium", 85.4678 ); + this.considerItem( name, item, "Strontium", 87.62 ); + this.considerItem( name, item, "Yttrium", 88.9059 ); + this.considerItem( name, item, "Zirconiumm", 91.224 ); + this.considerItem( name, item, "Niobiumm", 92.9064 ); + this.considerItem( name, item, "Technetium", 98 ); + this.considerItem( name, item, "Ruthenium", 101.07 ); + this.considerItem( name, item, "Rhodium", 102.9055 ); + this.considerItem( name, item, "Palladium", 106.42 ); + this.considerItem( name, item, "Silver", 107.8682 ); + this.considerItem( name, item, "Cadmium", 112.411 ); + this.considerItem( name, item, "Indium", 114.818 ); + this.considerItem( name, item, "Tin", 118.71 ); + this.considerItem( name, item, "Antimony", 121.76 ); + this.considerItem( name, item, "Iodine", 126.9045 ); + this.considerItem( name, item, "Tellurium", 127.6 ); + this.considerItem( name, item, "Xenon", 131.293 ); + this.considerItem( name, item, "Cesium", 132.9055 ); + this.considerItem( name, item, "Barium", 137.327 ); + this.considerItem( name, item, "Lanthanum", 138.9055 ); + this.considerItem( name, item, "Cerium", 140.116 ); + this.considerItem( name, item, "Tantalum", 180.9479 ); + this.considerItem( name, item, "Tungsten", 183.84 ); + this.considerItem( name, item, "Osmium", 190.23 ); + this.considerItem( name, item, "Iridium", 192.217 ); + this.considerItem( name, item, "Platinum", 195.078 ); + this.considerItem( name, item, "Lead", 207.2 ); + this.considerItem( name, item, "Bismuth", 208.9804 ); + this.considerItem( name, item, "Uranium", 238.0289 ); + this.considerItem( name, item, "Plutonium", 244 ); // TE stuff... - considerItem( name, item, "Invar", (58.6934 + 55.845 + 55.845) / 3.0 ); - considerItem( name, item, "Electrum", (107.8682 + 196.96655) / 2.0 ); + this.considerItem( name, item, "Invar", (58.6934 + 55.845 + 55.845) / 3.0 ); + this.considerItem( name, item, "Electrum", (107.8682 + 196.96655) / 2.0 ); } public MatterCannonAmmoRegistry() { OreDictionaryHandler.instance.observe( this ); - registerAmmo( new ItemStack( Items.gold_nugget ), 196.96655 ); + this.registerAmmo( new ItemStack( Items.gold_nugget ), 196.96655 ); } @Override public float getPenetration(ItemStack is) { - for (ItemStack o : DamageModifiers.keySet()) + for (ItemStack o : this.DamageModifiers.keySet()) { if ( Platform.isSameItem( o, is ) ) - return DamageModifiers.get( o ).floatValue(); + return this.DamageModifiers.get( o ).floatValue(); } return 0; } diff --git a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java index ad2d9094e..5258e570a 100644 --- a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java +++ b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java @@ -47,7 +47,7 @@ public class MovableTileRegistry implements IMovableRegistry IMovableHandler handler = null; // ask handlers... - for (IMovableHandler han : handlers) + for (IMovableHandler han : this.handlers) { if ( han.canHandle( myClass, te ) ) { @@ -59,7 +59,7 @@ public class MovableTileRegistry implements IMovableRegistry // if you have a handler your opted in if ( handler != null ) { - Valid.put( myClass, handler ); + this.Valid.put( myClass, handler ); return handler; } @@ -67,34 +67,34 @@ public class MovableTileRegistry implements IMovableRegistry // if your movable our opted in if ( te instanceof IMovableTile ) { - Valid.put( myClass, dsh ); - return dsh; + this.Valid.put( myClass, this.dsh ); + return this.dsh; } // if you are on the white list your opted in. - for (Class testClass : test) + for (Class testClass : this.test) { if ( testClass.isAssignableFrom( myClass ) ) { - Valid.put( myClass, dsh ); - return dsh; + this.Valid.put( myClass, this.dsh ); + return this.dsh; } } - Valid.put( myClass, nullHandler ); - return nullHandler; + this.Valid.put( myClass, this.nullHandler ); + return this.nullHandler; } @Override public boolean askToMove(TileEntity te) { Class myClass = te.getClass(); - IMovableHandler canMove = Valid.get( myClass ); + IMovableHandler canMove = this.Valid.get( myClass ); if ( canMove == null ) - canMove = testClass( myClass, te ); + canMove = this.testClass( myClass, te ); - if ( canMove != nullHandler ) + if ( canMove != this.nullHandler ) { if ( te instanceof IMovableTile ) ((IMovableTile) te).prepareToMove(); @@ -126,39 +126,39 @@ public class MovableTileRegistry implements IMovableRegistry "Someone tried to make all tiles movable, this is a clear violation of the purpose of the white list." ) ); } - test.add( c ); + this.test.add( c ); } @Override public void addHandler(IMovableHandler han) { - handlers.add( han ); + this.handlers.add( han ); } @Override public IMovableHandler getHandler(TileEntity te) { Class myClass = te.getClass(); - IMovableHandler h = Valid.get( myClass ); - return h == null ? dsh : h; + IMovableHandler h = this.Valid.get( myClass ); + return h == null ? this.dsh : h; } @Override public IMovableHandler getDefaultHandler() { - return dsh; + return this.dsh; } @Override public void blacklistBlock(Block blk) { - blacklisted.add( blk ); + this.blacklisted.add( blk ); } @Override public boolean isBlacklisted(Block blk) { - return blacklisted.contains( blk ); + return this.blacklisted.contains( blk ); } } diff --git a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java index c99b49de6..64f9805b6 100644 --- a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java +++ b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java @@ -54,24 +54,24 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry /** * light! */ - addNewAttunement( new ItemStack( Blocks.torch ), TunnelType.LIGHT ); - addNewAttunement( new ItemStack( Blocks.glowstone ), TunnelType.LIGHT ); + this.addNewAttunement( new ItemStack( Blocks.torch ), TunnelType.LIGHT ); + this.addNewAttunement( new ItemStack( Blocks.glowstone ), TunnelType.LIGHT ); /** * attune based on most redstone base items. */ - addNewAttunement( new ItemStack( Items.redstone ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Items.repeater ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.redstone_lamp ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.unpowered_comparator ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.powered_comparator ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.powered_repeater ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.unpowered_repeater ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.daylight_detector ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.redstone_wire ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.redstone_block ), TunnelType.REDSTONE ); - addNewAttunement( new ItemStack( Blocks.lever ), TunnelType.REDSTONE ); - addNewAttunement( getModItem( "EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Items.redstone ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Items.repeater ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.redstone_lamp ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.unpowered_comparator ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.powered_comparator ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.powered_repeater ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.unpowered_repeater ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.daylight_detector ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.redstone_wire ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.redstone_block ), TunnelType.REDSTONE ); + this.addNewAttunement( new ItemStack( Blocks.lever ), TunnelType.REDSTONE ); + this.addNewAttunement( this.getModItem( "EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.REDSTONE ); /** * attune based on lots of random item related stuff @@ -79,37 +79,37 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry appeng.api.definitions.Blocks AEBlocks = AEApi.instance().blocks(); Parts Parts = AEApi.instance().parts(); - addNewAttunement( AEBlocks.blockInterface.stack( 1 ), TunnelType.ITEM ); - addNewAttunement( Parts.partInterface.stack( 1 ), TunnelType.ITEM ); - addNewAttunement( Parts.partStorageBus.stack( 1 ), TunnelType.ITEM ); - addNewAttunement( Parts.partImportBus.stack( 1 ), TunnelType.ITEM ); - addNewAttunement( Parts.partExportBus.stack( 1 ), TunnelType.ITEM ); - addNewAttunement( new ItemStack( Blocks.hopper ), TunnelType.ITEM ); - addNewAttunement( new ItemStack( Blocks.chest ), TunnelType.ITEM ); - addNewAttunement( new ItemStack( Blocks.trapped_chest ), TunnelType.ITEM ); - addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 0 ), TunnelType.ITEM ); - addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 9 ), TunnelType.ITEM ); - addNewAttunement( getModItem( "EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM ); + this.addNewAttunement( AEBlocks.blockInterface.stack( 1 ), TunnelType.ITEM ); + this.addNewAttunement( Parts.partInterface.stack( 1 ), TunnelType.ITEM ); + this.addNewAttunement( Parts.partStorageBus.stack( 1 ), TunnelType.ITEM ); + this.addNewAttunement( Parts.partImportBus.stack( 1 ), TunnelType.ITEM ); + this.addNewAttunement( Parts.partExportBus.stack( 1 ), TunnelType.ITEM ); + this.addNewAttunement( new ItemStack( Blocks.hopper ), TunnelType.ITEM ); + this.addNewAttunement( new ItemStack( Blocks.chest ), TunnelType.ITEM ); + this.addNewAttunement( new ItemStack( Blocks.trapped_chest ), TunnelType.ITEM ); + this.addNewAttunement( this.getModItem( "ExtraUtilities", "extractor_base", 0 ), TunnelType.ITEM ); + this.addNewAttunement( this.getModItem( "Mekanism", "PartTransmitter", 9 ), TunnelType.ITEM ); + this.addNewAttunement( this.getModItem( "EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM ); /** * attune based on lots of random item related stuff */ - addNewAttunement( new ItemStack( Items.bucket ), TunnelType.FLUID ); - addNewAttunement( new ItemStack( Items.lava_bucket ), TunnelType.FLUID ); - addNewAttunement( new ItemStack( Items.milk_bucket ), TunnelType.FLUID ); - addNewAttunement( new ItemStack( Items.water_bucket ), TunnelType.FLUID ); - addNewAttunement( getModItem( "Mekanism", "MachineBlock2", 11 ), TunnelType.FLUID ); - addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 4 ), TunnelType.FLUID ); - addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 6 ), TunnelType.FLUID ); - addNewAttunement( getModItem( "ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); - addNewAttunement( getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); + this.addNewAttunement( new ItemStack( Items.bucket ), TunnelType.FLUID ); + this.addNewAttunement( new ItemStack( Items.lava_bucket ), TunnelType.FLUID ); + this.addNewAttunement( new ItemStack( Items.milk_bucket ), TunnelType.FLUID ); + this.addNewAttunement( new ItemStack( Items.water_bucket ), TunnelType.FLUID ); + this.addNewAttunement( this.getModItem( "Mekanism", "MachineBlock2", 11 ), TunnelType.FLUID ); + this.addNewAttunement( this.getModItem( "Mekanism", "PartTransmitter", 4 ), TunnelType.FLUID ); + this.addNewAttunement( this.getModItem( "ExtraUtilities", "extractor_base", 6 ), TunnelType.FLUID ); + this.addNewAttunement( this.getModItem( "ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); + this.addNewAttunement( this.getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); for (AEColor c : AEColor.values()) { - addNewAttunement( Parts.partCableGlass.stack( c, 1 ), TunnelType.ME ); - addNewAttunement( Parts.partCableCovered.stack( c, 1 ), TunnelType.ME ); - addNewAttunement( Parts.partCableSmart.stack( c, 1 ), TunnelType.ME ); - addNewAttunement( Parts.partCableDense.stack( c, 1 ), TunnelType.ME ); + this.addNewAttunement( Parts.partCableGlass.stack( c, 1 ), TunnelType.ME ); + this.addNewAttunement( Parts.partCableCovered.stack( c, 1 ), TunnelType.ME ); + this.addNewAttunement( Parts.partCableSmart.stack( c, 1 ), TunnelType.ME ); + this.addNewAttunement( Parts.partCableDense.stack( c, 1 ), TunnelType.ME ); } } @@ -119,7 +119,7 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry if ( type == null || trigger == null ) return; - Tunnels.put( trigger, type ); + this.Tunnels.put( trigger, type ); } @Override @@ -130,13 +130,13 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry if ( FluidContainerRegistry.isContainer( trigger ) ) return TunnelType.FLUID; - for (ItemStack is : Tunnels.keySet()) + for (ItemStack is : this.Tunnels.keySet()) { if ( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) - return Tunnels.get( is ); + return this.Tunnels.get( is ); if ( Platform.isSameItem( is, trigger ) ) - return Tunnels.get( is ); + return this.Tunnels.get( is ); } } diff --git a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java index 10d0f0c99..e5a28be7b 100644 --- a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java +++ b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java @@ -37,13 +37,13 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry @Override public void addNewCraftHandler(String name, Class handler) { - handlers.put( name.toLowerCase(), handler ); + this.handlers.put( name.toLowerCase(), handler ); } @Override public ICraftHandler getCraftHandlerFor(String name) { - Class clz = handlers.get( name ); + Class clz = this.handlers.get( name ); if ( clz == null ) return null; try @@ -54,7 +54,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { AELog.severe( "Error Caused when trying to construct " + clz.getName() ); AELog.error( e ); - handlers.put( name, null ); // clear it.. + this.handlers.put( name, null ); // clear it.. return null; } } @@ -68,13 +68,13 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry @Override public void addNewSubItemResolver(ISubItemResolver sir) { - resolvers.add( sir ); + this.resolvers.add( sir ); } @Override public Object resolveItem(String nameSpace, String itemName) { - for (ISubItemResolver sir : resolvers) + for (ISubItemResolver sir : this.resolvers) { Object rr = null; diff --git a/src/main/java/appeng/core/features/registries/RegistryContainer.java b/src/main/java/appeng/core/features/registries/RegistryContainer.java index b013976a1..4ed0b1a5c 100644 --- a/src/main/java/appeng/core/features/registries/RegistryContainer.java +++ b/src/main/java/appeng/core/features/registries/RegistryContainer.java @@ -52,73 +52,73 @@ public class RegistryContainer implements IRegistryContainer @Override public IWirelessTermRegistry wireless() { - return WirelessRegistry; + return this.WirelessRegistry; } @Override public ICellRegistry cell() { - return CellRegistry; + return this.CellRegistry; } @Override public IGrinderRegistry grinder() { - return GrinderRecipes; + return this.GrinderRecipes; } @Override public ISpecialComparisonRegistry specialComparison() { - return SpecialComparisonRegistry; + return this.SpecialComparisonRegistry; } @Override public IExternalStorageRegistry externalStorage() { - return ExternalStorageHandlers; + return this.ExternalStorageHandlers; } @Override public ILocatableRegistry locatable() { - return LocatableRegistry; + return this.LocatableRegistry; } @Override public IGridCacheRegistry gridCache() { - return GridCacheRegistry; + return this.GridCacheRegistry; } @Override public IMovableRegistry movable() { - return MovableReg; + return this.MovableReg; } @Override public IP2PTunnelRegistry p2pTunnel() { - return P2PRegistry; + return this.P2PRegistry; } @Override public IMatterCannonAmmoRegistry matterCannon() { - return matterCannonReg; + return this.matterCannonReg; } @Override public IPlayerRegistry players() { - return playerRegistry; + return this.playerRegistry; } @Override public IRecipeHandlerRegistry recipes() { - return recipeReg; + return this.recipeReg; } @Override diff --git a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java index f488a868b..bbcb71512 100644 --- a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java +++ b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java @@ -32,13 +32,13 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry private final List CompRegistry; public SpecialComparisonRegistry() { - CompRegistry = new ArrayList(); + this.CompRegistry = new ArrayList(); } @Override public IItemComparison getSpecialComparison(ItemStack stack) { - for (IItemComparisonProvider i : CompRegistry) + for (IItemComparisonProvider i : this.CompRegistry) { IItemComparison comp = i.getComparison( stack ); if ( comp != null ) @@ -53,7 +53,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry @Override public void addComparisonProvider(IItemComparisonProvider prov) { - CompRegistry.add( prov ); + this.CompRegistry.add( prov ); } } diff --git a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java index 825cfda89..775cea9fe 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java +++ b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java @@ -24,8 +24,8 @@ public class WirelessRangeResult { public WirelessRangeResult(TileEntity t, float d) { - dist = d; - te = t; + this.dist = d; + this.te = t; } final public float dist; diff --git a/src/main/java/appeng/core/features/registries/WirelessRegistry.java b/src/main/java/appeng/core/features/registries/WirelessRegistry.java index 86af5d41b..76c797a21 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRegistry.java +++ b/src/main/java/appeng/core/features/registries/WirelessRegistry.java @@ -37,20 +37,20 @@ public class WirelessRegistry implements IWirelessTermRegistry final List handlers; public WirelessRegistry() { - handlers = new ArrayList(); + this.handlers = new ArrayList(); } @Override public void registerWirelessHandler(IWirelessTermHandler handler) { if ( handler != null ) - handlers.add( handler ); + this.handlers.add( handler ); } @Override public boolean isWirelessTerminal(ItemStack is) { - for (IWirelessTermHandler h : handlers) + for (IWirelessTermHandler h : this.handlers) { if ( h.canHandle( is ) ) return true; @@ -61,7 +61,7 @@ public class WirelessRegistry implements IWirelessTermRegistry @Override public IWirelessTermHandler getWirelessTerminalHandler(ItemStack is) { - for (IWirelessTermHandler h : handlers) + for (IWirelessTermHandler h : this.handlers) { if ( h.canHandle( is ) ) return h; @@ -75,7 +75,7 @@ public class WirelessRegistry implements IWirelessTermRegistry if ( Platform.isClient() ) return; - IWirelessTermHandler handler = getWirelessTerminalHandler( item ); + IWirelessTermHandler handler = this.getWirelessTerminalHandler( item ); if ( handler == null ) { player.addChatMessage( new ChatComponentText( "Item is not a wireless terminal." ) ); diff --git a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java index e9057bc05..05221757d 100644 --- a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java +++ b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java @@ -42,11 +42,11 @@ public class WorldGenRegistry implements IWorldGen private WorldGenRegistry() { - types = new TypeSet[WorldGenType.values().length]; + this.types = new TypeSet[WorldGenType.values().length]; for (WorldGenType type : WorldGenType.values()) { - types[type.ordinal()] = new TypeSet(); + this.types[type.ordinal()] = new TypeSet(); } } @@ -60,9 +60,9 @@ public class WorldGenRegistry implements IWorldGen if ( w == null ) throw new IllegalArgumentException( "Bad Provider Passed" ); - boolean isBadProvider = types[type.ordinal()].badProviders.contains( w.provider.getClass() ); - boolean isBadDimension = types[type.ordinal()].badDimensions.contains( w.provider.dimensionId ); - boolean isGoodDimension = types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId ); + boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() ); + boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId ); + boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId ); if ( isBadProvider || isBadDimension ) { @@ -86,7 +86,7 @@ public class WorldGenRegistry implements IWorldGen if ( provider == null ) throw new IllegalArgumentException( "Bad Provider Passed" ); - types[type.ordinal()].badProviders.add( provider ); + this.types[type.ordinal()].badProviders.add( provider ); } @Override @@ -97,7 +97,7 @@ public class WorldGenRegistry implements IWorldGen throw new IllegalArgumentException( "Bad Type Passed" ); } - types[type.ordinal()].badDimensions.add( dimensionID ); + this.types[type.ordinal()].badDimensions.add( dimensionID ); } @Override @@ -106,7 +106,7 @@ public class WorldGenRegistry implements IWorldGen if ( type == null ) throw new IllegalArgumentException( "Bad Type Passed" ); - types[type.ordinal()].enabledDimensions.add( dimensionID ); + this.types[type.ordinal()].enabledDimensions.add( dimensionID ); } } diff --git a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java index 2ee0d7815..90a199c38 100644 --- a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java @@ -36,106 +36,106 @@ public class AppEngGrinderRecipe implements IGrinderEntry private int energy; public AppEngGrinderRecipe(ItemStack a, ItemStack b, int cost) { - in = a; - out = b; - energy = cost; + this.in = a; + this.out = b; + this.energy = cost; } public AppEngGrinderRecipe(ItemStack a, ItemStack b, ItemStack c, float chance, int cost) { - in = a; - out = b; + this.in = a; + this.out = b; - optionalOutput = c; - optionalChance = chance; + this.optionalOutput = c; + this.optionalChance = chance; - energy = cost; + this.energy = cost; } public AppEngGrinderRecipe(ItemStack a, ItemStack b, ItemStack c, ItemStack d, float chance, float chance2, int cost) { - in = a; - out = b; + this.in = a; + this.out = b; - optionalOutput = c; - optionalChance = chance; + this.optionalOutput = c; + this.optionalChance = chance; - optionalOutput2 = d; - optionalChance2 = chance2; + this.optionalOutput2 = d; + this.optionalChance2 = chance2; - energy = cost; + this.energy = cost; } @Override public ItemStack getInput() { - return in; + return this.in; } @Override public void setInput(ItemStack i) { - in = i.copy(); + this.in = i.copy(); } @Override public ItemStack getOutput() { - return out; + return this.out; } @Override public void setOutput(ItemStack o) { - out = o.copy(); + this.out = o.copy(); } @Override public int getEnergyCost() { - return energy; + return this.energy; } @Override public void setEnergyCost(int c) { - energy = c; + this.energy = c; } @Override public ItemStack getOptionalOutput() { - return optionalOutput; + return this.optionalOutput; } @Override public void setOptionalOutput(ItemStack output, float chance) { - optionalOutput = output.copy(); - optionalChance = chance; + this.optionalOutput = output.copy(); + this.optionalChance = chance; } @Override public float getOptionalChance() { - return optionalChance; + return this.optionalChance; } @Override public ItemStack getSecondOptionalOutput() { - return optionalOutput2; + return this.optionalOutput2; } @Override public void setSecondOptionalOutput(ItemStack output, float chance) { - optionalChance2 = chance; - optionalOutput2 = output.copy(); + this.optionalChance2 = chance; + this.optionalOutput2 = output.copy(); } @Override public float getSecondOptionalChance() { - return optionalChance2; + return this.optionalChance2; } } diff --git a/src/main/java/appeng/core/localization/ButtonToolTips.java b/src/main/java/appeng/core/localization/ButtonToolTips.java index adf4262c0..5568e36ff 100644 --- a/src/main/java/appeng/core/localization/ButtonToolTips.java +++ b/src/main/java/appeng/core/localization/ButtonToolTips.java @@ -59,21 +59,21 @@ public enum ButtonToolTips final String root; ButtonToolTips() { - root = "gui.tooltips.appliedenergistics2"; + this.root = "gui.tooltips.appliedenergistics2"; } ButtonToolTips(String r) { - root = r; + this.root = r; } public String getUnlocalized() { - return root + '.' + toString(); + return this.root + '.' + this.toString(); } public String getLocal() { - return StatCollector.translateToLocal( getUnlocalized() ); + return StatCollector.translateToLocal( this.getUnlocalized() ); } } diff --git a/src/main/java/appeng/core/localization/GuiText.java b/src/main/java/appeng/core/localization/GuiText.java index c6c4fb3c3..f95e57088 100644 --- a/src/main/java/appeng/core/localization/GuiText.java +++ b/src/main/java/appeng/core/localization/GuiText.java @@ -73,21 +73,21 @@ public enum GuiText final String root; GuiText() { - root = "gui.appliedenergistics2"; + this.root = "gui.appliedenergistics2"; } GuiText(String r) { - root = r; + this.root = r; } public String getUnlocalized() { - return root + '.' + toString(); + return this.root + '.' + this.toString(); } public String getLocal() { - return StatCollector.translateToLocal( getUnlocalized() ); + return StatCollector.translateToLocal( this.getUnlocalized() ); } } diff --git a/src/main/java/appeng/core/localization/PlayerMessages.java b/src/main/java/appeng/core/localization/PlayerMessages.java index c92b7c787..12c1a6b75 100644 --- a/src/main/java/appeng/core/localization/PlayerMessages.java +++ b/src/main/java/appeng/core/localization/PlayerMessages.java @@ -29,12 +29,12 @@ public enum PlayerMessages String getName() { - return "chat.appliedenergistics2." + toString(); + return "chat.appliedenergistics2." + this.toString(); } public IChatComponent get() { - return new ChatComponentTranslation( getName() ); + return new ChatComponentTranslation( this.getName() ); } } diff --git a/src/main/java/appeng/core/localization/WailaText.java b/src/main/java/appeng/core/localization/WailaText.java index 9c3f19b5d..0a197c78e 100644 --- a/src/main/java/appeng/core/localization/WailaText.java +++ b/src/main/java/appeng/core/localization/WailaText.java @@ -32,21 +32,21 @@ public enum WailaText final String root; WailaText() { - root = "waila.appliedenergistics2"; + this.root = "waila.appliedenergistics2"; } WailaText(String r) { - root = r; + this.root = r; } public String getUnlocalized() { - return root + '.' + toString(); + return this.root + '.' + this.toString(); } public String getLocal() { - return StatCollector.translateToLocal( getUnlocalized() ); + return StatCollector.translateToLocal( this.getUnlocalized() ); } } diff --git a/src/main/java/appeng/core/settings/TickRates.java b/src/main/java/appeng/core/settings/TickRates.java index eab5f69ac..c60167ec0 100644 --- a/src/main/java/appeng/core/settings/TickRates.java +++ b/src/main/java/appeng/core/settings/TickRates.java @@ -60,8 +60,8 @@ public enum TickRates config.addCustomCategoryComment( "TickRates", " Min / Max Tickrates for dynamic ticking, most of these components also use sleeping, to prevent constant ticking, adjust with care, non standard rates are not supported or tested." ); - min = config.get( "TickRates", name() + ".min", min ).getInt( min ); - max = config.get( "TickRates", name() + ".max", max ).getInt( max ); + this.min = config.get( "TickRates", this.name() + ".min", this.min ).getInt( this.min ); + this.max = config.get( "TickRates", this.name() + ".max", this.max ).getInt( this.max ); } } diff --git a/src/main/java/appeng/core/stats/Stats.java b/src/main/java/appeng/core/stats/Stats.java index 7be25b55c..61921ffc2 100644 --- a/src/main/java/appeng/core/stats/Stats.java +++ b/src/main/java/appeng/core/stats/Stats.java @@ -38,13 +38,13 @@ public enum Stats public StatBasic getStat() { - if ( stat == null ) + if ( this.stat == null ) { - stat = new StatBasic( "stat.ae2." + name(), new ChatComponentTranslation( "stat.ae2." + name() ) ); - stat.registerStat(); + this.stat = new StatBasic( "stat.ae2." + this.name(), new ChatComponentTranslation( "stat.ae2." + this.name() ) ); + this.stat.registerStat(); } - return stat; + return this.stat; } private Stats() { @@ -52,7 +52,7 @@ public enum Stats public void addToPlayer(EntityPlayer player, int howMany) { - player.addStat( getStat(), howMany ); + player.addStat( this.getStat(), howMany ); } } diff --git a/src/main/java/appeng/core/sync/AppEngPacket.java b/src/main/java/appeng/core/sync/AppEngPacket.java index 699dbafaf..d9ffcef02 100644 --- a/src/main/java/appeng/core/sync/AppEngPacket.java +++ b/src/main/java/appeng/core/sync/AppEngPacket.java @@ -41,29 +41,29 @@ public abstract class AppEngPacket public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player) { - throw new RuntimeException( "This packet ( " + getPacketID() + " does not implement a server side handler." ); + throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." ); } public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) { - throw new RuntimeException( "This packet ( " + getPacketID() + " does not implement a client side handler." ); + throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." ); } protected void configureWrite(ByteBuf data) { data.capacity( data.readableBytes() ); - p = data; + this.p = data; } public FMLProxyPacket getProxy() { - if ( p.array().length > 2 * 1024 * 1024 ) // 2k walking room :) - throw new IllegalArgumentException( "Sorry AE2 made a " + p.array().length + " byte packet by accident!" ); + if ( this.p.array().length > 2 * 1024 * 1024 ) // 2k walking room :) + throw new IllegalArgumentException( "Sorry AE2 made a " + this.p.array().length + " byte packet by accident!" ); - FMLProxyPacket pp = new FMLProxyPacket( p, NetworkHandler.instance.getChannel() ); + FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() ); if ( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) ) - AELog.info( getClass().getName() + " : " + pp.payload().readableBytes() ); + AELog.info( this.getClass().getName() + " : " + pp.payload().readableBytes() ); return pp; } diff --git a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java index 73704f001..95fc3e94d 100644 --- a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java +++ b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java @@ -109,12 +109,12 @@ public class AppEngPacketHandlerBase final public Constructor con; private PacketTypes(Class c) { - pc = c; + this.pc = c; Constructor x = null; try { - x = pc.getConstructor( ByteBuf.class ); + x = this.pc.getConstructor( ByteBuf.class ); } catch (NoSuchMethodException ignored) { @@ -123,16 +123,16 @@ public class AppEngPacketHandlerBase { } - con = x; - AppEngPacketHandlerBase.reverseLookup.put( pc, this ); + this.con = x; + AppEngPacketHandlerBase.reverseLookup.put( this.pc, this ); - if ( con == null ) + if ( this.con == null ) throw new RuntimeException( "Invalid Packet Class, must be constructable on DataInputStream" ); } public AppEngPacket parsePacket(ByteBuf in) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - return (AppEngPacket) con.newInstance( in ); + return (AppEngPacket) this.con.newInstance( in ); } public static PacketTypes getPacket(int id) diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index 67ee62381..94f15ea7a 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -194,9 +194,9 @@ public enum GuiBridge implements IGuiHandler private SecurityPermissions requiredPermission; private GuiBridge() { - Tile = null; - Gui = null; - Container = null; + this.Tile = null; + this.Gui = null; + this.Container = null; } /** @@ -207,52 +207,52 @@ public enum GuiBridge implements IGuiHandler { if ( Platform.isClient() ) { - String start = Container.getName(); + String start = this.Container.getName(); String GuiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" ); if ( start.equals( GuiClass ) ) throw new RuntimeException( "Unable to find gui class" ); - Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), GuiClass ); - if ( Gui == null ) + this.Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), GuiClass ); + if ( this.Gui == null ) throw new RuntimeException( "Cannot Load class: " + GuiClass ); } } private GuiBridge(Class _Container, SecurityPermissions requiredPermission) { this.requiredPermission = requiredPermission; - Container = _Container; - Tile = null; - getGui(); + this.Container = _Container; + this.Tile = null; + this.getGui(); } private GuiBridge(Class _Container, Class _Tile, GuiHostType type, SecurityPermissions requiredPermission) { this.requiredPermission = requiredPermission; - Container = _Container; + this.Container = _Container; this.type = type; - Tile = _Tile; - getGui(); + this.Tile = _Tile; + this.getGui(); } public boolean CorrectTileOrPart(Object tE) { - if ( Tile == null ) + if ( this.Tile == null ) throw new RuntimeException( "This Gui Cannot use the standard Handler." ); - return Tile.isInstance( tE ); + return this.Tile.isInstance( tE ); } public Object ConstructContainer(InventoryPlayer inventory, ForgeDirection side, Object tE) { try { - Constructor[] c = Container.getConstructors(); + Constructor[] c = this.Container.getConstructors(); if ( c.length == 0 ) throw new AppEngException( "Invalid Gui Class" ); - Constructor target = findConstructor( c, inventory, tE ); + Constructor target = this.findConstructor( c, inventory, tE ); if ( target == null ) { - throw new RuntimeException( "Cannot find " + Container.getName() + "( " + typeName( inventory ) + ", " + typeName( tE ) + " )" ); + throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" ); } Object o = target.newInstance( inventory, tE ); @@ -291,15 +291,15 @@ public enum GuiBridge implements IGuiHandler { try { - Constructor[] c = Gui.getConstructors(); + Constructor[] c = this.Gui.getConstructors(); if ( c.length == 0 ) throw new AppEngException( "Invalid Gui Class" ); - Constructor target = findConstructor( c, inventory, tE ); + Constructor target = this.findConstructor( c, inventory, tE ); if ( target == null ) { - throw new RuntimeException( "Cannot find " + Container.getName() + "( " + typeName( inventory ) + ", " + typeName( tE ) + " )" ); + throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" ); } return target.newInstance( inventory, tE ); @@ -358,9 +358,9 @@ public enum GuiBridge implements IGuiHandler if ( ID.type.isItem() && stem ) { ItemStack it = player.inventory.getCurrentItem(); - Object myItem = getGuiObject( it, player, w, x, y, z ); + Object myItem = this.getGuiObject( it, player, w, x, y, z ); if ( myItem != null && ID.CorrectTileOrPart( myItem ) ) - return updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem ); + return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem ); } if ( ID.type.isTile() ) @@ -371,12 +371,12 @@ public enum GuiBridge implements IGuiHandler ((IPartHost) TE).getPart( side ); IPart part = ((IPartHost) TE).getPart( side ); if ( ID.CorrectTileOrPart( part ) ) - return updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part ); + return this.updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part ); } else { if ( ID.CorrectTileOrPart( TE ) ) - return updateGui( ID.ConstructContainer( player.inventory, side, TE ), w, x, y, z, side, TE ); + return this.updateGui( ID.ConstructContainer( player.inventory, side, TE ), w, x, y, z, side, TE ); } } @@ -410,7 +410,7 @@ public enum GuiBridge implements IGuiHandler if ( ID.type.isItem() && stem ) { ItemStack it = player.inventory.getCurrentItem(); - Object myItem = getGuiObject( it, player, w, x, y, z ); + Object myItem = this.getGuiObject( it, player, w, x, y, z ); if ( ID.CorrectTileOrPart( myItem ) ) return ID.ConstructGui( player.inventory, side, myItem ); } @@ -442,33 +442,33 @@ public enum GuiBridge implements IGuiHandler if ( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, x, y, z ), player ) ) { - if ( type.isItem() ) + if ( this.type.isItem() ) { ItemStack it = player.inventory.getCurrentItem(); if ( it != null && it.getItem() instanceof IGuiItem ) { Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it, w, x, y, z ); - if ( CorrectTileOrPart( myItem ) ) + if ( this.CorrectTileOrPart( myItem ) ) { return true; } } } - if ( type.isTile() ) + if ( this.type.isTile() ) { TileEntity TE = w.getTileEntity( x, y, z ); if ( TE instanceof IPartHost ) { ((IPartHost) TE).getPart( side ); IPart part = ((IPartHost) TE).getPart( side ); - if ( CorrectTileOrPart( part ) ) - return securityCheck( part, player ); + if ( this.CorrectTileOrPart( part ) ) + return this.securityCheck( part, player ); } else { - if ( CorrectTileOrPart( TE ) ) - return securityCheck( TE, player ); + if ( this.CorrectTileOrPart( TE ) ) + return this.securityCheck( TE, player ); } } } @@ -477,7 +477,7 @@ public enum GuiBridge implements IGuiHandler private boolean securityCheck(Object te, EntityPlayer player) { - if ( te instanceof IActionHost && requiredPermission != null ) + if ( te instanceof IActionHost && this.requiredPermission != null ) { boolean requirePower = false; @@ -497,7 +497,7 @@ public enum GuiBridge implements IGuiHandler } ISecurityGrid sg = g.getCache( ISecurityGrid.class ); - if ( sg.hasPermission( player, requiredPermission ) ) + if ( sg.hasPermission( player, this.requiredPermission ) ) return true; } } @@ -509,7 +509,7 @@ public enum GuiBridge implements IGuiHandler public GuiHostType getType() { - return type; + return this.type; } } diff --git a/src/main/java/appeng/core/sync/network/NetworkHandler.java b/src/main/java/appeng/core/sync/network/NetworkHandler.java index 1f58e3534..ae4d73d0b 100644 --- a/src/main/java/appeng/core/sync/network/NetworkHandler.java +++ b/src/main/java/appeng/core/sync/network/NetworkHandler.java @@ -47,11 +47,11 @@ public class NetworkHandler public NetworkHandler(String channelName) { FMLCommonHandler.instance().bus().register( this ); - ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( myChannelName = channelName ); - ec.register( this ); + this.ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( this.myChannelName = channelName ); + this.ec.register( this ); - clientHandler = createClientSide(); - serveHandler = createServerSide(); + this.clientHandler = this.createClientSide(); + this.serveHandler = this.createServerSide(); } private IPacketHandler createServerSide() @@ -95,45 +95,45 @@ public class NetworkHandler public void serverPacket(ServerCustomPacketEvent ev) { NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler(); - if ( serveHandler != null ) - serveHandler.onPacketData( null, ev.packet, srv.playerEntity ); + if ( this.serveHandler != null ) + this.serveHandler.onPacketData( null, ev.packet, srv.playerEntity ); } @SubscribeEvent public void clientPacket(ClientCustomPacketEvent ev) { - if ( clientHandler != null ) - clientHandler.onPacketData( null, ev.packet, null ); + if ( this.clientHandler != null ) + this.clientHandler.onPacketData( null, ev.packet, null ); } public String getChannel() { - return myChannelName; + return this.myChannelName; } public void sendToAll(AppEngPacket message) { - ec.sendToAll( message.getProxy() ); + this.ec.sendToAll( message.getProxy() ); } public void sendTo(AppEngPacket message, EntityPlayerMP player) { - ec.sendTo( message.getProxy(), player ); + this.ec.sendTo( message.getProxy(), player ); } public void sendToAllAround(AppEngPacket message, NetworkRegistry.TargetPoint point) { - ec.sendToAllAround( message.getProxy(), point ); + this.ec.sendToAllAround( message.getProxy(), point ); } public void sendToDimension(AppEngPacket message, int dimensionId) { - ec.sendToDimension( message.getProxy(), dimensionId ); + this.ec.sendToDimension( message.getProxy(), dimensionId ); } public void sendToServer(AppEngPacket message) { - ec.sendToServer( message.getProxy() ); + this.ec.sendToServer( message.getProxy() ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java index 0111ea21d..c9f91395d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java +++ b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java @@ -42,11 +42,11 @@ public class PacketAssemblerAnimation extends AppEngPacket // automatic. public PacketAssemblerAnimation(ByteBuf stream) throws IOException { - x = stream.readInt(); - y = stream.readInt(); - z = stream.readInt(); - rate = stream.readByte(); - is = AEItemStack.loadItemStackFromPacket( stream ); + this.x = stream.readInt(); + this.y = stream.readInt(); + this.z = stream.readInt(); + this.rate = stream.readByte(); + this.is = AEItemStack.loadItemStackFromPacket( stream ); } @Override @@ -57,7 +57,7 @@ public class PacketAssemblerAnimation extends AppEngPacket double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); - CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), x + d0, y + d1, z + d2, this ); + CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this ); } // api @@ -65,7 +65,7 @@ public class PacketAssemblerAnimation extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( this.x = x ); data.writeInt( this.y = y ); data.writeInt( this.z = z ); @@ -73,6 +73,6 @@ public class PacketAssemblerAnimation extends AppEngPacket is.writeToPacket( data ); this.is = is; - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketClick.java b/src/main/java/appeng/core/sync/packets/PacketClick.java index e3624b75d..e29c236e8 100644 --- a/src/main/java/appeng/core/sync/packets/PacketClick.java +++ b/src/main/java/appeng/core/sync/packets/PacketClick.java @@ -44,13 +44,13 @@ public class PacketClick extends AppEngPacket // automatic. public PacketClick(ByteBuf stream) { - x = stream.readInt(); - y = stream.readInt(); - z = stream.readInt(); - side = stream.readInt(); - hitX = stream.readFloat(); - hitY = stream.readFloat(); - hitZ = stream.readFloat(); + this.x = stream.readInt(); + this.y = stream.readInt(); + this.z = stream.readInt(); + this.side = stream.readInt(); + this.hitX = stream.readFloat(); + this.hitY = stream.readFloat(); + this.hitZ = stream.readFloat(); } @Override @@ -60,7 +60,7 @@ public class PacketClick extends AppEngPacket if ( is != null && is.getItem() instanceof ToolNetworkTool ) { ToolNetworkTool tnt = (ToolNetworkTool) is.getItem(); - tnt.serverSideToolLogic( is, player, player.worldObj, x, y, z, side, hitX, hitY, hitZ ); + tnt.serverSideToolLogic( is, player, player.worldObj, this.x, this.y, this.z, this.side, this.hitX, this.hitY, this.hitZ ); } else if ( is != null && AEApi.instance().items().itemMemoryCard.sameAsStack( is ) ) { @@ -80,7 +80,7 @@ public class PacketClick extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( this.x = x ); data.writeInt( this.y = y ); data.writeInt( this.z = z ); @@ -89,6 +89,6 @@ public class PacketClick extends AppEngPacket data.writeFloat( this.hitY = hitY ); data.writeFloat( this.hitZ = hitZ ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java index 4f826c774..770cc4a8b 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java @@ -40,22 +40,22 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba // automatic. public PacketCompassRequest(ByteBuf stream) { - attunement = stream.readLong(); - cx = stream.readInt(); - cz = stream.readInt(); - cdy = stream.readInt(); + this.attunement = stream.readLong(); + this.cx = stream.readInt(); + this.cz = stream.readInt(); + this.cdy = stream.readInt(); } @Override public void calculatedDirection(boolean hasResult, boolean spin, double radians, double dist) { - NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) talkBackTo ); + NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo ); } @Override public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player) { - talkBackTo = player; + this.talkBackTo = player; DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 ); WorldSettings.getInstance().getCompass().getCompassDirection( loc, 174, this ); @@ -66,13 +66,13 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = attunement ); data.writeInt( this.cx = cx ); data.writeInt( this.cz = cz ); data.writeInt( this.cdy = cdy ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java index 005317768..82f420344 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java @@ -37,18 +37,18 @@ public class PacketCompassResponse extends AppEngPacket // automatic. public PacketCompassResponse(ByteBuf stream) { - attunement = stream.readLong(); - cx = stream.readInt(); - cz = stream.readInt(); - cdy = stream.readInt(); + this.attunement = stream.readLong(); + this.cx = stream.readInt(); + this.cz = stream.readInt(); + this.cdy = stream.readInt(); - cr = new CompassResult( stream.readBoolean(), stream.readBoolean(), stream.readDouble() ); + this.cr = new CompassResult( stream.readBoolean(), stream.readBoolean(), stream.readDouble() ); } @Override public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) { - CompassManager.instance.postResult( attunement, cx << 4, cdy << 5, cz << 4, cr ); + CompassManager.instance.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr ); } // api @@ -56,7 +56,7 @@ public class PacketCompassResponse extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = req.attunement ); data.writeInt( this.cx = req.cx ); data.writeInt( this.cz = req.cz ); @@ -66,7 +66,7 @@ public class PacketCompassResponse extends AppEngPacket data.writeBoolean( spin ); data.writeDouble( radians ); - configureWrite( data ); + this.configureWrite( data ); } } \ No newline at end of file diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index a761693b7..8a19d5591 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -56,8 +56,8 @@ public class PacketCompressedNBT extends AppEngPacket // automatic. public PacketCompressedNBT(final ByteBuf stream) throws IOException { - data = null; - compressFrame = null; + this.data = null; + this.compressFrame = null; GZIPInputStream gzReader = new GZIPInputStream( new InputStream() { @@ -73,7 +73,7 @@ public class PacketCompressedNBT extends AppEngPacket } ); DataInputStream inStream = new DataInputStream( gzReader ); - in = CompressedStreamTools.read( inStream ); + this.in = CompressedStreamTools.read( inStream ); inStream.close(); } @@ -84,32 +84,32 @@ public class PacketCompressedNBT extends AppEngPacket GuiScreen gs = Minecraft.getMinecraft().currentScreen; if ( gs instanceof GuiInterfaceTerminal ) - ((GuiInterfaceTerminal) gs).postUpdate( in ); + ((GuiInterfaceTerminal) gs).postUpdate( this.in ); } // api public PacketCompressedNBT(NBTTagCompound din) throws IOException { - data = Unpooled.buffer( 2048 ); - data.writeInt( getPacketID() ); + this.data = Unpooled.buffer( 2048 ); + this.data.writeInt( this.getPacketID() ); - in = din; + this.in = din; - compressFrame = new GZIPOutputStream( new OutputStream() { + this.compressFrame = new GZIPOutputStream( new OutputStream() { @Override public void write(int value) throws IOException { - data.writeByte( value ); + PacketCompressedNBT.this.data.writeByte( value ); } } ); - CompressedStreamTools.write( din, new DataOutputStream( compressFrame ) ); - compressFrame.close(); + CompressedStreamTools.write( din, new DataOutputStream( this.compressFrame ) ); + this.compressFrame.close(); - configureWrite( data ); + this.configureWrite( this.data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java index 42adca423..5ef0665f9 100644 --- a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java +++ b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java @@ -39,8 +39,8 @@ public class PacketConfigButton extends AppEngPacket // automatic. public PacketConfigButton(ByteBuf stream) { - option = Settings.values()[stream.readInt()]; - rotationDirection = stream.readBoolean(); + this.option = Settings.values()[stream.readInt()]; + this.rotationDirection = stream.readBoolean(); } @Override @@ -51,8 +51,8 @@ public class PacketConfigButton extends AppEngPacket if ( baseContainer.getTarget() instanceof IConfigurableObject ) { IConfigManager cm = ((IConfigurableObject) baseContainer.getTarget()).getConfigManager(); - Enum newState = Platform.rotateEnum( cm.getSetting( option ), rotationDirection, option.getPossibleValues() ); - cm.putSetting( option, newState ); + Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() ); + cm.putSetting( this.option, newState ); } } @@ -63,10 +63,10 @@ public class PacketConfigButton extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( option.ordinal() ); data.writeBoolean( rotationDirection ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java index 8d0042b78..e588070db 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java @@ -49,8 +49,8 @@ public class PacketCraftRequest extends AppEngPacket // automatic. public PacketCraftRequest(ByteBuf stream) { - heldShift = stream.readBoolean(); - amount = stream.readLong(); + this.heldShift = stream.readBoolean(); + this.amount = stream.readLong(); } @Override @@ -73,7 +73,7 @@ public class PacketCraftRequest extends AppEngPacket Future futureJob = null; - cca.whatToMake.setStackSize( amount ); + cca.whatToMake.setStackSize( this.amount ); try { @@ -89,7 +89,7 @@ public class PacketCraftRequest extends AppEngPacket if ( player.openContainer instanceof ContainerCraftConfirm ) { ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer; - ccc.autoStart = heldShift; + ccc.autoStart = this.heldShift; ccc.job = futureJob; cca.detectAndSendChanges(); } @@ -113,11 +113,11 @@ public class PacketCraftRequest extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeBoolean( shift ); - data.writeLong( amount ); + data.writeLong( this.amount ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index ad7f1fa9a..0d0e88495 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -48,14 +48,14 @@ public class PacketInventoryAction extends AppEngPacket // automatic. public PacketInventoryAction(ByteBuf stream) throws IOException { - action = InventoryAction.values()[stream.readInt()]; - slot = stream.readInt(); - id = stream.readLong(); + this.action = InventoryAction.values()[stream.readInt()]; + this.slot = stream.readInt(); + this.id = stream.readLong(); boolean hasItem = stream.readBoolean(); if ( hasItem ) - slotItem = AEItemStack.loadItemStackFromPacket( stream ); + this.slotItem = AEItemStack.loadItemStackFromPacket( stream ); else - slotItem = null; + this.slotItem = null; } @Override @@ -65,7 +65,7 @@ public class PacketInventoryAction extends AppEngPacket if ( sender.openContainer instanceof AEBaseContainer ) { AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; - if ( action == InventoryAction.AUTO_CRAFT ) + if ( this.action == InventoryAction.AUTO_CRAFT ) { ContainerOpenContext context = baseContainer.openContext; if ( context != null ) @@ -89,7 +89,7 @@ public class PacketInventoryAction extends AppEngPacket } else { - baseContainer.doAction( sender, action, slot, id ); + baseContainer.doAction( sender, this.action, this.slot, this.id ); } } } @@ -97,12 +97,12 @@ public class PacketInventoryAction extends AppEngPacket @Override public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) { - if ( action == InventoryAction.UPDATE_HAND ) + if ( this.action == InventoryAction.UPDATE_HAND ) { - if ( slotItem == null ) + if ( this.slotItem == null ) ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( null ); else - ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( slotItem.getItemStack() ); + ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( this.slotItem.getItemStack() ); } } @@ -119,10 +119,10 @@ public class PacketInventoryAction extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); data.writeInt( slot ); - data.writeLong( id ); + data.writeLong( this.id ); if ( slotItem == null ) data.writeBoolean( false ); @@ -132,7 +132,7 @@ public class PacketInventoryAction extends AppEngPacket slotItem.writeToPacket( data ); } - configureWrite( data ); + this.configureWrite( data ); } // api @@ -145,12 +145,12 @@ public class PacketInventoryAction extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); data.writeInt( slot ); data.writeLong( id ); data.writeBoolean( false ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketLightning.java b/src/main/java/appeng/core/sync/packets/PacketLightning.java index c1f06fb21..00b6a564c 100644 --- a/src/main/java/appeng/core/sync/packets/PacketLightning.java +++ b/src/main/java/appeng/core/sync/packets/PacketLightning.java @@ -41,9 +41,9 @@ public class PacketLightning extends AppEngPacket // automatic. public PacketLightning(ByteBuf stream) { - x = stream.readFloat(); - y = stream.readFloat(); - z = stream.readFloat(); + this.x = stream.readFloat(); + this.y = stream.readFloat(); + this.z = stream.readFloat(); } @Override @@ -54,7 +54,7 @@ public class PacketLightning extends AppEngPacket { if ( Platform.isClient() && AEConfig.instance.enableEffects ) { - LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f ); + LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } @@ -72,12 +72,12 @@ public class PacketLightning extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); data.writeFloat( (float) y ); data.writeFloat( (float) z ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java index e29104523..97669e559 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java @@ -63,10 +63,10 @@ public class PacketMEInventoryUpdate extends AppEngPacket // automatic. public PacketMEInventoryUpdate(final ByteBuf stream) throws IOException { - data = null; - compressFrame = null; - list = new LinkedList(); - ref = stream.readByte(); + this.data = null; + this.compressFrame = null; + this.list = new LinkedList(); + this.ref = stream.readByte(); // int originalBytes = stream.readableBytes(); @@ -97,9 +97,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket // AELog.info( "Receiver: " + originalBytes + " -> " + uncompressedBytes ); while (uncompressed.readableBytes() > 0) - list.add( AEItemStack.loadItemStackFromPacket( uncompressed ) ); + this.list.add( AEItemStack.loadItemStackFromPacket( uncompressed ) ); - empty = list.isEmpty(); + this.empty = this.list.isEmpty(); } @Override @@ -109,16 +109,16 @@ public class PacketMEInventoryUpdate extends AppEngPacket GuiScreen gs = Minecraft.getMinecraft().currentScreen; if ( gs instanceof GuiCraftConfirm ) - ((GuiCraftConfirm) gs).postUpdate( list, ref ); + ((GuiCraftConfirm) gs).postUpdate( this.list, this.ref ); if ( gs instanceof GuiCraftingCPU ) - ((GuiCraftingCPU) gs).postUpdate( list, ref ); + ((GuiCraftingCPU) gs).postUpdate( this.list, this.ref ); if ( gs instanceof GuiMEMonitorable ) - ((GuiMEMonitorable) gs).postUpdate( list ); + ((GuiMEMonitorable) gs).postUpdate( this.list ); if ( gs instanceof GuiNetworkStatus ) - ((GuiNetworkStatus) gs).postUpdate( list ); + ((GuiNetworkStatus) gs).postUpdate( this.list ); } @@ -127,9 +127,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket { try { - compressFrame.close(); + this.compressFrame.close(); - configureWrite( data ); + this.configureWrite( this.data ); return super.getProxy(); } catch (IOException e) @@ -147,21 +147,21 @@ public class PacketMEInventoryUpdate extends AppEngPacket // api public PacketMEInventoryUpdate(byte ref) throws IOException { - data = Unpooled.buffer( 2048 ); - data.writeInt( getPacketID() ); - data.writeByte( this.ref = ref ); + this.data = Unpooled.buffer( 2048 ); + this.data.writeInt( this.getPacketID() ); + this.data.writeByte( this.ref = ref ); - compressFrame = new GZIPOutputStream( new OutputStream() { + this.compressFrame = new GZIPOutputStream( new OutputStream() { @Override public void write(int value) throws IOException { - data.writeByte( value ); + PacketMEInventoryUpdate.this.data.writeByte( value ); } } ); - list = null; + this.list = null; } public void appendItem(IAEItemStack is) throws IOException, BufferOverflowException @@ -169,25 +169,25 @@ public class PacketMEInventoryUpdate extends AppEngPacket ByteBuf tmp = Unpooled.buffer( 2048 ); is.writeToPacket( tmp ); - compressFrame.flush(); - if ( writtenBytes + tmp.readableBytes() > 2 * 1024 * 1024 ) // 2mb! + this.compressFrame.flush(); + if ( this.writtenBytes + tmp.readableBytes() > 2 * 1024 * 1024 ) // 2mb! throw new BufferOverflowException(); else { - writtenBytes += tmp.readableBytes(); - compressFrame.write( tmp.array(), 0, tmp.readableBytes() ); - empty = false; + this.writtenBytes += tmp.readableBytes(); + this.compressFrame.write( tmp.array(), 0, tmp.readableBytes() ); + this.empty = false; } } public int getLength() { - return data.readableBytes(); + return this.data.readableBytes(); } public boolean isEmpty() { - return empty; + return this.empty; } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java index 6e52a0dec..f7b0cae2f 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java +++ b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java @@ -46,13 +46,13 @@ public class PacketMatterCannon extends AppEngPacket // automatic. public PacketMatterCannon(ByteBuf stream) { - x = stream.readFloat(); - y = stream.readFloat(); - z = stream.readFloat(); - dx = stream.readFloat(); - dy = stream.readFloat(); - dz = stream.readFloat(); - len = stream.readByte(); + this.x = stream.readFloat(); + this.y = stream.readFloat(); + this.z = stream.readFloat(); + this.dx = stream.readFloat(); + this.dy = stream.readFloat(); + this.dz = stream.readFloat(); + this.len = stream.readByte(); } @Override @@ -63,9 +63,9 @@ public class PacketMatterCannon extends AppEngPacket { World world = FMLClientHandler.instance().getClient().theWorld; - for (int a = 1; a < len; a++) + for (int a = 1; a < this.len; a++) { - MatterCannonFX fx = new MatterCannonFX( world, x + dx * a, y + dy * a, z + dz * a, Items.diamond ); + MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } @@ -91,7 +91,7 @@ public class PacketMatterCannon extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); data.writeFloat( (float) y ); data.writeFloat( (float) z ); @@ -100,7 +100,7 @@ public class PacketMatterCannon extends AppEngPacket data.writeFloat( (float) this.dz ); data.writeByte( len ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java index 7cacc17e6..6b19e78af 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java +++ b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java @@ -47,9 +47,9 @@ public class PacketMockExplosion extends AppEngPacket // automatic. public PacketMockExplosion(ByteBuf stream) { - x = stream.readDouble(); - y = stream.readDouble(); - z = stream.readDouble(); + this.x = stream.readDouble(); + this.y = stream.readDouble(); + this.z = stream.readDouble(); } // api @@ -61,12 +61,12 @@ public class PacketMockExplosion extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeDouble( x ); data.writeDouble( y ); data.writeDouble( z ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java index 1a102f77e..d1ee3df61 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java +++ b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java @@ -54,9 +54,9 @@ public class PacketMultiPart extends AppEngPacket { ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java index 04c0d2b33..78c26b7c2 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java @@ -68,16 +68,16 @@ public class PacketNEIRecipe extends AppEngPacket NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes ); if ( comp != null ) { - recipe = new ItemStack[9][]; - for (int x = 0; x < recipe.length; x++) + this.recipe = new ItemStack[9][]; + for (int x = 0; x < this.recipe.length; x++) { NBTTagList list = comp.getTagList( "#" + x, 10 ); if ( list.tagCount() > 0 ) { - recipe[x] = new ItemStack[list.tagCount()]; + this.recipe[x] = new ItemStack[list.tagCount()]; for (int y = 0; y < list.tagCount(); y++) { - recipe[x][y] = ItemStack.loadItemStackFromNBT( list.getCompoundTagAt( y ) ); + this.recipe[x][y] = ItemStack.loadItemStackFromNBT( list.getCompoundTagAt( y ) ); } } } @@ -108,14 +108,14 @@ public class PacketNEIRecipe extends AppEngPacket Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE; - if ( inv != null && recipe != null && security != null ) + if ( inv != null && this.recipe != null && security != null ) { InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); for (int x = 0; x < 9; x++) { - if ( recipe[x] != null && recipe[x].length > 0 ) + if ( this.recipe[x] != null && this.recipe[x].length > 0 ) { - testInv.setInventorySlotContents(x, recipe[x][0]); + testInv.setInventorySlotContents(x, this.recipe[x][0]); } } @@ -170,9 +170,9 @@ public class PacketNEIRecipe extends AppEngPacket // TODO see if this code is necessary if ( whichItem == null ) { - for (int y = 0; y < recipe[x].length; y++) + for (int y = 0; y < this.recipe[x].length; y++) { - IAEItemStack request = AEItemStack.create( recipe[x][y] ); + IAEItemStack request = AEItemStack.create( this.recipe[x][y] ); if ( request != null ) { if ( filter == null || filter.isListed( request ) ) @@ -228,11 +228,11 @@ public class PacketNEIRecipe extends AppEngPacket ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream( bytes ); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); CompressedStreamTools.writeCompressed( recipe, outputStream ); data.writeBytes( bytes.toByteArray() ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java index bceac2d04..e775a705d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java +++ b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java @@ -37,7 +37,7 @@ public class PacketNewStorageDimension extends AppEngPacket // automatic. public PacketNewStorageDimension(ByteBuf stream) { - newDim = stream.readInt(); + this.newDim = stream.readInt(); } @Override @@ -46,7 +46,7 @@ public class PacketNewStorageDimension extends AppEngPacket { try { - DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID ); + DimensionManager.registerDimension( this.newDim, AEConfig.instance.storageProviderID ); } catch (IllegalArgumentException iae) { @@ -61,10 +61,10 @@ public class PacketNewStorageDimension extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( newDim ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java index e2d010bc0..a6d354381 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java +++ b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java @@ -38,16 +38,16 @@ public class PacketPaintedEntity extends AppEngPacket // automatic. public PacketPaintedEntity(ByteBuf stream) { - entityId = stream.readInt(); - myColor = AEColor.values()[stream.readByte()]; - ticks = stream.readInt(); + this.entityId = stream.readInt(); + this.myColor = AEColor.values()[stream.readByte()]; + this.ticks = stream.readInt(); } @Override public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) { - PlayerColor pc = new PlayerColor( entityId, myColor, ticks ); - TickHandler.instance.getPlayerColors().put( entityId, pc ); + PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks ); + TickHandler.instance.getPlayerColors().put( this.entityId, pc ); } // api @@ -55,11 +55,11 @@ public class PacketPaintedEntity extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( this.entityId = myEntity ); data.writeByte( (this.myColor = myColor).ordinal() ); data.writeInt( ticksLeft ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java index 2c6c8b994..db081aed4 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java @@ -37,11 +37,11 @@ public class PacketPartPlacement extends AppEngPacket // automatic. public PacketPartPlacement(ByteBuf stream) { - x = stream.readInt(); - y = stream.readInt(); - z = stream.readInt(); - face = stream.readByte(); - eyeHeight = stream.readFloat(); + this.x = stream.readInt(); + this.y = stream.readInt(); + this.z = stream.readInt(); + this.face = stream.readByte(); + this.eyeHeight = stream.readFloat(); } @Override @@ -49,8 +49,8 @@ public class PacketPartPlacement extends AppEngPacket { EntityPlayerMP sender = (EntityPlayerMP) player; CommonHelper.proxy.updateRenderMode( sender ); - PartPlacement.eyeHeight = eyeHeight; - PartPlacement.place( sender.getHeldItem(), x, y, z, face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 ); + PartPlacement.eyeHeight = this.eyeHeight; + PartPlacement.place( sender.getHeldItem(), this.x, this.y, this.z, this.face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 ); CommonHelper.proxy.updateRenderMode( null ); } @@ -59,14 +59,14 @@ public class PacketPartPlacement extends AppEngPacket { ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( x ); data.writeInt( y ); data.writeInt( z ); data.writeByte( face ); data.writeFloat( eyeHeight ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java index ed78820dc..c0cfe8069 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java @@ -35,8 +35,8 @@ public class PacketPartialItem extends AppEngPacket // automatic. public PacketPartialItem(ByteBuf stream) { - pageNum = stream.readShort(); - stream.readBytes( data = new byte[stream.readableBytes()] ); + this.pageNum = stream.readShort(); + stream.readBytes( this.data = new byte[stream.readableBytes()] ); } @Override @@ -54,28 +54,28 @@ public class PacketPartialItem extends AppEngPacket ByteBuf data = Unpooled.buffer(); - pageNum = (short) (page | (maxPages << 8)); + this.pageNum = (short) (page | (maxPages << 8)); this.data = buf; - data.writeInt( getPacketID() ); - data.writeShort( pageNum ); + data.writeInt( this.getPacketID() ); + data.writeShort( this.pageNum ); data.writeBytes( buf ); - configureWrite( data ); + this.configureWrite( data ); } public int getPageCount() { - return pageNum >> 8; + return this.pageNum >> 8; } public int getSize() { - return data.length; + return this.data.length; } public int write(byte[] buffer, int cursor) { - System.arraycopy( data, 0, buffer, cursor, data.length ); - return cursor + data.length; + System.arraycopy( this.data, 0, buffer, cursor, this.data.length ); + return cursor + this.data.length; } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index d38db513c..4175e82ed 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -55,12 +55,12 @@ public class PacketPatternSlot extends AppEngPacket // automatic. public PacketPatternSlot(ByteBuf stream) throws IOException { - shift = stream.readBoolean(); + this.shift = stream.readBoolean(); - slotItem = readItem( stream ); + this.slotItem = this.readItem( stream ); for (int x = 0; x < 9; x++) - pattern[x] = readItem( stream ); + this.pattern[x] = this.readItem( stream ); } @Override @@ -93,18 +93,18 @@ public class PacketPatternSlot extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeBoolean( shift ); - writeItem( slotItem, data ); + this.writeItem( slotItem, data ); for (int x = 0; x < 9; x++) { - pattern[x] = AEApi.instance().storage().createItemStack( pat.getStackInSlot( x ) ); - writeItem( pattern[x], data ); + this.pattern[x] = AEApi.instance().storage().createItemStack( pat.getStackInSlot( x ) ); + this.writeItem( this.pattern[x], data ); } - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java index 07b51a632..b8a800ad6 100644 --- a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java +++ b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java @@ -36,8 +36,8 @@ public class PacketProgressBar extends AppEngPacket // automatic. public PacketProgressBar(ByteBuf stream) { - id = stream.readShort(); - value = stream.readLong(); + this.id = stream.readShort(); + this.value = stream.readLong(); } @Override @@ -45,7 +45,7 @@ public class PacketProgressBar extends AppEngPacket { Container c = player.openContainer; if ( c instanceof AEBaseContainer ) - ((AEBaseContainer) c).updateFullProgressBar( id, value ); + ((AEBaseContainer) c).updateFullProgressBar( this.id, this.value ); } @Override @@ -53,7 +53,7 @@ public class PacketProgressBar extends AppEngPacket { Container c = player.openContainer; if ( c instanceof AEBaseContainer ) - ((AEBaseContainer) c).updateFullProgressBar( id, value ); + ((AEBaseContainer) c).updateFullProgressBar( this.id, this.value ); } // api @@ -64,10 +64,10 @@ public class PacketProgressBar extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeShort( short_id ); data.writeLong( value ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java index 7ac14d42c..12cbcde60 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java @@ -35,8 +35,8 @@ public class PacketSwapSlots extends AppEngPacket // automatic. public PacketSwapSlots(ByteBuf stream) { - slotA = stream.readInt(); - slotB = stream.readInt(); + this.slotA = stream.readInt(); + this.slotB = stream.readInt(); } @Override @@ -44,7 +44,7 @@ public class PacketSwapSlots extends AppEngPacket { if ( player != null && player.openContainer instanceof AEBaseContainer ) { - ((AEBaseContainer) player.openContainer).swapSlotContents( slotA, slotB ); + ((AEBaseContainer) player.openContainer).swapSlotContents( this.slotA, this.slotB ); } } @@ -53,10 +53,10 @@ public class PacketSwapSlots extends AppEngPacket { ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( this.slotA = slotA ); data.writeInt( this.slotB = slotB ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java index b9e8491b6..3c0d80022 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java @@ -40,7 +40,7 @@ public class PacketSwitchGuis extends AppEngPacket // automatic. public PacketSwitchGuis(ByteBuf stream) { - newGui = GuiBridge.values()[stream.readInt()]; + this.newGui = GuiBridge.values()[stream.readInt()]; } @Override @@ -54,7 +54,7 @@ public class PacketSwitchGuis extends AppEngPacket if ( context != null ) { TileEntity te = context.getTile(); - Platform.openGUI( player, te, context.side, newGui ); + Platform.openGUI( player, te, context.side, this.newGui ); } } } @@ -75,9 +75,9 @@ public class PacketSwitchGuis extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeInt( newGui.ordinal() ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java index a71a1dbfb..7db92e886 100644 --- a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java +++ b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java @@ -50,11 +50,11 @@ public class PacketTransitionEffect extends AppEngPacket // automatic. public PacketTransitionEffect(ByteBuf stream) { - x = stream.readFloat(); - y = stream.readFloat(); - z = stream.readFloat(); - d = ForgeDirection.getOrientation( stream.readByte() ); - mode = stream.readBoolean(); + this.x = stream.readFloat(); + this.y = stream.readFloat(); + this.z = stream.readFloat(); + this.d = ForgeDirection.getOrientation( stream.readByte() ); + this.mode = stream.readBoolean(); } @Override @@ -63,33 +63,33 @@ public class PacketTransitionEffect extends AppEngPacket { World world = ClientHelper.proxy.getWorld(); - for (int zz = 0; zz < (mode ? 32 : 8); zz++) + for (int zz = 0; zz < (this.mode ? 32 : 8); zz++) if ( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - EnergyFx fx = new EnergyFx( world, x + (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), y - + (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), z - + (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), Items.diamond ); + EnergyFx fx = new EnergyFx( world, this.x + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), this.y + + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), this.z + + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), Items.diamond ); - if ( !mode ) - fx.fromItem( d ); + if ( !this.mode ) + fx.fromItem( this.d ); - fx.motionX = -0.1 * d.offsetX; - fx.motionY = -0.1 * d.offsetY; - fx.motionZ = -0.1 * d.offsetZ; + fx.motionX = -0.1 * this.d.offsetX; + fx.motionY = -0.1 * this.d.offsetY; + fx.motionZ = -0.1 * this.d.offsetZ; Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - if ( mode ) + if ( this.mode ) { - Block block = world.getBlock( (int) x, (int) y, (int) z ); + Block block = world.getBlock( (int) this.x, (int) this.y, (int) this.z ); Minecraft .getMinecraft() .getSoundHandler() .playSound( new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), (block.stepSound.getVolume() + 1.0F) / 2.0F, - block.stepSound.getPitch() * 0.8F, (float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F ) ); + block.stepSound.getPitch() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) ); } } @@ -104,14 +104,14 @@ public class PacketTransitionEffect extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); data.writeFloat( (float) y ); data.writeFloat( (float) z ); data.writeByte( this.d.ordinal() ); data.writeBoolean( wasBlock ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java index c124ee222..d16da7530 100644 --- a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java +++ b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java @@ -61,8 +61,8 @@ public class PacketValueConfig extends AppEngPacket // automatic. public PacketValueConfig(ByteBuf stream) throws IOException { DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) ); - Name = dis.readUTF(); - Value = dis.readUTF(); + this.Name = dis.readUTF(); + this.Value = dis.readUTF(); // dis.close(); } @@ -71,109 +71,109 @@ public class PacketValueConfig extends AppEngPacket { Container c = player.openContainer; - if ( Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem ) + if ( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem ) { ItemStack is = player.getHeldItem(); IMouseWheelItem si = (IMouseWheelItem) is.getItem(); - si.onWheel( is, Value.equals( "WheelUp" ) ); + si.onWheel( is, this.Value.equals( "WheelUp" ) ); } - else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus ) + else if ( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus ) { ContainerCraftingStatus qk = (ContainerCraftingStatus) c; - qk.cycleCpu( Value.equals( "Next" ) ); + qk.cycleCpu( this.Value.equals( "Next" ) ); } - else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm ) + else if ( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm ) { ContainerCraftConfirm qk = (ContainerCraftConfirm) c; - qk.cycleCpu( Value.equals( "Next" ) ); + qk.cycleCpu( this.Value.equals( "Next" ) ); } - else if ( Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm ) + else if ( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm ) { ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.startJob(); } - else if ( Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU ) + else if ( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU ) { ContainerCraftingCPU qk = (ContainerCraftingCPU) c; qk.cancelCrafting(); } - else if ( Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife ) + else if ( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife ) { ContainerQuartzKnife qk = (ContainerQuartzKnife) c; - qk.setName( Value ); + qk.setName( this.Value ); } - else if ( Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity ) + else if ( this.Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity ) { ContainerSecurity sc = (ContainerSecurity) c; - sc.toggleSetting( Value, player ); + sc.toggleSetting( this.Value, player ); } - else if ( Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority ) + else if ( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority ) { ContainerPriority pc = (ContainerPriority) c; - pc.setPriority( Integer.parseInt( Value ), player ); + pc.setPriority( Integer.parseInt( this.Value ), player ); } - else if ( Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter ) + else if ( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter ) { ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; - lvc.setLevel( Long.parseLong( Value ), player ); + lvc.setLevel( Long.parseLong( this.Value ), player ); } - else if ( Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm ) + else if ( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm ) { ContainerPatternTerm cpt = (ContainerPatternTerm) c; - if ( Name.equals( "PatternTerminal.CraftMode" ) ) + if ( this.Name.equals( "PatternTerminal.CraftMode" ) ) { - cpt.ct.setCraftingRecipe( Value.equals( "1" ) ); + cpt.ct.setCraftingRecipe( this.Value.equals( "1" ) ); } - else if ( Name.equals( "PatternTerminal.Encode" ) ) + else if ( this.Name.equals( "PatternTerminal.Encode" ) ) { cpt.encode(); } - else if ( Name.equals( "PatternTerminal.Clear" ) ) + else if ( this.Name.equals( "PatternTerminal.Clear" ) ) { cpt.clear(); } } - else if ( Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus ) + else if ( this.Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus ) { ContainerStorageBus ccw = (ContainerStorageBus) c; - if ( Name.equals( "StorageBus.Action" ) ) + if ( this.Name.equals( "StorageBus.Action" ) ) { - if ( Value.equals( "Partition" ) ) + if ( this.Value.equals( "Partition" ) ) { ccw.partition(); } - else if ( Value.equals( "Clear" ) ) + else if ( this.Value.equals( "Clear" ) ) { ccw.clear(); } } } - else if ( Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench ) + else if ( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench ) { ContainerCellWorkbench ccw = (ContainerCellWorkbench) c; - if ( Name.equals( "CellWorkbench.Action" ) ) + if ( this.Name.equals( "CellWorkbench.Action" ) ) { - if ( Value.equals( "CopyMode" ) ) + if ( this.Value.equals( "CopyMode" ) ) { ccw.nextCopyMode(); } - else if ( Value.equals( "Partition" ) ) + else if ( this.Value.equals( "Partition" ) ) { ccw.partition(); } - else if ( Value.equals( "Clear" ) ) + else if ( this.Value.equals( "Clear" ) ) { ccw.clear(); } } - else if ( Name.equals( "CellWorkbench.Fuzzy" ) ) + else if ( this.Name.equals( "CellWorkbench.Fuzzy" ) ) { - ccw.setFuzzy( FuzzyMode.valueOf( Value ) ); + ccw.setFuzzy( FuzzyMode.valueOf( this.Value ) ); } } else if ( c instanceof ContainerNetworkTool ) { - if ( Name.equals( "NetworkTool" ) && Value.equals( "Toggle" ) ) + if ( this.Name.equals( "NetworkTool" ) && this.Value.equals( "Toggle" ) ) { ((ContainerNetworkTool) c).toggleFacadeMode(); } @@ -184,13 +184,13 @@ public class PacketValueConfig extends AppEngPacket for (Enum e : cm.getSettings()) { - if ( e.name().equals( Name ) ) + if ( e.name().equals( this.Name ) ) { Enum def = cm.getSetting( e ); try { - cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) ); + cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } catch (IllegalArgumentException err) { @@ -209,15 +209,15 @@ public class PacketValueConfig extends AppEngPacket { Container c = player.openContainer; - if ( Name.equals( "CustomName" ) && c instanceof AEBaseContainer ) + if ( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { - ((AEBaseContainer) c).customName = Value; + ((AEBaseContainer) c).customName = this.Value; } - else if ( Name.startsWith( "SyncDat." ) ) + else if ( this.Name.startsWith( "SyncDat." ) ) { - ((AEBaseContainer) c).stringSync( Integer.parseInt( Name.substring( 8 ) ), Value ); + ((AEBaseContainer) c).stringSync( Integer.parseInt( this.Name.substring( 8 ) ), this.Value ); } - else if ( Name.equals( "CraftingStatus" ) && Value.equals( "Clear" ) ) + else if ( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) ) { GuiScreen gs = Minecraft.getMinecraft().currentScreen; if ( gs instanceof GuiCraftingCPU ) @@ -229,13 +229,13 @@ public class PacketValueConfig extends AppEngPacket for (Enum e : cm.getSettings()) { - if ( e.name().equals( Name ) ) + if ( e.name().equals( this.Name ) ) { Enum def = cm.getSetting( e ); try { - cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) ); + cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } catch (IllegalArgumentException err) { @@ -256,7 +256,7 @@ public class PacketValueConfig extends AppEngPacket ByteBuf data = Unpooled.buffer(); - data.writeInt( getPacketID() ); + data.writeInt( this.getPacketID() ); ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream( bos ); @@ -266,6 +266,6 @@ public class PacketValueConfig extends AppEngPacket data.writeBytes( bos.toByteArray() ); - configureWrite( data ); + this.configureWrite( data ); } } diff --git a/src/main/java/appeng/crafting/CraftBranchFailure.java b/src/main/java/appeng/crafting/CraftBranchFailure.java index 1f2238103..cd4ce9d61 100644 --- a/src/main/java/appeng/crafting/CraftBranchFailure.java +++ b/src/main/java/appeng/crafting/CraftBranchFailure.java @@ -29,7 +29,7 @@ public class CraftBranchFailure extends Exception public CraftBranchFailure(IAEItemStack what, long howMany) { super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany ); - missing = what.copy(); - missing.setStackSize( howMany ); + this.missing = what.copy(); + this.missing.setStackSize( howMany ); } } diff --git a/src/main/java/appeng/crafting/CraftingCalculationFailure.java b/src/main/java/appeng/crafting/CraftingCalculationFailure.java index 36974a2a1..61066ff6d 100644 --- a/src/main/java/appeng/crafting/CraftingCalculationFailure.java +++ b/src/main/java/appeng/crafting/CraftingCalculationFailure.java @@ -29,7 +29,7 @@ public class CraftingCalculationFailure extends RuntimeException public CraftingCalculationFailure(IAEItemStack what, long howMany) { super( "this should have been caught!" ); - missing = what.copy(); - missing.setStackSize( howMany ); + this.missing = what.copy(); + this.missing.setStackSize( howMany ); } } diff --git a/src/main/java/appeng/crafting/CraftingJob.java b/src/main/java/appeng/crafting/CraftingJob.java index 27951e1e6..4bdcff54a 100644 --- a/src/main/java/appeng/crafting/CraftingJob.java +++ b/src/main/java/appeng/crafting/CraftingJob.java @@ -63,43 +63,43 @@ public class CraftingJob implements Runnable, ICraftingJob @Override public IAEItemStack getOutput() { - return output; + return this.output; } public CraftingJob(World w, NBTTagCompound data) { - world = wrapWorld( w ); - storage = AEApi.instance().storage().createItemList(); - prophecies = new HashSet(); - original = null; - availableCheck = null; + this.world = this.wrapWorld( w ); + this.storage = AEApi.instance().storage().createItemList(); + this.prophecies = new HashSet(); + this.original = null; + this.availableCheck = null; } public void refund(IAEItemStack o) { - availableCheck.injectItems( o, Actionable.MODULATE, this.actionSrc ); + this.availableCheck.injectItems( o, Actionable.MODULATE, this.actionSrc ); } public IAEItemStack checkUse(IAEItemStack available) { - return availableCheck.extractItems( available, Actionable.MODULATE, this.actionSrc ); + return this.availableCheck.extractItems( available, Actionable.MODULATE, this.actionSrc ); } public CraftingJob(World w, IGrid grid, BaseActionSource actionSrc, IAEItemStack what, ICraftingCallback callback) { - world = wrapWorld( w ); - output = what.copy(); - storage = AEApi.instance().storage().createItemList(); - prophecies = new HashSet(); + this.world = this.wrapWorld( w ); + this.output = what.copy(); + this.storage = AEApi.instance().storage().createItemList(); + this.prophecies = new HashSet(); this.actionSrc = actionSrc; this.callback = callback; ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); IStorageGrid sg = grid.getCache( IStorageGrid.class ); - original = new MECraftingInventory( sg.getItemInventory(), actionSrc, false, false, false ); + this.original = new MECraftingInventory( sg.getItemInventory(), actionSrc, false, false, false ); - tree = getCraftingTree( cc, what ); - availableCheck = null; + this.tree = this.getCraftingTree( cc, what ); + this.availableCheck = null; } private World wrapWorld(World w) @@ -115,7 +115,7 @@ public class CraftingJob implements Runnable, ICraftingJob @Override public long getByteTotal() { - return bytes; + return this.bytes; } public void writeToNBT(NBTTagCompound out) @@ -132,14 +132,14 @@ public class CraftingJob implements Runnable, ICraftingJob { what = what.copy(); what.setStackSize( what.getStackSize() * crafts ); - crafting.add( what ); + this.crafting.add( what ); } } public void addMissing(IAEItemStack what) { what = what.copy(); - missing.add( what ); + this.missing.add( what ); } static class TwoIntegers @@ -158,51 +158,51 @@ public class CraftingJob implements Runnable, ICraftingJob { try { - TickHandler.instance.registerCraftingSimulation( world, this ); - handlePausing(); + TickHandler.instance.registerCraftingSimulation( this.world, this ); + this.handlePausing(); Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( original, true, false, true ); - craftingInventory.ignore( output ); + MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + craftingInventory.ignore( this.output ); - availableCheck = new MECraftingInventory( original, false, false, false ); - tree.request( craftingInventory, output.getStackSize(), actionSrc ); - tree.dive( this ); + this.availableCheck = new MECraftingInventory( this.original, false, false, false ); + this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); + this.tree.dive( this ); - for (String s : opsAndMultiplier.keySet()) + for (String s : this.opsAndMultiplier.keySet()) { - TwoIntegers ti = opsAndMultiplier.get( s ); + TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) ); } - AELog.crafting( "------------- " + getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); + AELog.crafting( "------------- " + this.getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); // if ( mode == Actionable.MODULATE ) // craftingInventory.moveItemsToStorage( storage ); } catch (CraftBranchFailure e) { - simulate = true; + this.simulate = true; try { Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( original, true, false, true ); - craftingInventory.ignore( output ); + MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + craftingInventory.ignore( this.output ); - availableCheck = new MECraftingInventory( original, false, false, false ); + this.availableCheck = new MECraftingInventory( this.original, false, false, false ); - tree.setSimulate(); - tree.request( craftingInventory, output.getStackSize(), actionSrc ); - tree.dive( this ); + this.tree.setSimulate(); + this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); + this.tree.dive( this ); - for (String s : opsAndMultiplier.keySet()) + for (String s : this.opsAndMultiplier.keySet()) { - TwoIntegers ti = opsAndMultiplier.get( s ); + TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) ); } - AELog.crafting( "------------- " + getByteTotal() + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); + AELog.crafting( "------------- " + this.getByteTotal() + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); } catch (CraftBranchFailure e1) { @@ -215,7 +215,7 @@ public class CraftingJob implements Runnable, ICraftingJob catch (InterruptedException e1) { AELog.crafting( "Crafting calculation canceled." ); - finish(); + this.finish(); return; } } @@ -226,51 +226,51 @@ public class CraftingJob implements Runnable, ICraftingJob catch (InterruptedException e1) { AELog.crafting( "Crafting calculation canceled." ); - finish(); + this.finish(); return; } - log( "crafting job now done" ); + this.log( "crafting job now done" ); } catch (Throwable t) { - finish(); + this.finish(); throw new RuntimeException( t ); } - finish(); + this.finish(); } public void finish() { - if ( callback != null ) - callback.calculationComplete( this ); + if ( this.callback != null ) + this.callback.calculationComplete( this ); - availableCheck = null; + this.availableCheck = null; - synchronized (monitor) + synchronized (this.monitor) { - running = false; - done = true; - monitor.notify(); + this.running = false; + this.done = true; + this.monitor.notify(); } } @Override public boolean isSimulation() { - return simulate; + return this.simulate; } public boolean isDone() { - return done; + return this.done; } public World getWorld() { - return world; + return this.world; } private boolean running = false; @@ -287,33 +287,33 @@ public class CraftingJob implements Runnable, ICraftingJob */ public boolean simulateFor(int milli) { - time = milli; + this.time = milli; - synchronized (monitor) + synchronized (this.monitor) { - if ( isDone() ) + if ( this.isDone() ) return false; - watch.reset(); - watch.start(); - running = true; + this.watch.reset(); + this.watch.start(); + this.running = true; - log( "main thread is now going to sleep" ); + this.log( "main thread is now going to sleep" ); - monitor.notify(); + this.monitor.notify(); - while (running) + while (this.running) { try { - monitor.wait(); + this.monitor.wait(); } catch (InterruptedException ignored) { } } - log( "main thread is now active" ); + this.log( "main thread is now active" ); } return true; @@ -323,29 +323,29 @@ public class CraftingJob implements Runnable, ICraftingJob public void handlePausing() throws InterruptedException { - if ( incTime++ > 100 ) + if ( this.incTime++ > 100 ) { - incTime = 0; + this.incTime = 0; - synchronized (monitor) + synchronized (this.monitor) { - if ( watch.elapsed( TimeUnit.MICROSECONDS ) > time ) + if ( this.watch.elapsed( TimeUnit.MICROSECONDS ) > this.time ) { - running = false; - watch.stop(); - monitor.notify(); + this.running = false; + this.watch.stop(); + this.monitor.notify(); } - if ( !running ) + if ( !this.running ) { - log( "crafting job will now sleep" ); + this.log( "crafting job will now sleep" ); - while (!running) + while (!this.running) { - monitor.wait(); + this.monitor.wait(); } - log( "crafting job now active" ); + this.log( "crafting job now active" ); } } @@ -361,14 +361,14 @@ public class CraftingJob implements Runnable, ICraftingJob public void addBytes(long crafts) { - bytes += crafts; + this.bytes += crafts; } @Override public void populatePlan(IItemList plan) { - if ( tree != null ) - tree.getPlan( plan ); + if ( this.tree != null ) + this.tree.getPlan( plan ); } } diff --git a/src/main/java/appeng/crafting/CraftingLink.java b/src/main/java/appeng/crafting/CraftingLink.java index e898057d3..bc8038a1b 100644 --- a/src/main/java/appeng/crafting/CraftingLink.java +++ b/src/main/java/appeng/crafting/CraftingLink.java @@ -40,98 +40,98 @@ public class CraftingLink implements ICraftingLink final boolean standalone; public CraftingLink(NBTTagCompound data, ICraftingRequester req) { - CraftID = data.getString( "CraftID" ); - canceled = data.getBoolean( "canceled" ); - done = data.getBoolean( "done" ); - standalone = data.getBoolean( "standalone" ); + this.CraftID = data.getString( "CraftID" ); + this.canceled = data.getBoolean( "canceled" ); + this.done = data.getBoolean( "done" ); + this.standalone = data.getBoolean( "standalone" ); if ( !data.hasKey( "req" ) || !data.getBoolean( "req" ) ) throw new RuntimeException( "Invalid Crafting Link for Object" ); this.req = req; - cpu = null; + this.cpu = null; } public CraftingLink(NBTTagCompound data, ICraftingCPU cpu) { - CraftID = data.getString( "CraftID" ); - canceled = data.getBoolean( "canceled" ); - done = data.getBoolean( "done" ); - standalone = data.getBoolean( "standalone" ); + this.CraftID = data.getString( "CraftID" ); + this.canceled = data.getBoolean( "canceled" ); + this.done = data.getBoolean( "done" ); + this.standalone = data.getBoolean( "standalone" ); if ( !data.hasKey( "req" ) || data.getBoolean( "req" ) ) throw new RuntimeException( "Invalid Crafting Link for Object" ); this.cpu = cpu; - req = null; + this.req = null; } @Override public boolean isCanceled() { - if ( canceled ) + if ( this.canceled ) return true; - if ( done ) + if ( this.done ) return false; - if ( tie == null ) + if ( this.tie == null ) return false; - return tie.isCanceled(); + return this.tie.isCanceled(); } @Override public boolean isDone() { - if ( done ) + if ( this.done ) return true; - if ( canceled ) + if ( this.canceled ) return false; - if ( tie == null ) + if ( this.tie == null ) return false; - return tie.isDone(); + return this.tie.isDone(); } @Override public void cancel() { - if ( done ) + if ( this.done ) return; - canceled = true; + this.canceled = true; - if ( tie != null ) - tie.cancel(); + if ( this.tie != null ) + this.tie.cancel(); - tie = null; + this.tie = null; } @Override public void writeToNBT(NBTTagCompound tag) { - tag.setString( "CraftID", CraftID ); - tag.setBoolean( "canceled", canceled ); - tag.setBoolean( "done", done ); - tag.setBoolean( "standalone", standalone ); - tag.setBoolean( "req", req != null ); + tag.setString( "CraftID", this.CraftID ); + tag.setBoolean( "canceled", this.canceled ); + tag.setBoolean( "done", this.done ); + tag.setBoolean( "standalone", this.standalone ); + tag.setBoolean( "req", this.req != null ); } public void setNexus(CraftingLinkNexus n) { - if ( tie != null ) - tie.remove( this ); + if ( this.tie != null ) + this.tie.remove( this ); - if ( canceled && n != null ) + if ( this.canceled && n != null ) { n.cancel(); - tie = null; + this.tie = null; return; } - tie = n; + this.tie = n; if ( n != null ) n.add( this ); @@ -140,26 +140,26 @@ public class CraftingLink implements ICraftingLink @Override public String getCraftingID() { - return CraftID; + return this.CraftID; } @Override public boolean isStandalone() { - return standalone; + return this.standalone; } public IAEItemStack injectItems(IAEItemStack input, Actionable mode) { - if ( tie == null || tie.req == null || tie.req.req == null ) + if ( this.tie == null || this.tie.req == null || this.tie.req.req == null ) return input; - return tie.req.req.injectCraftedItems( tie.req, input, mode ); + return this.tie.req.req.injectCraftedItems( this.tie.req, input, mode ); } public void markDone() { - if ( tie != null ) - tie.markDone(); + if ( this.tie != null ) + this.tie.markDone(); } } diff --git a/src/main/java/appeng/crafting/CraftingLinkNexus.java b/src/main/java/appeng/crafting/CraftingLinkNexus.java index 8ebd0d154..defd0c2cf 100644 --- a/src/main/java/appeng/crafting/CraftingLinkNexus.java +++ b/src/main/java/appeng/crafting/CraftingLinkNexus.java @@ -41,25 +41,25 @@ public class CraftingLinkNexus public boolean isDead(IGrid g, CraftingGridCache craftingGridCache) { - if ( isCanceled() || isDone() ) + if ( this.isCanceled() || this.isDone() ) return true; - if ( req == null || cpu == null ) - tickOfDeath++; + if ( this.req == null || this.cpu == null ) + this.tickOfDeath++; else { - boolean hasCpu = craftingGridCache.hasCpu( cpu.cpu ); - boolean hasMachine = req.req.getActionableNode().getGrid() == g; + boolean hasCpu = craftingGridCache.hasCpu( this.cpu.cpu ); + boolean hasMachine = this.req.req.getActionableNode().getGrid() == g; if ( hasCpu && hasMachine ) - tickOfDeath = 0; + this.tickOfDeath = 0; else - tickOfDeath += 60; + this.tickOfDeath += 60; } - if ( tickOfDeath > 60 ) + if ( this.tickOfDeath > 60 ) { - cancel(); + this.cancel(); return true; } @@ -68,72 +68,72 @@ public class CraftingLinkNexus public void remove(CraftingLink craftingLink) { - if ( req == craftingLink ) - req = null; - else if ( cpu == craftingLink ) - cpu = null; + if ( this.req == craftingLink ) + this.req = null; + else if ( this.cpu == craftingLink ) + this.cpu = null; } public void add(CraftingLink craftingLink) { if ( craftingLink.cpu != null ) - cpu = craftingLink; + this.cpu = craftingLink; else if ( craftingLink.req != null ) - req = craftingLink; + this.req = craftingLink; } public boolean isCanceled() { - return canceled; + return this.canceled; } public boolean isDone() { - return done; + return this.done; } public void markDone() { - done = true; + this.done = true; - if ( req != null ) + if ( this.req != null ) { - req.done = true; - if ( req.req != null ) - req.req.jobStateChange( req ); + this.req.done = true; + if ( this.req.req != null ) + this.req.req.jobStateChange( this.req ); } - if ( cpu != null ) - cpu.done = true; + if ( this.cpu != null ) + this.cpu.done = true; } public void cancel() { - canceled = true; + this.canceled = true; - if ( req != null ) + if ( this.req != null ) { - req.canceled = true; - if ( req.req != null ) - req.req.jobStateChange( req ); + this.req.canceled = true; + if ( this.req.req != null ) + this.req.req.jobStateChange( this.req ); } - if ( cpu != null ) - cpu.canceled = true; + if ( this.cpu != null ) + this.cpu.canceled = true; } public boolean isMachine(IGridHost machine) { - return req == machine; + return this.req == machine; } public void removeNode() { - if ( req != null ) - req.setNexus( null ); + if ( this.req != null ) + this.req.setNexus( null ); - req = null; - tickOfDeath = 0; + this.req = null; + this.tickOfDeath = 0; } } diff --git a/src/main/java/appeng/crafting/CraftingTreeNode.java b/src/main/java/appeng/crafting/CraftingTreeNode.java index 4ba412502..f1fc10cc0 100644 --- a/src/main/java/appeng/crafting/CraftingTreeNode.java +++ b/src/main/java/appeng/crafting/CraftingTreeNode.java @@ -66,29 +66,29 @@ public class CraftingTreeNode public CraftingTreeNode(ICraftingGrid cc, CraftingJob job, IAEItemStack wat, CraftingTreeProcess par, int slot, int depth) { - what = wat; - parent = par; + this.what = wat; + this.parent = par; this.slot = slot; this.world = job.getWorld(); this.job = job; - sim = false; + this.sim = false; - canEmit = cc.canEmitFor( what ); - if ( canEmit ) + this.canEmit = cc.canEmitFor( this.what ); + if ( this.canEmit ) return; // if you can emit for something, you can't make it with patterns. - for (ICraftingPatternDetails details : cc.getCraftingFor( what, parent == null ? null : parent.details, slot, world ))// in + for (ICraftingPatternDetails details : cc.getCraftingFor( this.what, this.parent == null ? null : this.parent.details, slot, this.world ))// in // order. { - if ( parent == null || parent.notRecursive( details ) ) - nodes.add( new CraftingTreeProcess( cc, job, details, this, depth + 1 ) ); + if ( this.parent == null || this.parent.notRecursive( details ) ) + this.nodes.add( new CraftingTreeProcess( cc, job, details, this, depth + 1 ) ); } } public IAEItemStack getStack(long size) { - IAEItemStack is = what.copy(); + IAEItemStack is = this.what.copy(); is.setStackSize( size ); return is; } @@ -97,32 +97,32 @@ public class CraftingTreeNode { IAEItemStack[] o = details.getCondensedOutputs(); for (IAEItemStack i : o) - if ( i.equals( what ) ) + if ( i.equals( this.what ) ) return false; o = details.getCondensedInputs(); for (IAEItemStack i : o) - if ( i.equals( what ) ) + if ( i.equals( this.what ) ) return false; - if ( parent == null ) + if ( this.parent == null ) return true; - return parent.notRecursive( details ); + return this.parent.notRecursive( details ); } public IAEItemStack request(MECraftingInventory inv, long l, BaseActionSource src) throws CraftBranchFailure, InterruptedException { - job.handlePausing(); + this.job.handlePausing(); List thingsUsed = new LinkedList(); - what.setStackSize( l ); - if ( slot >= 0 && parent != null && parent.details.isCraftable() ) + this.what.setStackSize( l ); + if ( this.slot >= 0 && this.parent != null && this.parent.details.isCraftable() ) { - for (IAEItemStack fuzz : inv.getItemList().findFuzzy( what, FuzzyMode.IGNORE_ALL )) + for (IAEItemStack fuzz : inv.getItemList().findFuzzy( this.what, FuzzyMode.IGNORE_ALL )) { - if ( parent.details.isValidItemForSlot( slot, fuzz.getItemStack(), world ) ) + if ( this.parent.details.isValidItemForSlot( this.slot, fuzz.getItemStack(), this.world ) ) { fuzz = fuzz.copy(); fuzz.setStackSize( l ); @@ -130,17 +130,17 @@ public class CraftingTreeNode if ( available != null ) { - if ( !exhausted ) + if ( !this.exhausted ) { - IAEItemStack is = job.checkUse( available ); + IAEItemStack is = this.job.checkUse( available ); if ( is != null ) { thingsUsed.add( is.copy() ); - used.add( is ); + this.used.add( is ); } } - bytes += available.getStackSize(); + this.bytes += available.getStackSize(); l -= available.getStackSize(); if ( l == 0 ) @@ -151,21 +151,21 @@ public class CraftingTreeNode } else { - IAEItemStack available = inv.extractItems( what, Actionable.MODULATE, src ); + IAEItemStack available = inv.extractItems( this.what, Actionable.MODULATE, src ); if ( available != null ) { - if ( !exhausted ) + if ( !this.exhausted ) { - IAEItemStack is = job.checkUse( available ); + IAEItemStack is = this.job.checkUse( available ); if ( is != null ) { thingsUsed.add( is.copy() ); - used.add( is ); + this.used.add( is ); } } - bytes += available.getStackSize(); + this.bytes += available.getStackSize(); l -= available.getStackSize(); if ( l == 0 ) @@ -173,26 +173,26 @@ public class CraftingTreeNode } } - if ( canEmit ) + if ( this.canEmit ) { - IAEItemStack wat = what.copy(); + IAEItemStack wat = this.what.copy(); wat.setStackSize( l ); - howManyEmitted = wat.getStackSize(); - bytes += wat.getStackSize(); + this.howManyEmitted = wat.getStackSize(); + this.bytes += wat.getStackSize(); return wat; } - exhausted = true; + this.exhausted = true; - if ( nodes.size() == 1 ) + if ( this.nodes.size() == 1 ) { - CraftingTreeProcess pro = nodes.get( 0 ); + CraftingTreeProcess pro = this.nodes.get( 0 ); while (pro.possible && l > 0) { - IAEItemStack madeWhat = pro.getAmountCrafted( what ); + IAEItemStack madeWhat = pro.getAmountCrafted( this.what ); pro.request( inv, pro.getTimes( l, madeWhat.getStackSize() ), src ); @@ -201,7 +201,7 @@ public class CraftingTreeNode if ( available != null ) { - bytes += available.getStackSize(); + this.bytes += available.getStackSize(); l -= available.getStackSize(); if ( l <= 0 ) @@ -211,9 +211,9 @@ public class CraftingTreeNode pro.possible = false; // ;P } } - else if ( nodes.size() > 1 ) + else if ( this.nodes.size() > 1 ) { - for (CraftingTreeProcess pro : nodes) + for (CraftingTreeProcess pro : this.nodes) { try { @@ -222,15 +222,15 @@ public class CraftingTreeNode MECraftingInventory subInv = new MECraftingInventory( inv, true, true, true ); pro.request( subInv, 1, src ); - what.setStackSize( l ); - IAEItemStack available = subInv.extractItems( what, Actionable.MODULATE, src ); + this.what.setStackSize( l ); + IAEItemStack available = subInv.extractItems( this.what, Actionable.MODULATE, src ); if ( available != null ) { if ( !subInv.commit( src ) ) - throw new CraftBranchFailure( what, l ); + throw new CraftBranchFailure( this.what, l ); - bytes += available.getStackSize(); + this.bytes += available.getStackSize(); l -= available.getStackSize(); if ( l <= 0 ) @@ -247,52 +247,52 @@ public class CraftingTreeNode } } - if ( sim ) + if ( this.sim ) { - missing += l; - bytes += l; - IAEItemStack rv = what.copy(); + this.missing += l; + this.bytes += l; + IAEItemStack rv = this.what.copy(); rv.setStackSize( l ); return rv; } for (IAEItemStack o : thingsUsed) { - job.refund( o.copy() ); + this.job.refund( o.copy() ); o.setStackSize( -o.getStackSize() ); - used.add( o ); + this.used.add( o ); } - throw new CraftBranchFailure( what, l ); + throw new CraftBranchFailure( this.what, l ); } public void dive(CraftingJob job) { - if ( missing > 0 ) - job.addMissing( getStack( missing ) ); + if ( this.missing > 0 ) + job.addMissing( this.getStack( this.missing ) ); // missing = 0; - job.addBytes( 8 + bytes ); + job.addBytes( 8 + this.bytes ); - for (CraftingTreeProcess pro : nodes) + for (CraftingTreeProcess pro : this.nodes) pro.dive( job ); } public void setSimulate() { - sim = true; - missing = 0; - bytes = 0; - used.resetStatus(); - exhausted = false; + this.sim = true; + this.missing = 0; + this.bytes = 0; + this.used.resetStatus(); + this.exhausted = false; - for (CraftingTreeProcess pro : nodes) + for (CraftingTreeProcess pro : this.nodes) pro.setSimulate(); } public void setJob(MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src) throws CraftBranchFailure { - for (IAEItemStack i : used) + for (IAEItemStack i : this.used) { IAEItemStack ex = storage.extractItems( i, Actionable.MODULATE, src ); @@ -302,37 +302,37 @@ public class CraftingTreeNode craftingCPUCluster.addStorage( ex ); } - if ( howManyEmitted > 0 ) + if ( this.howManyEmitted > 0 ) { - IAEItemStack i = what.copy(); - i.setStackSize( howManyEmitted ); + IAEItemStack i = this.what.copy(); + i.setStackSize( this.howManyEmitted ); craftingCPUCluster.addEmitable( i ); } - for (CraftingTreeProcess pro : nodes) + for (CraftingTreeProcess pro : this.nodes) pro.setJob( storage, craftingCPUCluster, src ); } public void getPlan(IItemList plan) { - if ( missing > 0 ) + if ( this.missing > 0 ) { - IAEItemStack o = what.copy(); - o.setStackSize( missing ); + IAEItemStack o = this.what.copy(); + o.setStackSize( this.missing ); plan.add( o ); } - if ( howManyEmitted > 0 ) + if ( this.howManyEmitted > 0 ) { - IAEItemStack i = what.copy(); - i.setCountRequestable( howManyEmitted ); + IAEItemStack i = this.what.copy(); + i.setCountRequestable( this.howManyEmitted ); plan.addRequestable( i ); } - for (IAEItemStack i : used) + for (IAEItemStack i : this.used) plan.add( i.copy() ); - for (CraftingTreeProcess pro : nodes) + for (CraftingTreeProcess pro : this.nodes) pro.getPlan( plan ); } } diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index 017025db8..5ce87f248 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -61,7 +61,7 @@ public class CraftingTreeProcess public boolean possible = true; public CraftingTreeProcess( ICraftingGrid cc, CraftingJob job, ICraftingPatternDetails details, CraftingTreeNode craftingTreeNode, int depth ) { - parent = craftingTreeNode; + this.parent = craftingTreeNode; this.details = details; this.job = job; this.depth = depth; @@ -82,7 +82,7 @@ public class CraftingTreeProcess { ItemStack g = ic.getStackInSlot( x ); if ( g != null && g.stackSize > 1 ) - fullSimulation = true; + this.fullSimulation = true; } for ( IAEItemStack part : details.getCondensedInputs() ) @@ -97,21 +97,21 @@ public class CraftingTreeProcess } if ( isAnInput ) - limitQty = true; + this.limitQty = true; if ( g.getItem().hasContainerItem( g ) ) - limitQty = containerItems = true; + this.limitQty = this.containerItems = true; } boolean complicated = false; - if ( containerItems || complicated ) + if ( this.containerItems || complicated ) { for (int x = 0; x < list.length; x++) { IAEItemStack part = list[x]; if ( part != null ) - nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); + this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); } } else @@ -125,7 +125,7 @@ public class CraftingTreeProcess if ( part != null && part.equals( comparePart ) ) { // use the first slot... - nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); + this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); break; } } @@ -146,31 +146,31 @@ public class CraftingTreeProcess } if ( isAnInput ) - limitQty = true; + this.limitQty = true; } for (IAEItemStack part : details.getCondensedInputs()) { - nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, -1, depth + 1 ), part.getStackSize() ); + this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, -1, depth + 1 ), part.getStackSize() ); } } } public boolean notRecursive(ICraftingPatternDetails details) { - return parent == null || parent.notRecursive( details ); + return this.parent == null || this.parent.notRecursive( details ); } long getTimes(long remaining, long stackSize) { - if ( limitQty || fullSimulation ) + if ( this.limitQty || this.fullSimulation ) return 1; return (remaining / stackSize) + (remaining % stackSize != 0 ? 1 : 0); } IAEItemStack getAmountCrafted(IAEItemStack what2) { - for (IAEItemStack is : details.getCondensedOutputs()) + for (IAEItemStack is : this.details.getCondensedOutputs()) { if ( is.equals( what2 ) ) { @@ -181,7 +181,7 @@ public class CraftingTreeProcess } // more fuzzy! - for (IAEItemStack is : details.getCondensedOutputs()) + for (IAEItemStack is : this.details.getCondensedOutputs()) { if ( is.getItem() == what2.getItem() && (is.getItem().isDamageable() || is.getItemDamage() == what2.getItemDamage()) ) { @@ -196,13 +196,13 @@ public class CraftingTreeProcess public void request(MECraftingInventory inv, long i, BaseActionSource src) throws CraftBranchFailure, InterruptedException { - job.handlePausing(); + this.job.handlePausing(); - if ( fullSimulation ) + if ( this.fullSimulation ) { InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - for (Entry entry : nodes.entrySet()) + for (Entry entry : this.nodes.entrySet()) { IAEItemStack item = entry.getKey().getStack( entry.getValue() ); IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src ); @@ -210,7 +210,7 @@ public class CraftingTreeProcess ic.setInventorySlotContents( entry.getKey().slot, stack.getItemStack() ); } - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) world ), details.getOutput( ic, world ), ic ); + FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.world ), this.details.getOutput( ic, this.world ), ic ); for (int x = 0; x < ic.getSizeInventory(); x++) { @@ -220,7 +220,7 @@ public class CraftingTreeProcess IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if ( o != null ) { - bytes++; + this.bytes++; inv.injectItems( o, Actionable.MODULATE, src ); } } @@ -228,18 +228,18 @@ public class CraftingTreeProcess else { // request and remove inputs... - for (Entry entry : nodes.entrySet()) + for (Entry entry : this.nodes.entrySet()) { IAEItemStack item = entry.getKey().getStack( entry.getValue() ); IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src ); - if ( containerItems ) + if ( this.containerItems ) { ItemStack is = Platform.getContainerItem( stack.getItemStack() ); IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if ( o != null ) { - bytes++; + this.bytes++; inv.injectItems( o, Actionable.MODULATE, src ); } } @@ -249,52 +249,52 @@ public class CraftingTreeProcess // assume its possible. // add crafting results.. - for (IAEItemStack out : details.getCondensedOutputs()) + for (IAEItemStack out : this.details.getCondensedOutputs()) { IAEItemStack o = out.copy(); o.setStackSize( o.getStackSize() * i ); inv.injectItems( o, Actionable.MODULATE, src ); } - crafts += i; + this.crafts += i; } public void dive(CraftingJob job) { - job.addTask( getAmountCrafted( parent.getStack( 1 ) ), crafts, details, depth ); - for (CraftingTreeNode pro : nodes.keySet()) + job.addTask( this.getAmountCrafted( this.parent.getStack( 1 ) ), this.crafts, this.details, this.depth ); + for (CraftingTreeNode pro : this.nodes.keySet()) pro.dive( job ); - job.addBytes( 8 + crafts + bytes ); + job.addBytes( 8 + this.crafts + this.bytes ); } public void setSimulate() { - crafts = 0; - bytes = 0; + this.crafts = 0; + this.bytes = 0; - for (CraftingTreeNode pro : nodes.keySet()) + for (CraftingTreeNode pro : this.nodes.keySet()) pro.setSimulate(); } public void setJob(MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src) throws CraftBranchFailure { - craftingCPUCluster.addCrafting( details, crafts ); + craftingCPUCluster.addCrafting( this.details, this.crafts ); - for (CraftingTreeNode pro : nodes.keySet()) + for (CraftingTreeNode pro : this.nodes.keySet()) pro.setJob( storage, craftingCPUCluster, src ); } public void getPlan(IItemList plan) { - for (IAEItemStack i : details.getOutputs()) + for (IAEItemStack i : this.details.getOutputs()) { i = i.copy(); - i.setCountRequestable( i.getStackSize() * crafts ); + i.setCountRequestable( i.getStackSize() * this.crafts ); plan.addRequestable( i ); } - for (CraftingTreeNode pro : nodes.keySet()) + for (CraftingTreeNode pro : this.nodes.keySet()) pro.getPlan( plan ); } } diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 2658a421f..517568c62 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -41,27 +41,27 @@ public class CraftingWatcher implements ICraftingWatcher IAEStack myLast; public ItemWatcherIterator(CraftingWatcher parent, Iterator i) { - watcher = parent; - interestIterator = i; + this.watcher = parent; + this.interestIterator = i; } @Override public boolean hasNext() { - return interestIterator.hasNext(); + return this.interestIterator.hasNext(); } @Override public IAEStack next() { - return myLast = interestIterator.next(); + return this.myLast = this.interestIterator.next(); } @Override public void remove() { - gsc.interestManager.remove( myLast, watcher ); - interestIterator.remove(); + CraftingWatcher.this.gsc.interestManager.remove( this.myLast, this.watcher ); + this.interestIterator.remove(); } } @@ -71,22 +71,22 @@ public class CraftingWatcher implements ICraftingWatcher final HashSet myInterests = new HashSet(); public CraftingWatcher(CraftingGridCache cache, ICraftingWatcherHost host) { - gsc = cache; + this.gsc = cache; this.host = host; } public ICraftingWatcherHost getHost() { - return host; + return this.host; } @Override public boolean add(IAEStack e) { - if ( myInterests.contains( e ) ) + if ( this.myInterests.contains( e ) ) return false; - return myInterests.add( e.copy() ) && gsc.interestManager.put( e, this ); + return this.myInterests.add( e.copy() ) && this.gsc.interestManager.put( e, this ); } @Override @@ -95,7 +95,7 @@ public class CraftingWatcher implements ICraftingWatcher boolean didChange = false; for (IAEStack o : c) - didChange = add( o ) || didChange; + didChange = this.add( o ) || didChange; return didChange; } @@ -103,10 +103,10 @@ public class CraftingWatcher implements ICraftingWatcher @Override public void clear() { - Iterator i = myInterests.iterator(); + Iterator i = this.myInterests.iterator(); while (i.hasNext()) { - gsc.interestManager.remove( i.next(), this ); + this.gsc.interestManager.remove( i.next(), this ); i.remove(); } } @@ -114,31 +114,31 @@ public class CraftingWatcher implements ICraftingWatcher @Override public boolean contains(Object o) { - return myInterests.contains( o ); + return this.myInterests.contains( o ); } @Override public boolean containsAll(Collection c) { - return myInterests.containsAll( c ); + return this.myInterests.containsAll( c ); } @Override public boolean isEmpty() { - return myInterests.isEmpty(); + return this.myInterests.isEmpty(); } @Override public Iterator iterator() { - return new ItemWatcherIterator( this, myInterests.iterator() ); + return new ItemWatcherIterator( this, this.myInterests.iterator() ); } @Override public boolean remove(Object o) { - return myInterests.remove( o ) && gsc.interestManager.remove( (IAEStack) o, this ); + return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this ); } @Override @@ -146,7 +146,7 @@ public class CraftingWatcher implements ICraftingWatcher { boolean didSomething = false; for (Object o : c) - didSomething = remove( o ) || didSomething; + didSomething = this.remove( o ) || didSomething; return didSomething; } @@ -154,7 +154,7 @@ public class CraftingWatcher implements ICraftingWatcher public boolean retainAll(Collection c) { boolean changed = false; - Iterator i = iterator(); + Iterator i = this.iterator(); while (i.hasNext()) { @@ -171,19 +171,19 @@ public class CraftingWatcher implements ICraftingWatcher @Override public int size() { - return myInterests.size(); + return this.myInterests.size(); } @Override public Object[] toArray() { - return myInterests.toArray(); + return this.myInterests.toArray(); } @Override public T[] toArray(T[] a) { - return myInterests.toArray( a ); + return this.myInterests.toArray( a ); } } diff --git a/src/main/java/appeng/crafting/MECraftingInventory.java b/src/main/java/appeng/crafting/MECraftingInventory.java index 8ca2c2992..0d7cb059e 100644 --- a/src/main/java/appeng/crafting/MECraftingInventory.java +++ b/src/main/java/appeng/crafting/MECraftingInventory.java @@ -46,15 +46,15 @@ public class MECraftingInventory implements IMEInventory public MECraftingInventory() { - localCache = AEApi.instance().storage().createItemList(); - extractedCache = null; - injectedCache = null; - missingCache = null; + this.localCache = AEApi.instance().storage().createItemList(); + this.extractedCache = null; + this.injectedCache = null; + this.missingCache = null; this.logExtracted = false; this.logInjections = false; this.logMissing = false; - target = null; - par = null; + this.target = null; + this.par = null; } public MECraftingInventory(MECraftingInventory parent) @@ -64,24 +64,24 @@ public class MECraftingInventory implements IMEInventory this.logInjections = parent.logInjections; this.logMissing = parent.logMissing; - if ( logMissing ) - missingCache = AEApi.instance().storage().createItemList(); + if ( this.logMissing ) + this.missingCache = AEApi.instance().storage().createItemList(); else - missingCache = null; + this.missingCache = null; - if ( logExtracted ) - extractedCache = AEApi.instance().storage().createItemList(); + if ( this.logExtracted ) + this.extractedCache = AEApi.instance().storage().createItemList(); else - extractedCache = null; + this.extractedCache = null; - if ( logInjections ) - injectedCache = AEApi.instance().storage().createItemList(); + if ( this.logInjections ) + this.injectedCache = AEApi.instance().storage().createItemList(); else - injectedCache = null; + this.injectedCache = null; - localCache = target.getAvailableItems( AEApi.instance().storage().createItemList() ); + this.localCache = this.target.getAvailableItems( AEApi.instance().storage().createItemList() ); - par = parent; + this.par = parent; } public MECraftingInventory(IMEMonitor target, BaseActionSource src, boolean logExtracted, boolean logInjections, boolean logMissing) @@ -92,25 +92,25 @@ public class MECraftingInventory implements IMEInventory this.logMissing = logMissing; if ( logMissing ) - missingCache = AEApi.instance().storage().createItemList(); + this.missingCache = AEApi.instance().storage().createItemList(); else - missingCache = null; + this.missingCache = null; if ( logExtracted ) - extractedCache = AEApi.instance().storage().createItemList(); + this.extractedCache = AEApi.instance().storage().createItemList(); else - extractedCache = null; + this.extractedCache = null; if ( logInjections ) - injectedCache = AEApi.instance().storage().createItemList(); + this.injectedCache = AEApi.instance().storage().createItemList(); else - injectedCache = null; + this.injectedCache = null; - localCache = AEApi.instance().storage().createItemList(); + this.localCache = AEApi.instance().storage().createItemList(); for (IAEItemStack is : target.getStorageList()) - localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) ); + this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) ); - par = null; + this.par = null; } public MECraftingInventory(IMEInventory target, boolean logExtracted, boolean logInjections, boolean logMissing) @@ -121,22 +121,22 @@ public class MECraftingInventory implements IMEInventory this.logMissing = logMissing; if ( logMissing ) - missingCache = AEApi.instance().storage().createItemList(); + this.missingCache = AEApi.instance().storage().createItemList(); else - missingCache = null; + this.missingCache = null; if ( logExtracted ) - extractedCache = AEApi.instance().storage().createItemList(); + this.extractedCache = AEApi.instance().storage().createItemList(); else - extractedCache = null; + this.extractedCache = null; if ( logInjections ) - injectedCache = AEApi.instance().storage().createItemList(); + this.injectedCache = AEApi.instance().storage().createItemList(); else - injectedCache = null; + this.injectedCache = null; - localCache = target.getAvailableItems( AEApi.instance().storage().createItemList() ); - par = null; + this.localCache = target.getAvailableItems( AEApi.instance().storage().createItemList() ); + this.par = null; } @Override @@ -147,9 +147,9 @@ public class MECraftingInventory implements IMEInventory if ( mode == Actionable.MODULATE ) { - if ( logInjections ) - injectedCache.add( input ); - localCache.add( input ); + if ( this.logInjections ) + this.injectedCache.add( input ); + this.localCache.add( input ); } return null; @@ -161,7 +161,7 @@ public class MECraftingInventory implements IMEInventory if ( request == null ) return null; - IAEItemStack list = localCache.findPrecise( request ); + IAEItemStack list = this.localCache.findPrecise( request ); if ( list == null || list.getStackSize() == 0 ) return null; @@ -170,8 +170,8 @@ public class MECraftingInventory implements IMEInventory if ( mode == Actionable.MODULATE ) { list.decStackSize( request.getStackSize() ); - if ( logExtracted ) - extractedCache.add( request ); + if ( this.logExtracted ) + this.extractedCache.add( request ); } return request; @@ -183,8 +183,8 @@ public class MECraftingInventory implements IMEInventory if ( mode == Actionable.MODULATE ) { list.reset(); - if ( logExtracted ) - extractedCache.add( ret ); + if ( this.logExtracted ) + this.extractedCache.add( ret ); } return ret; @@ -193,7 +193,7 @@ public class MECraftingInventory implements IMEInventory @Override public IItemList getAvailableItems(IItemList out) { - for (IAEItemStack is : localCache) + for (IAEItemStack is : this.localCache) out.add( is ); return out; @@ -201,7 +201,7 @@ public class MECraftingInventory implements IMEInventory public IItemList getItemList() { - return localCache; + return this.localCache; } @Override @@ -216,12 +216,12 @@ public class MECraftingInventory implements IMEInventory IItemList pulled = AEApi.instance().storage().createItemList(); boolean failed = false; - if ( logInjections ) + if ( this.logInjections ) { - for (IAEItemStack inject : injectedCache) + for (IAEItemStack inject : this.injectedCache) { IAEItemStack result = null; - added.add( result = target.injectItems( inject, Actionable.MODULATE, src ) ); + added.add( result = this.target.injectItems( inject, Actionable.MODULATE, src ) ); if ( result != null ) { @@ -234,17 +234,17 @@ public class MECraftingInventory implements IMEInventory if ( failed ) { for (IAEItemStack is : added) - target.extractItems( is, Actionable.MODULATE, src ); + this.target.extractItems( is, Actionable.MODULATE, src ); return false; } - if ( logExtracted ) + if ( this.logExtracted ) { - for (IAEItemStack extra : extractedCache) + for (IAEItemStack extra : this.extractedCache) { IAEItemStack result = null; - pulled.add( result = target.extractItems( extra, Actionable.MODULATE, src ) ); + pulled.add( result = this.target.extractItems( extra, Actionable.MODULATE, src ) ); if ( result == null || result.getStackSize() != extra.getStackSize() ) { @@ -257,18 +257,18 @@ public class MECraftingInventory implements IMEInventory if ( failed ) { for (IAEItemStack is : added) - target.extractItems( is, Actionable.MODULATE, src ); + this.target.extractItems( is, Actionable.MODULATE, src ); for (IAEItemStack is : pulled) - target.injectItems( is, Actionable.MODULATE, src ); + this.target.injectItems( is, Actionable.MODULATE, src ); return false; } - if ( logMissing && par != null ) + if ( this.logMissing && this.par != null ) { - for (IAEItemStack extra : missingCache) - par.addMissing( extra ); + for (IAEItemStack extra : this.missingCache) + this.par.addMissing( extra ); } return true; @@ -276,12 +276,12 @@ public class MECraftingInventory implements IMEInventory public void addMissing(IAEItemStack extra) { - missingCache.add( extra ); + this.missingCache.add( extra ); } public void ignore(IAEItemStack what) { - IAEItemStack list = localCache.findPrecise( what ); + IAEItemStack list = this.localCache.findPrecise( what ); if ( list != null ) list.setStackSize( 0 ); } diff --git a/src/main/java/appeng/debug/BlockChunkloader.java b/src/main/java/appeng/debug/BlockChunkloader.java index 6c0548b47..98847c522 100644 --- a/src/main/java/appeng/debug/BlockChunkloader.java +++ b/src/main/java/appeng/debug/BlockChunkloader.java @@ -36,8 +36,8 @@ public class BlockChunkloader extends AEBaseBlock implements LoadingCallback public BlockChunkloader() { super( BlockChunkloader.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); - setTileEntity( TileChunkLoader.class ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setTileEntity( TileChunkLoader.class ); ForgeChunkManager.setForcedChunkLoadingCallback( AppEng.instance, this ); } @@ -50,7 +50,7 @@ public class BlockChunkloader extends AEBaseBlock implements LoadingCallback @Override public void registerBlockIcons(IIconRegister iconRegistry) { - registerNoIcons(); + this.registerNoIcons(); } } diff --git a/src/main/java/appeng/debug/BlockCubeGenerator.java b/src/main/java/appeng/debug/BlockCubeGenerator.java index 0169e9423..c329e3112 100644 --- a/src/main/java/appeng/debug/BlockCubeGenerator.java +++ b/src/main/java/appeng/debug/BlockCubeGenerator.java @@ -32,15 +32,15 @@ public class BlockCubeGenerator extends AEBaseBlock public BlockCubeGenerator() { super( BlockCubeGenerator.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); - setTileEntity( TileCubeGenerator.class ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setTileEntity( TileCubeGenerator.class ); } @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - TileCubeGenerator tcg = getTileEntity(w, x, y, z); + TileCubeGenerator tcg = this.getTileEntity(w, x, y, z); if ( tcg != null ) tcg.click( player ); @@ -50,7 +50,7 @@ public class BlockCubeGenerator extends AEBaseBlock @Override public void registerBlockIcons(IIconRegister iconRegistry) { - registerNoIcons(); + this.registerNoIcons(); } } diff --git a/src/main/java/appeng/debug/BlockItemGen.java b/src/main/java/appeng/debug/BlockItemGen.java index ded39c3d6..a5d7deb7f 100644 --- a/src/main/java/appeng/debug/BlockItemGen.java +++ b/src/main/java/appeng/debug/BlockItemGen.java @@ -30,14 +30,14 @@ public class BlockItemGen extends AEBaseBlock public BlockItemGen() { super( BlockItemGen.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); - setTileEntity( TileItemGen.class ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setTileEntity( TileItemGen.class ); } @Override public void registerBlockIcons(IIconRegister iconRegistry) { - registerNoIcons(); + this.registerNoIcons(); } } diff --git a/src/main/java/appeng/debug/BlockPhantomNode.java b/src/main/java/appeng/debug/BlockPhantomNode.java index 1aed19ca9..d4db6401d 100644 --- a/src/main/java/appeng/debug/BlockPhantomNode.java +++ b/src/main/java/appeng/debug/BlockPhantomNode.java @@ -32,14 +32,14 @@ public class BlockPhantomNode extends AEBaseBlock public BlockPhantomNode() { super( BlockPhantomNode.class, Material.iron ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); - setTileEntity( TilePhantomNode.class ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setTileEntity( TilePhantomNode.class ); } @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - TilePhantomNode tpn = getTileEntity( w, x, y, z ); + TilePhantomNode tpn = this.getTileEntity( w, x, y, z ); tpn.BOOM(); return true; } @@ -47,7 +47,7 @@ public class BlockPhantomNode extends AEBaseBlock @Override public void registerBlockIcons(IIconRegister iconRegistry) { - registerNoIcons(); + this.registerNoIcons(); } } diff --git a/src/main/java/appeng/debug/TileChunkLoader.java b/src/main/java/appeng/debug/TileChunkLoader.java index 1f8b282a2..7b706a515 100644 --- a/src/main/java/appeng/debug/TileChunkLoader.java +++ b/src/main/java/appeng/debug/TileChunkLoader.java @@ -44,10 +44,10 @@ public class TileChunkLoader extends AEBaseTile @TileEvent(TileEventType.TICK) public void Tick_TileChunkLoader() { - if ( requestTicket ) + if ( this.requestTicket ) { - requestTicket = false; - initTicket(); + this.requestTicket = false; + this.initTicket(); } } @@ -56,9 +56,9 @@ public class TileChunkLoader extends AEBaseTile if ( Platform.isClient() ) return; - ct = ForgeChunkManager.requestTicket( AppEng.instance, worldObj, Type.NORMAL ); + this.ct = ForgeChunkManager.requestTicket( AppEng.instance, this.worldObj, Type.NORMAL ); - if ( ct == null ) + if ( this.ct == null ) { MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if ( server != null ) @@ -72,8 +72,8 @@ public class TileChunkLoader extends AEBaseTile return; } - AELog.info( "New Ticket " + ct.toString() ); - ForgeChunkManager.forceChunk( ct, new ChunkCoordIntPair( xCoord >> 4, zCoord >> 4 ) ); + AELog.info( "New Ticket " + this.ct.toString() ); + ForgeChunkManager.forceChunk( this.ct, new ChunkCoordIntPair( this.xCoord >> 4, this.zCoord >> 4 ) ); } @Override @@ -82,7 +82,7 @@ public class TileChunkLoader extends AEBaseTile if ( Platform.isClient() ) return; - AELog.info( "Released Ticket " + ct.toString() ); - ForgeChunkManager.releaseTicket( ct ); + AELog.info( "Released Ticket " + this.ct.toString() ); + ForgeChunkManager.releaseTicket( this.ct ); } } diff --git a/src/main/java/appeng/debug/TileCubeGenerator.java b/src/main/java/appeng/debug/TileCubeGenerator.java index abcac626e..eaff4a2c3 100644 --- a/src/main/java/appeng/debug/TileCubeGenerator.java +++ b/src/main/java/appeng/debug/TileCubeGenerator.java @@ -40,39 +40,39 @@ public class TileCubeGenerator extends AEBaseTile @TileEvent(TileEventType.TICK) public void TCG_Tick() { - if ( is != null && Platform.isServer() ) + if ( this.is != null && Platform.isServer() ) { - countdown--; + this.countdown--; - if ( countdown % 20 == 0 ) + if ( this.countdown % 20 == 0 ) { for (EntityPlayer e : CommonHelper.proxy.getPlayers()) { - e.addChatMessage( new ChatComponentText( "Spawning in... " + (countdown / 20) ) ); + e.addChatMessage( new ChatComponentText( "Spawning in... " + (this.countdown / 20) ) ); } } - if ( countdown <= 0 ) - spawn(); + if ( this.countdown <= 0 ) + this.spawn(); } } void spawn() { - worldObj.setBlock( xCoord, yCoord, zCoord, Platform.air, 0, 3 ); + this.worldObj.setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.air, 0, 3 ); - Item i = is.getItem(); + Item i = this.is.getItem(); int side = ForgeDirection.UP.ordinal(); - int half = (int) Math.floor( size / 2 ); + int half = (int) Math.floor( this.size / 2 ); - for (int y = 0; y < size; y++) + for (int y = 0; y < this.size; y++) { for (int x = -half; x < half; x++) { for (int z = -half; z < half; z++) { - i.onItemUse( is.copy(), who, worldObj, x + xCoord, y + yCoord - 1, z + zCoord, side, 0.5f, 0.0f, 0.5f ); + i.onItemUse( this.is.copy(), this.who, this.worldObj, x + this.xCoord, y + this.yCoord - 1, z + this.zCoord, side, 0.5f, 0.0f, 0.5f ); } } } @@ -83,28 +83,28 @@ public class TileCubeGenerator extends AEBaseTile if ( Platform.isServer() ) { ItemStack hand = player.inventory.getCurrentItem(); - who = player; + this.who = player; if ( hand == null ) { - is = null; + this.is = null; if ( player.isSneaking() ) - size--; + this.size--; else - size++; + this.size++; - if ( size < 3 ) - size = 3; - if ( size > 64 ) - size = 64; + if ( this.size < 3 ) + this.size = 3; + if ( this.size > 64 ) + this.size = 64; - player.addChatMessage( new ChatComponentText( "Size: " + size ) ); + player.addChatMessage( new ChatComponentText( "Size: " + this.size ) ); } else { - countdown = 20 * 10; - is = hand; + this.countdown = 20 * 10; + this.is = hand; } } } diff --git a/src/main/java/appeng/debug/TileItemGen.java b/src/main/java/appeng/debug/TileItemGen.java index df6d9dbe0..858061051 100644 --- a/src/main/java/appeng/debug/TileItemGen.java +++ b/src/main/java/appeng/debug/TileItemGen.java @@ -67,7 +67,7 @@ public class TileItemGen extends AEBaseTile implements IInventory @Override public ItemStack getStackInSlot(int i) { - return getRandomItem(); + return this.getRandomItem(); } private ItemStack getRandomItem() diff --git a/src/main/java/appeng/debug/TilePhantomNode.java b/src/main/java/appeng/debug/TilePhantomNode.java index 50110d408..702837014 100644 --- a/src/main/java/appeng/debug/TilePhantomNode.java +++ b/src/main/java/appeng/debug/TilePhantomNode.java @@ -35,26 +35,26 @@ public class TilePhantomNode extends AENetworkTile public void onReady() { super.onReady(); - proxy = createProxy(); - proxy.onReady(); - crashMode = true; + this.proxy = this.createProxy(); + this.proxy.onReady(); + this.crashMode = true; } @Override public IGridNode getGridNode(ForgeDirection dir) { - if ( !crashMode ) + if ( !this.crashMode ) return super.getGridNode( dir ); - return proxy.getNode(); + return this.proxy.getNode(); } public void BOOM() { - if ( proxy != null ) + if ( this.proxy != null ) { - crashMode = true; - proxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); + this.crashMode = true; + this.proxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); } } } diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index 29da61b36..46016c0da 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -52,7 +52,7 @@ public class ToolDebugCard extends AEBaseItem public ToolDebugCard() { super( ToolDebugCard.class ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); } public String timeMeasurement(long nanos) @@ -80,8 +80,8 @@ public class ToolDebugCard extends AEBaseItem totalNodes += g.getNodes().size(); } - outputMsg( player, "Grids: " + grids ); - outputMsg( player, "Total Nodes: " + totalNodes ); + this.outputMsg( player, "Grids: " + grids ); + this.outputMsg( player, "Total Nodes: " + totalNodes ); } else { @@ -94,8 +94,8 @@ public class ToolDebugCard extends AEBaseItem { Grid g = node.getInternalGrid(); IGridNode center = g.getPivot(); - outputMsg( player, "This Node: " + node.toString() ); - outputMsg( player, "Center Node: " + center.toString() ); + this.outputMsg( player, "This Node: " + node.toString() ); + this.outputMsg( player, "Center Node: " + center.toString() ); IPathingGrid pg = g.getCache( IPathingGrid.class ); if ( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE ) @@ -127,12 +127,12 @@ public class ToolDebugCard extends AEBaseItem break; } - outputMsg( player, "Cable Distance: " + length ); + this.outputMsg( player, "Cable Distance: " + length ); } if ( center.getMachine() instanceof PartP2PTunnel ) { - outputMsg( player, "Freq: " + ((PartP2PTunnel) center.getMachine()).freq ); + this.outputMsg( player, "Freq: " + ((PartP2PTunnel) center.getMachine()).freq ); } TickManagerCache tmc = g.getCache( ITickManager.class ); @@ -148,19 +148,19 @@ public class ToolDebugCard extends AEBaseItem if ( nanos < 0 ) { - outputMsg( player, c.getSimpleName() + " - " + o ); + this.outputMsg( player, c.getSimpleName() + " - " + o ); } else { - outputMsg( player, c.getSimpleName() + " - " + o + "; " + timeMeasurement( nanos ) ); + this.outputMsg( player, c.getSimpleName() + " - " + o + "; " + this.timeMeasurement( nanos ) ); } } } else - outputMsg( player, "No Node Available." ); + this.outputMsg( player, "No Node Available." ); } else - outputMsg( player, "Not Networked Block" ); + this.outputMsg( player, "Not Networked Block" ); if ( te instanceof IPartHost ) { @@ -169,12 +169,12 @@ public class ToolDebugCard extends AEBaseItem if ( center != null ) { GridNode n = (GridNode) center.getGridNode(); - outputMsg( player, "Node Channels: " + n.usedChannels() ); + this.outputMsg( player, "Node Channels: " + n.usedChannels() ); for (IGridConnection gc : n.getConnections()) { ForgeDirection fd = gc.getDirection( n ); if ( fd != ForgeDirection.UNKNOWN ) - outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() ); + this.outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() ); } } } @@ -182,7 +182,7 @@ public class ToolDebugCard extends AEBaseItem if ( te instanceof IAEPowerStorage ) { IAEPowerStorage ps = (IAEPowerStorage) te; - outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() ); + this.outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() ); if ( te instanceof IGridHost ) { @@ -190,7 +190,7 @@ public class ToolDebugCard extends AEBaseItem if ( node != null && node.getGrid() != null ) { IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class ); - outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) ); + this.outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) ); } } } diff --git a/src/main/java/appeng/debug/ToolEraser.java b/src/main/java/appeng/debug/ToolEraser.java index 8ba6f4cc1..e70d85357 100644 --- a/src/main/java/appeng/debug/ToolEraser.java +++ b/src/main/java/appeng/debug/ToolEraser.java @@ -39,7 +39,7 @@ public class ToolEraser extends AEBaseItem public ToolEraser() { super( ToolEraser.class ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); } @Override @@ -71,12 +71,12 @@ public class ToolEraser extends AEBaseItem blocks++; world.setBlock( wc.x, wc.y, wc.z, Platform.air ); - check( world, wc.x + 1, wc.y, wc.z, next ); - check( world, wc.x - 1, wc.y, wc.z, next ); - check( world, wc.x, wc.y + 1, wc.z, next ); - check( world, wc.x, wc.y - 1, wc.z, next ); - check( world, wc.x, wc.y, wc.z + 1, next ); - check( world, wc.x, wc.y, wc.z - 1, next ); + this.check( world, wc.x + 1, wc.y, wc.z, next ); + this.check( world, wc.x - 1, wc.y, wc.z, next ); + this.check( world, wc.x, wc.y + 1, wc.z, next ); + this.check( world, wc.x, wc.y - 1, wc.z, next ); + this.check( world, wc.x, wc.y, wc.z + 1, next ); + this.check( world, wc.x, wc.y, wc.z - 1, next ); } } @@ -95,7 +95,7 @@ public class ToolEraser extends AEBaseItem @Override public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = new MissingIcon( this ); + this.itemIcon = new MissingIcon( this ); } } diff --git a/src/main/java/appeng/debug/ToolMeteoritePlacer.java b/src/main/java/appeng/debug/ToolMeteoritePlacer.java index bbea7a333..8a29c9258 100644 --- a/src/main/java/appeng/debug/ToolMeteoritePlacer.java +++ b/src/main/java/appeng/debug/ToolMeteoritePlacer.java @@ -36,7 +36,7 @@ public class ToolMeteoritePlacer extends AEBaseItem public ToolMeteoritePlacer() { super( ToolMeteoritePlacer.class ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); } @Override @@ -57,7 +57,7 @@ public class ToolMeteoritePlacer extends AEBaseItem @Override public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = new MissingIcon( this ); + this.itemIcon = new MissingIcon( this ); } } diff --git a/src/main/java/appeng/debug/ToolReplicatorCard.java b/src/main/java/appeng/debug/ToolReplicatorCard.java index b1c74043d..64696d419 100644 --- a/src/main/java/appeng/debug/ToolReplicatorCard.java +++ b/src/main/java/appeng/debug/ToolReplicatorCard.java @@ -43,7 +43,7 @@ public class ToolReplicatorCard extends AEBaseItem public ToolReplicatorCard() { super( ToolReplicatorCard.class ); - setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); } @Override @@ -65,7 +65,7 @@ public class ToolReplicatorCard extends AEBaseItem stack.setTagCompound( tag ); } else - outputMsg( player, "This is not a Grid Tile." ); + this.outputMsg( player, "This is not a Grid Tile." ); } else { @@ -135,19 +135,19 @@ public class ToolReplicatorCard extends AEBaseItem } else - outputMsg( player, "requires valid spatial pylon setup." ); + this.outputMsg( player, "requires valid spatial pylon setup." ); } else - outputMsg( player, "no grid?" ); + this.outputMsg( player, "no grid?" ); } else - outputMsg( player, "No grid node?" ); + this.outputMsg( player, "No grid node?" ); } else - outputMsg( player, "Src is no longer a grid block?" ); + this.outputMsg( player, "Src is no longer a grid block?" ); } else - outputMsg( player, "No Source Defined" ); + this.outputMsg( player, "No Source Defined" ); } return true; } diff --git a/src/main/java/appeng/entity/EntityChargedQuartz.java b/src/main/java/appeng/entity/EntityChargedQuartz.java index 7bd2a0a8a..6cc4db43f 100644 --- a/src/main/java/appeng/entity/EntityChargedQuartz.java +++ b/src/main/java/appeng/entity/EntityChargedQuartz.java @@ -59,36 +59,36 @@ final public class EntityChargedQuartz extends AEBaseEntityItem if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldFluix ) ) return; - if ( Platform.isClient() && delay++ > 30 && AEConfig.instance.enableEffects ) + if ( Platform.isClient() && this.delay++ > 30 && AEConfig.instance.enableEffects ) { - CommonHelper.proxy.spawnEffect( EffectType.Lightning, worldObj, posX, posY, posZ, null ); - delay = 0; + CommonHelper.proxy.spawnEffect( EffectType.Lightning, this.worldObj, this.posX, this.posY, this.posZ, null ); + this.delay = 0; } int j = MathHelper.floor_double( this.posX ); int i = MathHelper.floor_double( this.posY ); int k = MathHelper.floor_double( this.posZ ); - Material mat = worldObj.getBlock( j, i, k ).getMaterial(); + Material mat = this.worldObj.getBlock( j, i, k ).getMaterial(); if ( Platform.isServer() && mat.isLiquid() ) { - transformTime++; - if ( transformTime > 60 ) + this.transformTime++; + if ( this.transformTime > 60 ) { - if ( !transform() ) - transformTime = 0; + if ( !this.transform() ) + this.transformTime = 0; } } else - transformTime = 0; + this.transformTime = 0; } public boolean transform() { - ItemStack item = getEntityItem(); + ItemStack item = this.getEntityItem(); if ( AEApi.instance().materials().materialCertusQuartzCrystalCharged.sameAsStack( item ) ) { - AxisAlignedBB region = AxisAlignedBB.getBoundingBox( posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1 ); + AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 ); List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); EntityItem redstone = null; @@ -112,12 +112,12 @@ final public class EntityChargedQuartz extends AEBaseEntityItem if ( redstone != null && netherQuartz != null ) { - getEntityItem().stackSize--; + this.getEntityItem().stackSize--; redstone.getEntityItem().stackSize--; netherQuartz.getEntityItem().stackSize--; - if ( getEntityItem().stackSize <= 0 ) - setDead(); + if ( this.getEntityItem().stackSize <= 0 ) + this.setDead(); if ( redstone.getEntityItem().stackSize <= 0 ) redstone.setDead(); @@ -126,7 +126,7 @@ final public class EntityChargedQuartz extends AEBaseEntityItem netherQuartz.setDead(); ItemStack Output = AEApi.instance().materials().materialFluixCrystal.stack( 2 ); - worldObj.spawnEntityInWorld( new EntityItem( worldObj, posX, posY, posZ, Output ) ); + this.worldObj.spawnEntityInWorld( new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, Output ) ); return true; } diff --git a/src/main/java/appeng/entity/EntityFloatingItem.java b/src/main/java/appeng/entity/EntityFloatingItem.java index 84c39fc4c..aa55501e6 100644 --- a/src/main/java/appeng/entity/EntityFloatingItem.java +++ b/src/main/java/appeng/entity/EntityFloatingItem.java @@ -34,7 +34,7 @@ final public class EntityFloatingItem extends EntityItem public EntityFloatingItem(Entity parent, World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { super( p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_, p_i1710_8_ ); - motionX = motionY = motionZ = 0.0d; + this.motionX = this.motionY = this.motionZ = 0.0d; this.hoverStart = 0.5f; this.rotationYaw = 0; this.parent = parent; @@ -45,11 +45,11 @@ final public class EntityFloatingItem extends EntityItem @Override public void onUpdate() { - if ( !isDead && parent.isDead ) + if ( !this.isDead && this.parent.isDead ) this.setDead(); - if ( superDeath++ > 100 ) - setDead(); + if ( this.superDeath++ > 100 ) + this.setDead(); this.age = ageStatic; } diff --git a/src/main/java/appeng/entity/EntityGrowingCrystal.java b/src/main/java/appeng/entity/EntityGrowingCrystal.java index e2054f9f8..5e51cb5f1 100644 --- a/src/main/java/appeng/entity/EntityGrowingCrystal.java +++ b/src/main/java/appeng/entity/EntityGrowingCrystal.java @@ -55,8 +55,8 @@ final public class EntityGrowingCrystal extends EntityItem if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldPurification ) ) return; - if ( age > 600 ) - age = 100; + if ( this.age > 600 ) + this.age = 100; ItemStack is = this.getEntityItem(); Item gc = is.getItem(); @@ -67,25 +67,25 @@ final public class EntityGrowingCrystal extends EntityItem int i = MathHelper.floor_double( this.posY ); int k = MathHelper.floor_double( this.posZ ); - Block blk = worldObj.getBlock( j, i, k ); + Block blk = this.worldObj.getBlock( j, i, k ); Material mat = blk.getMaterial(); IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); float multiplier = cry.getMultiplier( blk, mat ); - int speed = (int) Math.max( 1, getSpeed( j, i, k ) * multiplier ); + int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier ); boolean isClient = Platform.isClient(); if ( mat.isLiquid() ) { if ( isClient ) - progress_1000++; + this.progress_1000++; else - progress_1000 += speed; + this.progress_1000 += speed; } else - progress_1000 = 0; + this.progress_1000 = 0; if ( isClient ) { @@ -109,18 +109,18 @@ final public class EntityGrowingCrystal extends EntityItem if ( speed > 500 ) len = 1; - if ( progress_1000 >= len ) + if ( this.progress_1000 >= len ) { - progress_1000 = 0; - CommonHelper.proxy.spawnEffect( EffectType.Vibrant, worldObj, posX, posY + 0.2, posZ, null ); + this.progress_1000 = 0; + CommonHelper.proxy.spawnEffect( EffectType.Vibrant, this.worldObj, this.posX, this.posY + 0.2, this.posZ, null ); } } else { - if ( progress_1000 > 1000 ) + if ( this.progress_1000 > 1000 ) { - progress_1000 -= 1000; - setEntityItemStack( cry.triggerGrowth( is ) ); + this.progress_1000 -= 1000; + this.setEntityItemStack( cry.triggerGrowth( is ) ); } } } @@ -133,22 +133,22 @@ final public class EntityGrowingCrystal extends EntityItem int qty = 0; - if ( isAccelerated( x + 1, y, z ) ) + if ( this.isAccelerated( x + 1, y, z ) ) qty += per + qty * mul; - if ( isAccelerated( x, y + 1, z ) ) + if ( this.isAccelerated( x, y + 1, z ) ) qty += per + qty * mul; - if ( isAccelerated( x, y, z + 1 ) ) + if ( this.isAccelerated( x, y, z + 1 ) ) qty += per + qty * mul; - if ( isAccelerated( x - 1, y, z ) ) + if ( this.isAccelerated( x - 1, y, z ) ) qty += per + qty * mul; - if ( isAccelerated( x, y - 1, z ) ) + if ( this.isAccelerated( x, y - 1, z ) ) qty += per + qty * mul; - if ( isAccelerated( x, y, z - 1 ) ) + if ( this.isAccelerated( x, y, z - 1 ) ) qty += per + qty * mul; return qty; @@ -156,7 +156,7 @@ final public class EntityGrowingCrystal extends EntityItem private boolean isAccelerated(int x, int y, int z) { - TileEntity te = worldObj.getTileEntity( x, y, z ); + TileEntity te = this.worldObj.getTileEntity( x, y, z ); return te instanceof ICrystalGrowthAccelerator && ( ( ICrystalGrowthAccelerator ) te ).isPowered(); } diff --git a/src/main/java/appeng/entity/EntitySingularity.java b/src/main/java/appeng/entity/EntitySingularity.java index 6719175f1..6a8c40cc3 100644 --- a/src/main/java/appeng/entity/EntitySingularity.java +++ b/src/main/java/appeng/entity/EntitySingularity.java @@ -57,7 +57,7 @@ final public class EntitySingularity extends AEBaseEntityItem { if ( src.isExplosion() ) { - doExplosion(); + this.doExplosion(); return false; } @@ -72,10 +72,10 @@ final public class EntitySingularity extends AEBaseEntityItem if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldSingularity ) ) return; - ItemStack item = getEntityItem(); + ItemStack item = this.getEntityItem(); if ( AEApi.instance().materials().materialSingularity.sameAsStack( item ) ) { - AxisAlignedBB region = AxisAlignedBB.getBoundingBox( posX - 4, posY - 4, posZ - 4, posX + 4, posY + 4, posZ + 4 ); + AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 ); List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); for ( Entity e : l ) @@ -121,11 +121,11 @@ final public class EntitySingularity extends AEBaseEntityItem cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed++ ) % 100 ); item.stackSize--; - worldObj.spawnEntityInWorld( new EntitySingularity( worldObj, posX, posY, posZ, Output ) ); + this.worldObj.spawnEntityInWorld( new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, Output ) ); } if ( item.stackSize <= 0 ) - setDead(); + this.setDead(); } } } diff --git a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java index 593145c3d..f12810959 100644 --- a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java @@ -78,14 +78,14 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if ( this.isInWater() && Platform.isServer() ) // put out the fuse. { - EntityItem item = new EntityItem( worldObj, this.posX, this.posY, this.posZ, AEApi.instance().blocks().blockTinyTNT.stack( 1 ) ); - item.motionX = motionX; - item.motionY = motionY; - item.motionZ = motionZ; + EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, AEApi.instance().blocks().blockTinyTNT.stack( 1 ) ); + item.motionX = this.motionX; + item.motionY = this.motionY; + item.motionZ = this.motionZ; item.prevPosX = this.prevPosX; item.prevPosY = this.prevPosY; item.prevPosZ = this.prevPosZ; - worldObj.spawnEntityInWorld( item ); + this.worldObj.spawnEntityInWorld( item ); this.setDead(); } @@ -127,22 +127,22 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if ( AEConfig.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) ) { - posY -= 0.25; - Explosion ex = new Explosion( worldObj, this, posX, posY, posZ, 0.2f ); + this.posY -= 0.25; + Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f ); - for (int x = (int) (posX - 2); x <= posX + 2; x++) + for (int x = (int) (this.posX - 2); x <= this.posX + 2; x++) { - for (int y = (int) (posY - 2); y <= posY + 2; y++) + for (int y = (int) (this.posY - 2); y <= this.posY + 2; y++) { - for (int z = (int) (posZ - 2); z <= posZ + 2; z++) + for (int z = (int) (this.posZ - 2); z <= this.posZ + 2; z++) { - Block block = worldObj.getBlock( x, y, z ); - if ( block != null && !block.isAir( worldObj, x, y, z ) ) + Block block = this.worldObj.getBlock( x, y, z ); + if ( block != null && !block.isAir( this.worldObj, x, y, z ) ) { - float strength = (float) (2.3f - (((x + 0.5f) - posX) * ((x + 0.5f) - posX) + ((y + 0.5f) - posY) * ((y + 0.5f) - posY) + ((z + 0.5f) - posZ) - * ((z + 0.5f) - posZ))); + float strength = (float) (2.3f - (((x + 0.5f) - this.posX) * ((x + 0.5f) - this.posX) + ((y + 0.5f) - this.posY) * ((y + 0.5f) - this.posY) + ((z + 0.5f) - this.posZ) + * ((z + 0.5f) - this.posZ))); - float resistance = block.getExplosionResistance( this, worldObj, x, y, z, posX, posY, posZ ); + float resistance = block.getExplosionResistance( this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ ); strength -= (resistance + 0.3F) * 0.11f; if ( strength > 0.01 ) @@ -164,19 +164,19 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit } } - CommonHelper.proxy.sendToAllNearExcept( null, posX, posY, posZ, 64, this.worldObj, new PacketMockExplosion( posX, posY, posZ ) ); + CommonHelper.proxy.sendToAllNearExcept( null, this.posX, this.posY, this.posZ, 64, this.worldObj, new PacketMockExplosion( this.posX, this.posY, this.posZ ) ); } @Override public void writeSpawnData(ByteBuf data) { - data.writeByte( fuse ); + data.writeByte( this.fuse ); } @Override public void readSpawnData(ByteBuf data) { - fuse = data.readByte(); + this.fuse = data.readByte(); } } diff --git a/src/main/java/appeng/facade/FacadeContainer.java b/src/main/java/appeng/facade/FacadeContainer.java index db20fc169..1e59ac05c 100644 --- a/src/main/java/appeng/facade/FacadeContainer.java +++ b/src/main/java/appeng/facade/FacadeContainer.java @@ -44,23 +44,23 @@ public class FacadeContainer implements IFacadeContainer final CableBusStorage storage; public FacadeContainer(CableBusStorage cbs) { - storage = cbs; + this.storage = cbs; } @Override public void writeToStream(ByteBuf out) throws IOException { int facadeSides = 0; - for (int x = 0; x < facades; x++) + for (int x = 0; x < this.facades; x++) { - if ( getFacade( ForgeDirection.getOrientation( x ) ) != null ) + if ( this.getFacade( ForgeDirection.getOrientation( x ) ) != null ) facadeSides = facadeSides | (1 << x); } out.writeByte( (byte) facadeSides ); - for (int x = 0; x < facades; x++) + for (int x = 0; x < this.facades; x++) { - IFacadePart part = getFacade( ForgeDirection.getOrientation( x ) ); + IFacadePart part = this.getFacade( ForgeDirection.getOrientation( x ) ); if ( part != null ) { int itemID = Item.getIdFromItem( part.getItem() ); @@ -79,7 +79,7 @@ public class FacadeContainer implements IFacadeContainer boolean changed = false; int ids[] = new int[2]; - for (int x = 0; x < facades; x++) + for (int x = 0; x < this.facades; x++) { ForgeDirection side = ForgeDirection.getOrientation( x ); int ix = (1 << x); @@ -93,8 +93,8 @@ public class FacadeContainer implements IFacadeContainer if ( isBC && AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) { IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - changed = changed || storage.getFacade( x ) == null; - storage.setFacade( x, bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side ) ); + changed = changed || this.storage.getFacade( x ) == null; + this.storage.setFacade( x, bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side ) ); } else if ( !isBC ) { @@ -102,15 +102,15 @@ public class FacadeContainer implements IFacadeContainer ItemStack facade = ifa.createFromIDs( ids ); if ( facade != null ) { - changed = changed || storage.getFacade( x ) == null; - storage.setFacade( x, ifa.createPartFromItemStack( facade, side ) ); + changed = changed || this.storage.getFacade( x ) == null; + this.storage.setFacade( x, ifa.createPartFromItemStack( facade, side ) ); } } } else { - changed = changed || storage.getFacade( x ) != null; - storage.setFacade( x, null ); + changed = changed || this.storage.getFacade( x ) != null; + this.storage.setFacade( x, null ); } } @@ -120,9 +120,9 @@ public class FacadeContainer implements IFacadeContainer @Override public void readFromNBT(NBTTagCompound c) { - for (int x = 0; x < facades; x++) + for (int x = 0; x < this.facades; x++) { - storage.setFacade( x, null ); + this.storage.setFacade( x, null ); NBTTagCompound t = c.getCompoundTag( "facade:" + x ); if ( t != null ) @@ -132,14 +132,14 @@ public class FacadeContainer implements IFacadeContainer { Item i = is.getItem(); if ( i instanceof IFacadeItem ) - storage.setFacade( x, ((IFacadeItem) i).createPartFromItemStack( is, ForgeDirection.getOrientation( x ) ) ); + this.storage.setFacade( x, ((IFacadeItem) i).createPartFromItemStack( is, ForgeDirection.getOrientation( x ) ) ); else { if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) { IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); if ( bc.isFacade( is ) ) - storage.setFacade( x, bc.createFacadePart( is, ForgeDirection.getOrientation( x ) ) ); + this.storage.setFacade( x, bc.createFacadePart( is, ForgeDirection.getOrientation( x ) ) ); } } } @@ -150,12 +150,12 @@ public class FacadeContainer implements IFacadeContainer @Override public void writeToNBT(NBTTagCompound c) { - for (int x = 0; x < facades; x++) + for (int x = 0; x < this.facades; x++) { - if ( storage.getFacade( x ) != null ) + if ( this.storage.getFacade( x ) != null ) { NBTTagCompound data = new NBTTagCompound(); - storage.getFacade( x ).getItemStack().writeToNBT( data ); + this.storage.getFacade( x ).getItemStack().writeToNBT( data ); c.setTag( "facade:" + x, data ); } } @@ -164,9 +164,9 @@ public class FacadeContainer implements IFacadeContainer @Override public boolean addFacade(IFacadePart a) { - if ( getFacade( a.getSide() ) == null ) + if ( this.getFacade( a.getSide() ) == null ) { - storage.setFacade( a.getSide().ordinal(), a ); + this.storage.setFacade( a.getSide().ordinal(), a ); return true; } return false; @@ -177,9 +177,9 @@ public class FacadeContainer implements IFacadeContainer { if ( side != null && side != ForgeDirection.UNKNOWN ) { - if ( storage.getFacade( side.ordinal() ) != null ) + if ( this.storage.getFacade( side.ordinal() ) != null ) { - storage.setFacade( side.ordinal(), null ); + this.storage.setFacade( side.ordinal(), null ); if ( host != null ) host.markForUpdate(); } @@ -189,14 +189,14 @@ public class FacadeContainer implements IFacadeContainer @Override public IFacadePart getFacade(ForgeDirection s) { - return storage.getFacade( s.ordinal() ); + return this.storage.getFacade( s.ordinal() ); } @Override public boolean isEmpty() { - for (int x = 0; x < facades; x++) - if ( storage.getFacade( x ) != null ) + for (int x = 0; x < this.facades; x++) + if ( this.storage.getFacade( x ) != null ) return false; return true; } @@ -206,16 +206,16 @@ public class FacadeContainer implements IFacadeContainer { IFacadePart newFacades[] = new FacadePart[6]; - newFacades[ForgeDirection.UP.ordinal()] = storage.getFacade( ForgeDirection.UP.ordinal() ); - newFacades[ForgeDirection.DOWN.ordinal()] = storage.getFacade( ForgeDirection.DOWN.ordinal() ); + newFacades[ForgeDirection.UP.ordinal()] = this.storage.getFacade( ForgeDirection.UP.ordinal() ); + newFacades[ForgeDirection.DOWN.ordinal()] = this.storage.getFacade( ForgeDirection.DOWN.ordinal() ); - newFacades[ForgeDirection.EAST.ordinal()] = storage.getFacade( ForgeDirection.NORTH.ordinal() ); - newFacades[ForgeDirection.SOUTH.ordinal()] = storage.getFacade( ForgeDirection.EAST.ordinal() ); + newFacades[ForgeDirection.EAST.ordinal()] = this.storage.getFacade( ForgeDirection.NORTH.ordinal() ); + newFacades[ForgeDirection.SOUTH.ordinal()] = this.storage.getFacade( ForgeDirection.EAST.ordinal() ); - newFacades[ForgeDirection.WEST.ordinal()] = storage.getFacade( ForgeDirection.SOUTH.ordinal() ); - newFacades[ForgeDirection.NORTH.ordinal()] = storage.getFacade( ForgeDirection.WEST.ordinal() ); + newFacades[ForgeDirection.WEST.ordinal()] = this.storage.getFacade( ForgeDirection.SOUTH.ordinal() ); + newFacades[ForgeDirection.NORTH.ordinal()] = this.storage.getFacade( ForgeDirection.WEST.ordinal() ); - for (int x = 0; x < facades; x++) - storage.setFacade( x, newFacades[x] ); + for (int x = 0; x < this.facades; x++) + this.storage.setFacade( x, newFacades[x] ); } } diff --git a/src/main/java/appeng/facade/FacadePart.java b/src/main/java/appeng/facade/FacadePart.java index 6b37becd8..39ac611f4 100644 --- a/src/main/java/appeng/facade/FacadePart.java +++ b/src/main/java/appeng/facade/FacadePart.java @@ -75,7 +75,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public ItemStack getItemStack() { - return facade; + return this.facade; } @Override @@ -96,7 +96,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public void getBoxes(IPartCollisionHelper bch) { - getBoxes( bch, null ); + this.getBoxes( bch, null ); } @@ -109,15 +109,15 @@ public class FacadePart implements IFacadePart, IBoxProvider ItemStack getTexture() { - if ( facade.getItem() instanceof IFacadeItem ) + if ( this.facade.getItem() instanceof IFacadeItem ) { - IFacadeItem fi = (IFacadeItem) facade.getItem(); - return fi.getTextureItem( facade ); + IFacadeItem fi = (IFacadeItem) this.facade.getItem(); + return fi.getTextureItem( this.facade ); } else if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) { IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - return bc.getTextureForFacade( facade ); + return bc.getTextureForFacade( this.facade ); } return null; } @@ -127,13 +127,13 @@ public class FacadePart implements IFacadePart, IBoxProvider public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt) { - if ( facade != null ) + if ( this.facade != null ) { BusRenderHelper instance = (BusRenderHelper) instance2; try { - ItemStack randomItem = getTexture(); + ItemStack randomItem = this.getTexture(); RenderBlocksWorkaround rbw = null; if ( renderer instanceof RenderBlocksWorkaround ) @@ -150,18 +150,18 @@ public class FacadePart implements IFacadePart, IBoxProvider } IIcon myIcon = null; - if ( isBC() ) + if ( this.isBC() ) { IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); myIcon = bc.getFacadeTexture(); } if ( myIcon == null ) - myIcon = facade.getIconIndex(); + myIcon = this.facade.getIconIndex(); instance.setTexture( myIcon ); - if ( isBC() ) + if ( this.isBC() ) instance.setBounds( 6, 6, 10, 10, 10, 15 ); else instance.setBounds( 7, 7, 10, 9, 9, 15 ); @@ -203,7 +203,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - instance.setBounds( 0, 0, 16 - getFacadeThickness(), 16, 16, 16 ); + instance.setBounds( 0, 0, 16 - this.getFacadeThickness(), 16, 16, 16 ); instance.prepareBounds( renderer ); if ( rbw != null ) @@ -213,18 +213,18 @@ public class FacadePart implements IFacadePart, IBoxProvider rbw.calculations = true; rbw.faces = EnumSet.noneOf( ForgeDirection.class ); - if ( prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, prevLight ) ) - rbw.populate( prevLight ); + if ( this.prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, this.prevLight ) ) + rbw.populate( this.prevLight ); else { instance.setRenderColor( color ); rbw.renderStandardBlock( instance.getBlock(), x, y, z ); instance.setRenderColor( 0xffffff ); - prevLight = rbw.getLightingCache(); + this.prevLight = rbw.getLightingCache(); } rbw.calculations = false; - rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side ); + rbw.faces = this.calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, this.side ); ((RenderBlocksWorkaround) renderer).setTexture( blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), @@ -246,77 +246,77 @@ public class FacadePart implements IFacadePart, IBoxProvider if ( busBounds == null ) { - if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) + if ( this.side == ForgeDirection.UP || this.side == ForgeDirection.DOWN ) { instance.renderBlockCurrentBounds( x, y, z, renderer ); } - else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) + else if ( this.side == ForgeDirection.NORTH || this.side == ForgeDirection.SOUTH ) { if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; + renderer.renderMaxY -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; + renderer.renderMinY += this.getFacadeThickness() / 16.0; instance.renderBlockCurrentBounds( x, y, z, renderer ); } else { if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; + renderer.renderMaxY -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; + renderer.renderMinY += this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) - renderer.renderMaxZ -= getFacadeThickness() / 16.0; + renderer.renderMaxZ -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.NORTH ) != null ) - renderer.renderMinZ += getFacadeThickness() / 16.0; + renderer.renderMinZ += this.getFacadeThickness() / 16.0; instance.renderBlockCurrentBounds( x, y, z, renderer ); } } else { - if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) + if ( this.side == ForgeDirection.UP || this.side == ForgeDirection.DOWN ) { - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); } - else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) + else if ( this.side == ForgeDirection.NORTH || this.side == ForgeDirection.SOUTH ) { if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; + renderer.renderMaxY -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; + renderer.renderMinY += this.getFacadeThickness() / 16.0; - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 ); } else { if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; + renderer.renderMaxY -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; + renderer.renderMinY += this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) - renderer.renderMaxZ -= getFacadeThickness() / 16.0; + renderer.renderMaxZ -= this.getFacadeThickness() / 16.0; if ( fc.getFacade( ForgeDirection.NORTH ) != null ) - renderer.renderMinZ += getFacadeThickness() / 16.0; + renderer.renderMinZ += this.getFacadeThickness() / 16.0; - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ ); + this.renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); } } @@ -347,7 +347,7 @@ public class FacadePart implements IFacadePart, IBoxProvider for (ForgeDirection it : ForgeDirection.VALID_DIRECTIONS) { - if ( !out.contains( it ) && alphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) ) + if ( !out.contains( it ) && this.alphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) ) { out.add( it ); } @@ -459,15 +459,15 @@ public class FacadePart implements IFacadePart, IBoxProvider @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer) { - if ( facade != null ) + if ( this.facade != null ) { - IFacadeItem fi = (IFacadeItem) facade.getItem(); + IFacadeItem fi = (IFacadeItem) this.facade.getItem(); try { - ItemStack randomItem = fi.getTextureItem( facade ); + ItemStack randomItem = fi.getTextureItem( this.facade ); - instance.setTexture( facade.getIconIndex() ); + instance.setTexture( this.facade.getIconIndex() ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); instance.renderInventoryBox( renderer ); instance.setTexture( null ); @@ -493,7 +493,7 @@ public class FacadePart implements IFacadePart, IBoxProvider Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_F( 1, 1, 1 ); - instance.setTexture( blk.getIcon( side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); + instance.setTexture( blk.getIcon( this.side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); instance.setBounds( 0, 0, 14, 16, 16, 16 ); instance.renderInventoryBox( renderer ); @@ -512,24 +512,24 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public ForgeDirection getSide() { - return side; + return this.side; } public int getFacadeThickness() { - return thickness; + return this.thickness; } @Override public AxisAlignedBB getPrimaryBox() { - return Platform.getPrimaryBox( side, getFacadeThickness() ); + return Platform.getPrimaryBox( this.side, this.getFacadeThickness() ); } @Override public Item getItem() { - ItemStack is = getTexture(); + ItemStack is = this.getTexture(); if ( is == null ) return null; return is.getItem(); @@ -538,7 +538,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public int getItemDamage() { - ItemStack is = getTexture(); + ItemStack is = this.getTexture(); if ( is == null ) return 0; return is.getItemDamage(); @@ -547,13 +547,13 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public boolean isBC() { - return !(facade.getItem() instanceof IFacadeItem); + return !(this.facade.getItem() instanceof IFacadeItem); } @Override public void setThinFacades(boolean useThinFacades) { - thickness = useThinFacades ? 1 : 2; + this.thickness = useThinFacades ? 1 : 2; } @Override @@ -562,7 +562,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if ( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) return true; - ItemStack is = getTexture(); + ItemStack is = this.getTexture(); Block blk = Block.getBlockFromItem( is.getItem() ); if ( !blk.isOpaqueCube() ) return true; diff --git a/src/main/java/appeng/fmp/CableBusPart.java b/src/main/java/appeng/fmp/CableBusPart.java index f30f4680a..547f29961 100644 --- a/src/main/java/appeng/fmp/CableBusPart.java +++ b/src/main/java/appeng/fmp/CableBusPart.java @@ -103,7 +103,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public boolean isInWorld() { - return cb.isInWorld(); + return this.cb.isInWorld(); } @Override @@ -115,31 +115,31 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public AECableType getCableConnectionType(ForgeDirection dir) { - return cb.getCableConnectionType( dir ); + return this.cb.getCableConnectionType( dir ); } @Override public boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who) { - return cb.recolourBlock( side, colour, who ); + return this.cb.recolourBlock( side, colour, who ); } @Override public AEColor getColor() { - return cb.getColor(); + return this.cb.getColor(); } @Override public void save(NBTTagCompound tag) { - cb.writeToNBT( tag ); + this.cb.writeToNBT( tag ); } @Override public void load(NBTTagCompound tag) { - cb.readFromNBT( tag ); + this.cb.readFromNBT( tag ); } @Override @@ -149,7 +149,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds try { - cb.writeToStream( stream ); + this.cb.writeToStream( stream ); packet.writeInt( stream.readableBytes() ); stream.capacity( stream.readableBytes() ); packet.writeByteArray( stream.array() ); @@ -172,7 +172,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds if ( len > 0 ) { ByteBuf byteBuffer = Unpooled.wrappedBuffer( data ); - cb.readFromStream( byteBuffer ); + this.cb.readFromStream( byteBuffer ); } } catch (IOException e) @@ -186,7 +186,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { AxisAlignedBB b = null; - for (AxisAlignedBB bx : cb.getSelectedBoundingBoxesFromPool( false, true, null, true )) + for (AxisAlignedBB bx : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true )) { if ( b == null ) b = bx; @@ -217,14 +217,14 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public void onPartChanged(TMultiPart part) { - cb.updateConnections(); + this.cb.updateConnections(); } @Override public ItemStack pickItem(MovingObjectPosition hit) { Vec3 v3 = hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ); - SelectedPart sp = cb.selectPart( v3 ); + SelectedPart sp = this.cb.selectPart( v3 ); if ( sp != null ) { if ( sp.part != null ) @@ -238,58 +238,58 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public Iterable getDrops() { - return cb.getDrops( new ArrayList() ); + return this.cb.getDrops( new ArrayList() ); } @Override public void onEntityCollision(Entity entity) { - cb.onEntityCollision( entity ); + this.cb.onEntityCollision( entity ); } @Override public void onWorldJoin() { - canUpdate = true; - cb.updateConnections(); - cb.addToWorld(); + this.canUpdate = true; + this.cb.updateConnections(); + this.cb.addToWorld(); } @Override public void onWorldSeparate() { - canUpdate = false; - cb.removeFromWorld(); + this.canUpdate = false; + this.cb.removeFromWorld(); } @Override public boolean canConnectRedstone(int side) { - return cb.canConnectRedstone( EnumSet.of( ForgeDirection.getOrientation( side ) ) ); + return this.cb.canConnectRedstone( EnumSet.of( ForgeDirection.getOrientation( side ) ) ); } @Override public int strongPowerLevel(int side) { - return cb.isProvidingStrongPower( ForgeDirection.getOrientation( side ) ); + return this.cb.isProvidingStrongPower( ForgeDirection.getOrientation( side ) ); } @Override public int weakPowerLevel(int side) { - return cb.isProvidingWeakPower( ForgeDirection.getOrientation( side ) ); + return this.cb.isProvidingWeakPower( ForgeDirection.getOrientation( side ) ); } @Override public void onNeighborChanged() { - cb.onNeighborChanged(); + this.cb.onNeighborChanged(); } @Override public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item) { - return cb.activate( player, hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ) ); + return this.cb.activate( player, hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ) ); } @Override @@ -298,7 +298,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds if ( pass == 0 || (pass == 1 && AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass )) ) { BusRenderHelper.instance.setPass( pass ); - cb.renderDynamic( pos.x, pos.y, pos.z ); + this.cb.renderDynamic( pos.x, pos.y, pos.z ); } } @@ -309,9 +309,9 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { BusRenderHelper.instance.setPass( pass ); BusRenderer.instance.renderer.renderAllFaces = true; - BusRenderer.instance.renderer.blockAccess = world(); + BusRenderer.instance.renderer.blockAccess = this.world(); BusRenderer.instance.renderer.overrideBlockTexture = null; - cb.renderStatic( pos.x, pos.y, pos.z ); + this.cb.renderStatic( pos.x, pos.y, pos.z ); return BusRenderHelper.instance.getItemsRendered() > 0; } return false; @@ -320,7 +320,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public int getLightValue() { - return cb.getLightValue(); + return this.cb.getLightValue(); } @Override @@ -329,7 +329,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds IFacadePart fp = PartPlacement.isFacade( is, side ); if ( fp != null ) { - if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) ) + if ( !(side == null || side == ForgeDirection.UNKNOWN || this.tile() == null) ) { List boxes = new ArrayList(); IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); @@ -337,7 +337,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds for (AxisAlignedBB bb : boxes) { disableFacadeOcclusion.set( true ); - boolean canAdd = tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ); + boolean canAdd = this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ); disableFacadeOcclusion.remove(); if ( !canAdd ) { @@ -356,14 +356,14 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds is.stackSize = 1; IPart bp = bi.createPartFromItemStack( is ); - if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) ) + if ( !(side == null || side == ForgeDirection.UNKNOWN || this.tile() == null) ) { List boxes = new ArrayList(); IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); bp.getBoxes( bch ); for (AxisAlignedBB bb : boxes) { - if ( !tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) ) + if ( !this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) ) { return false; } @@ -371,25 +371,25 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds } } - return cb.canAddPart( is, side ); + return this.cb.canAddPart( is, side ); } @Override public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner) { - return cb.addPart( is, side, owner ); + return this.cb.addPart( is, side, owner ); } @Override public IPart getPart(ForgeDirection side) { - return cb.getPart( side ); + return this.cb.getPart( side ); } @Override public void removePart(ForgeDirection side, boolean suppressUpdate) { - cb.removePart( side, suppressUpdate ); + this.cb.removePart( side, suppressUpdate ); } boolean canUpdate = false; @@ -397,8 +397,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public void markForUpdate() { - if ( Platform.isServer() && canUpdate ) - sendDescUpdate(); + if ( Platform.isServer() && this.canUpdate ) + this.sendDescUpdate(); } @Override @@ -410,13 +410,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public void invalidateConvertedTile() { - cb.setHost( this ); + this.cb.setHost( this ); } public void convertFromTile(TileEntity blockTileEntity) { TileCableBus tcb = (TileCableBus) blockTileEntity; - cb = tcb.cb; + this.cb = tcb.cb; } @Override @@ -429,7 +429,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds public Iterable getCollisionBoxes() { LinkedList l = new LinkedList(); - for (AxisAlignedBB b : cb.getSelectedBoundingBoxesFromPool( false, true, null, false )) + for (AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, false )) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -441,7 +441,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds public Iterable getSubParts() { LinkedList l = new LinkedList(); - for (Cuboid6 c : getCollisionBoxes()) + for (Cuboid6 c : this.getCollisionBoxes()) { l.add( new IndexedCuboid6( 0, c ) ); } @@ -452,7 +452,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds public Iterable getOcclusionBoxes() { LinkedList l = new LinkedList(); - for (AxisAlignedBB b : cb.getSelectedBoundingBoxesFromPool( true, disableFacadeOcclusion.get() == null, null, true )) + for (AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( true, disableFacadeOcclusion.get() == null, null, true )) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -462,29 +462,29 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public IGridNode getGridNode(ForgeDirection dir) { - return cb.getGridNode( dir ); + return this.cb.getGridNode( dir ); } @Override public IFacadeContainer getFacadeContainer() { - return cb.getFacadeContainer(); + return this.cb.getFacadeContainer(); } @Override public void clearContainer() { - cb = new CableBusContainer( this ); + this.cb = new CableBusContainer( this ); } @Override public boolean isBlocked(ForgeDirection side) { - if ( side == null || side == ForgeDirection.UNKNOWN || tile() == null ) + if ( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) return false; disableFacadeOcclusion.set( true ); - boolean blocked = !tile().canAddPart( new NormallyOccludedPart( sideTests[side.ordinal()] ) ); + boolean blocked = !this.tile().canAddPart( new NormallyOccludedPart( sideTests[side.ordinal()] ) ); disableFacadeOcclusion.remove(); return blocked; @@ -493,20 +493,20 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public SelectedPart selectPart(Vec3 pos) { - return cb.selectPart( pos ); + return this.cb.selectPart( pos ); } @Override public void partChanged() { - if ( isInWorld() ) - notifyNeighbors(); + if ( this.isInWorld() ) + this.notifyNeighbors(); } @Override public Set getLayerFlags() { - return cb.getLayerFlags(); + return this.cb.getLayerFlags(); } @Override @@ -515,47 +515,47 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds // mark the chunk for save... TileEntity te = this.tile(); if ( te != null && te.getWorldObj() != null ) - te.getWorldObj().getChunkFromBlockCoords( x(), z() ).isModified = true; + te.getWorldObj().getChunkFromBlockCoords( this.x(), this.z() ).isModified = true; } @Override public boolean hasRedstone(ForgeDirection side) { - return cb.hasRedstone( side ); + return this.cb.hasRedstone( side ); } @Override public void securityBreak() { - cb.securityBreak(); + this.cb.securityBreak(); } @Override public boolean isEmpty() { - return cb.isEmpty(); + return this.cb.isEmpty(); } @Override public void cleanup() { - tile().remPart( this ); + this.tile().remPart( this ); } @Override public void notifyNeighbors() { - if ( tile() instanceof TIInventoryTile ) - ((TIInventoryTile) tile()).rebuildSlotMap(); + if ( this.tile() instanceof TIInventoryTile ) + ((TIInventoryTile) this.tile()).rebuildSlotMap(); - if ( world() != null && world().blockExists( x(), y(), z() ) && !CableBusContainer.isLoading() ) - Platform.notifyBlocksOfNeighbors(world(), x(), y(), z() ); + if ( this.world() != null && this.world().blockExists( this.x(), this.y(), this.z() ) && !CableBusContainer.isLoading() ) + Platform.notifyBlocksOfNeighbors(this.world(), this.x(), this.y(), this.z() ); } // @Override public int getHollowSize(int side) { - IPartCable cable = (IPartCable) getPart( ForgeDirection.UNKNOWN ); + IPartCable cable = (IPartCable) this.getPart( ForgeDirection.UNKNOWN ); ForgeDirection dir = ForgeDirection.getOrientation( side ); if ( cable != null && cable.isConnected( dir ) ) @@ -566,7 +566,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds for (ForgeDirection whichSide : ForgeDirection.values()) { - IPart fPart = getPart( whichSide ); + IPart fPart = this.getPart( whichSide ); if ( fPart != null ) fPart.getBoxes( bch ); @@ -600,13 +600,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { case WEST: case EAST: - return getSize( b.minZ, b.maxZ, b.minY, b.maxY ); + return this.getSize( b.minZ, b.maxZ, b.minY, b.maxY ); case DOWN: case NORTH: - return getSize( b.minX, b.maxX, b.minZ, b.maxZ ); + return this.getSize( b.minX, b.maxX, b.minZ, b.maxZ ); case SOUTH: case UP: - return getSize( b.minX, b.maxX, b.minY, b.maxY ); + return this.getSize( b.minX, b.maxX, b.minY, b.maxY ); default: } } @@ -629,9 +629,9 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds for (ForgeDirection side : ForgeDirection.values()) { - if ( getPart( side ) != null ) + if ( this.getPart( side ) != null ) mask |= 1 << side.ordinal(); - else if ( side != ForgeDirection.UNKNOWN && getFacadeContainer().getFacade( side ) != null ) + else if ( side != ForgeDirection.UNKNOWN && this.getFacadeContainer().getFacade( side ) != null ) mask |= 1 << side.ordinal(); } diff --git a/src/main/java/appeng/fmp/FMPEvent.java b/src/main/java/appeng/fmp/FMPEvent.java index af32e2e4d..64e9ca59b 100644 --- a/src/main/java/appeng/fmp/FMPEvent.java +++ b/src/main/java/appeng/fmp/FMPEvent.java @@ -60,12 +60,12 @@ public class FMPEvent { if ( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote ) { - if ( placing.get() != null ) + if ( this.placing.get() != null ) return; - placing.set( event ); + this.placing.set( event ); if ( place( event.entityPlayer, event.entityPlayer.worldObj ) ) event.setCanceled( true ); - placing.set( null ); + this.placing.set( null ); } } diff --git a/src/main/java/appeng/fmp/FMPPlacementHelper.java b/src/main/java/appeng/fmp/FMPPlacementHelper.java index f308de97e..86e4c0b02 100644 --- a/src/main/java/appeng/fmp/FMPPlacementHelper.java +++ b/src/main/java/appeng/fmp/FMPPlacementHelper.java @@ -69,67 +69,67 @@ public class FMPPlacementHelper implements IPartHost private CableBusPart getPart() { - scala.collection.Iterator i = myMP.partList().iterator(); + scala.collection.Iterator i = this.myMP.partList().iterator(); while (i.hasNext()) { TMultiPart p = i.next(); if ( p instanceof CableBusPart ) - myPart = (CableBusPart) p; + this.myPart = (CableBusPart) p; } - if ( myPart == null ) - myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 ); + if ( this.myPart == null ) + this.myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 ); - BlockCoord loc = new BlockCoord( myMP.xCoord, myMP.yCoord, myMP.zCoord ); + BlockCoord loc = new BlockCoord( this.myMP.xCoord, this.myMP.yCoord, this.myMP.zCoord ); - if ( myMP.canAddPart( myPart ) && Platform.isServer() ) + if ( this.myMP.canAddPart( this.myPart ) && Platform.isServer() ) { - myMP = TileMultipart.addPart( myMP.getWorldObj(), loc, myPart ); - hasPart = true; + this.myMP = TileMultipart.addPart( this.myMP.getWorldObj(), loc, this.myPart ); + this.hasPart = true; } - return myPart; + return this.myPart; } public void removePart() { - if ( myPart.isEmpty() ) + if ( this.myPart.isEmpty() ) { - scala.collection.Iterator i = myMP.partList().iterator(); + scala.collection.Iterator i = this.myMP.partList().iterator(); while (i.hasNext()) { TMultiPart p = i.next(); - if ( p == myPart ) + if ( p == this.myPart ) { - myMP = myMP.remPart( myPart ); + this.myMP = this.myMP.remPart( this.myPart ); break; } } - hasPart = false; - myPart = null; + this.hasPart = false; + this.myPart = null; } } public FMPPlacementHelper(TileMultipart mp) { - myMP = mp; + this.myMP = mp; } @Override public IFacadeContainer getFacadeContainer() { - if ( myPart == null ) + if ( this.myPart == null ) return new FacadeContainer( nullStorage ); - return myPart.getFacadeContainer(); + return this.myPart.getFacadeContainer(); } @Override public boolean canAddPart(ItemStack part, ForgeDirection side) { - CableBusPart myPart = getPart(); + CableBusPart myPart = this.getPart(); - boolean returnValue = hasPart && myPart.canAddPart( part, side ); + boolean returnValue = this.hasPart && myPart.canAddPart( part, side ); - removePart(); + this.removePart(); return returnValue; } @@ -137,11 +137,11 @@ public class FMPPlacementHelper implements IPartHost @Override public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner) { - CableBusPart myPart = getPart(); + CableBusPart myPart = this.getPart(); - ForgeDirection returnValue = hasPart ? myPart.addPart( is, side, owner ) : null; + ForgeDirection returnValue = this.hasPart ? myPart.addPart( is, side, owner ) : null; - removePart(); + this.removePart(); return returnValue; } @@ -149,65 +149,65 @@ public class FMPPlacementHelper implements IPartHost @Override public IPart getPart(ForgeDirection side) { - if ( myPart == null ) + if ( this.myPart == null ) return null; - return myPart.getPart( side ); + return this.myPart.getPart( side ); } @Override public void removePart(ForgeDirection side, boolean suppressUpdate) { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.removePart( side, suppressUpdate ); + this.myPart.removePart( side, suppressUpdate ); } @Override public void markForUpdate() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.markForUpdate(); + this.myPart.markForUpdate(); } @Override public DimensionalCoord getLocation() { - if ( myPart == null ) - return new DimensionalCoord( myMP ); - return myPart.getLocation(); + if ( this.myPart == null ) + return new DimensionalCoord( this.myMP ); + return this.myPart.getLocation(); } @Override public TileEntity getTile() { - return myMP; + return this.myMP; } @Override public AEColor getColor() { - if ( myPart == null ) + if ( this.myPart == null ) return AEColor.Transparent; - return myPart.getColor(); + return this.myPart.getColor(); } @Override public void clearContainer() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.clearContainer(); + this.myPart.clearContainer(); } @Override public boolean isBlocked(ForgeDirection side) { - getPart(); + this.getPart(); - boolean returnValue = myPart.isBlocked( side ); + boolean returnValue = this.myPart.isBlocked( side ); - removePart(); + this.removePart(); return returnValue; } @@ -215,73 +215,73 @@ public class FMPPlacementHelper implements IPartHost @Override public SelectedPart selectPart(Vec3 pos) { - if ( myPart == null ) + if ( this.myPart == null ) return new SelectedPart(); - return myPart.selectPart( pos ); + return this.myPart.selectPart( pos ); } @Override public void markForSave() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.markForSave(); + this.myPart.markForSave(); } @Override public void partChanged() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.partChanged(); + this.myPart.partChanged(); } @Override public boolean hasRedstone(ForgeDirection side) { - if ( myPart == null ) + if ( this.myPart == null ) return false; - return myPart.hasRedstone( side ); + return this.myPart.hasRedstone( side ); } @Override public boolean isEmpty() { - if ( myPart == null ) + if ( this.myPart == null ) return true; - return myPart.isEmpty(); + return this.myPart.isEmpty(); } @Override public Set getLayerFlags() { - if ( myPart == null ) + if ( this.myPart == null ) return EnumSet.noneOf( LayerFlags.class ); - return myPart.getLayerFlags(); + return this.myPart.getLayerFlags(); } @Override public void cleanup() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.cleanup(); + this.myPart.cleanup(); } @Override public void notifyNeighbors() { - if ( myPart == null ) + if ( this.myPart == null ) return; - myPart.notifyNeighbors(); + this.myPart.notifyNeighbors(); } @Override public boolean isInWorld() { - if ( myPart == null ) - return myMP.getWorldObj() != null; - return myPart.isInWorld(); + if ( this.myPart == null ) + return this.myMP.getWorldObj() != null; + return this.myPart.isInWorld(); } } diff --git a/src/main/java/appeng/fmp/PartRegistry.java b/src/main/java/appeng/fmp/PartRegistry.java index 18dda117e..ebbbb53ae 100644 --- a/src/main/java/appeng/fmp/PartRegistry.java +++ b/src/main/java/appeng/fmp/PartRegistry.java @@ -35,7 +35,7 @@ public enum PartRegistry public String getName() { - return name; + return this.name; } private PartRegistry(String name, Class blk, Class part) { @@ -49,9 +49,9 @@ public enum PartRegistry try { if ( this == CableBusPart ) - return (TMultiPart) Api.instance.partHelper.getCombinedInstance( part.getName() ).newInstance(); + return (TMultiPart) Api.instance.partHelper.getCombinedInstance( this.part.getName() ).newInstance(); else - return part.getConstructor( int.class ).newInstance( meta ); + return this.part.getConstructor( int.class ).newInstance( meta ); } catch (Throwable t) { diff --git a/src/main/java/appeng/fmp/QuartzTorchPart.java b/src/main/java/appeng/fmp/QuartzTorchPart.java index 9aa5469e8..2ed59b9fe 100644 --- a/src/main/java/appeng/fmp/QuartzTorchPart.java +++ b/src/main/java/appeng/fmp/QuartzTorchPart.java @@ -62,7 +62,7 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi @Override public Cuboid6 getBounds() { - return getBounds( meta ); + return this.getBounds( this.meta ); } public Cuboid6 getBounds(int meta) @@ -94,6 +94,6 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi @Override public void randomDisplayTick(Random r) { - getBlock().randomDisplayTick( world(), x(), y(), z(), r ); + this.getBlock().randomDisplayTick( this.world(), this.x(), this.y(), this.z(), r ); } } \ No newline at end of file diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index c3bf9bea3..119ad456f 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -115,28 +115,28 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn @Override public int getInstalledUpgrades(Upgrades u) { - if ( upgrades == null ) + if ( this.upgrades == null ) return 0; - return upgrades.getInstalledUpgrades( u ); + return this.upgrades.getInstalledUpgrades( u ); } public boolean hasItemsToSend() { - return waitingToSend != null && !waitingToSend.isEmpty(); + return this.waitingToSend != null && !this.waitingToSend.isEmpty(); } public void updateCraftingList() { Boolean accountedFor[] = new Boolean[] { false, false, false, false, false, false, false, false, false }; // 9... - assert (accountedFor.length == patterns.getSizeInventory()); + assert (accountedFor.length == this.patterns.getSizeInventory()); - if ( !gridProxy.isReady() ) + if ( !this.gridProxy.isReady() ) return; - if ( craftingList != null ) + if ( this.craftingList != null ) { - Iterator i = craftingList.iterator(); + Iterator i = this.craftingList.iterator(); while (i.hasNext()) { ICraftingPatternDetails details = i.next(); @@ -144,7 +144,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn for (int x = 0; x < accountedFor.length; x++) { - ItemStack is = patterns.getStackInSlot( x ); + ItemStack is = this.patterns.getStackInSlot( x ); if ( details.getPattern() == is ) { accountedFor[x] = found = true; @@ -159,12 +159,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn for (int x = 0; x < accountedFor.length; x++) { if ( !accountedFor[x] ) - addToCraftingList( patterns.getStackInSlot( x ) ); + this.addToCraftingList( this.patterns.getStackInSlot( x ) ); } try { - gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, gridProxy.getNode() ) ); + this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } catch (GridAccessException e) { @@ -180,14 +180,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if ( is.getItem() instanceof ICraftingPatternItem ) { ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); - ICraftingPatternDetails details = cpi.getPatternForItem( is, iHost.getTileEntity().getWorldObj() ); + ICraftingPatternDetails details = cpi.getPatternForItem( is, this.iHost.getTileEntity().getWorldObj() ); if ( details != null ) { - if ( craftingList == null ) - craftingList = new LinkedList(); + if ( this.craftingList == null ) + this.craftingList = new LinkedList(); - craftingList.add( details ); + this.craftingList.add( details ); } } } @@ -197,14 +197,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if ( is == null ) return; - if ( waitingToSend == null ) - waitingToSend = new LinkedList(); + if ( this.waitingToSend == null ) + this.waitingToSend = new LinkedList(); - waitingToSend.add( is ); + this.waitingToSend.add( is ); try { - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -213,52 +213,52 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } public DualityInterface(AENetworkProxy networkProxy, IInterfaceHost ih) { - gridProxy = networkProxy; - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.gridProxy = networkProxy; + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - upgrades = new UpgradeInventory( gridProxy.getMachineRepresentation(), this, 1 ); - cm.registerSetting( Settings.BLOCK, YesNo.NO ); - cm.registerSetting( Settings.INTERFACE_TERMINAL, YesNo.YES ); + this.upgrades = new UpgradeInventory( this.gridProxy.getMachineRepresentation(), this, 1 ); + this.cm.registerSetting( Settings.BLOCK, YesNo.NO ); + this.cm.registerSetting( Settings.INTERFACE_TERMINAL, YesNo.YES ); - iHost = ih; - craftingTracker = new MultiCraftingTracker( iHost, 9 ); - mySrc = fluids.changeSource = items.changeSource = new MachineSource( iHost ); + this.iHost = ih; + this.craftingTracker = new MultiCraftingTracker( this.iHost, 9 ); + this.mySrc = this.fluids.changeSource = this.items.changeSource = new MachineSource( this.iHost ); } @Override public void saveChanges() { - iHost.saveChanges(); + this.iHost.saveChanges(); } private void readConfig() { - hasConfig = false; + this.hasConfig = false; - for (ItemStack p : config) + for (ItemStack p : this.config) { if ( p != null ) { - hasConfig = true; + this.hasConfig = true; break; } } - boolean had = hasWorkToDo(); + boolean had = this.hasWorkToDo(); for (int x = 0; x < 8; x++) - updatePlan( x ); + this.updatePlan( x ); - boolean has = hasWorkToDo(); + boolean has = this.hasWorkToDo(); if ( had != has ) { try { if ( has ) - gridProxy.getTick().alertDevice( gridProxy.getNode() ); + this.gridProxy.getTick().alertDevice( this.gridProxy.getNode() ); else - gridProxy.getTick().sleepDevice( gridProxy.getNode() ); + this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -266,18 +266,18 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - notifyNeighbors(); + this.notifyNeighbors(); } public void writeToNBT(NBTTagCompound data) { - config.writeToNBT( data, "config" ); - patterns.writeToNBT( data, "patterns" ); - storage.writeToNBT( data, "storage" ); - upgrades.writeToNBT( data, "upgrades" ); - cm.writeToNBT( data ); - craftingTracker.writeToNBT( data ); - data.setInteger( "priority", priority ); + this.config.writeToNBT( data, "config" ); + this.patterns.writeToNBT( data, "patterns" ); + this.storage.writeToNBT( data, "storage" ); + this.upgrades.writeToNBT( data, "upgrades" ); + this.cm.writeToNBT( data ); + this.craftingTracker.writeToNBT( data ); + data.setInteger( "priority", this.priority ); NBTTagList waitingToSend = new NBTTagList(); if ( this.waitingToSend != null ) @@ -304,31 +304,31 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if ( c != null ) { ItemStack is = ItemStack.loadItemStackFromNBT( c ); - addToSendList( is ); + this.addToSendList( is ); } } } - craftingTracker.readFromNBT( data ); - upgrades.readFromNBT( data, "upgrades" ); - config.readFromNBT( data, "config" ); - patterns.readFromNBT( data, "patterns" ); - storage.readFromNBT( data, "storage" ); - priority = data.getInteger( "priority" ); - cm.readFromNBT( data ); - readConfig(); - updateCraftingList(); + this.craftingTracker.readFromNBT( data ); + this.upgrades.readFromNBT( data, "upgrades" ); + this.config.readFromNBT( data, "config" ); + this.patterns.readFromNBT( data, "patterns" ); + this.storage.readFromNBT( data, "storage" ); + this.priority = data.getInteger( "priority" ); + this.cm.readFromNBT( data ); + this.readConfig(); + this.updateCraftingList(); } final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 8 ); final AppEngInternalInventory storage = new AppEngInternalInventory( this, 8 ); final AppEngInternalInventory patterns = new AppEngInternalInventory( this, 9 ); - final WrapperInvSlot slotInv = new WrapperInvSlot( storage ); + final WrapperInvSlot slotInv = new WrapperInvSlot( this.storage ); private InventoryAdaptor getAdaptor(int slot) { - return new AdaptorIInventory( slotInv.getWrapper( slot ) ); + return new AdaptorIInventory( this.slotInv.getWrapper( slot ) ); } IMEInventory destination; @@ -337,7 +337,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn @Override public boolean canInsert(ItemStack stack) { - IAEItemStack out = destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); + IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); if ( out == null ) return true; return out.getStackSize() != stack.stackSize; @@ -349,48 +349,48 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private void updatePlan(int slot) { - IAEItemStack req = config.getAEStackInSlot( slot ); + IAEItemStack req = this.config.getAEStackInSlot( slot ); if ( req != null && req.getStackSize() <= 0 ) { - config.setInventorySlotContents( slot, null ); + this.config.setInventorySlotContents( slot, null ); req = null; } - ItemStack Stored = storage.getStackInSlot( slot ); + ItemStack Stored = this.storage.getStackInSlot( slot ); if ( req == null && Stored != null ) { IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); - requireWork[slot] = work.setStackSize( -work.getStackSize() ); + this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } else if ( req != null ) { if ( Stored == null ) // need to add stuff! { - requireWork[slot] = req.copy(); + this.requireWork[slot] = req.copy(); return; } else if ( req.isSameType( Stored ) ) // same type ( qty different? )! { if ( req.getStackSize() != Stored.stackSize ) { - requireWork[slot] = req.copy(); - requireWork[slot].setStackSize( req.getStackSize() - Stored.stackSize ); + this.requireWork[slot] = req.copy(); + this.requireWork[slot].setStackSize( req.getStackSize() - Stored.stackSize ); return; } } else // Stored != null; dispose! { IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); - requireWork[slot] = work.setStackSize( -work.getStackSize() ); + this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } } // else - requireWork[slot] = null; + this.requireWork[slot] = null; } static private boolean interfaceRequest = false; @@ -400,7 +400,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public InterfaceInventory(DualityInterface tileInterface) { super( new AdaptorIInventory( tileInterface.storage ) ); - mySource = new MachineSource( iHost ); + this.mySource = new MachineSource( DualityInterface.this.iHost ); } @Override @@ -426,16 +426,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private boolean usePlan(int x, IAEItemStack itemStack) { boolean changed = false; - InventoryAdaptor adaptor = getAdaptor( x ); - interfaceRequest = isWorking = true; + InventoryAdaptor adaptor = this.getAdaptor( x ); + interfaceRequest = this.isWorking = true; try { - destination = gridProxy.getStorage().getItemInventory(); - IEnergySource src = gridProxy.getEnergy(); + this.destination = this.gridProxy.getStorage().getItemInventory(); + IEnergySource src = this.gridProxy.getEnergy(); - if ( craftingTracker.isBusy( x ) ) - changed = handleCrafting( x, adaptor, itemStack ) || changed; + if ( this.craftingTracker.isBusy( x ) ) + changed = this.handleCrafting( x, adaptor, itemStack ) || changed; else if ( itemStack.getStackSize() > 0 ) { // make sure strange things didn't happen... @@ -445,7 +445,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn throw new GridAccessException(); } - IAEItemStack acquired = Platform.poweredExtraction( src, destination, itemStack, mySrc ); + IAEItemStack acquired = Platform.poweredExtraction( src, this.destination, itemStack, this.mySrc ); if ( acquired != null ) { changed = true; @@ -454,7 +454,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn throw new RuntimeException( "bad attempt at managing inventory. ( addItems )" ); } else - changed = handleCrafting( x, adaptor, itemStack ) || changed; + changed = this.handleCrafting( x, adaptor, itemStack ) || changed; } else if ( itemStack.getStackSize() < 0 ) { @@ -471,7 +471,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn throw new GridAccessException(); } - toStore = Platform.poweredInsert( src, destination, toStore, mySrc ); + toStore = Platform.poweredInsert( src, this.destination, toStore, this.mySrc ); if ( toStore != null ) diff -= toStore.getStackSize(); @@ -495,9 +495,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } if ( changed ) - updatePlan( x ); + this.updatePlan( x ); - interfaceRequest = isWorking = false; + interfaceRequest = this.isWorking = false; return changed; } @@ -505,10 +505,10 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { try { - if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 && itemStack != null ) + if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 && itemStack != null ) { - return craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, iHost.getTileEntity().getWorldObj(), gridProxy.getGrid(), - gridProxy.getCrafting(), mySrc ); + return this.craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorldObj(), this.gridProxy.getGrid(), + this.gridProxy.getCrafting(), this.mySrc ); } } catch (GridAccessException e) @@ -521,12 +521,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public IInventory getConfig() { - return config; + return this.config; } public IInventory getPatterns() { - return patterns; + return this.patterns; } final MEMonitorPassThrough items = new MEMonitorPassThrough( new NullInventory(), StorageChannel.ITEMS ); @@ -536,16 +536,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { try { - items.setInternal( gridProxy.getStorage().getItemInventory() ); - fluids.setInternal( gridProxy.getStorage().getFluidInventory() ); + this.items.setInternal( this.gridProxy.getStorage().getItemInventory() ); + this.fluids.setInternal( this.gridProxy.getStorage().getFluidInventory() ); } catch (GridAccessException gae) { - items.setInternal( new NullInventory() ); - fluids.setInternal( new NullInventory() ); + this.items.setInternal( new NullInventory() ); + this.fluids.setInternal( new NullInventory() ); } - notifyNeighbors(); + this.notifyNeighbors(); } public AECableType getCableConnectionType(ForgeDirection dir) @@ -555,46 +555,46 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public DimensionalCoord getLocation() { - return new DimensionalCoord( iHost.getTileEntity() ); + return new DimensionalCoord( this.iHost.getTileEntity() ); } public IInventory getInternalInventory() { - return storage; + return this.storage; } public void markDirty() { - for (int slot = 0; slot < storage.getSizeInventory(); slot++) - onChangeInventory( storage, slot, InvOperation.markDirty, null, null ); + for (int slot = 0; slot < this.storage.getSizeInventory(); slot++) + this.onChangeInventory( this.storage, slot, InvOperation.markDirty, null, null ); } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( isWorking ) + if ( this.isWorking ) return; - if ( inv == config ) - readConfig(); - else if ( inv == patterns && (removed != null || added != null) ) - updateCraftingList(); - else if ( inv == storage && slot >= 0 ) + if ( inv == this.config ) + this.readConfig(); + else if ( inv == this.patterns && (removed != null || added != null) ) + this.updateCraftingList(); + else if ( inv == this.storage && slot >= 0 ) { - boolean had = hasWorkToDo(); + boolean had = this.hasWorkToDo(); - updatePlan( slot ); + this.updatePlan( slot ); - boolean now = hasWorkToDo(); + boolean now = this.hasWorkToDo(); if ( had != now ) { try { if ( now ) - gridProxy.getTick().alertDevice( gridProxy.getNode() ); + this.gridProxy.getTick().alertDevice( this.gridProxy.getNode() ); else - gridProxy.getTick().sleepDevice( gridProxy.getNode() ); + this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -606,8 +606,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public boolean hasWorkToDo() { - return hasItemsToSend() || requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null - || requireWork[4] != null || requireWork[5] != null || requireWork[6] != null || requireWork[7] != null; + return this.hasItemsToSend() || this.requireWork[0] != null || this.requireWork[1] != null || this.requireWork[2] != null || this.requireWork[3] != null + || this.requireWork[4] != null || this.requireWork[5] != null || this.requireWork[6] != null || this.requireWork[7] != null; } private boolean updateStorage() @@ -616,9 +616,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn for (int x = 0; x < 8; x++) { - if ( requireWork[x] != null ) + if ( this.requireWork[x] != null ) { - didSomething = usePlan( x, requireWork[x] ) || didSomething; + didSomething = this.usePlan( x, this.requireWork[x] ) || didSomething; } } @@ -627,108 +627,108 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public boolean hasConfig() { - return hasConfig; + return this.hasConfig; } public int[] getAccessibleSlotsFromSide(int side) { - return sides; + return this.sides; } @Override public TickingRequest getTickingRequest(IGridNode node) { - return new TickingRequest( TickRates.Interface.min, TickRates.Interface.max, !hasWorkToDo(), true ); + return new TickingRequest( TickRates.Interface.min, TickRates.Interface.max, !this.hasWorkToDo(), true ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( !gridProxy.isActive() ) + if ( !this.gridProxy.isActive() ) return TickRateModulation.SLEEP; - if ( hasItemsToSend() ) - pushItemsOut( EnumSet.allOf( ForgeDirection.class ) ); + if ( this.hasItemsToSend() ) + this.pushItemsOut( EnumSet.allOf( ForgeDirection.class ) ); - boolean couldDoWork = updateStorage(); - return hasWorkToDo() ? (couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER) : TickRateModulation.SLEEP; + boolean couldDoWork = this.updateStorage(); + return this.hasWorkToDo() ? (couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER) : TickRateModulation.SLEEP; } @Override public IMEMonitor getItemInventory() { - if ( hasConfig() ) + if ( this.hasConfig() ) return new InterfaceInventory( this ); - return items; + return this.items; } @Override public IMEMonitor getFluidInventory() { - if ( hasConfig() ) + if ( this.hasConfig() ) return null; - return fluids; + return this.fluids; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "storage" ) ) - return storage; + return this.storage; if ( name.equals( "patterns" ) ) - return patterns; + return this.patterns; if ( name.equals( "config" ) ) - return config; + return this.config; if ( name.equals( "upgrades" ) ) - return upgrades; + return this.upgrades; return null; } public IInventory getStorage() { - return storage; + return this.storage; } @Override public TileEntity getTile() { - return (TileEntity) (iHost instanceof TileEntity ? iHost : null); + return (TileEntity) (this.iHost instanceof TileEntity ? this.iHost : null); } public IPart getPart() { - return (IPart) (iHost instanceof IPart ? iHost : null); + return (IPart) (this.iHost instanceof IPart ? this.iHost : null); } @Override public appeng.api.util.IConfigManager getConfigManager() { - return cm; + return this.cm; } @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - if ( getInstalledUpgrades( Upgrades.CRAFTING ) == 0 ) - cancelCrafting(); + if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) == 0 ) + this.cancelCrafting(); - markDirty(); + this.markDirty(); } private void cancelCrafting() { - craftingTracker.cancel(); + this.craftingTracker.cancel(); } public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src, IStorageMonitorable myInterface) { - if ( Platform.canAccess( gridProxy, src ) ) + if ( Platform.canAccess( this.gridProxy, src ) ) return myInterface; final DualityInterface di = this; @@ -752,15 +752,15 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn @Override public boolean isBusy() { - if ( hasItemsToSend() ) + if ( this.hasItemsToSend() ) return true; boolean busy = false; - if ( isBlocking() ) + if ( this.isBlocking() ) { - EnumSet possibleDirections = iHost.getTargets(); - TileEntity tile = iHost.getTileEntity(); + EnumSet possibleDirections = this.iHost.getTargets(); + TileEntity tile = this.iHost.getTileEntity(); World w = tile.getWorldObj(); boolean allAreBusy = true; @@ -788,19 +788,19 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private boolean isBlocking() { - return cm.getSetting( Settings.BLOCK ) == YesNo.YES; + return this.cm.getSetting( Settings.BLOCK ) == YesNo.YES; } @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) { - if ( hasItemsToSend() || !gridProxy.isActive() ) + if ( this.hasItemsToSend() || !this.gridProxy.isActive() ) return false; - TileEntity tile = iHost.getTileEntity(); + TileEntity tile = this.iHost.getTileEntity(); World w = tile.getWorldObj(); - EnumSet possibleDirections = iHost.getTargets(); + EnumSet possibleDirections = this.iHost.getTargets(); for (ForgeDirection s : possibleDirections) { TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); @@ -808,7 +808,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { try { - if ( ((IInterfaceHost) te).getInterfaceDuality().sameGrid( gridProxy.getGrid() ) ) + if ( ((IInterfaceHost) te).getInterfaceDuality().sameGrid( this.gridProxy.getGrid() ) ) continue; } catch (GridAccessException e) @@ -831,23 +831,23 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if ( ad != null ) { - if ( isBlocking() ) + if ( this.isBlocking() ) { if ( ad.simulateRemove( 1, null, null ) != null ) continue; } - if ( acceptsItems( ad, table ) ) + if ( this.acceptsItems( ad, table ) ) { for (int x = 0; x < table.getSizeInventory(); x++) { ItemStack is = table.getStackInSlot( x ); if ( is != null ) { - addToSendList( ad.addItems( is ) ); + this.addToSendList( ad.addItems( is ) ); } } - pushItemsOut( possibleDirections ); + this.pushItemsOut( possibleDirections ); return true; } } @@ -858,7 +858,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private boolean sameGrid(IGrid grid) throws GridAccessException { - return grid == gridProxy.getGrid(); + return grid == this.gridProxy.getGrid(); } private boolean acceptsItems(InventoryAdaptor ad, InventoryCrafting table) @@ -878,13 +878,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private void pushItemsOut(EnumSet possibleDirections) { - if ( !hasItemsToSend() ) + if ( !this.hasItemsToSend() ) return; - TileEntity tile = iHost.getTileEntity(); + TileEntity tile = this.iHost.getTileEntity(); World w = tile.getWorldObj(); - Iterator i = waitingToSend.iterator(); + Iterator i = this.waitingToSend.iterator(); while (i.hasNext()) { ItemStack whatToSend = i.next(); @@ -914,16 +914,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn i.remove(); } - if ( waitingToSend.isEmpty() ) - waitingToSend = null; + if ( this.waitingToSend.isEmpty() ) + this.waitingToSend = null; } @Override public void provideCrafting(ICraftingProviderHelper craftingTracker) { - if ( gridProxy.isActive() && craftingList != null ) + if ( this.gridProxy.isActive() && this.craftingList != null ) { - for (ICraftingPatternDetails details : craftingList) + for (ICraftingPatternDetails details : this.craftingList) { details.setPriority( this.priority ); craftingTracker.addCraftingOption( this, details ); @@ -933,34 +933,34 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public void addDrops(List drops) { - if ( waitingToSend != null ) + if ( this.waitingToSend != null ) { - for (ItemStack is : waitingToSend) + for (ItemStack is : this.waitingToSend) if ( is != null ) drops.add( is ); } - for (ItemStack is : upgrades) + for (ItemStack is : this.upgrades) if ( is != null ) drops.add( is ); - for (ItemStack is : storage) + for (ItemStack is : this.storage) if ( is != null ) drops.add( is ); - for (ItemStack is : patterns) + for (ItemStack is : this.patterns) if ( is != null ) drops.add( is ); } public void notifyNeighbors() { - if ( gridProxy.isActive() ) + if ( this.gridProxy.isActive() ) { try { - gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, gridProxy.getNode() ) ); - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -968,39 +968,39 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - TileEntity te = iHost.getTileEntity(); + TileEntity te = this.iHost.getTileEntity(); if ( te != null && te.getWorldObj() != null ) Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord ); } public IUpgradeableHost getHost() { - if ( getPart() instanceof IUpgradeableHost ) - return (IUpgradeableHost) getPart(); - if ( getTile() instanceof IUpgradeableHost ) - return (IUpgradeableHost) getTile(); + if ( this.getPart() instanceof IUpgradeableHost ) + return (IUpgradeableHost) this.getPart(); + if ( this.getTile() instanceof IUpgradeableHost ) + return (IUpgradeableHost) this.getTile(); return null; } public ImmutableSet getRequestedJobs() { - return craftingTracker.getRequestedJobs(); + return this.craftingTracker.getRequestedJobs(); } public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack acquired, Actionable mode) { - int slot = craftingTracker.getSlot( link ); + int slot = this.craftingTracker.getSlot( link ); - if ( acquired != null && slot >= 0 && slot <= requireWork.length ) + if ( acquired != null && slot >= 0 && slot <= this.requireWork.length ) { - InventoryAdaptor adaptor = getAdaptor( slot ); + InventoryAdaptor adaptor = this.getAdaptor( slot ); if ( mode == Actionable.SIMULATE ) return AEItemStack.create( adaptor.simulateAdd( acquired.getItemStack() ) ); else { IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) ); - updatePlan( slot ); + this.updatePlan( slot ); return is; } } @@ -1010,20 +1010,20 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public void jobStateChange(ICraftingLink link) { - craftingTracker.jobStateChange( link ); + this.craftingTracker.jobStateChange( link ); } static final Set badBlocks = new HashSet(); public String getTermName() { - TileEntity tile = iHost.getTileEntity(); + TileEntity tile = this.iHost.getTileEntity(); World w = tile.getWorldObj(); - if ( ((ICustomNameObject) iHost).hasCustomName() ) - return ((ICustomNameObject) iHost).getCustomName(); + if ( ((ICustomNameObject) this.iHost).hasCustomName() ) + return ((ICustomNameObject) this.iHost).getCustomName(); - EnumSet possibleDirections = iHost.getTargets(); + EnumSet possibleDirections = this.iHost.getTargets(); for (ForgeDirection s : possibleDirections) { Vec3 from = Vec3.createVectorHelper( tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5 ); @@ -1042,7 +1042,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { try { - if ( ((IInterfaceHost) te).getInterfaceDuality().sameGrid( gridProxy.getGrid() ) ) + if ( ((IInterfaceHost) te).getInterfaceDuality().sameGrid( this.gridProxy.getGrid() ) ) continue; } catch (GridAccessException e) @@ -1101,30 +1101,30 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public long getSortValue() { - TileEntity te = iHost.getTileEntity(); + TileEntity te = this.iHost.getTileEntity(); return (te.zCoord << 24) ^ (te.xCoord << 8) ^ te.yCoord; } public void initialize() { - updateCraftingList(); + this.updateCraftingList(); } @Override public int getPriority() { - return priority; + return this.priority; } @Override public void setPriority(int newValue) { - priority = newValue; - markDirty(); + this.priority = newValue; + this.markDirty(); try { - gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, gridProxy.getNode() ) ); + this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } catch (GridAccessException e) { diff --git a/src/main/java/appeng/helpers/LocationRotation.java b/src/main/java/appeng/helpers/LocationRotation.java index d2402f546..f1f1547ac 100644 --- a/src/main/java/appeng/helpers/LocationRotation.java +++ b/src/main/java/appeng/helpers/LocationRotation.java @@ -31,7 +31,7 @@ public class LocationRotation implements IOrientable final int z; public LocationRotation(IBlockAccess world, int x, int y, int z) { - w = world; + this.w = world; this.x = x; this.y = y; this.z = z; @@ -46,14 +46,14 @@ public class LocationRotation implements IOrientable @Override public ForgeDirection getUp() { - int num = Math.abs( x + y + z ) % 6; + int num = Math.abs( this.x + this.y + this.z ) % 6; return ForgeDirection.getOrientation( num ); } @Override public ForgeDirection getForward() { - if ( getUp().offsetY == 0 ) + if ( this.getUp().offsetY == 0 ) return ForgeDirection.UP; return ForgeDirection.SOUTH; } diff --git a/src/main/java/appeng/helpers/MetaRotation.java b/src/main/java/appeng/helpers/MetaRotation.java index d8e91e22c..e968cd229 100644 --- a/src/main/java/appeng/helpers/MetaRotation.java +++ b/src/main/java/appeng/helpers/MetaRotation.java @@ -32,7 +32,7 @@ public class MetaRotation implements IOrientable final int z; public MetaRotation(IBlockAccess world, int x, int y, int z) { - w = world; + this.w = world; this.x = x; this.y = y; this.z = z; @@ -41,22 +41,22 @@ public class MetaRotation implements IOrientable @Override public void setOrientation(ForgeDirection Forward, ForgeDirection Up) { - if ( w instanceof World ) - ((World) w).setBlockMetadataWithNotify( x, y, z, Up.ordinal(), 1 + 2 ); + if ( this.w instanceof World ) + ((World) this.w).setBlockMetadataWithNotify( this.x, this.y, this.z, Up.ordinal(), 1 + 2 ); else - throw new RuntimeException( w.getClass().getName() + " received, expected World" ); + throw new RuntimeException( this.w.getClass().getName() + " received, expected World" ); } @Override public ForgeDirection getUp() { - return ForgeDirection.getOrientation( w.getBlockMetadata( x, y, z ) ); + return ForgeDirection.getOrientation( this.w.getBlockMetadata( this.x, this.y, this.z ) ); } @Override public ForgeDirection getForward() { - if ( getUp().offsetY == 0 ) + if ( this.getUp().offsetY == 0 ) return ForgeDirection.UP; return ForgeDirection.SOUTH; } diff --git a/src/main/java/appeng/helpers/MeteoritePlacer.java b/src/main/java/appeng/helpers/MeteoritePlacer.java index 8a4f46b92..ee897d52c 100644 --- a/src/main/java/appeng/helpers/MeteoritePlacer.java +++ b/src/main/java/appeng/helpers/MeteoritePlacer.java @@ -57,30 +57,30 @@ public class MeteoritePlacer { double a = Math.random(); if ( a > 0.9 ) - put( w, x, y, z, Blocks.stone ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.stone ); else if ( a > 0.8 ) - put( w, x, y, z, Blocks.cobblestone ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.cobblestone ); else if ( a > 0.7 ) - put( w, x, y, z, Blocks.dirt ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.dirt ); else if ( a > 0.7 ) - put( w, x, y, z, Blocks.gravel ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.gravel ); } public void getRandomInset(IMeteoriteWorld w, int x, int y, int z) { double a = Math.random(); if ( a > 0.9 ) - put( w, x, y, z, Blocks.cobblestone ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.cobblestone ); else if ( a > 0.8 ) - put( w, x, y, z, Blocks.stone ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.stone ); else if ( a > 0.7 ) - put( w, x, y, z, Blocks.grass ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.grass ); else if ( a > 0.6 ) - put( w, x, y, z, skystone ); + MeteoritePlacer.this.put( w, x, y, z, MeteoritePlacer.this.skystone ); else if ( a > 0.5 ) - put( w, x, y, z, Blocks.gravel ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.gravel ); else if ( a > 0.5 ) - put( w, x, y, z, Platform.air ); + MeteoritePlacer.this.put( w, x, y, z, Platform.air ); } } @@ -92,8 +92,8 @@ public class MeteoritePlacer final int meta; public FalloutCopy(IMeteoriteWorld w, int x, int y, int z) { - blk = w.getBlock( x, y, z ); - meta = w.getBlockMetadata( x, y, z ); + this.blk = w.getBlock( x, y, z ); + this.meta = w.getBlockMetadata( x, y, z ); } public void getOther(IMeteoriteWorld w, int x, int y, int z, double a) @@ -106,9 +106,9 @@ public class MeteoritePlacer { double a = Math.random(); if ( a > 0.9 ) - put( w, x, y, z, blk, meta ); + MeteoritePlacer.this.put( w, x, y, z, this.blk, this.meta ); else - getOther( w, x, y, z, a ); + this.getOther( w, x, y, z, a ); } @Override @@ -116,11 +116,11 @@ public class MeteoritePlacer { double a = Math.random(); if ( a > 0.9 ) - put( w, x, y, z, blk, meta ); + MeteoritePlacer.this.put( w, x, y, z, this.blk, this.meta ); else if ( a > 0.8 ) - put( w, x, y, z, Platform.air ); + MeteoritePlacer.this.put( w, x, y, z, Platform.air ); else - getOther( w, x, y, z, a - 0.1 ); + this.getOther( w, x, y, z, a - 0.1 ); } } @@ -141,7 +141,7 @@ public class MeteoritePlacer public void getOther(IMeteoriteWorld w, int x, int y, int z, double a) { if ( a > 0.66 ) - put( w, x, y, z, Blocks.glass ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.glass ); } } @@ -163,9 +163,9 @@ public class MeteoritePlacer public void getOther(IMeteoriteWorld w, int x, int y, int z, double a) { if ( a > 0.7 ) - put( w, x, y, z, Blocks.snow ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.snow ); else if ( a > 0.5 ) - put( w, x, y, z, Blocks.ice ); + MeteoritePlacer.this.put( w, x, y, z, Blocks.ice ); } } @@ -213,59 +213,59 @@ public class MeteoritePlacer @Override public boolean hasNoSky() { - return !w.provider.hasNoSky; + return !this.w.provider.hasNoSky; } @Override public int getBlockMetadata(int x, int y, int z) { - if ( range( x, y, z ) ) - return w.getBlockMetadata( x, y, z ); + if ( this.range( x, y, z ) ) + return this.w.getBlockMetadata( x, y, z ); return 0; } @Override public Block getBlock(int x, int y, int z) { - if ( range( x, y, z ) ) - return w.getBlock( x, y, z ); + if ( this.range( x, y, z ) ) + return this.w.getBlock( x, y, z ); return Platform.air; } @Override public boolean canBlockSeeTheSky(int x, int y, int z) { - if ( range( x, y, z ) ) - return w.canBlockSeeTheSky( x, y, z ); + if ( this.range( x, y, z ) ) + return this.w.canBlockSeeTheSky( x, y, z ); return false; } @Override public TileEntity getTileEntity(int x, int y, int z) { - if ( range( x, y, z ) ) - return w.getTileEntity( x, y, z ); + if ( this.range( x, y, z ) ) + return this.w.getTileEntity( x, y, z ); return null; } @Override public World getWorld() { - return w; + return this.w; } @Override public void setBlock(int x, int y, int z, Block blk) { - if ( range( x, y, z ) ) - w.setBlock( x, y, z, blk ); + if ( this.range( x, y, z ) ) + this.w.setBlock( x, y, z, blk ); } @Override public void setBlock(int x, int y, int z, Block blk, int metadata, int flags) { - if ( range( x, y, z ) ) - w.setBlock( x, y, z, blk, metadata, flags ); + if ( this.range( x, y, z ) ) + this.w.setBlock( x, y, z, blk, metadata, flags ); } public boolean range(int x, int y, int z) @@ -316,7 +316,7 @@ public class MeteoritePlacer public ChunkOnly(World w, int cx, int cz) { super( w ); - target = w.getChunkFromChunkCoords( cx, cz ); + this.target = w.getChunkFromChunkCoords( cx, cz ); this.cx = cx; this.cz = cz; } @@ -324,74 +324,74 @@ public class MeteoritePlacer @Override public void done() { - if ( verticalBits != 0 ) - Platform.sendChunk( target, verticalBits ); + if ( this.verticalBits != 0 ) + Platform.sendChunk( this.target, this.verticalBits ); } @Override public void setBlock(int x, int y, int z, Block blk) { - if ( range( x, y, z ) ) + if ( this.range( x, y, z ) ) { - verticalBits |= 1 << (y >> 4); - w.setBlock( x, y, z, blk, 0, 1 ); + this.verticalBits |= 1 << (y >> 4); + this.w.setBlock( x, y, z, blk, 0, 1 ); } } @Override public void setBlock(int x, int y, int z, Block blk, int metadata, int flags) { - if ( range( x, y, z ) ) + if ( this.range( x, y, z ) ) { - verticalBits |= 1 << (y >> 4); - w.setBlock( x, y, z, blk, metadata, flags & (~2) ); + this.verticalBits |= 1 << (y >> 4); + this.w.setBlock( x, y, z, blk, metadata, flags & (~2) ); } } @Override public Block getBlock(int x, int y, int z) { - if ( range( x, y, z ) ) - return target.getBlock( x & 0xF, y, z & 0xF ); + if ( this.range( x, y, z ) ) + return this.target.getBlock( x & 0xF, y, z & 0xF ); return Platform.air; } @Override public int getBlockMetadata(int x, int y, int z) { - if ( range( x, y, z ) ) - return target.getBlockMetadata( x & 0xF, y, z & 0xF ); + if ( this.range( x, y, z ) ) + return this.target.getBlockMetadata( x & 0xF, y, z & 0xF ); return 0; } @Override public boolean range(int x, int y, int z) { - return cx == (x >> 4) && cz == (z >> 4); + return this.cx == (x >> 4) && this.cz == (z >> 4); } @Override public int minX(int in) { - return Math.max( in, cx << 4 ); + return Math.max( in, this.cx << 4 ); } @Override public int minZ(int in) { - return Math.max( in, cz << 4 ); + return Math.max( in, this.cz << 4 ); } @Override public int maxX(int in) { - return Math.min( in, (cx + 1) << 4 ); + return Math.min( in, (this.cx + 1) << 4 ); } @Override public int maxZ(int in) { - return Math.min( in, (cz + 1) << 4 ); + return Math.min( in, (this.cz + 1) << 4 ); } } @@ -405,80 +405,80 @@ public class MeteoritePlacer final Block skychest; double real_sizeOfMeteorite = (Math.random() * 6.0) + 2; - double realCrater = real_sizeOfMeteorite * 2 + 5; + double realCrater = this.real_sizeOfMeteorite * 2 + 5; - double sizeOfMeteorite = real_sizeOfMeteorite * real_sizeOfMeteorite; - double crater = realCrater * realCrater; + double sizeOfMeteorite = this.real_sizeOfMeteorite * this.real_sizeOfMeteorite; + double crater = this.realCrater * this.realCrater; public MeteoritePlacer() { if ( AEApi.instance().blocks().blockSkyChest.block() == null ) - skychest = Blocks.chest; + this.skychest = Blocks.chest; else - skychest = AEApi.instance().blocks().blockSkyChest.block(); + this.skychest = AEApi.instance().blocks().blockSkyChest.block(); - validSpawn.add( Blocks.stone ); - validSpawn.add( Blocks.cobblestone ); - validSpawn.add( Blocks.grass ); - validSpawn.add( Blocks.sand ); - validSpawn.add( Blocks.dirt ); - validSpawn.add( Blocks.gravel ); - validSpawn.add( Blocks.netherrack ); - validSpawn.add( Blocks.iron_ore ); - validSpawn.add( Blocks.gold_ore ); - validSpawn.add( Blocks.diamond_ore ); - validSpawn.add( Blocks.redstone_ore ); - validSpawn.add( Blocks.hardened_clay ); - validSpawn.add( Blocks.ice ); - validSpawn.add( Blocks.snow ); + this.validSpawn.add( Blocks.stone ); + this.validSpawn.add( Blocks.cobblestone ); + this.validSpawn.add( Blocks.grass ); + this.validSpawn.add( Blocks.sand ); + this.validSpawn.add( Blocks.dirt ); + this.validSpawn.add( Blocks.gravel ); + this.validSpawn.add( Blocks.netherrack ); + this.validSpawn.add( Blocks.iron_ore ); + this.validSpawn.add( Blocks.gold_ore ); + this.validSpawn.add( Blocks.diamond_ore ); + this.validSpawn.add( Blocks.redstone_ore ); + this.validSpawn.add( Blocks.hardened_clay ); + this.validSpawn.add( Blocks.ice ); + this.validSpawn.add( Blocks.snow ); - invalidSpawn.add( skystone ); - invalidSpawn.add( Blocks.planks ); - invalidSpawn.add( Blocks.iron_door ); - invalidSpawn.add( Blocks.iron_bars ); - invalidSpawn.add( Blocks.wooden_door ); - invalidSpawn.add( Blocks.brick_block ); - invalidSpawn.add( Blocks.clay ); - invalidSpawn.add( Blocks.water ); - invalidSpawn.add( Blocks.log ); - invalidSpawn.add( Blocks.log2 ); + this.invalidSpawn.add( this.skystone ); + this.invalidSpawn.add( Blocks.planks ); + this.invalidSpawn.add( Blocks.iron_door ); + this.invalidSpawn.add( Blocks.iron_bars ); + this.invalidSpawn.add( Blocks.wooden_door ); + this.invalidSpawn.add( Blocks.brick_block ); + this.invalidSpawn.add( Blocks.clay ); + this.invalidSpawn.add( Blocks.water ); + this.invalidSpawn.add( Blocks.log ); + this.invalidSpawn.add( Blocks.log2 ); } NBTTagCompound settings; public boolean spawnMeteorite(IMeteoriteWorld w, NBTTagCompound meteoriteBlob) { - settings = meteoriteBlob; + this.settings = meteoriteBlob; - int x = settings.getInteger( "x" ); - int y = settings.getInteger( "y" ); - int z = settings.getInteger( "z" ); + int x = this.settings.getInteger( "x" ); + int y = this.settings.getInteger( "y" ); + int z = this.settings.getInteger( "z" ); - real_sizeOfMeteorite = settings.getDouble( "real_sizeOfMeteorite" ); - realCrater = settings.getDouble( "realCrater" ); - sizeOfMeteorite = settings.getDouble( "sizeOfMeteorite" ); - crater = settings.getDouble( "crater" ); + this.real_sizeOfMeteorite = this.settings.getDouble( "real_sizeOfMeteorite" ); + this.realCrater = this.settings.getDouble( "realCrater" ); + this.sizeOfMeteorite = this.settings.getDouble( "sizeOfMeteorite" ); + this.crater = this.settings.getDouble( "crater" ); - Block blk = Block.getBlockById( settings.getInteger( "blk" ) ); + Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) ); if ( blk == Blocks.sand ) - type = new FalloutSand( w, x, y, z ); + this.type = new FalloutSand( w, x, y, z ); else if ( blk == Blocks.hardened_clay ) - type = new FalloutCopy( w, x, y, z ); + this.type = new FalloutCopy( w, x, y, z ); else if ( blk == Blocks.ice || blk == Blocks.snow ) - type = new FalloutSnow( w, x, y, z ); + this.type = new FalloutSnow( w, x, y, z ); - int skyMode = settings.getInteger( "skyMode" ); + int skyMode = this.settings.getInteger( "skyMode" ); // creator if ( skyMode > 10 ) - placeCrater( w, x, y, z ); + this.placeCrater( w, x, y, z ); - placeMeteorite( w, x, y, z ); + this.placeMeteorite( w, x, y, z ); // collapse blocks... if ( skyMode > 3 ) - Decay( w, x, y, z ); + this.Decay( w, x, y, z ); w.done(); return true; @@ -486,8 +486,8 @@ public class MeteoritePlacer public double getSqDistance(int x, int z) { - int Cx = settings.getInteger( "x" ) - x; - int Cz = settings.getInteger( "z" ) - z; + int Cx = this.settings.getInteger( "x" ) - x; + int Cz = this.settings.getInteger( "z" ) - z; return Cx * Cx + Cz * Cz; } @@ -500,28 +500,28 @@ public class MeteoritePlacer return false; Block blk = w.getBlock( x, y, z ); - if ( !validSpawn.contains( blk ) ) + if ( !this.validSpawn.contains( blk ) ) return false; // must spawn on a valid block.. - settings = new NBTTagCompound(); - settings.setInteger( "x", x ); - settings.setInteger( "y", y ); - settings.setInteger( "z", z ); - settings.setInteger( "blk", Block.getIdFromBlock( blk ) ); + this.settings = new NBTTagCompound(); + this.settings.setInteger( "x", x ); + this.settings.setInteger( "y", y ); + this.settings.setInteger( "z", z ); + this.settings.setInteger( "blk", Block.getIdFromBlock( blk ) ); - settings.setDouble( "real_sizeOfMeteorite", real_sizeOfMeteorite ); - settings.setDouble( "realCrater", realCrater ); - settings.setDouble( "sizeOfMeteorite", sizeOfMeteorite ); - settings.setDouble( "crater", crater ); + this.settings.setDouble( "real_sizeOfMeteorite", this.real_sizeOfMeteorite ); + this.settings.setDouble( "realCrater", this.realCrater ); + this.settings.setDouble( "sizeOfMeteorite", this.sizeOfMeteorite ); + this.settings.setDouble( "crater", this.crater ); - settings.setBoolean( "lava", Math.random() > 0.9 ); + this.settings.setBoolean( "lava", Math.random() > 0.9 ); if ( blk == Blocks.sand ) - type = new FalloutSand( w, x, y, z ); + this.type = new FalloutSand( w, x, y, z ); else if ( blk == Blocks.hardened_clay ) - type = new FalloutCopy( w, x, y, z ); + this.type = new FalloutCopy( w, x, y, z ); else if ( blk == Blocks.ice || blk == Blocks.snow ) - type = new FalloutSnow( w, x, y, z ); + this.type = new FalloutSnow( w, x, y, z ); int realValidBlocks = 0; @@ -530,7 +530,7 @@ public class MeteoritePlacer for (int k = z - 6; k < z + 6; k++) { blk = w.getBlock( i, j, k ); - if ( validSpawn.contains( blk ) ) + if ( this.validSpawn.contains( blk ) ) realValidBlocks++; } @@ -539,13 +539,13 @@ public class MeteoritePlacer for (int k = z - 15; k < z + 15; k++) { blk = w.getBlock( i, j, k ); - if ( invalidSpawn.contains( blk ) ) + if ( this.invalidSpawn.contains( blk ) ) return false; - if ( validSpawn.contains( blk ) ) + if ( this.validSpawn.contains( blk ) ) validBlocks++; } - if ( validBlocks > minBLocks && realValidBlocks > 80 ) + if ( validBlocks > this.minBLocks && realValidBlocks > 80 ) { // we can spawn here! @@ -571,18 +571,18 @@ public class MeteoritePlacer // creator if ( skyMode > 10 ) - placeCrater( w, x, y, z ); + this.placeCrater( w, x, y, z ); - placeMeteorite( w, x, y, z ); + this.placeMeteorite( w, x, y, z ); // collapse blocks... if ( skyMode > 3 ) - Decay( w, x, y, z ); + this.Decay( w, x, y, z ); - settings.setInteger( "skyMode", skyMode ); + this.settings.setInteger( "skyMode", skyMode ); w.done(); - WorldSettings.getInstance().addNearByMeteorites( w.getWorld().provider.dimensionId, x >> 4, z >> 4, settings ); + WorldSettings.getInstance().addNearByMeteorites( w.getWorld().provider.dimensionId, x >> 4, z >> 4, this.settings ); return true; } return false; @@ -590,7 +590,7 @@ public class MeteoritePlacer private void placeCrater(IMeteoriteWorld w, int x, int y, int z) { - boolean lava = settings.getBoolean( "lava" ); + boolean lava = this.settings.getBoolean( "lava" ); int maxY = 255; int minX = w.minX( x - 200 ); @@ -607,7 +607,7 @@ public class MeteoritePlacer { double dx = i - x; double dz = k - z; - double h = y - real_sizeOfMeteorite + 1 + type.adjustCrater(); + double h = y - this.real_sizeOfMeteorite + 1 + this.type.adjustCrater(); double distanceFrom = dx * dx + dz * dz; @@ -616,10 +616,10 @@ public class MeteoritePlacer if ( lava && j < y && w.getBlock( x, y - 1, z ).isBlockSolid( w.getWorld(), i, j, k, 0 ) ) { if ( j > h + distanceFrom * 0.02 ) - put( w, i, j, k, Blocks.lava ); + this.put( w, i, j, k, Blocks.lava ); } else - changed = put( w, i, j, k, Platform.air ) || changed; + changed = this.put( w, i, j, k, Platform.air ) || changed; } } } @@ -648,13 +648,13 @@ public class MeteoritePlacer double dy = j - y; double dz = k - z; - if ( dx * dx * 0.7 + dy * dy * (j > y ? 1.4 : 0.8) + dz * dz * 0.7 < sizeOfMeteorite ) - put( w, i, j, k, skystone ); + if ( dx * dx * 0.7 + dy * dy * (j > y ? 1.4 : 0.8) + dz * dz * 0.7 < this.sizeOfMeteorite ) + this.put( w, i, j, k, this.skystone ); } if ( AEConfig.instance.isFeatureEnabled( AEFeature.SpawnPressesInMeteorites ) ) { - put( w, x, y, z, skychest ); + this.put( w, x, y, z, this.skychest ); TileEntity te = w.getTileEntity( x, y, z ); if ( te != null && te instanceof IInventory ) { @@ -773,7 +773,7 @@ public class MeteoritePlacer w.setBlock( i, j, k, blk_b, meta_b, 3 ); w.setBlock( i, j + 1, k, blk ); } - else if ( randomShit < 100 * crater ) + else if ( randomShit < 100 * this.crater ) { double dx = i - x; double dy = j - y; @@ -784,12 +784,12 @@ public class MeteoritePlacer if ( !xf.isReplaceable( w.getWorld(), i, j - 1, k ) ) { double extraRange = Math.random() * 0.6; - double height = crater * (extraRange + 0.2) - Math.abs( dist - crater * 1.7 ); + double height = this.crater * (extraRange + 0.2) - Math.abs( dist - this.crater * 1.7 ); if ( xf != blk && height > 0 && Math.random() > 0.6 ) { randomShit++; - type.getRandomFall( w, i, j, k ); + this.type.getRandomFall( w, i, j, k ); } } } @@ -806,9 +806,9 @@ public class MeteoritePlacer double dy = j - y; double dz = k - z; - if ( dx * dx + dy * dy + dz * dz < crater * 1.6 ) + if ( dx * dx + dy * dy + dz * dz < this.crater * 1.6 ) { - type.getRandomInset( w, i, j, k ); + this.type.getRandomInset( w, i, j, k ); } } @@ -839,6 +839,6 @@ public class MeteoritePlacer public NBTTagCompound getSettings() { - return settings; + return this.settings; } } diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index 6257dbdfa..900d54f00 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -46,25 +46,25 @@ public class MultiCraftingTracker ICraftingLink[] links = null; public MultiCraftingTracker(ICraftingRequester o, int size) { - owner = o; + this.owner = o; this.size = size; } public void readFromNBT(NBTTagCompound extra) { - for (int x = 0; x < size; x++) + for (int x = 0; x < this.size; x++) { NBTTagCompound link = extra.getCompoundTag( "links-" + x ); if ( link != null && !link.hasNoTags() ) - setLink( x, AEApi.instance().storage().loadCraftingLink( link, owner ) ); + this.setLink( x, AEApi.instance().storage().loadCraftingLink( link, this.owner ) ); } } public void writeToNBT(NBTTagCompound extra) { - for (int x = 0; x < size; x++) + for (int x = 0; x < this.size; x++) { - ICraftingLink link = getLink( x ); + ICraftingLink link = this.getLink( x ); if ( link != null ) { NBTTagCompound ln = new NBTTagCompound(); @@ -78,8 +78,8 @@ public class MultiCraftingTracker { if ( ais != null && d.simulateAdd( ais.getItemStack() ) == null ) { - Future craftingJob = getJob( x ); - if ( getLink( x ) != null ) + Future craftingJob = this.getJob( x ); + if ( this.getLink( x ) != null ) { return false; } @@ -93,8 +93,8 @@ public class MultiCraftingTracker if ( job != null ) { - setJob( x, null ); - setLink( x, cg.submitJob( job, owner, null, false, mySrc ) ); + this.setJob( x, null ); + this.setLink( x, cg.submitJob( job, this.owner, null, false, mySrc ) ); return true; } } @@ -109,11 +109,11 @@ public class MultiCraftingTracker } else { - if ( getLink( x ) == null ) + if ( this.getLink( x ) == null ) { IAEItemStack aisC = ais.copy(); aisC.setStackSize( itemToCraft ); - setJob( x, cg.beginCraftingJob( w, g, mySrc, aisC, null ) ); + this.setJob( x, cg.beginCraftingJob( w, g, mySrc, aisC, null ) ); } } } @@ -122,51 +122,51 @@ public class MultiCraftingTracker ICraftingLink getLink(int slot) { - if ( links == null ) + if ( this.links == null ) return null; - return links[slot]; + return this.links[slot]; } void setLink(int slot, ICraftingLink l) { - if ( links == null ) - links = new ICraftingLink[size]; + if ( this.links == null ) + this.links = new ICraftingLink[this.size]; - links[slot] = l; + this.links[slot] = l; boolean hasStuff = false; - for (int x = 0; x < links.length; x++) + for (int x = 0; x < this.links.length; x++) { - ICraftingLink g = links[x]; + ICraftingLink g = this.links[x]; if ( g == null || g.isCanceled() || g.isDone() ) - links[x] = null; + this.links[x] = null; else hasStuff = true; } if ( !hasStuff ) - links = null; + this.links = null; } Future getJob(int slot) { - if ( jobs == null ) + if ( this.jobs == null ) return null; - return jobs[slot]; + return this.jobs[slot]; } void setJob(int slot, Future l) { - if ( jobs == null ) - jobs = new Future[size]; + if ( this.jobs == null ) + this.jobs = new Future[this.size]; - jobs[slot] = l; + this.jobs[slot] = l; boolean hasStuff = false; - for (Future job : jobs) + for (Future job : this.jobs) { if ( job != null ) { @@ -175,26 +175,26 @@ public class MultiCraftingTracker } if ( !hasStuff ) - jobs = null; + this.jobs = null; } public ImmutableSet getRequestedJobs() { - if ( links == null ) + if ( this.links == null ) return ImmutableSet.of(); - return ImmutableSet.copyOf( new NonNullArrayIterator( links ) ); + return ImmutableSet.copyOf( new NonNullArrayIterator( this.links ) ); } public void jobStateChange(ICraftingLink link) { - if ( links != null ) + if ( this.links != null ) { - for (int x = 0; x < links.length; x++) + for (int x = 0; x < this.links.length; x++) { - if ( links[x] == link ) + if ( this.links[x] == link ) { - setLink( x, null ); + this.setLink( x, null ); return; } } @@ -203,11 +203,11 @@ public class MultiCraftingTracker public int getSlot(ICraftingLink link) { - if ( links != null ) + if ( this.links != null ) { - for (int x = 0; x < links.length; x++) + for (int x = 0; x < this.links.length; x++) { - if ( links[x] == link ) + if ( this.links[x] == link ) return x; } } @@ -217,31 +217,31 @@ public class MultiCraftingTracker public void cancel() { - if ( links != null ) + if ( this.links != null ) { - for (ICraftingLink l : links) + for (ICraftingLink l : this.links) { if ( l != null ) l.cancel(); } - links = null; + this.links = null; } - if ( jobs != null ) + if ( this.jobs != null ) { - for (Future l : jobs) + for (Future l : this.jobs) { if ( l != null ) l.cancel( true ); } - jobs = null; + this.jobs = null; } } public boolean isBusy(int slot) { - return getLink( slot ) != null || getJob( slot ) != null; + return this.getLink( slot ) != null || this.getJob( slot ) != null; } } diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index 2d3c9b120..9b76717a6 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -76,15 +76,15 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> (offset + 32)); + this.hash = (this.ref << offset) | (this.ref >> (offset + 32)); } @Override public int hashCode() { - return hash; + return this.hash; } @Override @@ -95,7 +95,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable in = new ArrayList(); List out = new ArrayList(); @@ -162,32 +162,32 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpOutputs = new HashMap(); - for (IAEItemStack io : outputs) + for (IAEItemStack io : this.outputs) { if ( io == null ) continue; @@ -214,7 +214,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpInputs = new HashMap(); - for (IAEItemStack io : inputs) + for (IAEItemStack io : this.inputs) { if ( io == null ) continue; @@ -230,25 +230,25 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable 0 ) - return outputs[0].getItemStack(); + if ( this.outputs != null && this.outputs.length > 0 ) + return this.outputs[0].getItemStack(); return null; } @@ -320,49 +320,49 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> target; public PlayerSecurityWrapper(HashMap> playerPerms) { - target = playerPerms; + this.target = playerPerms; } @Override public void addPlayer(int PlayerID, EnumSet permissions) { - target.put( PlayerID, permissions ); + this.target.put( PlayerID, permissions ); } } diff --git a/src/main/java/appeng/helpers/Splotch.java b/src/main/java/appeng/helpers/Splotch.java index 8d6f11391..3bba80e0c 100644 --- a/src/main/java/appeng/helpers/Splotch.java +++ b/src/main/java/appeng/helpers/Splotch.java @@ -27,8 +27,8 @@ public class Splotch { public Splotch(AEColor col, boolean lit, ForgeDirection side, Vec3 Pos) { - color = col; - lumen = lit; + this.color = col; + this.lumen = lit; double x, y; @@ -59,18 +59,18 @@ public class Splotch public Splotch(ByteBuf data) { - pos = data.readByte(); + this.pos = data.readByte(); int val = data.readByte(); - side = ForgeDirection.getOrientation( val & 0x07 ); - color = AEColor.values()[(val >> 3) & 0x0F]; - lumen = ((val >> 7) & 0x01) > 0; + this.side = ForgeDirection.getOrientation( val & 0x07 ); + this.color = AEColor.values()[(val >> 3) & 0x0F]; + this.lumen = ((val >> 7) & 0x01) > 0; } public void writeToStream(ByteBuf stream) { - stream.writeByte( pos ); - int val = side.ordinal() | (color.ordinal() << 3) | (lumen ? 0x80 : 0x00); + stream.writeByte( this.pos ); + int val = this.side.ordinal() | (this.color.ordinal() << 3) | (this.lumen ? 0x80 : 0x00); stream.writeByte( val ); } @@ -81,17 +81,17 @@ public class Splotch public float x() { - return (pos & 0x0f) / 15.0f; + return (this.pos & 0x0f) / 15.0f; } public float y() { - return ((pos >> 4) & 0x0f) / 15.0f; + return ((this.pos >> 4) & 0x0f) / 15.0f; } public int getSeed() { - int val = side.ordinal() | (color.ordinal() << 3) | (lumen ? 0x80 : 0x00); - return Math.abs( pos + val ); + int val = this.side.ordinal() | (this.color.ordinal() << 3) | (this.lumen ? 0x80 : 0x00); + return Math.abs( this.pos + val ); } } diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index 5f5d13530..e10e69653 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -66,20 +66,20 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost public double getRange() { - return myRange; + return this.myRange; } public WirelessTerminalGuiObject(IWirelessTermHandler wh, ItemStack is, EntityPlayer ep, World w, int x, int y, int z) { - encryptionKey = wh.getEncryptionKey( is ); - effectiveItem = is; - myPlayer = ep; - wth = wh; + this.encryptionKey = wh.getEncryptionKey( is ); + this.effectiveItem = is; + this.myPlayer = ep; + this.wth = wh; Object obj = null; try { - long encKey = Long.parseLong( encryptionKey ); + long encKey = Long.parseLong( this.encryptionKey ); obj = AEApi.instance().registries().locatable().findLocatableBySerial( encKey ); } catch (NumberFormatException err) @@ -92,12 +92,12 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost IGridNode n = ((IGridHost) obj).getGridNode( ForgeDirection.UNKNOWN ); if ( n != null ) { - targetGrid = n.getGrid(); - if ( targetGrid != null ) + this.targetGrid = n.getGrid(); + if ( this.targetGrid != null ) { - sg = targetGrid.getCache( IStorageGrid.class ); - if ( sg != null ) - itemStorage = sg.getItemInventory(); + this.sg = this.targetGrid.getCache( IStorageGrid.class ); + if ( this.sg != null ) + this.itemStorage = this.sg.getItemInventory(); } } } @@ -105,32 +105,32 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost public boolean rangeCheck() { - sqRange = myRange = Double.MAX_VALUE; + this.sqRange = this.myRange = Double.MAX_VALUE; - if ( targetGrid != null && itemStorage != null ) + if ( this.targetGrid != null && this.itemStorage != null ) { - if ( myWap != null ) + if ( this.myWap != null ) { - if ( myWap.getGrid() == targetGrid ) + if ( this.myWap.getGrid() == this.targetGrid ) { - if ( testWap( myWap ) ) + if ( this.testWap( this.myWap ) ) return true; } return false; } - IMachineSet tw = targetGrid.getMachines( TileWireless.class ); + IMachineSet tw = this.targetGrid.getMachines( TileWireless.class ); - myWap = null; + this.myWap = null; for (IGridNode n : tw) { IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); - if ( testWap( wap ) ) - myWap = wap; + if ( this.testWap( wap ) ) + this.myWap = wap; } - return myWap != null; + return this.myWap != null; } return false; } @@ -142,19 +142,19 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost DimensionalCoord dc = wap.getLocation(); - if ( dc.getWorld() == myPlayer.worldObj ) + if ( dc.getWorld() == this.myPlayer.worldObj ) { - double offX = dc.x - myPlayer.posX; - double offY = dc.y - myPlayer.posY; - double offZ = dc.z - myPlayer.posZ; + double offX = dc.x - this.myPlayer.posX; + double offY = dc.y - this.myPlayer.posY; + double offZ = dc.z - this.myPlayer.posZ; double r = offX * offX + offY * offY + offZ * offZ; - if ( r < rangeLimit && sqRange > r ) + if ( r < rangeLimit && this.sqRange > r ) { if ( wap.isActive() ) { - sqRange = r; - myRange = Math.sqrt( r ); + this.sqRange = r; + this.myRange = Math.sqrt( r ); return true; } } @@ -165,121 +165,121 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost @Override public IMEMonitor getItemInventory() { - if ( sg == null ) + if ( this.sg == null ) return null; - return sg.getItemInventory(); + return this.sg.getItemInventory(); } @Override public IMEMonitor getFluidInventory() { - if ( sg == null ) + if ( this.sg == null ) return null; - return sg.getFluidInventory(); + return this.sg.getFluidInventory(); } @Override public void addListener(IMEMonitorHandlerReceiver l, Object verificationToken) { - if ( itemStorage != null ) - itemStorage.addListener( l, verificationToken ); + if ( this.itemStorage != null ) + this.itemStorage.addListener( l, verificationToken ); } @Override public void removeListener(IMEMonitorHandlerReceiver l) { - if ( itemStorage != null ) - itemStorage.removeListener( l ); + if ( this.itemStorage != null ) + this.itemStorage.removeListener( l ); } @Override public IItemList getAvailableItems(IItemList out) { - if ( itemStorage != null ) - return itemStorage.getAvailableItems( out ); + if ( this.itemStorage != null ) + return this.itemStorage.getAvailableItems( out ); return out; } @Override public IItemList getStorageList() { - if ( itemStorage != null ) - return itemStorage.getStorageList(); + if ( this.itemStorage != null ) + return this.itemStorage.getStorageList(); return null; } @Override public AccessRestriction getAccess() { - if ( itemStorage != null ) - return itemStorage.getAccess(); + if ( this.itemStorage != null ) + return this.itemStorage.getAccess(); return AccessRestriction.NO_ACCESS; } @Override public boolean isPrioritized(IAEItemStack input) { - if ( itemStorage != null ) - return itemStorage.isPrioritized( input ); + if ( this.itemStorage != null ) + return this.itemStorage.isPrioritized( input ); return false; } @Override public boolean canAccept(IAEItemStack input) { - if ( itemStorage != null ) - return itemStorage.canAccept( input ); + if ( this.itemStorage != null ) + return this.itemStorage.canAccept( input ); return false; } @Override public int getPriority() { - if ( itemStorage != null ) - return itemStorage.getPriority(); + if ( this.itemStorage != null ) + return this.itemStorage.getPriority(); return 0; } @Override public int getSlot() { - if ( itemStorage != null ) - return itemStorage.getSlot(); + if ( this.itemStorage != null ) + return this.itemStorage.getSlot(); return 0; } @Override public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) { - if ( itemStorage != null ) - return itemStorage.injectItems( input, type, src ); + if ( this.itemStorage != null ) + return this.itemStorage.injectItems( input, type, src ); return input; } @Override public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) { - if ( itemStorage != null ) - return itemStorage.extractItems( request, mode, src ); + if ( this.itemStorage != null ) + return this.itemStorage.extractItems( request, mode, src ); return null; } @Override public StorageChannel getChannel() { - if ( itemStorage != null ) - return itemStorage.getChannel(); + if ( this.itemStorage != null ) + return this.itemStorage.getChannel(); return StorageChannel.ITEMS; } @Override public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) { - if ( wth != null && effectiveItem != null ) + if ( this.wth != null && this.effectiveItem != null ) { if ( mode == Actionable.SIMULATE ) - return wth.hasPower( myPlayer, amt, getItemStack() ) ? amt : 0; - return wth.usePower( myPlayer, amt, getItemStack() ) ? amt : 0; + return this.wth.hasPower( this.myPlayer, amt, this.getItemStack() ) ? amt : 0; + return this.wth.usePower( this.myPlayer, amt, this.getItemStack() ) ? amt : 0; } return 0.0; } @@ -287,13 +287,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost @Override public ItemStack getItemStack() { - return effectiveItem; + return this.effectiveItem; } @Override public IConfigManager getConfigManager() { - return wth.getConfigManager( effectiveItem ); + return this.wth.getConfigManager( this.effectiveItem ); } @Override @@ -317,16 +317,16 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost @Override public IGridNode getActionableNode() { - rangeCheck(); - if ( myWap != null ) - return myWap.getActionableNode(); + this.rangeCheck(); + if ( this.myWap != null ) + return this.myWap.getActionableNode(); return null; } @Override public boolean validForPass(int i) { - return itemStorage.validForPass( i ); + return this.itemStorage.validForPass( i ); } } diff --git a/src/main/java/appeng/hooks/AETrading.java b/src/main/java/appeng/hooks/AETrading.java index 313e6f8a9..a269295c1 100644 --- a/src/main/java/appeng/hooks/AETrading.java +++ b/src/main/java/appeng/hooks/AETrading.java @@ -55,7 +55,7 @@ public class AETrading implements IVillageTradeHandler From.stackSize = 1 + (Math.abs( rand.nextInt() ) % (1 + conversion_Variance)); To.stackSize = 1; - addToList( list, From, To ); + this.addToList( list, From, To ); } private void addMerchant(MerchantRecipeList list, ItemStack item, int emera, Random rand, int greed) @@ -80,7 +80,7 @@ public class AETrading implements IVillageTradeHandler To.stackSize -= To.stackSize; } - addToList( list, From, To ); + this.addToList( list, From, To ); // Buy ItemStack reverseTo = From.copy(); @@ -88,17 +88,17 @@ public class AETrading implements IVillageTradeHandler reverseFrom.stackSize = (int) (reverseFrom.stackSize * (rand.nextFloat() * 3.0f + 1.0f)); - addToList( list, reverseFrom, reverseTo ); + this.addToList( list, reverseFrom, reverseTo ); } @Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - addMerchant( recipeList, AEApi.instance().materials().materialSilicon.stack( 1 ), 1, random, 2 ); - addMerchant( recipeList, AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), 2, random, 4 ); - addMerchant( recipeList, AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ), 1, random, 3 ); + this.addMerchant( recipeList, AEApi.instance().materials().materialSilicon.stack( 1 ), 1, random, 2 ); + this.addMerchant( recipeList, AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), 2, random, 4 ); + this.addMerchant( recipeList, AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ), 1, random, 3 ); - addTrade( recipeList, AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ), + this.addTrade( recipeList, AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ), AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), random, 2 ); } diff --git a/src/main/java/appeng/hooks/CompassManager.java b/src/main/java/appeng/hooks/CompassManager.java index 502169faa..e00c94b6a 100644 --- a/src/main/java/appeng/hooks/CompassManager.java +++ b/src/main/java/appeng/hooks/CompassManager.java @@ -39,16 +39,16 @@ public class CompassManager public CompassRequest(long attunement, int x, int y, int z) { this.attunement = attunement; - cx = x >> 4; - cdy = y >> 5; - cz = z >> 4; - hash = ((Integer) cx).hashCode() ^ ((Integer) cdy).hashCode() ^ ((Integer) cz).hashCode() ^ ((Long) attunement).hashCode(); + this.cx = x >> 4; + this.cdy = y >> 5; + this.cz = z >> 4; + this.hash = ((Integer) this.cx).hashCode() ^ ((Integer) this.cdy).hashCode() ^ ((Integer) this.cz).hashCode() ^ ((Long) attunement).hashCode(); } @Override public int hashCode() { - return hash; + return this.hash; } @Override @@ -56,10 +56,10 @@ public class CompassManager { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; CompassRequest other = (CompassRequest) obj; - return attunement == other.attunement && cx == other.cx && cdy == other.cdy && cz == other.cz; + return this.attunement == other.attunement && this.cx == other.cx && this.cdy == other.cdy && this.cz == other.cz; } } @@ -69,14 +69,14 @@ public class CompassManager public void postResult(long attunement, int x, int y, int z, CompassResult result) { CompassRequest r = new CompassRequest( attunement, x, y, z ); - requests.put( r, result ); + this.requests.put( r, result ); } public CompassResult getCompassDirection(long attunement, int x, int y, int z) { long now = System.currentTimeMillis(); - Iterator i = requests.values().iterator(); + Iterator i = this.requests.values().iterator(); while (i.hasNext()) { CompassResult res = i.next(); @@ -86,20 +86,20 @@ public class CompassManager } CompassRequest r = new CompassRequest( attunement, x, y, z ); - CompassResult res = requests.get( r ); + CompassResult res = this.requests.get( r ); if ( res == null ) { res = new CompassResult( false, true, 0 ); - requests.put( r, res ); - requestUpdate( r ); + this.requests.put( r, res ); + this.requestUpdate( r ); } else if ( now - res.time > 1000 * 3 ) { if ( !res.requested ) { res.requested = true; - requestUpdate( r ); + this.requestUpdate( r ); } } diff --git a/src/main/java/appeng/hooks/MeteoriteWorldGen.java b/src/main/java/appeng/hooks/MeteoriteWorldGen.java index 9e9475b3b..76c2bc38b 100644 --- a/src/main/java/appeng/hooks/MeteoriteWorldGen.java +++ b/src/main/java/appeng/hooks/MeteoriteWorldGen.java @@ -46,9 +46,9 @@ final public class MeteoriteWorldGen implements IWorldGenerator public void calculatedDirection(boolean hasResult, boolean spin, double radians, double dist) { if ( hasResult ) - distance = dist; + this.distance = dist; else - distance = Double.MAX_VALUE; + this.distance = Double.MAX_VALUE; } } @@ -92,27 +92,27 @@ final public class MeteoriteWorldGen implements IWorldGenerator @Override public Object call() throws Exception { - int chunkX = x >> 4; - int chunkZ = z >> 4; + int chunkX = this.x >> 4; + int chunkZ = this.z >> 4; double minSqDist = Double.MAX_VALUE; // near by meteorites! - for (NBTTagCompound data : getNearByMeteorites( w, chunkX, chunkZ )) + for (NBTTagCompound data : MeteoriteWorldGen.this.getNearByMeteorites( this.w, chunkX, chunkZ )) { MeteoritePlacer mp = new MeteoritePlacer(); - mp.spawnMeteorite( new MeteoritePlacer.ChunkOnly( w, chunkX, chunkZ ), data ); + mp.spawnMeteorite( new MeteoritePlacer.ChunkOnly( this.w, chunkX, chunkZ ), data ); - minSqDist = Math.min( minSqDist, mp.getSqDistance( x, z ) ); + minSqDist = Math.min( minSqDist, mp.getSqDistance( this.x, this.z ) ); } boolean isCluster = (minSqDist < 30 * 30) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance; if ( minSqDist > AEConfig.instance.minMeteoriteDistanceSq || isCluster ) - tryMeteorite( w, depth, x, z ); + MeteoriteWorldGen.this.tryMeteorite( this.w, this.depth, this.x, this.z ); - WorldSettings.getInstance().setGenerated( w.provider.dimensionId, chunkX, chunkZ ); - WorldSettings.getInstance().getCompass().updateArea( w, chunkX, chunkZ ); + WorldSettings.getInstance().setGenerated( this.w.provider.dimensionId, chunkX, chunkZ ); + WorldSettings.getInstance().getCompass().updateArea( this.w, chunkX, chunkZ ); return null; } diff --git a/src/main/java/appeng/hooks/QuartzWorldGen.java b/src/main/java/appeng/hooks/QuartzWorldGen.java index be89841b2..07aa79817 100644 --- a/src/main/java/appeng/hooks/QuartzWorldGen.java +++ b/src/main/java/appeng/hooks/QuartzWorldGen.java @@ -43,11 +43,11 @@ final public class QuartzWorldGen implements IWorldGenerator if ( normal != null && charged != null ) { - oreNormal = new WorldGenMinable( normal, 0, AEConfig.instance.quartzOresPerCluster, Blocks.stone ); - oreCharged = new WorldGenMinable( charged, 0, AEConfig.instance.quartzOresPerCluster, Blocks.stone ); + this.oreNormal = new WorldGenMinable( normal, 0, AEConfig.instance.quartzOresPerCluster, Blocks.stone ); + this.oreCharged = new WorldGenMinable( charged, 0, AEConfig.instance.quartzOresPerCluster, Blocks.stone ); } else - oreNormal = oreCharged = null; + this.oreNormal = this.oreCharged = null; } @Override @@ -62,7 +62,7 @@ final public class QuartzWorldGen implements IWorldGenerator seaLevel = w.getHeightValue( x, z ); } - if ( oreNormal == null || oreCharged == null ) + if ( this.oreNormal == null || this.oreCharged == null ) return; double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; @@ -71,7 +71,7 @@ final public class QuartzWorldGen implements IWorldGenerator for (int x = 0; x < (r.nextBoolean() ? scale * 2 : scale) / 2; ++x) { boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; - WorldGenMinable whichOre = isCharged ? oreCharged : oreNormal; + WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; if ( WorldGenRegistry.instance.isWorldGenEnabled( isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w ) ) { diff --git a/src/main/java/appeng/hooks/TickHandler.java b/src/main/java/appeng/hooks/TickHandler.java index e88d5ebd2..0f29242cb 100644 --- a/src/main/java/appeng/hooks/TickHandler.java +++ b/src/main/java/appeng/hooks/TickHandler.java @@ -67,8 +67,8 @@ public class TickHandler public void clear() { - tiles = new LinkedList(); - networks = new NetworkList(); + this.tiles = new LinkedList(); + this.networks = new NetworkList(); } } @@ -90,13 +90,13 @@ public class TickHandler public PacketPaintedEntity getPacket() { - return new PacketPaintedEntity( myEntity, myColor, ticksLeft ); + return new PacketPaintedEntity( this.myEntity, this.myColor, this.ticksLeft ); } public PlayerColor(int id, AEColor col, int ticks) { - myEntity = id; - myColor = col; - ticksLeft = ticks; + this.myEntity = id; + this.myColor = col; + this.ticksLeft = ticks; } } @@ -107,8 +107,8 @@ public class TickHandler public HashMap getPlayerColors() { if ( Platform.isServer() ) - return srvPlayerColors; - return cliPlayerColors; + return this.srvPlayerColors; + return this.cliPlayerColors; } private void tickColors(HashMap playerSet) @@ -125,20 +125,20 @@ public class TickHandler HandlerRep getRepo() { if ( Platform.isServer() ) - return server; - return client; + return this.server; + return this.client; } public void addCallable(World w, Callable c) { if ( w == null ) - serverQueue.add( c ); + this.serverQueue.add( c ); else { - Queue queue = callQueue.get( w ); + Queue queue = this.callQueue.get( w ); if ( queue == null ) - callQueue.put( w, queue = new LinkedList() ); + this.callQueue.put( w, queue = new LinkedList() ); queue.add( c ); } @@ -147,29 +147,29 @@ public class TickHandler public void addInit(AEBaseTile tile) { if ( Platform.isServer() ) // for no there is no reason to care about this on the client... - getRepo().tiles.add( tile ); + this.getRepo().tiles.add( tile ); } public void addNetwork(Grid grid) { if ( Platform.isServer() ) // for no there is no reason to care about this on the client... - getRepo().networks.add( grid ); + this.getRepo().networks.add( grid ); } public void removeNetwork(Grid grid) { if ( Platform.isServer() ) // for no there is no reason to care about this on the client... - getRepo().networks.remove( grid ); + this.getRepo().networks.remove( grid ); } public Iterable getGridList() { - return getRepo().networks; + return this.getRepo().networks; } public void shutdown() { - getRepo().clear(); + this.getRepo().clear(); } @SubscribeEvent @@ -179,7 +179,7 @@ public class TickHandler { LinkedList toDestroy = new LinkedList(); - for (Grid g : getRepo().networks) + for (Grid g : this.getRepo().networks) { for (IGridNode n : g.getNodes()) { @@ -213,12 +213,12 @@ public class TickHandler if ( ev.type == Type.CLIENT && ev.phase == Phase.START ) { - tickColors( cliPlayerColors ); + this.tickColors( this.cliPlayerColors ); EntityFloatingItem.ageStatic = (EntityFloatingItem.ageStatic + 1) % 60000; CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode(); - if ( currentMode != crm ) + if ( currentMode != this.crm ) { - crm = currentMode; + this.crm = currentMode; CommonHelper.proxy.triggerUpdates(); } } @@ -226,9 +226,9 @@ public class TickHandler if ( ev.type == Type.WORLD && ev.phase == Phase.END ) { WorldTickEvent wte = (WorldTickEvent) ev; - synchronized (craftingJobs) + synchronized (this.craftingJobs) { - Collection jobSet = craftingJobs.get( wte.world ); + Collection jobSet = this.craftingJobs.get( wte.world ); if ( !jobSet.isEmpty() ) { int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() ); @@ -246,9 +246,9 @@ public class TickHandler // for no there is no reason to care about this on the client... else if ( ev.type == Type.SERVER && ev.phase == Phase.END ) { - tickColors( srvPlayerColors ); + this.tickColors( this.srvPlayerColors ); // ready tiles. - HandlerRep repo = getRepo(); + HandlerRep repo = this.getRepo(); while (!repo.tiles.isEmpty()) { AEBaseTile bt = repo.tiles.poll(); @@ -257,17 +257,17 @@ public class TickHandler } // tick networks. - for (Grid g : getRepo().networks) + for (Grid g : this.getRepo().networks) g.update(); // cross world queue. - processQueue( serverQueue ); + this.processQueue( this.serverQueue ); } // world synced queue(s) if ( ev.type == Type.WORLD && ev.phase == Phase.START ) { - processQueue( callQueue.get( ((WorldTickEvent) ev).world ) ); + this.processQueue( this.callQueue.get( ((WorldTickEvent) ev).world ) ); } } @@ -303,9 +303,9 @@ public class TickHandler public void registerCraftingSimulation(World world, CraftingJob craftingJob) { - synchronized (craftingJobs) + synchronized (this.craftingJobs) { - craftingJobs.put( world, craftingJob ); + this.craftingJobs.put( world, craftingJob ); } } diff --git a/src/main/java/appeng/integration/IntegrationNode.java b/src/main/java/appeng/integration/IntegrationNode.java index cdac777f7..107f4283c 100644 --- a/src/main/java/appeng/integration/IntegrationNode.java +++ b/src/main/java/appeng/integration/IntegrationNode.java @@ -53,14 +53,14 @@ public class IntegrationNode @Override public String toString() { - return shortName.name() + ':' + state.name(); + return this.shortName.name() + ':' + this.state.name(); } void Call(IntegrationStage stage) { - if ( state != IntegrationStage.FAILED ) + if ( this.state != IntegrationStage.FAILED ) { - if ( state.ordinal() > stage.ordinal() ) + if ( this.state.ordinal() > stage.ordinal() ) return; try @@ -69,13 +69,13 @@ public class IntegrationNode { case PRE_INIT: - boolean enabled = modID == null || Loader.isModLoaded( modID ); + boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ); AEConfig.instance .addCustomCategoryComment( "ModIntegration", "Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." ); - String Mode = AEConfig.instance.get( "ModIntegration", displayName.replace( " ", "" ), "AUTO" ).getString(); + String Mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString(); if ( Mode.toUpperCase().equals( "ON" ) ) enabled = true; @@ -84,25 +84,25 @@ public class IntegrationNode if ( enabled ) { - classValue = getClass().getClassLoader().loadClass( name ); - mod = (IIntegrationModule) classValue.getConstructor().newInstance(); - Field f = classValue.getField( "instance" ); - f.set( classValue, instance = mod ); + this.classValue = this.getClass().getClassLoader().loadClass( this.name ); + this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance(); + Field f = this.classValue.getField( "instance" ); + f.set( this.classValue, this.instance = this.mod ); } else - throw new ModNotInstalled( modID ); + throw new ModNotInstalled( this.modID ); - state = IntegrationStage.INIT; + this.state = IntegrationStage.INIT; break; case INIT: - mod.Init(); - state = IntegrationStage.POST_INIT; + this.mod.Init(); + this.state = IntegrationStage.POST_INIT; break; case POST_INIT: - mod.PostInit(); - state = IntegrationStage.READY; + this.mod.PostInit(); + this.state = IntegrationStage.READY; break; case FAILED: @@ -112,33 +112,33 @@ public class IntegrationNode } catch (Throwable t) { - failedStage = stage; - exception = t; - state = IntegrationStage.FAILED; + this.failedStage = stage; + this.exception = t; + this.state = IntegrationStage.FAILED; } } if ( stage == IntegrationStage.POST_INIT ) { - if ( state == IntegrationStage.FAILED ) + if ( this.state == IntegrationStage.FAILED ) { - AELog.info( displayName + " - Integration Disabled" ); - if ( !(exception instanceof ModNotInstalled) ) - AELog.integration( exception ); + AELog.info( this.displayName + " - Integration Disabled" ); + if ( !(this.exception instanceof ModNotInstalled) ) + AELog.integration( this.exception ); } else { - AELog.info( displayName + " - Integration Enable" ); + AELog.info( this.displayName + " - Integration Enable" ); } } } public boolean isActive() { - if ( state == IntegrationStage.PRE_INIT ) - Call( IntegrationStage.PRE_INIT ); + if ( this.state == IntegrationStage.PRE_INIT ) + this.Call( IntegrationStage.PRE_INIT ); - return state != IntegrationStage.FAILED; + return this.state != IntegrationStage.FAILED; } } diff --git a/src/main/java/appeng/integration/IntegrationRegistry.java b/src/main/java/appeng/integration/IntegrationRegistry.java index 214d5e9c0..ef6c2a3b4 100644 --- a/src/main/java/appeng/integration/IntegrationRegistry.java +++ b/src/main/java/appeng/integration/IntegrationRegistry.java @@ -39,21 +39,21 @@ public enum IntegrationRegistry if ( type.side == IntegrationSide.SERVER && FMLLaunchHandler.side() == Side.CLIENT ) return; - modules.add( new IntegrationNode( type.dspName, type.modID, type, "appeng.integration.modules." + type.name() ) ); + this.modules.add( new IntegrationNode( type.dspName, type.modID, type, "appeng.integration.modules." + type.name() ) ); } public void init() { - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) node.Call( IntegrationStage.PRE_INIT ); - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) node.Call( IntegrationStage.INIT ); } public void postInit() { - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) node.Call( IntegrationStage.POST_INIT ); } @@ -61,7 +61,7 @@ public enum IntegrationRegistry { String out = null; - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) { String str = node.shortName + ":" + ( node.state == IntegrationStage.FAILED ? "OFF" : "ON" ); @@ -76,7 +76,7 @@ public enum IntegrationRegistry public boolean isEnabled( IntegrationType name ) { - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) { if ( node.shortName == name ) return node.isActive(); @@ -86,7 +86,7 @@ public enum IntegrationRegistry public Object getInstance( IntegrationType name ) { - for ( IntegrationNode node : modules ) + for ( IntegrationNode node : this.modules ) { if ( node.shortName.equals( name ) && node.isActive() ) { diff --git a/src/main/java/appeng/integration/modules/BC.java b/src/main/java/appeng/integration/modules/BC.java index c0999ad21..3295894da 100644 --- a/src/main/java/appeng/integration/modules/BC.java +++ b/src/main/java/appeng/integration/modules/BC.java @@ -64,9 +64,9 @@ public class BC extends BaseModule implements IBC public static BC instance; public BC() { - TestClass( IPipeConnection.class ); - TestClass( ItemFacade.class ); - TestClass( IToolWrench.class ); + this.TestClass( IPipeConnection.class ); + this.TestClass( ItemFacade.class ); + this.TestClass( IToolWrench.class ); } @Override @@ -231,14 +231,14 @@ public class BC extends BaseModule implements IBC AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() ); Blocks b = AEApi.instance().blocks(); - addFacade( b.blockFluix.stack( 1 ) ); - addFacade( b.blockQuartz.stack( 1 ) ); - addFacade( b.blockQuartzChiseled.stack( 1 ) ); - addFacade( b.blockQuartzPillar.stack( 1 ) ); + this.addFacade( b.blockFluix.stack( 1 ) ); + this.addFacade( b.blockQuartz.stack( 1 ) ); + this.addFacade( b.blockQuartzChiseled.stack( 1 ) ); + this.addFacade( b.blockQuartzPillar.stack( 1 ) ); try { - initBuilderSupport(); + this.initBuilderSupport(); } catch (Throwable builderSupport) { @@ -248,10 +248,10 @@ public class BC extends BaseModule implements IBC Block skyStone = b.blockSkyStone.block(); if ( skyStone != null ) { - addFacade( new ItemStack( skyStone, 1, 0 ) ); - addFacade( new ItemStack( skyStone, 1, 1 ) ); - addFacade( new ItemStack( skyStone, 1, 2 ) ); - addFacade( new ItemStack( skyStone, 1, 3 ) ); + this.addFacade( new ItemStack( skyStone, 1, 0 ) ); + this.addFacade( new ItemStack( skyStone, 1, 1 ) ); + this.addFacade( new ItemStack( skyStone, 1, 2 ) ); + this.addFacade( new ItemStack( skyStone, 1, 3 ) ); } } @@ -294,9 +294,9 @@ public class BC extends BaseModule implements IBC @Override public void PostInit() { - registerPowerP2P(); - registerItemP2P(); - registerLiquidsP2P(); + this.registerPowerP2P(); + this.registerItemP2P(); + this.registerLiquidsP2P(); } @Override diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java index 879664812..9ba13cb61 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java @@ -43,12 +43,12 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar public void rotateLeft(IBuilderContext context) { CableBusContainer cbc = new CableBusContainer( this ); - cbc.readFromNBT( tileNBT ); + cbc.readFromNBT( this.tileNBT ); cbc.rotateLeft(); - tileNBT = new NBTTagCompound(); - cbc.writeToNBT( tileNBT ); + this.tileNBT = new NBTTagCompound(); + cbc.writeToNBT( this.tileNBT ); } @Override diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java index f6443246e..e3316e9d3 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java @@ -42,16 +42,16 @@ public class AEGenericSchematicTile extends SchematicTile tcb.getDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, list ); } - storedRequirements = list.toArray( new ItemStack[list.size()] ); + this.storedRequirements = list.toArray( new ItemStack[list.size()] ); } @Override public void rotateLeft(IBuilderContext context) { - if ( tileNBT.hasKey( "orientation_forward" ) && tileNBT.hasKey( "orientation_up" ) ) + if ( this.tileNBT.hasKey( "orientation_forward" ) && this.tileNBT.hasKey( "orientation_up" ) ) { - String forward = tileNBT.getString( "orientation_forward" ); - String up = tileNBT.getString( "orientation_up" ); + String forward = this.tileNBT.getString( "orientation_forward" ); + String up = this.tileNBT.getString( "orientation_up" ); if ( forward != null && up != null ) { @@ -63,8 +63,8 @@ public class AEGenericSchematicTile extends SchematicTile fdForward = Platform.rotateAround( fdForward, ForgeDirection.DOWN ); fdUp = Platform.rotateAround( fdUp, ForgeDirection.DOWN ); - tileNBT.setString( "orientation_forward", fdForward.name() ); - tileNBT.setString( "orientation_up", fdUp.name() ); + this.tileNBT.setString( "orientation_forward", fdForward.name() ); + this.tileNBT.setString( "orientation_up", fdUp.name() ); } catch (Throwable ignored) { diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java index 95597bbe5..fe470447f 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java @@ -29,10 +29,10 @@ public class AERotatableBlockSchematic extends SchematicBlock @Override public void rotateLeft(IBuilderContext context) { - if ( meta < 6 ) + if ( this.meta < 6 ) { - ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[meta], ForgeDirection.DOWN ); - meta = d.ordinal(); + ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN ); + this.meta = d.ordinal(); } } diff --git a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java index 0e69f3af9..2f29d8db7 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java @@ -35,8 +35,8 @@ public class BCPipeInventory implements IMEInventory final ForgeDirection dir; public BCPipeInventory(TileEntity _te, ForgeDirection _dir) { - te = _te; - dir = _dir; + this.te = _te; + this.dir = _dir; } @Override @@ -50,12 +50,12 @@ public class BCPipeInventory implements IMEInventory { if ( mode == Actionable.SIMULATE ) { - if ( BC.instance.canAddItemsToPipe( te, input.getItemStack(), dir ) ) + if ( BC.instance.canAddItemsToPipe( this.te, input.getItemStack(), this.dir ) ) return null; return input; } - if ( BC.instance.addItemsToPipe( te, input.getItemStack(), dir ) ) + if ( BC.instance.addItemsToPipe( this.te, input.getItemStack(), this.dir ) ) return null; return input; } diff --git a/src/main/java/appeng/integration/modules/CLApi.java b/src/main/java/appeng/integration/modules/CLApi.java index 25912a0d7..e2303dc2f 100644 --- a/src/main/java/appeng/integration/modules/CLApi.java +++ b/src/main/java/appeng/integration/modules/CLApi.java @@ -30,7 +30,7 @@ public class CLApi extends BaseModule implements ICLApi @Override public void Init() throws Throwable { - TestClass( coloredlightscore.src.api.CLApi.class ); + this.TestClass( coloredlightscore.src.api.CLApi.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index ec1485d8d..2f6b92318 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -90,38 +90,38 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul @Override public void generateRecipes(RecipeGenerator generator) { - parent = generator; + this.parent = generator; RecipeTemplate craftingTemplate; RecipeTemplate smallCraftingTemplate; if ( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle ) { - craftingTemplate = generator.createRecipeTemplate( craftingSlotsOwnBackground, null ); - smallCraftingTemplate = generator.createRecipeTemplate( smallCraftingSlotsOwnBackground, null ); + craftingTemplate = generator.createRecipeTemplate( this.craftingSlotsOwnBackground, null ); + smallCraftingTemplate = generator.createRecipeTemplate( this.smallCraftingSlotsOwnBackground, null ); } else { - craftingTemplate = new DefaultRecipeTemplate( craftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( + craftingTemplate = new DefaultRecipeTemplate( this.craftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, 79, 58 ) ); - smallCraftingTemplate = new DefaultRecipeTemplate( smallCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( + smallCraftingTemplate = new DefaultRecipeTemplate( this.smallCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, 79, 58 ) ); } - RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( shapelessCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( + RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( this.shapelessCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, 79, 58 ) ); - RecipeTemplate furnaceTemplate = new DefaultRecipeTemplate( furnaceSlots, new ItemStack( Blocks.furnace ), new TextureClip( + RecipeTemplate furnaceTemplate = new DefaultRecipeTemplate( this.furnaceSlots, new ItemStack( Blocks.furnace ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 181, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 181, 79, 58 ) ); - addCraftingRecipes( craftingTemplate, smallCraftingTemplate, shapelessTemplate, this ); - addGrinderRecipes( furnaceTemplate, this ); - addInscriberRecipes( furnaceTemplate, this ); + this.addCraftingRecipes( craftingTemplate, smallCraftingTemplate, shapelessTemplate, this ); + this.addGrinderRecipes( furnaceTemplate, this ); + this.addInscriberRecipes( furnaceTemplate, this ); } private void addCraftingRecipes(RecipeTemplate template, RecipeTemplate templateSmall, RecipeTemplate templateShapeless, RecipeGenerator generator) @@ -183,46 +183,46 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul @Override public RecipeTemplate createRecipeTemplate(Slot[] slots, ItemStack craftingType) { - return parent.createRecipeTemplate( slots, craftingType ); + return this.parent.createRecipeTemplate( slots, craftingType ); } @Override public RecipeTemplate createRecipeTemplate(Slot[] slots, ItemStack craftingType, String backgroundTexture, int backgroundX, int backgroundY, int backgroundSelectedX, int backgroundSelectedY) { - return parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedX, backgroundSelectedY ); + return this.parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedX, backgroundSelectedY ); } @Override public RecipeTemplate createRecipeTemplate(Slot[] slots, ItemStack craftingType, String backgroundTexture, int backgroundX, int backgroundY, String backgroundSelectedTexture, int backgroundSelectedX, int backgroundSelectedY) { - return parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedTexture, backgroundSelectedX, + return this.parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedTexture, backgroundSelectedX, backgroundSelectedY ); } @Override public void addRecipe(RecipeTemplate template, Object[] crafting) { - parent.addRecipe( template, crafting ); + this.parent.addRecipe( template, crafting ); } @Override public void addRecipe(CraftGuideRecipe recipe, ItemStack craftingType) { - parent.addRecipe( recipe, craftingType ); + this.parent.addRecipe( recipe, craftingType ); } @Override public void setDefaultTypeVisibility(ItemStack type, boolean visible) { - parent.setDefaultTypeVisibility( type, visible ); + this.parent.setDefaultTypeVisibility( type, visible ); } @Override public Object[] getCraftingRecipe(IRecipe recipe) { - return getCraftingRecipe( recipe, true ); + return this.getCraftingRecipe( recipe, true ); } Object[] getCraftingShapelessRecipe(List items, ItemStack recipeOutput) @@ -240,7 +240,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul { try { - output[i] = toCG( ((IIngredient) output[i]).getItemStackSet() ); + output[i] = this.toCG( ((IIngredient) output[i]).getItemStackSet() ); } catch (RegistrationError ignored) { @@ -275,7 +275,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul { try { - output[i] = toCG( ((IIngredient) output[i]).getItemStackSet() ); + output[i] = this.toCG( ((IIngredient) output[i]).getItemStackSet() ); } catch (RegistrationError ignored) { @@ -311,7 +311,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul { try { - output[i] = toCG( ((IIngredient) output[i]).getItemStackSet() ); + output[i] = this.toCG( ((IIngredient) output[i]).getItemStackSet() ); } catch (RegistrationError ignored) { @@ -349,7 +349,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul if ( recipe instanceof ShapelessRecipe ) { List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" ); - return getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); + return this.getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); } else if ( recipe instanceof ShapedRecipe ) { @@ -359,11 +359,11 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul if ( allowSmallGrid && width < 3 && height < 3 ) { - return getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); + return this.getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } else { - return getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); + return this.getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } } diff --git a/src/main/java/appeng/integration/modules/DSU.java b/src/main/java/appeng/integration/modules/DSU.java index 352a385cf..28028e553 100644 --- a/src/main/java/appeng/integration/modules/DSU.java +++ b/src/main/java/appeng/integration/modules/DSU.java @@ -50,7 +50,7 @@ public class DSU extends BaseModule implements IDSU @Override public void Init() { - TestClass( IDeepStorageUnit.class ); + this.TestClass( IDeepStorageUnit.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/FMP.java b/src/main/java/appeng/integration/modules/FMP.java index 51273a810..466a9bdbd 100644 --- a/src/main/java/appeng/integration/modules/FMP.java +++ b/src/main/java/appeng/integration/modules/FMP.java @@ -83,13 +83,13 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF @Override public void Init() throws Throwable { - createAndRegister( AEApi.instance().blocks().blockQuartz.block(), 0 ); - createAndRegister( AEApi.instance().blocks().blockQuartzPillar.block(), 0 ); - createAndRegister( AEApi.instance().blocks().blockQuartzChiseled.block(), 0 ); - createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 0 ); - createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 1 ); - createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 2 ); - createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 3 ); + this.createAndRegister( AEApi.instance().blocks().blockQuartz.block(), 0 ); + this.createAndRegister( AEApi.instance().blocks().blockQuartzPillar.block(), 0 ); + this.createAndRegister( AEApi.instance().blocks().blockQuartzChiseled.block(), 0 ); + this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 0 ); + this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 1 ); + this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 2 ); + this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 3 ); PartRegistry reg[] = PartRegistry.values(); diff --git a/src/main/java/appeng/integration/modules/IC2.java b/src/main/java/appeng/integration/modules/IC2.java index 1c9931dce..705e9ea5d 100644 --- a/src/main/java/appeng/integration/modules/IC2.java +++ b/src/main/java/appeng/integration/modules/IC2.java @@ -35,7 +35,7 @@ public class IC2 extends BaseModule implements IIC2 public static IC2 instance; public IC2() { - TestClass( IEnergyTile.class ); + this.TestClass( IEnergyTile.class ); } @Override @@ -47,17 +47,17 @@ public class IC2 extends BaseModule implements IIC2 public void PostInit() { IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); - reg.addNewAttunement( getItem( "copperCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "goldCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "insulatedGoldCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "ironCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "insulatedIronCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "insulatedTinCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "glassFiberCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "tinCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "detectorCableItem" ), TunnelType.IC2_POWER ); - reg.addNewAttunement( getItem( "splitterCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "copperCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "goldCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "insulatedGoldCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "ironCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "insulatedIronCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "insulatedTinCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "glassFiberCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "tinCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "detectorCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( this.getItem( "splitterCableItem" ), TunnelType.IC2_POWER ); // this is gone? // AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 ); diff --git a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java index 0ee1c9631..32bb81e20 100644 --- a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java +++ b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java @@ -47,16 +47,16 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock @Override public void Init() throws Throwable { - TestClass( IMultipartTile.class ); - TestClass( ICoverSystem.class ); - TestClass( IPartContainer.class ); + this.TestClass( IMultipartTile.class ); + this.TestClass( ICoverSystem.class ); + this.TestClass( IPartContainer.class ); try { - MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" ); - mergeIntoMicroblockContainer = MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class, + this.MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" ); + this.mergeIntoMicroblockContainer = this.MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class, int.class, int.class, int.class, int.class, Block.class, int.class ); - canConvertTiles = true; + this.canConvertTiles = true; } catch (Throwable t) { @@ -87,7 +87,7 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock @Override public IPartHost getOrCreateHost(EntityPlayer player, int side, TileEntity te) { - if ( te instanceof IMultipartTile && canConvertTiles ) + if ( te instanceof IMultipartTile && this.canConvertTiles ) { Block blk = AEApi.instance().blocks().blockMultiPart.block(); ItemStack what = AEApi.instance().blocks().blockMultiPart.stack( 1 ); @@ -101,11 +101,11 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock { // ItemStack.class, EntityPlayer.class, World.class, // int.class, int.class, int.class, int.class, Block.class, int.class ); - mergeIntoMicroblockContainer.invoke( null, what, player, w, x, y, z, side, blk, 0 ); + this.mergeIntoMicroblockContainer.invoke( null, what, player, w, x, y, z, side, blk, 0 ); } catch (Throwable e) { - canConvertTiles = false; + this.canConvertTiles = false; return null; } diff --git a/src/main/java/appeng/integration/modules/MFR.java b/src/main/java/appeng/integration/modules/MFR.java index 04287e612..58e8b16b1 100644 --- a/src/main/java/appeng/integration/modules/MFR.java +++ b/src/main/java/appeng/integration/modules/MFR.java @@ -27,7 +27,7 @@ public class MFR extends BaseModule public static MFR instance; public MFR() { - TestClass( IRedNetConnection.class ); + this.TestClass( IRedNetConnection.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/MJ5.java b/src/main/java/appeng/integration/modules/MJ5.java index 0840274e4..bf172f234 100644 --- a/src/main/java/appeng/integration/modules/MJ5.java +++ b/src/main/java/appeng/integration/modules/MJ5.java @@ -29,7 +29,7 @@ public class MJ5 extends BaseModule implements IMJ5 public static MJ5 instance; public MJ5() { - TestClass( IPowerReceptor.class ); + this.TestClass( IPowerReceptor.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/MJ6.java b/src/main/java/appeng/integration/modules/MJ6.java index c6dea93a1..d1b96a5cb 100644 --- a/src/main/java/appeng/integration/modules/MJ6.java +++ b/src/main/java/appeng/integration/modules/MJ6.java @@ -37,9 +37,9 @@ public class MJ6 extends BaseModule implements IMJ6 public static MJ6 instance; public MJ6() { - TestClass( IBatteryObject.class ); - TestClass( IBatteryProvider.class ); - TestClass( ISidedBatteryProvider.class ); + this.TestClass( IBatteryObject.class ); + this.TestClass( IBatteryProvider.class ); + this.TestClass( ISidedBatteryProvider.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/Mekanism.java b/src/main/java/appeng/integration/modules/Mekanism.java index 0715cb83b..02a65fd92 100644 --- a/src/main/java/appeng/integration/modules/Mekanism.java +++ b/src/main/java/appeng/integration/modules/Mekanism.java @@ -31,7 +31,7 @@ public class Mekanism extends BaseModule implements IMekanism @Override public void Init() throws Throwable { - TestClass( mekanism.api.energy.IStrictEnergyAcceptor.class ); + this.TestClass( mekanism.api.energy.IStrictEnergyAcceptor.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEI.java b/src/main/java/appeng/integration/modules/NEI.java index d686efa48..8a011d546 100644 --- a/src/main/java/appeng/integration/modules/NEI.java +++ b/src/main/java/appeng/integration/modules/NEI.java @@ -63,48 +63,48 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler Method registerUsageHandler; public NEI() throws ClassNotFoundException { - TestClass( GuiContainerManager.class ); - TestClass( codechicken.nei.recipe.ICraftingHandler.class ); - TestClass( codechicken.nei.recipe.IUsageHandler.class ); - API = Class.forName( "codechicken.nei.api.API" ); + this.TestClass( GuiContainerManager.class ); + this.TestClass( codechicken.nei.recipe.ICraftingHandler.class ); + this.TestClass( codechicken.nei.recipe.IUsageHandler.class ); + this.API = Class.forName( "codechicken.nei.api.API" ); } public void registerRecipeHandler(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - registerRecipeHandler.invoke( API, o ); - registerUsageHandler.invoke( API, o ); + this.registerRecipeHandler.invoke( this.API, o ); + this.registerUsageHandler.invoke( this.API, o ); } @Override public void Init() throws Throwable { - registerRecipeHandler = API.getDeclaredMethod( "registerRecipeHandler", codechicken.nei.recipe.ICraftingHandler.class ); - registerUsageHandler = API.getDeclaredMethod( "registerUsageHandler", codechicken.nei.recipe.IUsageHandler.class ); + this.registerRecipeHandler = this.API.getDeclaredMethod( "registerRecipeHandler", codechicken.nei.recipe.ICraftingHandler.class ); + this.registerUsageHandler = this.API.getDeclaredMethod( "registerUsageHandler", codechicken.nei.recipe.IUsageHandler.class ); - registerRecipeHandler( new NEIAEShapedRecipeHandler() ); - registerRecipeHandler( new NEIAEShapelessRecipeHandler() ); - registerRecipeHandler( new NEIInscriberRecipeHandler() ); - registerRecipeHandler( new NEIWorldCraftingHandler() ); - registerRecipeHandler( new NEIGrinderRecipeHandler() ); + this.registerRecipeHandler( new NEIAEShapedRecipeHandler() ); + this.registerRecipeHandler( new NEIAEShapelessRecipeHandler() ); + this.registerRecipeHandler( new NEIInscriberRecipeHandler() ); + this.registerRecipeHandler( new NEIWorldCraftingHandler() ); + this.registerRecipeHandler( new NEIGrinderRecipeHandler() ); if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) && AEConfig.instance.isFeatureEnabled( AEFeature.enableFacadeCrafting ) ) - registerRecipeHandler( new NEIFacadeRecipeHandler() ); + this.registerRecipeHandler( new NEIFacadeRecipeHandler() ); // large stack tooltips GuiContainerManager.addTooltipHandler( this ); // crafting terminal... - Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); + Method registerGuiOverlay = this.API.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); Class IOverlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); Class DefaultOverlayHandler = NEICraftingHandler.class; - Method registerGuiOverlayHandler = API.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, IOverlayHandler, String.class ); - registerGuiOverlay.invoke( API, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() ); - registerGuiOverlay.invoke( API, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder() ); + Method registerGuiOverlayHandler = this.API.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, IOverlayHandler, String.class ); + registerGuiOverlay.invoke( this.API, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() ); + registerGuiOverlay.invoke( this.API, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder() ); Constructor DefaultOverlayHandlerConstructor = DefaultOverlayHandler.getConstructor( int.class, int.class ); - registerGuiOverlayHandler.invoke( API, GuiCraftingTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); - registerGuiOverlayHandler.invoke( API, GuiPatternTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); + registerGuiOverlayHandler.invoke( this.API, GuiCraftingTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); + registerGuiOverlayHandler.invoke( this.API, GuiPatternTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java index 45965b0d1..cb8f1d269 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java @@ -68,7 +68,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(String outputId, Object... results) { - if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapedRecipeHandler.class) ) + if ( (outputId.equals( "crafting" )) && (this.getClass() == NEIAEShapedRecipeHandler.class) ) { List recipes = CraftingManager.getInstance().getRecipeList(); for (IRecipe recipe : recipes) @@ -79,7 +79,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler { CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); cachedRecipe.computeVisuals(); - arecipes.add( cachedRecipe ); + this.arecipes.add( cachedRecipe ); } } } @@ -102,7 +102,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler { CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); cachedRecipe.computeVisuals(); - arecipes.add( cachedRecipe ); + this.arecipes.add( cachedRecipe ); } } } @@ -124,7 +124,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) ) { cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient ); - arecipes.add( cachedRecipe ); + this.arecipes.add( cachedRecipe ); } } } @@ -146,7 +146,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler @Override public boolean hasOverlay(GuiContainer gui, Container container, int recipe) { - return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); + return (super.hasOverlay( gui, container, recipe )) || ((this.isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); } @Override @@ -160,7 +160,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler if ( positioner == null ) return null; - return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner ); + return new DefaultOverlayRenderer( this.getIngredientStacks( recipe ), positioner ); } @Override @@ -175,7 +175,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler public boolean isRecipe2x2(int recipe) { - for (PositionedStack stack : getIngredientStacks( recipe )) + for (PositionedStack stack : this.getIngredientStacks( recipe )) { if ( (stack.relx > 43) || (stack.rely > 24) ) return false; @@ -190,9 +190,9 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler public final PositionedStack result; public CachedShapedRecipe(ShapedRecipe recipe) { - result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); - ingredients = new ArrayList(); - setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() ); + this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); + this.ingredients = new ArrayList(); + this.setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() ); } public void setIngredients(int width, int height, Object[] items) @@ -230,7 +230,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler @Override public List getIngredients() { - return getCycledIngredients( cycleticks / 20, this.ingredients ); + return this.getCycledIngredients( NEIAEShapedRecipeHandler.this.cycleticks / 20, this.ingredients ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java index 2c3f14c53..658ad06c0 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java @@ -68,7 +68,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(String outputId, Object... results) { - if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapelessRecipeHandler.class) ) + if ( (outputId.equals( "crafting" )) && (this.getClass() == NEIAEShapelessRecipeHandler.class) ) { List recipes = CraftingManager.getInstance().getRecipeList(); for (IRecipe recipe : recipes) @@ -102,7 +102,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler { CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); cachedRecipe.computeVisuals(); - arecipes.add( cachedRecipe ); + this.arecipes.add( cachedRecipe ); } } } @@ -146,7 +146,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler @Override public boolean hasOverlay(GuiContainer gui, Container container, int recipe) { - return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); + return (super.hasOverlay( gui, container, recipe )) || ((this.isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); } @Override @@ -160,7 +160,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler if ( positioner == null ) return null; - return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner ); + return new DefaultOverlayRenderer( this.getIngredientStacks( recipe ), positioner ); } @Override @@ -175,7 +175,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler public boolean isRecipe2x2(int recipe) { - for (PositionedStack stack : getIngredientStacks( recipe )) + for (PositionedStack stack : this.getIngredientStacks( recipe )) { if ( (stack.relx > 43) || (stack.rely > 24) ) return false; @@ -190,9 +190,9 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler public final PositionedStack result; public CachedShapelessRecipe(ShapelessRecipe recipe) { - result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); - ingredients = new ArrayList(); - setIngredients( recipe.getInput().toArray() ); + this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); + this.ingredients = new ArrayList(); + this.setIngredients( recipe.getInput().toArray() ); } public void setIngredients(Object[] items) @@ -231,7 +231,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler @Override public List getIngredients() { - return getCycledIngredients( cycleticks / 20, this.ingredients ); + return this.getCycledIngredients( NEIAEShapelessRecipeHandler.this.cycleticks / 20, this.ingredients ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java index 8d4103330..b5ca2a90e 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java @@ -42,8 +42,8 @@ public class NEICraftingHandler implements IOverlayHandler public NEICraftingHandler(int x, int y) { - offsetX = x; - offsetY = y; + this.offsetX = x; + this.offsetY = y; } final int offsetX; @@ -55,7 +55,7 @@ public class NEICraftingHandler implements IOverlayHandler try { List ingredients = recipe.getIngredientStacks( recipeIndex ); - overlayRecipe( gui, ingredients, shift ); + this.overlayRecipe( gui, ingredients, shift ); } catch (Exception ignored) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java index 383a8dc59..868e49225 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java @@ -64,7 +64,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(String outputId, Object... results) { - if ( (outputId.equals( "crafting" )) && (getClass() == NEIFacadeRecipeHandler.class) ) + if ( (outputId.equals( "crafting" )) && (this.getClass() == NEIFacadeRecipeHandler.class) ) { ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item(); List facades = ifa.getFacades(); @@ -72,7 +72,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler { CachedShapedRecipe recipe = new CachedShapedRecipe( is ); recipe.computeVisuals(); - arecipes.add( recipe ); + this.arecipes.add( recipe ); } } else @@ -84,18 +84,18 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(ItemStack result) { - if ( result.getItem() == ifa ) + if ( result.getItem() == this.ifa ) { CachedShapedRecipe recipe = new CachedShapedRecipe( result ); recipe.computeVisuals(); - arecipes.add( recipe ); + this.arecipes.add( recipe ); } } @Override public void loadUsageRecipes(ItemStack ingredient) { - List facades = ifa.getFacades(); + List facades = this.ifa.getFacades(); for (ItemStack is : facades) { CachedShapedRecipe recipe = new CachedShapedRecipe( is ); @@ -106,7 +106,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler if ( recipe.contains( recipe.ingredients, ingredient ) ) { recipe.setIngredientPermutation( recipe.ingredients, ingredient ); - arecipes.add( recipe ); + this.arecipes.add( recipe ); } } } @@ -127,7 +127,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler @Override public boolean hasOverlay(GuiContainer gui, Container container, int recipe) { - return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); + return (super.hasOverlay( gui, container, recipe )) || ((this.isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ))); } @Override @@ -141,7 +141,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler if ( positioner == null ) return null; - return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner ); + return new DefaultOverlayRenderer( this.getIngredientStacks( recipe ), positioner ); } @Override @@ -156,7 +156,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler public boolean isRecipe2x2(int recipe) { - for (PositionedStack stack : getIngredientStacks( recipe )) + for (PositionedStack stack : this.getIngredientStacks( recipe )) { if ( (stack.relx > 43) || (stack.rely > 24) ) return false; @@ -172,10 +172,10 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler public CachedShapedRecipe(ItemStack output) { output.stackSize = 4; - result = new PositionedStack( output, 119, 24 ); - ingredients = new ArrayList(); - ItemStack in = ifa.getTextureItem( output ); - setIngredients( 3, 3, new Object[] { null, cable_anchor, null, cable_anchor, in, cable_anchor, null, cable_anchor, null } ); + this.result = new PositionedStack( output, 119, 24 ); + this.ingredients = new ArrayList(); + ItemStack in = NEIFacadeRecipeHandler.this.ifa.getTextureItem( output ); + this.setIngredients( 3, 3, new Object[] { null, NEIFacadeRecipeHandler.this.cable_anchor, null, NEIFacadeRecipeHandler.this.cable_anchor, in, NEIFacadeRecipeHandler.this.cable_anchor, null, NEIFacadeRecipeHandler.this.cable_anchor, null } ); } public void setIngredients(int width, int height, Object[] items) @@ -198,7 +198,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler @Override public List getIngredients() { - return getCycledIngredients( cycleticks / 20, this.ingredients ); + return this.getCycledIngredients( NEIFacadeRecipeHandler.this.cycleticks / 20, this.ingredients ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java index 1d2508551..bbcc35463 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java @@ -51,7 +51,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler public void drawBackground(int recipe) { GL11.glColor4f( 1, 1, 1, 1 ); - changeTexture( getGuiTexture() ); + changeTexture( this.getGuiTexture() ); drawTexturedModalRect( 40, 10, 75, 16 + 10, 90, 66 ); } @@ -102,7 +102,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(String outputId, Object... results) { - if ( (outputId.equals( "grindstone" )) && (getClass() == NEIGrinderRecipeHandler.class) ) + if ( (outputId.equals( "grindstone" )) && (this.getClass() == NEIGrinderRecipeHandler.class) ) { for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { @@ -191,24 +191,24 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler public String Chance; public CachedGrindStoneRecipe(IGrinderEntry recipe) { - result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 ); - ingredients = new ArrayList(); + this.result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 ); + this.ingredients = new ArrayList(); if ( recipe.getOptionalOutput() != null ) { - hasOptional = true; - Chance = ((int) (recipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal(); - ingredients.add( new PositionedStack( recipe.getOptionalOutput(), -30 + 107 + 18, 47 ) ); + this.hasOptional = true; + this.Chance = ((int) (recipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal(); + this.ingredients.add( new PositionedStack( recipe.getOptionalOutput(), -30 + 107 + 18, 47 ) ); } if ( recipe.getInput() != null ) - ingredients.add( new PositionedStack( recipe.getInput(), 45, 24 ) ); + this.ingredients.add( new PositionedStack( recipe.getInput(), 45, 24 ) ); } @Override public List getIngredients() { - return getCycledIngredients( cycleticks / 20, this.ingredients ); + return this.getCycledIngredients( NEIGrinderRecipeHandler.this.cycleticks / 20, this.ingredients ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java index 4d73becdf..2e4bcfb28 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java @@ -49,7 +49,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler public void drawBackground(int recipe) { GL11.glColor4f( 1, 1, 1, 1 ); - changeTexture( getGuiTexture() ); + changeTexture( this.getGuiTexture() ); drawTexturedModalRect( 0, 0, 5, 11, 166, 75 ); } @@ -74,7 +74,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(String outputId, Object... results) { - if ( (outputId.equals( "inscriber" )) && (getClass() == NEIInscriberRecipeHandler.class) ) + if ( (outputId.equals( "inscriber" )) && (this.getClass() == NEIInscriberRecipeHandler.class) ) { for (InscriberRecipe recipe : Inscribe.recipes) { @@ -160,23 +160,23 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler public final PositionedStack result; public CachedInscriberRecipe(InscriberRecipe recipe) { - result = new PositionedStack( recipe.output, 108, 29 ); - ingredients = new ArrayList(); + this.result = new PositionedStack( recipe.output, 108, 29 ); + this.ingredients = new ArrayList(); if ( recipe.plateA != null ) - ingredients.add( new PositionedStack( recipe.plateA, 40, 5 ) ); + this.ingredients.add( new PositionedStack( recipe.plateA, 40, 5 ) ); if ( recipe.imprintable != null ) - ingredients.add( new PositionedStack( recipe.imprintable, 40 + 18, 28 ) ); + this.ingredients.add( new PositionedStack( recipe.imprintable, 40 + 18, 28 ) ); if ( recipe.plateB != null ) - ingredients.add( new PositionedStack( recipe.plateB, 40, 51 ) ); + this.ingredients.add( new PositionedStack( recipe.plateB, 40, 51 ) ); } @Override public List getIngredients() { - return getCycledIngredients( cycleticks / 20, this.ingredients ); + return this.getCycledIngredients( NEIInscriberRecipeHandler.this.cycleticks / 20, this.ingredients ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java index c01cb4da4..b46717824 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java @@ -55,11 +55,11 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler private void addRecipe(AEItemDefinition def, String msg) { - if ( NEIServerUtils.areStacksSameTypeCrafting( def.stack( 1 ), target ) ) + if ( NEIServerUtils.areStacksSameTypeCrafting( def.stack( 1 ), this.target ) ) { - offsets.add( def ); - outputs.add( new PositionedStack( def.stack( 1 ), 75, 4 ) ); - details.put( def, msg ); + this.offsets.add( def ); + this.outputs.add( new PositionedStack( def.stack( 1 ), 75, 4 ) ); + this.details.put( def, msg ); } } @@ -67,29 +67,29 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler { if ( AEConfig.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) ) - addRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged, + this.addRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged, GuiText.ChargedQuartz.getLocal() + "\n\n" + GuiText.ChargedQuartzFind.getLocal() ); else - addRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged, GuiText.ChargedQuartzFind.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged, GuiText.ChargedQuartzFind.getLocal() ); if ( AEConfig.instance.isFeatureEnabled( AEFeature.MeteoriteWorldGen ) ) { - addRecipe( AEApi.instance().materials().materialLogicProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); - addRecipe( AEApi.instance().materials().materialCalcProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); - addRecipe( AEApi.instance().materials().materialEngProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialLogicProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialCalcProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialEngProcessorPress, GuiText.inWorldCraftingPresses.getLocal() ); } if ( AEConfig.instance.isFeatureEnabled( AEFeature.inWorldFluix ) ) - addRecipe( AEApi.instance().materials().materialFluixCrystal, GuiText.inWorldFluix.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialFluixCrystal, GuiText.inWorldFluix.getLocal() ); if ( AEConfig.instance.isFeatureEnabled( AEFeature.inWorldSingularity ) ) - addRecipe( AEApi.instance().materials().materialQESingularity, GuiText.inWorldSingularity.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialQESingularity, GuiText.inWorldSingularity.getLocal() ); if ( AEConfig.instance.isFeatureEnabled( AEFeature.inWorldPurification ) ) { - addRecipe( AEApi.instance().materials().materialPurifiedCertusQuartzCrystal, GuiText.inWorldPurificationCertus.getLocal() ); - addRecipe( AEApi.instance().materials().materialPurifiedNetherQuartzCrystal, GuiText.inWorldPurificationNether.getLocal() ); - addRecipe( AEApi.instance().materials().materialPurifiedFluixCrystal, GuiText.inWorldPurificationFluix.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialPurifiedCertusQuartzCrystal, GuiText.inWorldPurificationCertus.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialPurifiedNetherQuartzCrystal, GuiText.inWorldPurificationNether.getLocal() ); + this.addRecipe( AEApi.instance().materials().materialPurifiedFluixCrystal, GuiText.inWorldPurificationFluix.getLocal() ); } } @@ -102,7 +102,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler @Override public int numRecipes() { - return offsets.size(); + return this.offsets.size(); } @Override @@ -139,7 +139,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler @Override public PositionedStack getResultStack(int recipe) { - return outputs.get( recipe ); + return this.outputs.get( recipe ); } @Override @@ -200,7 +200,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler { try { - return getClass().newInstance(); + return this.getClass().newInstance(); } catch (Exception e) { @@ -217,7 +217,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler @Override public ICraftingHandler getRecipeHandler(String outputId, Object... results) { - NEIWorldCraftingHandler g = newInstance(); + NEIWorldCraftingHandler g = this.newInstance(); if ( results.length > 0 && results[0] instanceof ItemStack ) { g.target = (ItemStack) results[0]; diff --git a/src/main/java/appeng/integration/modules/RB.java b/src/main/java/appeng/integration/modules/RB.java index d4884843e..0f5998c27 100644 --- a/src/main/java/appeng/integration/modules/RB.java +++ b/src/main/java/appeng/integration/modules/RB.java @@ -33,31 +33,31 @@ public class RB extends BaseModule implements IRB final private IOrientable internal; public RBWrapper(IOrientable ww) { - internal = ww; + this.internal = ww; } @Override public boolean canBeRotated() { - return internal.canBeRotated(); + return this.internal.canBeRotated(); } @Override public ForgeDirection getForward() { - return internal.getForward(); + return this.internal.getForward(); } @Override public ForgeDirection getUp() { - return internal.getUp(); + return this.internal.getUp(); } @Override public void setOrientation(ForgeDirection Forward, ForgeDirection Up) { - internal.setOrientation( Forward, Up ); + this.internal.setOrientation( Forward, Up ); } } @@ -67,7 +67,7 @@ public class RB extends BaseModule implements IRB @Override public void Init() throws Throwable { - TestClass( IOrientable.class ); + this.TestClass( IOrientable.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/RC.java b/src/main/java/appeng/integration/modules/RC.java index 7ae9fe612..6f9f2b798 100644 --- a/src/main/java/appeng/integration/modules/RC.java +++ b/src/main/java/appeng/integration/modules/RC.java @@ -37,8 +37,8 @@ public class RC extends BaseModule implements IRC } public RC() { - TestClass( RailcraftCraftingManager.class ); - TestClass( IRockCrusherRecipe.class ); + this.TestClass( RailcraftCraftingManager.class ); + this.TestClass( IRockCrusherRecipe.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/RF.java b/src/main/java/appeng/integration/modules/RF.java index 8e82bfc15..f71832605 100644 --- a/src/main/java/appeng/integration/modules/RF.java +++ b/src/main/java/appeng/integration/modules/RF.java @@ -31,10 +31,10 @@ public class RF extends BaseModule public static RF instance; public RF() { - TestClass( cofh.api.energy.IEnergyReceiver.class ); - TestClass( cofh.api.energy.IEnergyProvider.class ); - TestClass( cofh.api.energy.IEnergyHandler.class ); - TestClass( cofh.api.energy.IEnergyConnection.class ); + this.TestClass( cofh.api.energy.IEnergyReceiver.class ); + this.TestClass( cofh.api.energy.IEnergyProvider.class ); + this.TestClass( cofh.api.energy.IEnergyHandler.class ); + this.TestClass( cofh.api.energy.IEnergyConnection.class ); } @Override @@ -55,17 +55,17 @@ public class RF extends BaseModule @Override public void PostInit() { - RFStack( "ExtraUtilities", "extractor_base", 12 ); - RFStack( "ExtraUtilities", "pipes", 11 ); - RFStack( "ExtraUtilities", "pipes", 14 ); - RFStack( "ExtraUtilities", "generator", OreDictionary.WILDCARD_VALUE ); + this.RFStack( "ExtraUtilities", "extractor_base", 12 ); + this.RFStack( "ExtraUtilities", "pipes", 11 ); + this.RFStack( "ExtraUtilities", "pipes", 14 ); + this.RFStack( "ExtraUtilities", "generator", OreDictionary.WILDCARD_VALUE ); - RFStack( "ThermalExpansion", "Cell", OreDictionary.WILDCARD_VALUE ); - RFStack( "ThermalExpansion", "Dynamo", OreDictionary.WILDCARD_VALUE ); + this.RFStack( "ThermalExpansion", "Cell", OreDictionary.WILDCARD_VALUE ); + this.RFStack( "ThermalExpansion", "Dynamo", OreDictionary.WILDCARD_VALUE ); - RFStack( "EnderIO", "itemPowerConduit", OreDictionary.WILDCARD_VALUE ); - RFStack( "EnderIO", "blockCapacitorBank", 0 ); - RFStack( "EnderIO", "blockPowerMonitor", 0 ); + this.RFStack( "EnderIO", "itemPowerConduit", OreDictionary.WILDCARD_VALUE ); + this.RFStack( "EnderIO", "blockCapacitorBank", 0 ); + this.RFStack( "EnderIO", "blockPowerMonitor", 0 ); } } diff --git a/src/main/java/appeng/integration/modules/RFItem.java b/src/main/java/appeng/integration/modules/RFItem.java index f65e11a10..741a04f62 100644 --- a/src/main/java/appeng/integration/modules/RFItem.java +++ b/src/main/java/appeng/integration/modules/RFItem.java @@ -26,7 +26,7 @@ public class RFItem extends BaseModule public static RFItem instance; public RFItem() { - TestClass( cofh.api.energy.IEnergyContainerItem.class ); + this.TestClass( cofh.api.energy.IEnergyContainerItem.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/RotaryCraft.java b/src/main/java/appeng/integration/modules/RotaryCraft.java index e65b5a7ff..93692a26e 100644 --- a/src/main/java/appeng/integration/modules/RotaryCraft.java +++ b/src/main/java/appeng/integration/modules/RotaryCraft.java @@ -26,7 +26,7 @@ public class RotaryCraft extends BaseModule public static RotaryCraft instance; public RotaryCraft() { - TestClass( Reika.RotaryCraft.API.ShaftPowerReceiver.class ); + this.TestClass( Reika.RotaryCraft.API.ShaftPowerReceiver.class ); } @Override diff --git a/src/main/java/appeng/integration/modules/Waila.java b/src/main/java/appeng/integration/modules/Waila.java index 167500dfa..6277fa901 100644 --- a/src/main/java/appeng/integration/modules/Waila.java +++ b/src/main/java/appeng/integration/modules/Waila.java @@ -77,8 +77,8 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr @Override public void Init() throws Throwable { - TestClass( IWailaDataProvider.class ); - TestClass( IWailaRegistrar.class ); + this.TestClass( IWailaDataProvider.class ); + this.TestClass( IWailaRegistrar.class ); FMLInterModComms.sendMessage( "Waila", "register", this.getClass().getName() + ".register" ); } @@ -110,7 +110,7 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { } - return getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); + return this.getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); } @Override @@ -129,7 +129,7 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { } - return getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); + return this.getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); } public List getBody(ItemStack itemStack, List currentToolTip, EntityPlayer player, NBTTagCompound nbt, TileEntity te, MovingObjectPosition mop) diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrate.java b/src/main/java/appeng/integration/modules/helpers/BSCrate.java index e4386db58..32668cd8d 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrate.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrate.java @@ -36,8 +36,8 @@ public class BSCrate implements IMEInventory final ForgeDirection side; public BSCrate(Object object, ForgeDirection d) { - cs = (ICrateStorage) object; - side = d; + this.cs = (ICrateStorage) object; + this.side = d; } @Override @@ -52,7 +52,7 @@ public class BSCrate implements IMEInventory if ( mode == Actionable.SIMULATE ) return null; - ItemStack failed = cs.insertItems( input.getItemStack() ); + ItemStack failed = this.cs.insertItems( input.getItemStack() ); if ( failed == null ) return null; input.setStackSize( failed.stackSize ); @@ -64,18 +64,18 @@ public class BSCrate implements IMEInventory { if ( mode == Actionable.SIMULATE ) { - int howMany = cs.getItemCount( request.getItemStack() ); + int howMany = this.cs.getItemCount( request.getItemStack() ); return howMany > request.getStackSize() ? request : request.copy().setStackSize( howMany ); } - ItemStack Obtained = cs.extractItems( request.getItemStack(), (int) request.getStackSize() ); + ItemStack Obtained = this.cs.extractItems( request.getItemStack(), (int) request.getStackSize() ); return AEItemStack.create( Obtained ); } @Override public IItemList getAvailableItems(IItemList out) { - for (ItemStack is : cs.getContents()) + for (ItemStack is : this.cs.getContents()) { out.add( AEItemStack.create( is ) ); } diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java index 2fcb9992c..e712bf5b8 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java @@ -37,8 +37,8 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor final ForgeDirection side; public BSCrateStorageAdaptor(Object te, ForgeDirection d) { - cs = (ICrateStorage) te; - side = d; + this.cs = (ICrateStorage) te; + this.side = d; } @Override @@ -46,7 +46,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack target = null; - for (ItemStack is : cs.getContents()) + for (ItemStack is : this.cs.getContents()) { if ( is != null ) { @@ -65,7 +65,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack f = Platform.cloneItemStack( target ); f.stackSize = how_many; - return cs.extractItems( f, how_many ); + return this.cs.extractItems( f, how_many ); } return null; @@ -76,7 +76,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack target = null; - for (ItemStack is : cs.getContents()) + for (ItemStack is : this.cs.getContents()) { if ( is != null ) { @@ -93,7 +93,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor if ( target != null ) { - int cnt = cs.getItemCount( target ); + int cnt = this.cs.getItemCount( target ); if ( cnt == 0 ) return null; if ( cnt > how_many ) @@ -111,7 +111,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack target = null; - for (ItemStack is : cs.getContents()) + for (ItemStack is : this.cs.getContents()) { if ( is != null ) { @@ -130,7 +130,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack f = Platform.cloneItemStack( target ); f.stackSize = amount; - return cs.extractItems( f, amount ); + return this.cs.extractItems( f, amount ); } return null; @@ -141,7 +141,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { ItemStack target = null; - for (ItemStack is : cs.getContents()) + for (ItemStack is : this.cs.getContents()) { if ( is != null ) { @@ -158,7 +158,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor if ( target != null ) { - int cnt = cs.getItemCount( target ); + int cnt = this.cs.getItemCount( target ); if ( cnt == 0 ) return null; if ( cnt > how_many ) @@ -174,13 +174,13 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor @Override public ItemStack addItems(ItemStack A) { - return cs.insertItems( A ); + return this.cs.insertItems( A ); } @Override public ItemStack simulateAdd(ItemStack A) { - int items = cs.getSpaceForItem( A ); + int items = this.cs.getSpaceForItem( A ); ItemStack B = Platform.cloneItemStack( A ); if ( A.stackSize <= items ) return null; @@ -191,13 +191,13 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor @Override public boolean containsItems() { - return cs.getUniqueItems() > 0; + return this.cs.getUniqueItems() > 0; } @Override public Iterator iterator() { - return new StackToSlotIterator( cs.getContents().iterator() ); + return new StackToSlotIterator( this.cs.getContents().iterator() ); } } diff --git a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java index f7a4ba907..974fd3184 100644 --- a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java +++ b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java @@ -36,8 +36,8 @@ public class FactorizationBarrel implements IMEInventory final IFZ fProxy; public FactorizationBarrel(IFZ proxy, TileEntity tile) { - te = tile; - fProxy = proxy; + this.te = tile; + this.fProxy = proxy; } @Override @@ -48,17 +48,17 @@ public class FactorizationBarrel implements IMEInventory public long remainingItemTypes() { - return fProxy.barrelGetItem( te ) == null ? 1 : 0; + return this.fProxy.barrelGetItem( this.te ) == null ? 1 : 0; } public long remainingItemCount() { - return fProxy.barrelGetMaxItemCount( te ) - fProxy.barrelGetItemCount( te ); + return this.fProxy.barrelGetMaxItemCount( this.te ) - this.fProxy.barrelGetItemCount( this.te ); } public boolean containsItemType(IAEItemStack i, boolean acceptEmpty) { - ItemStack currentItem = fProxy.barrelGetItem( te ); + ItemStack currentItem = this.fProxy.barrelGetItem( this.te ); // empty barrels want your love too! if ( acceptEmpty && currentItem == null ) @@ -69,7 +69,7 @@ public class FactorizationBarrel implements IMEInventory public long storedItemCount() { - return fProxy.barrelGetItemCount( te ); + return this.fProxy.barrelGetItemCount( this.te ); } @Override @@ -84,20 +84,20 @@ public class FactorizationBarrel implements IMEInventory if ( shared.isItemDamaged() ) return input; - if ( remainingItemTypes() > 0 ) + if ( this.remainingItemTypes() > 0 ) { if ( mode == Actionable.MODULATE ) - fProxy.setItemType( te, input.getItemStack() ); + this.fProxy.setItemType( this.te, input.getItemStack() ); } - if ( containsItemType( input, mode == Actionable.SIMULATE ) ) + if ( this.containsItemType( input, mode == Actionable.SIMULATE ) ) { - int max = fProxy.barrelGetMaxItemCount( te ); - int newTotal = (int) storedItemCount() + (int) input.getStackSize(); + int max = this.fProxy.barrelGetMaxItemCount( this.te ); + int newTotal = (int) this.storedItemCount() + (int) input.getStackSize(); if ( newTotal > max ) { if ( mode == Actionable.MODULATE ) - fProxy.barrelSetCount( te, max ); + this.fProxy.barrelSetCount( this.te, max ); IAEItemStack result = input.copy(); result.setStackSize( newTotal - max ); return result; @@ -105,7 +105,7 @@ public class FactorizationBarrel implements IMEInventory else { if ( mode == Actionable.MODULATE ) - fProxy.barrelSetCount( te, newTotal ); + this.fProxy.barrelSetCount( this.te, newTotal ); return null; } } @@ -116,15 +116,15 @@ public class FactorizationBarrel implements IMEInventory @Override public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) { - if ( containsItemType( request, false ) ) + if ( this.containsItemType( request, false ) ) { - int howMany = (int) storedItemCount(); + int howMany = (int) this.storedItemCount(); if ( request.getStackSize() >= howMany ) { if ( mode == Actionable.MODULATE ) { - fProxy.setItemType( te, null ); - fProxy.barrelSetCount( te, 0 ); + this.fProxy.setItemType( this.te, null ); + this.fProxy.barrelSetCount( this.te, 0 ); } IAEItemStack r = request.copy(); @@ -134,7 +134,7 @@ public class FactorizationBarrel implements IMEInventory else { if ( mode == Actionable.MODULATE ) - fProxy.barrelSetCount( te, (int) (howMany - request.getStackSize()) ); + this.fProxy.barrelSetCount( this.te, (int) (howMany - request.getStackSize()) ); return request.copy(); } } @@ -144,10 +144,10 @@ public class FactorizationBarrel implements IMEInventory @Override public IItemList getAvailableItems(IItemList out) { - ItemStack i = fProxy.barrelGetItem( te ); + ItemStack i = this.fProxy.barrelGetItem( this.te ); if ( i != null ) { - i.stackSize = fProxy.barrelGetItemCount( te ); + i.stackSize = this.fProxy.barrelGetItemCount( this.te ); out.addStorage( AEItemStack.create( i ) ); } diff --git a/src/main/java/appeng/integration/modules/helpers/MJPerdition.java b/src/main/java/appeng/integration/modules/helpers/MJPerdition.java index 17958ac04..1bcc7d9d4 100644 --- a/src/main/java/appeng/integration/modules/helpers/MJPerdition.java +++ b/src/main/java/appeng/integration/modules/helpers/MJPerdition.java @@ -31,49 +31,49 @@ public class MJPerdition extends BaseMJPerdition final protected PowerHandler bcPowerHandler; public MJPerdition(IPowerReceptor te) { - bcPowerHandler = new PowerHandler( te, Type.MACHINE ); + this.bcPowerHandler = new PowerHandler( te, Type.MACHINE ); } @Override public void Tick() { - bcPowerHandler.update(); + this.bcPowerHandler.update(); } @Override public void writeToNBT(NBTTagCompound data) { - bcPowerHandler.writeToNBT( data, "bcPowerHandler" ); + this.bcPowerHandler.writeToNBT( data, "bcPowerHandler" ); } @Override public void readFromNBT(NBTTagCompound data) { - bcPowerHandler.readFromNBT( data, "bcPowerHandler" ); + this.bcPowerHandler.readFromNBT( data, "bcPowerHandler" ); } @Override public PowerReceiver getPowerReceiver() { - return bcPowerHandler.getPowerReceiver(); + return this.bcPowerHandler.getPowerReceiver(); } @Override public double useEnergy(double min, double max, boolean doUse) { - return bcPowerHandler.useEnergy( min, max, doUse ); + return this.bcPowerHandler.useEnergy( min, max, doUse ); } @Override public void addEnergy(float failed) { - bcPowerHandler.addEnergy( failed ); + this.bcPowerHandler.addEnergy( failed ); } @Override public void configure(int i, int j, float f, int k) { - bcPowerHandler.configure( i, j, f, k ); + this.bcPowerHandler.configure( i, j, f, k ); } } \ No newline at end of file diff --git a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java index df9303a7c..975f7972c 100644 --- a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java +++ b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java @@ -36,8 +36,8 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory= is.stackSize ) { is = is.copy(); if ( mode == Actionable.MODULATE ) - dsu.setStoredItemCount( 0 ); + this.dsu.setStoredItemCount( 0 ); return AEItemStack.create( is ); } else { if ( mode == Actionable.MODULATE ) - dsu.setStoredItemCount( is.stackSize - (int) request.getStackSize() ); + this.dsu.setStoredItemCount( is.stackSize - (int) request.getStackSize() ); return request.copy(); } } @@ -113,7 +113,7 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory getAvailableItems(IItemList out) { - ItemStack is = dsu.getStoredItemType(); + ItemStack is = this.dsu.getStoredItemType(); if ( is != null ) { out.add( AEItemStack.create( is ) ); diff --git a/src/main/java/appeng/items/AEBaseItem.java b/src/main/java/appeng/items/AEBaseItem.java index 42fe36e81..5d9a10e99 100644 --- a/src/main/java/appeng/items/AEBaseItem.java +++ b/src/main/java/appeng/items/AEBaseItem.java @@ -44,7 +44,7 @@ public class AEBaseItem extends Item implements IAEFeature public AEBaseItem( Class c ) { this( c, Optional. absent() ); - canRepair = false; + this.canRepair = false; } public AEBaseItem( Class c, Optional subName ) diff --git a/src/main/java/appeng/items/contents/CellConfig.java b/src/main/java/appeng/items/contents/CellConfig.java index 2376f64e7..ca0ae170b 100644 --- a/src/main/java/appeng/items/contents/CellConfig.java +++ b/src/main/java/appeng/items/contents/CellConfig.java @@ -30,13 +30,13 @@ public class CellConfig extends AppEngInternalInventory public CellConfig(ItemStack is) { super( null, 63 ); this.is = is; - readFromNBT( Platform.openNbtData( is ), "list" ); + this.readFromNBT( Platform.openNbtData( is ), "list" ); } @Override public void markDirty() { - writeToNBT( Platform.openNbtData( is ), "list" ); + this.writeToNBT( Platform.openNbtData( this.is ), "list" ); } } \ No newline at end of file diff --git a/src/main/java/appeng/items/contents/CellUpgrades.java b/src/main/java/appeng/items/contents/CellUpgrades.java index 3e307da73..f136397a4 100644 --- a/src/main/java/appeng/items/contents/CellUpgrades.java +++ b/src/main/java/appeng/items/contents/CellUpgrades.java @@ -30,13 +30,13 @@ public class CellUpgrades extends UpgradeInventory public CellUpgrades(ItemStack is, int upgrades) { super( is.getItem(), null, upgrades ); this.is = is; - readFromNBT( Platform.openNbtData( is ), "upgrades" ); + this.readFromNBT( Platform.openNbtData( is ), "upgrades" ); } @Override public void markDirty() { - writeToNBT( Platform.openNbtData( is ), "upgrades" ); + this.writeToNBT( Platform.openNbtData( this.is ), "upgrades" ); } } \ No newline at end of file diff --git a/src/main/java/appeng/items/contents/NetworkToolViewer.java b/src/main/java/appeng/items/contents/NetworkToolViewer.java index fdfe4ac44..8b9099ff4 100644 --- a/src/main/java/appeng/items/contents/NetworkToolViewer.java +++ b/src/main/java/appeng/items/contents/NetworkToolViewer.java @@ -35,102 +35,102 @@ public class NetworkToolViewer implements INetworkTool public NetworkToolViewer(ItemStack is, IGridHost gHost) { this.is = is; - gh = gHost; - inv = new AppEngInternalInventory( null, 9 ); + this.gh = gHost; + this.inv = new AppEngInternalInventory( null, 9 ); if ( is.hasTagCompound() ) // prevent crash when opening network status screen. - inv.readFromNBT( Platform.openNbtData( is ), "inv" ); + this.inv.readFromNBT( Platform.openNbtData( is ), "inv" ); } @Override public int getSizeInventory() { - return inv.getSizeInventory(); + return this.inv.getSizeInventory(); } @Override public ItemStack getStackInSlot(int i) { - return inv.getStackInSlot( i ); + return this.inv.getStackInSlot( i ); } @Override public ItemStack decrStackSize(int i, int j) { - return inv.decrStackSize( i, j ); + return this.inv.decrStackSize( i, j ); } @Override public ItemStack getStackInSlotOnClosing(int i) { - return inv.getStackInSlotOnClosing( i ); + return this.inv.getStackInSlotOnClosing( i ); } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - inv.setInventorySlotContents( i, itemstack ); + this.inv.setInventorySlotContents( i, itemstack ); } @Override public String getInventoryName() { - return inv.getInventoryName(); + return this.inv.getInventoryName(); } @Override public boolean hasCustomInventoryName() { - return inv.hasCustomInventoryName(); + return this.inv.hasCustomInventoryName(); } @Override public int getInventoryStackLimit() { - return inv.getInventoryStackLimit(); + return this.inv.getInventoryStackLimit(); } @Override public void markDirty() { - inv.markDirty(); - inv.writeToNBT( Platform.openNbtData( is ), "inv" ); + this.inv.markDirty(); + this.inv.writeToNBT( Platform.openNbtData( this.is ), "inv" ); } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return inv.isUseableByPlayer( entityplayer ); + return this.inv.isUseableByPlayer( entityplayer ); } @Override public void openInventory() { - inv.openInventory(); + this.inv.openInventory(); } @Override public void closeInventory() { - inv.closeInventory(); + this.inv.closeInventory(); } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule + return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ((IUpgradeModule) itemstack.getItem()).getType( itemstack ) != null; } @Override public ItemStack getItemStack() { - return is; + return this.is; } @Override public IGridHost getGridHost() { - return gh; + return this.gh; } } diff --git a/src/main/java/appeng/items/contents/PortableCellViewer.java b/src/main/java/appeng/items/contents/PortableCellViewer.java index 1ae7c4543..b120b4af2 100644 --- a/src/main/java/appeng/items/contents/PortableCellViewer.java +++ b/src/main/java/appeng/items/contents/PortableCellViewer.java @@ -46,14 +46,14 @@ public class PortableCellViewer extends MEMonitorHandler implement public PortableCellViewer(ItemStack is) { super( CellInventory.getCell( is, null ) ); - ips = (IAEItemPowerStorage) is.getItem(); - target = is; + this.ips = (IAEItemPowerStorage) is.getItem(); + this.target = is; } @Override public ItemStack getItemStack() { - return target; + return this.target; } @Override @@ -62,9 +62,9 @@ public class PortableCellViewer extends MEMonitorHandler implement amt = usePowerMultiplier.multiply( amt ); if ( mode == Actionable.SIMULATE ) - return usePowerMultiplier.divide( Math.min( amt, ips.getAECurrentPower( getItemStack() ) ) ); + return usePowerMultiplier.divide( Math.min( amt, this.ips.getAECurrentPower( this.getItemStack() ) ) ); - return usePowerMultiplier.divide( ips.extractAEPower( getItemStack(), amt ) ); + return usePowerMultiplier.divide( this.ips.extractAEPower( this.getItemStack(), amt ) ); } @Override @@ -87,7 +87,7 @@ public class PortableCellViewer extends MEMonitorHandler implement @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - NBTTagCompound data = Platform.openNbtData( target ); + NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target ); manager.writeToNBT( data ); } } ); @@ -96,7 +96,7 @@ public class PortableCellViewer extends MEMonitorHandler implement out.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); out.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); - out.readFromNBT( (NBTTagCompound) Platform.openNbtData( target ).copy() ); + out.readFromNBT( (NBTTagCompound) Platform.openNbtData( this.target ).copy() ); return out; } diff --git a/src/main/java/appeng/items/contents/QuartzKnifeObj.java b/src/main/java/appeng/items/contents/QuartzKnifeObj.java index 584bb1461..0c797a883 100644 --- a/src/main/java/appeng/items/contents/QuartzKnifeObj.java +++ b/src/main/java/appeng/items/contents/QuartzKnifeObj.java @@ -27,13 +27,13 @@ public class QuartzKnifeObj implements IGuiItemObject final ItemStack is; public QuartzKnifeObj(ItemStack o) { - is = o; + this.is = o; } @Override public ItemStack getItemStack() { - return is; + return this.is; } } diff --git a/src/main/java/appeng/items/materials/ItemMultiMaterial.java b/src/main/java/appeng/items/materials/ItemMultiMaterial.java index a5605b08d..8ba87d52d 100644 --- a/src/main/java/appeng/items/materials/ItemMultiMaterial.java +++ b/src/main/java/appeng/items/materials/ItemMultiMaterial.java @@ -75,8 +75,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, public ItemMultiMaterial() { super( ItemMultiMaterial.class ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setHasSubtypes( true ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setHasSubtypes( true ); instance = this; } @@ -94,8 +94,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, { try { - Matcher a = p.matcher( o1 ); - Matcher b = p.matcher( o2 ); + Matcher a = this.p.matcher( o1 ); + Matcher b = this.p.matcher( o2 ); if ( a.find() && b.find() ) { int ia = Integer.parseInt( a.group( 1 ) ); @@ -116,7 +116,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, { super.addCheckedInformation( stack, player, lines, displayAdditionalInformation ); - MaterialType mt = getTypeByStack( stack ); + MaterialType mt = this.getTypeByStack( stack ); if ( mt == null ) return; @@ -126,7 +126,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, lines.add( c.getString( "InscribeName" ) ); } - Upgrades u = getType( stack ); + Upgrades u = this.getType( stack ); if ( u != null ) { List textList = new LinkedList(); @@ -174,8 +174,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, IStackSrc output = mat.stackSrc = new MaterialStackSrc( mat ); - if ( dmgToMaterial.get( newMaterialNum ) == null ) - dmgToMaterial.put( newMaterialNum, mat ); + if ( this.dmgToMaterial.get( newMaterialNum ) == null ) + this.dmgToMaterial.put( newMaterialNum, mat ); else throw new RuntimeException( "Meta Overlap detected." ); @@ -190,7 +190,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, public void makeUnique() { - for (MaterialType mt : ImmutableSet.copyOf( dmgToMaterial.values() )) + for (MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() )) { if ( mt.getOreName() != null ) { @@ -226,7 +226,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, else { if ( mt.itemInstance == this ) - dmgToMaterial.remove( mt.damageValue ); + this.dmgToMaterial.remove( mt.damageValue ); mt.itemInstance = replacement.getItem(); mt.damageValue = replacement.getItemDamage(); @@ -238,16 +238,16 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, public MaterialType getTypeByStack(ItemStack is) { - if ( dmgToMaterial.containsKey( is.getItemDamage() ) ) - return dmgToMaterial.get( is.getItemDamage() ); + if ( this.dmgToMaterial.containsKey( is.getItemDamage() ) ) + return this.dmgToMaterial.get( is.getItemDamage() ); return MaterialType.InvalidType; } @Override public IIcon getIconFromDamage(int dmg) { - if ( dmgToMaterial.containsKey( dmg ) ) - return dmgToMaterial.get( dmg ).IIcon; + if ( this.dmgToMaterial.containsKey( dmg ) ) + return this.dmgToMaterial.get( dmg ).IIcon; return new MissingIcon( this ); } @@ -256,7 +256,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, if ( is == null ) return "null"; - MaterialType mt = getTypeByStack( is ); + MaterialType mt = this.getTypeByStack( is ); if ( mt == null ) return "null"; @@ -266,7 +266,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, @Override public String getUnlocalizedName(ItemStack is) { - return "item.appliedenergistics2." + nameOf( is ); + return "item.appliedenergistics2." + this.nameOf( is ); } @Override @@ -277,9 +277,9 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, if ( mat.damageValue != -1 ) { ItemStack what = new ItemStack( this, 1, mat.damageValue ); - if ( getTypeByStack( what ) != MaterialType.InvalidType ) + if ( this.getTypeByStack( what ) != MaterialType.InvalidType ) { - String tex = "appliedenergistics2:" + nameOf( what ); + String tex = "appliedenergistics2:" + this.nameOf( what ); mat.IIcon = icoRegister.registerIcon( tex ); } } @@ -289,13 +289,13 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, @Override public boolean hasCustomEntity(ItemStack is) { - return getTypeByStack( is ).hasCustomEntity(); + return this.getTypeByStack( is ).hasCustomEntity(); } @Override public Entity createEntity(World w, Entity location, ItemStack itemstack) { - Class droppedEntity = getTypeByStack( itemstack ).getCustomEntityClass(); + Class droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass(); Entity eqi; try @@ -321,7 +321,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, @Override public int getBytes(ItemStack is) { - switch (getTypeByStack( is )) + switch (this.getTypeByStack( is )) { case Cell1kPart: return 1024; @@ -339,7 +339,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, @Override public boolean isStorageComponent(ItemStack is) { - switch (getTypeByStack( is )) + switch (this.getTypeByStack( is )) { case Cell1kPart: case Cell4kPart: @@ -354,7 +354,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, @Override public Upgrades getType(ItemStack itemstack) { - switch (getTypeByStack( itemstack )) + switch (this.getTypeByStack( itemstack )) { case CardCapacity: return Upgrades.CAPACITY; diff --git a/src/main/java/appeng/items/materials/MaterialType.java b/src/main/java/appeng/items/materials/MaterialType.java index 5eac4a41a..4819adf7b 100644 --- a/src/main/java/appeng/items/materials/MaterialType.java +++ b/src/main/java/appeng/items/materials/MaterialType.java @@ -100,70 +100,70 @@ public enum MaterialType public MaterialStackSrc stackSrc; MaterialType(int metaValue) { - damageValue = metaValue; - features = EnumSet.of( AEFeature.Core ); + this.damageValue = metaValue; + this.features = EnumSet.of( AEFeature.Core ); } MaterialType(int metaValue, AEFeature part) { - damageValue = metaValue; - features = EnumSet.of( part ); + this.damageValue = metaValue; + this.features = EnumSet.of( part ); } MaterialType(int metaValue, AEFeature part, Class c) { - features = EnumSet.of( part ); - damageValue = metaValue; - droppedEntity = c; + this.features = EnumSet.of( part ); + this.damageValue = metaValue; + this.droppedEntity = c; - EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true ); + EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true ); } MaterialType(int metaValue, AEFeature part, String oreDictionary, Class c) { - features = EnumSet.of( part ); - damageValue = metaValue; - oreName = oreDictionary; - droppedEntity = c; - EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true ); + this.features = EnumSet.of( part ); + this.damageValue = metaValue; + this.oreName = oreDictionary; + this.droppedEntity = c; + EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true ); } MaterialType(int metaValue, AEFeature part, String oreDictionary) { - features = EnumSet.of( part ); - damageValue = metaValue; - oreName = oreDictionary; + this.features = EnumSet.of( part ); + this.damageValue = metaValue; + this.oreName = oreDictionary; } public ItemStack stack(int size) { - return new ItemStack( itemInstance, size, damageValue ); + return new ItemStack( this.itemInstance, size, this.damageValue ); } public EnumSet getFeature() { - return features; + return this.features; } public String getOreName() { - return oreName; + return this.oreName; } public boolean hasCustomEntity() { - return droppedEntity != null; + return this.droppedEntity != null; } public Class getCustomEntityClass() { - return droppedEntity; + return this.droppedEntity; } public boolean isRegistered() { - return isRegistered; + return this.isRegistered; } public void markReady() { - isRegistered = true; + this.isRegistered = true; } } diff --git a/src/main/java/appeng/items/misc/ItemCrystalSeed.java b/src/main/java/appeng/items/misc/ItemCrystalSeed.java index ca61e9a20..623d3ae4c 100644 --- a/src/main/java/appeng/items/misc/ItemCrystalSeed.java +++ b/src/main/java/appeng/items/misc/ItemCrystalSeed.java @@ -86,8 +86,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal public ItemCrystalSeed() { super( ItemCrystalSeed.class ); - setHasSubtypes( true ); - setFeature( EnumSet.of( AEFeature.Core ) ); + this.setHasSubtypes( true ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance, 16, 4, true ); @@ -102,24 +102,24 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Override public String getUnlocalizedName(ItemStack is) { - int damage = getProgress( is ); + int damage = this.getProgress( is ); if ( damage < Certus + SINGLE_OFFSET ) - return getUnlocalizedName() + ".Certus"; + return this.getUnlocalizedName() + ".Certus"; if ( damage < Nether + SINGLE_OFFSET ) - return getUnlocalizedName() + ".Nether"; + return this.getUnlocalizedName() + ".Nether"; if ( damage < Fluix + SINGLE_OFFSET ) - return getUnlocalizedName() + ".Fluix"; + return this.getUnlocalizedName() + ".Fluix"; - return getUnlocalizedName(); + return this.getUnlocalizedName(); } @Override public ItemStack triggerGrowth(ItemStack is) { - int newDamage = getProgress( is ) + 1; + int newDamage = this.getProgress( is ) + 1; if ( newDamage == Certus + SINGLE_OFFSET ) return AEApi.instance().materials().materialPurifiedCertusQuartzCrystal.stack( is.stackSize ); @@ -130,7 +130,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal if ( newDamage > END ) return null; - setProgress( is, newDamage ); + this.setProgress( is, newDamage ); return is; } @@ -144,7 +144,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal public void addCheckedInformation(ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation ) { lines.add( ButtonToolTips.DoesntDespawn.getLocal() ); - int progress = getProgress( stack ) % SINGLE_OFFSET; + int progress = this.getProgress( stack ) % SINGLE_OFFSET; lines.add( Math.floor( (float) progress / (float) (SINGLE_OFFSET / 100) ) + "%" ); super.addCheckedInformation( stack, player, lines, displayAdditionalInformation ); @@ -165,7 +165,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Override public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex( stack ); + return this.getIconIndex( stack ); } @Override @@ -173,21 +173,21 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal { IIcon list[] = null; - int damage = getProgress( stack ); + int damage = this.getProgress( stack ); if ( damage < Certus + SINGLE_OFFSET ) - list = certus; + list = this.certus; else if ( damage < Nether + SINGLE_OFFSET ) { damage -= Nether; - list = nether; + list = this.nether; } else if ( damage < Fluix + SINGLE_OFFSET ) { damage -= Fluix; - list = fluix; + list = this.fluix; } if ( list == null ) @@ -212,17 +212,17 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal { String preFix = "appliedenergistics2:ItemCrystalSeed."; - certus[0] = ir.registerIcon( preFix + "Certus" ); - certus[1] = ir.registerIcon( preFix + "Certus2" ); - certus[2] = ir.registerIcon( preFix + "Certus3" ); + this.certus[0] = ir.registerIcon( preFix + "Certus" ); + this.certus[1] = ir.registerIcon( preFix + "Certus2" ); + this.certus[2] = ir.registerIcon( preFix + "Certus3" ); - nether[0] = ir.registerIcon( preFix + "Nether" ); - nether[1] = ir.registerIcon( preFix + "Nether2" ); - nether[2] = ir.registerIcon( preFix + "Nether3" ); + this.nether[0] = ir.registerIcon( preFix + "Nether" ); + this.nether[1] = ir.registerIcon( preFix + "Nether2" ); + this.nether[2] = ir.registerIcon( preFix + "Nether3" ); - fluix[0] = ir.registerIcon( preFix + "Fluix" ); - fluix[1] = ir.registerIcon( preFix + "Fluix2" ); - fluix[2] = ir.registerIcon( preFix + "Fluix3" ); + this.fluix[0] = ir.registerIcon( preFix + "Fluix" ); + this.fluix[1] = ir.registerIcon( preFix + "Fluix2" ); + this.fluix[2] = ir.registerIcon( preFix + "Fluix3" ); } @Override diff --git a/src/main/java/appeng/items/misc/ItemEncodedPattern.java b/src/main/java/appeng/items/misc/ItemEncodedPattern.java index 40c7125aa..5cb465eba 100644 --- a/src/main/java/appeng/items/misc/ItemEncodedPattern.java +++ b/src/main/java/appeng/items/misc/ItemEncodedPattern.java @@ -47,8 +47,8 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt public ItemEncodedPattern() { super( ItemEncodedPattern.class ); - setFeature( EnumSet.of( AEFeature.Patterns ) ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( AEFeature.Patterns ) ); + this.setMaxStackSize( 1 ); if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, new ItemEncodedPatternRenderer() ); } @@ -78,20 +78,20 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - return clearPattern( stack, player ); + return this.clearPattern( stack, player ); } @Override public ItemStack onItemRightClick(ItemStack stack, World w, EntityPlayer player) { - clearPattern( stack, player ); + this.clearPattern( stack, player ); return stack; } @Override public void addCheckedInformation(ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation ) { - ICraftingPatternDetails details = getPatternForItem( stack, player.worldObj ); + ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj ); if ( details == null ) { @@ -146,7 +146,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt if ( w == null ) return null; - ICraftingPatternDetails details = getPatternForItem( item, w ); + ICraftingPatternDetails details = this.getPatternForItem( item, w ); if ( details == null ) return null; diff --git a/src/main/java/appeng/items/misc/ItemPaintBall.java b/src/main/java/appeng/items/misc/ItemPaintBall.java index 7ef003355..15f1c4b6e 100644 --- a/src/main/java/appeng/items/misc/ItemPaintBall.java +++ b/src/main/java/appeng/items/misc/ItemPaintBall.java @@ -39,8 +39,8 @@ public class ItemPaintBall extends AEBaseItem public ItemPaintBall() { super( ItemPaintBall.class ); - setFeature( EnumSet.of( AEFeature.PaintBalls ) ); - hasSubtypes = true; + this.setFeature( EnumSet.of( AEFeature.PaintBalls ) ); + this.hasSubtypes = true; if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, new PaintBallRender() ); } @@ -48,12 +48,12 @@ public class ItemPaintBall extends AEBaseItem @Override public String getItemStackDisplayName(ItemStack is) { - return super.getItemStackDisplayName( is ) + " - " + getExtraName( is ); + return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is ); } public String getExtraName(ItemStack is) { - return (is.getItemDamage() >= 20 ? GuiText.Lumen.getLocal() + ' ' : "") + getColor( is ); + return (is.getItemDamage() >= 20 ? GuiText.Lumen.getLocal() + ' ' : "") + this.getColor( is ); } public AEColor getColor(ItemStack is) diff --git a/src/main/java/appeng/items/parts/ItemFacade.java b/src/main/java/appeng/items/parts/ItemFacade.java index 5b572ce6b..30b1cd603 100644 --- a/src/main/java/appeng/items/parts/ItemFacade.java +++ b/src/main/java/appeng/items/parts/ItemFacade.java @@ -55,8 +55,8 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte public ItemFacade() { super( ItemFacade.class ); - setFeature( EnumSet.of( AEFeature.Facades ) ); - setHasSubtypes( true ); + this.setFeature( EnumSet.of( AEFeature.Facades ) ); + this.setHasSubtypes( true ); if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, BusRenderer.instance ); } @@ -77,7 +77,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte @Override public FacadePart createPartFromItemStack(ItemStack is, ForgeDirection side) { - ItemStack in = getTextureItem( is ); + ItemStack in = this.getTextureItem( is ); if ( in != null ) return new FacadePart( is, side ); return null; @@ -87,23 +87,23 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte public List getFacades() { - calculateSubTypes(); - return subTypes; + this.calculateSubTypes(); + return this.subTypes; } public ItemStack getCreativeTabIcon() { - calculateSubTypes(); - if ( subTypes.isEmpty() ) + this.calculateSubTypes(); + if ( this.subTypes.isEmpty() ) return new ItemStack( Items.cake ); - return subTypes.get( 0 ); + return this.subTypes.get( 0 ); } @Override public void getSubItems(Item number, CreativeTabs tab, List list) { - calculateSubTypes(); - list.addAll( subTypes ); + this.calculateSubTypes(); + list.addAll( this.subTypes ); } public ItemStack createFromIDs(int[] ids) @@ -118,17 +118,17 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte @Override public ItemStack getTextureItem(ItemStack is) { - Block blk = getBlock( is ); + Block blk = this.getBlock( is ); if ( blk != null ) - return new ItemStack( blk, 1, getMeta( is ) ); + return new ItemStack( blk, 1, this.getMeta( is ) ); return null; } private void calculateSubTypes() { - if ( subTypes == null ) + if ( this.subTypes == null ) { - subTypes = new ArrayList(); + this.subTypes = new ArrayList(); for (Object blk : Block.blockRegistry) { Block b = (Block) blk; @@ -140,9 +140,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList ); for (ItemStack l : tmpList) { - ItemStack facade = createFacadeForItem( l, false ); + ItemStack facade = this.createFacadeForItem( l, false ); if ( facade != null ) - subTypes.add( facade ); + this.subTypes.add( facade ); } } catch (Throwable t) @@ -231,7 +231,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte { try { - ItemStack in = getTextureItem( is ); + ItemStack in = this.getTextureItem( is ); if ( in != null ) { return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName(); @@ -248,7 +248,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte @Override public boolean useAlphaPass(ItemStack is) { - ItemStack out = getTextureItem( is ); + ItemStack out = this.getTextureItem( is ); if ( out == null || out.getItem() == null ) return false; diff --git a/src/main/java/appeng/items/parts/ItemMultiPart.java b/src/main/java/appeng/items/parts/ItemMultiPart.java index 7744fcba1..73013446c 100644 --- a/src/main/java/appeng/items/parts/ItemMultiPart.java +++ b/src/main/java/appeng/items/parts/ItemMultiPart.java @@ -67,9 +67,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup public ItemMultiPart() { super( ItemMultiPart.class ); - setFeature( EnumSet.of( AEFeature.Core ) ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); AEApi.instance().partHelper().setItemBusRenderer( this ); - setHasSubtypes( true ); + this.setHasSubtypes( true ); instance = this; } @@ -90,7 +90,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup int varID = variant == null ? 0 : variant.ordinal(); // verify - for (PartTypeIst p : dmgToPart.values()) + for (PartTypeIst p : this.dmgToPart.values()) { if ( p.part == mat && p.variant == varID ) throw new RuntimeException( "Cannot create the same material twice..." ); @@ -109,9 +109,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup pti.part = mat; pti.variant = varID; - if ( dmgToPart.get( newPartNum ) == null ) + if ( this.dmgToPart.get( newPartNum ) == null ) { - dmgToPart.put( newPartNum, pti ); + this.dmgToPart.put( newPartNum, pti ); return output; } else @@ -123,7 +123,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup public int getDamageByType(PartType t) { - for (Entry pt : dmgToPart.entrySet()) + for (Entry pt : this.dmgToPart.entrySet()) { if ( pt.getValue().part == t ) return pt.getKey(); @@ -136,7 +136,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup if ( is == null ) return null; - PartTypeIst pt = dmgToPart.get( is.getItemDamage() ); + PartTypeIst pt = this.dmgToPart.get( is.getItemDamage() ); if ( pt != null ) return pt.part; @@ -159,25 +159,25 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @Override public String getUnlocalizedName(ItemStack is) { - return "item.appliedenergistics2." + getName( is ); + return "item.appliedenergistics2." + this.getName( is ); } public String getName(ItemStack is) { - return AEFeatureHandler.getName( ItemMultiPart.class, getTypeByStack( is ).name() ); + return AEFeatureHandler.getName( ItemMultiPart.class, this.getTypeByStack( is ).name() ); } @Override public String getItemStackDisplayName(ItemStack is) { - PartType pt = getTypeByStack( is ); + PartType pt = this.getTypeByStack( is ); if ( pt == null ) return "Unnamed"; Enum[] variants = pt.getVariants(); if ( variants != null ) - return super.getItemStackDisplayName( is ) + " - " + variants[dmgToPart.get( is.getItemDamage() ).variant].toString(); + return super.getItemStackDisplayName( is ) + " - " + variants[this.dmgToPart.get( is.getItemDamage() ).variant].toString(); if ( pt.getExtraName() != null ) return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal(); @@ -188,9 +188,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @Override public void registerIcons(IIconRegister par1IconRegister) { - for (Entry part : dmgToPart.entrySet()) + for (Entry part : this.dmgToPart.entrySet()) { - String tex = "appliedenergistics2:" + getName( new ItemStack( this, 1, part.getKey() ) ); + String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) ); part.getValue().ico = par1IconRegister.registerIcon( tex ); } } @@ -206,7 +206,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup { try { - PartType t = getTypeByStack( is ); + PartType t = this.getTypeByStack( is ); if ( t != null ) { if ( t.constructor == null ) @@ -217,7 +217,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup } catch (Throwable e) { - throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + getTypeByStack( is ).getPart().getName() + throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + this.getTypeByStack( is ).getPart().getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } return null; @@ -226,7 +226,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @Override public void getSubItems(Item number, CreativeTabs tab, List cList) { - List> types = new ArrayList>( dmgToPart.entrySet() ); + List> types = new ArrayList>( this.dmgToPart.entrySet() ); Collections.sort( types, new Comparator>() { @Override @@ -243,8 +243,8 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup public int variantOf(int itemDamage) { - if ( dmgToPart.containsKey( itemDamage ) ) - return dmgToPart.get( itemDamage ).variant; + if ( this.dmgToPart.containsKey( itemDamage ) ) + return this.dmgToPart.get( itemDamage ).variant; return 0; } @@ -253,13 +253,13 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup { boolean importBus = false, exportBus = false, group = false; - PartType u = getTypeByStack( is ); + PartType u = this.getTypeByStack( is ); for (ItemStack stack : others) { if ( stack.getItem() == this ) { - PartType pt = getTypeByStack( stack ); + PartType pt = this.getTypeByStack( stack ); switch (pt) { case ImportBus: diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 598b05f20..cd286adce 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -138,10 +138,10 @@ public enum PartType } PartType(int baseMetaValue, AEFeature part, Class c, GuiText en) { - features = EnumSet.of( part ); - myPart = c; - extraName = en; - baseDamage = baseMetaValue; + this.features = EnumSet.of( part ); + this.myPart = c; + this.extraName = en; + this.baseDamage = baseMetaValue; } public Enum[] getVariants() @@ -154,17 +154,17 @@ public enum PartType public EnumSet getFeature() { - return features; + return this.features; } public Class getPart() { - return myPart; + return this.myPart; } public GuiText getExtraName() { - return extraName; + return this.extraName; } } diff --git a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java index f3bfaf05e..674c48108 100644 --- a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java @@ -218,7 +218,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II @Override public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player ) { - disassembleDrive( stack, world, player ); + this.disassembleDrive( stack, world, player ); return stack; } @@ -260,7 +260,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II @Override public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) { - return disassembleDrive( stack, world, player ); + return this.disassembleDrive( stack, world, player ); } @Override diff --git a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java index 884158e34..43fef8d1c 100644 --- a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java @@ -33,8 +33,8 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc public ItemCreativeStorageCell() { super( ItemCreativeStorageCell.class ); - setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.Creative ) ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.Creative ) ); + this.setMaxStackSize( 1 ); } @Override diff --git a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java index 4046822ff..1895a951a 100644 --- a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java @@ -52,16 +52,16 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag public ItemSpatialStorageCell( MaterialType whichCell, int spatialScale ) { super( ItemSpatialStorageCell.class, Optional.of( spatialScale + "Cubed" ) ); - setFeature( EnumSet.of( AEFeature.SpatialIO ) ); - setMaxStackSize( 1 ); - maxRegion = spatialScale; - component = whichCell; + this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); + this.setMaxStackSize( 1 ); + this.maxRegion = spatialScale; + this.component = whichCell; } @Override public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation ) { - WorldCoord wc = getStoredSize( stack ); + WorldCoord wc = this.getStoredSize( stack ); if ( wc.x > 0 ) lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z ); } @@ -75,7 +75,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag @Override public int getMaxStoredDim( ItemStack is ) { - return maxRegion; + return this.maxRegion; } @Override @@ -123,7 +123,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag @Override public WorldCoord getMin( ItemStack is ) { - World w = getWorld( is ); + World w = this.getWorld( is ); if ( w != null ) { NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" ); @@ -138,7 +138,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag @Override public WorldCoord getMax( ItemStack is ) { - World w = getWorld( is ); + World w = this.getWorld( is ); if ( w != null ) { NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" ); @@ -153,26 +153,26 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag @Override public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition ) { - WorldCoord scale = getStoredSize( is ); + WorldCoord scale = this.getStoredSize( is ); int targetX = max.x - min.x - 1; int targetY = max.y - min.y - 1; int targetZ = max.z - min.z - 1; - int maxSize = getMaxStoredDim( is ); + int maxSize = this.getMaxStoredDim( is ); int floorBuffer = 64; - World destination = getWorld( is ); + World destination = this.getWorld( is ); if ( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) ) { if ( targetX <= maxSize && targetY <= maxSize && targetZ <= maxSize ) { if ( destination == null ) - destination = createNewWorld( is ); + destination = this.createNewWorld( is ); StorageHelper.getInstance() .swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 ); - setStoredSize( is, targetX, targetY, targetZ ); + this.setStoredSize( is, targetX, targetY, targetZ ); return new TransitionResult( true, 0 ); } diff --git a/src/main/java/appeng/items/storage/ItemViewCell.java b/src/main/java/appeng/items/storage/ItemViewCell.java index bced565bd..4a97a401e 100644 --- a/src/main/java/appeng/items/storage/ItemViewCell.java +++ b/src/main/java/appeng/items/storage/ItemViewCell.java @@ -46,8 +46,8 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem public ItemViewCell() { super( ItemViewCell.class ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setMaxStackSize( 1 ); } @Override diff --git a/src/main/java/appeng/items/tools/ToolBiometricCard.java b/src/main/java/appeng/items/tools/ToolBiometricCard.java index 6f84a304e..17f50d9bf 100644 --- a/src/main/java/appeng/items/tools/ToolBiometricCard.java +++ b/src/main/java/appeng/items/tools/ToolBiometricCard.java @@ -45,8 +45,8 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard public ToolBiometricCard() { super( ToolBiometricCard.class ); - setFeature( EnumSet.of( AEFeature.Security ) ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( AEFeature.Security ) ); + this.setMaxStackSize( 1 ); if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, new ToolBiometricCardRender() ); } @@ -54,7 +54,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard @Override public String getItemStackDisplayName(ItemStack is) { - GameProfile username = getProfile( is ); + GameProfile username = this.getProfile( is ); return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is ); } @@ -65,7 +65,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard { if ( par2EntityPlayer.capabilities.isCreativeMode ) is = par2EntityPlayer.getCurrentEquippedItem(); - encode( is, (EntityPlayer) target ); + this.encode( is, (EntityPlayer) target ); par2EntityPlayer.swingItem(); return true; } @@ -77,7 +77,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard { if ( p.isSneaking() ) { - encode( is, p ); + this.encode( is, p ); p.swingItem(); return is; } @@ -87,18 +87,18 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard private void encode(ItemStack is, EntityPlayer p) { - GameProfile username = getProfile( is ); + GameProfile username = this.getProfile( is ); if (username != null && username.equals(p.getGameProfile())) - setProfile( is, null ); + this.setProfile( is, null ); else - setProfile( is, p.getGameProfile() ); + this.setProfile( is, p.getGameProfile() ); } @Override public void addCheckedInformation(ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation ) { - EnumSet perms = getPermissions( stack ); + EnumSet perms = this.getPermissions( stack ); if ( perms.isEmpty() ) lines.add( GuiText.NoPermissions.getLocal() ); else @@ -181,6 +181,6 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard @Override public void registerPermissions(ISecurityRegistry register, IPlayerRegistry pr, ItemStack is) { - register.addPlayer( pr.getID( getProfile( is ) ), getPermissions( is ) ); + register.addPlayer( pr.getID( this.getProfile( is ) ), this.getPermissions( is ) ); } } diff --git a/src/main/java/appeng/items/tools/ToolMemoryCard.java b/src/main/java/appeng/items/tools/ToolMemoryCard.java index 4dc96c4c8..3d5126e5e 100644 --- a/src/main/java/appeng/items/tools/ToolMemoryCard.java +++ b/src/main/java/appeng/items/tools/ToolMemoryCard.java @@ -41,8 +41,8 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard public ToolMemoryCard() { super( ToolMemoryCard.class ); - setFeature( EnumSet.of( AEFeature.Core ) ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( AEFeature.Core ) ); + this.setMaxStackSize( 1 ); } /** @@ -69,11 +69,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard @Override public void addCheckedInformation(ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation ) { - lines.add( getLocalizedName( getSettingsName( stack ) + ".name", getSettingsName( stack ) ) ); + lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) ); - NBTTagCompound data = getData( stack ); + NBTTagCompound data = this.getData( stack ); if ( data.hasKey( "tooltip" ) ) - lines.add( StatCollector.translateToLocal( getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) ); + lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) ); } @Override diff --git a/src/main/java/appeng/items/tools/ToolNetworkTool.java b/src/main/java/appeng/items/tools/ToolNetworkTool.java index 8cd55b007..c8a7c7d02 100644 --- a/src/main/java/appeng/items/tools/ToolNetworkTool.java +++ b/src/main/java/appeng/items/tools/ToolNetworkTool.java @@ -83,7 +83,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, if ( mop == null ) { - onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 ); + this.onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 ); } else { @@ -92,7 +92,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, int k = mop.blockZ; if ( w.getBlock( i, j, k ).isAir( w, i, j, k ) ) - onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 ); + this.onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 ); } } diff --git a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java index b4497c223..1ab5c8185 100644 --- a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java +++ b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java @@ -41,8 +41,8 @@ public class ToolChargedStaff extends AEBasePoweredItem public ToolChargedStaff() { super( ToolChargedStaff.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.chargedStaffBattery; + this.setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.chargedStaffBattery; } @Override @@ -50,7 +50,7 @@ public class ToolChargedStaff extends AEBasePoweredItem { if ( this.getAECurrentPower( item ) > 300 ) { - extractAEPower( item, 300 ); + this.extractAEPower( item, 300 ); if ( Platform.isServer() ) { for ( int x = 0; x < 2; x++ ) diff --git a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java index 3aac6e7a8..15b04f4d2 100644 --- a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java +++ b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java @@ -100,8 +100,8 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe public ToolColorApplicator() { super( ToolColorApplicator.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.colorApplicatorBattery; + this.setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.colorApplicatorBattery; if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, new ToolColorApplicatorRender() ); } @@ -119,7 +119,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe Block blk = w.getBlock( x, y, z ); double powerPerUse = 100; - ItemStack paintBall = getColor( is ); + ItemStack paintBall = this.getColor( is ); IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); if ( inv != null ) @@ -144,12 +144,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe // clean cables. if ( te instanceof IColorableTile ) { - if ( getAECurrentPower( is ) > powerPerUse && ( ( IColorableTile ) te ).getColor() != AEColor.Transparent ) + if ( this.getAECurrentPower( is ) > powerPerUse && ( ( IColorableTile ) te ).getColor() != AEColor.Transparent ) { if ( ( ( IColorableTile ) te ).recolourBlock( orientation, AEColor.Transparent, p ) ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); - extractAEPower( is, powerPerUse ); + this.extractAEPower( is, powerPerUse ); return true; } } @@ -158,25 +158,25 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe // clean paint balls.. Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); - if ( getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint ) + if ( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); - extractAEPower( is, powerPerUse ); + this.extractAEPower( is, powerPerUse ); ( ( TilePaint ) painted ).cleanSide( orientation.getOpposite() ); return true; } } else if ( paintBall != null ) { - AEColor color = getColorFromItem( paintBall ); + AEColor color = this.getColorFromItem( paintBall ); - if ( color != null && getAECurrentPower( is ) > powerPerUse ) + if ( color != null && this.getAECurrentPower( is ) > powerPerUse ) { if ( color != AEColor.Transparent - && recolourBlock( blk, ForgeDirection.getOrientation( side ), w, x, y, z, ForgeDirection.getOrientation( side ), color, p ) ) + && this.recolourBlock( blk, ForgeDirection.getOrientation( side ), w, x, y, z, ForgeDirection.getOrientation( side ), color, p ) ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); - extractAEPower( is, powerPerUse ); + this.extractAEPower( is, powerPerUse ); return true; } } @@ -186,7 +186,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if ( p.isSneaking() ) { - cycleColors( is, paintBall, 1 ); + this.cycleColors( is, paintBall, 1 ); } return false; @@ -197,7 +197,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe { String extra = GuiText.Empty.getLocal(); - AEColor selected = getActiveColor( par1ItemStack ); + AEColor selected = this.getActiveColor( par1ItemStack ); if ( selected != null && Platform.isClient() ) extra = Platform.gui_localize( selected.unlocalizedName ); @@ -207,7 +207,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe public AEColor getActiveColor( ItemStack tol ) { - return getColorFromItem( getColor( tol ) ); + return this.getColorFromItem( this.getColor( tol ) ); } public AEColor getColorFromItem( ItemStack paintBall ) @@ -248,7 +248,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return oldColor; } - return findNextColor( is, null, 0 ); + return this.findNextColor( is, null, 0 ); } private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset ) @@ -306,7 +306,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } if ( newColor != null ) - setColor( is, newColor ); + this.setColor( is, newColor ); return newColor; } @@ -383,11 +383,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe { if ( paintBall == null ) { - setColor( is, getColor( is ) ); + this.setColor( is, this.getColor( is ) ); } else { - setColor( is, findNextColor( is, paintBall, i ) ); + this.setColor( is, this.findNextColor( is, paintBall, i ) ); } } @@ -513,7 +513,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe @Override public void onWheel( ItemStack is, boolean up ) { - cycleColors( is, getColor( is ), up ? 1 : -1 ); + this.cycleColors( is, this.getColor( is ), up ? 1 : -1 ); } } diff --git a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java index e2cc6eaf3..7434786dd 100644 --- a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java +++ b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java @@ -63,8 +63,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT public ToolEntropyManipulator() { super( ToolEntropyManipulator.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.entropyManipulatorBattery; + this.setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.entropyManipulatorBattery; coolDown = new Hashtable(); coolDown.put( new Combo( Blocks.stone, 0 ), new InWorldToolOperationResult( new ItemStack( Blocks.cobblestone ) ) ); @@ -124,14 +124,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT public Combo( Block b, int m ) { - blk = b; - meta = m; + this.blk = b; + this.meta = m; } @Override public int hashCode() { - return blk.hashCode() ^ meta; + return this.blk.hashCode() ^ this.meta; } @Override @@ -139,10 +139,10 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; Combo other = ( Combo ) obj; - return blk == other.blk && meta == other.meta; + return this.blk == other.blk && this.meta == other.meta; } } @@ -200,7 +200,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if ( this.getAECurrentPower( item ) > 1600 ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); target.setFire( 8 ); } @@ -226,7 +226,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if ( Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) ) { - onItemUse( item, p, w, x, y, z, 0, 0.0F, 0.0F, 0.0F ); + this.onItemUse( item, p, w, x, y, z, 0, 0.0F, 0.0F, 0.0F ); } } } @@ -250,7 +250,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if ( canCool( Blk, Metadata ) ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); cool( Blk, Metadata, w, x, y, z ); return true; } @@ -273,7 +273,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if ( canHeat( Blk, Metadata ) ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); heat( Blk, Metadata, w, x, y, z ); return true; } @@ -308,7 +308,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if ( hasFurnaceable && canFurnaceable ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); @@ -340,7 +340,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if ( w.isAirBlock( x, y, z ) ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); w.setBlock( x, y, z, Blocks.fire ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index fd0c9eb35..486938bb1 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -84,8 +84,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell public ToolMassCannon() { super( ToolMassCannon.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.matterCannonBattery; + this.setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.matterCannonBattery; } @Override @@ -120,7 +120,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { int shots = 1; - CellUpgrades cu = ( CellUpgrades ) getUpgradesInventory( item ); + CellUpgrades cu = ( CellUpgrades ) this.getUpgradesInventory( item ); if ( cu != null ) shots += cu.getInstalledUpgrades( Upgrades.SPEED ); @@ -134,7 +134,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell shots = Math.min( shots, ( int ) aeAmmo.getStackSize() ); for ( int sh = 0; sh < shots; sh++ ) { - extractAEPower( item, 1600 ); + this.extractAEPower( item, 1600 ); if ( Platform.isClient() ) return item; @@ -174,13 +174,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell ItemStack type = ( ( IAEItemStack ) aeAmmo ).getItemStack(); if ( type.getItem() instanceof ItemPaintBall ) { - shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 ); + this.shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 ); } return item; } else { - standardAmmo( penetration, w, p, vec3, vec31, direction, d0, d1, d2 ); + this.standardAmmo( penetration, w, p, vec3, vec31, direction, d0, d1, d2 ); } } diff --git a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java index 121e42570..de9b2d001 100644 --- a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java +++ b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java @@ -62,8 +62,8 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, public ToolPortableCell() { super( ToolPortableCell.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.portableCellBattery; + this.setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.portableCellBattery; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java index db116cfc2..21c4210f9 100644 --- a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java +++ b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java @@ -55,8 +55,8 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless public ToolWirelessTerminal() { super( ToolWirelessTerminal.class, Optional. absent() ); - setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.wirelessTerminalBattery; + this.setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) ); + this.maxStoredPower = AEConfig.instance.wirelessTerminalBattery; } @SideOnly(Side.CLIENT) @@ -110,7 +110,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless @Override public boolean hasPower( EntityPlayer player, double amt, ItemStack is ) { - return getAECurrentPower( is ) >= amt; + return this.getAECurrentPower( is ) >= amt; } @Override diff --git a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java index fa82174e9..27dafa656 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java @@ -47,9 +47,9 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage public AERootPoweredItem( Class c, Optional subName ) { super( c, subName ); - setMaxDamage( 32 ); - hasSubtypes = false; - setFull3D(); + this.setMaxDamage( 32 ); + this.hasSubtypes = false; + this.setFull3D(); } @Override @@ -57,7 +57,7 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage { NBTTagCompound tag = stack.getTagCompound(); double internalCurrentPower = 0; - double internalMaxPower = getAEMaxPower( stack ); + double internalMaxPower = this.getAEMaxPower( stack ); if ( tag != null ) { @@ -84,8 +84,8 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage ItemStack charged = new ItemStack( this, 1 ); NBTTagCompound tag = Platform.openNbtData( charged ); - tag.setDouble( "internalCurrentPower", getAEMaxPower( charged ) ); - tag.setDouble( "internalMaxPower", getAEMaxPower( charged ) ); + tag.setDouble( "internalCurrentPower", this.getAEMaxPower( charged ) ); + tag.setDouble( "internalMaxPower", this.getAEMaxPower( charged ) ); list.add( charged ); } @@ -98,7 +98,7 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage @Override public double getDurabilityForDisplay( ItemStack is ) { - return 1 - getAECurrentPower( is ) / getAEMaxPower( is ); + return 1 - this.getAECurrentPower( is ) / this.getAEMaxPower( is ); } @Override @@ -120,14 +120,14 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage { if ( simulate ) { - int requiredEU = ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( is ) - getAECurrentPower( is ) ); + int requiredEU = ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) ); if ( amount < requiredEU ) return 0; return amount - requiredEU; } else { - double powerRemainder = injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); + double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); return PowerUnits.AE.convertTo( PowerUnits.EU, powerRemainder ); } } @@ -135,21 +135,21 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage @Override public double injectAEPower( ItemStack is, double amt ) { - return getInternalBattery( is, batteryOperation.INJECT, amt ); + return this.getInternalBattery( is, batteryOperation.INJECT, amt ); } @Override public double extractAEPower( ItemStack is, double amt ) { - return getInternalBattery( is, batteryOperation.EXTRACT, amt ); + return this.getInternalBattery( is, batteryOperation.EXTRACT, amt ); } private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment ) { NBTTagCompound data = Platform.openNbtData( is ); - double currentStorage = data.getDouble( EnergyVar ); - double maxStorage = getAEMaxPower( is ); + double currentStorage = data.getDouble( this.EnergyVar ); + double maxStorage = this.getAEMaxPower( is ); switch ( op ) { @@ -158,19 +158,19 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage if ( currentStorage > maxStorage ) { double diff = currentStorage - maxStorage; - data.setDouble( EnergyVar, maxStorage ); + data.setDouble( this.EnergyVar, maxStorage ); return diff; } - data.setDouble( EnergyVar, currentStorage ); + data.setDouble( this.EnergyVar, currentStorage ); return 0; case EXTRACT: if ( currentStorage > adjustment ) { currentStorage -= adjustment; - data.setDouble( EnergyVar, currentStorage ); + data.setDouble( this.EnergyVar, currentStorage ); return adjustment; } - data.setDouble( EnergyVar, 0 ); + data.setDouble( this.EnergyVar, 0 ); return currentStorage; default: break; @@ -182,13 +182,13 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage @Override public double getAEMaxPower( ItemStack is ) { - return maxStoredPower; + return this.maxStoredPower; } @Override public double getAECurrentPower( ItemStack is ) { - return getInternalBattery( is, batteryOperation.STORAGE, 0 ); + return this.getInternalBattery( is, batteryOperation.STORAGE, 0 ); } @Override diff --git a/src/main/java/appeng/items/tools/powered/powersink/IC2.java b/src/main/java/appeng/items/tools/powered/powersink/IC2.java index 43e183ce1..4114fb3a1 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/IC2.java +++ b/src/main/java/appeng/items/tools/powered/powersink/IC2.java @@ -48,12 +48,12 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate ) { double addedAmt = amount; - double limit = getTransferLimit( is ); + double limit = this.getTransferLimit( is ); if ( !ignoreTransferLimit && amount > limit ) addedAmt = limit; - return addedAmt - ( ( int ) injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) ); + return addedAmt - ( ( int ) this.injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) ); } @Override @@ -65,22 +65,22 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe @Override public double getCharge( ItemStack is ) { - return ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAECurrentPower( is ) ); + return ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) ); } @Override public boolean canUse( ItemStack is, double amount ) { - return getCharge( is ) > amount; + return this.getCharge( is ) > amount; } @Override public boolean use( ItemStack is, double amount, EntityLivingBase entity ) { - if ( canUse( is, amount ) ) + if ( this.canUse( is, amount ) ) { // use the power.. - extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); + this.extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); return true; } return false; @@ -119,7 +119,7 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe @Override public double getMaxCharge( ItemStack itemStack ) { - return PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( itemStack ) ); + return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) ); } @Override @@ -131,7 +131,7 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe @Override public double getTransferLimit( ItemStack itemStack ) { - return Math.max( 32, getMaxCharge( itemStack ) / 200 ); + return Math.max( 32, this.getMaxCharge( itemStack ) / 200 ); } @Override diff --git a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java index 73fe858bb..693bb18ac 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java @@ -41,7 +41,7 @@ public class RedstoneFlux extends IC2 implements IEnergyContainerItem @Override public int receiveEnergy( ItemStack is, int maxReceive, boolean simulate ) { - return maxReceive - ( int ) injectExternalPower( PowerUnits.RF, is, maxReceive, simulate ); + return maxReceive - ( int ) this.injectExternalPower( PowerUnits.RF, is, maxReceive, simulate ); } @Override @@ -53,13 +53,13 @@ public class RedstoneFlux extends IC2 implements IEnergyContainerItem @Override public int getEnergyStored( ItemStack is ) { - return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAECurrentPower( is ) ); + return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower( is ) ); } @Override public int getMaxEnergyStored( ItemStack is ) { - return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAEMaxPower( is ) ); + return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower( is ) ); } } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java index 2d22ce56c..cc1940f21 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java @@ -41,7 +41,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature public ToolQuartzAxe( AEFeature Type ) { super( ToolMaterial.IRON ); - this.feature = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzAxe ), this, this, Optional.of( Type.name() ) ); + this.feature = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzAxe ), this, this, Optional.of( Type.name() ) ); } @Override @@ -59,6 +59,6 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( type, a, b ); + return Platform.canRepair( this.type, a, b ); } } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java index 832682433..e5f13f109 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java @@ -46,9 +46,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem { super( ToolQuartzCuttingKnife.class, Optional.of( Type.name() ) ); - setFeature( EnumSet.of( type = Type, AEFeature.QuartzKnife ) ); - setMaxDamage( 50 ); - setMaxStackSize( 1 ); + this.setFeature( EnumSet.of( this.type = Type, AEFeature.QuartzKnife ) ); + this.setMaxDamage( 50 ); + this.setMaxStackSize( 1 ); } @Override @@ -77,7 +77,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( type, a, b ); + return Platform.canRepair( this.type, a, b ); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java index 7d709b10b..23edeb890 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java @@ -49,7 +49,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature @Override public IFeatureHandler handler() { - return handler; + return this.handler; } @Override @@ -61,6 +61,6 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( feature, a, b ); + return Platform.canRepair( this.feature, a, b ); } } \ No newline at end of file diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java index 818db3246..bdc0cad75 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java @@ -61,6 +61,6 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( type, a, b ); + return Platform.canRepair( this.type, a, b ); } } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java index c912d4e78..d270f9c62 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java @@ -42,13 +42,13 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature { super( ToolMaterial.IRON ); - this.handler = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzSpade ), this, this, Optional.of( Type.name() ) ); + this.handler = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzSpade ), this, this, Optional.of( Type.name() ) ); } @Override public IFeatureHandler handler() { - return handler; + return this.handler; } @Override @@ -60,6 +60,6 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( type, a, b ); + return Platform.canRepair( this.type, a, b ); } } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java index a3983f506..7cff6e421 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java @@ -41,13 +41,13 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature public ToolQuartzSword( AEFeature Type ) { super( ToolMaterial.IRON ); - feature = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzSword ), this, this, Optional.of( Type.name() ) ); + this.feature = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzSword ), this, this, Optional.of( Type.name() ) ); } @Override public IFeatureHandler handler() { - return feature; + return this.feature; } @Override @@ -59,6 +59,6 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature @Override public boolean getIsRepairable( ItemStack a, ItemStack b ) { - return Platform.canRepair( type, a, b ); + return Platform.canRepair( this.type, a, b ); } } diff --git a/src/main/java/appeng/me/GridCacheWrapper.java b/src/main/java/appeng/me/GridCacheWrapper.java index d25b2b156..c70d8bcd2 100644 --- a/src/main/java/appeng/me/GridCacheWrapper.java +++ b/src/main/java/appeng/me/GridCacheWrapper.java @@ -30,49 +30,49 @@ public class GridCacheWrapper implements IGridCache final String name; public GridCacheWrapper(final IGridCache gc) { - myCache = gc; - name = myCache.getClass().getName(); + this.myCache = gc; + this.name = this.myCache.getClass().getName(); } @Override public void onUpdateTick() { - myCache.onUpdateTick(); + this.myCache.onUpdateTick(); } @Override public void removeNode(final IGridNode gridNode, final IGridHost machine) { - myCache.removeNode( gridNode, machine ); + this.myCache.removeNode( gridNode, machine ); } @Override public void addNode(final IGridNode gridNode, final IGridHost machine) { - myCache.addNode( gridNode, machine ); + this.myCache.addNode( gridNode, machine ); } public String getName() { - return name; + return this.name; } @Override public void onSplit(final IGridStorage storageB) { - myCache.onSplit( storageB ); + this.myCache.onSplit( storageB ); } @Override public void onJoin(final IGridStorage storageB) { - myCache.onJoin( storageB ); + this.myCache.onJoin( storageB ); } @Override public void populateGridStorage(final IGridStorage storage) { - myCache.populateGridStorage( storage ); + this.myCache.populateGridStorage( storage ); } } diff --git a/src/main/java/appeng/me/GridConnection.java b/src/main/java/appeng/me/GridConnection.java index 051a52391..206c9d075 100644 --- a/src/main/java/appeng/me/GridConnection.java +++ b/src/main/java/appeng/me/GridConnection.java @@ -73,9 +73,9 @@ public class GridConnection implements IGridConnection, IPathItem if ( a.hasConnection( b ) || b.hasConnection( a ) ) throw new GridException( "Connection already exists." ); - sideA = a; + this.sideA = a; this.fromAtoB = fromAtoB; - sideB = b; + this.sideB = b; if ( b.getMyGrid() == null ) { @@ -93,7 +93,7 @@ public class GridConnection implements IGridConnection, IPathItem GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); } - else if ( isNetworkABetter( a, b ) ) + else if ( this.isNetworkABetter( a, b ) ) { GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); @@ -106,11 +106,11 @@ public class GridConnection implements IGridConnection, IPathItem } // a connection was destroyed RE-PATH!! - IPathingGrid p = sideA.getInternalGrid().getCache( IPathingGrid.class ); + IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); - sideA.addConnection( this ); - sideB.addConnection( this ); + this.sideA.addConnection( this ); + this.sideB.addConnection( this ); } private boolean isNetworkABetter(GridNode a, GridNode b) @@ -122,47 +122,47 @@ public class GridConnection implements IGridConnection, IPathItem public void destroy() { // a connection was destroyed RE-PATH!! - IPathingGrid p = sideA.getInternalGrid().getCache( IPathingGrid.class ); + IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); - sideA.removeConnection( this ); - sideB.removeConnection( this ); + this.sideA.removeConnection( this ); + this.sideB.removeConnection( this ); - sideA.validateGrid(); - sideB.validateGrid(); + this.sideA.validateGrid(); + this.sideB.validateGrid(); } @Override public IGridNode a() { - return sideA; + return this.sideA; } @Override public ForgeDirection getDirection(IGridNode side) { - if ( fromAtoB == ForgeDirection.UNKNOWN ) - return fromAtoB; + if ( this.fromAtoB == ForgeDirection.UNKNOWN ) + return this.fromAtoB; - if ( sideA == side ) - return fromAtoB; + if ( this.sideA == side ) + return this.fromAtoB; else - return fromAtoB.getOpposite(); + return this.fromAtoB.getOpposite(); } @Override public IGridNode b() { - return sideB; + return this.sideB; } @Override public IGridNode getOtherSide(IGridNode gridNode) { - if ( gridNode == sideA ) - return sideB; - if ( gridNode == sideB ) - return sideA; + if ( gridNode == this.sideA ) + return this.sideB; + if ( gridNode == this.sideB ) + return this.sideA; throw new GridException( "Invalid Side of Connection" ); } @@ -170,74 +170,74 @@ public class GridConnection implements IGridConnection, IPathItem @Override public boolean hasDirection() { - return fromAtoB != ForgeDirection.UNKNOWN; + return this.fromAtoB != ForgeDirection.UNKNOWN; } @Override public IReadOnlyCollection getPossibleOptions() { - return new ReadOnlyCollection( Arrays.asList( (IPathItem) a(), (IPathItem) b() ) ); + return new ReadOnlyCollection( Arrays.asList( (IPathItem) this.a(), (IPathItem) this.b() ) ); } @Override public void incrementChannelCount(int usedChannels) { - channelData += usedChannels; + this.channelData += usedChannels; } @Override public boolean canSupportMoreChannels() { - return getLastUsedChannels() < 32; // max, PERIOD. + return this.getLastUsedChannels() < 32; // max, PERIOD. } @Override public int getUsedChannels() { - return (channelData >> 8) & 0xff; + return (this.channelData >> 8) & 0xff; } public int getLastUsedChannels() { - return channelData & 0xff; + return this.channelData & 0xff; } @Override public IPathItem getControllerRoute() { - if ( sideA.getFlags().contains( GridFlags.CANNOT_CARRY ) ) + if ( this.sideA.getFlags().contains( GridFlags.CANNOT_CARRY ) ) return null; - return sideA; + return this.sideA; } @Override public void setControllerRoute(IPathItem fast, boolean zeroOut) { if ( zeroOut ) - channelData &= ~0xff; + this.channelData &= ~0xff; - if ( sideB == fast ) + if ( this.sideB == fast ) { - GridNode tmp = sideA; - sideA = sideB; - sideB = tmp; - fromAtoB = fromAtoB.getOpposite(); + GridNode tmp = this.sideA; + this.sideA = this.sideB; + this.sideB = tmp; + this.fromAtoB = this.fromAtoB.getOpposite(); } } @Override public void finalizeChannels() { - if ( getUsedChannels() != getLastUsedChannels() ) + if ( this.getUsedChannels() != this.getLastUsedChannels() ) { - channelData = (channelData & 0xff); - channelData |= channelData << 8; + this.channelData = (this.channelData & 0xff); + this.channelData |= this.channelData << 8; - if ( sideA.getInternalGrid() != null ) - sideA.getInternalGrid().postEventTo( sideA, event ); + if ( this.sideA.getInternalGrid() != null ) + this.sideA.getInternalGrid().postEventTo( this.sideA, event ); - if ( sideB.getInternalGrid() != null ) - sideB.getInternalGrid().postEventTo( sideB, event ); + if ( this.sideB.getInternalGrid() != null ) + this.sideB.getInternalGrid().postEventTo( this.sideB, event ); } } diff --git a/src/main/java/appeng/me/GridSplitDetector.java b/src/main/java/appeng/me/GridSplitDetector.java index 560281a20..3d7391a86 100644 --- a/src/main/java/appeng/me/GridSplitDetector.java +++ b/src/main/java/appeng/me/GridSplitDetector.java @@ -34,9 +34,9 @@ class GridSplitDetector implements IGridVisitor @Override public boolean visitNode(IGridNode n) { - if ( n == pivot ) - pivotFound = true; + if ( n == this.pivot ) + this.pivotFound = true; - return !pivotFound; + return !this.pivotFound; } } diff --git a/src/main/java/appeng/me/GridStorage.java b/src/main/java/appeng/me/GridStorage.java index d969cf667..e6d050c8b 100644 --- a/src/main/java/appeng/me/GridStorage.java +++ b/src/main/java/appeng/me/GridStorage.java @@ -51,9 +51,9 @@ public class GridStorage implements IGridStorage * @param gss grid storage search */ public GridStorage(long id, GridStorageSearch gss) { - myID = id; - mySearchEntry = gss; - data = new NBTTagCompound(); + this.myID = id; + this.mySearchEntry = gss; + this.data = new NBTTagCompound(); } /** @@ -64,8 +64,8 @@ public class GridStorage implements IGridStorage * @param gss grid storage search */ public GridStorage(String input, long id, GridStorageSearch gss) { - myID = id; - mySearchEntry = gss; + this.myID = id; + this.mySearchEntry = gss; NBTTagCompound myTag = null; try @@ -78,23 +78,23 @@ public class GridStorage implements IGridStorage myTag = new NBTTagCompound(); } - data = myTag; + this.data = myTag; } /** * fake storage. */ public GridStorage() { - myID = 0; - mySearchEntry = null; - data = new NBTTagCompound(); + this.myID = 0; + this.mySearchEntry = null; + this.data = new NBTTagCompound(); } public String getValue() { - isDirty = false; + this.isDirty = false; - Grid currentGrid = (Grid) getGrid(); + Grid currentGrid = (Grid) this.getGrid(); if ( currentGrid != null ) { currentGrid.saveState(); @@ -103,7 +103,7 @@ public class GridStorage implements IGridStorage try { ByteArrayOutputStream out = new ByteArrayOutputStream(); - CompressedStreamTools.writeCompressed( data, out ); + CompressedStreamTools.writeCompressed( this.data, out ); return javax.xml.bind.DatatypeConverter.printBase64Binary( out.toByteArray() ); } catch (IOException e) @@ -117,43 +117,43 @@ public class GridStorage implements IGridStorage @Override public NBTTagCompound dataObject() { - return data; + return this.data; } @Override public long getID() { - return myID; + return this.myID; } public void markDirty() { - isDirty = true; + this.isDirty = true; } public IGrid getGrid() { - return internalGrid == null ? null : internalGrid.get(); + return this.internalGrid == null ? null : this.internalGrid.get(); } public void setGrid(Grid grid) { - internalGrid = new WeakReference( grid ); + this.internalGrid = new WeakReference( grid ); } public void addDivided(GridStorage gs) { - divided.put( gs, true ); + this.divided.put( gs, true ); } public boolean hasDivided(GridStorage myStorage) { - return divided.containsKey( myStorage ); + return this.divided.containsKey( myStorage ); } public void remove() { - WorldSettings.getInstance().destroyGridStorage( getID() ); + WorldSettings.getInstance().destroyGridStorage( this.getID() ); } } diff --git a/src/main/java/appeng/me/GridStorageSearch.java b/src/main/java/appeng/me/GridStorageSearch.java index 4e357dead..f62696419 100644 --- a/src/main/java/appeng/me/GridStorageSearch.java +++ b/src/main/java/appeng/me/GridStorageSearch.java @@ -40,11 +40,11 @@ public class GridStorageSearch { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; GridStorageSearch other = (GridStorageSearch) obj; - if ( id == other.id ) + if ( this.id == other.id ) return true; return false; @@ -53,7 +53,7 @@ public class GridStorageSearch @Override public int hashCode() { - return ((Long) id).hashCode(); + return ((Long) this.id).hashCode(); } } diff --git a/src/main/java/appeng/me/MachineSet.java b/src/main/java/appeng/me/MachineSet.java index 975b98557..0ea3e43a5 100644 --- a/src/main/java/appeng/me/MachineSet.java +++ b/src/main/java/appeng/me/MachineSet.java @@ -32,13 +32,13 @@ public class MachineSet extends HashSet implements IMachineSet private final Class machine; MachineSet(Class m) { - machine = m; + this.machine = m; } @Override public Class getMachineClass() { - return machine; + return this.machine; } } diff --git a/src/main/java/appeng/me/NetworkList.java b/src/main/java/appeng/me/NetworkList.java index 8d993e385..4d8b43dee 100644 --- a/src/main/java/appeng/me/NetworkList.java +++ b/src/main/java/appeng/me/NetworkList.java @@ -31,91 +31,91 @@ public class NetworkList implements Collection @Override public boolean add(Grid e) { - copy(); - return networks.add( e ); + this.copy(); + return this.networks.add( e ); } @Override public boolean addAll(Collection c) { - copy(); - return networks.addAll( c ); + this.copy(); + return this.networks.addAll( c ); } @Override public void clear() { - networks = new LinkedList(); + this.networks = new LinkedList(); } @Override public boolean contains(Object o) { - return networks.contains( o ); + return this.networks.contains( o ); } @Override public boolean containsAll(Collection c) { - return networks.containsAll( c ); + return this.networks.containsAll( c ); } @Override public boolean isEmpty() { - return networks.isEmpty(); + return this.networks.isEmpty(); } @Override public Iterator iterator() { - return networks.iterator(); + return this.networks.iterator(); } @Override public boolean remove(Object o) { - copy(); - return networks.remove( o ); + this.copy(); + return this.networks.remove( o ); } @Override public boolean removeAll(Collection c) { - copy(); - return networks.removeAll( c ); + this.copy(); + return this.networks.removeAll( c ); } @Override public boolean retainAll(Collection c) { - copy(); - return networks.retainAll( c ); + this.copy(); + return this.networks.retainAll( c ); } private void copy() { - List old = networks; - networks = new LinkedList(); - networks.addAll( old ); + List old = this.networks; + this.networks = new LinkedList(); + this.networks.addAll( old ); } @Override public int size() { - return networks.size(); + return this.networks.size(); } @Override public Object[] toArray() { - return networks.toArray(); + return this.networks.toArray(); } @Override public T[] toArray(T[] a) { - return networks.toArray( a ); + return this.networks.toArray( a ); } } diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index e753b8187..27afbff17 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -104,7 +104,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper @Override public boolean hasNext() { - findNext(); + this.findNext(); return this.cpuCluster != null; } @@ -207,7 +207,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper @MENetworkEventSubscribe public void updateCPUClusters(MENetworkCraftingPatternChange c) { - updatePatterns(); + this.updatePatterns(); } @Override @@ -253,7 +253,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper { ICraftingWatcherHost watcherHost = (ICraftingWatcherHost) machine; CraftingWatcher watcher = new CraftingWatcher( this, watcherHost ); - craftingWatchers.put( gridNode, watcher ); + this.craftingWatchers.put( gridNode, watcher ); watcherHost.updateWatcher( watcher ); } @@ -294,7 +294,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if ( cluster.myLastLink != null ) { - addLink( (CraftingLink) cluster.myLastLink ); + this.addLink( (CraftingLink) cluster.myLastLink ); } } } @@ -531,7 +531,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if ( cpuCluster != null ) { - return cpuCluster.submitJob( grid, job, src, requestingMachine ); + return cpuCluster.submitJob( this.grid, job, src, requestingMachine ); } return null; @@ -572,7 +572,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper public List getMediums(ICraftingPatternDetails key) { - List mediums = craftingMethods.get( key ); + List mediums = this.craftingMethods.get( key ); if ( mediums == null ) { diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index aaffdf94c..baec05889 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -101,29 +101,29 @@ public class EnergyGridCache implements IEnergyGrid private double buffer() { - return providers.isEmpty() ? 1000.0 : 0.0; + return this.providers.isEmpty() ? 1000.0 : 0.0; } private IAEPowerStorage getFirstRequester() { - if ( lastRequester == null ) + if ( this.lastRequester == null ) { - Iterator i = requesters.iterator(); - lastRequester = i.hasNext() ? i.next() : null; + Iterator i = this.requesters.iterator(); + this.lastRequester = i.hasNext() ? i.next() : null; } - return lastRequester; + return this.lastRequester; } private IAEPowerStorage getFirstProvider() { - if ( lastProvider == null ) + if ( this.lastProvider == null ) { - Iterator i = providers.iterator(); - lastProvider = i.hasNext() ? i.next() : null; + Iterator i = this.providers.iterator(); + this.lastProvider = i.hasNext() ? i.next() : null; } - return lastProvider; + return this.lastProvider; } final Multiset energyGridProviders = HashMultiset.create(); @@ -132,13 +132,13 @@ public class EnergyGridCache implements IEnergyGrid PathGridCache pgc; public EnergyGridCache(IGrid g) { - myGrid = g; + this.myGrid = g; } @MENetworkEventSubscribe public void postInit(MENetworkPostCacheConstruction pcc) { - pgc = myGrid.getCache( IPathingGrid.class ); + this.pgc = this.myGrid.getCache( IPathingGrid.class ); } @MENetworkEventSubscribe @@ -152,7 +152,7 @@ public class EnergyGridCache implements IEnergyGrid double diffDraw = newDraw - node.previousDraw; node.previousDraw = newDraw; - drainPerTick += diffDraw; + this.drainPerTick += diffDraw; } @MENetworkEventSubscribe @@ -164,11 +164,11 @@ public class EnergyGridCache implements IEnergyGrid { case PROVIDE_POWER: if ( ev.storage.getPowerFlow() != AccessRestriction.WRITE ) - providers.add( ev.storage ); + this.providers.add( ev.storage ); break; case REQUEST_POWER: if ( ev.storage.getPowerFlow() != AccessRestriction.READ ) - requesters.add( ev.storage ); + this.requesters.add( ev.storage ); break; } } @@ -181,8 +181,8 @@ public class EnergyGridCache implements IEnergyGrid @Override public double getEnergyDemand(double maxRequired) { - localSeen.clear(); - return getEnergyDemand( maxRequired, localSeen ); + this.localSeen.clear(); + return this.getEnergyDemand( maxRequired, this.localSeen ); } @Override @@ -191,9 +191,9 @@ public class EnergyGridCache implements IEnergyGrid if ( !seen.add( this ) ) return 0; - double required = buffer() - extra; + double required = this.buffer() - this.extra; - Iterator it = requesters.iterator(); + Iterator it = this.requesters.iterator(); while (required < maxRequired && it.hasNext()) { IAEPowerStorage node = it.next(); @@ -201,7 +201,7 @@ public class EnergyGridCache implements IEnergyGrid required += Math.max( 0.0, node.getAEMaxPower() - node.getAECurrentPower() ); } - Iterator ix = energyGridProviders.iterator(); + Iterator ix = this.energyGridProviders.iterator(); while (required < maxRequired && ix.hasNext()) { IEnergyGridProvider node = ix.next(); @@ -214,8 +214,8 @@ public class EnergyGridCache implements IEnergyGrid @Override public double injectPower(double amt, Actionable mode) { - localSeen.clear(); - return injectAEPower( amt, mode, localSeen ); + this.localSeen.clear(); + return this.injectAEPower( amt, mode, this.localSeen ); } @Override @@ -224,40 +224,40 @@ public class EnergyGridCache implements IEnergyGrid if ( !seen.add( this ) ) return 0; - double ignore = extra; - amt += extra; + double ignore = this.extra; + amt += this.extra; if ( mode == Actionable.SIMULATE ) { - Iterator it = requesters.iterator(); + Iterator it = this.requesters.iterator(); while (amt > 0 && it.hasNext()) { IAEPowerStorage node = it.next(); amt = node.injectAEPower( amt, Actionable.SIMULATE ); } - Iterator i = energyGridProviders.iterator(); + Iterator i = this.energyGridProviders.iterator(); while (amt > 0 && i.hasNext()) amt = i.next().injectAEPower( amt, mode, seen ); } else { - tickInjectionPerTick += amt - ignore; + this.tickInjectionPerTick += amt - ignore; // totalInjectionPastTicks[0] += i; - while (amt > 0 && !requesters.isEmpty()) + while (amt > 0 && !this.requesters.isEmpty()) { - IAEPowerStorage node = getFirstRequester(); + IAEPowerStorage node = this.getFirstRequester(); amt = node.injectAEPower( amt, Actionable.MODULATE ); if ( amt > 0 ) { - requesters.remove( node ); - lastRequester = null; + this.requesters.remove( node ); + this.lastRequester = null; } } - Iterator i = energyGridProviders.iterator(); + Iterator i = this.energyGridProviders.iterator(); while (amt > 0 && i.hasNext()) { IEnergyGridProvider what = i.next(); @@ -270,30 +270,30 @@ public class EnergyGridCache implements IEnergyGrid amt = cannotHold; } - extra = amt; + this.extra = amt; } - return Math.max( 0.0, amt - buffer() ); + return Math.max( 0.0, amt - this.buffer() ); } @Override public double extractAEPower(double amt, Actionable mode, PowerMultiplier pm) { - localSeen.clear(); - return pm.divide( extractAEPower( pm.multiply( amt ), mode, localSeen ) ); + this.localSeen.clear(); + return pm.divide( this.extractAEPower( pm.multiply( amt ), mode, this.localSeen ) ); } @Override public void addNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) - energyGridProviders.add( (IEnergyGridProvider) machine ); + this.energyGridProviders.add( (IEnergyGridProvider) machine ); // idle draw... GridNode gridNode = (GridNode) node; IGridBlock gb = gridNode.getGridBlock(); gridNode.previousDraw = gb.getIdlePowerUsage(); - drainPerTick += gridNode.previousDraw; + this.drainPerTick += gridNode.previousDraw; // power storage if ( machine instanceof IAEPowerStorage ) @@ -306,17 +306,17 @@ public class EnergyGridCache implements IEnergyGrid if ( ps.getPowerFlow() != AccessRestriction.WRITE ) { - globalMaxPower += ps.getAEMaxPower(); + this.globalMaxPower += ps.getAEMaxPower(); } if ( current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE ) { - globalAvailablePower += current; - providers.add( ps ); + this.globalAvailablePower += current; + this.providers.add( ps ); } if ( current < max && ps.getPowerFlow() != AccessRestriction.READ ) - requesters.add( ps ); + this.requesters.add( ps ); } } @@ -324,22 +324,22 @@ public class EnergyGridCache implements IEnergyGrid { IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; EnergyWatcher iw = new EnergyWatcher( this, swh ); - watchers.put( node, iw ); + this.watchers.put( node, iw ); swh.updateWatcher( iw ); } - myGrid.postEventTo( node, new MENetworkPowerStatusChange() ); + this.myGrid.postEventTo( node, new MENetworkPowerStatusChange() ); } @Override public void removeNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) - energyGridProviders.remove( machine ); + this.energyGridProviders.remove( machine ); // idle draw. GridNode gridNode = (GridNode) node; - drainPerTick -= gridNode.previousDraw; + this.drainPerTick -= gridNode.previousDraw; // power storage. if ( machine instanceof IAEPowerStorage ) @@ -349,28 +349,28 @@ public class EnergyGridCache implements IEnergyGrid { if ( ps.getPowerFlow() != AccessRestriction.WRITE ) { - globalMaxPower -= ps.getAEMaxPower(); - globalAvailablePower -= ps.getAECurrentPower(); + this.globalMaxPower -= ps.getAEMaxPower(); + this.globalAvailablePower -= ps.getAECurrentPower(); } - if ( lastProvider == machine ) - lastProvider = null; + if ( this.lastProvider == machine ) + this.lastProvider = null; - if ( lastRequester == machine ) - lastRequester = null; + if ( this.lastRequester == machine ) + this.lastRequester = null; - providers.remove( machine ); - requesters.remove( machine ); + this.providers.remove( machine ); + this.requesters.remove( machine ); } } if ( machine instanceof IStackWatcherHost ) { - IEnergyWatcher myWatcher = watchers.get( machine ); + IEnergyWatcher myWatcher = this.watchers.get( machine ); if ( myWatcher != null ) { myWatcher.clear(); - watchers.remove( machine ); + this.watchers.remove( machine ); } } @@ -381,66 +381,66 @@ public class EnergyGridCache implements IEnergyGrid @Override public void onUpdateTick() { - if ( !interests.isEmpty() ) + if ( !this.interests.isEmpty() ) { - double oldPower = lastStoredPower; - lastStoredPower = getStoredPower(); + double oldPower = this.lastStoredPower; + this.lastStoredPower = this.getStoredPower(); - EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, lastStoredPower ), null ); - EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, lastStoredPower ), null ); - for (EnergyThreshold th : interests.subSet( low, true, high, true )) + EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, this.lastStoredPower ), null ); + EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, this.lastStoredPower ), null ); + for (EnergyThreshold th : this.interests.subSet( low, true, high, true )) { ((EnergyWatcher) th.watcher).post( this ); } } - avgDrainPerTick *= (AvgLength - 1) / AvgLength; - avgInjectionPerTick *= (AvgLength - 1) / AvgLength; + this.avgDrainPerTick *= (this.AvgLength - 1) / this.AvgLength; + this.avgInjectionPerTick *= (this.AvgLength - 1) / this.AvgLength; - avgDrainPerTick += tickDrainPerTick / AvgLength; - avgInjectionPerTick += tickInjectionPerTick / AvgLength; + this.avgDrainPerTick += this.tickDrainPerTick / this.AvgLength; + this.avgInjectionPerTick += this.tickInjectionPerTick / this.AvgLength; - tickDrainPerTick = 0; - tickInjectionPerTick = 0; + this.tickDrainPerTick = 0; + this.tickInjectionPerTick = 0; // power information. boolean currentlyHasPower = false; - if ( drainPerTick > 0.0001 ) + if ( this.drainPerTick > 0.0001 ) { - double drained = extractAEPower( getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); - currentlyHasPower = drained >= drainPerTick - 0.001; + double drained = this.extractAEPower( this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); + currentlyHasPower = drained >= this.drainPerTick - 0.001; } else { - currentlyHasPower = extractAEPower( 0.1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0; + currentlyHasPower = this.extractAEPower( 0.1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0; } // ticks since change.. - if ( currentlyHasPower == hasPower ) - ticksSinceHasPowerChange++; + if ( currentlyHasPower == this.hasPower ) + this.ticksSinceHasPowerChange++; else - ticksSinceHasPowerChange = 0; + this.ticksSinceHasPowerChange = 0; // update status.. - hasPower = currentlyHasPower; + this.hasPower = currentlyHasPower; // update public status, this buffers power ups for 30 ticks. - if ( hasPower && ticksSinceHasPowerChange > 30 ) - publicPowerState( true, myGrid ); - else if ( !hasPower ) - publicPowerState( false, myGrid ); + if ( this.hasPower && this.ticksSinceHasPowerChange > 30 ) + this.publicPowerState( true, this.myGrid ); + else if ( !this.hasPower ) + this.publicPowerState( false, this.myGrid ); - availableTicksSinceUpdate++; + this.availableTicksSinceUpdate++; } private void publicPowerState(boolean newState, IGrid grid) { - if ( publicHasPower == newState ) + if ( this.publicHasPower == newState ) return; - publicHasPower = newState; - ((Grid) myGrid).setImportantFlag( 0, publicHasPower ); + this.publicHasPower = newState; + ((Grid) this.myGrid).setImportantFlag( 0, this.publicHasPower ); grid.postEvent( new MENetworkPowerStatusChange() ); } @@ -449,25 +449,25 @@ public class EnergyGridCache implements IEnergyGrid */ public void refreshPower() { - availableTicksSinceUpdate = 0; - globalAvailablePower = 0; - for (IAEPowerStorage p : providers) - globalAvailablePower += p.getAECurrentPower(); + this.availableTicksSinceUpdate = 0; + this.globalAvailablePower = 0; + for (IAEPowerStorage p : this.providers) + this.globalAvailablePower += p.getAECurrentPower(); } @Override public double getStoredPower() { - if ( availableTicksSinceUpdate > 90 ) - refreshPower(); + if ( this.availableTicksSinceUpdate > 90 ) + this.refreshPower(); - return Math.max( 0.0, globalAvailablePower ); + return Math.max( 0.0, this.globalAvailablePower ); } @Override public double getMaxStoredPower() { - return globalMaxPower; + return this.globalMaxPower; } @Override @@ -476,15 +476,15 @@ public class EnergyGridCache implements IEnergyGrid if ( !seen.add( this ) ) return 0; - double extractedPower = extra; + double extractedPower = this.extra; if ( mode == Actionable.SIMULATE ) { - extractedPower += simulateExtract( extractedPower, amt ); + extractedPower += this.simulateExtract( extractedPower, amt ); if ( extractedPower < amt ) { - Iterator i = energyGridProviders.iterator(); + Iterator i = this.energyGridProviders.iterator(); while (extractedPower < amt && i.hasNext()) extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); } @@ -493,38 +493,38 @@ public class EnergyGridCache implements IEnergyGrid } else { - extra = 0; - extractedPower = doExtract( extractedPower, amt ); + this.extra = 0; + extractedPower = this.doExtract( extractedPower, amt ); } // got more then we wanted? if ( extractedPower > amt ) { - extra = extractedPower - amt; - globalAvailablePower -= amt; + this.extra = extractedPower - amt; + this.globalAvailablePower -= amt; - tickDrainPerTick += amt; + this.tickDrainPerTick += amt; return amt; } if ( extractedPower < amt ) { - Iterator i = energyGridProviders.iterator(); + Iterator i = this.energyGridProviders.iterator(); while (extractedPower < amt && i.hasNext()) extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); } // go less or the correct amount? - globalAvailablePower -= extractedPower; - tickDrainPerTick += extractedPower; + this.globalAvailablePower -= extractedPower; + this.tickDrainPerTick += extractedPower; return extractedPower; } private double doExtract(double extractedPower, double amt) { - while (extractedPower < amt && !providers.isEmpty()) + while (extractedPower < amt && !this.providers.isEmpty()) { - IAEPowerStorage node = getFirstProvider(); + IAEPowerStorage node = this.getFirstProvider(); double req = amt - extractedPower; double newPower = node.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.ONE ); @@ -532,8 +532,8 @@ public class EnergyGridCache implements IEnergyGrid if ( newPower < req ) { - providers.remove( node ); - lastProvider = null; + this.providers.remove( node ); + this.lastProvider = null; } } @@ -543,7 +543,7 @@ public class EnergyGridCache implements IEnergyGrid private double simulateExtract(double extractedPower, double amt) { - Iterator it = providers.iterator(); + Iterator it = this.providers.iterator(); while (extractedPower < amt && it.hasNext()) { @@ -560,38 +560,38 @@ public class EnergyGridCache implements IEnergyGrid @Override public boolean isNetworkPowered() { - return publicHasPower; + return this.publicHasPower; } @Override public double getIdlePowerUsage() { - return drainPerTick + pgc.channelPowerUsage; + return this.drainPerTick + this.pgc.channelPowerUsage; } @Override public double getAvgPowerUsage() { - return avgDrainPerTick; + return this.avgDrainPerTick; } @Override public double getAvgPowerInjection() { - return avgInjectionPerTick; + return this.avgInjectionPerTick; } @Override public void onSplit(IGridStorage storageB) { - extra /= 2; - storageB.dataObject().setDouble( "extraEnergy", extra ); + this.extra /= 2; + storageB.dataObject().setDouble( "extraEnergy", this.extra ); } @Override public void onJoin(IGridStorage storageB) { - extra += storageB.dataObject().getDouble( "extraEnergy" ); + this.extra += storageB.dataObject().getDouble( "extraEnergy" ); } @Override diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 49358fb9f..f32b6c30f 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -57,7 +57,7 @@ public class GridStorageCache implements IStorageGrid { final private SetMultimap interests = HashMultimap.create(); - final public GenericInterestManager interestManager = new GenericInterestManager( interests ); + final public GenericInterestManager interestManager = new GenericInterestManager( this.interests ); final HashSet activeCellProviders = new HashSet(); final HashSet inactiveCellProviders = new HashSet(); @@ -72,14 +72,14 @@ public class GridStorageCache implements IStorageGrid private final HashMap watchers = new HashMap(); public GridStorageCache(IGrid g) { - myGrid = g; + this.myGrid = g; } @Override public void onUpdateTick() { - itemMonitor.onTick(); - fluidMonitor.onTick(); + this.itemMonitor.onTick(); + this.fluidMonitor.onTick(); } private class CellChangeTrackerRecord @@ -105,7 +105,7 @@ public class GridStorageCache implements IStorageGrid public void applyChanges() { - postChangesToNetwork( channel, up_or_down, list, src ); + GridStorageCache.this.postChangesToNetwork( this.channel, this.up_or_down, this.list, this.src ); } } @@ -117,12 +117,12 @@ public class GridStorageCache implements IStorageGrid public void postChanges(StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc) { - data.add( new CellChangeTrackerRecord( channel, i, h, actionSrc ) ); + this.data.add( new CellChangeTrackerRecord( channel, i, h, actionSrc ) ); } public void applyChanges() { - for (CellChangeTrackerRecord rec : data) + for (CellChangeTrackerRecord rec : this.data) rec.applyChanges(); } } @@ -130,23 +130,23 @@ public class GridStorageCache implements IStorageGrid @Override public void registerCellProvider(ICellProvider provider) { - inactiveCellProviders.add( provider ); - addCellProvider( provider, new CellChangeTracker() ).applyChanges(); + this.inactiveCellProviders.add( provider ); + this.addCellProvider( provider, new CellChangeTracker() ).applyChanges(); } @Override public void unregisterCellProvider(ICellProvider provider) { - removeCellProvider( provider, new CellChangeTracker() ).applyChanges(); - inactiveCellProviders.remove( provider ); + this.removeCellProvider( provider, new CellChangeTracker() ).applyChanges(); + this.inactiveCellProviders.remove( provider ); } public CellChangeTracker addCellProvider(ICellProvider cc, CellChangeTracker tracker) { - if ( inactiveCellProviders.contains( cc ) ) + if ( this.inactiveCellProviders.contains( cc ) ) { - inactiveCellProviders.remove( cc ); - activeCellProviders.add( cc ); + this.inactiveCellProviders.remove( cc ); + this.activeCellProviders.add( cc ); BaseActionSource actionSrc = new BaseActionSource(); if ( cc instanceof IActionHost ) @@ -168,10 +168,10 @@ public class GridStorageCache implements IStorageGrid public CellChangeTracker removeCellProvider(ICellProvider cc, CellChangeTracker tracker) { - if ( activeCellProviders.contains( cc ) ) + if ( this.activeCellProviders.contains( cc ) ) { - inactiveCellProviders.add( cc ); - activeCellProviders.remove( cc ); + this.inactiveCellProviders.add( cc ); + this.activeCellProviders.remove( cc ); BaseActionSource actionSrc = new BaseActionSource(); if ( cc instanceof IActionHost ) @@ -194,12 +194,12 @@ public class GridStorageCache implements IStorageGrid @MENetworkEventSubscribe public void cellUpdate(MENetworkCellArrayUpdate ev) { - myItemNetwork = null; - myFluidNetwork = null; + this.myItemNetwork = null; + this.myFluidNetwork = null; LinkedList ll = new LinkedList(); - ll.addAll( inactiveCellProviders ); - ll.addAll( activeCellProviders ); + ll.addAll( this.inactiveCellProviders ); + ll.addAll( this.activeCellProviders ); CellChangeTracker tracker = new CellChangeTracker(); @@ -217,13 +217,13 @@ public class GridStorageCache implements IStorageGrid } if ( Active ) - addCellProvider( cc, tracker ); + this.addCellProvider( cc, tracker ); else - removeCellProvider( cc, tracker ); + this.removeCellProvider( cc, tracker ); } - itemMonitor.forceUpdate(); - fluidMonitor.forceUpdate(); + this.itemMonitor.forceUpdate(); + this.fluidMonitor.forceUpdate(); tracker.applyChanges(); } @@ -235,18 +235,18 @@ public class GridStorageCache implements IStorageGrid { ICellContainer cc = (ICellContainer) machine; - myGrid.postEvent( new MENetworkCellArrayUpdate() ); - removeCellProvider( cc, new CellChangeTracker() ).applyChanges(); - inactiveCellProviders.remove( cc ); + this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); + this.removeCellProvider( cc, new CellChangeTracker() ).applyChanges(); + this.inactiveCellProviders.remove( cc ); } if ( machine instanceof IStackWatcherHost ) { - IStackWatcher myWatcher = watchers.get( machine ); + IStackWatcher myWatcher = this.watchers.get( machine ); if ( myWatcher != null ) { myWatcher.clear(); - watchers.remove( machine ); + this.watchers.remove( machine ); } } } @@ -257,42 +257,42 @@ public class GridStorageCache implements IStorageGrid if ( machine instanceof ICellContainer ) { ICellContainer cc = (ICellContainer) machine; - inactiveCellProviders.add( cc ); + this.inactiveCellProviders.add( cc ); - myGrid.postEvent( new MENetworkCellArrayUpdate() ); + this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); if ( node.isActive() ) - addCellProvider( cc, new CellChangeTracker() ).applyChanges(); + this.addCellProvider( cc, new CellChangeTracker() ).applyChanges(); } if ( machine instanceof IStackWatcherHost ) { IStackWatcherHost swh = (IStackWatcherHost) machine; ItemWatcher iw = new ItemWatcher( this, swh ); - watchers.put( node, iw ); + this.watchers.put( node, iw ); swh.updateWatcher( iw ); } } private void buildNetworkStorage(StorageChannel chan) { - SecurityCache security = myGrid.getCache( ISecurityGrid.class ); + SecurityCache security = this.myGrid.getCache( ISecurityGrid.class ); switch (chan) { case FLUIDS: - myFluidNetwork = new NetworkInventoryHandler( StorageChannel.FLUIDS, security ); - for (ICellProvider cc : activeCellProviders) + this.myFluidNetwork = new NetworkInventoryHandler( StorageChannel.FLUIDS, security ); + for (ICellProvider cc : this.activeCellProviders) { for (IMEInventoryHandler h : cc.getCellArray( chan )) - myFluidNetwork.addNewStorage( h ); + this.myFluidNetwork.addNewStorage( h ); } break; case ITEMS: - myItemNetwork = new NetworkInventoryHandler( StorageChannel.ITEMS, security ); - for (ICellProvider cc : activeCellProviders) + this.myItemNetwork = new NetworkInventoryHandler( StorageChannel.ITEMS, security ); + for (ICellProvider cc : this.activeCellProviders) { for (IMEInventoryHandler h : cc.getCellArray( chan )) - myItemNetwork.addNewStorage( h ); + this.myItemNetwork.addNewStorage( h ); } break; default: @@ -304,10 +304,10 @@ public class GridStorageCache implements IStorageGrid switch (chan) { case FLUIDS: - fluidMonitor.postChange( up_or_down > 0, availableItems, src ); + this.fluidMonitor.postChange( up_or_down > 0, availableItems, src ); break; case ITEMS: - itemMonitor.postChange( up_or_down > 0, availableItems, src ); + this.itemMonitor.postChange( up_or_down > 0, availableItems, src ); break; default: } @@ -315,37 +315,37 @@ public class GridStorageCache implements IStorageGrid public IMEInventoryHandler getItemInventoryHandler() { - if ( myItemNetwork == null ) - buildNetworkStorage( StorageChannel.ITEMS ); - return myItemNetwork; + if ( this.myItemNetwork == null ) + this.buildNetworkStorage( StorageChannel.ITEMS ); + return this.myItemNetwork; } public IMEInventoryHandler getFluidInventoryHandler() { - if ( myFluidNetwork == null ) - buildNetworkStorage( StorageChannel.FLUIDS ); - return myFluidNetwork; + if ( this.myFluidNetwork == null ) + this.buildNetworkStorage( StorageChannel.FLUIDS ); + return this.myFluidNetwork; } @Override public void postAlterationOfStoredItems(StorageChannel chan, Iterable input, BaseActionSource src) { if ( chan == StorageChannel.ITEMS ) - itemMonitor.postChange( true, (Iterable) input, src ); + this.itemMonitor.postChange( true, (Iterable) input, src ); else if ( chan == StorageChannel.FLUIDS ) - fluidMonitor.postChange( true, (Iterable) input, src ); + this.fluidMonitor.postChange( true, (Iterable) input, src ); } @Override public IMEMonitor getFluidInventory() { - return fluidMonitor; + return this.fluidMonitor; } @Override public IMEMonitor getItemInventory() { - return itemMonitor; + return this.itemMonitor; } @Override diff --git a/src/main/java/appeng/me/cache/NetworkMonitor.java b/src/main/java/appeng/me/cache/NetworkMonitor.java index 9b86c4e78..5db26f345 100644 --- a/src/main/java/appeng/me/cache/NetworkMonitor.java +++ b/src/main/java/appeng/me/cache/NetworkMonitor.java @@ -43,9 +43,9 @@ public class NetworkMonitor> extends MEMonitorHandler public void forceUpdate() { - hasChanged = true; + this.hasChanged = true; - Iterator, Object>> i = getListeners(); + Iterator, Object>> i = this.getListeners(); while (i.hasNext()) { Entry, Object> o = i.next(); @@ -60,8 +60,8 @@ public class NetworkMonitor> extends MEMonitorHandler public NetworkMonitor(GridStorageCache cache, StorageChannel chan) { super( null, chan ); - myGridCache = cache; - myChannel = chan; + this.myGridCache = cache; + this.myChannel = chan; } final static public LinkedList depth = new LinkedList(); @@ -69,7 +69,7 @@ public class NetworkMonitor> extends MEMonitorHandler @Override protected void postChangesToListeners(Iterable changes, BaseActionSource src) { - postChange( true, changes, src ); + this.postChange( true, changes, src ); } protected void postChange(boolean Add, Iterable changes, BaseActionSource src) @@ -79,10 +79,10 @@ public class NetworkMonitor> extends MEMonitorHandler depth.push( this ); - sendEvent = true; - notifyListenersOfChange( changes, src ); + this.sendEvent = true; + this.notifyListenersOfChange( changes, src ); - IItemList myStorageList = getStorageList(); + IItemList myStorageList = this.getStorageList(); for (T changedItem : changes) { @@ -91,9 +91,9 @@ public class NetworkMonitor> extends MEMonitorHandler if ( !Add && changedItem != null ) (difference = changedItem.copy()).setStackSize( -changedItem.getStackSize() ); - if ( myGridCache.interestManager.containsKey( changedItem ) ) + if ( this.myGridCache.interestManager.containsKey( changedItem ) ) { - Collection list = myGridCache.interestManager.get( changedItem ); + Collection list = this.myGridCache.interestManager.get( changedItem ); if ( !list.isEmpty() ) { IAEStack fullStack = myStorageList.findPrecise( changedItem ); @@ -103,12 +103,12 @@ public class NetworkMonitor> extends MEMonitorHandler fullStack.setStackSize( 0 ); } - myGridCache.interestManager.enableTransactions(); + this.myGridCache.interestManager.enableTransactions(); for (ItemWatcher iw : list) - iw.getHost().onStackChange( myStorageList, fullStack, difference, src, getChannel() ); + iw.getHost().onStackChange( myStorageList, fullStack, difference, src, this.getChannel() ); - myGridCache.interestManager.disableTransactions(); + this.myGridCache.interestManager.disableTransactions(); } } } @@ -120,22 +120,22 @@ public class NetworkMonitor> extends MEMonitorHandler public void onTick() { - if ( sendEvent ) + if ( this.sendEvent ) { - sendEvent = false; - myGridCache.myGrid.postEvent( new MENetworkStorageEvent( this, myChannel ) ); + this.sendEvent = false; + this.myGridCache.myGrid.postEvent( new MENetworkStorageEvent( this, this.myChannel ) ); } } @Override protected IMEInventoryHandler getHandler() { - switch (myChannel) + switch (this.myChannel) { case ITEMS: - return myGridCache.getItemInventoryHandler(); + return this.myGridCache.getItemInventoryHandler(); case FLUIDS: - return myGridCache.getFluidInventoryHandler(); + return this.myGridCache.getFluidInventoryHandler(); default: } return null; diff --git a/src/main/java/appeng/me/cache/P2PCache.java b/src/main/java/appeng/me/cache/P2PCache.java index 7d6c8b6f6..da0583d8b 100644 --- a/src/main/java/appeng/me/cache/P2PCache.java +++ b/src/main/java/appeng/me/cache/P2PCache.java @@ -47,14 +47,14 @@ public class P2PCache implements IGridCache final IGrid myGrid; public P2PCache(IGrid g) { - myGrid = g; + this.myGrid = g; } @MENetworkEventSubscribe public void bootComplete(MENetworkBootingStatusChange bootStatus) { - ITickManager tm = myGrid.getCache( ITickManager.class ); - for (PartP2PTunnel me : inputs.values()) + ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for (PartP2PTunnel me : this.inputs.values()) { if ( me instanceof PartP2PTunnelME ) tm.wakeDevice( me.getGridNode() ); @@ -64,8 +64,8 @@ public class P2PCache implements IGridCache @MENetworkEventSubscribe public void bootComplete(MENetworkPowerStatusChange power) { - ITickManager tm = myGrid.getCache( ITickManager.class ); - for (PartP2PTunnel me : inputs.values()) + ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for (PartP2PTunnel me : this.inputs.values()) { if ( me instanceof PartP2PTunnelME ) tm.wakeDevice( me.getGridNode() ); @@ -80,23 +80,23 @@ public class P2PCache implements IGridCache public void updateFreq(PartP2PTunnel t, long NewFreq) { - if ( outputs.containsValue( t ) ) - outputs.remove( t.freq, t ); + if ( this.outputs.containsValue( t ) ) + this.outputs.remove( t.freq, t ); - if ( inputs.containsValue( t ) ) - inputs.remove( t.freq ); + if ( this.inputs.containsValue( t ) ) + this.inputs.remove( t.freq ); t.freq = NewFreq; if ( t.output ) - outputs.put( t.freq, t ); + this.outputs.put( t.freq, t ); else - inputs.put( t.freq, t ); + this.inputs.put( t.freq, t ); // AELog.info( "update-" + (t.output ? "output: " : "input: ") + t.freq // ); - updateTunnel( t.freq, t.output, true ); - updateTunnel( t.freq, !t.output, true ); + this.updateTunnel( t.freq, t.output, true ); + this.updateTunnel( t.freq, !t.output, true ); } @Override @@ -115,11 +115,11 @@ public class P2PCache implements IGridCache // ); if ( t.output ) - outputs.put( t.freq, t ); + this.outputs.put( t.freq, t ); else - inputs.put( t.freq, t ); + this.inputs.put( t.freq, t ); - updateTunnel( t.freq, !t.output, false ); + this.updateTunnel( t.freq, !t.output, false ); } } @@ -139,24 +139,24 @@ public class P2PCache implements IGridCache // ); if ( t.output ) - outputs.remove( t.freq, t ); + this.outputs.remove( t.freq, t ); else - inputs.remove( t.freq ); + this.inputs.remove( t.freq ); - updateTunnel( t.freq, !t.output, false ); + this.updateTunnel( t.freq, !t.output, false ); } } private void updateTunnel(long freq, boolean updateOutputs, boolean configChange) { - for (PartP2PTunnel p : outputs.get( freq )) + for (PartP2PTunnel p : this.outputs.get( freq )) { if ( configChange ) p.onTunnelConfigChange(); p.onTunnelNetworkChange(); } - PartP2PTunnel in = inputs.get( freq ); + PartP2PTunnel in = this.inputs.get( freq ); if ( in != null ) { if ( configChange ) @@ -167,20 +167,20 @@ public class P2PCache implements IGridCache public TunnelCollection getOutputs(long freq, Class c) { - PartP2PTunnel in = inputs.get( freq ); + PartP2PTunnel in = this.inputs.get( freq ); if ( in == null ) - return NullColl; + return this.NullColl; - TunnelCollection out = inputs.get( freq ).getCollection( outputs.get( freq ), c ); + TunnelCollection out = this.inputs.get( freq ).getCollection( this.outputs.get( freq ), c ); if ( out == null ) - return NullColl; + return this.NullColl; return out; } public PartP2PTunnel getInput(long freq) { - return inputs.get( freq ); + return this.inputs.get( freq ); } @Override diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index 1f6a487a7..fb024de92 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -83,69 +83,69 @@ public class PathGridCache implements IPathingGrid public PathGridCache(IGrid g) { - myGrid = g; + this.myGrid = g; } @Override public void onUpdateTick() { - if ( recalculateControllerNextTick ) + if ( this.recalculateControllerNextTick ) { - recalcController(); + this.recalcController(); } - if ( updateNetwork ) + if ( this.updateNetwork ) { - if ( !booting ) - myGrid.postEvent( new MENetworkBootingStatusChange() ); + if ( !this.booting ) + this.myGrid.postEvent( new MENetworkBootingStatusChange() ); - booting = true; - updateNetwork = false; - instance++; - channelsInUse = 0; + this.booting = true; + this.updateNetwork = false; + this.instance++; + this.channelsInUse = 0; if ( !AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - int used = calculateRequiredChannels(); + int used = this.calculateRequiredChannels(); - int nodes = myGrid.getNodes().size(); - ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); - channelsByBlocks = nodes * used; - channelPowerUsage = channelsByBlocks / 128.0; + int nodes = this.myGrid.getNodes().size(); + this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); + this.channelsByBlocks = nodes * used; + this.channelPowerUsage = this.channelsByBlocks / 128.0; - myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); + this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); } - else if ( controllerState == ControllerState.NO_CONTROLLER ) + else if ( this.controllerState == ControllerState.NO_CONTROLLER ) { - int requiredChannels = calculateRequiredChannels(); + int requiredChannels = this.calculateRequiredChannels(); int used = requiredChannels; if ( requiredChannels > 8 ) used = 0; - int nodes = myGrid.getNodes().size(); - channelsInUse = used; + int nodes = this.myGrid.getNodes().size(); + this.channelsInUse = used; - ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); - channelsByBlocks = nodes * used; - channelPowerUsage = channelsByBlocks / 128.0; + this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); + this.channelsByBlocks = nodes * used; + this.channelPowerUsage = this.channelsByBlocks / 128.0; - myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); + this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); } - else if ( controllerState == ControllerState.CONTROLLER_CONFLICT ) + else if ( this.controllerState == ControllerState.CONTROLLER_CONFLICT ) { - ticksUntilReady = 20; - myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) ); + this.ticksUntilReady = 20; + this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) ); } else { - int nodes = myGrid.getNodes().size(); - ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); + int nodes = this.myGrid.getNodes().size(); + this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); HashSet closedList = new HashSet(); - semiOpen = new HashSet(); + this.semiOpen = new HashSet(); // myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) // ); - for (IGridNode node : myGrid.getMachines( TileController.class )) + for (IGridNode node : this.myGrid.getMachines( TileController.class )) { closedList.add( (IPathItem) node ); for (IGridConnection gcc : node.getConnections()) @@ -157,16 +157,16 @@ public class PathGridCache implements IPathingGrid closedList.add( gc ); open.add( gc ); gc.setControllerRoute( (GridNode) node, true ); - active.add( new PathSegment( this, open, semiOpen, closedList ) ); + this.active.add( new PathSegment( this, open, this.semiOpen, closedList ) ); } } } } } - if ( !active.isEmpty() || ticksUntilReady > 0 ) + if ( !this.active.isEmpty() || this.ticksUntilReady > 0 ) { - Iterator i = active.iterator(); + Iterator i = this.active.iterator(); while (i.hasNext()) { PathSegment pat = i.next(); @@ -177,11 +177,11 @@ public class PathGridCache implements IPathingGrid } } - ticksUntilReady--; + this.ticksUntilReady--; - if ( active.isEmpty() && ticksUntilReady <= 0 ) + if ( this.active.isEmpty() && this.ticksUntilReady <= 0 ) { - if ( controllerState == ControllerState.CONTROLLER_ONLINE ) + if ( this.controllerState == ControllerState.CONTROLLER_ONLINE ) { final Iterator controllerIterator = this.controllers.iterator(); if (controllerIterator.hasNext()) @@ -192,25 +192,25 @@ public class PathGridCache implements IPathingGrid } // check for achievements - achievementPost(); + this.achievementPost(); - booting = false; - channelPowerUsage = channelsByBlocks / 128.0; - myGrid.postEvent( new MENetworkBootingStatusChange() ); + this.booting = false; + this.channelPowerUsage = this.channelsByBlocks / 128.0; + this.myGrid.postEvent( new MENetworkBootingStatusChange() ); } } } private void achievementPost() { - if ( lastChannels != channelsInUse && AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) + if ( this.lastChannels != this.channelsInUse && AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - Achievements currentBracket = getAchievementBracket( channelsInUse ); - Achievements lastBracket = getAchievementBracket( lastChannels ); + Achievements currentBracket = this.getAchievementBracket( this.channelsInUse ); + Achievements lastBracket = this.getAchievementBracket( this.lastChannels ); if ( currentBracket != lastBracket && currentBracket != null ) { Set players = new HashSet(); - for (IGridNode n : requireChannels) + for (IGridNode n : this.requireChannels) players.add( n.getPlayerID() ); for (int id : players) @@ -219,7 +219,7 @@ public class PathGridCache implements IPathingGrid } } } - lastChannels = channelsInUse; + this.lastChannels = this.channelsInUse; } private Achievements getAchievementBracket(int ch) @@ -239,16 +239,16 @@ public class PathGridCache implements IPathingGrid private int calculateRequiredChannels() { int depth = 0; - semiOpen.clear(); + this.semiOpen.clear(); - for (IGridNode nodes : requireChannels) + for (IGridNode nodes : this.requireChannels) { - if ( !semiOpen.contains( nodes ) ) + if ( !this.semiOpen.contains( nodes ) ) { IGridBlock gb = nodes.getGridBlock(); EnumSet flags = gb.getFlags(); - if ( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !blockDense.isEmpty() ) + if ( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !this.blockDense.isEmpty() ) return 9; depth++; @@ -258,7 +258,7 @@ public class PathGridCache implements IPathingGrid IGridMultiblock gmb = (IGridMultiblock) gb; Iterator i = gmb.getMultiblockNodes(); while (i.hasNext()) - semiOpen.add( (IPathItem) i.next() ); + this.semiOpen.add( (IPathItem) i.next() ); } } } @@ -270,10 +270,10 @@ public class PathGridCache implements IPathingGrid public void repath() { // clean up... - active.clear(); + this.active.clear(); - channelsByBlocks = 0; - updateNetwork = true; + this.channelsByBlocks = 0; + this.updateNetwork = true; } @Override @@ -281,19 +281,19 @@ public class PathGridCache implements IPathingGrid { if ( machine instanceof TileController ) { - controllers.remove( machine ); - recalculateControllerNextTick = true; + this.controllers.remove( machine ); + this.recalculateControllerNextTick = true; } EnumSet flags = gridNode.getGridBlock().getFlags(); if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) - requireChannels.remove( gridNode ); + this.requireChannels.remove( gridNode ); if ( flags.contains( GridFlags.CANNOT_CARRY_COMPRESSED ) ) - blockDense.remove( gridNode ); + this.blockDense.remove( gridNode ); - repath(); + this.repath(); } @Override @@ -301,19 +301,19 @@ public class PathGridCache implements IPathingGrid { if ( machine instanceof TileController ) { - controllers.add( (TileController) machine ); - recalculateControllerNextTick = true; + this.controllers.add( (TileController) machine ); + this.recalculateControllerNextTick = true; } EnumSet flags = gridNode.getGridBlock().getFlags(); if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) - requireChannels.add( gridNode ); + this.requireChannels.add( gridNode ); if ( flags.contains( GridFlags.CANNOT_CARRY_COMPRESSED ) ) - blockDense.add( gridNode ); + this.blockDense.add( gridNode ); - repath(); + this.repath(); } @MENetworkEventSubscribe @@ -322,28 +322,28 @@ public class PathGridCache implements IPathingGrid IGridNode gridNode = ev.node; if ( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) ) - requireChannels.add( gridNode ); + this.requireChannels.add( gridNode ); else - requireChannels.remove( gridNode ); + this.requireChannels.remove( gridNode ); - repath(); + this.repath(); } private void recalcController() { - recalculateControllerNextTick = false; - ControllerState old = controllerState; + this.recalculateControllerNextTick = false; + ControllerState old = this.controllerState; - if ( controllers.isEmpty() ) + if ( this.controllers.isEmpty() ) { - controllerState = ControllerState.NO_CONTROLLER; + this.controllerState = ControllerState.NO_CONTROLLER; } else { - IGridNode startingNode = controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN ); + IGridNode startingNode = this.controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN ); if ( startingNode == null ) { - controllerState = ControllerState.CONTROLLER_CONFLICT; + this.controllerState = ControllerState.CONTROLLER_CONFLICT; return; } @@ -352,15 +352,15 @@ public class PathGridCache implements IPathingGrid startingNode.beginVisit( cv ); - if ( cv.isValid && cv.found == controllers.size() ) - controllerState = ControllerState.CONTROLLER_ONLINE; + if ( cv.isValid && cv.found == this.controllers.size() ) + this.controllerState = ControllerState.CONTROLLER_ONLINE; else - controllerState = ControllerState.CONTROLLER_CONFLICT; + this.controllerState = ControllerState.CONTROLLER_CONFLICT; } - if ( old != controllerState ) + if ( old != this.controllerState ) { - myGrid.postEvent( new MENetworkControllerChange() ); + this.myGrid.postEvent( new MENetworkControllerChange() ); } } diff --git a/src/main/java/appeng/me/cache/SecurityCache.java b/src/main/java/appeng/me/cache/SecurityCache.java index 71084b258..4970eceec 100644 --- a/src/main/java/appeng/me/cache/SecurityCache.java +++ b/src/main/java/appeng/me/cache/SecurityCache.java @@ -43,7 +43,7 @@ public class SecurityCache implements ISecurityGrid final private HashMap> playerPerms = new HashMap>(); public SecurityCache(IGrid g) { - myGrid = g; + this.myGrid = g; } private long securityKey = -1; @@ -52,43 +52,43 @@ public class SecurityCache implements ISecurityGrid @MENetworkEventSubscribe public void updatePermissions(MENetworkSecurityChange ev) { - playerPerms.clear(); - if ( securityProvider.isEmpty() ) + this.playerPerms.clear(); + if ( this.securityProvider.isEmpty() ) return; - securityProvider.get( 0 ).readPermissions( playerPerms ); + this.securityProvider.get( 0 ).readPermissions( this.playerPerms ); } public long getSecurityKey() { - return securityKey; + return this.securityKey; } @Override public boolean isAvailable() { - return securityProvider.size() == 1 && securityProvider.get( 0 ).isSecurityEnabled(); + return this.securityProvider.size() == 1 && this.securityProvider.get( 0 ).isSecurityEnabled(); } @Override public boolean hasPermission(EntityPlayer player, SecurityPermissions perm) { - return hasPermission( player == null ? -1 : WorldSettings.getInstance().getPlayerID( player.getGameProfile() ), perm ); + return this.hasPermission( player == null ? -1 : WorldSettings.getInstance().getPlayerID( player.getGameProfile() ), perm ); } @Override public boolean hasPermission(int playerID, SecurityPermissions perm) { - if ( isAvailable() ) + if ( this.isAvailable() ) { - EnumSet perms = playerPerms.get( playerID ); + EnumSet perms = this.playerPerms.get( playerID ); if ( perms == null ) { if ( playerID == -1 ) // no default? return false; else - return hasPermission( -1, perm ); + return this.hasPermission( -1, perm ); } return perms.contains( perm ); @@ -98,18 +98,18 @@ public class SecurityCache implements ISecurityGrid private void updateSecurityKey() { - long lastCode = securityKey; + long lastCode = this.securityKey; - if ( securityProvider.size() == 1 ) - securityKey = securityProvider.get( 0 ).getSecurityKey(); + if ( this.securityProvider.size() == 1 ) + this.securityKey = this.securityProvider.get( 0 ).getSecurityKey(); else - securityKey = -1; + this.securityKey = -1; - if ( lastCode != securityKey ) + if ( lastCode != this.securityKey ) { - myGrid.postEvent( new MENetworkSecurityChange() ); - for (IGridNode n : myGrid.getNodes()) - ((GridNode) n).lastSecurityKey = securityKey; + this.myGrid.postEvent( new MENetworkSecurityChange() ); + for (IGridNode n : this.myGrid.getNodes()) + ((GridNode) n).lastSecurityKey = this.securityKey; } } @@ -118,8 +118,8 @@ public class SecurityCache implements ISecurityGrid { if ( machine instanceof ISecurityProvider ) { - securityProvider.remove( machine ); - updateSecurityKey(); + this.securityProvider.remove( machine ); + this.updateSecurityKey(); } } @@ -128,11 +128,11 @@ public class SecurityCache implements ISecurityGrid { if ( machine instanceof ISecurityProvider ) { - securityProvider.add( (ISecurityProvider) machine ); - updateSecurityKey(); + this.securityProvider.add( (ISecurityProvider) machine ); + this.updateSecurityKey(); } else - ((GridNode) gridNode).lastSecurityKey = securityKey; + ((GridNode) gridNode).lastSecurityKey = this.securityKey; } @Override @@ -162,8 +162,8 @@ public class SecurityCache implements ISecurityGrid @Override public int getOwner() { - if ( isAvailable() ) - return securityProvider.get( 0 ).getOwner(); + if ( this.isAvailable() ) + return this.securityProvider.get( 0 ).getOwner(); return -1; } diff --git a/src/main/java/appeng/me/cache/SpatialPylonCache.java b/src/main/java/appeng/me/cache/SpatialPylonCache.java index 488381d15..2a1ae5fd0 100644 --- a/src/main/java/appeng/me/cache/SpatialPylonCache.java +++ b/src/main/java/appeng/me/cache/SpatialPylonCache.java @@ -54,37 +54,37 @@ public class SpatialPylonCache implements ISpatialCache final IGrid myGrid; public SpatialPylonCache(IGrid g) { - myGrid = g; + this.myGrid = g; } @Override public long requiredPower() { - return powerRequired; + return this.powerRequired; } @Override public boolean hasRegion() { - return captureMin != null; + return this.captureMin != null; } @Override public boolean isValidRegion() { - return hasRegion() && isValid; + return this.hasRegion() && this.isValid; } @Override public DimensionalCoord getMin() { - return captureMin; + return this.captureMin; } @Override public DimensionalCoord getMax() { - return captureMax; + return this.captureMax; } public void reset(IGrid grid) @@ -97,12 +97,12 @@ public class SpatialPylonCache implements ISpatialCache double minPower = 0; double maxPower = 0; - clusters = new HashMap(); - ioPorts = new LinkedList(); + this.clusters = new HashMap(); + this.ioPorts = new LinkedList(); for (IGridNode gm : grid.getMachines( TileSpatialIOPort.class )) { - ioPorts.add( (TileSpatialIOPort) gm.getMachine() ); + this.ioPorts.add( (TileSpatialIOPort) gm.getMachine() ); } IReadOnlyCollection set = grid.getMachines( TileSpatialPylon.class ); @@ -112,89 +112,89 @@ public class SpatialPylonCache implements ISpatialCache { SpatialPylonCluster c = ((TileSpatialPylon) gm.getMachine()).getCluster(); if ( c != null ) - clusters.put( c, c ); + this.clusters.put( c, c ); } } - captureMax = null; - captureMin = null; - isValid = true; + this.captureMax = null; + this.captureMin = null; + this.isValid = true; int pylonBlocks = 0; - for (SpatialPylonCluster cl : clusters.values()) + for (SpatialPylonCluster cl : this.clusters.values()) { - if ( captureMax == null ) - captureMax = cl.max.copy(); - if ( captureMin == null ) - captureMin = cl.min.copy(); + if ( this.captureMax == null ) + this.captureMax = cl.max.copy(); + if ( this.captureMin == null ) + this.captureMin = cl.min.copy(); pylonBlocks += cl.tileCount(); - captureMin.x = Math.min( captureMin.x, cl.min.x ); - captureMin.y = Math.min( captureMin.y, cl.min.y ); - captureMin.z = Math.min( captureMin.z, cl.min.z ); + this.captureMin.x = Math.min( this.captureMin.x, cl.min.x ); + this.captureMin.y = Math.min( this.captureMin.y, cl.min.y ); + this.captureMin.z = Math.min( this.captureMin.z, cl.min.z ); - captureMax.x = Math.max( captureMax.x, cl.max.x ); - captureMax.y = Math.max( captureMax.y, cl.max.y ); - captureMax.z = Math.max( captureMax.z, cl.max.z ); + this.captureMax.x = Math.max( this.captureMax.x, cl.max.x ); + this.captureMax.y = Math.max( this.captureMax.y, cl.max.y ); + this.captureMax.z = Math.max( this.captureMax.z, cl.max.z ); } - if ( hasRegion() ) + if ( this.hasRegion() ) { - isValid = captureMax.x - captureMin.x > 1 && captureMax.y - captureMin.y > 1 && captureMax.z - captureMin.z > 1; + this.isValid = this.captureMax.x - this.captureMin.x > 1 && this.captureMax.y - this.captureMin.y > 1 && this.captureMax.z - this.captureMin.z > 1; - for (SpatialPylonCluster cl : clusters.values()) + for (SpatialPylonCluster cl : this.clusters.values()) { switch (cl.currentAxis) { case X: - isValid = isValid && ((captureMax.y == cl.min.y || captureMin.y == cl.max.y) || (captureMax.z == cl.min.z || captureMin.z == cl.max.z)) - && ((captureMax.y == cl.max.y || captureMin.y == cl.min.y) || (captureMax.z == cl.max.z || captureMin.z == cl.min.z)); + this.isValid = this.isValid && ((this.captureMax.y == cl.min.y || this.captureMin.y == cl.max.y) || (this.captureMax.z == cl.min.z || this.captureMin.z == cl.max.z)) + && ((this.captureMax.y == cl.max.y || this.captureMin.y == cl.min.y) || (this.captureMax.z == cl.max.z || this.captureMin.z == cl.min.z)); break; case Y: - isValid = isValid && ((captureMax.x == cl.min.x || captureMin.x == cl.max.x) || (captureMax.z == cl.min.z || captureMin.z == cl.max.z)) - && ((captureMax.x == cl.max.x || captureMin.x == cl.min.x) || (captureMax.z == cl.max.z || captureMin.z == cl.min.z)); + this.isValid = this.isValid && ((this.captureMax.x == cl.min.x || this.captureMin.x == cl.max.x) || (this.captureMax.z == cl.min.z || this.captureMin.z == cl.max.z)) + && ((this.captureMax.x == cl.max.x || this.captureMin.x == cl.min.x) || (this.captureMax.z == cl.max.z || this.captureMin.z == cl.min.z)); break; case Z: - isValid = isValid && ((captureMax.y == cl.min.y || captureMin.y == cl.max.y) || (captureMax.x == cl.min.x || captureMin.x == cl.max.x)) - && ((captureMax.y == cl.max.y || captureMin.y == cl.min.y) || (captureMax.x == cl.max.x || captureMin.x == cl.min.x)); + this.isValid = this.isValid && ((this.captureMax.y == cl.min.y || this.captureMin.y == cl.max.y) || (this.captureMax.x == cl.min.x || this.captureMin.x == cl.max.x)) + && ((this.captureMax.y == cl.max.y || this.captureMin.y == cl.min.y) || (this.captureMax.x == cl.max.x || this.captureMin.x == cl.min.x)); break; case UNFORMED: - isValid = false; + this.isValid = false; break; } } - reqX = captureMax.x - captureMin.x; - reqY = captureMax.y - captureMin.y; - reqZ = captureMax.z - captureMin.z; + reqX = this.captureMax.x - this.captureMin.x; + reqY = this.captureMax.y - this.captureMin.y; + reqZ = this.captureMax.z - this.captureMin.z; requirePylonBlocks = Math.max( 6, ((reqX * reqZ + reqX * reqY + reqY * reqZ) * 3) / 8 ); - efficiency = (double) pylonBlocks / (double) requirePylonBlocks; + this.efficiency = (double) pylonBlocks / (double) requirePylonBlocks; - if ( efficiency > 1.0 ) - efficiency = 1.0; - if ( efficiency < 0.0 ) - efficiency = 0.0; + if ( this.efficiency > 1.0 ) + this.efficiency = 1.0; + if ( this.efficiency < 0.0 ) + this.efficiency = 0.0; minPower = (double) reqX * (double) reqY * reqZ * AEConfig.instance.spatialPowerMultiplier; maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerExponent ); } - double affective_efficiency = Math.pow( efficiency, 0.25 ); - powerRequired = (long) (affective_efficiency * minPower + (1.0 - affective_efficiency) * maxPower); + double affective_efficiency = Math.pow( this.efficiency, 0.25 ); + this.powerRequired = (long) (affective_efficiency * minPower + (1.0 - affective_efficiency) * maxPower); - for (SpatialPylonCluster cl : clusters.values()) + for (SpatialPylonCluster cl : this.clusters.values()) { boolean myWasValid = cl.isValid; - cl.isValid = isValid; - if ( myWasValid != isValid ) + cl.isValid = this.isValid; + if ( myWasValid != this.isValid ) cl.updateStatus( false ); } } @@ -202,13 +202,13 @@ public class SpatialPylonCache implements ISpatialCache @Override public float currentEfficiency() { - return (float) efficiency * 100; + return (float) this.efficiency * 100; } @MENetworkEventSubscribe public void bootingRender(MENetworkBootingStatusChange c) { - reset( myGrid ); + this.reset( this.myGrid ); } @Override diff --git a/src/main/java/appeng/me/cache/TickManagerCache.java b/src/main/java/appeng/me/cache/TickManagerCache.java index adf2c144d..5a02765af 100644 --- a/src/main/java/appeng/me/cache/TickManagerCache.java +++ b/src/main/java/appeng/me/cache/TickManagerCache.java @@ -42,7 +42,7 @@ public class TickManagerCache implements ITickManager final IGrid myGrid; public TickManagerCache(IGrid g) { - myGrid = g; + this.myGrid = g; } final HashMap alertable = new HashMap(); @@ -54,15 +54,15 @@ public class TickManagerCache implements ITickManager public long getCurrentTick() { - return currentTick; + return this.currentTick; } public long getAvgNanoTime(IGridNode node) { - TickTracker tt = awake.get( node ); + TickTracker tt = this.awake.get( node ); if ( tt == null ) - tt = sleeping.get( node ); + tt = this.sleeping.get( node ); if ( tt == null ) return -1; @@ -76,15 +76,15 @@ public class TickManagerCache implements ITickManager TickTracker tt = null; try { - currentTick++; - while (!upcomingTicks.isEmpty()) + this.currentTick++; + while (!this.upcomingTicks.isEmpty()) { - tt = upcomingTicks.peek(); - int diff = (int) (currentTick - tt.lastTick); + tt = this.upcomingTicks.peek(); + int diff = (int) (this.currentTick - tt.lastTick); if ( diff >= tt.current_rate ) { // remove tt.. - upcomingTicks.poll(); + this.upcomingTicks.poll(); TickRateModulation mod = tt.gt.tickingRequest( tt.node, diff ); switch (mod) @@ -98,7 +98,7 @@ public class TickManagerCache implements ITickManager case SAME: break; case SLEEP: - sleepDevice( tt.node ); + this.sleepDevice( tt.node ); break; case SLOWER: tt.setRate( tt.current_rate + 1 ); @@ -110,8 +110,8 @@ public class TickManagerCache implements ITickManager break; } - if ( awake.containsKey( tt.node ) ) - addToQueue( tt ); + if ( this.awake.containsKey( tt.node ) ) + this.addToQueue( tt ); } else return; // done! @@ -128,30 +128,30 @@ public class TickManagerCache implements ITickManager private void addToQueue(TickTracker tt) { - tt.lastTick = currentTick; - upcomingTicks.add( tt ); + tt.lastTick = this.currentTick; + this.upcomingTicks.add( tt ); } @Override public boolean alertDevice(IGridNode node) { - TickTracker tt = alertable.get( node ); + TickTracker tt = this.alertable.get( node ); if ( tt == null ) return false; // throw new RuntimeException( // "Invalid alerted device, this node is not marked as alertable, or part of this grid." ); // set to awake, this is for sanity. - sleeping.remove( node ); - awake.put( node, tt ); + this.sleeping.remove( node ); + this.awake.put( node, tt ); // configure sort. tt.lastTick = tt.lastTick - tt.request.maxTickRate; tt.current_rate = tt.request.minTickRate; // prevent dupes and tick build up. - upcomingTicks.remove( tt ); - upcomingTicks.add( tt ); + this.upcomingTicks.remove( tt ); + this.upcomingTicks.add( tt ); return true; } @@ -159,11 +159,11 @@ public class TickManagerCache implements ITickManager @Override public boolean sleepDevice(IGridNode node) { - if ( awake.containsKey( node ) ) + if ( this.awake.containsKey( node ) ) { - TickTracker gt = awake.get( node ); - awake.remove( node ); - sleeping.put( node, gt ); + TickTracker gt = this.awake.get( node ); + this.awake.remove( node ); + this.sleeping.put( node, gt ); return true; } @@ -174,12 +174,12 @@ public class TickManagerCache implements ITickManager @Override public boolean wakeDevice(IGridNode node) { - if ( sleeping.containsKey( node ) ) + if ( this.sleeping.containsKey( node ) ) { - TickTracker gt = sleeping.get( node ); - sleeping.remove( node ); - awake.put( node, gt ); - addToQueue( gt ); + TickTracker gt = this.sleeping.get( node ); + this.sleeping.remove( node ); + this.awake.put( node, gt ); + this.addToQueue( gt ); return true; } @@ -192,9 +192,9 @@ public class TickManagerCache implements ITickManager { if ( machine instanceof IGridTickable ) { - alertable.remove( gridNode ); - sleeping.remove( gridNode ); - awake.remove( gridNode ); + this.alertable.remove( gridNode ); + this.sleeping.remove( gridNode ); + this.awake.remove( gridNode ); } } @@ -206,17 +206,17 @@ public class TickManagerCache implements ITickManager TickingRequest tr = ((IGridTickable) machine).getTickingRequest( gridNode ); if ( tr != null ) { - TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, currentTick, this ); + TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, this.currentTick, this ); if ( tr.canBeAlerted ) - alertable.put( gridNode, tt ); + this.alertable.put( gridNode, tt ); if ( tr.isSleeping ) - sleeping.put( gridNode, tt ); + this.sleeping.put( gridNode, tt ); else { - awake.put( gridNode, tt ); - addToQueue( tt ); + this.awake.put( gridNode, tt ); + this.addToQueue( tt ); } } diff --git a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java index 149149698..95c8662ed 100644 --- a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java +++ b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java @@ -26,7 +26,7 @@ public class ConnectionWrapper public IGridConnection connection; public ConnectionWrapper(IGridConnection gc) { - connection = gc; + this.connection = gc; } } \ No newline at end of file diff --git a/src/main/java/appeng/me/cache/helpers/Connections.java b/src/main/java/appeng/me/cache/helpers/Connections.java index c7f3cb857..bad763213 100644 --- a/src/main/java/appeng/me/cache/helpers/Connections.java +++ b/src/main/java/appeng/me/cache/helpers/Connections.java @@ -34,27 +34,27 @@ public class Connections implements Callable public boolean destroy = false; public Connections(PartP2PTunnelME o) { - me = o; + this.me = o; } @Override public Object call() throws Exception { - me.updateConnections( this ); + this.me.updateConnections( this ); return null; } public void markDestroy() { - create = false; - destroy = true; + this.create = false; + this.destroy = true; } public void markCreate() { - create = true; - destroy = false; + this.create = true; + this.destroy = false; } } diff --git a/src/main/java/appeng/me/cache/helpers/TickTracker.java b/src/main/java/appeng/me/cache/helpers/TickTracker.java index 26a244b04..6771dfb04 100644 --- a/src/main/java/appeng/me/cache/helpers/TickTracker.java +++ b/src/main/java/appeng/me/cache/helpers/TickTracker.java @@ -40,54 +40,54 @@ public class TickTracker implements Comparable public int current_rate; public TickTracker(TickingRequest req, IGridNode node, IGridTickable gt, long currentTick, TickManagerCache tickManagerCache) { - request = req; + this.request = req; this.gt = gt; this.node = node; - current_rate = (req.minTickRate + req.maxTickRate) / 2; - lastTick = currentTick; - host = tickManagerCache; + this.current_rate = (req.minTickRate + req.maxTickRate) / 2; + this.lastTick = currentTick; + this.host = tickManagerCache; } public long getAvgNanos() { - return (LastFiveTicksTime / 5); + return (this.LastFiveTicksTime / 5); } public void setRate(int rate) { - current_rate = rate; + this.current_rate = rate; - if ( current_rate < request.minTickRate ) - current_rate = request.minTickRate; + if ( this.current_rate < this.request.minTickRate ) + this.current_rate = this.request.minTickRate; - if ( current_rate > request.maxTickRate ) - current_rate = request.maxTickRate; + if ( this.current_rate > this.request.maxTickRate ) + this.current_rate = this.request.maxTickRate; } @Override public int compareTo(TickTracker t) { - int nextTick = (int) ((lastTick - host.getCurrentTick()) + current_rate); - int ts_nextTick = (int) ((t.lastTick - host.getCurrentTick()) + t.current_rate); + int nextTick = (int) ((this.lastTick - this.host.getCurrentTick()) + this.current_rate); + int ts_nextTick = (int) ((t.lastTick - this.host.getCurrentTick()) + t.current_rate); return nextTick - ts_nextTick; } public void addEntityCrashInfo(CrashReportCategory crashreportcategory) { - if ( gt instanceof AEBasePart ) + if ( this.gt instanceof AEBasePart ) { - AEBasePart part = (AEBasePart)gt; + AEBasePart part = (AEBasePart)this.gt; part.addEntityCrashInfo( crashreportcategory ); } - crashreportcategory.addCrashSection( "CurrentTickRate", current_rate ); - crashreportcategory.addCrashSection( "MinTickRate", request.minTickRate ); - crashreportcategory.addCrashSection( "MaxTickRate", request.maxTickRate ); - crashreportcategory.addCrashSection( "MachineType", gt.getClass().getName() ); - crashreportcategory.addCrashSection( "GridBlockType", node.getGridBlock().getClass().getName() ); - crashreportcategory.addCrashSection( "ConnectedSides", node.getConnectedSides() ); + crashreportcategory.addCrashSection( "CurrentTickRate", this.current_rate ); + crashreportcategory.addCrashSection( "MinTickRate", this.request.minTickRate ); + crashreportcategory.addCrashSection( "MaxTickRate", this.request.maxTickRate ); + crashreportcategory.addCrashSection( "MachineType", this.gt.getClass().getName() ); + crashreportcategory.addCrashSection( "GridBlockType", this.node.getGridBlock().getClass().getName() ); + crashreportcategory.addCrashSection( "ConnectedSides", this.node.getConnectedSides() ); - DimensionalCoord dc = node.getGridBlock().getLocation(); + DimensionalCoord dc = this.node.getGridBlock().getLocation(); if ( dc != null ) crashreportcategory.addCrashSection( "Location", dc ); } diff --git a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java index c5ccc4580..70028c6e5 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java @@ -31,35 +31,35 @@ public class TunnelCollection implements Iterable Collection tunnelSources; public TunnelCollection(Collection src, Class c) { - tunnelSources = src; - clz = c; + this.tunnelSources = src; + this.clz = c; } @Override public Iterator iterator() { - if ( tunnelSources == null ) + if ( this.tunnelSources == null ) return new NullIterator(); - return new TunnelIterator( tunnelSources, clz ); + return new TunnelIterator( this.tunnelSources, this.clz ); } public void setSource(Collection c) { - tunnelSources = c; + this.tunnelSources = c; } public boolean isEmpty() { - return !iterator().hasNext(); + return !this.iterator().hasNext(); } public boolean matches(Class c) { - return clz == c; + return this.clz == c; } public Class getClz() { - return clz; + return this.clz; } } diff --git a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java index b7acf25cb..71c5fb6a0 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java @@ -28,7 +28,7 @@ public class TunnelConnection final public IGridConnection c; public TunnelConnection(PartP2PTunnelME t, IGridConnection con) { - tunnel = t; - c = con; + this.tunnel = t; + this.c = con; } } \ No newline at end of file diff --git a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java index c61372f8d..4a5ed7f30 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java @@ -32,32 +32,32 @@ public class TunnelIterator implements Iterator private void findNext() { - while (Next == null && wrapped.hasNext()) + while (this.Next == null && this.wrapped.hasNext()) { - Next = wrapped.next(); - if ( !targetType.isInstance( Next ) ) - Next = null; + this.Next = this.wrapped.next(); + if ( !this.targetType.isInstance( this.Next ) ) + this.Next = null; } } public TunnelIterator(Collection tunnelSources, Class clz) { - wrapped = tunnelSources.iterator(); - targetType = clz; - findNext(); + this.wrapped = tunnelSources.iterator(); + this.targetType = clz; + this.findNext(); } @Override public boolean hasNext() { - findNext(); - return Next != null; + this.findNext(); + return this.Next != null; } @Override public T next() { - T tmp = Next; - Next = null; + T tmp = this.Next; + this.Next = null; return tmp; } diff --git a/src/main/java/appeng/me/cluster/MBCalculator.java b/src/main/java/appeng/me/cluster/MBCalculator.java index f91626d4d..870348e2b 100644 --- a/src/main/java/appeng/me/cluster/MBCalculator.java +++ b/src/main/java/appeng/me/cluster/MBCalculator.java @@ -31,7 +31,7 @@ public abstract class MBCalculator final private IAEMultiBlock target; public MBCalculator(IAEMultiBlock t) { - target = t; + this.target = t; } /** @@ -78,7 +78,7 @@ public abstract class MBCalculator public boolean isValidTileAt(World w, int x, int y, int z) { - return isValidTile( w.getTileEntity( x, y, z ) ); + return this.isValidTile( w.getTileEntity( x, y, z ) ); } public void calculateMultiblock(World world, WorldCoord loc) @@ -92,44 +92,44 @@ public abstract class MBCalculator WorldCoord max = loc.copy(); // find size of MB structure... - while (isValidTileAt( world, min.x - 1, min.y, min.z )) + while (this.isValidTileAt( world, min.x - 1, min.y, min.z )) min.x--; - while (isValidTileAt( world, min.x, min.y - 1, min.z )) + while (this.isValidTileAt( world, min.x, min.y - 1, min.z )) min.y--; - while (isValidTileAt( world, min.x, min.y, min.z - 1 )) + while (this.isValidTileAt( world, min.x, min.y, min.z - 1 )) min.z--; - while (isValidTileAt( world, max.x + 1, max.y, max.z )) + while (this.isValidTileAt( world, max.x + 1, max.y, max.z )) max.x++; - while (isValidTileAt( world, max.x, max.y + 1, max.z )) + while (this.isValidTileAt( world, max.x, max.y + 1, max.z )) max.y++; - while (isValidTileAt( world, max.x, max.y, max.z + 1 )) + while (this.isValidTileAt( world, max.x, max.y, max.z + 1 )) max.z++; - if ( checkMultiblockScale( min, max ) ) + if ( this.checkMultiblockScale( min, max ) ) { - if ( verifyUnownedRegion( world, min, max ) ) + if ( this.verifyUnownedRegion( world, min, max ) ) { - IAECluster c = createCluster( world, min, max ); + IAECluster c = this.createCluster( world, min, max ); try { - if ( !verifyInternalStructure( world, min, max ) ) + if ( !this.verifyInternalStructure( world, min, max ) ) { - disconnect(); + this.disconnect(); return; } } catch (Exception err) { - disconnect(); + this.disconnect(); return; } boolean updateGrid = false; - IAECluster cluster = target.getCluster(); + IAECluster cluster = this.target.getCluster(); if ( cluster == null ) { - updateTiles( c, world, min, max ); + this.updateTiles( c, world, min, max ); updateGrid = true; } @@ -146,7 +146,7 @@ public abstract class MBCalculator AELog.error( err ); } - disconnect(); + this.disconnect(); } public abstract boolean verifyInternalStructure(World worldObj, WorldCoord min, WorldCoord max); @@ -190,7 +190,7 @@ public abstract class MBCalculator for (int z = minZ; z <= maxZ; z++) { TileEntity te = w.getTileEntity( x, y, z ); - if ( isValidTile( te ) ) + if ( this.isValidTile( te ) ) return true; } } @@ -202,7 +202,7 @@ public abstract class MBCalculator public boolean verifyUnownedRegion(World w, WorldCoord min, WorldCoord max) { for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - if ( verifyUnownedRegionInner( w, min.x, min.y, min.z, max.x, max.y, max.z, side ) ) + if ( this.verifyUnownedRegionInner( w, min.x, min.y, min.z, max.x, max.y, max.z, side ) ) return false; return true; diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java index d7dc77f9f..6d9ec3335 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java @@ -40,7 +40,7 @@ public class CraftingCPUCalculator extends MBCalculator public CraftingCPUCalculator(IAEMultiBlock t) { super( t ); - tqb = (TileCraftingTile) t; + this.tqb = (TileCraftingTile) t; } @Override @@ -110,7 +110,7 @@ public class CraftingCPUCalculator extends MBCalculator @Override public void disconnect() { - tqb.disconnect( true ); + this.tqb.disconnect( true ); } @Override diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index 6a5a999a1..55f29c244 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -122,12 +122,12 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU protected Iterator, Object>> getListeners() { - return listeners.entrySet().iterator(); + return this.listeners.entrySet().iterator(); } protected void postChange(IAEItemStack diff, BaseActionSource src) { - Iterator, Object>> i = getListeners(); + Iterator, Object>> i = this.getListeners(); ImmutableList single = null; @@ -152,7 +152,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU @Override public void addListener(IMEMonitorHandlerReceiver l, Object verificationToken) { - listeners.put( l, verificationToken ); + this.listeners.put( l, verificationToken ); } /** @@ -161,7 +161,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU @Override public void removeListener(IMEMonitorHandlerReceiver l) { - listeners.remove( l ); + this.listeners.remove( l ); } public void getListOfItem(IItemList list, CraftingItemList whichList) @@ -169,11 +169,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU switch (whichList) { case ACTIVE: - for (IAEItemStack ais : waitingFor) + for (IAEItemStack ais : this.waitingFor) list.add( ais ); break; case PENDING: - for (Entry t : tasks.entrySet()) + for (Entry t : this.tasks.entrySet()) { for (IAEItemStack ais : t.getKey().getCondensedOutputs()) { @@ -184,16 +184,16 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU } break; case STORAGE: - inventory.getAvailableItems( list ); + this.inventory.getAvailableItems( list ); break; default: case ALL: - inventory.getAvailableItems( list ); + this.inventory.getAvailableItems( list ); - for (IAEItemStack ais : waitingFor) + for (IAEItemStack ais : this.waitingFor) list.add( ais ); - for (Entry t : tasks.entrySet()) + for (Entry t : this.tasks.entrySet()) { for (IAEItemStack ais : t.getKey().getCondensedOutputs()) { @@ -210,37 +210,37 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU @Override public Iterator getTiles() { - return (Iterator) tiles.iterator(); + return (Iterator) this.tiles.iterator(); } public IMEInventory getInventory() { - return inventory; + return this.inventory; } public CraftingCPUCluster(WorldCoord _min, WorldCoord _max) { - min = _min; - max = _max; + this.min = _min; + this.max = _max; } @Override public void updateStatus(boolean updateGrid) { - for (TileCraftingTile r : tiles) + for (TileCraftingTile r : this.tiles) r.updateMeta( true ); } @Override public void destroy() { - if ( isDestroyed ) + if ( this.isDestroyed ) return; - isDestroyed = true; + this.isDestroyed = true; boolean posted = false; - for (TileCraftingTile r : tiles) + for (TileCraftingTile r : this.tiles) { IGridNode n = r.getActionableNode(); if ( n != null && !posted ) @@ -260,40 +260,40 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU @Override public long getAvailableStorage() { - return availableStorage; + return this.availableStorage; } @Override public int getCoProcessors() { - return accelerator; + return this.accelerator; } public void addTile(TileCraftingTile te) { - if ( machineSrc == null || te.isCoreBlock ) - machineSrc = new MachineSource( te ); + if ( this.machineSrc == null || te.isCoreBlock ) + this.machineSrc = new MachineSource( te ); te.isCoreBlock = false; te.markDirty(); - tiles.push( te ); + this.tiles.push( te ); if ( te.isStorage() ) { - availableStorage += te.getStorageBytes(); - storage.add( te ); + this.availableStorage += te.getStorageBytes(); + this.storage.add( te ); } else if ( te.isStatus() ) - status.add( (TileCraftingMonitorTile) te ); + this.status.add( (TileCraftingMonitorTile) te ); else if ( te.isAccelerator() ) - accelerator++; + this.accelerator++; } public boolean canAccept(IAEStack input) { if ( input instanceof IAEItemStack ) { - IAEItemStack is = waitingFor.findPrecise( (IAEItemStack) input ); + IAEItemStack is = this.waitingFor.findPrecise( (IAEItemStack) input ); if ( is != null && is.getStackSize() > 0 ) return true; } @@ -302,10 +302,10 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public void postCraftingStatusChange(IAEItemStack diff) { - if ( getGrid() == null ) + if ( this.getGrid() == null ) return; - CraftingGridCache sg = getGrid().getCache( ICraftingGrid.class ); + CraftingGridCache sg = this.getGrid().getCache( ICraftingGrid.class ); if ( sg.interestManager.containsKey( diff ) ) { @@ -326,16 +326,16 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( input instanceof IAEItemStack && type == Actionable.SIMULATE )// causes crafting to lock up? { IAEItemStack what = (IAEItemStack) input.copy(); - IAEItemStack is = waitingFor.findPrecise( what ); + IAEItemStack is = this.waitingFor.findPrecise( what ); if ( is != null && is.getStackSize() > 0 ) { if ( is.getStackSize() >= what.getStackSize() ) { - if ( finalOutput.equals( what ) ) + if ( this.finalOutput.equals( what ) ) { - if ( myLastLink != null ) - return ((CraftingLink) myLastLink).injectItems( what.copy(), type ); + if ( this.myLastLink != null ) + return ((CraftingLink) this.myLastLink).injectItems( what.copy(), type ); return what; // ignore it. } @@ -349,11 +349,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU IAEItemStack used = what.copy(); used.setStackSize( is.getStackSize() ); - if ( finalOutput.equals( what ) ) + if ( this.finalOutput.equals( what ) ) { - if ( myLastLink != null ) + if ( this.myLastLink != null ) { - leftOver.add( ((CraftingLink) myLastLink).injectItems( used.copy(), type ) ); + leftOver.add( ((CraftingLink) this.myLastLink).injectItems( used.copy(), type ) ); return leftOver; } @@ -366,35 +366,35 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU else if ( input instanceof IAEItemStack && type == Actionable.MODULATE ) { IAEItemStack what = (IAEItemStack) input; - IAEItemStack is = waitingFor.findPrecise( what ); + IAEItemStack is = this.waitingFor.findPrecise( what ); if ( is != null && is.getStackSize() > 0 ) { - waiting = false; - postChange( (IAEItemStack) input, src ); + this.waiting = false; + this.postChange( (IAEItemStack) input, src ); if ( is.getStackSize() >= input.getStackSize() ) { is.decStackSize( input.getStackSize() ); - markDirty(); - postCraftingStatusChange( is ); + this.markDirty(); + this.postCraftingStatusChange( is ); - if ( finalOutput.equals( input ) ) + if ( this.finalOutput.equals( input ) ) { - finalOutput.decStackSize( input.getStackSize() ); - if ( finalOutput.getStackSize() <= 0 ) - completeJob(); + this.finalOutput.decStackSize( input.getStackSize() ); + if ( this.finalOutput.getStackSize() <= 0 ) + this.completeJob(); - updateCPU(); + this.updateCPU(); - if ( myLastLink != null ) - return ((CraftingLink) myLastLink).injectItems( (IAEItemStack) input, type ); + if ( this.myLastLink != null ) + return ((CraftingLink) this.myLastLink).injectItems( (IAEItemStack) input, type ); return input; // ignore it. } // 2000 - return inventory.injectItems( what, type, src ); + return this.inventory.injectItems( what, type, src ); } IAEItemStack insert = what.copy(); @@ -403,28 +403,28 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU is.setStackSize( 0 ); - if ( finalOutput.equals( insert ) ) + if ( this.finalOutput.equals( insert ) ) { - finalOutput.decStackSize( insert.getStackSize() ); - if ( finalOutput.getStackSize() <= 0 ) - completeJob(); + this.finalOutput.decStackSize( insert.getStackSize() ); + if ( this.finalOutput.getStackSize() <= 0 ) + this.completeJob(); - updateCPU(); + this.updateCPU(); - if ( myLastLink != null ) + if ( this.myLastLink != null ) { - what.add( ((CraftingLink) myLastLink).injectItems( insert.copy(), type ) ); + what.add( ((CraftingLink) this.myLastLink).injectItems( insert.copy(), type ) ); return what; } - if ( myLastLink != null ) - return ((CraftingLink) myLastLink).injectItems( (IAEItemStack) input, type ); + if ( this.myLastLink != null ) + return ((CraftingLink) this.myLastLink).injectItems( (IAEItemStack) input, type ); return input; // ignore it. } - inventory.injectItems( insert, type, src ); - markDirty(); + this.inventory.injectItems( insert, type, src ); + this.markDirty(); return what; } @@ -435,18 +435,18 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void updateCPU() { - IAEItemStack send = finalOutput; + IAEItemStack send = this.finalOutput; - if ( finalOutput != null && finalOutput.getStackSize() <= 0 ) + if ( this.finalOutput != null && this.finalOutput.getStackSize() <= 0 ) send = null; - for (TileCraftingMonitorTile t : status) + for (TileCraftingMonitorTile t : this.status) t.setJob( send ); } public IGrid getGrid() { - for (TileCraftingTile r : tiles) + for (TileCraftingTile r : this.tiles) { IGridNode gn = r.getActionableNode(); if ( gn != null ) @@ -462,11 +462,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void completeJob() { - if ( myLastLink != null ) - ((CraftingLink) myLastLink).markDone(); + if ( this.myLastLink != null ) + ((CraftingLink) this.myLastLink).markDone(); AELog.crafting( "marking job as complete" ); - isComplete = true; + this.isComplete = true; } private boolean canCraft(ICraftingPatternDetails details, IAEItemStack[] condensedInputs) @@ -478,11 +478,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU { boolean found = false; - for (IAEItemStack fuzz : inventory.getItemList().findFuzzy( g, FuzzyMode.IGNORE_ALL )) + for (IAEItemStack fuzz : this.inventory.getItemList().findFuzzy( g, FuzzyMode.IGNORE_ALL )) { fuzz = fuzz.copy(); fuzz.setStackSize( g.getStackSize() ); - IAEItemStack ais = inventory.extractItems( fuzz, Actionable.SIMULATE, machineSrc ); + IAEItemStack ais = this.inventory.extractItems( fuzz, Actionable.SIMULATE, this.machineSrc ); ItemStack is = ais == null ? null : ais.getItemStack(); if ( is != null && is.stackSize == g.getStackSize() ) @@ -502,7 +502,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU } else { - IAEItemStack ais = inventory.extractItems( g.copy(), Actionable.SIMULATE, machineSrc ); + IAEItemStack ais = this.inventory.extractItems( g.copy(), Actionable.SIMULATE, this.machineSrc ); ItemStack is = ais == null ? null : ais.getItemStack(); if ( is == null || is.stackSize < g.getStackSize() ) @@ -515,76 +515,76 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public void cancel() { - if ( myLastLink != null ) - myLastLink.cancel(); + if ( this.myLastLink != null ) + this.myLastLink.cancel(); IItemList list; - getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); + this.getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); for (IAEItemStack is : list) - postChange( is, machineSrc ); + this.postChange( is, this.machineSrc ); - isComplete = true; - myLastLink = null; - tasks.clear(); + this.isComplete = true; + this.myLastLink = null; + this.tasks.clear(); - ImmutableSet items = ImmutableSet.copyOf( waitingFor ); + ImmutableSet items = ImmutableSet.copyOf( this.waitingFor ); - waitingFor.resetStatus(); + this.waitingFor.resetStatus(); for (IAEItemStack is : items) - postCraftingStatusChange( is ); + this.postCraftingStatusChange( is ); - finalOutput = null; - updateCPU(); + this.finalOutput = null; + this.updateCPU(); - storeItems(); // marks dirty + this.storeItems(); // marks dirty } public void updateCraftingLogic(IGrid grid, IEnergyGrid eg, CraftingGridCache cc) { - if ( !getCore().isActive() ) + if ( !this.getCore().isActive() ) return; - if ( myLastLink != null ) + if ( this.myLastLink != null ) { - if ( myLastLink.isCanceled() ) + if ( this.myLastLink.isCanceled() ) { - myLastLink = null; - cancel(); + this.myLastLink = null; + this.cancel(); } } - if ( isComplete ) + if ( this.isComplete ) { - if ( inventory.getItemList().isEmpty() ) + if ( this.inventory.getItemList().isEmpty() ) return; - storeItems(); + this.storeItems(); return; } - waiting = false; - if ( waiting || tasks.isEmpty() ) // nothing to do here... + this.waiting = false; + if ( this.waiting || this.tasks.isEmpty() ) // nothing to do here... return; - remainingOperations = accelerator + 1 - (usedOps[0] + usedOps[1] + usedOps[2]); - int started = remainingOperations; + this.remainingOperations = this.accelerator + 1 - (this.usedOps[0] + this.usedOps[1] + this.usedOps[2]); + int started = this.remainingOperations; - if ( remainingOperations > 0 ) + if ( this.remainingOperations > 0 ) { do { - somethingChanged = false; - executeCrafting( eg, cc ); + this.somethingChanged = false; + this.executeCrafting( eg, cc ); } - while (somethingChanged && remainingOperations > 0); + while (this.somethingChanged && this.remainingOperations > 0); } - usedOps[2] = usedOps[1]; - usedOps[1] = usedOps[0]; - usedOps[0] = started - remainingOperations; + this.usedOps[2] = this.usedOps[1]; + this.usedOps[1] = this.usedOps[0]; + this.usedOps[0] = started - this.remainingOperations; - if ( remainingOperations > 0 && !somethingChanged ) - waiting = true; + if ( this.remainingOperations > 0 && !this.somethingChanged ) + this.waiting = true; } private int remainingOperations; @@ -592,7 +592,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void executeCrafting(IEnergyGrid eg, CraftingGridCache cc) { - Iterator> i = tasks.entrySet().iterator(); + Iterator> i = this.tasks.entrySet().iterator(); while (i.hasNext()) { Entry e = i.next(); @@ -603,7 +603,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU } ICraftingPatternDetails details = e.getKey(); - if ( canCraft( details, details.getCondensedInputs() ) ) + if ( this.canCraft( details, details.getCondensedInputs() ) ) { InventoryCrafting ic = null; @@ -642,19 +642,19 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU found = false; if ( details.isCraftable() ) { - for (IAEItemStack fuzz : inventory.getItemList().findFuzzy( input[x], FuzzyMode.IGNORE_ALL )) + for (IAEItemStack fuzz : this.inventory.getItemList().findFuzzy( input[x], FuzzyMode.IGNORE_ALL )) { fuzz = fuzz.copy(); fuzz.setStackSize( input[x].getStackSize() ); - if ( details.isValidItemForSlot( x, fuzz.getItemStack(), getWorld() ) ) + if ( details.isValidItemForSlot( x, fuzz.getItemStack(), this.getWorld() ) ) { - IAEItemStack ais = inventory.extractItems( fuzz, Actionable.MODULATE, machineSrc ); + IAEItemStack ais = this.inventory.extractItems( fuzz, Actionable.MODULATE, this.machineSrc ); ItemStack is = ais == null ? null : ais.getItemStack(); if ( is != null ) { - postChange( AEItemStack.create( is ), machineSrc ); + this.postChange( AEItemStack.create( is ), this.machineSrc ); ic.setInventorySlotContents( x, is ); found = true; break; @@ -664,12 +664,12 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU } else { - IAEItemStack ais = inventory.extractItems( input[x].copy(), Actionable.MODULATE, machineSrc ); + IAEItemStack ais = this.inventory.extractItems( input[x].copy(), Actionable.MODULATE, this.machineSrc ); ItemStack is = ais == null ? null : ais.getItemStack(); if ( is != null ) { - postChange( input[x], machineSrc ); + this.postChange( input[x], this.machineSrc ); ic.setInventorySlotContents( x, is ); if ( is.stackSize == input[x].getStackSize() ) { @@ -692,7 +692,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU { ItemStack is = ic.getStackInSlot( x ); if ( is != null ) - inventory.injectItems( AEItemStack.create( is ), Actionable.MODULATE, machineSrc ); + this.inventory.injectItems( AEItemStack.create( is ), Actionable.MODULATE, this.machineSrc ); } ic = null; break; @@ -701,20 +701,20 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( m.pushPattern( details, ic ) ) { - somethingChanged = true; - remainingOperations--; + this.somethingChanged = true; + this.remainingOperations--; for (IAEItemStack out : details.getCondensedOutputs()) { - postChange( out, machineSrc ); - waitingFor.add( out.copy() ); - postCraftingStatusChange( out.copy() ); + this.postChange( out, this.machineSrc ); + this.waitingFor.add( out.copy() ); + this.postCraftingStatusChange( out.copy() ); } if ( details.isCraftable() ) { - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) getWorld() ), - details.getOutput( ic, getWorld() ), ic ); + FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ), + details.getOutput( ic, this.getWorld() ), ic ); for (int x = 0; x < ic.getSizeInventory(); x++) { @@ -722,21 +722,21 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( output != null ) { IAEItemStack cItem = AEItemStack.create( output ); - postChange( cItem, machineSrc ); - waitingFor.add( cItem ); - postCraftingStatusChange( cItem ); + this.postChange( cItem, this.machineSrc ); + this.waitingFor.add( cItem ); + this.postCraftingStatusChange( cItem ); } } } ic = null; // hand off complete! - markDirty(); + this.markDirty(); e.getValue().value--; if ( e.getValue().value <= 0 ) continue; - if ( remainingOperations == 0 ) + if ( this.remainingOperations == 0 ) return; } } @@ -750,7 +750,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU ItemStack is = ic.getStackInSlot( x ); if ( is != null ) { - inventory.injectItems( AEItemStack.create( is ), Actionable.MODULATE, machineSrc ); + this.inventory.injectItems( AEItemStack.create( is ), Actionable.MODULATE, this.machineSrc ); } } } @@ -760,47 +760,47 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void storeItems() { - IGrid g = getGrid(); + IGrid g = this.getGrid(); if ( g == null ) return; IStorageGrid sg = g.getCache( IStorageGrid.class ); IMEInventory ii = sg.getItemInventory(); - for (IAEItemStack is : inventory.getItemList()) + for (IAEItemStack is : this.inventory.getItemList()) { - is = inventory.extractItems( is.copy(), Actionable.MODULATE, machineSrc ); + is = this.inventory.extractItems( is.copy(), Actionable.MODULATE, this.machineSrc ); if ( is != null ) { - postChange( is, machineSrc ); - is = ii.injectItems( is, Actionable.MODULATE, machineSrc ); + this.postChange( is, this.machineSrc ); + is = ii.injectItems( is, Actionable.MODULATE, this.machineSrc ); } if ( is != null ) - inventory.injectItems( is, Actionable.MODULATE, machineSrc ); + this.inventory.injectItems( is, Actionable.MODULATE, this.machineSrc ); } - if ( inventory.getItemList().isEmpty() ) - inventory = new MECraftingInventory(); + if ( this.inventory.getItemList().isEmpty() ) + this.inventory = new MECraftingInventory(); - markDirty(); + this.markDirty(); } private World getWorld() { - return getCore().getWorldObj(); + return this.getCore().getWorldObj(); } public ICraftingLink submitJob(IGrid g, ICraftingJob job, BaseActionSource src, ICraftingRequester requestingMachine) { - if ( !tasks.isEmpty() || !waitingFor.isEmpty() ) + if ( !this.tasks.isEmpty() || !this.waitingFor.isEmpty() ) return null; if ( !(job instanceof CraftingJob) ) return null; - if ( isBusy() || !isActive() || getAvailableStorage() < job.getByteTotal() ) + if ( this.isBusy() || !this.isActive() || this.getAvailableStorage() < job.getByteTotal() ) return null; IStorageGrid sg = g.getCache( IStorageGrid.class ); @@ -809,46 +809,46 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU try { - waitingFor.resetStatus(); + this.waitingFor.resetStatus(); ((CraftingJob) job).tree.setJob( ci, this, src ); if ( ci.commit( src ) ) { - finalOutput = job.getOutput(); - waiting = false; - isComplete = false; - markDirty(); + this.finalOutput = job.getOutput(); + this.waiting = false; + this.isComplete = false; + this.markDirty(); - updateCPU(); - String craftID = generateCraftingID(); + this.updateCPU(); + String craftID = this.generateCraftingID(); - myLastLink = new CraftingLink( generateLinkData( craftID, requestingMachine == null, false ), this ); + this.myLastLink = new CraftingLink( this.generateLinkData( craftID, requestingMachine == null, false ), this ); if ( requestingMachine == null ) - return myLastLink; + return this.myLastLink; - ICraftingLink whatLink = new CraftingLink( generateLinkData( craftID, false, true ), requestingMachine ); + ICraftingLink whatLink = new CraftingLink( this.generateLinkData( craftID, false, true ), requestingMachine ); - submitLink( myLastLink ); - submitLink( whatLink ); + this.submitLink( this.myLastLink ); + this.submitLink( whatLink ); IItemList list; - getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); + this.getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); for (IAEItemStack ge : list) - postChange( ge, machineSrc ); + this.postChange( ge, this.machineSrc ); return whatLink; } else { - tasks.clear(); - inventory.getItemList().resetStatus(); + this.tasks.clear(); + this.inventory.getItemList().resetStatus(); } } catch (CraftBranchFailure e) { - tasks.clear(); - inventory.getItemList().resetStatus(); + this.tasks.clear(); + this.inventory.getItemList().resetStatus(); // AELog.error( e ); } @@ -857,9 +857,9 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void submitLink(ICraftingLink myLastLink2) { - if ( getGrid() != null ) + if ( this.getGrid() != null ) { - CraftingGridCache cc = getGrid().getCache( ICraftingGrid.class ); + CraftingGridCache cc = this.getGrid().getCache( ICraftingGrid.class ); cc.addLink( (CraftingLink) myLastLink2 ); } } @@ -868,7 +868,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU { long now = System.currentTimeMillis(); int hash = System.identityHashCode( this ); - int hmm = finalOutput == null ? 0 : finalOutput.hashCode(); + int hmm = this.finalOutput == null ? 0 : this.finalOutput.hashCode(); return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm, Character.MAX_RADIX ); @@ -889,31 +889,31 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU private void markDirty() { - getCore().markDirty(); + this.getCore().markDirty(); } private TileCraftingTile getCore() { - return (TileCraftingTile) machineSrc.via; + return (TileCraftingTile) this.machineSrc.via; } public void addStorage(IAEItemStack extractItems) { - inventory.injectItems( extractItems, Actionable.MODULATE, null ); + this.inventory.injectItems( extractItems, Actionable.MODULATE, null ); } public void addEmitable(IAEItemStack i) { - waitingFor.add( i ); - postCraftingStatusChange( i ); + this.waitingFor.add( i ); + this.postCraftingStatusChange( i ); } public void addCrafting(ICraftingPatternDetails details, long crafts) { - TaskProgress i = tasks.get( details ); + TaskProgress i = this.tasks.get( details ); if ( i == null ) - tasks.put( details, i = new TaskProgress() ); + this.tasks.put( details, i = new TaskProgress() ); i.value += crafts; } @@ -921,14 +921,14 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU @Override public boolean isBusy() { - Iterator> i = tasks.entrySet().iterator(); + Iterator> i = this.tasks.entrySet().iterator(); while (i.hasNext()) { if ( i.next().getValue().value <= 0 ) i.remove(); } - return !tasks.isEmpty() || !waitingFor.isEmpty(); + return !this.tasks.isEmpty() || !this.waitingFor.isEmpty(); } public IAEItemStack getItemStack(IAEItemStack what, CraftingItemList storage2) @@ -937,17 +937,17 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU switch (storage2) { case STORAGE: - is = inventory.getItemList().findPrecise( what ); + is = this.inventory.getItemList().findPrecise( what ); break; case ACTIVE: - is = waitingFor.findPrecise( what ); + is = this.waitingFor.findPrecise( what ); break; case PENDING: is = what.copy(); is.setStackSize( 0 ); - for (Entry t : tasks.entrySet()) + for (Entry t : this.tasks.entrySet()) { for (IAEItemStack ais : t.getKey().getCondensedOutputs()) { @@ -972,18 +972,18 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public void readFromNBT(NBTTagCompound data) { - finalOutput = AEItemStack.loadItemStackFromNBT( (NBTTagCompound) data.getTag( "finalOutput" ) ); - for (IAEItemStack ais : readList( (NBTTagList) data.getTag( "inventory" ) )) - inventory.injectItems( ais, Actionable.MODULATE, machineSrc ); + this.finalOutput = AEItemStack.loadItemStackFromNBT( (NBTTagCompound) data.getTag( "finalOutput" ) ); + for (IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) )) + this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc ); - waiting = data.getBoolean( "waiting" ); - isComplete = data.getBoolean( "isComplete" ); + this.waiting = data.getBoolean( "waiting" ); + this.isComplete = data.getBoolean( "isComplete" ); if ( data.hasKey( "link" ) ) { NBTTagCompound link = data.getCompoundTag( "link" ); - myLastLink = new CraftingLink( link, this ); - submitLink( myLastLink ); + this.myLastLink = new CraftingLink( link, this ); + this.submitLink( this.myLastLink ); } NBTTagList list = data.getTagList( "tasks", 10 ); @@ -994,45 +994,45 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( pattern != null && pattern.getItem() instanceof ICraftingPatternItem ) { ICraftingPatternItem cpi = (ICraftingPatternItem) pattern.getItem(); - ICraftingPatternDetails details = cpi.getPatternForItem( pattern.getItemStack(), getWorld() ); + ICraftingPatternDetails details = cpi.getPatternForItem( pattern.getItemStack(), this.getWorld() ); if ( details != null ) { TaskProgress tp = new TaskProgress(); tp.value = item.getLong( "craftingProgress" ); - tasks.put( details, tp ); + this.tasks.put( details, tp ); } } } - waitingFor = readList( (NBTTagList) data.getTag( "waitingFor" ) ); - for (IAEItemStack is : waitingFor) - postCraftingStatusChange( is.copy() ); + this.waitingFor = this.readList( (NBTTagList) data.getTag( "waitingFor" ) ); + for (IAEItemStack is : this.waitingFor) + this.postCraftingStatusChange( is.copy() ); } public void writeToNBT(NBTTagCompound data) { - data.setTag( "finalOutput", writeItem( finalOutput ) ); - data.setTag( "inventory", writeList( inventory.getItemList() ) ); - data.setBoolean( "waiting", waiting ); - data.setBoolean( "isComplete", isComplete ); + data.setTag( "finalOutput", this.writeItem( this.finalOutput ) ); + data.setTag( "inventory", this.writeList( this.inventory.getItemList() ) ); + data.setBoolean( "waiting", this.waiting ); + data.setBoolean( "isComplete", this.isComplete ); - if ( myLastLink != null ) + if ( this.myLastLink != null ) { NBTTagCompound link = new NBTTagCompound(); - myLastLink.writeToNBT( link ); + this.myLastLink.writeToNBT( link ); data.setTag( "link", link ); } NBTTagList list = new NBTTagList(); - for (Entry e : tasks.entrySet()) + for (Entry e : this.tasks.entrySet()) { - NBTTagCompound item = writeItem( AEItemStack.create( e.getKey().getPattern() ) ); + NBTTagCompound item = this.writeItem( AEItemStack.create( e.getKey().getPattern() ) ); item.setLong( "craftingProgress", e.getValue().value ); list.appendTag( item ); } data.setTag( "tasks", list ); - data.setTag( "waitingFor", writeList( waitingFor ) ); + data.setTag( "waitingFor", this.writeList( this.waitingFor ) ); } private IItemList readList(NBTTagList tag) @@ -1056,7 +1056,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU NBTTagList out = new NBTTagList(); for (IAEItemStack ais : myList) - out.appendTag( writeItem( ais ) ); + out.appendTag( this.writeItem( ais ) ); return out; } @@ -1073,44 +1073,44 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public void done() { - TileCraftingTile core = getCore(); + TileCraftingTile core = this.getCore(); core.isCoreBlock = true; if ( core.previousState != null ) { - readFromNBT( core.previousState ); + this.readFromNBT( core.previousState ); core.previousState = null; } - updateCPU(); - updateName(); + this.updateCPU(); + this.updateName(); } @Override public BaseActionSource getActionSource() { - return machineSrc; + return this.machineSrc; } @Override public String getName() { - return myName; + return this.myName; } public void updateName() { - myName = ""; - for (TileCraftingTile te : tiles) + this.myName = ""; + for (TileCraftingTile te : this.tiles) { if ( te.hasCustomName() ) { - if ( myName.length() > 0 ) - myName += ' ' + te.getCustomName(); + if ( this.myName.length() > 0 ) + this.myName += ' ' + te.getCustomName(); else - myName = te.getCustomName(); + this.myName = te.getCustomName(); } } @@ -1118,7 +1118,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public boolean isActive() { - TileCraftingTile core = getCore(); + TileCraftingTile core = this.getCore(); if ( core == null ) return false; @@ -1131,13 +1131,13 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU public boolean isMaking(IAEItemStack what) { - IAEItemStack wat = waitingFor.findPrecise( what ); + IAEItemStack wat = this.waitingFor.findPrecise( what ); return wat != null && wat.getStackSize() > 0; } public void breakCluster() { - TileCraftingTile t = getCore(); + TileCraftingTile t = this.getCore(); if ( t != null ) t.breakCluster(); } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java index 9b56f2f14..0566bc9df 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java @@ -35,7 +35,7 @@ public class QuantumCalculator extends MBCalculator public QuantumCalculator(IAEMultiBlock t) { super( t ); - tqb = (TileQuantumBridge) t; + this.tqb = (TileQuantumBridge) t; } @Override @@ -85,7 +85,7 @@ public class QuantumCalculator extends MBCalculator else { if ( num == 1 || num == 3 || num == 7 || num == 9 ) - flags = (byte) (tqb.corner | num); + flags = (byte) (this.tqb.corner | num); else flags = num; c.Ring[ringNum++] = te; @@ -107,7 +107,7 @@ public class QuantumCalculator extends MBCalculator @Override public void disconnect() { - tqb.disconnect(true); + this.tqb.disconnect(true); } @Override diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 6778f3e60..a0a1ed567 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -61,20 +61,20 @@ public class QuantumCluster implements ILocatable, IAECluster @Override public Iterator getTiles() { - return new ChainedIterator( Ring[0], Ring[1], Ring[2], Ring[3], Ring[4], Ring[5], Ring[6], Ring[7], center ); + return new ChainedIterator( this.Ring[0], this.Ring[1], this.Ring[2], this.Ring[3], this.Ring[4], this.Ring[5], this.Ring[6], this.Ring[7], this.center ); } public void setCenter(TileQuantumBridge c) { - registered = true; + this.registered = true; MinecraftForge.EVENT_BUS.register( this ); - center = c; + this.center = c; } public QuantumCluster(WorldCoord _min, WorldCoord _max) { - min = _min; - max = _max; - Ring = new TileQuantumBridge[8]; + this.min = _min; + this.max = _max; + this.Ring = new TileQuantumBridge[8]; } public boolean canUseNode(long qe) @@ -102,10 +102,10 @@ public class QuantumCluster implements ILocatable, IAECluster @SubscribeEvent public void onUnload(WorldEvent.Unload e) { - if ( center.getWorldObj() == e.world ) + if ( this.center.getWorldObj() == e.world ) { - updateStatus = false; - destroy(); + this.updateStatus = false; + this.destroy(); } } @@ -114,24 +114,24 @@ public class QuantumCluster implements ILocatable, IAECluster { long qe; - qe = center.getQEFrequency(); + qe = this.center.getQEFrequency(); - if ( thisSide != qe && thisSide != -qe ) + if ( this.thisSide != qe && this.thisSide != -qe ) { if ( qe != 0 ) { - if ( thisSide != 0 ) + if ( this.thisSide != 0 ) MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); - if ( canUseNode( -qe ) ) + if ( this.canUseNode( -qe ) ) { - otherSide = qe; - thisSide = -qe; + this.otherSide = qe; + this.thisSide = -qe; } - else if ( canUseNode( qe ) ) + else if ( this.canUseNode( qe ) ) { - thisSide = qe; - otherSide = -qe; + this.thisSide = qe; + this.otherSide = -qe; } MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Register ) ); @@ -140,12 +140,12 @@ public class QuantumCluster implements ILocatable, IAECluster { MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); - otherSide = 0; - thisSide = 0; + this.otherSide = 0; + this.thisSide = 0; } } - Object myOtherSide = otherSide == 0 ? null : AEApi.instance().registries().locatable().findLocatableBySerial( otherSide ); + Object myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().findLocatableBySerial( this.otherSide ); boolean shutdown = false; @@ -156,10 +156,10 @@ public class QuantumCluster implements ILocatable, IAECluster if ( sideA.isActive() && sideB.isActive() ) { - if ( connection != null && connection.connection != null ) + if ( this.connection != null && this.connection.connection != null ) { - IGridNode a = connection.connection.a(); - IGridNode b = connection.connection.b(); + IGridNode a = this.connection.connection.a(); + IGridNode b = this.connection.connection.b(); IGridNode sa = sideA.getNode(); IGridNode sb = sideB.getNode(); if ( (a == sa || b == sa) && (a == sb || b == sb) ) @@ -199,13 +199,13 @@ public class QuantumCluster implements ILocatable, IAECluster else shutdown = true; - if ( shutdown && connection != null ) + if ( shutdown && this.connection != null ) { - if ( connection.connection != null ) + if ( this.connection.connection != null ) { - connection.connection.destroy(); - connection.connection = null; - connection = new ConnectionWrapper( null ); + this.connection.connection.destroy(); + this.connection.connection = null; + this.connection = new ConnectionWrapper( null ); } } } @@ -213,65 +213,65 @@ public class QuantumCluster implements ILocatable, IAECluster @Override public void destroy() { - if ( isDestroyed ) + if ( this.isDestroyed ) return; - isDestroyed = true; + this.isDestroyed = true; - if ( registered ) + if ( this.registered ) { MinecraftForge.EVENT_BUS.unregister( this ); - registered = false; + this.registered = false; } - if ( getLocatableSerial() != 0 ) + if ( this.getLocatableSerial() != 0 ) { - updateStatus( true ); + this.updateStatus( true ); MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); } - center.updateStatus( null, (byte) -1, updateStatus ); + this.center.updateStatus( null, (byte) -1, this.updateStatus ); - for (TileQuantumBridge r : Ring) + for (TileQuantumBridge r : this.Ring) { - r.updateStatus( null, (byte) -1, updateStatus ); + r.updateStatus( null, (byte) -1, this.updateStatus ); } - center = null; - Ring = new TileQuantumBridge[8]; + this.center = null; + this.Ring = new TileQuantumBridge[8]; } public boolean isCorner(TileQuantumBridge tileQuantumBridge) { - return Ring[0] == tileQuantumBridge || Ring[2] == tileQuantumBridge || Ring[4] == tileQuantumBridge || Ring[6] == tileQuantumBridge; + return this.Ring[0] == tileQuantumBridge || this.Ring[2] == tileQuantumBridge || this.Ring[4] == tileQuantumBridge || this.Ring[6] == tileQuantumBridge; } @Override public long getLocatableSerial() { - return thisSide; + return this.thisSide; } public TileQuantumBridge getCenter() { - return center; + return this.center; } public boolean hasQES() { - return getLocatableSerial() != 0; + return this.getLocatableSerial() != 0; } private IGridNode getNode() { - return center.getGridNode( ForgeDirection.UNKNOWN ); + return this.center.getGridNode( ForgeDirection.UNKNOWN ); } private boolean isActive() { - if ( isDestroyed || !registered ) + if ( this.isDestroyed || !this.registered ) return false; - return center.isPowered() && hasQES(); + return this.center.isPowered() && this.hasQES(); } } diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java index d08447a91..54a8be5ad 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java @@ -34,7 +34,7 @@ public class SpatialPylonCalculator extends MBCalculator public SpatialPylonCalculator(IAEMultiBlock t) { super( t ); - tqb = (TileSpatialPylon) t; + this.tqb = (TileSpatialPylon) t; } @Override @@ -78,7 +78,7 @@ public class SpatialPylonCalculator extends MBCalculator @Override public void disconnect() { - tqb.disconnect(true); + this.tqb.disconnect(true); } @Override diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java index 8ce5aedaa..38ee6265c 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java @@ -47,23 +47,23 @@ public class SpatialPylonCluster implements IAECluster public boolean hasChannel; public SpatialPylonCluster(DimensionalCoord _min, DimensionalCoord _max) { - min = _min.copy(); - max = _max.copy(); + this.min = _min.copy(); + this.max = _max.copy(); - if ( min.x != max.x ) - currentAxis = Axis.X; - else if ( min.y != max.y ) - currentAxis = Axis.Y; - else if ( min.z != max.z ) - currentAxis = Axis.Z; + if ( this.min.x != this.max.x ) + this.currentAxis = Axis.X; + else if ( this.min.y != this.max.y ) + this.currentAxis = Axis.Y; + else if ( this.min.z != this.max.z ) + this.currentAxis = Axis.Z; else - currentAxis = Axis.UNFORMED; + this.currentAxis = Axis.UNFORMED; } @Override public void updateStatus(boolean updateGrid) { - for (TileSpatialPylon r : line) + for (TileSpatialPylon r : this.line) { r.recalculateDisplay(); } @@ -73,11 +73,11 @@ public class SpatialPylonCluster implements IAECluster public void destroy() { - if ( isDestroyed ) + if ( this.isDestroyed ) return; - isDestroyed = true; + this.isDestroyed = true; - for (TileSpatialPylon r : line) + for (TileSpatialPylon r : this.line) { r.updateStatus( null ); } @@ -86,13 +86,13 @@ public class SpatialPylonCluster implements IAECluster public int tileCount() { - return line.size(); + return this.line.size(); } @Override public Iterator getTiles() { - return (Iterator) line.iterator(); + return (Iterator) this.line.iterator(); } } diff --git a/src/main/java/appeng/me/energy/EnergyThreshold.java b/src/main/java/appeng/me/energy/EnergyThreshold.java index 870e899c5..f5079df2a 100644 --- a/src/main/java/appeng/me/energy/EnergyThreshold.java +++ b/src/main/java/appeng/me/energy/EnergyThreshold.java @@ -29,25 +29,25 @@ public class EnergyThreshold implements Comparable final int hash; public EnergyThreshold(double lim, IEnergyWatcher wat) { - Limit = lim; - watcher = wat; + this.Limit = lim; + this.watcher = wat; - if ( watcher != null ) - hash = watcher.hashCode() ^ ((Double) lim).hashCode(); + if ( this.watcher != null ) + this.hash = this.watcher.hashCode() ^ ((Double) lim).hashCode(); else - hash = ((Double) lim).hashCode(); + this.hash = ((Double) lim).hashCode(); } @Override public int hashCode() { - return hash; + return this.hash; } @Override public int compareTo(EnergyThreshold o) { - return ItemSorters.compareDouble( Limit, o.Limit ); + return ItemSorters.compareDouble( this.Limit, o.Limit ); } } diff --git a/src/main/java/appeng/me/energy/EnergyWatcher.java b/src/main/java/appeng/me/energy/EnergyWatcher.java index 1775e90a2..5859d6e2f 100644 --- a/src/main/java/appeng/me/energy/EnergyWatcher.java +++ b/src/main/java/appeng/me/energy/EnergyWatcher.java @@ -40,28 +40,28 @@ public class EnergyWatcher implements IEnergyWatcher EnergyThreshold myLast; public EnergyWatcherIterator(EnergyWatcher parent, Iterator i) { - watcher = parent; - interestIterator = i; + this.watcher = parent; + this.interestIterator = i; } @Override public boolean hasNext() { - return interestIterator.hasNext(); + return this.interestIterator.hasNext(); } @Override public Double next() { - myLast = interestIterator.next(); - return myLast.Limit; + this.myLast = this.interestIterator.next(); + return this.myLast.Limit; } @Override public void remove() { - gsc.interests.remove( myLast ); - interestIterator.remove(); + EnergyWatcher.this.gsc.interests.remove( this.myLast ); + this.interestIterator.remove(); } } @@ -72,27 +72,27 @@ public class EnergyWatcher implements IEnergyWatcher public void post(EnergyGridCache energyGridCache) { - myObject.onThresholdPass( energyGridCache ); + this.myObject.onThresholdPass( energyGridCache ); } public EnergyWatcher(EnergyGridCache cache, IEnergyWatcherHost host) { - gsc = cache; - myObject = host; + this.gsc = cache; + this.myObject = host; } public IEnergyWatcherHost getHost() { - return myObject; + return this.myObject; } @Override public boolean add(Double e) { - if ( myInterests.contains( e ) ) + if ( this.myInterests.contains( e ) ) return false; EnergyThreshold eh = new EnergyThreshold( e, this ); - return gsc.interests.add( eh ) && myInterests.add( eh ); + return this.gsc.interests.add( eh ) && this.myInterests.add( eh ); } @Override @@ -101,7 +101,7 @@ public class EnergyWatcher implements IEnergyWatcher boolean didChange = false; for (Double o : c) - didChange = add( o ) || didChange; + didChange = this.add( o ) || didChange; return didChange; } @@ -109,10 +109,10 @@ public class EnergyWatcher implements IEnergyWatcher @Override public void clear() { - Iterator i = myInterests.iterator(); + Iterator i = this.myInterests.iterator(); while (i.hasNext()) { - gsc.interests.remove( i.next() ); + this.gsc.interests.remove( i.next() ); i.remove(); } } @@ -120,32 +120,32 @@ public class EnergyWatcher implements IEnergyWatcher @Override public boolean contains(Object o) { - return myInterests.contains( o ); + return this.myInterests.contains( o ); } @Override public boolean containsAll(Collection c) { - return myInterests.containsAll( c ); + return this.myInterests.containsAll( c ); } @Override public boolean isEmpty() { - return myInterests.isEmpty(); + return this.myInterests.isEmpty(); } @Override public Iterator iterator() { - return new EnergyWatcherIterator( this, myInterests.iterator() ); + return new EnergyWatcherIterator( this, this.myInterests.iterator() ); } @Override public boolean remove(Object o) { EnergyThreshold eh = new EnergyThreshold( (Double) o, this ); - return myInterests.remove( eh ) && gsc.interests.remove( eh ); + return this.myInterests.remove( eh ) && this.gsc.interests.remove( eh ); } @Override @@ -153,7 +153,7 @@ public class EnergyWatcher implements IEnergyWatcher { boolean didSomething = false; for (Object o : c) - didSomething = remove( o ) || didSomething; + didSomething = this.remove( o ) || didSomething; return didSomething; } @@ -161,7 +161,7 @@ public class EnergyWatcher implements IEnergyWatcher public boolean retainAll(Collection c) { boolean changed = false; - Iterator i = iterator(); + Iterator i = this.iterator(); while (i.hasNext()) { @@ -178,19 +178,19 @@ public class EnergyWatcher implements IEnergyWatcher @Override public int size() { - return myInterests.size(); + return this.myInterests.size(); } @Override public Object[] toArray() { - return myInterests.toArray(); + return this.myInterests.toArray(); } @Override public T[] toArray(T[] a) { - return myInterests.toArray( a ); + return this.myInterests.toArray( a ); } } diff --git a/src/main/java/appeng/me/helpers/AENetworkProxy.java b/src/main/java/appeng/me/helpers/AENetworkProxy.java index f0946613a..74ce499ba 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxy.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxy.java @@ -75,60 +75,60 @@ public class AENetworkProxy implements IGridBlock @Override public ItemStack getMachineRepresentation() { - return myRepInstance; + return this.myRepInstance; } public void setVisualRepresentation(ItemStack is) { - myRepInstance = is; + this.myRepInstance = is; } public AENetworkProxy(IGridProxyable te, String nbtName, ItemStack visual, boolean inWorld) { this.gp = te; this.nbtName = nbtName; - worldNode = inWorld; - myRepInstance = visual; - validSides = EnumSet.allOf( ForgeDirection.class ); + this.worldNode = inWorld; + this.myRepInstance = visual; + this.validSides = EnumSet.allOf( ForgeDirection.class ); } public void writeToNBT(NBTTagCompound tag) { - if ( node != null ) - node.saveToNBT( nbtName, tag ); + if ( this.node != null ) + this.node.saveToNBT( this.nbtName, tag ); } public void readFromNBT(NBTTagCompound tag) { - data = tag; - if ( node != null && data != null ) + this.data = tag; + if ( this.node != null && this.data != null ) { - node.loadFromNBT( nbtName, data ); - data = null; + this.node.loadFromNBT( this.nbtName, this.data ); + this.data = null; } - else if ( node != null && owner != null ) + else if ( this.node != null && this.owner != null ) { - node.setPlayerID( WorldSettings.getInstance().getPlayerID( owner.getGameProfile() ) ); - owner = null; + this.node.setPlayerID( WorldSettings.getInstance().getPlayerID( this.owner.getGameProfile() ) ); + this.owner = null; } } @Override public DimensionalCoord getLocation() { - return gp.getLocation(); + return this.gp.getLocation(); } @Override public AEColor getGridColor() { - return myColor; + return this.myColor; } @Override public void onGridNotification(GridNotification notification) { - if ( gp instanceof PartCable ) - ((PartCable) gp).markForUpdate(); + if ( this.gp instanceof PartCable ) + ((PartCable) this.gp).markForUpdate(); } @Override @@ -140,69 +140,69 @@ public class AENetworkProxy implements IGridBlock @Override public EnumSet getConnectableSides() { - return validSides; + return this.validSides; } public void setValidSides(EnumSet validSides) { this.validSides = validSides; - if ( node != null ) - node.updateState(); + if ( this.node != null ) + this.node.updateState(); } public IGridNode getNode() { - if ( node == null && Platform.isServer() && isReady ) + if ( this.node == null && Platform.isServer() && this.isReady ) { - node = AEApi.instance().createGridNode( this ); - readFromNBT( data ); - node.updateState(); + this.node = AEApi.instance().createGridNode( this ); + this.readFromNBT( this.data ); + this.node.updateState(); } - return node; + return this.node; } public void validate() { - if ( gp instanceof AEBaseTile ) - TickHandler.instance.addInit( (AEBaseTile) gp ); + if ( this.gp instanceof AEBaseTile ) + TickHandler.instance.addInit( (AEBaseTile) this.gp ); } public void onChunkUnload() { - isReady = false; - invalidate(); + this.isReady = false; + this.invalidate(); } public void invalidate() { - isReady = false; - if ( node != null ) + this.isReady = false; + if ( this.node != null ) { - node.destroy(); - node = null; + this.node.destroy(); + this.node = null; } } public void onReady() { - isReady = true; + this.isReady = true; // send orientation based directionality to the node. - if ( gp instanceof IOrientable ) + if ( this.gp instanceof IOrientable ) { - IOrientable ori = (IOrientable) gp; + IOrientable ori = (IOrientable) this.gp; if ( ori.canBeRotated() ) ori.setOrientation( ori.getForward(), ori.getUp() ); } - getNode(); + this.getNode(); } @Override public IGridHost getMachine() { - return gp; + return this.gp; } /** @@ -213,9 +213,9 @@ public class AENetworkProxy implements IGridBlock */ public IGrid getGrid() throws GridAccessException { - if ( node == null ) + if ( this.node == null ) throw new GridAccessException(); - IGrid grid = node.getGrid(); + IGrid grid = this.node.getGrid(); if ( grid == null ) throw new GridAccessException(); return grid; @@ -223,7 +223,7 @@ public class AENetworkProxy implements IGridBlock public IEnergyGrid getEnergy() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); @@ -234,7 +234,7 @@ public class AENetworkProxy implements IGridBlock public IPathingGrid getPath() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); IPathingGrid pg = grid.getCache( IPathingGrid.class ); @@ -245,7 +245,7 @@ public class AENetworkProxy implements IGridBlock public ITickManager getTick() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); ITickManager pg = grid.getCache( ITickManager.class ); @@ -256,7 +256,7 @@ public class AENetworkProxy implements IGridBlock public IStorageGrid getStorage() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); @@ -270,7 +270,7 @@ public class AENetworkProxy implements IGridBlock public P2PCache getP2P() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); @@ -284,7 +284,7 @@ public class AENetworkProxy implements IGridBlock public ISecurityGrid getSecurity() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); @@ -298,7 +298,7 @@ public class AENetworkProxy implements IGridBlock public ICraftingGrid getCrafting() throws GridAccessException { - IGrid grid = getGrid(); + IGrid grid = this.getGrid(); if ( grid == null ) throw new GridAccessException(); @@ -313,13 +313,13 @@ public class AENetworkProxy implements IGridBlock @Override public boolean isWorldAccessible() { - return worldNode; + return this.worldNode; } @Override public EnumSet getFlags() { - return flags; + return this.flags; } public void setFlags(GridFlags... requireChannel) @@ -334,19 +334,19 @@ public class AENetworkProxy implements IGridBlock @Override public double getIdlePowerUsage() { - return idleDraw; + return this.idleDraw; } public void setIdlePowerUsage(double idle) { - idleDraw = idle; + this.idleDraw = idle; - if ( node != null ) + if ( this.node != null ) { try { - IGrid g = getGrid(); - g.postEvent( new MENetworkPowerIdleChange( node ) ); + IGrid g = this.getGrid(); + g.postEvent( new MENetworkPowerIdleChange( this.node ) ); } catch (GridAccessException e) { @@ -357,22 +357,22 @@ public class AENetworkProxy implements IGridBlock public boolean isReady() { - return isReady; + return this.isReady; } public boolean isActive() { - if ( node == null ) + if ( this.node == null ) return false; - return node.isActive(); + return this.node.isActive(); } public boolean isPowered() { try { - return getEnergy().isNetworkPowered(); + return this.getEnergy().isNetworkPowered(); } catch (GridAccessException e) { @@ -383,12 +383,12 @@ public class AENetworkProxy implements IGridBlock @Override public void gridChanged() { - gp.gridChanged(); + this.gp.gridChanged(); } public void setOwner(EntityPlayer player) { - owner = player; + this.owner = player; } } diff --git a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java index eb85aad26..2a2f9e034 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java @@ -33,7 +33,7 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul IAECluster getCluster() { - return ((IAEMultiBlock) getMachine()).getCluster(); + return ((IAEMultiBlock) this.getMachine()).getCluster(); } public AENetworkProxyMultiblock(IGridProxyable te, String nbtName, ItemStack itemStack, boolean inWorld) { @@ -43,9 +43,9 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul @Override public Iterator getMultiblockNodes() { - if ( getCluster() == null ) + if ( this.getCluster() == null ) return new ChainedIterator(); - return new ProxyNodeIterator( getCluster().getTiles() ); + return new ProxyNodeIterator( this.getCluster().getTiles() ); } } diff --git a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java index 55c56e191..2c83ea6b7 100644 --- a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java +++ b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java @@ -30,15 +30,15 @@ public class ChannelPowerSrc implements IEnergySource final IEnergySource realSrc; public ChannelPowerSrc(IGridNode networkNode, IEnergySource src) { - node = networkNode; - realSrc = src; + this.node = networkNode; + this.realSrc = src; } @Override public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) { - if ( node.isActive() ) - return realSrc.extractAEPower( amt, mode, usePowerMultiplier ); + if ( this.node.isActive() ) + return this.realSrc.extractAEPower( amt, mode, usePowerMultiplier ); return 0.0; } diff --git a/src/main/java/appeng/me/helpers/GenericInterestManager.java b/src/main/java/appeng/me/helpers/GenericInterestManager.java index 6aa32e1a5..ed89d512b 100644 --- a/src/main/java/appeng/me/helpers/GenericInterestManager.java +++ b/src/main/java/appeng/me/helpers/GenericInterestManager.java @@ -36,9 +36,9 @@ public class GenericInterestManager public final T iw; public SavedTransactions(boolean putOperation, IAEStack myStack, T watcher) { - put = putOperation; - stack = myStack; - iw = watcher; + this.put = putOperation; + this.stack = myStack; + this.iw = watcher; } } @@ -47,66 +47,66 @@ public class GenericInterestManager private int transDepth = 0; public GenericInterestManager(Multimap interests) { - container = interests; + this.container = interests; } public void enableTransactions() { - if ( transDepth == 0 ) - transactions = new LinkedList(); + if ( this.transDepth == 0 ) + this.transactions = new LinkedList(); - transDepth++; + this.transDepth++; } public void disableTransactions() { - transDepth--; + this.transDepth--; - if ( transDepth == 0 ) + if ( this.transDepth == 0 ) { - LinkedList myActions = transactions; - transactions = null; + LinkedList myActions = this.transactions; + this.transactions = null; for (SavedTransactions t : myActions) { if ( t.put ) - put( t.stack, t.iw ); + this.put( t.stack, t.iw ); else - remove( t.stack, t.iw ); + this.remove( t.stack, t.iw ); } } } public boolean containsKey(IAEStack stack) { - return container.containsKey( stack ); + return this.container.containsKey( stack ); } public Collection get(IAEStack stack) { - return container.get( stack ); + return this.container.get( stack ); } public boolean put(IAEStack stack, T iw) { - if ( transactions != null ) + if ( this.transactions != null ) { - transactions.add( new SavedTransactions( true, stack, iw ) ); + this.transactions.add( new SavedTransactions( true, stack, iw ) ); return true; } else - return container.put( stack, iw ); + return this.container.put( stack, iw ); } public boolean remove(IAEStack stack, T iw) { - if ( transactions != null ) + if ( this.transactions != null ) { - transactions.add( new SavedTransactions( true, stack, iw ) ); + this.transactions.add( new SavedTransactions( true, stack, iw ) ); return true; } else - return container.remove( stack, iw ); + return this.container.remove( stack, iw ); } } diff --git a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java index 1ccb44846..ff79db10a 100644 --- a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java @@ -30,7 +30,7 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor final private int usedChannels; public AdHocChannelUpdater(int used) { - usedChannels = used; + this.usedChannels = used; } @Override @@ -38,7 +38,7 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor { GridNode gn = (GridNode) n; gn.setControllerRoute( null, true ); - gn.incrementChannelCount( usedChannels ); + gn.incrementChannelCount( this.usedChannels ); gn.finalizeChannels(); return true; } @@ -48,7 +48,7 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor { GridConnection gc = (GridConnection) gcc; gc.setControllerRoute( null, true ); - gc.incrementChannelCount( usedChannels ); + gc.incrementChannelCount( this.usedChannels ); gc.finalizeChannels(); } } diff --git a/src/main/java/appeng/me/pathfinding/ControllerValidator.java b/src/main/java/appeng/me/pathfinding/ControllerValidator.java index b509981b4..a1f7a5e70 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerValidator.java +++ b/src/main/java/appeng/me/pathfinding/ControllerValidator.java @@ -38,40 +38,40 @@ public class ControllerValidator implements IGridVisitor public int found = 0; public ControllerValidator(int x, int y, int z) { - minX = x; - minY = y; - minZ = z; - maxX = x; - maxY = y; - maxZ = z; + this.minX = x; + this.minY = y; + this.minZ = z; + this.maxX = x; + this.maxY = y; + this.maxZ = z; } @Override public boolean visitNode(IGridNode n) { IGridHost host = n.getMachine(); - if ( isValid && host instanceof TileController ) + if ( this.isValid && host instanceof TileController ) { TileController c = (TileController) host; - minX = Math.min( c.xCoord, minX ); - maxX = Math.max( c.xCoord, maxX ); - minY = Math.min( c.yCoord, minY ); - maxY = Math.max( c.yCoord, maxY ); - minZ = Math.min( c.zCoord, minZ ); - maxZ = Math.max( c.zCoord, maxZ ); + this.minX = Math.min( c.xCoord, this.minX ); + this.maxX = Math.max( c.xCoord, this.maxX ); + this.minY = Math.min( c.yCoord, this.minY ); + this.maxY = Math.max( c.yCoord, this.maxY ); + this.minZ = Math.min( c.zCoord, this.minZ ); + this.maxZ = Math.max( c.zCoord, this.maxZ ); - if ( maxX - minX < 7 && maxY - minY < 7 && maxZ - minZ < 7 ) + if ( this.maxX - this.minX < 7 && this.maxY - this.minY < 7 && this.maxZ - this.minZ < 7 ) { - found++; + this.found++; return true; } - isValid = false; + this.isValid = false; } else return false; - return isValid; + return this.isValid; } } diff --git a/src/main/java/appeng/me/pathfinding/PathSegment.java b/src/main/java/appeng/me/pathfinding/PathSegment.java index 91eb9f4b3..0b073d3cf 100644 --- a/src/main/java/appeng/me/pathfinding/PathSegment.java +++ b/src/main/java/appeng/me/pathfinding/PathSegment.java @@ -41,8 +41,8 @@ public class PathSegment this.open = open; this.semiOpen = semiOpen; this.closed = closed; - pgc = myPGC; - isDead = false; + this.pgc = myPGC; + this.isDead = false; } List open; @@ -51,8 +51,8 @@ public class PathSegment public boolean step() { - List oldOpen = open; - open = new LinkedList(); + List oldOpen = this.open; + this.open = new LinkedList(); for (IPathItem i : oldOpen) { @@ -60,21 +60,21 @@ public class PathSegment { EnumSet flags = pi.getFlags(); - if ( !closed.contains( pi ) ) + if ( !this.closed.contains( pi ) ) { pi.setControllerRoute( i, true ); if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { // close the semi open. - if ( !semiOpen.contains( pi ) ) + if ( !this.semiOpen.contains( pi ) ) { boolean worked; if ( flags.contains( GridFlags.COMPRESSED_CHANNEL ) ) - worked = useDenseChannel( pi ); + worked = this.useDenseChannel( pi ); else - worked = useChannel( pi ); + worked = this.useChannel( pi ); if ( worked && flags.contains( GridFlags.MULTIBLOCK ) ) { @@ -83,24 +83,24 @@ public class PathSegment { IGridNode otherNodes = oni.next(); if ( otherNodes != pi ) - semiOpen.add( (IPathItem) otherNodes ); + this.semiOpen.add( (IPathItem) otherNodes ); } } } else { pi.incrementChannelCount( 1 ); // give a channel. - semiOpen.remove( pi ); + this.semiOpen.remove( pi ); } } - closed.add( pi ); - open.add( pi ); + this.closed.add( pi ); + this.open.add( pi ); } } } - return open.isEmpty(); + return this.open.isEmpty(); } private boolean useChannel(IPathItem start) @@ -117,12 +117,12 @@ public class PathSegment pi = start; while (pi != null) { - pgc.channelsByBlocks++; + this.pgc.channelsByBlocks++; pi.incrementChannelCount( 1 ); pi = pi.getControllerRoute(); } - pgc.channelsInUse++; + this.pgc.channelsInUse++; return true; } @@ -140,12 +140,12 @@ public class PathSegment pi = start; while (pi != null) { - pgc.channelsByBlocks++; + this.pgc.channelsByBlocks++; pi.incrementChannelCount( 1 ); pi = pi.getControllerRoute(); } - pgc.channelsInUse++; + this.pgc.channelsInUse++; return true; } diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index e738571a9..3dd35d48a 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -69,29 +69,29 @@ public class CellInventory implements ICellInventory final protected ISaveProvider container; protected CellInventory(NBTTagCompound data, ISaveProvider container) { - tagCompound = data; + this.tagCompound = data; this.container = container; } protected void loadCellItems() { - if ( cellItems == null ) - cellItems = AEApi.instance().storage().createItemList(); + if ( this.cellItems == null ) + this.cellItems = AEApi.instance().storage().createItemList(); - cellItems.resetStatus(); // clears totals and stuff. + this.cellItems.resetStatus(); // clears totals and stuff. - int types = (int) getStoredItemTypes(); + int types = (int) this.getStoredItemTypes(); for (int x = 0; x < types; x++) { - ItemStack t = ItemStack.loadItemStackFromNBT( tagCompound.getCompoundTag( ITEM_SLOT_ARR[x] ) ); + ItemStack t = ItemStack.loadItemStackFromNBT( this.tagCompound.getCompoundTag( ITEM_SLOT_ARR[x] ) ); if ( t != null ) { - t.stackSize = tagCompound.getInteger( ITEM_SLOT_COUNT_ARR[x] ); + t.stackSize = this.tagCompound.getInteger( ITEM_SLOT_COUNT_ARR[x] ); if ( t.stackSize > 0 ) { - cellItems.add( AEItemStack.create( t ) ); + this.cellItems.add( AEItemStack.create( t ) ); } } } @@ -106,11 +106,11 @@ public class CellInventory implements ICellInventory // add new pretty stuff... int x = 0; - for (IAEItemStack v : cellItems) + for (IAEItemStack v : this.cellItems) { itemCount += v.getStackSize(); - NBTBase c = tagCompound.getTag( ITEM_SLOT_ARR[x] ); + NBTBase c = this.tagCompound.getTag( ITEM_SLOT_ARR[x] ); if ( c instanceof NBTTagCompound ) { v.writeToNBT( (NBTTagCompound) c ); @@ -119,21 +119,21 @@ public class CellInventory implements ICellInventory { NBTTagCompound g = new NBTTagCompound(); v.writeToNBT( g ); - tagCompound.setTag( ITEM_SLOT_ARR[x], g ); + this.tagCompound.setTag( ITEM_SLOT_ARR[x], g ); } /* * NBTBase tagSlotCount = tagCompound.getTag( ITEM_SLOT_COUNT_ARR[x] ); if ( tagSlotCount instanceof * NBTTagInt ) ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else */ - tagCompound.setInteger( ITEM_SLOT_COUNT_ARR[x], (int) v.getStackSize() ); + this.tagCompound.setInteger( ITEM_SLOT_COUNT_ARR[x], (int) v.getStackSize() ); x++; } // NBTBase tagType = tagCompound.getTag( ITEM_TYPE_TAG ); // NBTBase tagCount = tagCompound.getTag( ITEM_COUNT_TAG ); - short oldStoredItems = storedItems; + short oldStoredItems = this.storedItems; /* * if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size(); @@ -163,23 +163,23 @@ public class CellInventory implements ICellInventory } // clean any old crusty stuff... - for (; x < oldStoredItems && x < MAX_ITEM_TYPES; x++) + for (; x < oldStoredItems && x < this.MAX_ITEM_TYPES; x++) { - tagCompound.removeTag( ITEM_SLOT_ARR[x] ); - tagCompound.removeTag( ITEM_SLOT_COUNT_ARR[x] ); + this.tagCompound.removeTag( ITEM_SLOT_ARR[x] ); + this.tagCompound.removeTag( ITEM_SLOT_COUNT_ARR[x] ); } - if ( container != null ) - container.saveChanges( this ); + if ( this.container != null ) + this.container.saveChanges( this ); } protected CellInventory(ItemStack o, ISaveProvider container) throws AppEngException { if ( ITEM_SLOT_ARR == null ) { - ITEM_SLOT_ARR = new String[MAX_ITEM_TYPES]; - ITEM_SLOT_COUNT_ARR = new String[MAX_ITEM_TYPES]; + ITEM_SLOT_ARR = new String[this.MAX_ITEM_TYPES]; + ITEM_SLOT_COUNT_ARR = new String[this.MAX_ITEM_TYPES]; - for (int x = 0; x < MAX_ITEM_TYPES; x++) + for (int x = 0; x < this.MAX_ITEM_TYPES; x++) { ITEM_SLOT_ARR[x] = ITEM_SLOT + x; ITEM_SLOT_COUNT_ARR[x] = ITEM_SLOT_COUNT + x; @@ -191,60 +191,60 @@ public class CellInventory implements ICellInventory throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); } - CellType = null; - i = o; + this.CellType = null; + this.i = o; - Item type = i.getItem(); + Item type = this.i.getItem(); if ( type instanceof IStorageCell ) { - CellType = (IStorageCell) i.getItem(); - MAX_ITEM_TYPES = CellType.getTotalTypes( i ); + this.CellType = (IStorageCell) this.i.getItem(); + this.MAX_ITEM_TYPES = this.CellType.getTotalTypes( this.i ); } - if ( CellType == null ) + if ( this.CellType == null ) { throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); } - if ( !CellType.isStorageCell( i ) ) + if ( !this.CellType.isStorageCell( this.i ) ) { throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); } - if ( MAX_ITEM_TYPES > 63 ) - MAX_ITEM_TYPES = 63; - if ( MAX_ITEM_TYPES < 1 ) - MAX_ITEM_TYPES = 1; + if ( this.MAX_ITEM_TYPES > 63 ) + this.MAX_ITEM_TYPES = 63; + if ( this.MAX_ITEM_TYPES < 1 ) + this.MAX_ITEM_TYPES = 1; this.container = container; - tagCompound = Platform.openNbtData( o ); - storedItems = tagCompound.getShort( ITEM_TYPE_TAG ); - storedItemCount = tagCompound.getInteger( ITEM_COUNT_TAG ); - cellItems = null; + this.tagCompound = Platform.openNbtData( o ); + this.storedItems = this.tagCompound.getShort( ITEM_TYPE_TAG ); + this.storedItemCount = this.tagCompound.getInteger( ITEM_COUNT_TAG ); + this.cellItems = null; } IItemList getCellItems() { - if ( cellItems == null ) + if ( this.cellItems == null ) { - cellItems = AEApi.instance().storage().createItemList(); - loadCellItems(); + this.cellItems = AEApi.instance().storage().createItemList(); + this.loadCellItems(); } - return cellItems; + return this.cellItems; } @Override public int getBytesPerType() { - return CellType.BytePerType( i ); + return this.CellType.BytePerType( this.i ); } @Override public boolean canHoldNewItem() { - long bytesFree = getFreeBytes(); - return (bytesFree > getBytesPerType() || (bytesFree == getBytesPerType() && getUnusedItemCount() > 0)) && getRemainingItemTypes() > 0; + long bytesFree = this.getFreeBytes(); + return (bytesFree > this.getBytesPerType() || (bytesFree == this.getBytesPerType() && this.getUnusedItemCount() > 0)) && this.getRemainingItemTypes() > 0; } public static IMEInventoryHandler getCell(ItemStack o, ISaveProvider container2) @@ -301,64 +301,64 @@ public class CellInventory implements ICellInventory @Override public long getTotalBytes() { - return CellType.getBytes( i ); + return this.CellType.getBytes( this.i ); } @Override public long getFreeBytes() { - return getTotalBytes() - getUsedBytes(); + return this.getTotalBytes() - this.getUsedBytes(); } @Override public long getUsedBytes() { - long bytesForItemCount = (getStoredItemCount() + getUnusedItemCount()) / 8; - return getStoredItemTypes() * getBytesPerType() + bytesForItemCount; + long bytesForItemCount = (this.getStoredItemCount() + this.getUnusedItemCount()) / 8; + return this.getStoredItemTypes() * this.getBytesPerType() + bytesForItemCount; } @Override public long getTotalItemTypes() { - return MAX_ITEM_TYPES; + return this.MAX_ITEM_TYPES; } @Override public long getStoredItemTypes() { - return storedItems; + return this.storedItems; } @Override public long getStoredItemCount() { - return storedItemCount; + return this.storedItemCount; } private void updateItemCount(long delta) { - tagCompound.setInteger( ITEM_COUNT_TAG, storedItemCount = (int) (storedItemCount + delta) ); + this.tagCompound.setInteger( ITEM_COUNT_TAG, this.storedItemCount = (int) (this.storedItemCount + delta) ); } @Override public long getRemainingItemTypes() { - long basedOnStorage = getFreeBytes() / getBytesPerType(); - long baseOnTotal = getTotalItemTypes() - getStoredItemTypes(); + long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); + long baseOnTotal = this.getTotalItemTypes() - this.getStoredItemTypes(); return basedOnStorage > baseOnTotal ? baseOnTotal : basedOnStorage; } @Override public long getRemainingItemCount() { - long remaining = getFreeBytes() * 8 + getUnusedItemCount(); + long remaining = this.getFreeBytes() * 8 + this.getUnusedItemCount(); return remaining > 0 ? remaining : 0; } @Override public int getUnusedItemCount() { - int div = (int) (getStoredItemCount() % 8); + int div = (int) (this.getStoredItemCount() % 8); if ( div == 0 ) { @@ -395,7 +395,7 @@ public class CellInventory implements ICellInventory if ( input.getStackSize() == 0 ) return null; - if ( isBlackListed( input ) || CellType.isBlackListed( i, input ) ) + if ( isBlackListed( input ) || this.CellType.isBlackListed( this.i, input ) ) return input; ItemStack sharedItemStack = input.getItemStack(); @@ -403,14 +403,14 @@ public class CellInventory implements ICellInventory if ( CellInventory.isStorageCell( sharedItemStack ) ) { IMEInventory meInventory = getCell( sharedItemStack, null ); - if ( meInventory != null && !isEmpty( meInventory ) ) + if ( meInventory != null && !this.isEmpty( meInventory ) ) return input; } - IAEItemStack l = getCellItems().findPrecise( input ); + IAEItemStack l = this.getCellItems().findPrecise( input ); if ( l != null ) { - long remainingItemSlots = getRemainingItemCount(); + long remainingItemSlots = this.getRemainingItemCount(); if ( remainingItemSlots < 0 ) return input; @@ -421,8 +421,8 @@ public class CellInventory implements ICellInventory if ( mode == Actionable.MODULATE ) { l.setStackSize( l.getStackSize() + remainingItemSlots ); - updateItemCount( remainingItemSlots ); - saveChanges(); + this.updateItemCount( remainingItemSlots ); + this.saveChanges(); } return r; } @@ -431,16 +431,16 @@ public class CellInventory implements ICellInventory if ( mode == Actionable.MODULATE ) { l.setStackSize( l.getStackSize() + input.getStackSize() ); - updateItemCount( input.getStackSize() ); - saveChanges(); + this.updateItemCount( input.getStackSize() ); + this.saveChanges(); } return null; } } - if ( canHoldNewItem() ) // room for new type, and for at least one item! + if ( this.canHoldNewItem() ) // room for new type, and for at least one item! { - int remainingItemCount = (int) getRemainingItemCount() - getBytesPerType() * 8; + int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * 8; if ( remainingItemCount > 0 ) { if ( input.getStackSize() > remainingItemCount ) @@ -452,19 +452,19 @@ public class CellInventory implements ICellInventory ItemStack toWrite = Platform.cloneItemStack( sharedItemStack ); toWrite.stackSize = remainingItemCount; - cellItems.add( AEItemStack.create( toWrite ) ); - updateItemCount( toWrite.stackSize ); + this.cellItems.add( AEItemStack.create( toWrite ) ); + this.updateItemCount( toWrite.stackSize ); - saveChanges(); + this.saveChanges(); } return AEItemStack.create( toReturn ); } if ( mode == Actionable.MODULATE ) { - updateItemCount( input.getStackSize() ); - cellItems.add( input ); - saveChanges(); + this.updateItemCount( input.getStackSize() ); + this.cellItems.add( input ); + this.saveChanges(); } return null; @@ -485,7 +485,7 @@ public class CellInventory implements ICellInventory IAEItemStack Results = null; - IAEItemStack l = getCellItems().findPrecise( request ); + IAEItemStack l = this.getCellItems().findPrecise( request ); if ( l != null ) { Results = l.copy(); @@ -495,9 +495,9 @@ public class CellInventory implements ICellInventory Results.setStackSize( l.getStackSize() ); if ( mode == Actionable.MODULATE ) { - updateItemCount( -l.getStackSize() ); + this.updateItemCount( -l.getStackSize() ); l.setStackSize( 0 ); - saveChanges(); + this.saveChanges(); } } else @@ -506,8 +506,8 @@ public class CellInventory implements ICellInventory if ( mode == Actionable.MODULATE ) { l.setStackSize( l.getStackSize() - size ); - updateItemCount( -size ); - saveChanges(); + this.updateItemCount( -size ); + this.saveChanges(); } } } @@ -518,7 +518,7 @@ public class CellInventory implements ICellInventory @Override public IItemList getAvailableItems(IItemList out) { - for (IAEItemStack i : getCellItems()) + for (IAEItemStack i : this.getCellItems()) out.add( i ); return out; @@ -533,33 +533,33 @@ public class CellInventory implements ICellInventory @Override public double getIdleDrain() { - return CellType.getIdleDrain(); + return this.CellType.getIdleDrain(); } @Override public FuzzyMode getFuzzyMode() { - return CellType.getFuzzyMode( this.i ); + return this.CellType.getFuzzyMode( this.i ); } @Override public IInventory getConfigInventory() { - return CellType.getConfigInventory( this.i ); + return this.CellType.getConfigInventory( this.i ); } @Override public IInventory getUpgradesInventory() { - return CellType.getUpgradesInventory( this.i ); + return this.CellType.getUpgradesInventory( this.i ); } @Override public int getStatusForCell() { - if ( canHoldNewItem() ) + if ( this.canHoldNewItem() ) return 1; - if ( getRemainingItemCount() > 0 ) + if ( this.getRemainingItemCount() > 0 ) return 2; return 3; } @@ -567,7 +567,7 @@ public class CellInventory implements ICellInventory @Override public ItemStack getItemStack() { - return i; + return this.i; } } diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index a87ed5891..f3639acef 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -42,7 +42,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple NBTTagCompound openNbtData() { - return Platform.openNbtData( getCellInv().getItemStack() ); + return Platform.openNbtData( this.getCellInv().getItemStack() ); } @Override @@ -59,7 +59,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple CellInventoryHandler(IMEInventory c) { super( c, StorageChannel.ITEMS ); - ICellInventory ci = getCellInv(); + ICellInventory ci = this.getCellInv(); if ( ci != null ) { IItemList priorityList = AEApi.instance().storage().createItemList(); @@ -100,14 +100,14 @@ public class CellInventoryHandler extends MEInventoryHandler imple priorityList.add( AEItemStack.create( is ) ); } - myWhitelist = hasInverter ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; + this.myWhitelist = hasInverter ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; if ( !priorityList.isEmpty() ) { if ( hasFuzzy ) - myPartitionList = new FuzzyPriorityList( priorityList, fzMode ); + this.myPartitionList = new FuzzyPriorityList( priorityList, fzMode ); else - myPartitionList = new PrecisePriorityList( priorityList ); + this.myPartitionList = new PrecisePriorityList( priorityList ); } } } @@ -115,26 +115,26 @@ public class CellInventoryHandler extends MEInventoryHandler imple @Override public boolean isPreformatted() { - return ! myPartitionList.isEmpty(); + return ! this.myPartitionList.isEmpty(); } @Override public boolean isFuzzy() { - return myPartitionList instanceof FuzzyPriorityList; + return this.myPartitionList instanceof FuzzyPriorityList; } @Override public IncludeExclude getIncludeExcludeMode() { - return myWhitelist; + return this.myWhitelist; } public int getStatusForCell() { - int val = getCellInv().getStatusForCell(); + int val = this.getCellInv().getStatusForCell(); - if ( val == 1 && isPreformatted() ) + if ( val == 1 && this.isPreformatted() ) val = 2; return val; diff --git a/src/main/java/appeng/me/storage/CreativeCellInventory.java b/src/main/java/appeng/me/storage/CreativeCellInventory.java index 988627d39..055bab454 100644 --- a/src/main/java/appeng/me/storage/CreativeCellInventory.java +++ b/src/main/java/appeng/me/storage/CreativeCellInventory.java @@ -48,14 +48,14 @@ public class CreativeCellInventory implements IMEInventoryHandler { IAEItemStack i = AEItemStack.create( is ); i.setStackSize( Integer.MAX_VALUE ); - itemListCache.add( i ); + this.itemListCache.add( i ); } } @Override public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src) { - IAEItemStack local = itemListCache.findPrecise( input ); + IAEItemStack local = this.itemListCache.findPrecise( input ); if ( local == null ) return input; @@ -65,7 +65,7 @@ public class CreativeCellInventory implements IMEInventoryHandler @Override public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) { - IAEItemStack local = itemListCache.findPrecise( request ); + IAEItemStack local = this.itemListCache.findPrecise( request ); if ( local == null ) return null; @@ -75,7 +75,7 @@ public class CreativeCellInventory implements IMEInventoryHandler @Override public IItemList getAvailableItems(IItemList out) { - for (IAEItemStack ais : itemListCache) + for (IAEItemStack ais : this.itemListCache) out.add( ais ); return out; } @@ -95,13 +95,13 @@ public class CreativeCellInventory implements IMEInventoryHandler @Override public boolean isPrioritized(IAEItemStack input) { - return itemListCache.findPrecise( input ) != null; + return this.itemListCache.findPrecise( input ) != null; } @Override public boolean canAccept(IAEItemStack input) { - return itemListCache.findPrecise( input ) != null; + return this.itemListCache.findPrecise( input ) != null; } @Override diff --git a/src/main/java/appeng/me/storage/DriveWatcher.java b/src/main/java/appeng/me/storage/DriveWatcher.java index 1d37e97c3..2a4686e05 100644 --- a/src/main/java/appeng/me/storage/DriveWatcher.java +++ b/src/main/java/appeng/me/storage/DriveWatcher.java @@ -37,8 +37,8 @@ public class DriveWatcher> extends MEInventoryHandler public DriveWatcher(IMEInventory i, ItemStack is, ICellHandler han, IChestOrDrive cod) { super( i, i.getChannel() ); this.is = is; - handler = han; - cord = cod; + this.handler = han; + this.cord = cod; } @Override @@ -50,11 +50,11 @@ public class DriveWatcher> extends MEInventoryHandler if ( a == null || a.getStackSize() != size ) { - int newStatus = handler.getStatusForCell( is, getInternal() ); + int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); - if ( newStatus != oldStatus ) + if ( newStatus != this.oldStatus ) { - cord.blinkCell( getSlot() ); + this.cord.blinkCell( this.getSlot() ); } } @@ -68,11 +68,11 @@ public class DriveWatcher> extends MEInventoryHandler if ( a != null ) { - int newStatus = handler.getStatusForCell( is, getInternal() ); + int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); - if ( newStatus != oldStatus ) + if ( newStatus != this.oldStatus ) { - cord.blinkCell( getSlot() ); + this.cord.blinkCell( this.getSlot() ); } } diff --git a/src/main/java/appeng/me/storage/ItemWatcher.java b/src/main/java/appeng/me/storage/ItemWatcher.java index 82c64d343..64933fe27 100644 --- a/src/main/java/appeng/me/storage/ItemWatcher.java +++ b/src/main/java/appeng/me/storage/ItemWatcher.java @@ -41,27 +41,27 @@ public class ItemWatcher implements IStackWatcher IAEStack myLast; public ItemWatcherIterator(ItemWatcher parent, Iterator i) { - watcher = parent; - interestIterator = i; + this.watcher = parent; + this.interestIterator = i; } @Override public boolean hasNext() { - return interestIterator.hasNext(); + return this.interestIterator.hasNext(); } @Override public IAEStack next() { - return myLast = interestIterator.next(); + return this.myLast = this.interestIterator.next(); } @Override public void remove() { - gsc.interestManager.remove( myLast, watcher ); - interestIterator.remove(); + ItemWatcher.this.gsc.interestManager.remove( this.myLast, this.watcher ); + this.interestIterator.remove(); } } @@ -71,22 +71,22 @@ public class ItemWatcher implements IStackWatcher final HashSet myInterests = new HashSet(); public ItemWatcher(GridStorageCache cache, IStackWatcherHost host) { - gsc = cache; - myObject = host; + this.gsc = cache; + this.myObject = host; } public IStackWatcherHost getHost() { - return myObject; + return this.myObject; } @Override public boolean add(IAEStack e) { - if ( myInterests.contains( e ) ) + if ( this.myInterests.contains( e ) ) return false; - return myInterests.add( e.copy() ) && gsc.interestManager.put( e, this ); + return this.myInterests.add( e.copy() ) && this.gsc.interestManager.put( e, this ); } @Override @@ -95,7 +95,7 @@ public class ItemWatcher implements IStackWatcher boolean didChange = false; for (IAEStack o : c) - didChange = add( o ) || didChange; + didChange = this.add( o ) || didChange; return didChange; } @@ -103,10 +103,10 @@ public class ItemWatcher implements IStackWatcher @Override public void clear() { - Iterator i = myInterests.iterator(); + Iterator i = this.myInterests.iterator(); while (i.hasNext()) { - gsc.interestManager.remove( i.next(), this ); + this.gsc.interestManager.remove( i.next(), this ); i.remove(); } } @@ -114,31 +114,31 @@ public class ItemWatcher implements IStackWatcher @Override public boolean contains(Object o) { - return myInterests.contains( o ); + return this.myInterests.contains( o ); } @Override public boolean containsAll(Collection c) { - return myInterests.containsAll( c ); + return this.myInterests.containsAll( c ); } @Override public boolean isEmpty() { - return myInterests.isEmpty(); + return this.myInterests.isEmpty(); } @Override public Iterator iterator() { - return new ItemWatcherIterator( this, myInterests.iterator() ); + return new ItemWatcherIterator( this, this.myInterests.iterator() ); } @Override public boolean remove(Object o) { - return myInterests.remove( o ) && gsc.interestManager.remove( (IAEStack)o, this ); + return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack)o, this ); } @Override @@ -146,7 +146,7 @@ public class ItemWatcher implements IStackWatcher { boolean didSomething = false; for (Object o : c) - didSomething = remove( o ) || didSomething; + didSomething = this.remove( o ) || didSomething; return didSomething; } @@ -154,7 +154,7 @@ public class ItemWatcher implements IStackWatcher public boolean retainAll(Collection c) { boolean changed = false; - Iterator i = iterator(); + Iterator i = this.iterator(); while (i.hasNext()) { @@ -171,19 +171,19 @@ public class ItemWatcher implements IStackWatcher @Override public int size() { - return myInterests.size(); + return this.myInterests.size(); } @Override public Object[] toArray() { - return myInterests.toArray(); + return this.myInterests.toArray(); } @Override public T[] toArray(T[] a) { - return myInterests.toArray( a ); + return this.myInterests.toArray( a ); } } diff --git a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java index ecd9642af..a69a2093b 100644 --- a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java +++ b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java @@ -37,8 +37,8 @@ public class MEIInventoryWrapper implements IMEInventory protected final InventoryAdaptor adaptor; public MEIInventoryWrapper(IInventory m, InventoryAdaptor ia) { - target = m; - adaptor = ia; + this.target = m; + this.adaptor = ia; } @Override @@ -52,9 +52,9 @@ public class MEIInventoryWrapper implements IMEInventory { ItemStack input = iox.getItemStack(); - if ( adaptor != null ) + if ( this.adaptor != null ) { - ItemStack is = mode == Actionable.SIMULATE ? adaptor.simulateAdd( input ) : adaptor.addItems( input ); + ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd( input ) : this.adaptor.addItems( input ); if ( is == null ) return null; return AEItemStack.create( is ); @@ -64,20 +64,20 @@ public class MEIInventoryWrapper implements IMEInventory if ( mode == Actionable.MODULATE ) // absolutely no need for a first run in simulate mode. { - for (int x = 0; x < target.getSizeInventory(); x++) + for (int x = 0; x < this.target.getSizeInventory(); x++) { - ItemStack t = target.getStackInSlot( x ); + ItemStack t = this.target.getStackInSlot( x ); if ( Platform.isSameItem( t, input ) ) { int oriStack = t.stackSize; t.stackSize += out.stackSize; - target.setInventorySlotContents( x, t ); + this.target.setInventorySlotContents( x, t ); - if ( t.stackSize > target.getInventoryStackLimit() ) + if ( t.stackSize > this.target.getInventoryStackLimit() ) { - t.stackSize = target.getInventoryStackLimit(); + t.stackSize = this.target.getInventoryStackLimit(); } if ( t.stackSize > t.getMaxStackSize() ) @@ -95,23 +95,23 @@ public class MEIInventoryWrapper implements IMEInventory } } - for (int x = 0; x < target.getSizeInventory(); x++) + for (int x = 0; x < this.target.getSizeInventory(); x++) { - ItemStack t = target.getStackInSlot( x ); + ItemStack t = this.target.getStackInSlot( x ); if ( t == null ) { t = Platform.cloneItemStack( input ); t.stackSize = out.stackSize; - if ( t.stackSize > target.getInventoryStackLimit() ) + if ( t.stackSize > this.target.getInventoryStackLimit() ) { - t.stackSize = target.getInventoryStackLimit(); + t.stackSize = this.target.getInventoryStackLimit(); } out.stackSize -= t.stackSize; if ( mode == Actionable.MODULATE ) - target.setInventorySlotContents( x, t ); + this.target.setInventorySlotContents( x, t ); if ( out.stackSize <= 0 ) { @@ -138,9 +138,9 @@ public class MEIInventoryWrapper implements IMEInventory Req.stackSize = request_stackSize; - if ( adaptor != null ) + if ( this.adaptor != null ) { - Gathered = adaptor.removeItems( Req.stackSize, Req, null ); + Gathered = this.adaptor.removeItems( Req.stackSize, Req, null ); } else { @@ -148,9 +148,9 @@ public class MEIInventoryWrapper implements IMEInventory Gathered.stackSize = 0; // try to find matching inventories that already have it... - for (int x = 0; x < target.getSizeInventory(); x++) + for (int x = 0; x < this.target.getSizeInventory(); x++) { - ItemStack sub = target.getStackInSlot( x ); + ItemStack sub = this.target.getStackInSlot( x ); if ( Platform.isSameItem( sub, Req ) ) { @@ -174,9 +174,9 @@ public class MEIInventoryWrapper implements IMEInventory } if ( sub.stackSize <= 0 ) - target.setInventorySlotContents( x, null ); + this.target.setInventorySlotContents( x, null ); else - target.setInventorySlotContents( x, sub ); + this.target.setInventorySlotContents( x, sub ); if ( retrieved != null ) { @@ -204,9 +204,9 @@ public class MEIInventoryWrapper implements IMEInventory @Override public IItemList getAvailableItems(IItemList out) { - for (int x = 0; x < target.getSizeInventory(); x++) + for (int x = 0; x < this.target.getSizeInventory(); x++) { - out.addStorage( AEItemStack.create( target.getStackInSlot( x ) ) ); + out.addStorage( AEItemStack.create( this.target.getStackInSlot( x ) ) ); } return out; diff --git a/src/main/java/appeng/me/storage/MEInventoryHandler.java b/src/main/java/appeng/me/storage/MEInventoryHandler.java index 9ede80715..556e2ac93 100644 --- a/src/main/java/appeng/me/storage/MEInventoryHandler.java +++ b/src/main/java/appeng/me/storage/MEInventoryHandler.java @@ -47,11 +47,11 @@ public class MEInventoryHandler> implements IMEInventoryHa this.channel = channel; if ( i instanceof IMEInventoryHandler ) - internal = (IMEInventoryHandler) i; + this.internal = (IMEInventoryHandler) i; else - internal = new MEPassThrough( i, channel ); + this.internal = new MEPassThrough( i, channel ); - monitor = internal instanceof IMEMonitor ? (IMEMonitor) internal : null; + this.monitor = this.internal instanceof IMEMonitor ? (IMEMonitor) this.internal : null; } @Override @@ -60,75 +60,75 @@ public class MEInventoryHandler> implements IMEInventoryHa if ( !this.canAccept( input ) ) return input; - return internal.injectItems( input, type, src ); + return this.internal.injectItems( input, type, src ); } @Override public T extractItems(T request, Actionable type, BaseActionSource src) { - if ( !getAccess().hasPermission( AccessRestriction.READ ) ) + if ( !this.getAccess().hasPermission( AccessRestriction.READ ) ) return null; - return internal.extractItems( request, type, src ); + return this.internal.extractItems( request, type, src ); } @Override public IItemList getAvailableItems(IItemList out) { - if ( !getAccess().hasPermission( AccessRestriction.READ ) ) + if ( !this.getAccess().hasPermission( AccessRestriction.READ ) ) return out; - return internal.getAvailableItems( out ); + return this.internal.getAvailableItems( out ); } @Override public StorageChannel getChannel() { - return internal.getChannel(); + return this.internal.getChannel(); } @Override public AccessRestriction getAccess() { - return myAccess.restrictPermissions( internal.getAccess() ); + return this.myAccess.restrictPermissions( this.internal.getAccess() ); } @Override public boolean isPrioritized(T input) { - if ( myWhitelist == IncludeExclude.WHITELIST ) - return myPartitionList.isListed( input ) || internal.isPrioritized( input ); + if ( this.myWhitelist == IncludeExclude.WHITELIST ) + return this.myPartitionList.isListed( input ) || this.internal.isPrioritized( input ); return false; } @Override public boolean canAccept(T input) { - if ( !getAccess().hasPermission( AccessRestriction.WRITE ) ) + if ( !this.getAccess().hasPermission( AccessRestriction.WRITE ) ) return false; - if ( myWhitelist == IncludeExclude.BLACKLIST && myPartitionList.isListed( input ) ) + if ( this.myWhitelist == IncludeExclude.BLACKLIST && this.myPartitionList.isListed( input ) ) return false; - if ( myPartitionList.isEmpty() || myWhitelist == IncludeExclude.BLACKLIST ) - return internal.canAccept( input ); - return myPartitionList.isListed( input ) && internal.canAccept( input ); + if ( this.myPartitionList.isEmpty() || this.myWhitelist == IncludeExclude.BLACKLIST ) + return this.internal.canAccept( input ); + return this.myPartitionList.isListed( input ) && this.internal.canAccept( input ); } @Override public int getPriority() { - return myPriority; + return this.myPriority; } @Override public int getSlot() { - return internal.getSlot(); + return this.internal.getSlot(); } public IMEInventory getInternal() { - return internal; + return this.internal; } @Override diff --git a/src/main/java/appeng/me/storage/MEMonitorIInventory.java b/src/main/java/appeng/me/storage/MEMonitorIInventory.java index e97c53be8..eff69de7a 100644 --- a/src/main/java/appeng/me/storage/MEMonitorIInventory.java +++ b/src/main/java/appeng/me/storage/MEMonitorIInventory.java @@ -52,13 +52,13 @@ public class MEMonitorIInventory implements IMEMonitor { if ( is == null ) { - itemStack = null; - aeStack = null; + this.itemStack = null; + this.aeStack = null; } else { - itemStack = is.copy(); - aeStack = AEApi.instance().storage().createItemStack( is ); + this.itemStack = is.copy(); + this.aeStack = AEApi.instance().storage().createItemStack( is ); } } @@ -78,19 +78,19 @@ public class MEMonitorIInventory implements IMEMonitor @Override public void addListener(IMEMonitorHandlerReceiver l, Object verificationToken) { - listeners.put( l, verificationToken ); + this.listeners.put( l, verificationToken ); } @Override public void removeListener(IMEMonitorHandlerReceiver l) { - listeners.remove( l ); + this.listeners.remove( l ); } public MEMonitorIInventory(InventoryAdaptor adaptor) { this.adaptor = adaptor; - memory = new ConcurrentSkipListMap(); + this.memory = new ConcurrentSkipListMap(); } @Override @@ -99,11 +99,11 @@ public class MEMonitorIInventory implements IMEMonitor ItemStack out = null; if ( type == Actionable.SIMULATE ) - out = adaptor.simulateAdd( input.getItemStack() ); + out = this.adaptor.simulateAdd( input.getItemStack() ); else - out = adaptor.addItems( input.getItemStack() ); + out = this.adaptor.addItems( input.getItemStack() ); - onTick(); + this.onTick(); if ( out == null ) return null; @@ -147,13 +147,13 @@ public class MEMonitorIInventory implements IMEMonitor @Override public IItemList getStorageList() { - return list; + return this.list; } @Override public IItemList getAvailableItems(IItemList out) { - for (CachedItemStack is : memory.values()) + for (CachedItemStack is : this.memory.values()) out.addStorage( is.aeStack ); return out; @@ -165,9 +165,9 @@ public class MEMonitorIInventory implements IMEMonitor ItemStack out = null; if ( type == Actionable.SIMULATE ) - out = adaptor.simulateRemove( (int) request.getStackSize(), request.getItemStack(), null ); + out = this.adaptor.simulateRemove( (int) request.getStackSize(), request.getItemStack(), null ); else - out = adaptor.removeItems( (int) request.getStackSize(), request.getItemStack(), null ); + out = this.adaptor.removeItems( (int) request.getStackSize(), request.getItemStack(), null ); if ( out == null ) return null; @@ -176,7 +176,7 @@ public class MEMonitorIInventory implements IMEMonitor IAEItemStack o = request.copy(); o.setStackSize( out.stackSize ); - onTick(); + this.onTick(); return o; } @@ -188,19 +188,19 @@ public class MEMonitorIInventory implements IMEMonitor LinkedList changes = new LinkedList(); int high = 0; - list.resetStatus(); - for (ItemSlot is : adaptor) + this.list.resetStatus(); + for (ItemSlot is : this.adaptor) { - CachedItemStack old = memory.get( is.slot ); + CachedItemStack old = this.memory.get( is.slot ); high = Math.max( high, is.slot ); - ItemStack newIS = !is.isExtractable && mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); + ItemStack newIS = !is.isExtractable && this.mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); ItemStack oldIS = old == null ? null : old.itemStack; - if ( isDifferent( newIS, oldIS ) ) + if ( this.isDifferent( newIS, oldIS ) ) { CachedItemStack cis = new CachedItemStack( is.getItemStack() ); - memory.put( is.slot, cis ); + this.memory.put( is.slot, cis ); if ( old != null && old.aeStack != null ) { @@ -211,7 +211,7 @@ public class MEMonitorIInventory implements IMEMonitor if ( cis.aeStack != null ) { changes.add( cis.aeStack ); - list.add( cis.aeStack ); + this.list.add( cis.aeStack ); } changed = true; @@ -225,13 +225,13 @@ public class MEMonitorIInventory implements IMEMonitor if ( stack != null ) { stack.setStackSize( newSize ); - list.add( stack ); + this.list.add( stack ); } if ( diff != 0 && stack != null ) { CachedItemStack cis = new CachedItemStack( is.getItemStack() ); - memory.put( is.slot, cis ); + this.memory.put( is.slot, cis ); IAEItemStack a = stack.copy(); a.setStackSize( diff ); @@ -242,7 +242,7 @@ public class MEMonitorIInventory implements IMEMonitor } // detect dropped items; should fix non IISided Inventory Changes. - NavigableMap end = memory.tailMap( high, false ); + NavigableMap end = this.memory.tailMap( high, false ); if ( !end.isEmpty() ) { for (CachedItemStack cis : end.values()) @@ -259,7 +259,7 @@ public class MEMonitorIInventory implements IMEMonitor } if ( !changes.isEmpty() ) - postDifference( changes ); + this.postDifference( changes ); return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER; } @@ -280,13 +280,13 @@ public class MEMonitorIInventory implements IMEMonitor // AELog.info( a.getItemStack().getUnlocalizedName() + " @ " + a.getStackSize() ); if ( a != null ) { - Iterator, Object>> i = listeners.entrySet().iterator(); + Iterator, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { Entry, Object> l = i.next(); IMEMonitorHandlerReceiver key = l.getKey(); if ( key.isValid( l.getValue() ) ) - key.postChange( this, a, mySource ); + key.postChange( this, a, this.mySource ); else i.remove(); } diff --git a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java index d90893453..b697e9164 100644 --- a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java +++ b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java @@ -44,30 +44,30 @@ public class MEMonitorPassThrough> extends MEPassThrough i, StorageChannel channel) { super( i, channel ); if ( i instanceof IMEMonitor ) - monitor = (IMEMonitor) i; + this.monitor = (IMEMonitor) i; } @Override public void setInternal(IMEInventory i) { - if ( monitor != null ) - monitor.removeListener( this ); + if ( this.monitor != null ) + this.monitor.removeListener( this ); - monitor = null; - IItemList before = getInternal() == null ? channel.createList() : getInternal() - .getAvailableItems( new ItemListIgnoreCrafting( channel.createList() ) ); + this.monitor = null; + IItemList before = this.getInternal() == null ? this.channel.createList() : this.getInternal() + .getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); super.setInternal( i ); if ( i instanceof IMEMonitor ) - monitor = (IMEMonitor) i; + this.monitor = (IMEMonitor) i; - IItemList after = getInternal() == null ? channel.createList() : getInternal() - .getAvailableItems( new ItemListIgnoreCrafting( channel.createList() ) ); + IItemList after = this.getInternal() == null ? this.channel.createList() : this.getInternal() + .getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); - if ( monitor != null ) - monitor.addListener( this, monitor ); + if ( this.monitor != null ) + this.monitor.addListener( this, this.monitor ); - Platform.postListChanges( before, after, this, changeSource ); + Platform.postListChanges( before, after, this, this.changeSource ); } @Override @@ -80,37 +80,37 @@ public class MEMonitorPassThrough> extends MEPassThrough l, Object verificationToken) { - listeners.put( l, verificationToken ); + this.listeners.put( l, verificationToken ); } @Override public void removeListener(IMEMonitorHandlerReceiver l) { - listeners.remove( l ); + this.listeners.remove( l ); } @Override public IItemList getStorageList() { - if ( monitor == null ) + if ( this.monitor == null ) { - IItemList out = channel.createList(); - getInternal().getAvailableItems( new ItemListIgnoreCrafting( out ) ); + IItemList out = this.channel.createList(); + this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } - return monitor.getStorageList(); + return this.monitor.getStorageList(); } @Override public boolean isValid(Object verificationToken) { - return verificationToken == monitor; + return verificationToken == this.monitor; } @Override public void postChange(IBaseMonitor monitor, Iterable change, BaseActionSource source) { - Iterator, Object>> i = listeners.entrySet().iterator(); + Iterator, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { Entry, Object> e = i.next(); @@ -125,7 +125,7 @@ public class MEMonitorPassThrough> extends MEPassThrough, Object>> i = listeners.entrySet().iterator(); + Iterator, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { Entry, Object> e = i.next(); diff --git a/src/main/java/appeng/me/storage/MEPassThrough.java b/src/main/java/appeng/me/storage/MEPassThrough.java index 886f5444c..2dd68f3b6 100644 --- a/src/main/java/appeng/me/storage/MEPassThrough.java +++ b/src/main/java/appeng/me/storage/MEPassThrough.java @@ -35,41 +35,41 @@ public class MEPassThrough> implements IMEInventoryHandler protected IMEInventory getInternal() { - return internal; + return this.internal; } public MEPassThrough(IMEInventory i, StorageChannel channel) { this.channel = channel; - setInternal( i ); + this.setInternal( i ); } public void setInternal(IMEInventory i) { - internal = i; + this.internal = i; } @Override public T injectItems(T input, Actionable type, BaseActionSource src) { - return internal.injectItems( input, type, src ); + return this.internal.injectItems( input, type, src ); } @Override public T extractItems(T request, Actionable type, BaseActionSource src) { - return internal.extractItems( request, type, src ); + return this.internal.extractItems( request, type, src ); } @Override public IItemList getAvailableItems(IItemList out) { - return internal.getAvailableItems( out ); + return this.internal.getAvailableItems( out ); } @Override public StorageChannel getChannel() { - return internal.getChannel(); + return this.internal.getChannel(); } @Override diff --git a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java index 5c1c84212..f42d9e7b2 100644 --- a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java +++ b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java @@ -62,17 +62,17 @@ public class NetworkInventoryHandler> implements IMEInvent private final NavigableMap>> priorityInventory; public NetworkInventoryHandler(StorageChannel chan, SecurityCache security) { - myChannel = chan; + this.myChannel = chan; this.security = security; - priorityInventory = new ConcurrentSkipListMap>>( prioritySorter ); // TreeMultimap.create( prioritySorter, hashSorter ); + this.priorityInventory = new ConcurrentSkipListMap>>( prioritySorter ); // TreeMultimap.create( prioritySorter, hashSorter ); } public void addNewStorage(IMEInventoryHandler h) { int priority = h.getPriority(); - List> list = priorityInventory.get( priority ); + List> list = this.priorityInventory.get( priority ); if ( list == null ) - priorityInventory.put( priority, list = new ArrayList>() ); + this.priorityInventory.put( priority, list = new ArrayList>() ); list.add( h ); } @@ -96,7 +96,7 @@ public class NetworkInventoryHandler> implements IMEInvent private boolean diveList(NetworkInventoryHandler networkInventoryHandler, Actionable type) { - LinkedList cDepth = getDepth( type ); + LinkedList cDepth = this.getDepth( type ); if ( cDepth.contains( networkInventoryHandler ) ) return true; @@ -106,18 +106,18 @@ public class NetworkInventoryHandler> implements IMEInvent private boolean diveIteration(NetworkInventoryHandler networkInventoryHandler, Actionable type) { - LinkedList cDepth = getDepth( type ); + LinkedList cDepth = this.getDepth( type ); if ( cDepth.isEmpty() ) { currentPass++; - myPass = currentPass; + this.myPass = currentPass; } else { - if ( currentPass == myPass ) + if ( currentPass == this.myPass ) return true; else - myPass = currentPass; + this.myPass = currentPass; } cDepth.push( this ); @@ -126,7 +126,7 @@ public class NetworkInventoryHandler> implements IMEInvent private void surface(NetworkInventoryHandler networkInventoryHandler, Actionable type) { - if ( getDepth( type ).pop() != this ) + if ( this.getDepth( type ).pop() != this ) throw new RuntimeException( "Invalid Access to Networked Storage API detected." ); } @@ -134,26 +134,26 @@ public class NetworkInventoryHandler> implements IMEInvent { if ( src.isPlayer() ) { - if ( !security.hasPermission( ((PlayerSource) src).player, permission ) ) + if ( !this.security.hasPermission( ((PlayerSource) src).player, permission ) ) return true; } else if ( src.isMachine() ) { - if ( security.isAvailable() ) + if ( this.security.isAvailable() ) { IGridNode n = ((MachineSource) src).via.getActionableNode(); if ( n == null ) return true; IGrid gn = n.getGrid(); - if ( gn != security.myGrid ) + if ( gn != this.security.myGrid ) { int playerID = -1; ISecurityGrid sg = gn.getCache( ISecurityGrid.class ); playerID = sg.getOwner(); - if ( !security.hasPermission( playerID, permission ) ) + if ( !this.security.hasPermission( playerID, permission ) ) return true; } } @@ -165,16 +165,16 @@ public class NetworkInventoryHandler> implements IMEInvent @Override public T injectItems(T input, Actionable type, BaseActionSource src) { - if ( diveList( this, type ) ) + if ( this.diveList( this, type ) ) return input; - if ( testPermission( src, SecurityPermissions.INJECT ) ) + if ( this.testPermission( src, SecurityPermissions.INJECT ) ) { - surface( this, type ); + this.surface( this, type ); return input; } - for (List> invList : priorityInventory.values()) + for (List> invList : this.priorityInventory.values()) { Iterator> ii = invList.iterator(); while (ii.hasNext() && input != null) @@ -199,7 +199,7 @@ public class NetworkInventoryHandler> implements IMEInvent } } - surface( this, type ); + this.surface( this, type ); return input; } @@ -207,16 +207,16 @@ public class NetworkInventoryHandler> implements IMEInvent @Override public T extractItems(T request, Actionable mode, BaseActionSource src) { - if ( diveList( this, mode ) ) + if ( this.diveList( this, mode ) ) return null; - if ( testPermission( src, SecurityPermissions.EXTRACT ) ) + if ( this.testPermission( src, SecurityPermissions.EXTRACT ) ) { - surface( this, mode ); + this.surface( this, mode ); return null; } - Iterator>> i = priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); + Iterator>> i = this.priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); T output = request.copy(); request = request.copy(); @@ -237,7 +237,7 @@ public class NetworkInventoryHandler> implements IMEInvent } } - surface( this, mode ); + this.surface( this, mode ); if ( output.getStackSize() <= 0 ) return null; @@ -248,15 +248,15 @@ public class NetworkInventoryHandler> implements IMEInvent @Override public IItemList getAvailableItems(IItemList out) { - if ( diveIteration( this, Actionable.SIMULATE ) ) + if ( this.diveIteration( this, Actionable.SIMULATE ) ) return out; // for (Entry> h : priorityInventory.entries()) - for (List> i : priorityInventory.values()) + for (List> i : this.priorityInventory.values()) for (IMEInventoryHandler j : i) out = j.getAvailableItems( out ); - surface( this, Actionable.SIMULATE ); + this.surface( this, Actionable.SIMULATE ); return out; } @@ -264,7 +264,7 @@ public class NetworkInventoryHandler> implements IMEInvent @Override public StorageChannel getChannel() { - return myChannel; + return this.myChannel; } @Override diff --git a/src/main/java/appeng/me/storage/SecurityInventory.java b/src/main/java/appeng/me/storage/SecurityInventory.java index 93901b7a6..8f9b4f626 100644 --- a/src/main/java/appeng/me/storage/SecurityInventory.java +++ b/src/main/java/appeng/me/storage/SecurityInventory.java @@ -41,7 +41,7 @@ public class SecurityInventory implements IMEInventoryHandler final public IItemList storedItems = AEApi.instance().storage().createItemList(); public SecurityInventory(TileSecurity ts) { - securityTile = ts; + this.securityTile = ts; } private boolean hasPermission(BaseActionSource src) @@ -50,7 +50,7 @@ public class SecurityInventory implements IMEInventoryHandler { try { - return securityTile.getProxy().getSecurity().hasPermission( ((PlayerSource) src).player, SecurityPermissions.SECURITY ); + return this.securityTile.getProxy().getSecurity().hasPermission( ((PlayerSource) src).player, SecurityPermissions.SECURITY ); } catch (GridAccessException e) { @@ -63,15 +63,15 @@ public class SecurityInventory implements IMEInventoryHandler @Override public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) { - if ( hasPermission( src ) && AEApi.instance().items().itemBiometricCard.sameAsStack( input.getItemStack() ) ) + if ( this.hasPermission( src ) && AEApi.instance().items().itemBiometricCard.sameAsStack( input.getItemStack() ) ) { - if ( canAccept( input ) ) + if ( this.canAccept( input ) ) { if ( type == Actionable.SIMULATE ) return null; - storedItems.add( input ); - securityTile.inventoryChanged(); + this.storedItems.add( input ); + this.securityTile.inventoryChanged(); return null; } } @@ -81,9 +81,9 @@ public class SecurityInventory implements IMEInventoryHandler @Override public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) { - if ( hasPermission( src ) ) + if ( this.hasPermission( src ) ) { - IAEItemStack target = storedItems.findPrecise( request ); + IAEItemStack target = this.storedItems.findPrecise( request ); if ( target != null ) { IAEItemStack output = target.copy(); @@ -92,7 +92,7 @@ public class SecurityInventory implements IMEInventoryHandler return output; target.setStackSize( 0 ); - securityTile.inventoryChanged(); + this.securityTile.inventoryChanged(); return output; } } @@ -102,7 +102,7 @@ public class SecurityInventory implements IMEInventoryHandler @Override public IItemList getAvailableItems(IItemList out) { - for (IAEItemStack ais : storedItems) + for (IAEItemStack ais : this.storedItems) out.add( ais ); return out; @@ -135,10 +135,10 @@ public class SecurityInventory implements IMEInventoryHandler GameProfile newUser = tbc.getProfile( input.getItemStack() ); int PlayerID = AEApi.instance().registries().players().getID( newUser ); - if ( securityTile.getOwner() == PlayerID ) + if ( this.securityTile.getOwner() == PlayerID ) return false; - for (IAEItemStack ais : storedItems) + for (IAEItemStack ais : this.storedItems) { if ( ais.isMeaningful() ) { diff --git a/src/main/java/appeng/me/storage/VoidFluidInventory.java b/src/main/java/appeng/me/storage/VoidFluidInventory.java index 2033cffcb..f951a1754 100644 --- a/src/main/java/appeng/me/storage/VoidFluidInventory.java +++ b/src/main/java/appeng/me/storage/VoidFluidInventory.java @@ -36,7 +36,7 @@ public class VoidFluidInventory implements IMEInventoryHandler public VoidFluidInventory( TileCondenser te ) { - target = te; + this.target = te; } @Override @@ -46,7 +46,7 @@ public class VoidFluidInventory implements IMEInventoryHandler return null; if ( input != null ) - target.addPower( input.getStackSize() / 1000.0 ); + this.target.addPower( input.getStackSize() / 1000.0 ); return null; } diff --git a/src/main/java/appeng/me/storage/VoidItemInventory.java b/src/main/java/appeng/me/storage/VoidItemInventory.java index 5fd12731e..c2e796f30 100644 --- a/src/main/java/appeng/me/storage/VoidItemInventory.java +++ b/src/main/java/appeng/me/storage/VoidItemInventory.java @@ -36,7 +36,7 @@ public class VoidItemInventory implements IMEInventoryHandler public VoidItemInventory( TileCondenser te ) { - target = te; + this.target = te; } @Override @@ -46,7 +46,7 @@ public class VoidItemInventory implements IMEInventoryHandler return null; if ( input != null ) - target.addPower( input.getStackSize() ); + this.target.addPower( input.getStackSize() ); return null; } diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index 8b79fd406..458f62d2d 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -82,8 +82,8 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea public AEBasePart(Class c, ItemStack is) { this.is = is; - proxy = new AENetworkProxy( this, "part", is, this instanceof PartCable ); - proxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.proxy = new AENetworkProxy( this, "part", is, this instanceof PartCable ); + this.proxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override @@ -117,11 +117,11 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea { if ( type == PartItemStack.Network ) { - ItemStack copy = is.copy(); + ItemStack copy = this.is.copy(); copy.setTagCompound( null ); return copy; } - return is; + return this.is; } @Override @@ -145,13 +145,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public void readFromNBT(NBTTagCompound data) { - proxy.readFromNBT( data ); + this.proxy.readFromNBT( data ); } @Override public void writeToNBT(NBTTagCompound data) { - proxy.writeToNBT( data ); + this.proxy.writeToNBT( data ); } @Override @@ -181,7 +181,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public IGridNode getGridNode() { - return proxy.getNode(); + return this.proxy.getNode(); } @Override @@ -193,13 +193,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public void removeFromWorld() { - proxy.invalidate(); + this.proxy.invalidate(); } @Override public void addToWorld() { - proxy.onReady(); + this.proxy.onReady(); } @Override @@ -212,7 +212,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea public IPartHost getHost() { - return host; + return this.host; } @Override @@ -224,20 +224,20 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public IGridNode getGridNode(ForgeDirection dir) { - return proxy.getNode(); + return this.proxy.getNode(); } protected AEColor getColor() { - if ( getHost() == null ) + if ( this.getHost() == null ) return AEColor.Transparent; - return getHost().getColor(); + return this.getHost().getColor(); } @Override public DimensionalCoord getLocation() { - return new DimensionalCoord( tile ); + return new DimensionalCoord( this.tile ); } @Override @@ -377,11 +377,11 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea { ItemStack memCardIS = player.inventory.getCurrentItem(); - if ( memCardIS != null && useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) + if ( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) { IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); - ItemStack is = getItemStack( PartItemStack.Network ); + ItemStack is = this.getItemStack( PartItemStack.Network ); // Blocks and parts share the same soul! if ( AEApi.instance().parts().partInterface.sameAsStack( is ) ) @@ -391,7 +391,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea if ( player.isSneaking() ) { - NBTTagCompound data = downloadSettings( SettingsFrom.MEMORY_CARD ); + NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD ); if ( data != null ) { memoryCard.setMemoryCardContents( memCardIS, name, data ); @@ -404,7 +404,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea NBTTagCompound data = memoryCard.getData( memCardIS ); if ( name.equals( storedName ) ) { - uploadSettings( SettingsFrom.MEMORY_CARD, data ); + this.uploadSettings( SettingsFrom.MEMORY_CARD, data ); memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); } else @@ -418,19 +418,19 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override final public boolean onActivate(EntityPlayer player, Vec3 pos) { - if ( useMemoryCard( player ) ) + if ( this.useMemoryCard( player ) ) return true; - return onPartActivate( player, pos ); + return this.onPartActivate( player, pos ); } @Override final public boolean onShiftActivate(EntityPlayer player, Vec3 pos) { - if ( useMemoryCard( player ) ) + if ( this.useMemoryCard( player ) ) return true; - return onPartShiftActivate( player, pos ); + return this.onPartShiftActivate( player, pos ); } public boolean onPartActivate(EntityPlayer player, Vec3 pos) @@ -446,38 +446,38 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side) { - proxy.setOwner( player ); + this.proxy.setOwner( player ); } @Override public TileEntity getTile() { - return tile; + return this.tile; } @Override public void securityBreak() { - if ( is.stackSize > 0 ) + if ( this.is.stackSize > 0 ) { List items = new ArrayList(); - items.add( is.copy() ); - host.removePart( side, false ); - Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items ); - is.stackSize = 0; + items.add( this.is.copy() ); + this.host.removePart( this.side, false ); + Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items ); + this.is.stackSize = 0; } } @Override public AENetworkProxy getProxy() { - return proxy; + return this.proxy; } @Override public IGridNode getActionableNode() { - return proxy.getNode(); + return this.proxy.getNode(); } @Override @@ -488,7 +488,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea public void saveChanges() { - host.markForSave(); + this.host.markForSave(); } @Override @@ -500,13 +500,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea @Override public String getCustomName() { - return is.getDisplayName(); + return this.is.getDisplayName(); } @Override public boolean hasCustomName() { - return is.hasDisplayName(); + return this.is.hasDisplayName(); } @Override @@ -518,6 +518,6 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea public void addEntityCrashInfo(CrashReportCategory crashreportcategory) { - crashreportcategory.addCrashSection( "Part Side", side ); + crashreportcategory.addCrashSection( "Part Side", this.side ); } } \ No newline at end of file diff --git a/src/main/java/appeng/parts/BusCollisionHelper.java b/src/main/java/appeng/parts/BusCollisionHelper.java index 41b0d211b..14fbd26d5 100644 --- a/src/main/java/appeng/parts/BusCollisionHelper.java +++ b/src/main/java/appeng/parts/BusCollisionHelper.java @@ -42,52 +42,52 @@ public class BusCollisionHelper implements IPartCollisionHelper this.x = x; this.y = y; this.z = z; - entity = e; - isVisual = visual; + this.entity = e; + this.isVisual = visual; } public BusCollisionHelper(List boxes, ForgeDirection s, Entity e, boolean visual) { this.boxes = boxes; - entity = e; - isVisual = visual; + this.entity = e; + this.isVisual = visual; switch (s) { case DOWN: - x = ForgeDirection.EAST; - y = ForgeDirection.NORTH; - z = ForgeDirection.DOWN; + this.x = ForgeDirection.EAST; + this.y = ForgeDirection.NORTH; + this.z = ForgeDirection.DOWN; break; case UP: - x = ForgeDirection.EAST; - y = ForgeDirection.SOUTH; - z = ForgeDirection.UP; + this.x = ForgeDirection.EAST; + this.y = ForgeDirection.SOUTH; + this.z = ForgeDirection.UP; break; case EAST: - x = ForgeDirection.SOUTH; - y = ForgeDirection.UP; - z = ForgeDirection.EAST; + this.x = ForgeDirection.SOUTH; + this.y = ForgeDirection.UP; + this.z = ForgeDirection.EAST; break; case WEST: - x = ForgeDirection.NORTH; - y = ForgeDirection.UP; - z = ForgeDirection.WEST; + this.x = ForgeDirection.NORTH; + this.y = ForgeDirection.UP; + this.z = ForgeDirection.WEST; break; case NORTH: - x = ForgeDirection.WEST; - y = ForgeDirection.UP; - z = ForgeDirection.NORTH; + this.x = ForgeDirection.WEST; + this.y = ForgeDirection.UP; + this.z = ForgeDirection.NORTH; break; case SOUTH: - x = ForgeDirection.EAST; - y = ForgeDirection.UP; - z = ForgeDirection.SOUTH; + this.x = ForgeDirection.EAST; + this.y = ForgeDirection.UP; + this.z = ForgeDirection.SOUTH; break; case UNKNOWN: default: - x = ForgeDirection.EAST; - y = ForgeDirection.UP; - z = ForgeDirection.SOUTH; + this.x = ForgeDirection.EAST; + this.y = ForgeDirection.UP; + this.z = ForgeDirection.SOUTH; break; } } @@ -95,7 +95,7 @@ public class BusCollisionHelper implements IPartCollisionHelper @Override public boolean isBBCollision() { - return !isVisual; + return !this.isVisual; } /** @@ -103,7 +103,7 @@ public class BusCollisionHelper implements IPartCollisionHelper */ public Entity getEntity() { - return entity; + return this.entity; } @Override @@ -116,27 +116,27 @@ public class BusCollisionHelper implements IPartCollisionHelper maxY /= 16.0; maxZ /= 16.0; - double aX = minX * x.offsetX + minY * y.offsetX + minZ * z.offsetX; - double aY = minX * x.offsetY + minY * y.offsetY + minZ * z.offsetY; - double aZ = minX * x.offsetZ + minY * y.offsetZ + minZ * z.offsetZ; + double aX = minX * this.x.offsetX + minY * this.y.offsetX + minZ * this.z.offsetX; + double aY = minX * this.x.offsetY + minY * this.y.offsetY + minZ * this.z.offsetY; + double aZ = minX * this.x.offsetZ + minY * this.y.offsetZ + minZ * this.z.offsetZ; - double bX = maxX * x.offsetX + maxY * y.offsetX + maxZ * z.offsetX; - double bY = maxX * x.offsetY + maxY * y.offsetY + maxZ * z.offsetY; - double bZ = maxX * x.offsetZ + maxY * y.offsetZ + maxZ * z.offsetZ; + double bX = maxX * this.x.offsetX + maxY * this.y.offsetX + maxZ * this.z.offsetX; + double bY = maxX * this.x.offsetY + maxY * this.y.offsetY + maxZ * this.z.offsetY; + double bZ = maxX * this.x.offsetZ + maxY * this.y.offsetZ + maxZ * this.z.offsetZ; - if ( x.offsetX + y.offsetX + z.offsetX < 0 ) + if ( this.x.offsetX + this.y.offsetX + this.z.offsetX < 0 ) { aX += 1; bX += 1; } - if ( x.offsetY + y.offsetY + z.offsetY < 0 ) + if ( this.x.offsetY + this.y.offsetY + this.z.offsetY < 0 ) { aY += 1; bY += 1; } - if ( x.offsetZ + y.offsetZ + z.offsetZ < 0 ) + if ( this.x.offsetZ + this.y.offsetZ + this.z.offsetZ < 0 ) { aZ += 1; bZ += 1; @@ -149,25 +149,25 @@ public class BusCollisionHelper implements IPartCollisionHelper maxY = Math.max( aY, bY ); maxZ = Math.max( aZ, bZ ); - boxes.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) ); + this.boxes.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) ); } @Override public ForgeDirection getWorldX() { - return x; + return this.x; } @Override public ForgeDirection getWorldY() { - return y; + return this.y; } @Override public ForgeDirection getWorldZ() { - return z; + return this.z; } } diff --git a/src/main/java/appeng/parts/CableBusContainer.java b/src/main/java/appeng/parts/CableBusContainer.java index 2037b16ae..a570ab5c5 100644 --- a/src/main/java/appeng/parts/CableBusContainer.java +++ b/src/main/java/appeng/parts/CableBusContainer.java @@ -82,53 +82,53 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean isInWorld() { - return inWorld; + return this.inWorld; } public void setHost(IPartHost host) { - tcb.clearContainer(); - tcb = host; + this.tcb.clearContainer(); + this.tcb = host; } public CableBusContainer(IPartHost host) { - tcb = host; + this.tcb = host; } @Override public IPart getPart(ForgeDirection side) { if ( side == ForgeDirection.UNKNOWN ) - return getCenter(); - return getSide( side ); + return this.getCenter(); + return this.getSide( side ); } public void rotateLeft() { IPart newSides[] = new IPart[6]; - newSides[ForgeDirection.UP.ordinal()] = getSide( ForgeDirection.UP ); - newSides[ForgeDirection.DOWN.ordinal()] = getSide( ForgeDirection.DOWN ); + newSides[ForgeDirection.UP.ordinal()] = this.getSide( ForgeDirection.UP ); + newSides[ForgeDirection.DOWN.ordinal()] = this.getSide( ForgeDirection.DOWN ); - newSides[ForgeDirection.EAST.ordinal()] = getSide( ForgeDirection.NORTH ); - newSides[ForgeDirection.SOUTH.ordinal()] = getSide( ForgeDirection.EAST ); - newSides[ForgeDirection.WEST.ordinal()] = getSide( ForgeDirection.SOUTH ); - newSides[ForgeDirection.NORTH.ordinal()] = getSide( ForgeDirection.WEST ); + newSides[ForgeDirection.EAST.ordinal()] = this.getSide( ForgeDirection.NORTH ); + newSides[ForgeDirection.SOUTH.ordinal()] = this.getSide( ForgeDirection.EAST ); + newSides[ForgeDirection.WEST.ordinal()] = this.getSide( ForgeDirection.SOUTH ); + newSides[ForgeDirection.NORTH.ordinal()] = this.getSide( ForgeDirection.WEST ); for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - setSide( dir, newSides[dir.ordinal()] ); + this.setSide( dir, newSides[dir.ordinal()] ); - getFacadeContainer().rotateLeft(); + this.getFacadeContainer().rotateLeft(); } public void updateDynamicRender() { - requiresDynamicRender = false; + this.requiresDynamicRender = false; for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS) { - IPart p = getPart( s ); + IPart p = this.getPart( s ); if ( p != null ) - requiresDynamicRender = requiresDynamicRender || p.requireDynamicRender(); + this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender(); } } @@ -137,24 +137,24 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if ( side == ForgeDirection.UNKNOWN ) { - if ( getCenter() != null ) - getCenter().removeFromWorld(); - setCenter( null ); + if ( this.getCenter() != null ) + this.getCenter().removeFromWorld(); + this.setCenter( null ); } else { - if ( getSide( side ) != null ) - getSide( side ).removeFromWorld(); - setSide( side, null ); + if ( this.getSide( side ) != null ) + this.getSide( side ).removeFromWorld(); + this.setSide( side, null ); } if ( !suppressUpdate ) { - updateDynamicRender(); - updateConnections(); - markForUpdate(); - markForSave(); - partChanged(); + this.updateDynamicRender(); + this.updateConnections(); + this.markForUpdate(); + this.markForSave(); + this.partChanged(); } } @@ -163,18 +163,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I */ public void updateConnections() { - if ( getCenter() != null ) + if ( this.getCenter() != null ) { EnumSet sides = EnumSet.allOf( ForgeDirection.class ); for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS) { - if ( getPart( s ) != null || isBlocked( s ) ) + if ( this.getPart( s ) != null || this.isBlocked( s ) ) sides.remove( s ); } - getCenter().setValidSides( sides ); - IGridNode n = getCenter().getGridNode(); + this.getCenter().setValidSides( sides ); + IGridNode n = this.getCenter().getGridNode(); if ( n != null ) n.updateState(); } @@ -200,21 +200,21 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { boolean canPlace = true; for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) ) + if ( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) ) canPlace = false; if ( !canPlace ) return false; - return getPart( ForgeDirection.UNKNOWN ) == null; + return this.getPart( ForgeDirection.UNKNOWN ) == null; } else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN ) { - IPart cable = getPart( ForgeDirection.UNKNOWN ); + IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) ) return false; - return getPart( side ) == null; + return this.getPart( side ) == null; } } } @@ -224,7 +224,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer player) { - if ( canAddPart( is, side ) ) + if ( this.canAddPart( is, side ) ) { if ( is.getItem() instanceof IPartItem ) { @@ -238,30 +238,30 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { boolean canPlace = true; for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) ) + if ( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) ) canPlace = false; if ( !canPlace ) return null; - if ( getPart( ForgeDirection.UNKNOWN ) != null ) + if ( this.getPart( ForgeDirection.UNKNOWN ) != null ) return null; - setCenter( (IPartCable) bp ); - bp.setPartHostInfo( ForgeDirection.UNKNOWN, this, tcb.getTile() ); + this.setCenter( (IPartCable) bp ); + bp.setPartHostInfo( ForgeDirection.UNKNOWN, this, this.tcb.getTile() ); if ( player != null ) bp.onPlacement( player, is, side ); - if ( inWorld ) + if ( this.inWorld ) bp.addToWorld(); - IGridNode cn = getCenter().getGridNode(); + IGridNode cn = this.getCenter().getGridNode(); if ( cn != null ) { for (ForgeDirection ins : ForgeDirection.VALID_DIRECTIONS) { - IPart sbp = getPart( ins ); + IPart sbp = this.getPart( ins ); if ( sbp != null ) { IGridNode sn = sbp.getGridNode(); @@ -276,7 +276,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I // ekk! bp.removeFromWorld(); - setCenter( null ); + this.setCenter( null ); return null; } } @@ -284,30 +284,30 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - updateConnections(); - markForUpdate(); - markForSave(); - partChanged(); + this.updateConnections(); + this.markForUpdate(); + this.markForSave(); + this.partChanged(); return ForgeDirection.UNKNOWN; } else if ( bp != null && !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN ) { - IPart cable = getPart( ForgeDirection.UNKNOWN ); + IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) ) return null; - setSide( side, bp ); + this.setSide( side, bp ); bp.setPartHostInfo( side, this, this.getTile() ); if ( player != null ) bp.onPlacement( player, is, side ); - if ( inWorld ) + if ( this.inWorld ) bp.addToWorld(); - if ( getCenter() != null ) + if ( this.getCenter() != null ) { - IGridNode cn = getCenter().getGridNode(); + IGridNode cn = this.getCenter().getGridNode(); IGridNode sn = bp.getGridNode(); if ( cn != null && sn != null ) @@ -321,17 +321,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I // ekk! bp.removeFromWorld(); - setSide( side, null ); + this.setSide( side, null ); return null; } } } - updateDynamicRender(); - updateConnections(); - markForUpdate(); - markForSave(); - partChanged(); + this.updateDynamicRender(); + this.updateConnections(); + this.markForUpdate(); + this.markForSave(); + this.partChanged(); return side; } } @@ -349,19 +349,19 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public void addToWorld() { - if ( inWorld ) + if ( this.inWorld ) return; - inWorld = true; + this.inWorld = true; isLoading.set( true ); - TileEntity te = getTile(); + TileEntity te = this.getTile(); // start with the center, then install the side parts into the grid. for (int x = 6; x >= 0; x--) { ForgeDirection s = ForgeDirection.getOrientation( x ); - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) { @@ -377,7 +377,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I // here? // if ( !sn.getConnections().iterator().hasNext() ) - IPart center = getPart( ForgeDirection.UNKNOWN ); + IPart center = this.getPart( ForgeDirection.UNKNOWN ); if ( center != null ) { IGridNode cn = center.getGridNode(); @@ -399,26 +399,26 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - partChanged(); + this.partChanged(); isLoading.set( false ); } public void removeFromWorld() { - if ( !inWorld ) + if ( !this.inWorld ) return; - inWorld = false; + this.inWorld = false; for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) part.removeFromWorld(); } - partChanged(); + this.partChanged(); } @Override @@ -426,7 +426,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection dir : enumSet) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part != null && part.canConnectRedstone() ) return true; } @@ -436,7 +436,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public IGridNode getGridNode(ForgeDirection side) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); if ( part != null ) { IGridNode n = part.getExternalFacingNode(); @@ -444,8 +444,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return n; } - if ( getCenter() != null ) - return getCenter().getGridNode(); + if ( this.getCenter() != null ) + return this.getCenter().getGridNode(); return null; } @@ -454,12 +454,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { List boxes = new LinkedList(); - IFacadeContainer fc = getFacadeContainer(); + IFacadeContainer fc = this.getFacadeContainer(); for (ForgeDirection s : ForgeDirection.values()) { IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual ); - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) { if ( ignoreCableConnections && part instanceof IPartCable ) @@ -487,7 +487,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) part.onEntityCollision( entity ); } @@ -496,10 +496,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean isEmpty() { - IFacadeContainer fc = getFacadeContainer(); + IFacadeContainer fc = this.getFacadeContainer(); for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) return false; @@ -516,11 +516,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public void onNeighborChanged() { - hasRedstone = YesNo.UNDECIDED; + this.hasRedstone = YesNo.UNDECIDED; for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) part.onNeighborChanged(); } @@ -528,8 +528,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I private void updateRedstone() { - TileEntity te = getTile(); - hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO; + TileEntity te = this.getTile(); + this.hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO; } @Override @@ -539,33 +539,33 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return false; // facades are solid.. - IFacadePart fp = getFacadeContainer().getFacade( side ); + IFacadePart fp = this.getFacadeContainer().getFacade( side ); if ( fp != null ) return true; // buses can be too. - IPart part = getPart( side ); + IPart part = this.getPart( side ); return part != null && part.isSolid(); } @Override public int isProvidingWeakPower(ForgeDirection side) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); return part != null ? part.isProvidingWeakPower() : 0; } @Override public int isProvidingStrongPower(ForgeDirection side) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); return part != null ? part.isProvidingStrongPower() : 0; } @SideOnly(Side.CLIENT) public void renderStatic(double x, double y, double z) { - CableRenderHelper.getInstance().renderStatic( this, getFacadeContainer() ); + CableRenderHelper.getInstance().renderStatic( this, this.getFacadeContainer() ); } @SideOnly(Side.CLIENT) @@ -579,7 +579,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I int sides = 0; for (int x = 0; x < 7; x++) { - IPart p = getPart( ForgeDirection.getOrientation( x ) ); + IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); if ( p != null ) { sides = sides | (1 << x); @@ -591,7 +591,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I for (int x = 0; x < 7; x++) { ItemStack is = null; - IPart p = getPart( ForgeDirection.getOrientation( x ) ); + IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); if ( p != null ) { is = p.getItemStack( PartItemStack.Network ); @@ -603,7 +603,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - getFacadeContainer().writeToStream( data ); + this.getFacadeContainer().writeToStream( data ); } public boolean readFromStream(ByteBuf data) throws IOException @@ -617,7 +617,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I ForgeDirection side = ForgeDirection.getOrientation( x ); if ( ((sides & (1 << x)) == (1 << x)) ) { - IPart p = getPart( side ); + IPart p = this.getPart( side ); short itemID = data.readShort(); short dmgValue = data.readShort(); @@ -632,22 +632,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else { - removePart( side, false ); - side = addPart( new ItemStack( myItem, 1, dmgValue ), side, null ); + this.removePart( side, false ); + side = this.addPart( new ItemStack( myItem, 1, dmgValue ), side, null ); if ( side != null ) { - p = getPart( side ); + p = this.getPart( side ); p.readFromStream( data ); } else throw new RuntimeException( "Invalid Stream For CableBus Container." ); } } - else if ( getPart( side ) != null ) - removePart( side, false ); + else if ( this.getPart( side ) != null ) + this.removePart( side, false ); } - if ( getFacadeContainer().readFromStream( data ) ) + if ( this.getFacadeContainer().readFromStream( data ) ) return true; return updateBlock; @@ -655,12 +655,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I ForgeDirection getSide(IPart part) { - if ( getCenter() == part ) + if ( this.getCenter() == part ) return ForgeDirection.UNKNOWN; else { for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - if ( getSide( side ) == part ) + if ( this.getSide( side ) == part ) { return side; } @@ -670,14 +670,14 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public void writeToNBT(NBTTagCompound data) { - data.setInteger( "hasRedstone", hasRedstone.ordinal() ); + data.setInteger( "hasRedstone", this.hasRedstone.ordinal() ); - IFacadeContainer fc = getFacadeContainer(); + IFacadeContainer fc = this.getFacadeContainer(); for (ForgeDirection s : ForgeDirection.values()) { fc.writeToNBT( data ); - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) { NBTTagCompound def = new NBTTagCompound(); @@ -686,8 +686,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I NBTTagCompound extra = new NBTTagCompound(); part.writeToNBT( extra ); - data.setTag( "def:" + getSide( part ).ordinal(), def ); - data.setTag( "extra:" + getSide( part ).ordinal(), extra ); + data.setTag( "def:" + this.getSide( part ).ordinal(), def ); + data.setTag( "extra:" + this.getSide( part ).ordinal(), extra ); } } } @@ -695,7 +695,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public void readFromNBT(NBTTagCompound data) { if ( data.hasKey( "hasRedstone" ) ) - hasRedstone = YesNo.values()[data.getInteger( "hasRedstone" )]; + this.hasRedstone = YesNo.values()[data.getInteger( "hasRedstone" )]; for (int x = 0; x < 7; x++) { @@ -705,7 +705,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() ); if ( def != null && extra != null ) { - IPart p = getPart( side ); + IPart p = this.getPart( side ); ItemStack iss = ItemStack.loadItemStackFromNBT( def ); if ( iss == null ) continue; @@ -716,11 +716,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I p.readFromNBT( extra ); else { - removePart( side, true ); - side = addPart( iss, side, null ); + this.removePart( side, true ); + side = this.addPart( iss, side, null ); if ( side != null ) { - p = getPart( side ); + p = this.getPart( side ); p.readFromNBT( extra ); } else @@ -730,17 +730,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } else - removePart( side, false ); + this.removePart( side, false ); } - getFacadeContainer().readFromNBT( data ); + this.getFacadeContainer().readFromNBT( data ); } public List getDrops(List drops) { for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) { drops.add( part.getItemStack( PartItemStack.Break ) ); @@ -749,7 +749,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if ( s != ForgeDirection.UNKNOWN ) { - IFacadePart fp = getFacadeContainer().getFacade( s ); + IFacadePart fp = this.getFacadeContainer().getFacade( s ); if ( fp != null ) drops.add( fp.getItemStack() ); } @@ -762,7 +762,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection s : ForgeDirection.values()) { - IPart part = getPart( s ); + IPart part = this.getPart( s ); if ( part != null ) { part.getDrops( drops, false ); @@ -775,25 +775,25 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public void markForUpdate() { - tcb.markForUpdate(); + this.tcb.markForUpdate(); } @Override public DimensionalCoord getLocation() { - return tcb.getLocation(); + return this.tcb.getLocation(); } @Override public TileEntity getTile() { - return tcb.getTile(); + return this.tcb.getTile(); } @Override public AECableType getCableConnectionType(ForgeDirection dir) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part != null && part instanceof IGridHost ) { AECableType t = ((IGridHost) part).getCableConnectionType( dir ); @@ -801,9 +801,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return t; } - if ( getCenter() != null ) + if ( this.getCenter() != null ) { - IPartCable c = getCenter(); + IPartCable c = this.getCenter(); return c.getCableConnectionType(); } return AECableType.NONE; @@ -812,9 +812,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public AEColor getColor() { - if ( getCenter() != null ) + if ( this.getCenter() != null ) { - IPartCable c = getCenter(); + IPartCable c = this.getCenter(); return c.getCableColor(); } return AEColor.Transparent; @@ -835,7 +835,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean isBlocked(ForgeDirection side) { - return tcb.isBlocked( side ); + return this.tcb.isBlocked( side ); } @Override @@ -845,13 +845,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I for (ForgeDirection d : ForgeDirection.values()) { - IPart p = getPart( d ); + IPart p = this.getPart( d ); if ( p != null ) light = Math.max( p.getLightLevel(), light ); } if ( light > 0 && AppEng.instance.isIntegrationEnabled( IntegrationType.CLApi ) ) - return ((ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi )).colorLight( getColor(), light ); + return ((ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi )).colorLight( this.getColor(), light ); return light; } @@ -859,7 +859,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who) { - IPart cable = getPart( ForgeDirection.UNKNOWN ); + IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if ( cable != null ) { IPartCable pc = (IPartCable) cable; @@ -871,7 +871,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean activate(EntityPlayer player, Vec3 pos) { - SelectedPart p = selectPart( pos ); + SelectedPart p = this.selectPart( pos ); if ( p != null && p.part != null ) { return p.part.onActivate( player, pos ); @@ -884,7 +884,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection side : ForgeDirection.values()) { - IPart p = getPart( side ); + IPart p = this.getPart( side ); if ( p != null ) { List boxes = new LinkedList(); @@ -904,7 +904,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades ) { - IFacadeContainer fc = getFacadeContainer(); + IFacadeContainer fc = this.getFacadeContainer(); for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { IFacadePart p = fc.getFacade( side ); @@ -932,35 +932,35 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public void partChanged() { - if ( getCenter() == null ) + if ( this.getCenter() == null ) { List facades = new LinkedList(); - IFacadeContainer fc = getFacadeContainer(); + IFacadeContainer fc = this.getFacadeContainer(); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { IFacadePart fp = fc.getFacade( d ); if ( fp != null ) { facades.add( fp.getItemStack() ); - fc.removeFacade( tcb, d ); + fc.removeFacade( this.tcb, d ); } } if ( !facades.isEmpty() ) { - TileEntity te = tcb.getTile(); + TileEntity te = this.tcb.getTile(); Platform.spawnDrops( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, facades ); } } - tcb.partChanged(); + this.tcb.partChanged(); } @Override public void markForSave() { - tcb.markForSave(); + this.tcb.markForSave(); } @Override @@ -968,7 +968,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection side : ForgeDirection.values()) { - IPart p = getPart( side ); + IPart p = this.getPart( side ); if ( p != null ) { p.randomDisplayTick( world, x, y, z, r ); @@ -979,10 +979,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean hasRedstone(ForgeDirection side) { - if ( hasRedstone == YesNo.UNDECIDED ) - updateRedstone(); + if ( this.hasRedstone == YesNo.UNDECIDED ) + this.updateRedstone(); - return hasRedstone == YesNo.YES; + return this.hasRedstone == YesNo.YES; } @Override @@ -990,7 +990,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection side : ForgeDirection.values()) { - IPart p = getPart( side ); + IPart p = this.getPart( side ); if ( p != null ) { if ( p.isLadder( entity ) ) @@ -1006,7 +1006,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { for (ForgeDirection d : ForgeDirection.values()) { - IPart p = getPart( d ); + IPart p = this.getPart( d ); if ( p != null && p instanceof IGridHost ) ((IGridHost) p).securityBreak(); } @@ -1015,19 +1015,19 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public Set getLayerFlags() { - return myLayerFlags; + return this.myLayerFlags; } @Override public void cleanup() { - tcb.cleanup(); + this.tcb.cleanup(); } @Override public void notifyNeighbors() { - tcb.notifyNeighbors(); + this.tcb.notifyNeighbors(); } } diff --git a/src/main/java/appeng/parts/CableBusStorage.java b/src/main/java/appeng/parts/CableBusStorage.java index 843c8d0eb..b8c5277ac 100644 --- a/src/main/java/appeng/parts/CableBusStorage.java +++ b/src/main/java/appeng/parts/CableBusStorage.java @@ -35,7 +35,7 @@ public class CableBusStorage protected IPartCable getCenter() { - return center; + return this.center; } protected void setCenter(IPartCable center) @@ -46,8 +46,8 @@ public class CableBusStorage protected IPart getSide(ForgeDirection side) { int x = side.ordinal(); - if ( sides != null && sides.length > x ) - return sides[x]; + if ( this.sides != null && this.sides.length > x ) + return this.sides[x]; return null; } @@ -56,37 +56,37 @@ public class CableBusStorage { int x = side.ordinal(); - if ( sides != null && sides.length > x && part == null ) + if ( this.sides != null && this.sides.length > x && part == null ) { - sides[x] = null; - sides = shrink( sides, true ); + this.sides[x] = null; + this.sides = this.shrink( this.sides, true ); } else if ( part != null ) { - sides = grow( sides, x, true ); - sides[x] = part; + this.sides = this.grow( this.sides, x, true ); + this.sides[x] = part; } } public IFacadePart getFacade(int x) { - if ( facades != null && facades.length > x ) - return facades[x]; + if ( this.facades != null && this.facades.length > x ) + return this.facades[x]; return null; } public void setFacade(int x, IFacadePart facade) { - if ( facades != null && facades.length > x && facade == null ) + if ( this.facades != null && this.facades.length > x && facade == null ) { - facades[x] = null; - facades = shrink( facades, false ); + this.facades[x] = null; + this.facades = this.shrink( this.facades, false ); } else { - facades = grow( facades, x, false ); - facades[x] = facade; + this.facades = this.grow( this.facades, x, false ); + this.facades[x] = facade; } } diff --git a/src/main/java/appeng/parts/PartBasicState.java b/src/main/java/appeng/parts/PartBasicState.java index 618f47f25..56afbce95 100644 --- a/src/main/java/appeng/parts/PartBasicState.java +++ b/src/main/java/appeng/parts/PartBasicState.java @@ -49,13 +49,13 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState @MENetworkEventSubscribe public void chanRender(MENetworkChannelsChanged c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } public void setColors(boolean hasChan, boolean hasPower) @@ -64,13 +64,13 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState { int l = 14; Tessellator.instance.setBrightness( l << 20 | l << 4 ); - Tessellator.instance.setColorOpaque_I( getColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant ); } else if ( hasPower ) { int l = 9; Tessellator.instance.setBrightness( l << 20 | l << 4 ); - Tessellator.instance.setColorOpaque_I( getColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant ); } else { @@ -83,7 +83,7 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState public void renderLights(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { rh.normalRendering(); - setColors( (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG), (clientFlags & POWERED_FLAG) == POWERED_FLAG ); + this.setColors( (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG), (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG ); rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.EAST, renderer ); rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.WEST, renderer ); rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.UP, renderer ); @@ -95,24 +95,24 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState { super.writeToStream( data ); - clientFlags = 0; + this.clientFlags = 0; try { - if ( proxy.getEnergy().isNetworkPowered() ) - clientFlags |= POWERED_FLAG; + if ( this.proxy.getEnergy().isNetworkPowered() ) + this.clientFlags |= this.POWERED_FLAG; - if ( proxy.getNode().meetsChannelRequirements() ) - clientFlags |= CHANNEL_FLAG; + if ( this.proxy.getNode().meetsChannelRequirements() ) + this.clientFlags |= this.CHANNEL_FLAG; - clientFlags = populateFlags( clientFlags ); + this.clientFlags = this.populateFlags( this.clientFlags ); } catch (GridAccessException e) { // meh } - data.writeByte( (byte) clientFlags ); + data.writeByte( (byte) this.clientFlags ); } protected int populateFlags(int cf) @@ -125,27 +125,27 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState { boolean eh = super.readFromStream( data ); - int old = clientFlags; - clientFlags = data.readByte(); + int old = this.clientFlags; + this.clientFlags = data.readByte(); - return eh || old != clientFlags; + return eh || old != this.clientFlags; } public PartBasicState(Class c, ItemStack is) { super( c, is ); - proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); } @Override public boolean isPowered() { - return (clientFlags & POWERED_FLAG) == POWERED_FLAG; + return (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG; } @Override public boolean isActive() { - return (clientFlags & CHANNEL_FLAG) == CHANNEL_FLAG; + return (this.clientFlags & this.CHANNEL_FLAG) == this.CHANNEL_FLAG; } @Override diff --git a/src/main/java/appeng/parts/PartPlacement.java b/src/main/java/appeng/parts/PartPlacement.java index 9e165de39..efa180300 100644 --- a/src/main/java/appeng/parts/PartPlacement.java +++ b/src/main/java/appeng/parts/PartPlacement.java @@ -67,7 +67,7 @@ public class PartPlacement @SubscribeEvent public void playerInteract(TickEvent.ClientTickEvent event) { - wasCanceled = false; + this.wasCanceled = false; } @SubscribeEvent @@ -87,7 +87,7 @@ public class PartPlacement { World w = event.entity.worldObj; TileEntity te = w.getTileEntity( mop.blockX, mop.blockY, mop.blockZ ); - if ( te instanceof IPartHost && wasCanceled ) + if ( te instanceof IPartHost && this.wasCanceled ) event.setCanceled( true ); } else if ( event.entityPlayer != null ) @@ -103,19 +103,19 @@ public class PartPlacement } else if ( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote ) { - if ( placing.get() != null ) + if ( this.placing.get() != null ) return; - placing.set( event ); + this.placing.set( event ); ItemStack held = event.entityPlayer.getHeldItem(); if ( place( held, event.x, event.y, event.z, event.face, event.entityPlayer, event.entityPlayer.worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) ) { event.setCanceled( true ); - wasCanceled = true; + this.wasCanceled = true; } - placing.set( null ); + this.placing.set( null ); } } diff --git a/src/main/java/appeng/parts/automation/NonNullArrayIterator.java b/src/main/java/appeng/parts/automation/NonNullArrayIterator.java index 50ec057bc..99493b1f1 100644 --- a/src/main/java/appeng/parts/automation/NonNullArrayIterator.java +++ b/src/main/java/appeng/parts/automation/NonNullArrayIterator.java @@ -29,22 +29,22 @@ public class NonNullArrayIterator implements Iterator final E[] g; public NonNullArrayIterator(E[] o) { - g = o; + this.g = o; } @Override public boolean hasNext() { - while (offset < g.length && g[offset] == null) - offset++; + while (this.offset < this.g.length && this.g[this.offset] == null) + this.offset++; - return offset != g.length; + return this.offset != this.g.length; } @Override public E next() { - return g[offset++]; + return this.g[this.offset++]; } @Override diff --git a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java index c96e2f90b..f44a57a63 100644 --- a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java @@ -76,7 +76,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); rh.setBounds( 1, 1, 15, 15, 15, 16 ); @@ -98,38 +98,38 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab ForgeDirection e = rh.getWorldX(); ForgeDirection u = rh.getWorldY(); - TileEntity te = getHost().getTile(); + TileEntity te = this.getHost().getTile(); - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) minX = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) ) maxX = 16; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) ) minY = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) ) maxY = 16; - boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG); + boolean isActive = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG); - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); rh.setBounds( minX, minY, 15, maxX, maxY, 16 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 5, 5, 14, 11, 11, 15 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side) @@ -150,7 +150,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab int maxX = 15; int maxY = 15; - IPartHost host = getHost(); + IPartHost host = this.getHost(); if ( host != null ) { TileEntity te = host.getTile(); @@ -162,16 +162,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab ForgeDirection e = bch.getWorldX(); ForgeDirection u = bch.getWorldY(); - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) minX = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) ) maxX = 16; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) ) minY = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) ) maxY = 16; } @@ -194,11 +194,11 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab { super.writeToNBT( data ); - data.setInteger( "bufferSize", Buffer.size() ); - for (int x = 0; x < Buffer.size(); x++) + data.setInteger( "bufferSize", this.Buffer.size() ); + for (int x = 0; x < this.Buffer.size(); x++) { NBTTagCompound pack = new NBTTagCompound(); - Buffer.get( x ).writeToNBT( pack ); + this.Buffer.get( x ).writeToNBT( pack ); data.setTag( "buffer" + x, pack ); } } @@ -209,25 +209,25 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab super.readFromNBT( data ); int size = data.getInteger( "bufferSize" ); - Buffer.clear(); + this.Buffer.clear(); for (int x = 0; x < size; x++) { NBTTagCompound pack = (NBTTagCompound) data.getTag( "buffer" + x ); IAEItemStack ais = AEItemStack.loadItemStackFromNBT( pack ); if ( ais != null ) - Buffer.add( ais ); + this.Buffer.add( ais ); } } private boolean isAccepting() { - return Buffer.isEmpty(); + return this.Buffer.isEmpty(); } @Override public void getDrops(List drops, boolean wrenched) { - for (IAEItemStack is : Buffer) + for (IAEItemStack is : this.Buffer) if ( is != null ) drops.add( is.getItemStack() ); } @@ -236,35 +236,35 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @MENetworkEventSubscribe public void chanRender(MENetworkChannelsChanged c) { - onNeighborChanged(); - getHost().markForUpdate(); + this.onNeighborChanged(); + this.getHost().markForUpdate(); } @Override @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - onNeighborChanged(); - getHost().markForUpdate(); + this.onNeighborChanged(); + this.getHost().markForUpdate(); } public TickRateModulation EatBlock(boolean eatForReal) { - if ( isAccepting() && proxy.isActive() ) + if ( this.isAccepting() && this.proxy.isActive() ) { try { - TileEntity te = getTile(); + TileEntity te = this.getTile(); WorldServer w = (WorldServer) te.getWorldObj(); - int x = te.xCoord + side.offsetX; - int y = te.yCoord + side.offsetY; - int z = te.zCoord + side.offsetZ; + int x = te.xCoord + this.side.offsetX; + int y = te.yCoord + this.side.offsetY; + int z = te.zCoord + this.side.offsetZ; Block blk = w.getBlock( x, y, z ); - IStorageGrid storage = proxy.getStorage(); - IEnergyGrid energy = proxy.getEnergy(); + IStorageGrid storage = this.proxy.getStorage(); + IEnergyGrid energy = this.proxy.getEnergy(); Material mat = blk.getMaterial(); boolean ignore = mat == Material.air || mat == Material.lava || mat == Material.water || mat.isLiquid() || blk == Blocks.bedrock @@ -299,30 +299,30 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab if ( !item.isDead ) { IAEItemStack storedItem = AEItemStack.create( item.getEntityItem() ); - storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc ); + storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc ); if ( storedItem != null ) - Buffer.add( storedItem ); + this.Buffer.add( storedItem ); item.setDead(); } } } - ServerHelper.proxy.sendToAllNearExcept( null, x, y, z, 64, w, new PacketTransitionEffect( x, y, z, side, true ) ); + ServerHelper.proxy.sendToAllNearExcept( null, x, y, z, 64, w, new PacketTransitionEffect( x, y, z, this.side, true ) ); for (ItemStack snaggedItem : out) { IAEItemStack storedItem = AEItemStack.create( snaggedItem ); - storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc ); + storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc ); if ( storedItem != null ) - Buffer.add( storedItem ); + this.Buffer.add( storedItem ); } return TickRateModulation.URGENT; } else { - breaking = true; + this.breaking = true; TickHandler.instance.addCallable( this.tile.getWorldObj(), this ); return TickRateModulation.URGENT; } @@ -352,7 +352,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab { try { - proxy.getTick().alertDevice( proxy.getNode() ); + this.proxy.getTick().alertDevice( this.proxy.getNode() ); } catch (GridAccessException e) { @@ -363,33 +363,33 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override public void onEntityCollision(Entity entity) { - if ( entity instanceof EntityItem && !entity.isDead && isAccepting() ) + if ( entity instanceof EntityItem && !entity.isDead && this.isAccepting() ) { boolean capture = false; - switch (side) + switch (this.side) { case DOWN: case UP: - if ( entity.posX > tile.xCoord && entity.posX < tile.xCoord + 1 ) - if ( entity.posZ > tile.zCoord && entity.posZ < tile.zCoord + 1 ) - if ( (entity.posY > tile.yCoord + 0.9 && side == ForgeDirection.UP) || (entity.posY < tile.yCoord + 0.1 && side == ForgeDirection.DOWN) ) + if ( entity.posX > this.tile.xCoord && entity.posX < this.tile.xCoord + 1 ) + if ( entity.posZ > this.tile.zCoord && entity.posZ < this.tile.zCoord + 1 ) + if ( (entity.posY > this.tile.yCoord + 0.9 && this.side == ForgeDirection.UP) || (entity.posY < this.tile.yCoord + 0.1 && this.side == ForgeDirection.DOWN) ) capture = true; break; case SOUTH: case NORTH: - if ( entity.posX > tile.xCoord && entity.posX < tile.xCoord + 1 ) - if ( entity.posY > tile.yCoord && entity.posY < tile.yCoord + 1 ) - if ( (entity.posZ > tile.zCoord + 0.9 && side == ForgeDirection.SOUTH) - || (entity.posZ < tile.zCoord + 0.1 && side == ForgeDirection.NORTH) ) + if ( entity.posX > this.tile.xCoord && entity.posX < this.tile.xCoord + 1 ) + if ( entity.posY > this.tile.yCoord && entity.posY < this.tile.yCoord + 1 ) + if ( (entity.posZ > this.tile.zCoord + 0.9 && this.side == ForgeDirection.SOUTH) + || (entity.posZ < this.tile.zCoord + 0.1 && this.side == ForgeDirection.NORTH) ) capture = true; break; case EAST: case WEST: - if ( entity.posZ > tile.zCoord && entity.posZ < tile.zCoord + 1 ) - if ( entity.posY > tile.yCoord && entity.posY < tile.yCoord + 1 ) - if ( (entity.posX > tile.xCoord + 0.9 && side == ForgeDirection.EAST) - || (entity.posX < tile.xCoord + 0.1 && side == ForgeDirection.WEST) ) + if ( entity.posZ > this.tile.zCoord && entity.posZ < this.tile.zCoord + 1 ) + if ( entity.posY > this.tile.yCoord && entity.posY < this.tile.yCoord + 1 ) + if ( (entity.posX > this.tile.xCoord + 0.9 && this.side == ForgeDirection.EAST) + || (entity.posX < this.tile.xCoord + 0.1 && this.side == ForgeDirection.WEST) ) capture = true; break; default: @@ -397,16 +397,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab break; } - if ( capture && Platform.isServer() && proxy.isActive() ) + if ( capture && Platform.isServer() && this.proxy.isActive() ) { IAEItemStack stack = AEItemStack.create( ((EntityItem) entity).getEntityItem() ); if ( stack != null ) { - ServerHelper.proxy.sendToAllNearExcept( null, tile.xCoord, tile.yCoord, tile.zCoord, 64, tile.getWorldObj(), - new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, side, false ) ); + ServerHelper.proxy.sendToAllNearExcept( null, this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, 64, this.tile.getWorldObj(), + new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.side, false ) ); - Buffer.add( stack ); - storeBuffer(); + this.Buffer.add( stack ); + this.storeBuffer(); entity.setDead(); } } @@ -416,14 +416,14 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( breaking ) + if ( this.breaking ) return TickRateModulation.URGENT; - if ( isAccepting() ) - return EatBlock( false ); + if ( this.isAccepting() ) + return this.EatBlock( false ); else { - storeBuffer(); + this.storeBuffer(); return TickRateModulation.IDLE; } } @@ -432,16 +432,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab { try { - IStorageGrid storage = proxy.getStorage(); - IEnergyGrid energy = proxy.getEnergy(); + IStorageGrid storage = this.proxy.getStorage(); + IEnergyGrid energy = this.proxy.getEnergy(); - while (!Buffer.isEmpty()) + while (!this.Buffer.isEmpty()) { - IAEItemStack storedItem = Buffer.pop(); - storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc ); + IAEItemStack storedItem = this.Buffer.pop(); + storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc ); if ( storedItem != null ) { - Buffer.add( storedItem ); + this.Buffer.add( storedItem ); break; } } @@ -455,8 +455,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override public Object call() throws Exception { - breaking = false; - return EatBlock( true ); + this.breaking = false; + return this.EatBlock( true ); } } diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index 28305fc21..068ee84b0 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -69,24 +69,24 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest public PartExportBus(ItemStack is) { super( PartExportBus.class, is ); - settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - settings.registerSetting( Settings.CRAFT_ONLY, YesNo.NO ); - mySrc = new MachineSource( this ); + this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.settings.registerSetting( Settings.CRAFT_ONLY, YesNo.NO ); + this.mySrc = new MachineSource( this ); } @Override public void readFromNBT(NBTTagCompound extra) { super.readFromNBT( extra ); - cratingTracker.readFromNBT( extra ); + this.cratingTracker.readFromNBT( extra ); } @Override public void writeToNBT(NBTTagCompound extra) { super.writeToNBT( extra ); - cratingTracker.writeToNBT( extra ); + this.cratingTracker.writeToNBT( extra ); } @Override @@ -97,7 +97,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_BUS ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS ); return true; } @@ -110,7 +110,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest { rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); rh.setBounds( 4, 4, 12, 12, 12, 14 ); rh.renderInventoryBox( renderer ); @@ -126,9 +126,9 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); rh.setBounds( 4, 4, 12, 12, 12, 14 ); rh.renderBlock( x, y, z, renderer ); @@ -140,13 +140,13 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 6, 6, 11, 10, 10, 12 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override @@ -170,70 +170,70 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override TickRateModulation doBusWork() { - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return TickRateModulation.IDLE; - itemToSend = 1; - didSomething = false; + this.itemToSend = 1; + this.didSomething = false; - switch (getInstalledUpgrades( Upgrades.SPEED )) + switch (this.getInstalledUpgrades( Upgrades.SPEED )) { default: case 0: - itemToSend = 1; + this.itemToSend = 1; break; case 1: - itemToSend = 8; + this.itemToSend = 8; break; case 2: - itemToSend = 32; + this.itemToSend = 32; break; case 3: - itemToSend = 64; + this.itemToSend = 64; break; case 4: - itemToSend = 96; + this.itemToSend = 96; break; } try { - InventoryAdaptor d = getHandler(); - IMEMonitor inv = proxy.getStorage().getItemInventory(); - IEnergyGrid energy = proxy.getEnergy(); - ICraftingGrid cg = proxy.getCrafting(); - FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE ); + InventoryAdaptor d = this.getHandler(); + IMEMonitor inv = this.proxy.getStorage().getItemInventory(); + IEnergyGrid energy = this.proxy.getEnergy(); + ICraftingGrid cg = this.proxy.getCrafting(); + FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); if ( d != null ) { - for (int x = 0; x < availableSlots() && itemToSend > 0; x++) + for (int x = 0; x < this.availableSlots() && this.itemToSend > 0; x++) { - IAEItemStack ais = config.getAEStackInSlot( x ); - if ( ais == null || itemToSend <= 0 || craftOnly() ) + IAEItemStack ais = this.config.getAEStackInSlot( x ); + if ( ais == null || this.itemToSend <= 0 || this.craftOnly() ) { - if ( isCraftingEnabled() ) - didSomething = cratingTracker.handleCrafting( x, itemToSend, ais, d, getTile().getWorldObj(), proxy.getGrid(), cg, mySrc ) - || didSomething; + if ( this.isCraftingEnabled() ) + this.didSomething = this.cratingTracker.handleCrafting( x, this.itemToSend, ais, d, this.getTile().getWorldObj(), this.proxy.getGrid(), cg, this.mySrc ) + || this.didSomething; continue; } - long before = itemToSend; + long before = this.itemToSend; - if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) + if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { for (IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) )) { - pushItemIntoTarget( d, energy, inv, o ); - if ( itemToSend <= 0 ) + this.pushItemIntoTarget( d, energy, inv, o ); + if ( this.itemToSend <= 0 ) break; } } else - pushItemIntoTarget( d, energy, inv, ais ); + this.pushItemIntoTarget( d, energy, inv, ais ); - if ( itemToSend == before && isCraftingEnabled() ) - didSomething = cratingTracker.handleCrafting( x, itemToSend, ais, d, getTile().getWorldObj(), proxy.getGrid(), cg, mySrc ) - || didSomething; + if ( this.itemToSend == before && this.isCraftingEnabled() ) + this.didSomething = this.cratingTracker.handleCrafting( x, this.itemToSend, ais, d, this.getTile().getWorldObj(), this.proxy.getGrid(), cg, this.mySrc ) + || this.didSomething; } } @@ -243,45 +243,45 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest // :P } - return didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER; + return this.didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } private boolean craftOnly() { - return getConfigManager().getSetting( Settings.CRAFT_ONLY ) == YesNo.YES; + return this.getConfigManager().getSetting( Settings.CRAFT_ONLY ) == YesNo.YES; } private boolean isCraftingEnabled() { - return getInstalledUpgrades( Upgrades.CRAFTING ) > 0; + return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0; } private void pushItemIntoTarget(InventoryAdaptor d, IEnergyGrid energy, IMEInventory inv, IAEItemStack ais) { ItemStack is = ais.getItemStack(); - is.stackSize = (int) itemToSend; + is.stackSize = (int) this.itemToSend; ItemStack o = d.simulateAdd( is ); - long canFit = o == null ? itemToSend : itemToSend - o.stackSize; + long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize; if ( canFit > 0 ) { ais = ais.copy(); ais.setStackSize( canFit ); - IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, mySrc ); + IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc ); if ( itemsToAdd != null ) { - itemToSend -= itemsToAdd.getStackSize(); + this.itemToSend -= itemsToAdd.getStackSize(); ItemStack failed = d.addItems( itemsToAdd.getItemStack() ); if ( failed != null ) { ais.setStackSize( failed.stackSize ); - inv.injectItems( ais, Actionable.MODULATE, mySrc ); + inv.injectItems( ais, Actionable.MODULATE, this.mySrc ); } else - didSomething = true; + this.didSomething = true; } } @@ -290,13 +290,13 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) { - InventoryAdaptor d = getHandler(); + InventoryAdaptor d = this.getHandler(); try { - if ( d != null && proxy.isActive() ) + if ( d != null && this.proxy.isActive() ) { - IEnergyGrid energy = proxy.getEnergy(); + IEnergyGrid energy = this.proxy.getEnergy(); double power = items.getStackSize(); if ( energy.extractAEPower( power, mode, PowerMultiplier.CONFIG ) > power - 0.01 ) @@ -318,37 +318,37 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - return doBusWork(); + return this.doBusWork(); } @Override public RedstoneMode getRSMode() { - return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED ); + return (RedstoneMode) this.settings.getSetting( Settings.REDSTONE_CONTROLLED ); } @Override protected boolean isSleeping() { - return getHandler() == null || super.isSleeping(); + return this.getHandler() == null || super.isSleeping(); } @Override public TickingRequest getTickingRequest(IGridNode node) { - return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, isSleeping(), false ); + return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false ); } @Override public ImmutableSet getRequestedJobs() { - return cratingTracker.getRequestedJobs(); + return this.cratingTracker.getRequestedJobs(); } @Override public void jobStateChange(ICraftingLink link) { - cratingTracker.jobStateChange( link ); + this.cratingTracker.jobStateChange( link ); } } diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index 8cd0ae83d..a3d1b86f0 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -89,8 +89,8 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine public PartFormationPlane(ItemStack is) { super( PartFormationPlane.class, is ); - settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - updateHandler(); + this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.updateHandler(); } @Override @@ -101,7 +101,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_FORMATION_PLANE ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_FORMATION_PLANE ); return true; } @@ -118,7 +118,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine public IInventory getInventoryByName(String name) { if ( name.equals( "config" ) ) - return Config; + return this.Config; return super.getInventoryByName( name ); } @@ -127,24 +127,24 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - boolean currentActive = proxy.isActive(); - if ( wasActive != currentActive ) + boolean currentActive = this.proxy.isActive(); + if ( this.wasActive != currentActive ) { - wasActive = currentActive; - updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - getHost().markForUpdate(); + this.wasActive = currentActive; + this.updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.getHost().markForUpdate(); } } @MENetworkEventSubscribe public void updateChannels(MENetworkChannelsChanged changedChannels) { - boolean currentActive = proxy.isActive(); - if ( wasActive != currentActive ) + boolean currentActive = this.proxy.isActive(); + if ( this.wasActive != currentActive ) { - wasActive = currentActive; - updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - getHost().markForUpdate(); + this.wasActive = currentActive; + this.updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.getHost().markForUpdate(); } } @@ -153,7 +153,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); rh.setBounds( 1, 1, 15, 15, 15, 16 ); @@ -175,38 +175,38 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine ForgeDirection e = rh.getWorldX(); ForgeDirection u = rh.getWorldY(); - TileEntity te = getHost().getTile(); + TileEntity te = this.getHost().getTile(); - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) minX = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) ) maxX = 16; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) ) minY = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) ) maxY = 16; - boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG); + boolean isActive = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG); - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); rh.setBounds( minX, minY, 15, maxX, maxY, 16 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(), + CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 5, 5, 14, 11, 11, 15 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side) @@ -227,7 +227,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine int maxX = 15; int maxY = 15; - IPartHost host = getHost(); + IPartHost host = this.getHost(); if ( host != null ) { TileEntity te = host.getTile(); @@ -239,16 +239,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine ForgeDirection e = bch.getWorldX(); ForgeDirection u = bch.getWorldY(); - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) minX = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) ) maxX = 16; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) ) minY = 0; - if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) ) + if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) ) maxY = 16; } @@ -265,10 +265,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public List getCellArray(StorageChannel channel) { - if ( proxy.isActive() && channel == StorageChannel.ITEMS ) + if ( this.proxy.isActive() && channel == StorageChannel.ITEMS ) { List Handler = new ArrayList( 1 ); - Handler.add( myHandler ); + Handler.add( this.myHandler ); return Handler; } return new ArrayList(); @@ -277,16 +277,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - updateHandler(); - host.markForSave(); + this.updateHandler(); + this.host.markForSave(); } @Override public void setPriority(int newValue) { - priority = newValue; - host.markForSave(); - updateHandler(); + this.priority = newValue; + this.host.markForSave(); + this.updateHandler(); } @Override @@ -294,40 +294,40 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); - if ( inv == Config ) - updateHandler(); + if ( inv == this.Config ) + this.updateHandler(); } @Override public void upgradesChanged() { - updateHandler(); + this.updateHandler(); } private void updateHandler() { - myHandler.myAccess = AccessRestriction.WRITE; - myHandler.myWhitelist = getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; - myHandler.myPriority = priority; + this.myHandler.myAccess = AccessRestriction.WRITE; + this.myHandler.myWhitelist = this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; + this.myHandler.myPriority = this.priority; IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + getInstalledUpgrades( Upgrades.CAPACITY ) * 9; - for (int x = 0; x < Config.getSizeInventory() && x < slotsToUse; x++) + int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + for (int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++) { - IAEItemStack is = Config.getAEStackInSlot( x ); + IAEItemStack is = this.Config.getAEStackInSlot( x ); if ( is != null ) priorityList.add( is ); } - if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) - myHandler.myPartitionList = new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); + if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) + this.myHandler.myPartitionList = new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); else - myHandler.myPartitionList = new PrecisePriorityList( priorityList ); + this.myHandler.myPartitionList = new PrecisePriorityList( priorityList ); try { - proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch (GridAccessException e) { @@ -339,17 +339,17 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - Config.writeToNBT( data, "config" ); - data.setInteger( "priority", priority ); + this.Config.writeToNBT( data, "config" ); + data.setInteger( "priority", this.priority ); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - Config.readFromNBT( data, "config" ); - priority = data.getInteger( "priority" ); - updateHandler(); + this.Config.readFromNBT( data, "config" ); + this.priority = data.getInteger( "priority" ); + this.updateHandler(); } @Override @@ -373,7 +373,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public int getPriority() { - return priority; + return this.priority; } @Override @@ -385,7 +385,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public void onNeighborChanged() { - TileEntity te = host.getTile(); + TileEntity te = this.host.getTile(); World w = te.getWorldObj(); ForgeDirection side = this.side; @@ -393,13 +393,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine int y = te.yCoord + side.offsetY; int z = te.zCoord + side.offsetZ; - blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z ); + this.blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z ); } @Override public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) { - if ( blocked || input == null || input.getStackSize() <= 0 ) + if ( this.blocked || input == null || input.getStackSize() <= 0 ) return input; ItemStack is = input.getItemStack(); @@ -408,7 +408,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() ); boolean worked = false; - TileEntity te = host.getTile(); + TileEntity te = this.host.getTile(); World w = te.getWorldObj(); ForgeDirection side = this.side; @@ -422,7 +422,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine || i instanceof ItemReed ) { EntityPlayer player = Platform.getPlayer( (WorldServer) w ); - Platform.configurePlayer( player, side, tile ); + Platform.configurePlayer( player, side, this.tile ); if ( i instanceof ItemFirework ) { @@ -514,7 +514,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } } - blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z ); + this.blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z ); if ( worked ) { diff --git a/src/main/java/appeng/parts/automation/PartImportBus.java b/src/main/java/appeng/parts/automation/PartImportBus.java index 34d9d2ffa..da695ea8c 100644 --- a/src/main/java/appeng/parts/automation/PartImportBus.java +++ b/src/main/java/appeng/parts/automation/PartImportBus.java @@ -60,9 +60,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin public PartImportBus(ItemStack is) { super( PartImportBus.class, is ); - settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - mySrc = new MachineSource( this ); + this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.mySrc = new MachineSource( this ); } @Override @@ -73,7 +73,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_BUS ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS ); return true; } @@ -86,7 +86,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin if ( stack == null || stack.getItem() == null ) return false; - IAEItemStack out = destination.injectItems( lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, mySrc ); + IAEItemStack out = this.destination.injectItems( this.lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, this.mySrc ); if ( out == null ) return true; return out.getStackSize() != stack.stackSize; @@ -94,7 +94,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin private IInventoryDestination configDestination( IMEMonitor itemInventory ) { - destination = itemInventory; + this.destination = itemInventory; return this; } @@ -103,7 +103,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); rh.setBounds( 3, 3, 15, 13, 13, 16 ); rh.renderInventoryBox( renderer ); @@ -119,9 +119,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); rh.setBounds( 4, 4, 14, 12, 12, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -132,13 +132,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin rh.setBounds( 6, 6, 12, 10, 10, 13 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 6, 6, 11, 10, 10, 12 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override @@ -158,7 +158,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override public TickingRequest getTickingRequest(IGridNode node) { - return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, getHandler() == null, false ); + return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false ); } private int itemToSend; // used in tickingRequest @@ -167,52 +167,52 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override TickRateModulation doBusWork() { - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return TickRateModulation.IDLE; - worked = false; + this.worked = false; - InventoryAdaptor myAdaptor = getHandler(); - FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE ); + InventoryAdaptor myAdaptor = this.getHandler(); + FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); if ( myAdaptor != null ) { try { - switch (getInstalledUpgrades( Upgrades.SPEED )) + switch (this.getInstalledUpgrades( Upgrades.SPEED )) { default: case 0: - itemToSend = 1; + this.itemToSend = 1; break; case 1: - itemToSend = 8; + this.itemToSend = 8; break; case 2: - itemToSend = 32; + this.itemToSend = 32; break; case 3: - itemToSend = 64; + this.itemToSend = 64; break; case 4: - itemToSend = 96; + this.itemToSend = 96; break; } - itemToSend = Math.min( itemToSend, (int) (0.01 + proxy.getEnergy().extractAEPower( itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG )) ); - IMEMonitor inv = proxy.getStorage().getItemInventory(); - IEnergyGrid energy = proxy.getEnergy(); + this.itemToSend = Math.min( this.itemToSend, (int) (0.01 + this.proxy.getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG )) ); + IMEMonitor inv = this.proxy.getStorage().getItemInventory(); + IEnergyGrid energy = this.proxy.getEnergy(); boolean Configured = false; - for (int x = 0; x < availableSlots(); x++) + for (int x = 0; x < this.availableSlots(); x++) { - IAEItemStack ais = config.getAEStackInSlot( x ); - if ( ais != null && itemToSend > 0 ) + IAEItemStack ais = this.config.getAEStackInSlot( x ); + if ( ais != null && this.itemToSend > 0 ) { Configured = true; - while (itemToSend > 0) + while (this.itemToSend > 0) { - if ( importStuff( myAdaptor, ais, inv, energy, fzMode ) ) + if ( this.importStuff( myAdaptor, ais, inv, energy, fzMode ) ) break; } } @@ -220,9 +220,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin if ( !Configured ) { - while (itemToSend > 0) + while (this.itemToSend > 0) { - if ( importStuff( myAdaptor, null, inv, energy, fzMode ) ) + if ( this.importStuff( myAdaptor, null, inv, energy, fzMode ) ) break; } } @@ -235,13 +235,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin else return TickRateModulation.SLEEP; - return worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER; + return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - return doBusWork(); + return this.doBusWork(); } private boolean importStuff(InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor inv, IEnergySource energy, FuzzyMode fzMode) @@ -252,22 +252,22 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin toSend = 64; ItemStack newItems; - if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) - newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), fzMode, configDestination( inv ) ); + if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) + newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), fzMode, this.configDestination( inv ) ); else - newItems = myAdaptor.removeItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), configDestination( inv ) ); + newItems = myAdaptor.removeItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), this.configDestination( inv ) ); if ( newItems != null ) { newItems.stackSize = (int) (Math.min( newItems.stackSize, energy.extractAEPower( newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01); - itemToSend -= newItems.stackSize; + this.itemToSend -= newItems.stackSize; - if ( lastItemChecked == null || !lastItemChecked.isSameType( newItems ) ) - lastItemChecked = AEApi.instance().storage().createItemStack( newItems ); + if ( this.lastItemChecked == null || !this.lastItemChecked.isSameType( newItems ) ) + this.lastItemChecked = AEApi.instance().storage().createItemStack( newItems ); else - lastItemChecked.setStackSize( newItems.stackSize ); + this.lastItemChecked.setStackSize( newItems.stackSize ); - IAEItemStack failed = Platform.poweredInsert( energy, destination, lastItemChecked, mySrc ); + IAEItemStack failed = Platform.poweredInsert( energy, this.destination, this.lastItemChecked, this.mySrc ); // destination.injectItems( lastItemChecked, Actionable.MODULATE ); if ( failed != null ) { @@ -275,7 +275,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return true; } else - worked = true; + this.worked = true; } else return true; @@ -286,13 +286,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override public RedstoneMode getRSMode() { - return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED ); + return (RedstoneMode) this.settings.getSetting( Settings.REDSTONE_CONTROLLED ); } @Override protected boolean isSleeping() { - return getHandler() == null || super.isSleeping(); + return this.getHandler() == null || super.isSleeping(); } } diff --git a/src/main/java/appeng/parts/automation/PartLevelEmitter.java b/src/main/java/appeng/parts/automation/PartLevelEmitter.java index c9f71eabd..7c8aecfca 100644 --- a/src/main/java/appeng/parts/automation/PartLevelEmitter.java +++ b/src/main/java/appeng/parts/automation/PartLevelEmitter.java @@ -94,54 +94,54 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH public long getReportingValue() { - return reportingValue; + return this.reportingValue; } public void setReportingValue(long v) { - reportingValue = v; - if ( getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) - configureWatchers(); + this.reportingValue = v; + if ( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) + this.configureWatchers(); else - updateState(); + this.updateState(); } @MENetworkEventSubscribe public void powerChanged(MENetworkPowerStatusChange c) { - updateState(); + this.updateState(); } @MENetworkEventSubscribe public void channelChanged(MENetworkChannelsChanged c) { - updateState(); + this.updateState(); } @Override public void upgradesChanged() { - configureWatchers(); + this.configureWatchers(); } @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - configureWatchers(); + this.configureWatchers(); } private void updateState() { - if ( proxy.isActive() ) + if ( this.proxy.isActive() ) { - boolean isOn = isLevelEmitterOn(); - if ( prevState != isOn ) + boolean isOn = this.isLevelEmitterOn(); + if ( this.prevState != isOn ) { - host.markForUpdate(); - TileEntity te = host.getTile(); - prevState = isOn; + this.host.markForUpdate(); + TileEntity te = this.host.getTile(); + this.prevState = isOn; Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord ); - Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ ); + Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); } } } @@ -150,93 +150,93 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - data.setLong( "lastReportedValue", lastReportedValue ); - data.setLong( "reportingValue", reportingValue ); - data.setBoolean( "prevState", prevState ); - config.writeToNBT( data, "config" ); + data.setLong( "lastReportedValue", this.lastReportedValue ); + data.setLong( "reportingValue", this.reportingValue ); + data.setBoolean( "prevState", this.prevState ); + this.config.writeToNBT( data, "config" ); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - lastReportedValue = data.getLong( "lastReportedValue" ); - reportingValue = data.getLong( "reportingValue" ); - prevState = data.getBoolean( "prevState" ); - config.readFromNBT( data, "config" ); + this.lastReportedValue = data.getLong( "lastReportedValue" ); + this.reportingValue = data.getLong( "reportingValue" ); + this.prevState = data.getBoolean( "prevState" ); + this.config.readFromNBT( data, "config" ); } @Override protected int populateFlags(int cf) { - return cf | (prevState ? FLAG_ON : 0); + return cf | (this.prevState ? this.FLAG_ON : 0); } @Override public void updateWatcher(ICraftingWatcher newWatcher) { - myCraftingWatcher = newWatcher; - configureWatchers(); + this.myCraftingWatcher = newWatcher; + this.configureWatchers(); } @Override public void updateWatcher(IStackWatcher newWatcher) { - myWatcher = newWatcher; - configureWatchers(); + this.myWatcher = newWatcher; + this.configureWatchers(); } @Override public void updateWatcher(IEnergyWatcher newWatcher) { - myEnergyWatcher = newWatcher; - configureWatchers(); + this.myEnergyWatcher = newWatcher; + this.configureWatchers(); } // update the system... public void configureWatchers() { - IAEItemStack myStack = config.getAEStackInSlot( 0 ); + IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); - if ( myWatcher != null ) - myWatcher.clear(); + if ( this.myWatcher != null ) + this.myWatcher.clear(); - if ( myEnergyWatcher != null ) - myEnergyWatcher.clear(); + if ( this.myEnergyWatcher != null ) + this.myEnergyWatcher.clear(); - if ( myCraftingWatcher != null ) - myCraftingWatcher.clear(); + if ( this.myCraftingWatcher != null ) + this.myCraftingWatcher.clear(); try { - proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, proxy.getNode() ) ); + this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) ); } catch (GridAccessException e1) { // :/ } - if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) + if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) { - if ( myCraftingWatcher != null && myStack != null ) - myCraftingWatcher.add( myStack ); + if ( this.myCraftingWatcher != null && myStack != null ) + this.myCraftingWatcher.add( myStack ); return; } - if ( getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) + if ( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) { - if ( myEnergyWatcher != null ) - myEnergyWatcher.add( (double) reportingValue ); + if ( this.myEnergyWatcher != null ) + this.myEnergyWatcher.add( (double) this.reportingValue ); try { // update to power... - lastReportedValue = (long) proxy.getEnergy().getStoredPower(); - updateState(); + this.lastReportedValue = (long) this.proxy.getEnergy().getStoredPower(); + this.updateState(); // no more item stuff.. - proxy.getStorage().getItemInventory().removeListener( this ); + this.proxy.getStorage().getItemInventory().removeListener( this ); } catch (GridAccessException e) { @@ -248,19 +248,19 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH try { - if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null ) + if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null ) { - proxy.getStorage().getItemInventory().addListener( this, proxy.getGrid() ); + this.proxy.getStorage().getItemInventory().addListener( this, this.proxy.getGrid() ); } else { - proxy.getStorage().getItemInventory().removeListener( this ); + this.proxy.getStorage().getItemInventory().removeListener( this ); - if ( myWatcher != null ) - myWatcher.add( myStack ); + if ( this.myWatcher != null ) + this.myWatcher.add( myStack ); } - updateReportingValue( proxy.getStorage().getItemInventory() ); + this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } catch (GridAccessException e) { @@ -271,8 +271,8 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - if ( inv == config ) - configureWatchers(); + if ( inv == this.config ) + this.configureWatchers(); super.onChangeInventory( inv, slot, mc, removedStack, newStack ); } @@ -280,7 +280,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void postChange(IBaseMonitor monitor, Iterable change, BaseActionSource actionSource) { - updateReportingValue( (IMEMonitor) monitor ); + this.updateReportingValue( (IMEMonitor) monitor ); } @Override @@ -291,7 +291,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_LEVEL_EMITTER ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_LEVEL_EMITTER ); return true; } @@ -300,32 +300,32 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH private void updateReportingValue(IMEMonitor monitor) { - IAEItemStack myStack = config.getAEStackInSlot( 0 ); + IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); if ( myStack == null ) { - lastReportedValue = 0; + this.lastReportedValue = 0; for (IAEItemStack st : monitor.getStorageList()) - lastReportedValue += st.getStackSize(); + this.lastReportedValue += st.getStackSize(); } - else if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) + else if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { - lastReportedValue = 0; - FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.lastReportedValue = 0; + FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); Collection fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode ); for (IAEItemStack st : fuzzyList) - lastReportedValue += st.getStackSize(); + this.lastReportedValue += st.getStackSize(); } else { IAEItemStack r = monitor.getStorageList().findPrecise( myStack ); if ( r == null ) - lastReportedValue = 0; + this.lastReportedValue = 0; else - lastReportedValue = r.getStackSize(); + this.lastReportedValue = r.getStackSize(); } - updateState(); + this.updateState(); } @Override @@ -333,7 +333,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { try { - return proxy.getGrid() == effectiveGrid; + return this.proxy.getGrid() == effectiveGrid; } catch (GridAccessException e) { @@ -344,41 +344,41 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void onRequestChange(ICraftingGrid craftingGrid, IAEItemStack what) { - updateState(); + this.updateState(); } @Override public void onThresholdPass(IEnergyGrid energyGrid) { - lastReportedValue = (long) energyGrid.getStoredPower(); - updateState(); + this.lastReportedValue = (long) energyGrid.getStoredPower(); + this.updateState(); } @Override public void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan) { - if ( chan == StorageChannel.ITEMS && fullStack.equals( config.getAEStackInSlot( 0 ) ) && getInstalledUpgrades( Upgrades.FUZZY ) == 0 ) + if ( chan == StorageChannel.ITEMS && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 ) { - lastReportedValue = fullStack.getStackSize(); - updateState(); + this.lastReportedValue = fullStack.getStackSize(); + this.updateState(); } } public PartLevelEmitter(ItemStack is) { super( PartLevelEmitter.class, is ); - getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL ); - getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - getConfigManager().registerSetting( Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL ); - getConfigManager().registerSetting( Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); + this.getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL ); + this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.getConfigManager().registerSetting( Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL ); + this.getConfigManager().registerSetting( Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); } @Override @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { - rh.setTexture( is.getIconIndex() ); + rh.setTexture( this.is.getIconIndex() ); Tessellator.instance.startDrawingQuads(); - renderTorchAtAngle( 0, -0.5, 0 ); + this.renderTorchAtAngle( 0, -0.5, 0 ); Tessellator.instance.draw(); // rh.setBounds( 7, 7, 10, 9, 9, 15 ); // rh.renderInventoryBox( renderer ); @@ -392,17 +392,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { Tessellator var12 = Tessellator.instance; - x -= centerX; - y -= centerY; - z -= centerZ; + x -= this.centerX; + y -= this.centerY; + z -= this.centerZ; - if ( side == ForgeDirection.DOWN ) + if ( this.side == ForgeDirection.DOWN ) { y = -y; z = -z; } - if ( side == ForgeDirection.EAST ) + if ( this.side == ForgeDirection.EAST ) { double m = x; x = y; @@ -410,14 +410,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH y = -y; } - if ( side == ForgeDirection.WEST ) + if ( this.side == ForgeDirection.WEST ) { double m = x; x = -y; y = m; } - if ( side == ForgeDirection.SOUTH ) + if ( this.side == ForgeDirection.SOUTH ) { double m = z; z = y; @@ -425,16 +425,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH y = -y; } - if ( side == ForgeDirection.NORTH ) + if ( this.side == ForgeDirection.NORTH ) { double m = z; z = -y; y = m; } - x += centerX;// + orientation.offsetX * 0.4; - y += centerY;// + orientation.offsetY * 0.4; - z += centerZ;// + orientation.offsetZ * 0.4; + x += this.centerX;// + orientation.offsetX * 0.4; + y += this.centerY;// + orientation.offsetY * 0.4; + z += this.centerZ;// + orientation.offsetZ * 0.4; var12.addVertexWithUV( x, y, z, u, v ); } @@ -442,9 +442,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void randomDisplayTick(World world, int x, int y, int z, Random r) { - if ( isLevelEmitterOn() ) + if ( this.isLevelEmitterOn() ) { - ForgeDirection d = side; + ForgeDirection d = this.side; double d0 = d.offsetX * 0.45F + (r.nextFloat() - 0.5F) * 0.2D; double d1 = d.offsetY * 0.45F + (r.nextFloat() - 0.5F) * 0.2D; @@ -456,13 +456,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH public void renderTorchAtAngle(double baseX, double baseY, double baseZ) { - boolean isOn = isLevelEmitterOn(); - IIcon offTexture = is.getIconIndex(); + boolean isOn = this.isLevelEmitterOn(); + IIcon offTexture = this.is.getIconIndex(); IIcon IIcon = (isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture); // - centerX = baseX + 0.5; - centerY = baseY + 0.5; - centerZ = baseZ + 0.5; + this.centerX = baseX + 0.5; + this.centerY = baseY + 0.5; + this.centerZ = baseZ + 0.5; baseY += 7.0 / 16.0; @@ -567,31 +567,31 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH private boolean isLevelEmitterOn() { if ( Platform.isClient() ) - return (clientFlags & FLAG_ON) == FLAG_ON; + return (this.clientFlags & this.FLAG_ON) == this.FLAG_ON; - if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) + if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) { try { - return proxy.getCrafting().isRequesting( config.getAEStackInSlot( 0 ) ); + return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) ); } catch (GridAccessException e) { // :P } - return prevState; + return this.prevState; } - boolean flipState = getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; - return flipState ? reportingValue >= lastReportedValue + 1 : reportingValue < lastReportedValue + 1; + boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; + return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1; } @Override @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - rh.setTexture( is.getIconIndex() ); + rh.setTexture( this.is.getIconIndex() ); // rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() ); // rh.setBounds( 2, 2, 14, 14, 14, 16 ); @@ -606,12 +606,12 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH tess.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorldObj(), x, y, z ) ); tess.setColorOpaque_F( 1.0F, 1.0F, 1.0F ); - renderTorchAtAngle( x, y, z ); + this.renderTorchAtAngle( x, y, z ); renderer.renderAllFaces = false; rh.setBounds( 7, 7, 11, 9, 9, 12 ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); // super.renderWorldBlock( world, x, y, z, block, modelId, renderer ); } @@ -619,7 +619,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public IIcon getBreakingTexture() { - return is.getIconIndex(); + return this.is.getIconIndex(); } @Override @@ -649,20 +649,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public int isProvidingStrongPower() { - return prevState ? 15 : 0; + return this.prevState ? 15 : 0; } @Override public int isProvidingWeakPower() { - return prevState ? 15 : 0; + return this.prevState ? 15 : 0; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "config" ) ) - return config; + return this.config; return super.getInventoryByName( name ); } @@ -672,7 +672,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { try { - updateReportingValue( proxy.getStorage().getItemInventory() ); + this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } catch (GridAccessException e) { @@ -695,11 +695,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void provideCrafting(ICraftingProviderHelper craftingTracker) { - if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) + if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) { - if ( settings.getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES ) + if ( this.settings.getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES ) { - IAEItemStack what = config.getAEStackInSlot( 0 ); + IAEItemStack what = this.config.getAEStackInSlot( 0 ); if ( what != null ) craftingTracker.setEmitable( what ); } diff --git a/src/main/java/appeng/parts/automation/PartSharedItemBus.java b/src/main/java/appeng/parts/automation/PartSharedItemBus.java index 81e8c06d3..43d200039 100644 --- a/src/main/java/appeng/parts/automation/PartSharedItemBus.java +++ b/src/main/java/appeng/parts/automation/PartSharedItemBus.java @@ -53,26 +53,26 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid @Override public void upgradesChanged() { - updateState(); + this.updateState(); } protected int availableSlots() { - return Math.min( 1 + getInstalledUpgrades( Upgrades.CAPACITY ) * 4, config.getSizeInventory() ); + return Math.min( 1 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 4, this.config.getSizeInventory() ); } @Override public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra) { super.writeToNBT( extra ); - config.writeToNBT( extra, "config" ); + this.config.writeToNBT( extra, "config" ); } @Override public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra) { super.readFromNBT( extra ); - config.readFromNBT( extra, "config" ); + this.config.readFromNBT( extra, "config" ); } final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 9 ); @@ -82,18 +82,18 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid InventoryAdaptor getHandler() { - TileEntity self = getHost().getTile(); - TileEntity target = getTileEntity( self, self.xCoord + side.offsetX, self.yCoord + side.offsetY, self.zCoord + side.offsetZ ); + TileEntity self = this.getHost().getTile(); + TileEntity target = this.getTileEntity( self, self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); int newAdaptorHash = Platform.generateTileHash( target ); - if ( adaptorHash == newAdaptorHash && newAdaptorHash != 0 ) - return adaptor; + if ( this.adaptorHash == newAdaptorHash && newAdaptorHash != 0 ) + return this.adaptor; - adaptorHash = newAdaptorHash; - adaptor = InventoryAdaptor.getAdaptor( target, side.getOpposite() ); + this.adaptorHash = newAdaptorHash; + this.adaptor = InventoryAdaptor.getAdaptor( target, this.side.getOpposite() ); - return adaptor; + return this.adaptor; } boolean lastRedstone = false; @@ -103,12 +103,12 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid @Override public void onNeighborChanged() { - updateState(); - if ( lastRedstone != host.hasRedstone( side ) ) + this.updateState(); + if ( this.lastRedstone != this.host.hasRedstone( this.side ) ) { - lastRedstone = !lastRedstone; - if ( lastRedstone && getRSMode() == RedstoneMode.SIGNAL_PULSE ) - doBusWork(); + this.lastRedstone = !this.lastRedstone; + if ( this.lastRedstone && this.getRSMode() == RedstoneMode.SIGNAL_PULSE ) + this.doBusWork(); } } @@ -116,10 +116,10 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid { try { - if ( !isSleeping() ) - proxy.getTick().wakeDevice( proxy.getNode() ); + if ( !this.isSleeping() ) + this.proxy.getTick().wakeDevice( this.proxy.getNode() ); else - proxy.getTick().sleepDevice( proxy.getNode() ); + this.proxy.getTick().sleepDevice( this.proxy.getNode() ); } catch (GridAccessException e) { @@ -131,7 +131,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid public IInventory getInventoryByName(String name) { if ( name.equals( "config" ) ) - return config; + return this.config; return super.getInventoryByName( name ); } diff --git a/src/main/java/appeng/parts/automation/PartUpgradeable.java b/src/main/java/appeng/parts/automation/PartUpgradeable.java index d5c562fe9..3cd3ca7a7 100644 --- a/src/main/java/appeng/parts/automation/PartUpgradeable.java +++ b/src/main/java/appeng/parts/automation/PartUpgradeable.java @@ -35,18 +35,18 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor { final IConfigManager settings = new ConfigManager( this ); - private final UpgradeInventory upgrades = new UpgradeInventory( is, this, getUpgradeSlots() ); + private final UpgradeInventory upgrades = new UpgradeInventory( this.is, this, this.getUpgradeSlots() ); @Override public int getInstalledUpgrades(Upgrades u) { - return upgrades.getInstalledUpgrades( u ); + return this.upgrades.getInstalledUpgrades( u ); } @Override public boolean canConnectRedstone() { - return upgrades.getMaxInstalled( Upgrades.REDSTONE ) > 0; + return this.upgrades.getMaxInstalled( Upgrades.REDSTONE ) > 0; } protected int getUpgradeSlots() @@ -57,7 +57,7 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor @Override public void getDrops(List drops, boolean wrenched) { - for (ItemStack is : upgrades) + for (ItemStack is : this.upgrades) if ( is != null ) drops.add( is ); } @@ -66,34 +66,34 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra) { super.writeToNBT( extra ); - settings.writeToNBT( extra ); - upgrades.writeToNBT( extra, "upgrades" ); + this.settings.writeToNBT( extra ); + this.upgrades.writeToNBT( extra, "upgrades" ); } @Override public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra) { super.readFromNBT( extra ); - settings.readFromNBT( extra ); - upgrades.readFromNBT( extra, "upgrades" ); + this.settings.readFromNBT( extra ); + this.upgrades.readFromNBT( extra, "upgrades" ); } public PartUpgradeable(Class c, ItemStack is) { super( c, is ); - upgrades.setMaxStackSize( 1 ); + this.upgrades.setMaxStackSize( 1 ); } @Override public IConfigManager getConfigManager() { - return settings; + return this.settings; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "upgrades" ) ) - return upgrades; + return this.upgrades; return null; } @@ -112,9 +112,9 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - if ( inv == upgrades ) + if ( inv == this.upgrades ) { - upgradesChanged(); + this.upgradesChanged(); } } @@ -125,21 +125,21 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor protected boolean isSleeping() { - if ( getInstalledUpgrades( Upgrades.REDSTONE ) > 0 ) + if ( this.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 ) { - switch (getRSMode()) + switch (this.getRSMode()) { case IGNORE: return false; case HIGH_SIGNAL: - if ( host.hasRedstone( side ) ) + if ( this.host.hasRedstone( this.side ) ) return false; break; case LOW_SIGNAL: - if ( !host.hasRedstone( side ) ) + if ( !this.host.hasRedstone( this.side ) ) return false; break; diff --git a/src/main/java/appeng/parts/automation/UpgradeInventory.java b/src/main/java/appeng/parts/automation/UpgradeInventory.java index 0fa41feb0..482d11025 100644 --- a/src/main/java/appeng/parts/automation/UpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/UpgradeInventory.java @@ -47,8 +47,8 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE public UpgradeInventory(Object itemOrBlock, IAEAppEngInventory _te, int s) { super( null, s ); - te = this; - parent = _te; + this.te = this; + this.parent = _te; this.itemOrBlock = itemOrBlock; } @@ -69,7 +69,7 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE Upgrades u = ((IUpgradeModule) it).getType( itemstack ); if ( u != null ) { - return getInstalledUpgrades( u ) < getMaxInstalled( u ); + return this.getInstalledUpgrades( u ) < this.getMaxInstalled( u ); } } return false; @@ -80,17 +80,17 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE Integer max = null; for (ItemStack is : u.getSupported().keySet()) { - if ( is.getItem() == itemOrBlock ) + if ( is.getItem() == this.itemOrBlock ) { max = u.getSupported().get( is ); break; } - else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == itemOrBlock ) + else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == this.itemOrBlock ) { max = u.getSupported().get( is ); break; } - else if ( itemOrBlock instanceof ItemStack && Platform.isSameItem( (ItemStack) itemOrBlock, is ) ) + else if ( this.itemOrBlock instanceof ItemStack && Platform.isSameItem( (ItemStack) this.itemOrBlock, is ) ) { max = u.getSupported().get( is ); break; @@ -110,8 +110,8 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE private void updateUpgradeInfo() { - cached = true; - InverterUpgrades = CapacityUpgrades = RedstoneUpgrades = SpeedUpgrades = FuzzyUpgrades = CraftingUpgrades = 0; + this.cached = true; + this.InverterUpgrades = this.CapacityUpgrades = this.RedstoneUpgrades = this.SpeedUpgrades = this.FuzzyUpgrades = this.CraftingUpgrades = 0; for (ItemStack is : this) { @@ -122,55 +122,55 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE switch (myUpgrade) { case CAPACITY: - CapacityUpgrades++; + this.CapacityUpgrades++; break; case FUZZY: - FuzzyUpgrades++; + this.FuzzyUpgrades++; break; case REDSTONE: - RedstoneUpgrades++; + this.RedstoneUpgrades++; break; case SPEED: - SpeedUpgrades++; + this.SpeedUpgrades++; break; case INVERTER: - InverterUpgrades++; + this.InverterUpgrades++; break; case CRAFTING: - CraftingUpgrades++; + this.CraftingUpgrades++; break; default: break; } } - CapacityUpgrades = Math.min( CapacityUpgrades, getMaxInstalled( Upgrades.CAPACITY ) ); - FuzzyUpgrades = Math.min( FuzzyUpgrades, getMaxInstalled( Upgrades.FUZZY ) ); - RedstoneUpgrades = Math.min( RedstoneUpgrades, getMaxInstalled( Upgrades.REDSTONE ) ); - SpeedUpgrades = Math.min( SpeedUpgrades, getMaxInstalled( Upgrades.SPEED ) ); - InverterUpgrades = Math.min( InverterUpgrades, getMaxInstalled( Upgrades.INVERTER ) ); - CraftingUpgrades = Math.min( CraftingUpgrades, getMaxInstalled( Upgrades.CRAFTING ) ); + this.CapacityUpgrades = Math.min( this.CapacityUpgrades, this.getMaxInstalled( Upgrades.CAPACITY ) ); + this.FuzzyUpgrades = Math.min( this.FuzzyUpgrades, this.getMaxInstalled( Upgrades.FUZZY ) ); + this.RedstoneUpgrades = Math.min( this.RedstoneUpgrades, this.getMaxInstalled( Upgrades.REDSTONE ) ); + this.SpeedUpgrades = Math.min( this.SpeedUpgrades, this.getMaxInstalled( Upgrades.SPEED ) ); + this.InverterUpgrades = Math.min( this.InverterUpgrades, this.getMaxInstalled( Upgrades.INVERTER ) ); + this.CraftingUpgrades = Math.min( this.CraftingUpgrades, this.getMaxInstalled( Upgrades.CRAFTING ) ); } public int getInstalledUpgrades(Upgrades u) { - if ( !cached ) - updateUpgradeInfo(); + if ( !this.cached ) + this.updateUpgradeInfo(); switch (u) { case CAPACITY: - return CapacityUpgrades; + return this.CapacityUpgrades; case FUZZY: - return FuzzyUpgrades; + return this.FuzzyUpgrades; case REDSTONE: - return RedstoneUpgrades; + return this.RedstoneUpgrades; case SPEED: - return SpeedUpgrades; + return this.SpeedUpgrades; case INVERTER: - return InverterUpgrades; + return this.InverterUpgrades; case CRAFTING: - return CraftingUpgrades; + return this.CraftingUpgrades; default: return 0; } @@ -180,21 +180,21 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE public void readFromNBT(NBTTagCompound target) { super.readFromNBT( target ); - updateUpgradeInfo(); + this.updateUpgradeInfo(); } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - cached = false; - if ( parent != null && Platform.isServer() ) - parent.onChangeInventory( inv, slot, mc, removedStack, newStack ); + this.cached = false; + if ( this.parent != null && Platform.isServer() ) + this.parent.onChangeInventory( inv, slot, mc, removedStack, newStack ); } @Override public void saveChanges() { - parent.saveChanges(); + this.parent.saveChanges(); } } diff --git a/src/main/java/appeng/parts/layers/InvLayerData.java b/src/main/java/appeng/parts/layers/InvLayerData.java index 02309e69b..b27fe2ad2 100644 --- a/src/main/java/appeng/parts/layers/InvLayerData.java +++ b/src/main/java/appeng/parts/layers/InvLayerData.java @@ -36,9 +36,9 @@ public class InvLayerData final private List slots; public InvLayerData(int a[][], List b, List c) { - sides = a; - inventories = b; - slots = c; + this.sides = a; + this.inventories = b; + this.slots = c; } /** @@ -49,77 +49,77 @@ public class InvLayerData */ boolean isSlotValid(int slot) { - return slots != null && slot >= 0 && slot < slots.size(); + return this.slots != null && slot >= 0 && slot < this.slots.size(); } public ItemStack decreaseStackSize(int slot, int amount) { - if ( isSlotValid( slot ) ) - return slots.get( slot ).decreaseStackSize( amount ); + if ( this.isSlotValid( slot ) ) + return this.slots.get( slot ).decreaseStackSize( amount ); return null; } public int getSizeInventory() { - if ( slots == null ) + if ( this.slots == null ) return 0; - return slots.size(); + return this.slots.size(); } public ItemStack getStackInSlot(int slot) { - if ( isSlotValid( slot ) ) - return slots.get( slot ).getStackInSlot(); + if ( this.isSlotValid( slot ) ) + return this.slots.get( slot ).getStackInSlot(); return null; } public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - if ( isSlotValid( slot ) ) - return slots.get( slot ).isItemValidForSlot( itemstack ); + if ( this.isSlotValid( slot ) ) + return this.slots.get( slot ).isItemValidForSlot( itemstack ); return false; } public void setInventorySlotContents(int slot, ItemStack itemstack) { - if ( isSlotValid( slot ) ) - slots.get( slot ).setInventorySlotContents( itemstack ); + if ( this.isSlotValid( slot ) ) + this.slots.get( slot ).setInventorySlotContents( itemstack ); } public boolean canExtractItem(int slot, ItemStack itemstack, int side) { - if ( isSlotValid( slot ) ) - return slots.get( slot ).canExtractItem( itemstack, side ); + if ( this.isSlotValid( slot ) ) + return this.slots.get( slot ).canExtractItem( itemstack, side ); return false; } public boolean canInsertItem(int slot, ItemStack itemstack, int side) { - if ( isSlotValid( slot ) ) - return slots.get( slot ).canInsertItem( itemstack, side ); + if ( this.isSlotValid( slot ) ) + return this.slots.get( slot ).canInsertItem( itemstack, side ); return false; } public void markDirty() { - if ( inventories != null ) + if ( this.inventories != null ) { - for (IInventory inv : inventories) + for (IInventory inv : this.inventories) inv.markDirty(); } } public int[] getAccessibleSlotsFromSide(int side) { - if ( sides == null || side < 0 || side > 5 ) + if ( this.sides == null || side < 0 || side > 5 ) return nullSides; - return sides[side]; + return this.sides[side]; } } diff --git a/src/main/java/appeng/parts/layers/InvSot.java b/src/main/java/appeng/parts/layers/InvSot.java index 184de993e..b335870cf 100644 --- a/src/main/java/appeng/parts/layers/InvSot.java +++ b/src/main/java/appeng/parts/layers/InvSot.java @@ -28,38 +28,38 @@ public class InvSot final public int index; public InvSot(ISidedInventory part, int slot) { - partInv = part; - index = slot; + this.partInv = part; + this.index = slot; } public ItemStack decreaseStackSize(int j) { - return partInv.decrStackSize( index, j ); + return this.partInv.decrStackSize( this.index, j ); } public ItemStack getStackInSlot() { - return partInv.getStackInSlot( index ); + return this.partInv.getStackInSlot( this.index ); } public boolean isItemValidForSlot(ItemStack itemstack) { - return partInv.isItemValidForSlot( index, itemstack ); + return this.partInv.isItemValidForSlot( this.index, itemstack ); } public void setInventorySlotContents(ItemStack itemstack) { - partInv.setInventorySlotContents( index, itemstack ); + this.partInv.setInventorySlotContents( this.index, itemstack ); } public boolean canExtractItem(ItemStack itemstack, int side) { - return partInv.canExtractItem( index, itemstack, side ); + return this.partInv.canExtractItem( this.index, itemstack, side ); } public boolean canInsertItem(ItemStack itemstack, int side) { - return partInv.canInsertItem( index, itemstack, side ); + return this.partInv.canInsertItem( this.index, itemstack, side ); } } diff --git a/src/main/java/appeng/parts/layers/LayerIBatteryProvider.java b/src/main/java/appeng/parts/layers/LayerIBatteryProvider.java index 7d57001cd..65d10730e 100644 --- a/src/main/java/appeng/parts/layers/LayerIBatteryProvider.java +++ b/src/main/java/appeng/parts/layers/LayerIBatteryProvider.java @@ -30,7 +30,7 @@ public class LayerIBatteryProvider extends LayerBase implements ISidedBatteryPro @Override public IBatteryObject getMjBattery(String kind, ForgeDirection direction) { - IPart p = getPart( direction ); + IPart p = this.getPart( direction ); if ( p instanceof ISidedBatteryProvider ) return ((ISidedBatteryProvider) p).getMjBattery( kind, direction ); diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySink.java b/src/main/java/appeng/parts/layers/LayerIEnergySink.java index 50187d260..eabe43333 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySink.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySink.java @@ -35,7 +35,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink private boolean isInIC2() { - return getLayerFlags().contains( LayerFlags.IC2_ENET ); + return this.getLayerFlags().contains( LayerFlags.IC2_ENET ); } private TileEntity getEnergySinkTile() @@ -46,15 +46,15 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink private World getEnergySinkWorld() { - if ( getEnergySinkTile() == null ) + if ( this.getEnergySinkTile() == null ) return null; - return getEnergySinkTile().getWorldObj(); + return this.getEnergySinkTile().getWorldObj(); } private boolean isTileValid() { - TileEntity te = getEnergySinkTile(); + TileEntity te = this.getEnergySinkTile(); if ( te == null ) return false; @@ -64,28 +64,28 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink private void addToENet() { - if ( getEnergySinkWorld() == null ) + if ( this.getEnergySinkWorld() == null ) return; // re-add - removeFromENet(); + this.removeFromENet(); - if ( !isInIC2() && Platform.isServer() && isTileValid() ) + if ( !this.isInIC2() && Platform.isServer() && this.isTileValid() ) { - getLayerFlags().add( LayerFlags.IC2_ENET ); - MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) getEnergySinkTile() ) ); + this.getLayerFlags().add( LayerFlags.IC2_ENET ); + MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) this.getEnergySinkTile() ) ); } } private void removeFromENet() { - if ( getEnergySinkWorld() == null ) + if ( this.getEnergySinkWorld() == null ) return; - if ( isInIC2() && Platform.isServer() ) + if ( this.isInIC2() && Platform.isServer() ) { - getLayerFlags().remove( LayerFlags.IC2_ENET ); - MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) getEnergySinkTile() ) ); + this.getLayerFlags().remove( LayerFlags.IC2_ENET ); + MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) this.getEnergySinkTile() ) ); } } @@ -97,7 +97,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink int interested = 0; for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergyTile ) { interested++; @@ -111,19 +111,19 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink { super.partChanged(); - if ( interestedInIC2() ) - addToENet(); + if ( this.interestedInIC2() ) + this.addToENet(); else - removeFromENet(); + this.removeFromENet(); } @Override public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - if ( !isInIC2() ) + if ( !this.isInIC2() ) return false; - IPart part = getPart( direction ); + IPart part = this.getPart( direction ); if ( part instanceof IEnergySink ) return ((IEnergySink) part).acceptsEnergyFrom( emitter, direction ); return false; @@ -132,14 +132,14 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink @Override public double getDemandedEnergy() { - if ( !isInIC2() ) + if ( !this.isInIC2() ) return 0; // this is a flawed implementation, that requires a change to the IC2 API. for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergySink ) { // use lower number cause ic2 deletes power it sends that isn't received. @@ -153,12 +153,12 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink @Override public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { - if ( !isInIC2() ) + if ( !this.isInIC2() ) return amount; for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergySink ) { return ((IEnergySink) part).injectEnergy( directionFrom, amount, voltage ); diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySource.java b/src/main/java/appeng/parts/layers/LayerIEnergySource.java index 3afac4ca5..f418ba9f2 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySource.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySource.java @@ -37,7 +37,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource private boolean isInIC2() { - return getLayerFlags().contains( LayerFlags.IC2_ENET ); + return this.getLayerFlags().contains( LayerFlags.IC2_ENET ); } private TileEntity getEnergySourceTile() @@ -48,14 +48,14 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource private World getEnergySourceWorld() { - if ( getEnergySourceTile() == null ) + if ( this.getEnergySourceTile() == null ) return null; - return getEnergySourceTile().getWorldObj(); + return this.getEnergySourceTile().getWorldObj(); } private boolean isTileValid() { - TileEntity te = getEnergySourceTile(); + TileEntity te = this.getEnergySourceTile(); if ( te == null ) return false; return !te.isInvalid(); @@ -63,28 +63,28 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource private void addToENet() { - if ( getEnergySourceWorld() == null ) + if ( this.getEnergySourceWorld() == null ) return; // re-add - removeFromENet(); + this.removeFromENet(); - if ( !isInIC2() && Platform.isServer() && isTileValid() ) + if ( !this.isInIC2() && Platform.isServer() && this.isTileValid() ) { - getLayerFlags().add( LayerFlags.IC2_ENET ); - MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) getEnergySourceTile() ) ); + this.getLayerFlags().add( LayerFlags.IC2_ENET ); + MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) this.getEnergySourceTile() ) ); } } private void removeFromENet() { - if ( getEnergySourceWorld() == null ) + if ( this.getEnergySourceWorld() == null ) return; - if ( isInIC2() && Platform.isServer() ) + if ( this.isInIC2() && Platform.isServer() ) { - getLayerFlags().remove( LayerFlags.IC2_ENET ); - MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) getEnergySourceTile() ) ); + this.getLayerFlags().remove( LayerFlags.IC2_ENET ); + MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) this.getEnergySourceTile() ) ); } } @@ -96,7 +96,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource int interested = 0; for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergyTile ) { interested++; @@ -110,19 +110,19 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource { super.partChanged(); - if ( interestedInIC2() ) - addToENet(); + if ( this.interestedInIC2() ) + this.addToENet(); else - removeFromENet(); + this.removeFromENet(); } @Override public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { - if ( !isInIC2() ) + if ( !this.isInIC2() ) return false; - IPart part = getPart( direction ); + IPart part = this.getPart( direction ); if ( part instanceof IEnergySink ) return ((IEnergyEmitter) part).emitsEnergyTo( receiver, direction ); return false; @@ -131,14 +131,14 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource @Override public double getOfferedEnergy() { - if ( !isInIC2() ) + if ( !this.isInIC2() ) return 0; // this is a flawed implementation, that requires a change to the IC2 API. for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergySource ) { // use lower number cause ic2 deletes power it sends that isn't received. @@ -156,7 +156,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergySource ) { ((IEnergySource) part).drawEnergy( amount ); @@ -172,7 +172,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getPart( dir ); + IPart part = this.getPart( dir ); if ( part instanceof IEnergySource ) { return ((IEnergySource) part).getSourceTier(); diff --git a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java index a31be5b73..8ae69581e 100644 --- a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java +++ b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java @@ -33,7 +33,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).fill( from, resource, doFill ); return 0; @@ -42,7 +42,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).drain( from, resource, doDrain ); return null; @@ -51,7 +51,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).drain( from, maxDrain, doDrain ); return null; @@ -60,7 +60,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public boolean canFill(ForgeDirection from, net.minecraftforge.fluids.Fluid fluid) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).canFill( from, fluid ); return false; @@ -69,7 +69,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public boolean canDrain(ForgeDirection from, net.minecraftforge.fluids.Fluid fluid) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).canDrain( from, fluid ); return false; @@ -78,7 +78,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - IPart part = getPart( from ); + IPart part = this.getPart( from ); if ( part instanceof IFluidHandler ) return ((IFluidHandler) part).getTankInfo( from ); return emptyList; diff --git a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java index 55f910b8b..0f2250e63 100644 --- a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java +++ b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java @@ -30,7 +30,7 @@ public class LayerIPipeConnection extends LayerBase implements IPipeConnection @Override public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with) { - IPart part = getPart( with ); + IPart part = this.getPart( with ); if ( part instanceof IPipeConnection ) return ((IPipeConnection) part).overridePipeConnection( type, with ); return ConnectOverride.DEFAULT; diff --git a/src/main/java/appeng/parts/layers/LayerIPowerEmitter.java b/src/main/java/appeng/parts/layers/LayerIPowerEmitter.java index d851131ce..faf4810a4 100644 --- a/src/main/java/appeng/parts/layers/LayerIPowerEmitter.java +++ b/src/main/java/appeng/parts/layers/LayerIPowerEmitter.java @@ -29,7 +29,7 @@ public class LayerIPowerEmitter extends LayerBase implements IPowerEmitter @Override public boolean canEmitPowerFrom(ForgeDirection side) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); if ( part instanceof IPowerEmitter ) return ((IPowerEmitter) part).canEmitPowerFrom( side ); return false; diff --git a/src/main/java/appeng/parts/layers/LayerIPowerReceptor.java b/src/main/java/appeng/parts/layers/LayerIPowerReceptor.java index 4d35bb33a..f640c360e 100644 --- a/src/main/java/appeng/parts/layers/LayerIPowerReceptor.java +++ b/src/main/java/appeng/parts/layers/LayerIPowerReceptor.java @@ -33,7 +33,7 @@ public class LayerIPowerReceptor extends LayerBase implements IPowerReceptor @Override public PowerReceiver getPowerReceiver(ForgeDirection side) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); if ( part instanceof IPowerReceptor ) return ((IPowerReceptor) part).getPowerReceiver( side ); return null; diff --git a/src/main/java/appeng/parts/layers/LayerISidedInventory.java b/src/main/java/appeng/parts/layers/LayerISidedInventory.java index 77b8cc5bb..36620d3b8 100644 --- a/src/main/java/appeng/parts/layers/LayerISidedInventory.java +++ b/src/main/java/appeng/parts/layers/LayerISidedInventory.java @@ -65,7 +65,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - IPart bp = getPart( side ); + IPart bp = this.getPart( side ); if ( bp instanceof ISidedInventory ) { ISidedInventory part = (ISidedInventory) bp; @@ -92,7 +92,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory ForgeDirection currentSide = ForgeDirection.UNKNOWN; for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - if ( getPart( side ) == sides ) + if ( this.getPart( side ) == sides ) { currentSide = side; break; @@ -108,9 +108,9 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } if ( sideData == null || slots == null ) - invLayer = null; + this.invLayer = null; else - invLayer = new InvLayerData( sideData, inventories, slots ); + this.invLayer = new InvLayerData( sideData, inventories, slots ); // make sure inventory is updated before we call FMP. super.notifyNeighbors(); @@ -119,71 +119,71 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory @Override public ItemStack decrStackSize(int slot, int amount) { - if ( invLayer == null ) + if ( this.invLayer == null ) return null; - return invLayer.decreaseStackSize( slot, amount ); + return this.invLayer.decreaseStackSize( slot, amount ); } @Override public int getSizeInventory() { - if ( invLayer == null ) + if ( this.invLayer == null ) return 0; - return invLayer.getSizeInventory(); + return this.invLayer.getSizeInventory(); } @Override public ItemStack getStackInSlot(int slot) { - if ( invLayer == null ) + if ( this.invLayer == null ) return null; - return invLayer.getStackInSlot( slot ); + return this.invLayer.getStackInSlot( slot ); } @Override public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - if ( invLayer == null ) + if ( this.invLayer == null ) return false; - return invLayer.isItemValidForSlot( slot, itemstack ); + return this.invLayer.isItemValidForSlot( slot, itemstack ); } @Override public void setInventorySlotContents(int slot, ItemStack itemstack) { - if ( invLayer == null ) + if ( this.invLayer == null ) return; - invLayer.setInventorySlotContents( slot, itemstack ); + this.invLayer.setInventorySlotContents( slot, itemstack ); } @Override public boolean canExtractItem(int slot, ItemStack itemstack, int side) { - if ( invLayer == null ) + if ( this.invLayer == null ) return false; - return invLayer.canExtractItem( slot, itemstack, side ); + return this.invLayer.canExtractItem( slot, itemstack, side ); } @Override public boolean canInsertItem(int slot, ItemStack itemstack, int side) { - if ( invLayer == null ) + if ( this.invLayer == null ) return false; - return invLayer.canInsertItem( slot, itemstack, side ); + return this.invLayer.canInsertItem( slot, itemstack, side ); } @Override public void markDirty() { - if ( invLayer != null ) - invLayer.markDirty(); + if ( this.invLayer != null ) + this.invLayer.markDirty(); super.markForSave(); } @@ -191,8 +191,8 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory @Override public int[] getAccessibleSlotsFromSide(int side) { - if ( invLayer != null ) - return invLayer.getAccessibleSlotsFromSide( side ); + if ( this.invLayer != null ) + return this.invLayer.getAccessibleSlotsFromSide( side ); return nullSides; } diff --git a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java index 5ca4209a7..960e4b759 100644 --- a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java +++ b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java @@ -31,7 +31,7 @@ public class LayerITileStorageMonitorable extends LayerBase implements ITileStor @Override public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) { - IPart part = getPart( side ); + IPart part = this.getPart( side ); if ( part instanceof ITileStorageMonitorable ) return ((ITileStorageMonitorable) part).getMonitorable( side, src ); return null; diff --git a/src/main/java/appeng/parts/misc/PartCableAnchor.java b/src/main/java/appeng/parts/misc/PartCableAnchor.java index 696dc7aaf..b6a89cc72 100644 --- a/src/main/java/appeng/parts/misc/PartCableAnchor.java +++ b/src/main/java/appeng/parts/misc/PartCableAnchor.java @@ -62,10 +62,10 @@ public class PartCableAnchor implements IPart @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - IIcon myIcon = is.getIconIndex(); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + IIcon myIcon = this.is.getIconIndex(); rh.setTexture( myIcon ); - if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null ) + if ( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) rh.setBounds( 7, 7, 10, 9, 9, 14 ); else rh.setBounds( 7, 7, 10, 9, 9, 16 ); @@ -84,7 +84,7 @@ public class PartCableAnchor implements IPart @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer) { - instance.setTexture( is.getIconIndex() ); + instance.setTexture( this.is.getIconIndex() ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); instance.renderInventoryBox( renderer ); instance.setTexture( null ); @@ -93,7 +93,7 @@ public class PartCableAnchor implements IPart @Override public void getBoxes(IPartCollisionHelper bch) { - if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null ) + if ( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) bch.addBox( 7, 7, 10, 9, 9, 14 ); else bch.addBox( 7, 7, 10, 9, 9, 16 ); @@ -102,7 +102,7 @@ public class PartCableAnchor implements IPart @Override public ItemStack getItemStack(PartItemStack wrenched) { - return is; + return this.is; } @Override @@ -212,7 +212,7 @@ public class PartCableAnchor implements IPart public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { this.host = host; - mySide = side; + this.mySide = side; } @Override @@ -236,7 +236,7 @@ public class PartCableAnchor implements IPart @Override public boolean isLadder(EntityLivingBase entity) { - return mySide.offsetY == 0 && ( entity.isCollidedHorizontally || ! entity.onGround ); + return this.mySide.offsetY == 0 && ( entity.isCollidedHorizontally || ! entity.onGround ); } @Override diff --git a/src/main/java/appeng/parts/misc/PartInterface.java b/src/main/java/appeng/parts/misc/PartInterface.java index 7d5f2a3a6..c0e6d666c 100644 --- a/src/main/java/appeng/parts/misc/PartInterface.java +++ b/src/main/java/appeng/parts/misc/PartInterface.java @@ -73,7 +73,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost { - final DualityInterface duality = new DualityInterface( proxy, this ); + final DualityInterface duality = new DualityInterface( this.proxy, this ); public PartInterface(ItemStack is) { super( PartInterface.class, is ); @@ -83,45 +83,45 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto public void addToWorld() { super.addToWorld(); - duality.initialize(); + this.duality.initialize(); } @MENetworkEventSubscribe public void stateChange(MENetworkChannelsChanged c) { - duality.notifyNeighbors(); + this.duality.notifyNeighbors(); } @MENetworkEventSubscribe public void stateChange(MENetworkPowerStatusChange c) { - duality.notifyNeighbors(); + this.duality.notifyNeighbors(); } @Override public void gridChanged() { - duality.gridChanged(); + this.duality.gridChanged(); } @Override public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - duality.writeToNBT( data ); + this.duality.writeToNBT( data ); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - duality.readFromNBT( data ); + this.duality.readFromNBT( data ); } @Override public void getDrops(List drops, boolean wrenched) { - duality.addDrops( drops ); + this.duality.addDrops( drops ); } @Override @@ -129,7 +129,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 3, 3, 15, 13, 13, 16 ); rh.renderInventoryBox( renderer ); @@ -145,33 +145,33 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 5, 5, 12, 11, 11, 13 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 5, 5, 13, 11, 11, 14 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override public IIcon getBreakingTexture() { - return is.getIconIndex(); + return this.is.getIconIndex(); } @Override @@ -196,127 +196,127 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @Override public boolean canInsert(ItemStack stack) { - return duality.canInsert( stack ); + return this.duality.canInsert( stack ); } @Override public IMEMonitor getItemInventory() { - return duality.getItemInventory(); + return this.duality.getItemInventory(); } @Override public IMEMonitor getFluidInventory() { - return duality.getFluidInventory(); + return this.duality.getFluidInventory(); } @Override public TickingRequest getTickingRequest(IGridNode node) { - return duality.getTickingRequest( node ); + return this.duality.getTickingRequest( node ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - return duality.tickingRequest( node, TicksSinceLastCall ); + return this.duality.tickingRequest( node, TicksSinceLastCall ); } @Override public int getSizeInventory() { - return duality.getStorage().getSizeInventory(); + return this.duality.getStorage().getSizeInventory(); } @Override public ItemStack getStackInSlot(int i) { - return duality.getStorage().getStackInSlot( i ); + return this.duality.getStorage().getStackInSlot( i ); } @Override public ItemStack decrStackSize(int i, int j) { - return duality.getStorage().decrStackSize( i, j ); + return this.duality.getStorage().decrStackSize( i, j ); } @Override public ItemStack getStackInSlotOnClosing(int i) { - return duality.getStorage().getStackInSlotOnClosing( i ); + return this.duality.getStorage().getStackInSlotOnClosing( i ); } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - duality.getStorage().setInventorySlotContents( i, itemstack ); + this.duality.getStorage().setInventorySlotContents( i, itemstack ); } @Override public String getInventoryName() { - return duality.getStorage().getInventoryName(); + return this.duality.getStorage().getInventoryName(); } @Override public boolean hasCustomInventoryName() { - return duality.getStorage().hasCustomInventoryName(); + return this.duality.getStorage().hasCustomInventoryName(); } @Override public int getInventoryStackLimit() { - return duality.getStorage().getInventoryStackLimit(); + return this.duality.getStorage().getInventoryStackLimit(); } @Override public IConfigManager getConfigManager() { - return duality.getConfigManager(); + return this.duality.getConfigManager(); } @Override public IInventory getInventoryByName(String name) { - return duality.getInventoryByName( name ); + return this.duality.getInventoryByName( name ); } @Override public void markDirty() { - duality.getStorage().markDirty(); + this.duality.getStorage().markDirty(); } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return duality.getStorage().isUseableByPlayer( entityplayer ); + return this.duality.getStorage().isUseableByPlayer( entityplayer ); } @Override public void openInventory() { - duality.getStorage().openInventory(); + this.duality.getStorage().openInventory(); } @Override public void closeInventory() { - duality.getStorage().closeInventory(); + this.duality.getStorage().closeInventory(); } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return duality.getStorage().isItemValidForSlot( i, itemstack ); + return this.duality.getStorage().isItemValidForSlot( i, itemstack ); } @Override public int[] getAccessibleSlotsFromSide(int s) { - return duality.getAccessibleSlotsFromSide( s ); + return this.duality.getAccessibleSlotsFromSide( s ); } @Override @@ -334,13 +334,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - duality.onChangeInventory( inv, slot, mc, removedStack, newStack ); + this.duality.onChangeInventory( inv, slot, mc, removedStack, newStack ); } @Override public DualityInterface getInterfaceDuality() { - return duality; + return this.duality; } @Override @@ -350,7 +350,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto return false; if ( Platform.isServer() ) - Platform.openGUI( p, getTileEntity(), side, GuiBridge.GUI_INTERFACE ); + Platform.openGUI( p, this.getTileEntity(), this.side, GuiBridge.GUI_INTERFACE ); return true; } @@ -358,67 +358,67 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @Override public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) { - return duality.getMonitorable( side, src, this ); + return this.duality.getMonitorable( side, src, this ); } @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) { - return duality.pushPattern( patternDetails, table ); + return this.duality.pushPattern( patternDetails, table ); } @Override public void provideCrafting(ICraftingProviderHelper craftingTracker) { - duality.provideCrafting( craftingTracker ); + this.duality.provideCrafting( craftingTracker ); } @Override public EnumSet getTargets() { - return EnumSet.of( side ); + return EnumSet.of( this.side ); } @Override public boolean isBusy() { - return duality.isBusy(); + return this.duality.isBusy(); } @Override public int getInstalledUpgrades(Upgrades u) { - return duality.getInstalledUpgrades( u ); + return this.duality.getInstalledUpgrades( u ); } @Override public ImmutableSet getRequestedJobs() { - return duality.getRequestedJobs(); + return this.duality.getRequestedJobs(); } @Override public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) { - return duality.injectCraftedItems( link, items, mode ); + return this.duality.injectCraftedItems( link, items, mode ); } @Override public void jobStateChange(ICraftingLink link) { - duality.jobStateChange( link ); + this.duality.jobStateChange( link ); } @Override public int getPriority() { - return duality.getPriority(); + return this.duality.getPriority(); } @Override public void setPriority(int newValue) { - duality.setPriority( newValue ); + this.duality.setPriority( newValue ); } } diff --git a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java index 997ce9bfb..3d95ce146 100644 --- a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java @@ -25,10 +25,10 @@ public class PartInvertedToggleBus extends PartToggleBus public PartInvertedToggleBus(ItemStack is) { super( PartInvertedToggleBus.class, is ); - proxy.setIdlePowerUsage( 0.0 ); - outerProxy.setIdlePowerUsage( 0.0 ); - proxy.setFlags(); - outerProxy.setFlags(); + this.proxy.setIdlePowerUsage( 0.0 ); + this.outerProxy.setIdlePowerUsage( 0.0 ); + this.proxy.setFlags(); + this.outerProxy.setFlags(); } @Override diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index c9b5425f6..b1ce1d9b8 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -102,10 +102,10 @@ public class PartStorageBus public PartStorageBus( ItemStack is ) { super( PartStorageBus.class, is ); - getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE ); - getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); - getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY ); - mySrc = new MachineSource( this ); + this.getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE ); + this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY ); + this.mySrc = new MachineSource( this ); } boolean cached = false; @@ -119,25 +119,25 @@ public class PartStorageBus @MENetworkEventSubscribe public void powerRender( MENetworkPowerStatusChange c ) { - updateStatus(); + this.updateStatus(); } @MENetworkEventSubscribe public void updateChannels( MENetworkChannelsChanged changedChannels ) { - updateStatus(); + this.updateStatus(); } private void updateStatus() { - boolean currentActive = proxy.isActive(); - if ( wasActive != currentActive ) + boolean currentActive = this.proxy.isActive(); + if ( this.wasActive != currentActive ) { - wasActive = currentActive; + this.wasActive = currentActive; try { - proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - host.markForUpdate(); + this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.host.markForUpdate(); } catch ( GridAccessException e ) { @@ -154,7 +154,7 @@ public class PartStorageBus if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_STORAGEBUS ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_STORAGEBUS ); return true; } @@ -170,14 +170,14 @@ public class PartStorageBus @Override public boolean isValid( Object verificationToken ) { - return handler == verificationToken; + return this.handler == verificationToken; } @Override public IInventory getInventoryByName( String name ) { if ( name.equals( "config" ) ) - return Config; + return this.Config; return super.getInventoryByName( name ); } @@ -186,17 +186,17 @@ public class PartStorageBus private void resetCache( boolean fullReset ) { - if ( host == null || host.getTile() == null || host.getTile().getWorldObj() == null || host.getTile().getWorldObj().isRemote ) + if ( this.host == null || this.host.getTile() == null || this.host.getTile().getWorldObj() == null || this.host.getTile().getWorldObj().isRemote ) return; if ( fullReset ) - resetCacheLogic = 2; + this.resetCacheLogic = 2; else - resetCacheLogic = 1; + this.resetCacheLogic = 1; try { - proxy.getTick().alertDevice( proxy.getNode() ); + this.proxy.getTick().alertDevice( this.proxy.getNode() ); } catch ( GridAccessException e ) { @@ -206,34 +206,34 @@ public class PartStorageBus private void resetCache() { - boolean fullReset = resetCacheLogic == 2; - resetCacheLogic = 0; + boolean fullReset = this.resetCacheLogic == 2; + this.resetCacheLogic = 0; - IMEInventory in = getInternalHandler(); + IMEInventory in = this.getInternalHandler(); IItemList before = AEApi.instance().storage().createItemList(); if ( in != null ) before = in.getAvailableItems( before ); - cached = false; + this.cached = false; if ( fullReset ) - handlerHash = 0; + this.handlerHash = 0; - IMEInventory out = getInternalHandler(); + IMEInventory out = this.getInternalHandler(); - if ( monitor != null ) - monitor.onTick(); + if ( this.monitor != null ) + this.monitor.onTick(); IItemList after = AEApi.instance().storage().createItemList(); if ( out != null ) after = out.getAvailableItems( after ); - Platform.postListChanges( before, after, this, mySrc ); + Platform.postListChanges( before, after, this, this.mySrc ); } @Override public void onNeighborChanged() { - resetCache( false ); + this.resetCache( false ); } @Override @@ -241,119 +241,119 @@ public class PartStorageBus { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); - if ( inv == Config ) - resetCache( true ); + if ( inv == this.Config ) + this.resetCache( true ); } @Override public void upgradesChanged() { super.upgradesChanged(); - resetCache( true ); + this.resetCache( true ); } @Override public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) { - resetCache( true ); - host.markForSave(); + this.resetCache( true ); + this.host.markForSave(); } @Override public void setPriority( int newValue ) { - priority = newValue; - host.markForSave(); - resetCache( true ); + this.priority = newValue; + this.host.markForSave(); + this.resetCache( true ); } public MEInventoryHandler getInternalHandler() { - if ( cached ) - return handler; + if ( this.cached ) + return this.handler; - boolean wasSleeping = monitor == null; + boolean wasSleeping = this.monitor == null; - cached = true; - TileEntity self = getHost().getTile(); - TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + side.offsetX, self.yCoord + side.offsetY, self.zCoord + side.offsetZ ); + this.cached = true; + TileEntity self = this.getHost().getTile(); + TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); int newHandlerHash = Platform.generateTileHash( target ); - if ( handlerHash == newHandlerHash && handlerHash != 0 ) - return handler; + if ( this.handlerHash == newHandlerHash && this.handlerHash != 0 ) + return this.handler; try { // force grid to update handlers... - proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch ( GridAccessException e ) { // :3 } - handlerHash = newHandlerHash; - handler = null; - monitor = null; + this.handlerHash = newHandlerHash; + this.handler = null; + this.monitor = null; if ( target != null ) { - IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, side.getOpposite(), StorageChannel.ITEMS, mySrc ); + IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); if ( esh != null ) { - IMEInventory inv = esh.getInventory( target, side.getOpposite(), StorageChannel.ITEMS, mySrc ); + IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); if ( inv instanceof MEMonitorIInventory ) { MEMonitorIInventory h = ( MEMonitorIInventory ) inv; - h.mode = ( StorageFilter ) getConfigManager().getSetting( Settings.STORAGE_FILTER ); + h.mode = ( StorageFilter ) this.getConfigManager().getSetting( Settings.STORAGE_FILTER ); h.mySource = new MachineSource( this ); } if ( inv instanceof MEMonitorIInventory ) - monitor = ( MEMonitorIInventory ) inv; + this.monitor = ( MEMonitorIInventory ) inv; if ( inv != null ) { - checkInterfaceVsStorageBus( target, side.getOpposite() ); + this.checkInterfaceVsStorageBus( target, this.side.getOpposite() ); - handler = new MEInventoryHandler( inv, StorageChannel.ITEMS ); + this.handler = new MEInventoryHandler( inv, StorageChannel.ITEMS ); - handler.myAccess = ( AccessRestriction ) this.getConfigManager().getSetting( Settings.ACCESS ); - handler.myWhitelist = getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; - handler.myPriority = priority; + this.handler.myAccess = ( AccessRestriction ) this.getConfigManager().getSetting( Settings.ACCESS ); + this.handler.myWhitelist = this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; + this.handler.myPriority = this.priority; IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + getInstalledUpgrades( Upgrades.CAPACITY ) * 9; - for ( int x = 0; x < Config.getSizeInventory() && x < slotsToUse; x++ ) + int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + for ( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { - IAEItemStack is = Config.getAEStackInSlot( x ); + IAEItemStack is = this.Config.getAEStackInSlot( x ); if ( is != null ) priorityList.add( is ); } - if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) - handler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); + if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) + this.handler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); else - handler.myPartitionList = new PrecisePriorityList( priorityList ); + this.handler.myPartitionList = new PrecisePriorityList( priorityList ); if ( inv instanceof IMEMonitor ) - ( ( IMEMonitor ) inv ).addListener( this, handler ); + ( ( IMEMonitor ) inv ).addListener( this, this.handler ); } } } // update sleep state... - if ( wasSleeping != ( monitor == null ) ) + if ( wasSleeping != ( this.monitor == null ) ) { try { - ITickManager tm = proxy.getTick(); - if ( monitor == null ) - tm.sleepDevice( proxy.getNode() ); + ITickManager tm = this.proxy.getTick(); + if ( this.monitor == null ) + tm.sleepDevice( this.proxy.getNode() ); else - tm.wakeDevice( proxy.getNode() ); + tm.wakeDevice( this.proxy.getNode() ); } catch ( GridAccessException e ) { @@ -361,7 +361,7 @@ public class PartStorageBus } } - return handler; + return this.handler; } private void checkInterfaceVsStorageBus( TileEntity target, ForgeDirection side ) @@ -390,7 +390,7 @@ public class PartStorageBus public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); rh.setBounds( 3, 3, 15, 13, 13, 16 ); rh.renderInventoryBox( renderer ); @@ -406,8 +406,8 @@ public class PartStorageBus @SideOnly( Side.CLIENT ) public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); rh.setBounds( 3, 3, 15, 13, 13, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -416,19 +416,19 @@ public class PartStorageBus rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); rh.setBounds( 5, 5, 12, 11, 11, 13 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 5, 5, 13, 11, 11, 14 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override @@ -448,17 +448,17 @@ public class PartStorageBus @Override public TickingRequest getTickingRequest( IGridNode node ) { - return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, monitor == null, true ); + return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true ); } @Override public TickRateModulation tickingRequest( IGridNode node, int TicksSinceLastCall ) { - if ( resetCacheLogic != 0 ) - resetCache(); + if ( this.resetCacheLogic != 0 ) + this.resetCache(); - if ( monitor != null ) - return monitor.onTick(); + if ( this.monitor != null ) + return this.monitor.onTick(); return TickRateModulation.SLEEP; } @@ -467,16 +467,16 @@ public class PartStorageBus public void writeToNBT( NBTTagCompound data ) { super.writeToNBT( data ); - Config.writeToNBT( data, "config" ); - data.setInteger( "priority", priority ); + this.Config.writeToNBT( data, "config" ); + data.setInteger( "priority", this.priority ); } @Override public void readFromNBT( NBTTagCompound data ) { super.readFromNBT( data ); - Config.readFromNBT( data, "config" ); - priority = data.getInteger( "priority" ); + this.Config.readFromNBT( data, "config" ); + this.priority = data.getInteger( "priority" ); } @Override @@ -484,7 +484,7 @@ public class PartStorageBus { if ( channel == StorageChannel.ITEMS ) { - IMEInventoryHandler out = proxy.isActive() ? getInternalHandler() : null; + IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null; if ( out != null ) return Collections.singletonList( out ); } @@ -494,7 +494,7 @@ public class PartStorageBus @Override public int getPriority() { - return priority; + return this.priority; } @Override @@ -506,8 +506,8 @@ public class PartStorageBus { try { - if ( proxy.isActive() ) - proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, mySrc ); + if ( this.proxy.isActive() ) + this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc ); } catch ( GridAccessException e ) { @@ -519,7 +519,7 @@ public class PartStorageBus @Method( iname = "BC" ) public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with ) { - return type == PipeType.ITEM && with == side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT; + return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT; } @Override diff --git a/src/main/java/appeng/parts/misc/PartToggleBus.java b/src/main/java/appeng/parts/misc/PartToggleBus.java index cd0f8225c..7504c5945 100644 --- a/src/main/java/appeng/parts/misc/PartToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartToggleBus.java @@ -61,34 +61,34 @@ public class PartToggleBus extends PartBasicState public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side) { super.onPlacement( player, held, side ); - outerProxy.setOwner( player ); + this.outerProxy.setOwner( player ); } @Override protected int populateFlags(int cf) { - return cf | (getIntention() ? REDSTONE_FLAG : 0); + return cf | (this.getIntention() ? this.REDSTONE_FLAG : 0); } @Override public void onNeighborChanged() { - boolean oldHasRedstone = hasRedstone; - hasRedstone = getHost().hasRedstone( side ); + boolean oldHasRedstone = this.hasRedstone; + this.hasRedstone = this.getHost().hasRedstone( this.side ); - if ( hasRedstone != oldHasRedstone ) + if ( this.hasRedstone != oldHasRedstone ) { - updateInternalState(); - getHost().markForUpdate(); + this.updateInternalState(); + this.getHost().markForUpdate(); } } public PartToggleBus(ItemStack is) { this( PartToggleBus.class, is ); - proxy.setIdlePowerUsage( 0.0 ); - outerProxy.setIdlePowerUsage( 0.0 ); - proxy.setFlags(); - outerProxy.setFlags(); + this.proxy.setIdlePowerUsage( 0.0 ); + this.outerProxy.setIdlePowerUsage( 0.0 ); + this.proxy.setFlags(); + this.outerProxy.setFlags(); } public PartToggleBus(Class cls, ItemStack is) { @@ -99,44 +99,44 @@ public class PartToggleBus extends PartBasicState public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { super.setPartHostInfo( side, host, tile ); - outerProxy.setValidSides( EnumSet.of( side ) ); + this.outerProxy.setValidSides( EnumSet.of( side ) ); } @Override public void readFromNBT(NBTTagCompound extra) { super.readFromNBT( extra ); - outerProxy.readFromNBT( extra ); + this.outerProxy.readFromNBT( extra ); } @Override public void writeToNBT(NBTTagCompound extra) { super.writeToNBT( extra ); - outerProxy.writeToNBT( extra ); + this.outerProxy.writeToNBT( extra ); } @Override public void addToWorld() { super.addToWorld(); - outerProxy.onReady(); - hasRedstone = getHost().hasRedstone( side ); - updateInternalState(); + this.outerProxy.onReady(); + this.hasRedstone = this.getHost().hasRedstone( this.side ); + this.updateInternalState(); } private void updateInternalState() { - boolean intention = getIntention(); - if ( intention == ( connection == null ) ) + boolean intention = this.getIntention(); + if ( intention == ( this.connection == null ) ) { - if ( proxy.getNode() != null && outerProxy.getNode() != null ) + if ( this.proxy.getNode() != null && this.outerProxy.getNode() != null ) { if ( intention ) { try { - connection = AEApi.instance().createGridConnection( proxy.getNode(), outerProxy.getNode() ); + this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() ); } catch (FailedConnection e) { @@ -145,8 +145,8 @@ public class PartToggleBus extends PartBasicState } else { - connection.destroy(); - connection = null; + this.connection.destroy(); + this.connection = null; } } } @@ -154,20 +154,20 @@ public class PartToggleBus extends PartBasicState protected boolean getIntention() { - return getHost().hasRedstone( side ); + return this.getHost().hasRedstone( this.side ); } @Override public void removeFromWorld() { super.removeFromWorld(); - outerProxy.invalidate(); + this.outerProxy.invalidate(); } @Override public IGridNode getExternalFacingNode() { - return outerProxy.getNode(); + return this.outerProxy.getNode(); } @Override @@ -179,16 +179,16 @@ public class PartToggleBus extends PartBasicState @Override public void setColors(boolean hasChan, boolean hasPower) { - hasRedstone = (clientFlags & REDSTONE_FLAG) == REDSTONE_FLAG; - super.setColors( hasChan && hasRedstone, hasPower && hasRedstone ); + this.hasRedstone = (this.clientFlags & this.REDSTONE_FLAG) == this.REDSTONE_FLAG; + super.setColors( hasChan && this.hasRedstone, hasPower && this.hasRedstone ); } @Override @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( is.getIconIndex() ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( this.is.getIconIndex() ); rh.setBounds( 6, 6, 14, 10, 10, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -197,19 +197,19 @@ public class PartToggleBus extends PartBasicState rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); rh.setBounds( 6, 6, 13, 10, 10, 14 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override public IIcon getBreakingTexture() { - return is.getIconIndex(); + return this.is.getIconIndex(); } @Override @@ -224,7 +224,7 @@ public class PartToggleBus extends PartBasicState { GL11.glTranslated( -0.2, -0.3, 0.0 ); - rh.setTexture( is.getIconIndex() ); + rh.setTexture( this.is.getIconIndex() ); rh.setBounds( 6, 6, 14 - 4, 10, 10, 16 - 4 ); rh.renderInventoryBox( renderer ); @@ -252,13 +252,13 @@ public class PartToggleBus extends PartBasicState @Override public void securityBreak() { - if ( is.stackSize > 0 ) + if ( this.is.stackSize > 0 ) { List items = new ArrayList(); - items.add( is.copy() ); - host.removePart( side, false ); - Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items ); - is.stackSize = 0; + items.add( this.is.copy() ); + this.host.removePart( this.side, false ); + Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items ); + this.is.stackSize = 0; } } } diff --git a/src/main/java/appeng/parts/networking/PartCable.java b/src/main/java/appeng/parts/networking/PartCable.java index 2528702e2..a3dbdd7ab 100644 --- a/src/main/java/appeng/parts/networking/PartCable.java +++ b/src/main/java/appeng/parts/networking/PartCable.java @@ -71,15 +71,15 @@ public class PartCable extends AEBasePart implements IPartCable public PartCable(Class c, ItemStack is) { super( c, is ); - proxy.setFlags( GridFlags.PREFERRED ); - proxy.setIdlePowerUsage( 0.0 ); - proxy.myColor = AEColor.values()[((ItemMultiPart) is.getItem()).variantOf( is.getItemDamage() )]; + this.proxy.setFlags( GridFlags.PREFERRED ); + this.proxy.setIdlePowerUsage( 0.0 ); + this.proxy.myColor = AEColor.values()[((ItemMultiPart) is.getItem()).variantOf( is.getItemDamage() )]; } @Override public boolean isConnected(ForgeDirection side) { - return connections.contains( side ); + return this.connections.contains( side ); } @Override @@ -132,7 +132,7 @@ public class PartCable extends AEBasePart implements IPartCable public IIcon getTexture(AEColor c) { - return getGlassTexture( c ); + return this.getGlassTexture( c ); } public IIcon getCoveredTexture(AEColor c) @@ -222,7 +222,7 @@ public class PartCable extends AEBasePart implements IPartCable @Override public AEColor getCableColor() { - return proxy.myColor; + return this.proxy.myColor; } @Override @@ -234,12 +234,12 @@ public class PartCable extends AEBasePart implements IPartCable @Override public AENetworkProxy getProxy() { - return proxy; + return this.proxy; } public void markForUpdate() { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @Override @@ -249,7 +249,7 @@ public class PartCable extends AEBasePart implements IPartCable if ( Platform.isServer() ) { - IGridNode node = getGridNode(); + IGridNode node = this.getGridNode(); int howMany = 0; if ( node != null ) @@ -269,12 +269,12 @@ public class PartCable extends AEBasePart implements IPartCable int cs = 0; int sideOut = 0; - IGridNode n = getGridNode(); + IGridNode n = this.getGridNode(); if ( n != null ) { for (ForgeDirection thisSide : ForgeDirection.VALID_DIRECTIONS) { - IPart part = getHost().getPart( thisSide ); + IPart part = this.getHost().getPart( thisSide ); if ( part != null ) { if ( part.getGridNode() != null ) @@ -282,7 +282,7 @@ public class PartCable extends AEBasePart implements IPartCable IReadOnlyCollection set = part.getGridNode().getConnections(); for (IGridConnection gc : set) { - if ( proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) ) + if ( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) ) sideOut |= (gc.getUsedChannels() / 4) << (4 * thisSide.ordinal()); else sideOut |= (gc.getUsedChannels()) << (4 * thisSide.ordinal()); @@ -296,8 +296,8 @@ public class PartCable extends AEBasePart implements IPartCable ForgeDirection side = gc.getDirection( n ); if ( side != ForgeDirection.UNKNOWN ) { - boolean isTier2a = proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); - boolean isTier2b = gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); + boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); + boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); if ( isTier2a && isTier2b ) sideOut |= (gc.getUsedChannels() / 4) << (4 * side.ordinal()); @@ -310,7 +310,7 @@ public class PartCable extends AEBasePart implements IPartCable try { - if ( proxy.getEnergy().isNetworkPowered() ) + if ( this.proxy.getEnergy().isNetworkPowered() ) cs |= (1 << ForgeDirection.UNKNOWN.ordinal()); } catch (GridAccessException e) @@ -328,9 +328,9 @@ public class PartCable extends AEBasePart implements IPartCable int cs = data.readByte(); int sideOut = data.readInt(); - EnumSet myC = connections.clone(); - boolean wasPowered = powered; - powered = false; + EnumSet myC = this.connections.clone(); + boolean wasPowered = this.powered; + this.powered = false; boolean channelsChanged = false; for (ForgeDirection d : ForgeDirection.values()) @@ -338,10 +338,10 @@ public class PartCable extends AEBasePart implements IPartCable if ( d != ForgeDirection.UNKNOWN ) { int ch = (sideOut >> (d.ordinal() * 4)) & 0xF; - if ( ch != channelsOnSide[d.ordinal()] ) + if ( ch != this.channelsOnSide[d.ordinal()] ) { channelsChanged = true; - channelsOnSide[d.ordinal()] = ch; + this.channelsOnSide[d.ordinal()] = ch; } } @@ -349,19 +349,19 @@ public class PartCable extends AEBasePart implements IPartCable { int id = 1 << d.ordinal(); if ( id == (cs & id) ) - powered = true; + this.powered = true; } else { int id = 1 << d.ordinal(); if ( id == (cs & id) ) - connections.add( d ); + this.connections.add( d ); else - connections.remove( d ); + this.connections.remove( d ); } } - return !myC.equals( connections ) || wasPowered != powered || channelsChanged; + return !myC.equals( this.connections ) || wasPowered != this.powered || channelsChanged; } @Override @@ -371,14 +371,14 @@ public class PartCable extends AEBasePart implements IPartCable if ( Platform.isServer() ) { - IGridNode n = getGridNode(); + IGridNode n = this.getGridNode(); if ( n != null ) - connections = n.getConnectedSides(); + this.connections = n.getConnectedSides(); else - connections.clear(); + this.connections.clear(); } - IPartHost ph = getHost(); + IPartHost ph = this.getHost(); if ( ph != null ) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) @@ -417,7 +417,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { switch (of) { @@ -450,7 +450,7 @@ public class PartCable extends AEBasePart implements IPartCable { GL11.glTranslated( -0.0, -0.0, 0.3 ); - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); rh.setBounds( 6.0f, 6.0f, 2.0f, 10.0f, 10.0f, 14.0f ); rh.renderInventoryBox( renderer ); rh.setTexture( null ); @@ -460,7 +460,7 @@ public class PartCable extends AEBasePart implements IPartCable @SideOnly(Side.CLIENT) public IIcon getBreakingTexture() { - return getTexture( getCableColor() ); + return this.getTexture( this.getCableColor() ); } @SideOnly(Side.CLIENT) @@ -474,10 +474,10 @@ public class PartCable extends AEBasePart implements IPartCable if ( gh != null && partHost != null && gh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart( of.getOpposite() ) == null ) - rh.setTexture( getTexture( partHost.getColor() ) ); + rh.setTexture( this.getTexture( partHost.getColor() ) ); else if ( partHost == null && gh != null && gh.getCableConnectionType( of ) != AECableType.GLASS ) { - rh.setTexture( getCoveredTexture( getCableColor() ) ); + rh.setTexture( this.getCoveredTexture( this.getCableColor() ) ); switch (of) { case DOWN: @@ -503,10 +503,10 @@ public class PartCable extends AEBasePart implements IPartCable } rh.renderBlock( x, y, z, renderer ); - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); } else - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); switch (of) { @@ -538,7 +538,7 @@ public class PartCable extends AEBasePart implements IPartCable protected CableBusTextures getChannelTex(int i, boolean b) { - if ( !powered ) + if ( !this.powered ) i = 0; if ( b ) @@ -586,10 +586,10 @@ public class PartCable extends AEBasePart implements IPartCable rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent ) - rh.setTexture( getGlassTexture( partHost.getColor() ) ); + rh.setTexture( this.getGlassTexture( partHost.getColor() ) ); else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { - rh.setTexture( getCoveredTexture( getCableColor() ) ); + rh.setTexture( this.getCoveredTexture( this.getCableColor() ) ); switch (of) { case DOWN: @@ -616,18 +616,18 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( x, y, z, renderer ); - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); } else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.COVERED && partHost.getColor() != AEColor.Transparent && partHost.getPart( of.getOpposite() ) == null ) - rh.setTexture( getCoveredTexture( partHost.getColor() ) ); + rh.setTexture( this.getCoveredTexture( partHost.getColor() ) ); else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.SMART && partHost.getPart( of.getOpposite() ) == null ) { isSmart = true; - rh.setTexture( getSmartTexture( getCableColor() ) ); + rh.setTexture( this.getSmartTexture( this.getCableColor() ) ); } else - rh.setTexture( getCoveredTexture( getCableColor() ) ); + rh.setTexture( this.getCoveredTexture( this.getCableColor() ) ); switch (of) { @@ -658,9 +658,9 @@ public class PartCable extends AEBasePart implements IPartCable if ( isSmart ) { - setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + this.setSmartConnectionRotations( of, renderer ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -670,13 +670,13 @@ public class PartCable extends AEBasePart implements IPartCable } Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @@ -691,7 +691,7 @@ public class PartCable extends AEBasePart implements IPartCable IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; boolean isGlass = false; - AEColor myColor = getCableColor(); + AEColor myColor = this.getCableColor(); rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); @@ -699,11 +699,11 @@ public class PartCable extends AEBasePart implements IPartCable && partHost.getColor() != AEColor.Transparent ) { isGlass = true; - rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) ); + rh.setTexture( this.getGlassTexture( myColor = partHost.getColor() ) ); } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of.getOpposite() ) != AECableType.GLASS ) { - rh.setTexture( getSmartTexture( myColor ) ); + rh.setTexture( this.getSmartTexture( myColor ) ); switch (of) { case DOWN: @@ -729,9 +729,9 @@ public class PartCable extends AEBasePart implements IPartCable } rh.renderBlock( x, y, z, renderer ); - setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + this.setSmartConnectionRotations( of, renderer ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -743,22 +743,22 @@ public class PartCable extends AEBasePart implements IPartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); } else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart( of.getOpposite() ) == null ) - rh.setTexture( getSmartTexture( myColor = partHost.getColor() ) ); + rh.setTexture( this.getSmartTexture( myColor = partHost.getColor() ) ); else - rh.setTexture( getSmartTexture( getCableColor() ) ); + rh.setTexture( this.getSmartTexture( this.getCableColor() ) ); switch (of) { @@ -789,19 +789,19 @@ public class PartCable extends AEBasePart implements IPartCable if ( !isGlass ) { - setSmartConnectionRotations( of, renderer ); + this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @@ -861,13 +861,13 @@ public class PartCable extends AEBasePart implements IPartCable @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); boolean useCovered = false; boolean requireDetailed = false; for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - IPart p = getHost().getPart( dir ); + IPart p = this.getHost().getPart( dir ); if ( p != null && p instanceof IGridHost ) { IGridHost igh = (IGridHost) p; @@ -878,7 +878,7 @@ public class PartCable extends AEBasePart implements IPartCable break; } } - else if ( connections.contains( dir ) ) + else if ( this.connections.contains( dir ) ) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ ); IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; @@ -890,15 +890,15 @@ public class PartCable extends AEBasePart implements IPartCable if ( useCovered ) { - rh.setTexture( getCoveredTexture( getCableColor() ) ); + rh.setTexture( this.getCoveredTexture( this.getCableColor() ) ); } else { - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); } - IPartHost ph = getHost(); - for (ForgeDirection of : EnumSet.complementOf( connections )) + IPartHost ph = this.getHost(); + for (ForgeDirection of : EnumSet.complementOf( this.connections )) { IPart bp = ph.getPart( of ); if ( bp instanceof IGridHost ) @@ -934,7 +934,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - if ( connections.size() != 2 || !nonLinear( connections ) || useCovered || requireDetailed ) + if ( this.connections.size() != 2 || !this.nonLinear( this.connections ) || useCovered || requireDetailed ) { if ( useCovered ) { @@ -947,17 +947,17 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( x, y, z, renderer ); } - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - renderGlassConnection( x, y, z, rh, renderer, of ); + this.renderGlassConnection( x, y, z, rh, renderer, of ); } } else { - IIcon def = getTexture( getCableColor() ); + IIcon def = this.getTexture( this.getCableColor() ); rh.setTexture( def ); - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) ); switch (of) @@ -991,24 +991,24 @@ public class PartCable extends AEBasePart implements IPartCable @Override public boolean changeColor(AEColor newColor, EntityPlayer who) { - if ( getCableColor() != newColor ) + if ( this.getCableColor() != newColor ) { ItemStack newPart = null; - if ( getCableConnectionType() == AECableType.GLASS ) + if ( this.getCableConnectionType() == AECableType.GLASS ) newPart = AEApi.instance().parts().partCableGlass.stack( newColor, 1 ); - else if ( getCableConnectionType() == AECableType.COVERED ) + else if ( this.getCableConnectionType() == AECableType.COVERED ) newPart = AEApi.instance().parts().partCableCovered.stack( newColor, 1 ); - else if ( getCableConnectionType() == AECableType.SMART ) + else if ( this.getCableConnectionType() == AECableType.SMART ) newPart = AEApi.instance().parts().partCableSmart.stack( newColor, 1 ); - else if ( getCableConnectionType() == AECableType.DENSE ) + else if ( this.getCableConnectionType() == AECableType.DENSE ) newPart = AEApi.instance().parts().partCableDense.stack( newColor, 1 ); boolean hasPermission = true; try { - hasPermission = proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD ); + hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD ); } catch (GridAccessException e) { @@ -1020,8 +1020,8 @@ public class PartCable extends AEBasePart implements IPartCable if ( Platform.isClient() ) return true; - getHost().removePart( ForgeDirection.UNKNOWN, true ); - getHost().addPart( newPart, ForgeDirection.UNKNOWN, who ); + this.getHost().removePart( ForgeDirection.UNKNOWN, true ); + this.getHost().addPart( newPart, ForgeDirection.UNKNOWN, who ); return true; } } @@ -1031,7 +1031,7 @@ public class PartCable extends AEBasePart implements IPartCable @Override public void setValidSides(EnumSet sides) { - proxy.setValidSides( sides ); + this.proxy.setValidSides( sides ); } protected boolean nonLinear(EnumSet sides) diff --git a/src/main/java/appeng/parts/networking/PartCableCovered.java b/src/main/java/appeng/parts/networking/PartCableCovered.java index bac3784c4..8459b5d16 100644 --- a/src/main/java/appeng/parts/networking/PartCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartCableCovered.java @@ -49,13 +49,13 @@ public class PartCableCovered extends PartCable @MENetworkEventSubscribe public void channelUpdated(MENetworkChannelsChanged c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } public PartCableCovered(Class c, ItemStack is) { @@ -69,7 +69,7 @@ public class PartCableCovered extends PartCable @Override public IIcon getTexture(AEColor c) { - return getCoveredTexture( c ); + return this.getCoveredTexture( c ); } @Override @@ -85,14 +85,14 @@ public class PartCableCovered extends PartCable if ( Platform.isServer() ) { - IGridNode n = getGridNode(); + IGridNode n = this.getGridNode(); if ( n != null ) - connections = n.getConnectedSides(); + this.connections = n.getConnectedSides(); else - connections.clear(); + this.connections.clear(); } - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { switch (of) { @@ -129,7 +129,7 @@ public class PartCableCovered extends PartCable float offU = 0; float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { @@ -138,14 +138,14 @@ public class PartCableCovered extends PartCable offU = 9; offV = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { rh.renderInventoryFace( main, side, renderer ); } - main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 ); for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH )) { @@ -159,14 +159,14 @@ public class PartCableCovered extends PartCable @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( getTexture( getCableColor() ) ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = connections.clone(); + EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = getHost(); - for (ForgeDirection of : EnumSet.complementOf( connections )) + IPartHost ph = this.getHost(); + for (ForgeDirection of : EnumSet.complementOf( this.connections )) { IPart bp = ph.getPart( of ); if ( bp instanceof IGridHost ) @@ -208,22 +208,22 @@ public class PartCableCovered extends PartCable } } - if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses ) + if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - renderCoveredConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); rh.setBounds( 5, 5, 5, 11, 11, 11 ); rh.renderBlock( x, y, z, renderer ); } else { - IIcon def = getTexture( getCableColor() ); + IIcon def = this.getTexture( this.getCableColor() ); IIcon off = new OffsetIcon( def, 0, -12 ); - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { switch (of) { diff --git a/src/main/java/appeng/parts/networking/PartCableSmart.java b/src/main/java/appeng/parts/networking/PartCableSmart.java index ef15617a9..015200f86 100644 --- a/src/main/java/appeng/parts/networking/PartCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartCableSmart.java @@ -53,13 +53,13 @@ public class PartCableSmart extends PartCable @MENetworkEventSubscribe public void channelUpdated(MENetworkChannelsChanged c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } public PartCableSmart(Class c, ItemStack is) { @@ -79,7 +79,7 @@ public class PartCableSmart extends PartCable @Override public IIcon getTexture(AEColor c) { - return getSmartTexture( c ); + return this.getSmartTexture( c ); } @Override @@ -91,9 +91,9 @@ public class PartCableSmart extends PartCable float offU = 0; float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); - OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); - OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); + OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); + OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); + OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { @@ -105,9 +105,9 @@ public class PartCableSmart extends PartCable offU = 9; offV = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); + ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); + ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { @@ -117,9 +117,9 @@ public class PartCableSmart extends PartCable rh.renderInventoryFace( ch2, side, renderer ); } - main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), 0, 0 ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), 0, 0 ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 ); + ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); + ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH )) { @@ -139,14 +139,14 @@ public class PartCableSmart extends PartCable if ( Platform.isServer() ) { - IGridNode n = getGridNode(); + IGridNode n = this.getGridNode(); if ( n != null ) - connections = n.getConnectedSides(); + this.connections = n.getConnectedSides(); else - connections.clear(); + this.connections.clear(); } - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { switch (of) { @@ -177,14 +177,14 @@ public class PartCableSmart extends PartCable @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( getTexture( getCableColor() ) ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = connections.clone(); + EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = getHost(); - for (ForgeDirection of : EnumSet.complementOf( connections )) + IPartHost ph = this.getHost(); + for (ForgeDirection of : EnumSet.complementOf( this.connections )) { IPart bp = ph.getPart( of ); if ( bp instanceof IGridHost ) @@ -223,9 +223,9 @@ public class PartCableSmart extends PartCable } rh.renderBlock( x, y, z, renderer ); - setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); + this.setSmartConnectionRotations( of, renderer ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -235,29 +235,29 @@ public class PartCableSmart extends PartCable } Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); } } } - if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses ) + if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } - rh.setTexture( getCoveredTexture( getCableColor() ) ); + rh.setTexture( this.getCoveredTexture( this.getCableColor() ) ); rh.setBounds( 5, 5, 5, 11, 11, 11 ); rh.renderBlock( x, y, z, renderer ); } @@ -265,20 +265,20 @@ public class PartCableSmart extends PartCable { ForgeDirection selectedSide = ForgeDirection.UNKNOWN; - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { selectedSide = of; break; } - int channels = channelsOnSide[selectedSide.ordinal()]; - IIcon def = getTexture( getCableColor() ); + int channels = this.channelsOnSide[selectedSide.ordinal()]; + IIcon def = this.getTexture( this.getCableColor() ); IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon firstTaughtIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); IIcon firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); - IIcon secondTaughtIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); switch (selectedSide) @@ -296,13 +296,13 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case EAST: case WEST: @@ -332,13 +332,13 @@ public class PartCableSmart extends PartCable fpA.setFlip( true, false ); fpB.setFlip( true, false ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, fpB ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case NORTH: case SOUTH: @@ -353,13 +353,13 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; default: break; diff --git a/src/main/java/appeng/parts/networking/PartDenseCable.java b/src/main/java/appeng/parts/networking/PartDenseCable.java index 6ccace55c..4b498b1b2 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCable.java +++ b/src/main/java/appeng/parts/networking/PartDenseCable.java @@ -63,18 +63,18 @@ public class PartDenseCable extends PartCable @MENetworkEventSubscribe public void channelUpdated(MENetworkChannelsChanged c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } public PartDenseCable(Class c, ItemStack is) { super( c, is ); - proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED ); + this.proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED ); } public PartDenseCable(ItemStack is) { @@ -93,7 +93,7 @@ public class PartDenseCable extends PartCable if ( c == AEColor.Transparent ) return AEApi.instance().parts().partCableSmart.stack( AEColor.Transparent, 1 ).getIconIndex(); - return getSmartTexture( c ); + return this.getSmartTexture( c ); } @Override @@ -106,9 +106,9 @@ public class PartDenseCable extends PartCable float offU = 0; float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); - OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); - OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); + OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); + OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); + OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { @@ -119,9 +119,9 @@ public class PartDenseCable extends PartCable offU = 9; offV = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); + ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); + ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { @@ -130,9 +130,9 @@ public class PartDenseCable extends PartCable rh.renderInventoryFace( ch2, side, renderer ); } - main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), 0, 0 ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), 0, 0 ); + main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 ); + ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); + ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH )) { @@ -155,16 +155,16 @@ public class PartDenseCable extends PartCable if ( Platform.isServer() ) { - IGridNode n = getGridNode(); + IGridNode n = this.getGridNode(); if ( n != null ) - connections = n.getConnectedSides(); + this.connections = n.getConnectedSides(); else - connections.clear(); + this.connections.clear(); } - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - if ( isDense( of ) ) + if ( this.isDense( of ) ) { switch (of) { @@ -219,7 +219,7 @@ public class PartDenseCable extends PartCable private boolean isDense(ForgeDirection of) { - TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ ); + TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); if ( te instanceof IGridHost ) { AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() ); @@ -230,7 +230,7 @@ public class PartDenseCable extends PartCable private boolean isSmart(ForgeDirection of) { - TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ ); + TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); if ( te instanceof IGridHost ) { AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() ); @@ -246,7 +246,7 @@ public class PartDenseCable extends PartCable IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; boolean isGlass = false; - AEColor myColor = getCableColor(); + AEColor myColor = this.getCableColor(); /* * ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart( * of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) ); @@ -281,9 +281,9 @@ public class PartDenseCable extends PartCable rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) ); if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart( of.getOpposite() ) == null ) - rh.setTexture( getTexture( myColor = partHost.getColor() ) ); + rh.setTexture( this.getTexture( myColor = partHost.getColor() ) ); else - rh.setTexture( getTexture( getCableColor() ) ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); switch (of) { @@ -314,19 +314,19 @@ public class PartDenseCable extends PartCable rh.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) ); if ( !isGlass ) { - setSmartConnectionRotations( of, renderer ); + this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @@ -336,31 +336,31 @@ public class PartDenseCable extends PartCable @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( getTexture( getCableColor() ) ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = connections.clone(); + EnumSet sides = this.connections.clone(); boolean hasBuses = false; - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - if ( !isDense( of ) ) + if ( !this.isDense( of ) ) hasBuses = true; } - if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses ) + if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { - if ( isDense( of ) ) - renderDenseConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); - else if ( isSmart( of ) ) - renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + if ( this.isDense( of ) ) + this.renderDenseConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); + else if ( this.isSmart( of ) ) + this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); else - renderCoveredConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } - rh.setTexture( getDenseTexture( getCableColor() ) ); + rh.setTexture( this.getDenseTexture( this.getCableColor() ) ); rh.setBounds( 3, 3, 3, 13, 13, 13 ); rh.renderBlock( x, y, z, renderer ); } @@ -368,20 +368,20 @@ public class PartDenseCable extends PartCable { ForgeDirection selectedSide = ForgeDirection.UNKNOWN; - for (ForgeDirection of : connections) + for (ForgeDirection of : this.connections) { selectedSide = of; break; } - int channels = channelsOnSide[selectedSide.ordinal()]; - IIcon def = getTexture( getCableColor() ); + int channels = this.channelsOnSide[selectedSide.ordinal()]; + IIcon def = this.getTexture( this.getCableColor() ); IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 ); - IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 ); switch (selectedSide) @@ -399,13 +399,13 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstIcon, firstIcon, firstOffset, firstOffset, firstOffset, firstOffset ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondOffset, secondOffset, secondOffset, secondOffset ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case EAST: case WEST: @@ -432,13 +432,13 @@ public class PartDenseCable extends PartCable fpA.setFlip( true, false ); fpB.setFlip( true, false ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstOffset, firstOffset, firstOffset, firstOffset, firstIcon, fpA ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondOffset, secondOffset, secondOffset, secondOffset, secondIcon, fpB ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case NORTH: case SOUTH: @@ -453,13 +453,13 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant ); rh.setTexture( firstOffset, firstOffset, firstIcon, firstIcon, firstOffset, firstOffset ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); - Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant ); rh.setTexture( secondOffset, secondOffset, secondIcon, secondIcon, secondOffset, secondOffset ); - renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); + this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; default: break; @@ -509,6 +509,6 @@ public class PartDenseCable extends PartCable default: } - return is.getIconIndex(); + return this.is.getIconIndex(); } } diff --git a/src/main/java/appeng/parts/networking/PartQuartzFiber.java b/src/main/java/appeng/parts/networking/PartQuartzFiber.java index 41691d3fe..d64b96562 100644 --- a/src/main/java/appeng/parts/networking/PartQuartzFiber.java +++ b/src/main/java/appeng/parts/networking/PartQuartzFiber.java @@ -49,62 +49,62 @@ import cpw.mods.fml.relauncher.SideOnly; public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider { - final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", proxy.getMachineRepresentation(), true ); + final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true ); public PartQuartzFiber(ItemStack is) { super( PartQuartzFiber.class, is ); - proxy.setIdlePowerUsage( 0 ); - proxy.setFlags( GridFlags.CANNOT_CARRY ); - outerProxy.setIdlePowerUsage( 0 ); - outerProxy.setFlags( GridFlags.CANNOT_CARRY ); + this.proxy.setIdlePowerUsage( 0 ); + this.proxy.setFlags( GridFlags.CANNOT_CARRY ); + this.outerProxy.setIdlePowerUsage( 0 ); + this.outerProxy.setFlags( GridFlags.CANNOT_CARRY ); } @Override public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side) { super.onPlacement( player, held, side ); - outerProxy.setOwner( player ); + this.outerProxy.setOwner( player ); } @Override public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { super.setPartHostInfo( side, host, tile ); - outerProxy.setValidSides( EnumSet.of( side ) ); + this.outerProxy.setValidSides( EnumSet.of( side ) ); } @Override public void readFromNBT(NBTTagCompound extra) { super.readFromNBT( extra ); - outerProxy.readFromNBT( extra ); + this.outerProxy.readFromNBT( extra ); } @Override public void writeToNBT(NBTTagCompound extra) { super.writeToNBT( extra ); - outerProxy.writeToNBT( extra ); + this.outerProxy.writeToNBT( extra ); } @Override public void addToWorld() { super.addToWorld(); - outerProxy.onReady(); + this.outerProxy.onReady(); } @Override public void removeFromWorld() { super.removeFromWorld(); - outerProxy.invalidate(); + this.outerProxy.invalidate(); } @Override public IGridNode getExternalFacingNode() { - return outerProxy.getNode(); + return this.outerProxy.getNode(); } @Override @@ -117,7 +117,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - IIcon myIcon = is.getIconIndex(); + IIcon myIcon = this.is.getIconIndex(); rh.setTexture( myIcon ); rh.setBounds( 6, 6, 10, 10, 10, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -136,7 +136,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider { GL11.glTranslated( -0.2, -0.3, 0.0 ); - rh.setTexture( is.getIconIndex() ); + rh.setTexture( this.is.getIconIndex() ); rh.setBounds( 6.0f, 6.0f, 5.0f, 10.0f, 10.0f, 11.0f ); rh.renderInventoryBox( renderer ); rh.setTexture( null ); @@ -149,7 +149,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = proxy.getEnergy(); + IEnergyGrid eg = this.proxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } catch (GridAccessException e) @@ -159,7 +159,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = outerProxy.getEnergy(); + IEnergyGrid eg = this.outerProxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } catch (GridAccessException e) @@ -176,7 +176,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = proxy.getEnergy(); + IEnergyGrid eg = this.proxy.getEnergy(); if ( !seen.contains( eg ) ) return eg.injectAEPower( amt, mode, seen ); } @@ -187,7 +187,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = outerProxy.getEnergy(); + IEnergyGrid eg = this.outerProxy.getEnergy(); if ( !seen.contains( eg ) ) return eg.injectAEPower( amt, mode, seen ); } @@ -212,7 +212,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = proxy.getEnergy(); + IEnergyGrid eg = this.proxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } catch (GridAccessException e) @@ -222,7 +222,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider try { - IEnergyGrid eg = outerProxy.getEnergy(); + IEnergyGrid eg = this.outerProxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } catch (GridAccessException e) diff --git a/src/main/java/appeng/parts/p2p/PartP2PBCPower.java b/src/main/java/appeng/parts/p2p/PartP2PBCPower.java index 949c69483..9cd01bd06 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PBCPower.java +++ b/src/main/java/appeng/parts/p2p/PartP2PBCPower.java @@ -78,9 +78,9 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( AppEng.instance.isIntegrationEnabled( IntegrationType.MJ5 ) ) { - pp = (BaseMJPerdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this ); - if ( pp != null ) - pp.configure( 1, 380, 1.0f / 5.0f, 1000 ); + this.pp = (BaseMJPerdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this ); + if ( this.pp != null ) + this.pp.configure( 1, 380, 1.0f / 5.0f, 1000 ); } } @@ -95,14 +95,14 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Method(iname = "MJ5") public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( !output && proxy.isActive() ) + if ( !this.output && this.proxy.isActive() ) { float totalRequiredPower = 0.0f; TunnelCollection tunnels; try { - tunnels = getOutputs(); + tunnels = this.getOutputs(); } catch (GridAccessException e) { @@ -114,7 +114,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo IPowerReceptor target = o.getPowerTarget(); if ( target != null ) { - PowerReceiver tp = target.getPowerReceiver( side.getOpposite() ); + PowerReceiver tp = target.getPowerReceiver( this.side.getOpposite() ); if ( tp != null ) { double request = tp.powerRequest(); @@ -133,7 +133,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( totalRequiredPower < 0.1 ) return TickRateModulation.SLOWER; - double currentTotal = pp.getPowerReceiver().getEnergyStored(); + double currentTotal = this.pp.getPowerReceiver().getEnergyStored(); if ( currentTotal < 0.01 ) return TickRateModulation.SLOWER; @@ -142,7 +142,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo IPowerReceptor target = o.getPowerTarget(); if ( target != null ) { - PowerReceiver tp = target.getPowerReceiver( side.getOpposite() ); + PowerReceiver tp = target.getPowerReceiver( this.side.getOpposite() ); if ( tp != null ) { double request = tp.powerRequest(); @@ -153,8 +153,8 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( request > 0.01 && request > tp.getMinEnergyReceived() ) { double toPull = currentTotal * (request / totalRequiredPower); - double pulled = pp.useEnergy( 0, toPull, true ); - QueueTunnelDrain( PowerUnits.MJ, pulled ); + double pulled = this.pp.useEnergy( 0, toPull, true ); + this.QueueTunnelDrain( PowerUnits.MJ, pulled ); tp.receiveEnergy( Type.PIPE, pulled, o.side.getOpposite() ); } @@ -176,14 +176,14 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Method(iname = "MJ6") private IBatteryObject getTargetBattery() { - TileEntity te = getWorld().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ ); + TileEntity te = this.getWorld().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); if ( te != null ) { - IBatteryObject bo = MjAPI.getMjBattery( te, MjAPI.DEFAULT_POWER_FRAMEWORK, side.getOpposite() ); + IBatteryObject bo = MjAPI.getMjBattery( te, MjAPI.DEFAULT_POWER_FRAMEWORK, this.side.getOpposite() ); if ( bo != null ) return bo; - return ((IMJ6) AppEng.instance.getIntegration( IntegrationType.MJ6 )).provider( te, side.getOpposite() ); + return ((IMJ6) AppEng.instance.getIntegration( IntegrationType.MJ6 )).provider( te, this.side.getOpposite() ); } return null; } @@ -191,7 +191,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Method(iname = "MJ5") private IPowerReceptor getPowerTarget() { - TileEntity te = getWorld().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ ); + TileEntity te = this.getWorld().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); if ( te != null ) { if ( te instanceof IPowerReceptor ) @@ -204,16 +204,16 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo public void writeToNBT(NBTTagCompound tag) { super.writeToNBT( tag ); - if ( pp != null ) - pp.writeToNBT( tag ); + if ( this.pp != null ) + this.pp.writeToNBT( tag ); } @Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT( tag ); - if ( pp != null ) - pp.readFromNBT( tag ); + if ( this.pp != null ) + this.pp.readFromNBT( tag ); } @Override @@ -227,7 +227,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Method(iname = "MJ5") public PowerReceiver getPowerReceiver(ForgeDirection side) { - return pp.getPowerReceiver(); + return this.pp.getPowerReceiver(); } @Override @@ -240,7 +240,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Override public World getWorld() { - return tile.getWorldObj(); + return this.tile.getWorldObj(); } @Override @@ -258,7 +258,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo { double totalRequiredPower = 0.0f; - for (PartP2PBCPower g : getOutputs()) + for (PartP2PBCPower g : this.getOutputs()) { IBatteryObject o = g.getTargetBattery(); if ( o != null ) @@ -277,27 +277,27 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo @Method(iname = "MJ6") public double addEnergy(double mj) { - return addEnergyInternal( mj, false, false ); + return this.addEnergyInternal( mj, false, false ); } @Override @Method(iname = "MJ6") public double addEnergy(double mj, boolean ignoreCycleLimit) { - return addEnergyInternal( mj, true, ignoreCycleLimit ); + return this.addEnergyInternal( mj, true, ignoreCycleLimit ); } @Method(iname = "MJ6") private double addEnergyInternal(double mj, boolean cycleLimitMode, boolean ignoreCycleLimit) { - if ( output || !proxy.isActive() ) + if ( this.output || !this.proxy.isActive() ) return 0; double originalInput = mj; try { - TunnelCollection outs = getOutputs(); + TunnelCollection outs = this.getOutputs(); double outputs = 0; for (PartP2PBCPower g : outs) @@ -357,7 +357,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo { double totalRequiredPower = 0.0f; - for (PartP2PBCPower g : getOutputs()) + for (PartP2PBCPower g : this.getOutputs()) { IBatteryObject o = g.getTargetBattery(); if ( o != null ) @@ -386,7 +386,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo { double totalRequiredPower = 0.0f; - for (PartP2PBCPower g : getOutputs()) + for (PartP2PBCPower g : this.getOutputs()) { IBatteryObject o = g.getTargetBattery(); if ( o != null ) @@ -409,7 +409,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo { double totalRequiredPower = 1000000000000.0; - for (PartP2PBCPower g : getOutputs()) + for (PartP2PBCPower g : this.getOutputs()) { IBatteryObject o = g.getTargetBattery(); if ( o != null ) @@ -432,7 +432,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo { double totalRequiredPower = 1000000.0; - for (PartP2PBCPower g : getOutputs()) + for (PartP2PBCPower g : this.getOutputs()) { IBatteryObject o = g.getTargetBattery(); if ( o != null ) diff --git a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java index 0bd3675bc..d300d244c 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java @@ -68,20 +68,20 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i public void writeToNBT(NBTTagCompound tag) { super.writeToNBT( tag ); - tag.setDouble( "OutputPacket", OutputEnergyA ); - tag.setDouble( "OutputPacket2", OutputEnergyB ); - tag.setDouble( "OutputVoltageA", OutputVoltageA ); - tag.setDouble( "OutputVoltageB", OutputVoltageB ); + tag.setDouble( "OutputPacket", this.OutputEnergyA ); + tag.setDouble( "OutputPacket2", this.OutputEnergyB ); + tag.setDouble( "OutputVoltageA", this.OutputVoltageA ); + tag.setDouble( "OutputVoltageB", this.OutputVoltageB ); } @Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT( tag ); - OutputEnergyA = tag.getDouble( "OutputPacket" ); - OutputEnergyB = tag.getDouble( "OutputPacket2" ); - OutputVoltageA = tag.getDouble( "OutputVoltageA" ); - OutputVoltageB = tag.getDouble( "OutputVoltageB" ); + this.OutputEnergyA = tag.getDouble( "OutputPacket" ); + this.OutputEnergyB = tag.getDouble( "OutputPacket2" ); + this.OutputVoltageA = tag.getDouble( "OutputVoltageA" ); + this.OutputVoltageB = tag.getDouble( "OutputVoltageB" ); } @Override @@ -94,28 +94,28 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - if ( !output ) - return direction.equals( side ); + if ( !this.output ) + return direction.equals( this.side ); return false; } @Override public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { - if ( output ) - return direction.equals( side ); + if ( this.output ) + return direction.equals( this.side ); return false; } @Override public double getDemandedEnergy() { - if ( output ) + if ( this.output ) return 0; try { - for (PartP2PIC2Power t : getOutputs()) + for (PartP2PIC2Power t : this.getOutputs()) { if ( t.OutputEnergyA <= 0.0001 || t.OutputEnergyB <= 0.0001 ) { @@ -134,13 +134,13 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public void onTunnelNetworkChange() { - getHost().notifyNeighbors(); + this.getHost().notifyNeighbors(); } @Override public void onTunnelConfigChange() { - getHost().partChanged(); + this.getHost().partChanged(); } public float getPowerDrainPerTick() @@ -154,7 +154,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i TunnelCollection outs; try { - outs = getOutputs(); + outs = this.getOutputs(); } catch (GridAccessException e) { @@ -191,7 +191,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if ( x != null && x.OutputEnergyA <= 0.001 ) { - QueueTunnelDrain( PowerUnits.EU, amount ); + this.QueueTunnelDrain( PowerUnits.EU, amount ); x.OutputEnergyA = amount; x.OutputVoltageA = voltage; return 0; @@ -199,7 +199,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if ( x != null && x.OutputEnergyB <= 0.001 ) { - QueueTunnelDrain( PowerUnits.EU, amount ); + this.QueueTunnelDrain( PowerUnits.EU, amount ); x.OutputEnergyB = amount; x.OutputVoltageB = voltage; return 0; @@ -217,30 +217,30 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public double getOfferedEnergy() { - if ( output ) - return OutputEnergyA; + if ( this.output ) + return this.OutputEnergyA; return 0; } @Override public void drawEnergy(double amount) { - OutputEnergyA -= amount; - if ( OutputEnergyA < 0.001 ) + this.OutputEnergyA -= amount; + if ( this.OutputEnergyA < 0.001 ) { - OutputEnergyA = OutputEnergyB; - OutputEnergyB = 0; + this.OutputEnergyA = this.OutputEnergyB; + this.OutputEnergyB = 0; - OutputVoltageA = OutputVoltageB; - OutputVoltageB = 0; + this.OutputVoltageA = this.OutputVoltageB; + this.OutputVoltageB = 0; } } @Override public int getSourceTier() { - if ( output ) - return calculateTierFromVoltage( OutputVoltageA ); + if ( this.output ) + return this.calculateTierFromVoltage( this.OutputVoltageA ); return 4; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PItems.java b/src/main/java/appeng/parts/p2p/PartP2PItems.java index b6c1cca9a..779bddc50 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PItems.java +++ b/src/main/java/appeng/parts/p2p/PartP2PItems.java @@ -81,25 +81,25 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo { IInventory output = null; - if ( proxy.isActive() ) + if ( this.proxy.isActive() ) { - TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ ); + TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); - if ( which.contains( this ) ) + if ( this.which.contains( this ) ) return null; - which.add( this ); + this.which.add( this ); if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) { IBC buildcraft = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); if ( buildcraft != null ) { - if ( buildcraft.isPipe( te, side.getOpposite() ) ) + if ( buildcraft.isPipe( te, this.side.getOpposite() ) ) { try { - output = new WrapperBCPipe( te, side.getOpposite() ); + output = new WrapperBCPipe( te, this.side.getOpposite() ); } catch (Throwable ignore) { @@ -122,7 +122,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } else if ( te instanceof ISidedInventory ) { - output = new WrapperMCISidedInventory( (ISidedInventory) te, side.getOpposite() ); + output = new WrapperMCISidedInventory( (ISidedInventory) te, this.side.getOpposite() ); } else if ( te instanceof IInventory ) { @@ -130,7 +130,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } } - which.pop(); + this.which.pop(); } return output; @@ -139,9 +139,9 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public void onNeighborChanged() { - cachedInv = null; - PartP2PItems input = getInput(); - if ( input != null && output ) + this.cachedInv = null; + PartP2PItems input = this.getInput(); + if ( input != null && this.output ) input.onTunnelNetworkChange(); } @@ -154,28 +154,28 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - boolean wasReq = requested; + boolean wasReq = this.requested; - if ( requested && cachedInv != null ) - ((WrapperChainedInventory) cachedInv).cycleOrder(); + if ( this.requested && this.cachedInv != null ) + ((WrapperChainedInventory) this.cachedInv).cycleOrder(); - requested = false; + this.requested = false; return wasReq ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } IInventory getDestination() { - requested = true; + this.requested = true; - if ( cachedInv != null ) - return cachedInv; + if ( this.cachedInv != null ) + return this.cachedInv; List outs = new LinkedList(); TunnelCollection itemTunnels; try { - itemTunnels = getOutputs(); + itemTunnels = this.getOutputs(); } catch (GridAccessException e) { @@ -194,20 +194,20 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } } - return cachedInv = new WrapperChainedInventory( outs ); + return this.cachedInv = new WrapperChainedInventory( outs ); } @MENetworkEventSubscribe public void changeStateA(MENetworkBootingStatusChange bs) { - if ( !output ) + if ( !this.output ) { - cachedInv = null; - int olderSize = oldSize; - oldSize = getDestination().getSizeInventory(); - if ( olderSize != oldSize ) + this.cachedInv = null; + int olderSize = this.oldSize; + this.oldSize = this.getDestination().getSizeInventory(); + if ( olderSize != this.oldSize ) { - getHost().notifyNeighbors(); + this.getHost().notifyNeighbors(); } } } @@ -215,14 +215,14 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @MENetworkEventSubscribe public void changeStateB(MENetworkChannelsChanged bs) { - if ( !output ) + if ( !this.output ) { - cachedInv = null; - int olderSize = oldSize; - oldSize = getDestination().getSizeInventory(); - if ( olderSize != oldSize ) + this.cachedInv = null; + int olderSize = this.oldSize; + this.oldSize = this.getDestination().getSizeInventory(); + if ( olderSize != this.oldSize ) { - getHost().notifyNeighbors(); + this.getHost().notifyNeighbors(); } } } @@ -230,14 +230,14 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @MENetworkEventSubscribe public void changeStateC(MENetworkPowerStatusChange bs) { - if ( !output ) + if ( !this.output ) { - cachedInv = null; - int olderSize = oldSize; - oldSize = getDestination().getSizeInventory(); - if ( olderSize != oldSize ) + this.cachedInv = null; + int olderSize = this.oldSize; + this.oldSize = this.getDestination().getSizeInventory(); + if ( olderSize != this.oldSize ) { - getHost().notifyNeighbors(); + this.getHost().notifyNeighbors(); } } } @@ -245,19 +245,19 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public void onTunnelNetworkChange() { - if ( !output ) + if ( !this.output ) { - cachedInv = null; - int olderSize = oldSize; - oldSize = getDestination().getSizeInventory(); - if ( olderSize != oldSize ) + this.cachedInv = null; + int olderSize = this.oldSize; + this.oldSize = this.getDestination().getSizeInventory(); + if ( olderSize != this.oldSize ) { - getHost().notifyNeighbors(); + this.getHost().notifyNeighbors(); } } else { - PartP2PItems input = getInput(); + PartP2PItems input = this.getInput(); if ( input != null ) input.getHost().notifyNeighbors(); } @@ -273,19 +273,19 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public int getSizeInventory() { - return getDestination().getSizeInventory(); + return this.getDestination().getSizeInventory(); } @Override public ItemStack getStackInSlot(int i) { - return getDestination().getStackInSlot( i ); + return this.getDestination().getStackInSlot( i ); } @Override public ItemStack decrStackSize(int i, int j) { - return getDestination().decrStackSize( i, j ); + return this.getDestination().decrStackSize( i, j ); } @Override @@ -297,7 +297,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - getDestination().setInventorySlotContents( i, itemstack ); + this.getDestination().setInventorySlotContents( i, itemstack ); } @Override @@ -315,7 +315,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public int getInventoryStackLimit() { - return getDestination().getInventoryStackLimit(); + return this.getDestination().getInventoryStackLimit(); } @Override @@ -331,14 +331,14 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public boolean isItemValidForSlot(int i, net.minecraft.item.ItemStack itemstack) { - return getDestination().isItemValidForSlot( i, itemstack ); + return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override public int[] getAccessibleSlotsFromSide(int var1) { - int[] slots = new int[getSizeInventory()]; - for (int x = 0; x < getSizeInventory(); x++) + int[] slots = new int[this.getSizeInventory()]; + for (int x = 0; x < this.getSizeInventory(); x++) slots[x] = x; return slots; } @@ -351,7 +351,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return getDestination().isItemValidForSlot( i, itemstack ); + return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override @@ -370,7 +370,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Method(iname = "BC") public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with) { - return side.equals( with ) && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT; + return this.side.equals( with ) && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT; } @Override diff --git a/src/main/java/appeng/parts/p2p/PartP2PLight.java b/src/main/java/appeng/parts/p2p/PartP2PLight.java index 10c30a8df..7e2bdf22a 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLight.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLight.java @@ -58,82 +58,82 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi public void setLightLevel(int out) { - lastValue = out; - getHost().markForUpdate(); + this.lastValue = out; + this.getHost().markForUpdate(); } @Override public int getLightLevel() { - if ( output && isPowered() ) - return blockLight( lastValue ); + if ( this.output && this.isPowered() ) + return this.blockLight( this.lastValue ); return 0; } private int blockLight(int emit) { - if ( opacity < 0 ) + if ( this.opacity < 0 ) { TileEntity te = this.getTile(); - opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ ); + this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); } - return (int) (emit * (opacity / 255.0f)); + return (int) (emit * (this.opacity / 255.0f)); } @Override public void chanRender(MENetworkChannelsChanged c) { - onTunnelNetworkChange(); + this.onTunnelNetworkChange(); super.chanRender( c ); } @Override public void powerRender(MENetworkPowerStatusChange c) { - onTunnelNetworkChange(); + this.onTunnelNetworkChange(); super.powerRender( c ); } @Override public void onTunnelNetworkChange() { - if ( output ) + if ( this.output ) { - PartP2PLight src = getInput(); + PartP2PLight src = this.getInput(); if ( src != null && src.proxy.isActive() ) - setLightLevel( src.lastValue ); + this.setLightLevel( src.lastValue ); else - getHost().markForUpdate(); + this.getHost().markForUpdate(); } else - doWork(); + this.doWork(); } @Override public void onTunnelConfigChange() { - onTunnelNetworkChange(); + this.onTunnelNetworkChange(); } @Override public void onNeighborChanged() { - opacity = -1; + this.opacity = -1; - doWork(); + this.doWork(); - if ( output ) - getHost().markForUpdate(); + if ( this.output ) + this.getHost().markForUpdate(); } @Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT( tag ); - tag.setFloat( "opacity", opacity ); - tag.setInteger( "lastValue", lastValue ); + tag.setFloat( "opacity", this.opacity ); + tag.setInteger( "lastValue", this.lastValue ); } @Override @@ -141,16 +141,16 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi { super.readFromNBT( tag ); if ( tag.hasKey( "opacity" ) ) - opacity = tag.getFloat( "opacity" ); - lastValue = tag.getInteger( "lastValue" ); + this.opacity = tag.getFloat( "opacity" ); + this.lastValue = tag.getInteger( "lastValue" ); } @Override public boolean readFromStream(ByteBuf data) throws IOException { super.readFromStream( data ); - lastValue = data.readInt(); - output = lastValue > 0; + this.lastValue = data.readInt(); + this.output = this.lastValue > 0; return false; } @@ -158,7 +158,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi public void writeToStream(ByteBuf data) throws IOException { super.writeToStream( data ); - data.writeInt( output ? lastValue : 0 ); + data.writeInt( this.output ? this.lastValue : 0 ); } @Override @@ -176,21 +176,21 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi private boolean doWork() { - if ( output ) + if ( this.output ) return false; - TileEntity te = getTile(); + TileEntity te = this.getTile(); World w = te.getWorldObj(); - int newLevel = w.getBlockLightValue( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ ); + int newLevel = w.getBlockLightValue( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); - if ( lastValue != newLevel && proxy.isActive() ) + if ( this.lastValue != newLevel && this.proxy.isActive() ) { - lastValue = newLevel; + this.lastValue = newLevel; try { - for (PartP2PLight out : getOutputs()) - out.setLightLevel( lastValue ); + for (PartP2PLight out : this.getOutputs()) + out.setLightLevel( this.lastValue ); } catch (GridAccessException e) { @@ -209,6 +209,6 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - return doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER; + return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java index 4378126fc..71e87eae1 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java @@ -55,9 +55,9 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl private FluidTankInfo[] getTank() { - if ( output ) + if ( this.output ) { - PartP2PLiquids tun = getInput(); + PartP2PLiquids tun = this.getInput(); if ( tun != null ) return activeTank; } @@ -65,7 +65,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl { try { - if ( !getOutputs().isEmpty() ) + if ( !this.getOutputs().isEmpty() ) return activeTank; } catch (GridAccessException e) @@ -98,7 +98,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl try { - for (PartP2PLiquids l : getOutputs()) + for (PartP2PLiquids l : this.getOutputs()) { IFluidHandler handler = l.getTarget(); if ( handler != null ) @@ -119,10 +119,10 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl @Override public void onNeighborChanged() { - cachedTank = null; - if ( output ) + this.cachedTank = null; + if ( this.output ) { - PartP2PLiquids in = getInput(); + PartP2PLiquids in = this.getInput(); if ( in != null ) in.onTunnelNetworkChange(); } @@ -131,20 +131,20 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl @Override public void onTunnelNetworkChange() { - cachedTank = null; + this.cachedTank = null; } IFluidHandler getTarget() { - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return null; - if ( cachedTank != null ) - return cachedTank; + if ( this.cachedTank != null ) + return this.cachedTank; - TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ ); + TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); if ( te instanceof IFluidHandler ) - return cachedTank = (IFluidHandler) te; + return this.cachedTank = (IFluidHandler) te; return null; } @@ -164,7 +164,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - Stack stack = getDepth(); + Stack stack = this.getDepth(); for (PartP2PLiquids t : stack) if ( t == this ) @@ -172,7 +172,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl stack.push( this ); - List list = getOutputs( resource.getFluid() ); + List list = this.getOutputs( resource.getFluid() ); int requestTotal = 0; Iterator i = list.iterator(); @@ -239,7 +239,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - return !output && from.equals( side ) && !getOutputs( fluid ).isEmpty(); + return !this.output && from.equals( this.side ) && !this.getOutputs( fluid ).isEmpty(); } @Override @@ -263,8 +263,8 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - if ( from.equals( side ) ) - return getTank(); + if ( from.equals( this.side ) ) + return this.getTank(); return new FluidTankInfo[0]; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java index 28be8d12a..e9d6f2b38 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java @@ -59,46 +59,46 @@ public class PartP2PRedstone extends PartP2PTunnel @Override public int isProvidingStrongPower() { - return output ? power : 0; + return this.output ? this.power : 0; } @Override public int isProvidingWeakPower() { - return output ? power : 0; + return this.output ? this.power : 0; } @Override public void onTunnelNetworkChange() { - setNetworkReady(); + this.setNetworkReady(); } @MENetworkEventSubscribe public void changeStateA(MENetworkBootingStatusChange bs) { - setNetworkReady(); + this.setNetworkReady(); } @MENetworkEventSubscribe public void changeStateB(MENetworkChannelsChanged bs) { - setNetworkReady(); + this.setNetworkReady(); } @MENetworkEventSubscribe public void changeStateC(MENetworkPowerStatusChange bs) { - setNetworkReady(); + this.setNetworkReady(); } public void setNetworkReady() { - if ( output ) + if ( this.output ) { - PartP2PRedstone in = getInput(); + PartP2PRedstone in = this.getInput(); if ( in != null ) - putInput( in.power ); + this.putInput( in.power ); } } @@ -106,30 +106,30 @@ public class PartP2PRedstone extends PartP2PTunnel protected void putInput(Object o) { - if ( recursive ) + if ( this.recursive ) return; - recursive = true; - if ( output && proxy.isActive() ) + this.recursive = true; + if ( this.output && this.proxy.isActive() ) { int newPower = (Integer) o; - if ( power != newPower ) + if ( this.power != newPower ) { - power = newPower; - notifyNeighbors(); + this.power = newPower; + this.notifyNeighbors(); } } - recursive = false; + this.recursive = false; } public void notifyNeighbors() { - World worldObj = tile.getWorldObj(); + World worldObj = this.tile.getWorldObj(); - int xCoord = tile.xCoord; - int yCoord = tile.yCoord; - int zCoord = tile.zCoord; + int xCoord = this.tile.xCoord; + int yCoord = this.tile.yCoord; + int zCoord = this.tile.zCoord; Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); @@ -146,14 +146,14 @@ public class PartP2PRedstone extends PartP2PTunnel public void writeToNBT(NBTTagCompound tag) { super.writeToNBT( tag ); - tag.setInteger( "power", power ); + tag.setInteger( "power", this.power ); } @Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT( tag ); - power = tag.getInteger( "power" ); + this.power = tag.getInteger( "power" ); } @Override @@ -171,24 +171,24 @@ public class PartP2PRedstone extends PartP2PTunnel @Override public void onNeighborChanged() { - if ( !output ) + if ( !this.output ) { - int x = tile.xCoord + side.offsetX; - int y = tile.yCoord + side.offsetY; - int z = tile.zCoord + side.offsetZ; + int x = this.tile.xCoord + this.side.offsetX; + int y = this.tile.yCoord + this.side.offsetY; + int z = this.tile.zCoord + this.side.offsetZ; - Block b = tile.getWorldObj().getBlock( x, y, z ); - if ( b != null && !output ) + Block b = this.tile.getWorldObj().getBlock( x, y, z ); + if ( b != null && !this.output ) { - int srcSide = side.ordinal(); + int srcSide = this.side.ordinal(); if ( b instanceof BlockRedstoneWire ) srcSide = 1; - power = b.isProvidingStrongPower( tile.getWorldObj(), x, y, z, srcSide ); - power = Math.max( power, b.isProvidingWeakPower( tile.getWorldObj(), x, y, z, srcSide ) ); - sendToOutput( power ); + this.power = b.isProvidingStrongPower( this.tile.getWorldObj(), x, y, z, srcSide ); + this.power = Math.max( this.power, b.isProvidingWeakPower( this.tile.getWorldObj(), x, y, z, srcSide ) ); + this.sendToOutput( this.power ); } else - sendToOutput( 0 ); + this.sendToOutput( 0 ); } } @@ -196,7 +196,7 @@ public class PartP2PRedstone extends PartP2PTunnel { try { - for (PartP2PRedstone rs : getOutputs()) + for (PartP2PRedstone rs : this.getOutputs()) { rs.putInput( power ); } diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java index 78feb1673..5579e1b6d 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java @@ -55,11 +55,11 @@ public class PartP2PTunnel extends PartBasicState public boolean output; public long freq; - final TunnelCollection type = new TunnelCollection( null, getClass() ); + final TunnelCollection type = new TunnelCollection( null, this.getClass() ); public PartP2PTunnel(ItemStack is) { super( PartP2PTunnel.class, is ); - if ( getClass() == PartP2PTunnel.class ) + if ( this.getClass() == PartP2PTunnel.class ) throw new RuntimeException( "Don't construct the root tunnel!" ); } @@ -72,15 +72,15 @@ public class PartP2PTunnel extends PartBasicState @Override public void writeToNBT(NBTTagCompound data) { - data.setBoolean( "output", output ); - data.setLong( "freq", freq ); + data.setBoolean( "output", this.output ); + data.setLong( "freq", this.freq ); } @Override public void readFromNBT(NBTTagCompound data) { - output = data.getBoolean( "output" ); - freq = data.getLong( "freq" ); + this.output = data.getBoolean( "output" ); + this.freq = data.getLong( "freq" ); } @Override @@ -107,9 +107,9 @@ public class PartP2PTunnel extends PartBasicState IPart testPart = ((IPartItem) newType.getItem()).createPartFromItemStack( newType ); if ( testPart instanceof PartP2PTunnel ) { - getHost().removePart( side, true ); - ForgeDirection dir = getHost().addPart( newType, side, player ); - IPart newBus = getHost().getPart( dir ); + this.getHost().removePart( this.side, true ); + ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); + IPart newBus = this.getHost().getPart( dir ); if ( newBus instanceof PartP2PTunnel ) { @@ -181,12 +181,12 @@ public class PartP2PTunnel extends PartBasicState if ( newType != null && !Platform.isSameItem( newType, this.is ) ) { - boolean oldOutput = output; - long myFreq = freq; + boolean oldOutput = this.output; + long myFreq = this.freq; - getHost().removePart( side, false ); - ForgeDirection dir = getHost().addPart( newType, side, player ); - IPart newBus = getHost().getPart( dir ); + this.getHost().removePart( this.side, false ); + ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); + IPart newBus = this.getHost().getPart( dir ); if ( newBus instanceof PartP2PTunnel ) { @@ -205,7 +205,7 @@ public class PartP2PTunnel extends PartBasicState } } - Platform.notifyBlocksOfNeighbors( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord ); + Platform.notifyBlocksOfNeighbors( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord ); return true; } } @@ -227,29 +227,29 @@ public class PartP2PTunnel extends PartBasicState IMemoryCard mc = (IMemoryCard) is.getItem(); NBTTagCompound data = new NBTTagCompound(); - long newFreq = freq; - boolean wasOutput = output; - output = false; + long newFreq = this.freq; + boolean wasOutput = this.output; + this.output = false; - if ( wasOutput || freq == 0 ) + if ( wasOutput || this.freq == 0 ) newFreq = System.currentTimeMillis(); try { - proxy.getP2P().updateFreq( this, newFreq ); + this.proxy.getP2P().updateFreq( this, newFreq ); } catch (GridAccessException e) { // :P } - onTunnelConfigChange(); + this.onTunnelConfigChange(); - ItemStack p2pItem = getItemStack( PartItemStack.Wrench ); + ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench ); String type = p2pItem.getUnlocalizedName(); p2pItem.writeToNBT( data ); - data.setLong( "freq", freq ); + data.setLong( "freq", this.freq ); mc.setMemoryCardContents( is, type + ".name", data ); mc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED ); @@ -273,10 +273,10 @@ public class PartP2PTunnel extends PartBasicState public TunnelCollection getCollection(Collection collection, Class c) { - if ( type.matches( c ) ) + if ( this.type.matches( c ) ) { - type.setSource( collection ); - return type; + this.type.setSource( collection ); + return this.type; } return null; @@ -284,14 +284,14 @@ public class PartP2PTunnel extends PartBasicState public T getInput() { - if ( freq == 0 ) + if ( this.freq == 0 ) return null; PartP2PTunnel tunnel; try { - tunnel = proxy.getP2P().getInput( freq ); - if ( getClass().isInstance( tunnel ) ) + tunnel = this.proxy.getP2P().getInput( this.freq ); + if ( this.getClass().isInstance( tunnel ) ) return (T) tunnel; } catch (GridAccessException e) @@ -303,9 +303,9 @@ public class PartP2PTunnel extends PartBasicState public TunnelCollection getOutputs() throws GridAccessException { - if ( proxy.isActive() ) - return (TunnelCollection) proxy.getP2P().getOutputs( freq, getClass() ); - return new TunnelCollection( new ArrayList(), getClass() ); + if ( this.proxy.isActive() ) + return (TunnelCollection) this.proxy.getP2P().getOutputs( this.freq, this.getClass() ); + return new TunnelCollection( new ArrayList(), this.getClass() ); } public void onTunnelNetworkChange() @@ -317,13 +317,13 @@ public class PartP2PTunnel extends PartBasicState @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { - rh.setTexture( getTypeTexture() ); + rh.setTexture( this.getTypeTexture() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderInventoryBox( renderer ); rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), - is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderInventoryBox( renderer ); @@ -338,14 +338,14 @@ public class PartP2PTunnel extends PartBasicState @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); - rh.setTexture( getTypeTexture() ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); + rh.setTexture( this.getTypeTexture() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), - is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -361,7 +361,7 @@ public class PartP2PTunnel extends PartBasicState rh.setBounds( 5, 6, 12, 11, 10, 13 ); rh.renderBlock( x, y, z, renderer ); - renderLights( x, y, z, rh, renderer ); + this.renderLights( x, y, z, rh, renderer ); } @Override @@ -377,7 +377,7 @@ public class PartP2PTunnel extends PartBasicState try { - proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE ); + this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE ); } catch (GridAccessException e) { diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java index 660b33bd5..43ed900f9 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java @@ -59,49 +59,49 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public PartP2PTunnelME(ItemStack is) { super( is ); - proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL ); - outerProxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED ); + this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL ); + this.outerProxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED ); } @Override public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { super.setPartHostInfo( side, host, tile ); - outerProxy.setValidSides( EnumSet.of( side ) ); + this.outerProxy.setValidSides( EnumSet.of( side ) ); } @Override public void readFromNBT(NBTTagCompound extra) { super.readFromNBT( extra ); - outerProxy.readFromNBT( extra ); + this.outerProxy.readFromNBT( extra ); } @Override public void writeToNBT(NBTTagCompound extra) { super.writeToNBT( extra ); - outerProxy.writeToNBT( extra ); + this.outerProxy.writeToNBT( extra ); } @Override public void addToWorld() { super.addToWorld(); - outerProxy.onReady(); + this.outerProxy.onReady(); } @Override public void removeFromWorld() { super.removeFromWorld(); - outerProxy.invalidate(); + this.outerProxy.invalidate(); } @Override public IGridNode getExternalFacingNode() { - return outerProxy.getNode(); + return this.outerProxy.getNode(); } @Override @@ -114,11 +114,11 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public void onTunnelNetworkChange() { super.onTunnelNetworkChange(); - if ( !output ) + if ( !this.output ) { try { - proxy.getTick().wakeDevice( proxy.getNode() ); + this.proxy.getTick().wakeDevice( this.proxy.getNode() ); } catch (GridAccessException e) { @@ -139,24 +139,24 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I // just move on... try { - if ( !proxy.getPath().isNetworkBooting() ) + if ( !this.proxy.getPath().isNetworkBooting() ) { - if ( !proxy.getEnergy().isNetworkPowered() ) + if ( !this.proxy.getEnergy().isNetworkPowered() ) { - connection.markDestroy(); - TickHandler.instance.addCallable( tile.getWorldObj(), connection ); + this.connection.markDestroy(); + TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection ); } else { - if ( proxy.isActive() ) + if ( this.proxy.isActive() ) { - connection.markCreate(); - TickHandler.instance.addCallable( tile.getWorldObj(), connection ); + this.connection.markCreate(); + TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection ); } else { - connection.markDestroy(); - TickHandler.instance.addCallable( tile.getWorldObj(), connection ); + this.connection.markDestroy(); + TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection ); } } @@ -175,28 +175,28 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side) { super.onPlacement( player, held, side ); - outerProxy.setOwner( player ); + this.outerProxy.setOwner( player ); } public void updateConnections(Connections connections) { if ( connections.destroy ) { - for (TunnelConnection cw : connection.connections.values()) + for (TunnelConnection cw : this.connection.connections.values()) cw.c.destroy(); - connection.connections.clear(); + this.connection.connections.clear(); } else if ( connections.create ) { - Iterator i = connection.connections.values().iterator(); + Iterator i = this.connection.connections.values().iterator(); while (i.hasNext()) { TunnelConnection cw = i.next(); try { - if ( cw.tunnel.proxy.getGrid() != proxy.getGrid() ) + if ( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() ) { cw.c.destroy(); i.remove(); @@ -216,7 +216,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I LinkedList newSides = new LinkedList(); try { - for (PartP2PTunnelME me : getOutputs()) + for (PartP2PTunnelME me : this.getOutputs()) { if ( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null ) { @@ -229,7 +229,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I try { connections.connections.put( me.getGridNode(), - new TunnelConnection( me, AEApi.instance().createGridConnection( outerProxy.getNode(), me.outerProxy.getNode() ) ) ); + new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) ); } catch (FailedConnection e) { diff --git a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java index 80a4f11bc..de99385a3 100644 --- a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java @@ -43,9 +43,9 @@ public class PartConversionMonitor extends PartStorageMonitor public PartConversionMonitor(ItemStack is) { super( PartConversionMonitor.class, is ); - frontBright = CableBusTextures.PartConversionMonitor_Bright; - frontColored = CableBusTextures.PartConversionMonitor_Colored; - frontDark = CableBusTextures.PartConversionMonitor_Dark; + this.frontBright = CableBusTextures.PartConversionMonitor_Bright; + this.frontColored = CableBusTextures.PartConversionMonitor_Colored; + this.frontDark = CableBusTextures.PartConversionMonitor_Dark; // frontSolid = CableBusTextures.PartConversionMonitor_Solid; } @@ -55,30 +55,30 @@ public class PartConversionMonitor extends PartStorageMonitor if ( Platform.isClient() ) return true; - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return false; - if ( !Platform.hasPermissions( getLocation(), player ) ) + if ( !Platform.hasPermissions( this.getLocation(), player ) ) return false; boolean ModeB = false; ItemStack item = player.getCurrentEquippedItem(); - if ( item == null && getDisplayed() != null ) + if ( item == null && this.getDisplayed() != null ) { ModeB = true; - item = ((IAEItemStack) getDisplayed()).getItemStack(); + item = ((IAEItemStack) this.getDisplayed()).getItemStack(); } if ( item != null ) { try { - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return false; - IEnergySource energy = proxy.getEnergy(); - IMEMonitor cell = proxy.getStorage().getItemInventory(); + IEnergySource energy = this.proxy.getEnergy(); + IMEMonitor cell = this.proxy.getStorage().getItemInventory(); IAEItemStack input = AEItemStack.create( item ); if ( ModeB ) @@ -112,16 +112,16 @@ public class PartConversionMonitor extends PartStorageMonitor @Override protected void extractItem(EntityPlayer player) { - IAEItemStack input = (IAEItemStack) getDisplayed(); + IAEItemStack input = (IAEItemStack) this.getDisplayed(); if ( input != null ) { try { - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return; - IEnergySource energy = proxy.getEnergy(); - IMEMonitor cell = proxy.getStorage().getItemInventory(); + IEnergySource energy = this.proxy.getEnergy(); + IMEMonitor cell = this.proxy.getStorage().getItemInventory(); ItemStack is = input.getItemStack(); input.setStackSize( is.getMaxStackSize() ); @@ -134,9 +134,9 @@ public class PartConversionMonitor extends PartStorageMonitor newItems = adaptor.addItems( newItems ); if ( newItems != null ) { - TileEntity te = tile; + TileEntity te = this.tile; List list = Collections.singletonList( newItems ); - Platform.spawnDrops( player.worldObj, te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ, list ); + Platform.spawnDrops( player.worldObj, te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ, list ); } if ( player.openContainer != null ) diff --git a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java index c9f4e7c14..dbc2d3c80 100644 --- a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java @@ -38,14 +38,14 @@ public class PartCraftingTerminal extends PartTerminal public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - craftingGrid.writeToNBT( data, "craftingGrid" ); + this.craftingGrid.writeToNBT( data, "craftingGrid" ); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - craftingGrid.readFromNBT( data, "craftingGrid" ); + this.craftingGrid.readFromNBT( data, "craftingGrid" ); } @Override @@ -53,16 +53,16 @@ public class PartCraftingTerminal extends PartTerminal { super.getDrops(drops, wrenched); - for (ItemStack is : craftingGrid) + for (ItemStack is : this.craftingGrid) if ( is != null ) drops.add( is ); } public PartCraftingTerminal(ItemStack is) { super( PartCraftingTerminal.class, is ); - frontBright = CableBusTextures.PartCraftingTerm_Bright; - frontColored = CableBusTextures.PartCraftingTerm_Colored; - frontDark = CableBusTextures.PartCraftingTerm_Dark; + this.frontBright = CableBusTextures.PartCraftingTerm_Bright; + this.frontColored = CableBusTextures.PartCraftingTerm_Colored; + this.frontDark = CableBusTextures.PartCraftingTerm_Dark; // frontSolid = CableBusTextures.PartCraftingTerm_Solid; } @@ -70,14 +70,14 @@ public class PartCraftingTerminal extends PartTerminal public GuiBridge getGui( EntityPlayer p ) { int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ; - if ( getHost().getTile() != null ) + if ( this.getHost().getTile() != null ) { - x = tile.xCoord; - y = tile.yCoord; - z = tile.zCoord; + x = this.tile.xCoord; + y = this.tile.yCoord; + z = this.tile.zCoord; } - if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) ) + if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) ) return GuiBridge.GUI_CRAFTING_TERMINAL; return GuiBridge.GUI_ME; } @@ -85,14 +85,14 @@ public class PartCraftingTerminal extends PartTerminal @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - host.markForSave(); + this.host.markForSave(); } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "crafting" ) ) - return craftingGrid; + return this.craftingGrid; return super.getInventoryByName( name ); } diff --git a/src/main/java/appeng/parts/reporting/PartDarkMonitor.java b/src/main/java/appeng/parts/reporting/PartDarkMonitor.java index eccf5aa69..1418aeb5d 100644 --- a/src/main/java/appeng/parts/reporting/PartDarkMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartDarkMonitor.java @@ -32,7 +32,7 @@ public class PartDarkMonitor extends PartMonitor public PartDarkMonitor(ItemStack is) { super( PartDarkMonitor.class, is, false ); - notLightSource = false; + this.notLightSource = false; } @Override @@ -42,11 +42,11 @@ public class PartDarkMonitor extends PartMonitor rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.renderInventoryBox( renderer ); - rh.setInvColor( getColor().mediumVariant ); - rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.setInvColor( this.getColor().mediumVariant ); + rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderInventoryBox( renderer ); @@ -57,19 +57,19 @@ public class PartDarkMonitor extends PartMonitor public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); - if ( getLightLevel() > 0 ) + if ( this.getLightLevel() > 0 ) { int l = 13; Tessellator.instance.setBrightness( l << 20 | l << 4 ); } - Tessellator.instance.setColorOpaque_I( getColor().mediumVariant ); - rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant ); + rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderBlock( x, y, z, renderer ); diff --git a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java index aa286a5f8..8c27cebad 100644 --- a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java @@ -30,9 +30,9 @@ public class PartInterfaceTerminal extends PartMonitor public PartInterfaceTerminal(ItemStack is) { super( PartInterfaceTerminal.class, is, true ); - frontBright = CableBusTextures.PartInterfaceTerm_Bright; - frontColored = CableBusTextures.PartInterfaceTerm_Colored; - frontDark = CableBusTextures.PartInterfaceTerm_Dark; + this.frontBright = CableBusTextures.PartInterfaceTerm_Bright; + this.frontColored = CableBusTextures.PartInterfaceTerm_Colored; + this.frontDark = CableBusTextures.PartInterfaceTerm_Dark; } @Override @@ -45,7 +45,7 @@ public class PartInterfaceTerminal extends PartMonitor if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_INTERFACE_TERMINAL ); + Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_INTERFACE_TERMINAL ); return true; } diff --git a/src/main/java/appeng/parts/reporting/PartMonitor.java b/src/main/java/appeng/parts/reporting/PartMonitor.java index dd27ee764..9cc4d66dd 100644 --- a/src/main/java/appeng/parts/reporting/PartMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartMonitor.java @@ -71,17 +71,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann byte rotation = (byte) (MathHelper.floor_double( (player.rotationYaw * 4F) / 360F + 2.5D ) & 3); if ( side == ForgeDirection.UP ) - spin = rotation; + this.spin = rotation; else if ( side == ForgeDirection.DOWN ) - spin = rotation; + this.spin = rotation; } @Override public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - data.setFloat( "opacity", opacity ); - data.setByte( "spin", spin ); + data.setFloat( "opacity", this.opacity ); + data.setByte( "spin", this.spin ); } @Override @@ -89,35 +89,35 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann { super.readFromNBT( data ); if ( data.hasKey( "opacity" ) ) - opacity = data.getFloat( "opacity" ); - spin = data.getByte( "spin" ); + this.opacity = data.getFloat( "opacity" ); + this.spin = data.getByte( "spin" ); } @Override public boolean onPartActivate(EntityPlayer player, Vec3 pos) { - TileEntity te = getTile(); + TileEntity te = this.getTile(); if ( !player.isSneaking() && Platform.isWrench( player, player.inventory.getCurrentItem(), te.xCoord, te.yCoord, te.zCoord ) ) { if ( Platform.isServer() ) { - if ( spin > 3 ) - spin = 0; + if ( this.spin > 3 ) + this.spin = 0; - switch (spin) + switch (this.spin) { case 0: - spin = 1; + this.spin = 1; break; case 1: - spin = 3; + this.spin = 3; break; case 2: - spin = 0; + this.spin = 0; break; case 3: - spin = 2; + this.spin = 2; break; } @@ -133,56 +133,56 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann @MENetworkEventSubscribe public void bootingRender(MENetworkBootingStatusChange c) { - if ( notLightSource ) - getHost().markForUpdate(); + if ( this.notLightSource ) + this.getHost().markForUpdate(); } @Override public void onNeighborChanged() { - opacity = -1; - getHost().markForUpdate(); + this.opacity = -1; + this.getHost().markForUpdate(); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - getHost().markForUpdate(); + this.getHost().markForUpdate(); } @Override public void writeToStream(ByteBuf data) throws IOException { super.writeToStream( data ); - clientFlags = spin & 3; + this.clientFlags = this.spin & 3; try { - if ( proxy.getEnergy().isNetworkPowered() ) - clientFlags = clientFlags | POWERED_FLAG; + if ( this.proxy.getEnergy().isNetworkPowered() ) + this.clientFlags = this.clientFlags | this.POWERED_FLAG; - if ( proxy.getPath().isNetworkBooting() ) - clientFlags = clientFlags | BOOTING_FLAG; + if ( this.proxy.getPath().isNetworkBooting() ) + this.clientFlags = this.clientFlags | this.BOOTING_FLAG; - if ( proxy.getNode().meetsChannelRequirements() ) - clientFlags = clientFlags | CHANNEL_FLAG; + if ( this.proxy.getNode().meetsChannelRequirements() ) + this.clientFlags = this.clientFlags | this.CHANNEL_FLAG; } catch (GridAccessException e) { // um.. nothing. } - data.writeByte( (byte) clientFlags ); + data.writeByte( (byte) this.clientFlags ); } @Override public boolean readFromStream(ByteBuf data) throws IOException { super.readFromStream( data ); - int oldFlags = clientFlags; - clientFlags = data.readByte(); - spin = (byte) (clientFlags & 3); - if ( clientFlags == oldFlags ) + int oldFlags = this.clientFlags; + this.clientFlags = data.readByte(); + this.spin = (byte) (this.clientFlags & 3); + if ( this.clientFlags == oldFlags ) return false; return true; } @@ -190,18 +190,18 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann @Override public int getLightLevel() { - return blockLight( isPowered() ? (notLightSource ? 9 : 15) : 0 ); + return this.blockLight( this.isPowered() ? (this.notLightSource ? 9 : 15) : 0 ); } private int blockLight(int emit) { - if ( opacity < 0 ) + if ( this.opacity < 0 ) { TileEntity te = this.getTile(); - opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ ); + this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); } - return (int) (emit * (opacity / 255.0f)); + return (int) (emit * (this.opacity / 255.0f)); } @Override @@ -210,9 +210,9 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann try { if ( Platform.isServer() ) - return proxy.getEnergy().isNetworkPowered(); + return this.proxy.getEnergy().isNetworkPowered(); else - return ((clientFlags & POWERED_FLAG) == POWERED_FLAG); + return ((this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG); } catch (GridAccessException e) { @@ -229,11 +229,11 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann if ( requireChannel ) { - proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - proxy.setIdlePowerUsage( 1.0 / 2.0 ); + this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.proxy.setIdlePowerUsage( 1.0 / 2.0 ); } else - proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit. + this.proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit. } @@ -244,17 +244,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.renderInventoryBox( renderer ); - rh.setInvColor( getColor().whiteVariant ); - rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.setInvColor( this.getColor().whiteVariant ); + rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); - rh.setInvColor( getColor().mediumVariant ); - rh.renderInventoryFace( frontDark.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.setInvColor( this.getColor().mediumVariant ); + rh.renderInventoryFace( this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer ); - rh.setInvColor( getColor().blackVariant ); - rh.renderInventoryFace( frontColored.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.setInvColor( this.getColor().blackVariant ); + rh.renderInventoryFace( this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderInventoryBox( renderer ); @@ -264,15 +264,15 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann @SideOnly(Side.CLIENT) public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { - renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache ); + this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); - if ( getLightLevel() > 0 ) + if ( this.getLightLevel() > 0 ) { int l = 13; Tessellator.instance.setBrightness( l << 20 | l << 4 ); @@ -280,43 +280,43 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this.spin; - Tessellator.instance.setColorOpaque_I( getColor().whiteVariant ); - rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant ); + rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); - Tessellator.instance.setColorOpaque_I( getColor().mediumVariant ); - rh.renderFace( x, y, z, frontDark.getIcon(), ForgeDirection.SOUTH, renderer ); + Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant ); + rh.renderFace( x, y, z, this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer ); - Tessellator.instance.setColorOpaque_I( getColor().blackVariant ); - rh.renderFace( x, y, z, frontColored.getIcon(), ForgeDirection.SOUTH, renderer ); + Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant ); + rh.renderFace( x, y, z, this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - if ( notLightSource ) + if ( this.notLightSource ) { rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), - CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), + CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() ); } rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderBlock( x, y, z, renderer ); - if ( notLightSource ) + if ( this.notLightSource ) { - boolean hasChan = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG); - boolean hasPower = (clientFlags & POWERED_FLAG) == POWERED_FLAG; + boolean hasChan = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG); + boolean hasPower = (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG; if ( hasChan ) { int l = 14; Tessellator.instance.setBrightness( l << 20 | l << 4 ); - Tessellator.instance.setColorOpaque_I( getColor().blackVariant ); + Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant ); } else if ( hasPower ) { int l = 9; Tessellator.instance.setBrightness( l << 20 | l << 4 ); - Tessellator.instance.setColorOpaque_I( getColor().whiteVariant ); + Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant ); } else { @@ -342,10 +342,10 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann @Override public boolean isActive() { - if ( notLightSource ) - return ((clientFlags & (CHANNEL_FLAG | POWERED_FLAG)) == (CHANNEL_FLAG | POWERED_FLAG)); + if ( this.notLightSource ) + return ((this.clientFlags & (this.CHANNEL_FLAG | this.POWERED_FLAG)) == (this.CHANNEL_FLAG | this.POWERED_FLAG)); else - return isPowered(); + return this.isPowered(); } } diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java index 6bcfa1cb5..c567e140b 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java @@ -45,49 +45,49 @@ public class PartPatternTerminal extends PartTerminal public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - data.setBoolean( "craftingMode", isCraftingRecipe() ); - pattern.writeToNBT( data, "pattern" ); - output.writeToNBT( data, "outputList" ); - crafting.writeToNBT( data, "craftingGrid" ); + data.setBoolean( "craftingMode", this.isCraftingRecipe() ); + this.pattern.writeToNBT( data, "pattern" ); + this.output.writeToNBT( data, "outputList" ); + this.crafting.writeToNBT( data, "craftingGrid" ); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - setCraftingRecipe( data.getBoolean( "craftingMode" ) ); - pattern.readFromNBT( data, "pattern" ); - output.readFromNBT( data, "outputList" ); - crafting.readFromNBT( data, "craftingGrid" ); + this.setCraftingRecipe( data.getBoolean( "craftingMode" ) ); + this.pattern.readFromNBT( data, "pattern" ); + this.output.readFromNBT( data, "outputList" ); + this.crafting.readFromNBT( data, "craftingGrid" ); } @Override public void getDrops(List drops, boolean wrenched) { - for (ItemStack is : pattern) + for (ItemStack is : this.pattern) if ( is != null ) drops.add( is ); } public PartPatternTerminal(ItemStack is) { super( PartPatternTerminal.class, is ); - frontBright = CableBusTextures.PartPatternTerm_Bright; - frontColored = CableBusTextures.PartPatternTerm_Colored; - frontDark = CableBusTextures.PartPatternTerm_Dark; + this.frontBright = CableBusTextures.PartPatternTerm_Bright; + this.frontColored = CableBusTextures.PartPatternTerm_Colored; + this.frontDark = CableBusTextures.PartPatternTerm_Dark; } @Override public GuiBridge getGui( EntityPlayer p ) { int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ; - if ( getHost().getTile() != null ) + if ( this.getHost().getTile() != null ) { - x = tile.xCoord; - y = tile.yCoord; - z = tile.zCoord; + x = this.tile.xCoord; + y = this.tile.yCoord; + z = this.tile.zCoord; } - if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) ) + if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) ) return GuiBridge.GUI_PATTERN_TERMINAL; return GuiBridge.GUI_ME; } @@ -96,13 +96,13 @@ public class PartPatternTerminal extends PartTerminal public IInventory getInventoryByName(String name) { if ( name.equals( "crafting" ) ) - return crafting; + return this.crafting; if ( name.equals( "output" ) ) - return output; + return this.output; if ( name.equals( "pattern" ) ) - return pattern; + return this.pattern; return super.getInventoryByName( name ); } @@ -110,57 +110,57 @@ public class PartPatternTerminal extends PartTerminal @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - if ( inv == pattern && slot == 1 ) + if ( inv == this.pattern && slot == 1 ) { - ItemStack is = pattern.getStackInSlot( 1 ); + ItemStack is = this.pattern.getStackInSlot( 1 ); if ( is != null && is.getItem() instanceof ICraftingPatternItem ) { ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem(); ICraftingPatternDetails details = pattern.getPatternForItem( is, this.getHost().getTile().getWorldObj() ); if ( details != null ) { - setCraftingRecipe( details.isCraftable() ); + this.setCraftingRecipe( details.isCraftable() ); - for (int x = 0; x < crafting.getSizeInventory() && x < details.getInputs().length; x++) + for (int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++) { IAEItemStack item = details.getInputs()[x]; - crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); + this.crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); } - for (int x = 0; x < output.getSizeInventory() && x < details.getOutputs().length; x++) + for (int x = 0; x < this.output.getSizeInventory() && x < details.getOutputs().length; x++) { IAEItemStack item = details.getOutputs()[x]; - output.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); + this.output.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); } } } } - else if ( inv == crafting ) + else if ( inv == this.crafting ) { - fixCraftingRecipes(); + this.fixCraftingRecipes(); } - host.markForSave(); + this.host.markForSave(); } public boolean isCraftingRecipe() { - return craftingMode; + return this.craftingMode; } public void setCraftingRecipe(boolean craftingMode) { this.craftingMode = craftingMode; - fixCraftingRecipes(); + this.fixCraftingRecipes(); } private void fixCraftingRecipes() { - if ( isCraftingRecipe() ) + if ( this.isCraftingRecipe() ) { - for (int x = 0; x < crafting.getSizeInventory(); x++) + for (int x = 0; x < this.crafting.getSizeInventory(); x++) { - ItemStack is = crafting.getStackInSlot( x ); + ItemStack is = this.crafting.getStackInSlot( x ); if ( is != null ) is.stackSize = 1; } diff --git a/src/main/java/appeng/parts/reporting/PartSemiDarkMonitor.java b/src/main/java/appeng/parts/reporting/PartSemiDarkMonitor.java index 5e39dd16f..0b344a7fd 100644 --- a/src/main/java/appeng/parts/reporting/PartSemiDarkMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartSemiDarkMonitor.java @@ -32,7 +32,7 @@ public class PartSemiDarkMonitor extends PartMonitor public PartSemiDarkMonitor(ItemStack is) { super( PartSemiDarkMonitor.class, is,false ); - notLightSource = false; + this.notLightSource = false; } @Override @@ -42,14 +42,14 @@ public class PartSemiDarkMonitor extends PartMonitor rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.renderInventoryBox( renderer ); - int light = getColor().whiteVariant; - int dark = getColor().mediumVariant; + int light = this.getColor().whiteVariant; + int dark = this.getColor().mediumVariant; rh.setInvColor( (((((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2) << 16) | (((((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2) << 8) | ((((light) & 0xff) + ((dark) & 0xff)) / 2) ); - rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderInventoryBox( renderer ); @@ -60,22 +60,22 @@ public class PartSemiDarkMonitor extends PartMonitor public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), - is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); + this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.renderBlock( x, y, z, renderer ); - if ( getLightLevel() > 0 ) + if ( this.getLightLevel() > 0 ) { int l = 13; Tessellator.instance.setBrightness( l << 20 | l << 4 ); } - int light = getColor().whiteVariant; - int dark = getColor().mediumVariant; + int light = this.getColor().whiteVariant; + int dark = this.getColor().mediumVariant; Tessellator.instance.setColorOpaque( (((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2, (((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2, (((light) & 0xff) + ((dark) & 0xff)) / 2 ); - rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); + rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderBlock( x, y, z, renderer ); diff --git a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java index 29a247476..efca8d6f0 100644 --- a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java @@ -72,11 +72,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit { super.writeToNBT( data ); - data.setBoolean( "isLocked", isLocked ); + data.setBoolean( "isLocked", this.isLocked ); NBTTagCompound myItem = new NBTTagCompound(); - if ( configuredItem != null ) - configuredItem.writeToNBT( myItem ); + if ( this.configuredItem != null ) + this.configuredItem.writeToNBT( myItem ); data.setTag( "configuredItem", myItem ); } @@ -86,10 +86,10 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit { super.readFromNBT( data ); - isLocked = data.getBoolean( "isLocked" ); + this.isLocked = data.getBoolean( "isLocked" ); NBTTagCompound myItem = data.getCompoundTag( "configuredItem" ); - configuredItem = AEItemStack.loadItemStackFromNBT( myItem ); + this.configuredItem = AEItemStack.loadItemStackFromNBT( myItem ); } @Override @@ -97,11 +97,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit { super.writeToStream( data ); - data.writeByte( spin ); - data.writeBoolean( isLocked ); - data.writeBoolean( configuredItem != null ); - if ( configuredItem != null ) - configuredItem.writeToPacket( data ); + data.writeByte( this.spin ); + data.writeBoolean( this.isLocked ); + data.writeBoolean( this.configuredItem != null ); + if ( this.configuredItem != null ) + this.configuredItem.writeToPacket( data ); } @Override @@ -109,15 +109,15 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit { boolean stuff = super.readFromStream( data ); - spin = data.readByte(); - isLocked = data.readBoolean(); + this.spin = data.readByte(); + this.isLocked = data.readBoolean(); boolean val = data.readBoolean(); if ( val ) - configuredItem = AEItemStack.loadItemStackFromPacket( data ); + this.configuredItem = AEItemStack.loadItemStackFromPacket( data ); else - configuredItem = null; + this.configuredItem = null; - updateList = true; + this.updateList = true; return stuff; } @@ -128,28 +128,28 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit if ( Platform.isClient() ) return true; - if ( !proxy.isActive() ) + if ( !this.proxy.isActive() ) return false; - if ( !Platform.hasPermissions( getLocation(), player ) ) + if ( !Platform.hasPermissions( this.getLocation(), player ) ) return false; TileEntity te = this.tile; ItemStack eq = player.getCurrentEquippedItem(); if ( Platform.isWrench( player, eq, te.xCoord, te.yCoord, te.zCoord ) ) { - isLocked = !isLocked; - player.addChatMessage( (isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() ); + this.isLocked = !this.isLocked; + player.addChatMessage( (this.isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() ); this.getHost().markForUpdate(); } - else if ( !isLocked ) + else if ( !this.isLocked ) { - configuredItem = AEItemStack.create( eq ); - configureWatchers(); + this.configuredItem = AEItemStack.create( eq ); + this.configureWatchers(); this.getHost().markForUpdate(); } else - extractItem( player ); + this.extractItem( player ); return true; } @@ -165,9 +165,9 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit public PartStorageMonitor(ItemStack is) { super( PartStorageMonitor.class, is, true ); - frontBright = CableBusTextures.PartStorageMonitor_Bright; - frontColored = CableBusTextures.PartStorageMonitor_Colored; - frontDark = CableBusTextures.PartStorageMonitor_Dark; + this.frontBright = CableBusTextures.PartStorageMonitor_Bright; + this.frontColored = CableBusTextures.PartStorageMonitor_Colored; + this.frontDark = CableBusTextures.PartStorageMonitor_Dark; // frontSolid = CableBusTextures.PartStorageMonitor_Solid; } @@ -188,39 +188,39 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit protected void finalize() throws Throwable { super.finalize(); - if ( dspList != null ) - GLAllocation.deleteDisplayLists( dspList ); + if ( this.dspList != null ) + GLAllocation.deleteDisplayLists( this.dspList ); } @Override @SideOnly(Side.CLIENT) public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer) { - if ( dspList == null ) - dspList = GLAllocation.generateDisplayLists( 1 ); + if ( this.dspList == null ) + this.dspList = GLAllocation.generateDisplayLists( 1 ); Tessellator tess = Tessellator.instance; if ( Platform.isDrawing( tess ) ) return; - if ( (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) != (POWERED_FLAG | CHANNEL_FLAG) ) + if ( (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) != (this.POWERED_FLAG | this.CHANNEL_FLAG) ) return; - IAEItemStack ais = (IAEItemStack) getDisplayed(); + IAEItemStack ais = (IAEItemStack) this.getDisplayed(); if ( ais != null ) { GL11.glPushMatrix(); GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 ); - if ( updateList ) + if ( this.updateList ) { - updateList = false; - GL11.glNewList( dspList, GL11.GL_COMPILE_AND_EXECUTE ); - tesrRenderScreen( tess, ais ); + this.updateList = false; + GL11.glNewList( this.dspList, GL11.GL_COMPILE_AND_EXECUTE ); + this.tesrRenderScreen( tess, ais ); GL11.glEndList(); } else - GL11.glCallList( dspList ); + GL11.glCallList( this.dspList ); GL11.glPopMatrix(); } @@ -229,21 +229,21 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit private void tesrRenderScreen(Tessellator tess, IAEItemStack ais) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - ForgeDirection d = side; + ForgeDirection d = this.side; GL11.glTranslated( d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77 ); if ( d == ForgeDirection.UP ) { GL11.glScalef( 1.0f, -1.0f, 1.0f ); GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f ); - GL11.glRotatef( spin * 90.0F, 0, 0, 1 ); + GL11.glRotatef( this.spin * 90.0F, 0, 0, 1 ); } if ( d == ForgeDirection.DOWN ) { GL11.glScalef( 1.0f, -1.0f, 1.0f ); GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f ); - GL11.glRotatef( spin * -90.0F, 0, 0, 1 ); + GL11.glRotatef( this.spin * -90.0F, 0, 0, 1 ); } if ( d == ForgeDirection.EAST ) @@ -323,13 +323,13 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit @Override public IAEStack getDisplayed() { - return configuredItem; + return this.configuredItem; } @Override public boolean isLocked() { - return isLocked; + return this.isLocked; } IStackWatcher myWatcher; @@ -337,24 +337,24 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit @Override public void updateWatcher(IStackWatcher newWatcher) { - myWatcher = newWatcher; - configureWatchers(); + this.myWatcher = newWatcher; + this.configureWatchers(); } // update the system... public void configureWatchers() { - if ( myWatcher != null ) - myWatcher.clear(); + if ( this.myWatcher != null ) + this.myWatcher.clear(); try { - if ( configuredItem != null ) + if ( this.configuredItem != null ) { - if ( myWatcher != null ) - myWatcher.add( configuredItem ); + if ( this.myWatcher != null ) + this.myWatcher.add( this.configuredItem ); - updateReportingValue( proxy.getStorage().getItemInventory() ); + this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } } catch (GridAccessException e) @@ -365,27 +365,27 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit private void updateReportingValue(IMEMonitor itemInventory) { - if ( configuredItem != null ) + if ( this.configuredItem != null ) { - IAEItemStack result = itemInventory.getStorageList().findPrecise( configuredItem ); + IAEItemStack result = itemInventory.getStorageList().findPrecise( this.configuredItem ); if ( result == null ) - configuredItem.setStackSize( 0 ); + this.configuredItem.setStackSize( 0 ); else - configuredItem.setStackSize( result.getStackSize() ); + this.configuredItem.setStackSize( result.getStackSize() ); } } @Override public void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan) { - if ( configuredItem != null ) + if ( this.configuredItem != null ) { if ( fullStack == null ) - configuredItem.setStackSize( 0 ); + this.configuredItem.setStackSize( 0 ); else - configuredItem.setStackSize( fullStack.getStackSize() ); + this.configuredItem.setStackSize( fullStack.getStackSize() ); - getHost().markForUpdate(); + this.getHost().markForUpdate(); } } diff --git a/src/main/java/appeng/parts/reporting/PartTerminal.java b/src/main/java/appeng/parts/reporting/PartTerminal.java index 17327cc6b..f6668179a 100644 --- a/src/main/java/appeng/parts/reporting/PartTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartTerminal.java @@ -52,9 +52,9 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM public PartTerminal(Class clz, ItemStack is) { super( clz, is, true ); - cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); - cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); - cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); + this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); + this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); + this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); } @Override @@ -62,7 +62,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM { super.getDrops( drops, wrenched ); - for (ItemStack is : viewCell) + for (ItemStack is : this.viewCell) if ( is != null ) drops.add( is ); } @@ -71,28 +71,28 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); - cm.readFromNBT( data ); - viewCell.readFromNBT( data, "viewCell" ); + this.cm.readFromNBT( data ); + this.viewCell.readFromNBT( data, "viewCell" ); } @Override public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); - cm.writeToNBT( data ); - viewCell.writeToNBT( data, "viewCell" ); + this.cm.writeToNBT( data ); + this.viewCell.writeToNBT( data, "viewCell" ); } public PartTerminal(ItemStack is) { super( PartTerminal.class, is, true ); - frontBright = CableBusTextures.PartTerminal_Bright; - frontColored = CableBusTextures.PartTerminal_Colored; - frontDark = CableBusTextures.PartTerminal_Dark; + this.frontBright = CableBusTextures.PartTerminal_Bright; + this.frontColored = CableBusTextures.PartTerminal_Colored; + this.frontDark = CableBusTextures.PartTerminal_Dark; // frontSolid = CableBusTextures.PartTerminal_Solid; - cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); - cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); - cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); + this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); + this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); + this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); } public GuiBridge getGui( EntityPlayer player ) @@ -110,7 +110,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, getGui( player ) ); + Platform.openGUI( player, this.getHost().getTile(), this.side, this.getGui( player ) ); return true; } @@ -123,7 +123,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM { try { - return proxy.getStorage().getFluidInventory(); + return this.proxy.getStorage().getFluidInventory(); } catch (GridAccessException e) { @@ -137,7 +137,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM { try { - return proxy.getStorage().getItemInventory(); + return this.proxy.getStorage().getItemInventory(); } catch (GridAccessException e) { @@ -149,7 +149,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM @Override public IConfigManager getConfigManager() { - return cm; + return this.cm; } @Override @@ -161,12 +161,12 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM @Override public IInventory getViewCellStorage() { - return viewCell; + return this.viewCell; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - host.markForSave(); + this.host.markForSave(); } } diff --git a/src/main/java/appeng/recipes/AEItemResolver.java b/src/main/java/appeng/recipes/AEItemResolver.java index 9bde0c2ab..4045792d2 100644 --- a/src/main/java/appeng/recipes/AEItemResolver.java +++ b/src/main/java/appeng/recipes/AEItemResolver.java @@ -45,12 +45,12 @@ public class AEItemResolver implements ISubItemResolver { if ( itemName.startsWith( "PaintBall." ) ) { - return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), false ); + return this.paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), false ); } if ( itemName.startsWith( "LumenPaintBall." ) ) { - return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true ); + return this.paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true ); } if ( itemName.equals( "CableGlass" ) ) @@ -60,7 +60,7 @@ public class AEItemResolver implements ISubItemResolver if ( itemName.startsWith( "CableGlass." ) ) { - return cableItem( AEApi.instance().parts().partCableGlass, itemName.substring( itemName.indexOf( "." ) + 1 ) ); + return this.cableItem( AEApi.instance().parts().partCableGlass, itemName.substring( itemName.indexOf( "." ) + 1 ) ); } if ( itemName.equals( "CableCovered" ) ) @@ -70,7 +70,7 @@ public class AEItemResolver implements ISubItemResolver if ( itemName.startsWith( "CableCovered." ) ) { - return cableItem( AEApi.instance().parts().partCableCovered, itemName.substring( itemName.indexOf( "." ) + 1 ) ); + return this.cableItem( AEApi.instance().parts().partCableCovered, itemName.substring( itemName.indexOf( "." ) + 1 ) ); } if ( itemName.equals( "CableSmart" ) ) @@ -80,7 +80,7 @@ public class AEItemResolver implements ISubItemResolver if ( itemName.startsWith( "CableSmart." ) ) { - return cableItem( AEApi.instance().parts().partCableSmart, itemName.substring( itemName.indexOf( "." ) + 1 ) ); + return this.cableItem( AEApi.instance().parts().partCableSmart, itemName.substring( itemName.indexOf( "." ) + 1 ) ); } if ( itemName.equals( "CableDense" ) ) @@ -90,7 +90,7 @@ public class AEItemResolver implements ISubItemResolver if ( itemName.startsWith( "CableDense." ) ) { - return cableItem( AEApi.instance().parts().partCableDense, itemName.substring( itemName.indexOf( "." ) + 1 ) ); + return this.cableItem( AEApi.instance().parts().partCableDense, itemName.substring( itemName.indexOf( "." ) + 1 ) ); } if ( itemName.startsWith( "ItemCrystalSeed." ) ) diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index b62ce36b6..b0a87b4b0 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -40,7 +40,7 @@ public class GroupIngredient implements IIngredient boolean isInside = false; public GroupIngredient(String myName, List ingredients) throws RecipeError { - name = myName; + this.name = myName; for (IIngredient I : ingredients) if ( I.isAir() ) @@ -51,7 +51,7 @@ public class GroupIngredient implements IIngredient public IIngredient copy(int qty) throws RecipeError { - GroupIngredient gi = new GroupIngredient( name, ingredients ); + GroupIngredient gi = new GroupIngredient( this.name, this.ingredients ); gi.qty = qty; return gi; } @@ -65,7 +65,7 @@ public class GroupIngredient implements IIngredient @Override public String getItemName() { - return name; + return this.name; } @Override @@ -77,17 +77,17 @@ public class GroupIngredient implements IIngredient @Override public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError { - if ( baked != null ) - return baked; + if ( this.baked != null ) + return this.baked; - if ( isInside ) + if ( this.isInside ) return new ItemStack[0]; List out = new LinkedList(); - isInside = true; + this.isInside = true; try { - for (IIngredient i : ingredients) + for (IIngredient i : this.ingredients) { try { @@ -101,14 +101,14 @@ public class GroupIngredient implements IIngredient } finally { - isInside = false; + this.isInside = false; } if ( out.size() == 0 ) - throw new MissingIngredientError( toString() + " - group could not be resolved to any items." ); + throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); for (ItemStack is : out) - is.stackSize = qty; + is.stackSize = this.qty; return out.toArray( new ItemStack[out.size()] ); } @@ -134,8 +134,8 @@ public class GroupIngredient implements IIngredient @Override public void bake() throws RegistrationError, MissingIngredientError { - baked = null; - baked = getItemStackSet(); + this.baked = null; + this.baked = this.getItemStackSet(); } } diff --git a/src/main/java/appeng/recipes/Ingredient.java b/src/main/java/appeng/recipes/Ingredient.java index 9e1eb20a5..f1453831e 100644 --- a/src/main/java/appeng/recipes/Ingredient.java +++ b/src/main/java/appeng/recipes/Ingredient.java @@ -58,25 +58,25 @@ public class Ingredient implements IIngredient if ( input.equals( "_" ) ) { - isAir = true; - nameSpace = ""; - itemName = ""; - meta = OreDictionary.WILDCARD_VALUE; + this.isAir = true; + this.nameSpace = ""; + this.itemName = ""; + this.meta = OreDictionary.WILDCARD_VALUE; return; } - isAir = false; + this.isAir = false; String[] parts = input.split( ":" ); if ( parts.length >= 2 ) { - nameSpace = handler.alias( parts[0] ); + this.nameSpace = handler.alias( parts[0] ); String tmpName = handler.alias( parts[1] ); if ( parts.length != 3 ) { int sel = 0; - if ( nameSpace.equals( "oreDictionary" ) ) + if ( this.nameSpace.equals( "oreDictionary" ) ) { if ( parts.length == 3 ) throw new RecipeError( "Cannot specify meta when using ore dictionary." ); @@ -86,13 +86,13 @@ public class Ingredient implements IIngredient { try { - Object ro = AEApi.instance().registries().recipes().resolveItem( nameSpace, tmpName ); + Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName ); if ( ro instanceof ResolverResult ) { ResolverResult rr = (ResolverResult) ro; tmpName = rr.itemName; sel = rr.damageValue; - nbt = rr.compound; + this.nbt = rr.compound; } else if ( ro instanceof ResolverResultSet ) { @@ -105,19 +105,19 @@ public class Ingredient implements IIngredient } } - meta = sel; + this.meta = sel; } else { if ( parts[2].equals( "*" ) ) { - meta = OreDictionary.WILDCARD_VALUE; + this.meta = OreDictionary.WILDCARD_VALUE; } else { try { - meta = Integer.parseInt( parts[2] ); + this.meta = Integer.parseInt( parts[2] ); } catch (NumberFormatException e) { @@ -125,40 +125,40 @@ public class Ingredient implements IIngredient } } } - itemName = tmpName; + this.itemName = tmpName; } else throw new RecipeError( input + " : Needs at least Namespace and Name." ); - handler.data.knownItem.add( toString() ); + handler.data.knownItem.add( this.toString() ); } @Override public ItemStack getItemStack() throws RegistrationError, MissingIngredientError { - if ( isAir ) + if ( this.isAir ) throw new RegistrationError( "Found blank item and expected a real item." ); - if ( nameSpace.equalsIgnoreCase( "oreDictionary" ) ) + if ( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) ) throw new RegistrationError( "Recipe format expected a single item, but got a set of items." ); - Block blk = GameRegistry.findBlock( nameSpace, itemName ); + Block blk = GameRegistry.findBlock( this.nameSpace, this.itemName ); if ( blk == null ) - blk = GameRegistry.findBlock( nameSpace, "tile." + itemName ); + blk = GameRegistry.findBlock( this.nameSpace, "tile." + this.itemName ); if ( blk != null ) { Item it = Item.getItemFromBlock( blk ); if ( it != null ) - return MakeItemStack( it, qty, meta, nbt ); + return this.MakeItemStack( it, this.qty, this.meta, this.nbt ); } - Item it = GameRegistry.findItem( nameSpace, itemName ); + Item it = GameRegistry.findItem( this.nameSpace, this.itemName ); if ( it == null ) - it = GameRegistry.findItem( nameSpace, "item." + itemName ); + it = GameRegistry.findItem( this.nameSpace, "item." + this.itemName ); if ( it != null ) - return MakeItemStack( it, qty, meta, nbt ); + return this.MakeItemStack( it, this.qty, this.meta, this.nbt ); /* * Object o = Item.itemRegistry.getObject( nameSpace + ":" + itemName ); if ( o instanceof Item ) return new @@ -173,7 +173,7 @@ public class Ingredient implements IIngredient * instanceof BlockAir)) ) return new ItemStack( (Block) o, qty, meta ); */ - throw new MissingIngredientError( "Unable to find item: " + toString() ); + throw new MissingIngredientError( "Unable to find item: " + this.toString() ); } private ItemStack MakeItemStack(Item it, int quantity, int damageValue, NBTTagCompound compound) @@ -186,72 +186,72 @@ public class Ingredient implements IIngredient @Override public String toString() { - return nameSpace + ':' + itemName + ':' + meta; + return this.nameSpace + ':' + this.itemName + ':' + this.meta; } @Override public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError { - if ( baked != null ) - return baked; + if ( this.baked != null ) + return this.baked; - if ( nameSpace.equalsIgnoreCase( "oreDictionary" ) ) + if ( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) ) { - List ores = OreDictionary.getOres( itemName ); + List ores = OreDictionary.getOres( this.itemName ); ItemStack[] set = ores.toArray( new ItemStack[ores.size()] ); // clone and set qty. for (int x = 0; x < set.length; x++) { ItemStack is = set[x].copy(); - is.stackSize = qty; + is.stackSize = this.qty; set[x] = is; } if ( set.length == 0 ) - throw new MissingIngredientError( getItemName() + " - ore dictionary could not be resolved to any items." ); + throw new MissingIngredientError( this.getItemName() + " - ore dictionary could not be resolved to any items." ); return set; } - return new ItemStack[] { getItemStack() }; + return new ItemStack[] { this.getItemStack() }; } @Override public String getNameSpace() { - return nameSpace; + return this.nameSpace; } @Override public String getItemName() { - return itemName; + return this.itemName; } @Override public int getDamageValue() { - return meta; + return this.meta; } @Override public int getQty() { - return qty; + return this.qty; } @Override public boolean isAir() { - return isAir; + return this.isAir; } @Override public void bake() throws RegistrationError, MissingIngredientError { - baked = null; - baked = getItemStackSet(); + this.baked = null; + this.baked = this.getItemStackSet(); } } diff --git a/src/main/java/appeng/recipes/IngredientSet.java b/src/main/java/appeng/recipes/IngredientSet.java index 5dfc25367..cace3dac3 100644 --- a/src/main/java/appeng/recipes/IngredientSet.java +++ b/src/main/java/appeng/recipes/IngredientSet.java @@ -37,8 +37,8 @@ public class IngredientSet implements IIngredient ItemStack[] baked; public IngredientSet(ResolverResultSet rr) { - name = rr.name; - items = rr.results; + this.name = rr.name; + this.items = rr.results; } final boolean isInside = false; @@ -52,7 +52,7 @@ public class IngredientSet implements IIngredient @Override public String getItemName() { - return name; + return this.name; } @Override @@ -64,20 +64,20 @@ public class IngredientSet implements IIngredient @Override public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError { - if ( baked != null ) - return baked; + if ( this.baked != null ) + return this.baked; - if ( isInside ) + if ( this.isInside ) return new ItemStack[0]; List out = new LinkedList(); - out.addAll( items ); + out.addAll( this.items ); if ( out.size() == 0 ) - throw new MissingIngredientError( toString() + " - group could not be resolved to any items." ); + throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); for (ItemStack is : out) - is.stackSize = qty; + is.stackSize = this.qty; return out.toArray( new ItemStack[out.size()] ); } @@ -103,8 +103,8 @@ public class IngredientSet implements IIngredient @Override public void bake() throws RegistrationError, MissingIngredientError { - baked = null; - baked = getItemStackSet(); + this.baked = null; + this.baked = this.getItemStackSet(); } } diff --git a/src/main/java/appeng/recipes/MissedIngredientSet.java b/src/main/java/appeng/recipes/MissedIngredientSet.java index ea3e13752..d40b20eeb 100644 --- a/src/main/java/appeng/recipes/MissedIngredientSet.java +++ b/src/main/java/appeng/recipes/MissedIngredientSet.java @@ -27,7 +27,7 @@ public class MissedIngredientSet extends Throwable final ResolverResultSet rrs; public MissedIngredientSet(ResolverResultSet ro) { - rrs = ro; + this.rrs = ro; } } diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index 278e87cfc..40873ea08 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -64,23 +64,23 @@ public class RecipeHandler implements IRecipeHandler final RecipeData data; public RecipeHandler() { - data = new RecipeData(); + this.data = new RecipeData(); } RecipeHandler(RecipeHandler parent) { - data = parent.data; + this.data = parent.data; } private void addCrafting(ICraftHandler ch) { - data.Handlers.add( ch ); + this.data.Handlers.add( ch ); } public List findRecipe(ItemStack output) { List out = new LinkedList(); - for (ICraftHandler ch : data.Handlers) + for (ICraftHandler ch : this.data.Handlers) { try { @@ -107,7 +107,7 @@ public class RecipeHandler implements IRecipeHandler HashMap processed = new HashMap(); try { - for (ICraftHandler ch : data.Handlers) + for (ICraftHandler ch : this.data.Handlers) { try { @@ -123,19 +123,19 @@ public class RecipeHandler implements IRecipeHandler catch (RegistrationError e) { AELog.warning( "Unable to register a recipe: " + e.getMessage() ); - if ( data.exceptions ) + if ( this.data.exceptions ) AELog.error( e ); - if ( data.crash ) + if ( this.data.crash ) throw e; } catch (MissingIngredientError e) { - if ( data.errorOnMissing ) + if ( this.data.errorOnMissing ) { AELog.warning( "Unable to register a recipe:" + e.getMessage() ); - if ( data.exceptions ) + if ( this.data.exceptions ) AELog.error( e ); - if ( data.crash ) + if ( this.data.crash ) throw e; } } @@ -143,9 +143,9 @@ public class RecipeHandler implements IRecipeHandler } catch (Throwable e) { - if ( data.exceptions ) + if ( this.data.exceptions ) AELog.error( e ); - if ( data.crash ) + if ( this.data.crash ) throw new RuntimeException( e ); } @@ -162,7 +162,7 @@ public class RecipeHandler implements IRecipeHandler HashMultimap combined = HashMultimap.create(); - for (String s : data.knownItem) + for (String s : this.data.knownItem) { try { @@ -171,8 +171,8 @@ public class RecipeHandler implements IRecipeHandler for (ItemStack is : i.getItemStackSet()) { - String realName = getName( is ); - List recipes = findRecipe( is ); + String realName = this.getName( is ); + List recipes = this.findRecipe( is ); if ( !recipes.isEmpty() ) combined.putAll( realName, recipes ); } @@ -234,7 +234,7 @@ public class RecipeHandler implements IRecipeHandler { try { - return getName( is ); + return this.getName( is ); } catch (RecipeError ignored) { @@ -339,7 +339,7 @@ public class RecipeHandler implements IRecipeHandler public String alias(String in) { - String out = data.aliases.get( in ); + String out = this.data.aliases.get( in ); if ( out != null ) return out; @@ -360,7 +360,7 @@ public class RecipeHandler implements IRecipeHandler catch (Exception err) { AELog.warning( "Error Loading Recipe File:" + path ); - if ( data.exceptions ) + if ( this.data.exceptions ) AELog.error( err ); return; } @@ -406,18 +406,18 @@ public class RecipeHandler implements IRecipeHandler if ( token.length() > 0 ) { - tokens.add( token ); - tokens.add( "," ); + this.tokens.add( token ); + this.tokens.add( "," ); } token = ""; break; case '=': - processTokens( loader, path, line ); + this.processTokens( loader, path, line ); if ( token.length() > 0 ) - tokens.add( token ); + this.tokens.add( token ); token = ""; break; @@ -432,7 +432,7 @@ public class RecipeHandler implements IRecipeHandler case ' ': if ( token.length() > 0 ) - tokens.add( token ); + this.tokens.add( token ); token = ""; break; @@ -444,15 +444,15 @@ public class RecipeHandler implements IRecipeHandler } if ( token.length() > 0 ) - tokens.add( token ); + this.tokens.add( token ); reader.close(); - processTokens( loader, path, line ); + this.processTokens( loader, path, line ); } catch (Throwable e) { AELog.error( e ); - if ( data.crash ) + if ( this.data.crash ) throw new RuntimeException( e ); } } @@ -463,64 +463,64 @@ public class RecipeHandler implements IRecipeHandler { IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes(); - if ( tokens.isEmpty() ) + if ( this.tokens.isEmpty() ) return; - int split = tokens.indexOf( "->" ); + int split = this.tokens.indexOf( "->" ); if ( split != -1 ) { - String operation = tokens.remove( 0 ).toLowerCase(); + String operation = this.tokens.remove( 0 ).toLowerCase(); if ( operation.equals( "alias" ) ) { - if ( tokens.size() == 3 && tokens.indexOf( "->" ) == 1 ) - data.aliases.put( tokens.get( 0 ), tokens.get( 2 ) ); + if ( this.tokens.size() == 3 && this.tokens.indexOf( "->" ) == 1 ) + this.data.aliases.put( this.tokens.get( 0 ), this.tokens.get( 2 ) ); else throw new RecipeError( "Alias must have exactly 1 input and 1 output." ); } else if ( operation.equals( "group" ) ) { - List pre = tokens.subList( 0, split - 1 ); - List post = tokens.subList( split, tokens.size() ); + List pre = this.tokens.subList( 0, split - 1 ); + List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = parseLines( pre ); + List> inputs = this.parseLines( pre ); if ( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { - data.groups.put( post.get( 0 ), new GroupIngredient( post.get( 0 ), inputs.get( 0 ) ) ); + this.data.groups.put( post.get( 0 ), new GroupIngredient( post.get( 0 ), inputs.get( 0 ) ) ); } else throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs." ); } else if ( operation.equals( "ore" ) ) { - List pre = tokens.subList( 0, split - 1 ); - List post = tokens.subList( split, tokens.size() ); + List pre = this.tokens.subList( 0, split - 1 ); + List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = parseLines( pre ); + List> inputs = this.parseLines( pre ); if ( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) ); - addCrafting( ch ); + this.addCrafting( ch ); } else throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs in a single row." ); } else { - List pre = tokens.subList( 0, split - 1 ); - List post = tokens.subList( split, tokens.size() ); + List pre = this.tokens.subList( 0, split - 1 ); + List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = parseLines( pre ); - List> outputs = parseLines( post ); + List> inputs = this.parseLines( pre ); + List> outputs = this.parseLines( post ); ICraftHandler ch = cr.getCraftHandlerFor( operation ); if ( ch != null ) { ch.setup( inputs, outputs ); - addCrafting( ch ); + this.addCrafting( ch ); } else throw new RecipeError( "Invalid crafting type: " + operation ); @@ -528,57 +528,57 @@ public class RecipeHandler implements IRecipeHandler } else { - String operation = tokens.remove( 0 ).toLowerCase(); + String operation = this.tokens.remove( 0 ).toLowerCase(); - if ( operation.equals( "exceptions" ) && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) ) + if ( operation.equals( "exceptions" ) && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) ) { - if ( tokens.size() == 1 ) + if ( this.tokens.size() == 1 ) { - data.exceptions = tokens.get( 0 ).equals( "true" ); + this.data.exceptions = this.tokens.get( 0 ).equals( "true" ); } else throw new RecipeError( "exceptions must be true or false explicitly." ); } - else if ( operation.equals( "crash" ) && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) ) + else if ( operation.equals( "crash" ) && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) ) { - if ( tokens.size() == 1 ) + if ( this.tokens.size() == 1 ) { - data.crash = tokens.get( 0 ).equals( "true" ); + this.data.crash = this.tokens.get( 0 ).equals( "true" ); } else throw new RecipeError( "crash must be true or false explicitly." ); } else if ( operation.equals( "erroronmissing" ) ) { - if ( tokens.size() == 1 && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) ) + if ( this.tokens.size() == 1 && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) ) { - data.errorOnMissing = tokens.get( 0 ).equals( "true" ); + this.data.errorOnMissing = this.tokens.get( 0 ).equals( "true" ); } else throw new RecipeError( "erroronmissing must be true or false explicitly." ); } else if ( operation.equals( "import" ) ) { - if ( tokens.size() == 1 ) - (new RecipeHandler( this )).parseRecipes( loader, tokens.get( 0 ) ); + if ( this.tokens.size() == 1 ) + (new RecipeHandler( this )).parseRecipes( loader, this.tokens.get( 0 ) ); else throw new RecipeError( "Import must have exactly 1 input." ); } else - throw new RecipeError( operation + ": " + tokens.toString() + "; recipe without an output." ); + throw new RecipeError( operation + ": " + this.tokens.toString() + "; recipe without an output." ); } } catch (RecipeError e) { - AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + tokens.toString() ); - if ( data.exceptions ) + AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString() ); + if ( this.data.exceptions ) AELog.error( e ); - if ( data.crash ) + if ( this.data.crash ) throw e; } - tokens.clear(); + this.tokens.clear(); } private List> parseLines(List subList) throws RecipeError @@ -601,7 +601,7 @@ public class RecipeHandler implements IRecipeHandler } else { - if ( isNumber( v ) ) + if ( this.isNumber( v ) ) { if ( hasQty ) throw new RecipeError( "Qty found with no item." ); @@ -612,11 +612,11 @@ public class RecipeHandler implements IRecipeHandler { if ( hasQty ) { - cList.add( findIngredient( v, qty ) ); + cList.add( this.findIngredient( v, qty ) ); hasQty = false; } else - cList.add( findIngredient( v, 1 ) ); + cList.add( this.findIngredient( v, 1 ) ); } } } @@ -629,7 +629,7 @@ public class RecipeHandler implements IRecipeHandler private IIngredient findIngredient(String v, int qty) throws RecipeError { - GroupIngredient gi = data.groups.get( v ); + GroupIngredient gi = this.data.groups.get( v ); if ( gi != null ) return gi.copy( qty ); diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index 6211d334e..38430612e 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -50,17 +50,17 @@ public class DisassembleRecipe implements IRecipe if ( hasCell != null ) return null; - if ( items.itemCell1k.sameAsStack( is ) ) - hasCell = mats.materialCell1kPart.stack( 1 ); + if ( this.items.itemCell1k.sameAsStack( is ) ) + hasCell = this.mats.materialCell1kPart.stack( 1 ); - if ( items.itemCell4k.sameAsStack( is ) ) - hasCell = mats.materialCell4kPart.stack( 1 ); + if ( this.items.itemCell4k.sameAsStack( is ) ) + hasCell = this.mats.materialCell4kPart.stack( 1 ); - if ( items.itemCell16k.sameAsStack( is ) ) - hasCell = mats.materialCell16kPart.stack( 1 ); + if ( this.items.itemCell16k.sameAsStack( is ) ) + hasCell = this.mats.materialCell16kPart.stack( 1 ); - if ( items.itemCell64k.sameAsStack( is ) ) - hasCell = mats.materialCell64kPart.stack( 1 ); + if ( this.items.itemCell64k.sameAsStack( is ) ) + hasCell = this.mats.materialCell64kPart.stack( 1 ); // make sure the storage cell is empty... if ( hasCell != null ) @@ -74,20 +74,20 @@ public class DisassembleRecipe implements IRecipe } } - if ( items.itemEncodedPattern.sameAsStack( is ) ) - hasCell = mats.materialBlankPattern.stack( 1 ); + if ( this.items.itemEncodedPattern.sameAsStack( is ) ) + hasCell = this.mats.materialBlankPattern.stack( 1 ); - if ( blocks.blockCraftingStorage1k.sameAsStack( is ) ) - hasCell = mats.materialCell1kPart.stack( 1 ); + if ( this.blocks.blockCraftingStorage1k.sameAsStack( is ) ) + hasCell = this.mats.materialCell1kPart.stack( 1 ); - if ( blocks.blockCraftingStorage4k.sameAsStack( is ) ) - hasCell = mats.materialCell4kPart.stack( 1 ); + if ( this.blocks.blockCraftingStorage4k.sameAsStack( is ) ) + hasCell = this.mats.materialCell4kPart.stack( 1 ); - if ( blocks.blockCraftingStorage16k.sameAsStack( is ) ) - hasCell = mats.materialCell16kPart.stack( 1 ); + if ( this.blocks.blockCraftingStorage16k.sameAsStack( is ) ) + hasCell = this.mats.materialCell16kPart.stack( 1 ); - if ( blocks.blockCraftingStorage64k.sameAsStack( is ) ) - hasCell = mats.materialCell64kPart.stack( 1 ); + if ( this.blocks.blockCraftingStorage64k.sameAsStack( is ) ) + hasCell = this.mats.materialCell64kPart.stack( 1 ); if ( hasCell == null ) return null; @@ -100,13 +100,13 @@ public class DisassembleRecipe implements IRecipe @Override public boolean matches(InventoryCrafting inv, World w) { - return getOutput( inv, false ) != null; + return this.getOutput( inv, false ) != null; } @Override public ItemStack getCraftingResult(InventoryCrafting inv) { - return getOutput( inv, true ); + return this.getOutput( inv, true ); } @Override diff --git a/src/main/java/appeng/recipes/game/FacadeRecipe.java b/src/main/java/appeng/recipes/game/FacadeRecipe.java index 8c02b185a..2fed687a0 100644 --- a/src/main/java/appeng/recipes/game/FacadeRecipe.java +++ b/src/main/java/appeng/recipes/game/FacadeRecipe.java @@ -36,10 +36,10 @@ public class FacadeRecipe implements IRecipe { if ( inv.getStackInSlot( 0 ) == null && inv.getStackInSlot( 2 ) == null && inv.getStackInSlot( 6 ) == null && inv.getStackInSlot( 8 ) == null ) { - if ( anchor.sameAsStack( inv.getStackInSlot( 1 ) ) && anchor.sameAsStack( inv.getStackInSlot( 3 ) ) && anchor.sameAsStack( inv.getStackInSlot( 5 ) ) - && anchor.sameAsStack( inv.getStackInSlot( 7 ) ) ) + if ( this.anchor.sameAsStack( inv.getStackInSlot( 1 ) ) && this.anchor.sameAsStack( inv.getStackInSlot( 3 ) ) && this.anchor.sameAsStack( inv.getStackInSlot( 5 ) ) + && this.anchor.sameAsStack( inv.getStackInSlot( 7 ) ) ) { - ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); + ItemStack facades = this.facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); if ( facades != null && createFacade ) facades.stackSize = 4; return facades; @@ -51,13 +51,13 @@ public class FacadeRecipe implements IRecipe @Override public boolean matches(InventoryCrafting inv, World w) { - return getOutput( inv, false ) != null; + return this.getOutput( inv, false ) != null; } @Override public ItemStack getCraftingResult(InventoryCrafting inv) { - return getOutput( inv, true ); + return this.getOutput( inv, true ); } @Override diff --git a/src/main/java/appeng/recipes/game/ShapedRecipe.java b/src/main/java/appeng/recipes/game/ShapedRecipe.java index 0c7a23862..4ac4c0e61 100644 --- a/src/main/java/appeng/recipes/game/ShapedRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapedRecipe.java @@ -46,19 +46,19 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable public boolean isEnabled() { - return !disable; + return !this.disable; } public ShapedRecipe(ItemStack result, Object... recipe) { - output = result.copy(); + this.output = result.copy(); StringBuilder shape = new StringBuilder(); int idx = 0; if ( recipe[idx] instanceof Boolean ) { - mirrored = (Boolean) recipe[idx]; + this.mirrored = (Boolean) recipe[idx]; if ( recipe[idx + 1] instanceof Object[] ) { recipe = (Object[]) recipe[idx + 1]; @@ -75,11 +75,11 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable for (String s : parts) { - width = s.length(); + this.width = s.length(); shape.append( s ); } - height = parts.length; + this.height = parts.length; } else { @@ -87,19 +87,19 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { String s = (String) recipe[idx++]; shape.append( s ); - width = s.length(); - height++; + this.width = s.length(); + this.height++; } } - if ( width * height != shape.length() ) + if ( this.width * this.height != shape.length() ) { StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); for (Object tmp : recipe) { ret.append( tmp ).append( ", " ); } - ret.append( output ); + ret.append( this.output ); throw new RuntimeException( ret.toString() ); } @@ -121,53 +121,53 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { ret.append( tmp ).append( ", " ); } - ret.append( output ); + ret.append( this.output ); throw new RuntimeException( ret.toString() ); } } - input = new Object[width * height]; + this.input = new Object[this.width * this.height]; int x = 0; for (char chr : shape.toString().toCharArray()) { - input[x++] = itemMap.get( chr ); + this.input[x++] = itemMap.get( chr ); } } @Override public ItemStack getCraftingResult(InventoryCrafting var1) { - return output.copy(); + return this.output.copy(); } @Override public int getRecipeSize() { - return input.length; + return this.input.length; } @Override public ItemStack getRecipeOutput() { - return output; + return this.output; } @Override public boolean matches(InventoryCrafting inv, World world) { - if ( disable ) + if ( this.disable ) return false; - for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) + for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - this.width; x++) { - for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) + for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - this.height; ++y) { - if ( checkMatch( inv, x, y, false ) ) + if ( this.checkMatch( inv, x, y, false ) ) { return true; } - if ( mirrored && checkMatch( inv, x, y, true ) ) + if ( this.mirrored && this.checkMatch( inv, x, y, true ) ) { return true; } @@ -180,7 +180,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable @SuppressWarnings("unchecked") private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror) { - if ( disable ) + if ( this.disable ) return false; for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) @@ -191,15 +191,15 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable int subY = y - startY; Object target = null; - if ( subX >= 0 && subY >= 0 && subX < width && subY < height ) + if ( subX >= 0 && subY >= 0 && subX < this.width && subY < this.height ) { if ( mirror ) { - target = input[width - subX - 1 + subY * width]; + target = this.input[this.width - subX - 1 + subY * this.width]; } else { - target = input[subX + subY * width]; + target = this.input[subX + subY * this.width]; } } @@ -213,7 +213,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { for (ItemStack item : ((IIngredient) target).getItemStackSet()) { - matched = matched || checkItemEquals( item, slot ); + matched = matched || this.checkItemEquals( item, slot ); } } catch (RegistrationError e) @@ -236,7 +236,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable for (ItemStack item : (ArrayList) target) { - matched = matched || checkItemEquals( item, slot ); + matched = matched || this.checkItemEquals( item, slot ); } if ( !matched ) @@ -266,7 +266,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable public ShapedRecipe setMirrored(boolean mirror) { - mirrored = mirror; + this.mirrored = mirror; return this; } @@ -283,17 +283,17 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable public int getWidth() { - return width; + return this.width; } public int getHeight() { - return height; + return this.height; } public Object[] getIngredients() { - return input; + return this.input; } @Override @@ -301,8 +301,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { try { - disable = false; - for (Object o : getInput()) + this.disable = false; + for (Object o : this.getInput()) { if ( o instanceof IIngredient ) ((IIngredient) o).bake(); @@ -310,7 +310,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } catch (MissingIngredientError err) { - disable = true; + this.disable = true; } } diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index ac48d2b79..10c822003 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -38,17 +38,17 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable public boolean isEnabled() { - return !disable; + return !this.disable; } public ShapelessRecipe(ItemStack result, Object... recipe) { - output = result.copy(); + this.output = result.copy(); for (Object in : recipe) { if ( in instanceof IIngredient ) { - input.add( in ); + this.input.add( in ); } else { @@ -57,7 +57,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { ret.append( tmp ).append( ", " ); } - ret.append( output ); + ret.append( this.output ); throw new RuntimeException( ret.toString() ); } } @@ -66,29 +66,29 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable @Override public int getRecipeSize() { - return input.size(); + return this.input.size(); } @Override public ItemStack getRecipeOutput() { - return output; + return this.output; } @Override public ItemStack getCraftingResult(InventoryCrafting var1) { - return output.copy(); + return this.output.copy(); } @SuppressWarnings("unchecked") @Override public boolean matches(InventoryCrafting var1, World world) { - if ( disable ) + if ( this.disable ) return false; - ArrayList required = new ArrayList( input ); + ArrayList required = new ArrayList( this.input ); for (int x = 0; x < var1.getSizeInventory(); x++) { @@ -108,7 +108,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { for (ItemStack item : ((IIngredient) next).getItemStackSet()) { - match = match || checkItemEquals( item, slot ); + match = match || this.checkItemEquals( item, slot ); } } catch (RegistrationError e) @@ -161,8 +161,8 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { try { - disable = false; - for (Object o : getInput()) + this.disable = false; + for (Object o : this.getInput()) { if ( o instanceof IIngredient ) ((IIngredient) o).bake(); @@ -170,7 +170,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } catch (MissingIngredientError e) { - disable = true; + this.disable = true; } } } \ No newline at end of file diff --git a/src/main/java/appeng/recipes/handlers/Crusher.java b/src/main/java/appeng/recipes/handlers/Crusher.java index 6d82fa033..7e2d3fb99 100644 --- a/src/main/java/appeng/recipes/handlers/Crusher.java +++ b/src/main/java/appeng/recipes/handlers/Crusher.java @@ -47,8 +47,8 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -61,11 +61,11 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer if ( AppEng.instance.isIntegrationEnabled( IntegrationType.RC ) ) { IRC rc = (IRC) AppEng.instance.getIntegration( IntegrationType.RC ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { try { - rc.rockCrusher( is, pro_output[0].getItemStack() ); + rc.rockCrusher( is, this.pro_output[0].getItemStack() ); } catch (java.lang.RuntimeException err) { @@ -78,7 +78,7 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/Grind.java b/src/main/java/appeng/recipes/handlers/Grind.java index f2560d7a9..58831e1af 100644 --- a/src/main/java/appeng/recipes/handlers/Grind.java +++ b/src/main/java/appeng/recipes/handlers/Grind.java @@ -46,8 +46,8 @@ public class Grind implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -57,20 +57,20 @@ public class Grind implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for (ItemStack is : pro_input.getItemStackSet()) - AEApi.instance().registries().grinder().addRecipe( is, pro_output[0].getItemStack(), 8 ); + for (ItemStack is : this.pro_input.getItemStackSet()) + AEApi.instance().registries().grinder().addRecipe( is, this.pro_output[0].getItemStack(), 8 ); } @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(),output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(),output ); } @Override public String getPattern( RecipeHandler h ) { return "grind\n"+ - h.getName(pro_input)+ '\n' + - h.getName(pro_output[0]); + h.getName(this.pro_input)+ '\n' + + h.getName(this.pro_output[0]); } } diff --git a/src/main/java/appeng/recipes/handlers/GrindFZ.java b/src/main/java/appeng/recipes/handlers/GrindFZ.java index c83d5a208..a9d3dc3cc 100644 --- a/src/main/java/appeng/recipes/handlers/GrindFZ.java +++ b/src/main/java/appeng/recipes/handlers/GrindFZ.java @@ -47,8 +47,8 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -61,11 +61,11 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FZ ) ) { IFZ fz = (IFZ) AppEng.instance.getIntegration( IntegrationType.FZ ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { try { - fz.grinderRecipe( is, pro_output[0].getItemStack() ); + fz.grinderRecipe( is, this.pro_output[0].getItemStack() ); } catch (java.lang.RuntimeException err) { @@ -78,7 +78,7 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/HCCrusher.java b/src/main/java/appeng/recipes/handlers/HCCrusher.java index 97c2ddcac..abeae4dcc 100644 --- a/src/main/java/appeng/recipes/handlers/HCCrusher.java +++ b/src/main/java/appeng/recipes/handlers/HCCrusher.java @@ -46,8 +46,8 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -57,13 +57,13 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for (ItemStack beginStack : pro_input.getItemStackSet()) + for (ItemStack beginStack : this.pro_input.getItemStackSet()) { try { NBTTagCompound toRegister = new NBTTagCompound(); - ItemStack endStack = pro_output[0].getItemStack(); + ItemStack endStack = this.pro_output[0].getItemStack(); NBTTagCompound itemFrom = new NBTTagCompound(); NBTTagCompound itemTo = new NBTTagCompound(); @@ -87,7 +87,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/Inscribe.java b/src/main/java/appeng/recipes/handlers/Inscribe.java index e34c734a3..9671231ad 100644 --- a/src/main/java/appeng/recipes/handlers/Inscribe.java +++ b/src/main/java/appeng/recipes/handlers/Inscribe.java @@ -45,7 +45,7 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer this.usePlates = usePlates; this.plateA = plateA; this.plateB = plateB; - output = out; + this.output = out; } final public boolean usePlates; @@ -77,12 +77,12 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer { if ( input.size() == 1 && input.get( 0 ).size() > 1 ) { - imprintable = input.get( 0 ).get( 0 ); + this.imprintable = input.get( 0 ).get( 0 ); - plateA = input.get( 0 ).get( 1 ); + this.plateA = input.get( 0 ).get( 1 ); if ( input.get( 0 ).size() > 2 ) - plateB = input.get( 0 ).get( 2 ); + this.plateB = input.get( 0 ).get( 2 ); this.output = output.get( 0 ).get( 0 ); } @@ -96,40 +96,40 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - if ( imprintable != null ) - Collections.addAll( inputs, imprintable.getItemStackSet() ); + if ( this.imprintable != null ) + Collections.addAll( inputs, this.imprintable.getItemStackSet() ); - if ( plateA != null ) - Collections.addAll( plates, plateA.getItemStackSet() ); + if ( this.plateA != null ) + Collections.addAll( plates, this.plateA.getItemStackSet() ); - if ( plateB != null ) - Collections.addAll( plates, plateB.getItemStackSet() ); + if ( this.plateB != null ) + Collections.addAll( plates, this.plateB.getItemStackSet() ); - InscriberRecipe ir = new InscriberRecipe( imprintable.getItemStackSet(), plateA == null ? null : plateA.getItemStack(), plateB == null ? null - : plateB.getItemStack(), output.getItemStack(), usePlates ); + InscriberRecipe ir = new InscriberRecipe( this.imprintable.getItemStackSet(), this.plateA == null ? null : this.plateA.getItemStack(), this.plateB == null ? null + : this.plateB.getItemStack(), this.output.getItemStack(), this.usePlates ); recipes.add( ir ); } @Override public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( output.getItemStack(), reqOutput ); + return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput ); } @Override public String getPattern(RecipeHandler h) { - String o = "inscriber " + output.getQty() + '\n'; + String o = "inscriber " + this.output.getQty() + '\n'; - o += h.getName( output ) + '\n'; + o += h.getName( this.output ) + '\n'; - if ( plateA != null ) - o += h.getName( plateA )+ '\n'; + if ( this.plateA != null ) + o += h.getName( this.plateA )+ '\n'; - o += h.getName(imprintable); + o += h.getName(this.imprintable); - if ( plateB != null ) - o += '\n' +h.getName( plateB ); + if ( this.plateB != null ) + o += '\n' +h.getName( this.plateB ); return o; } diff --git a/src/main/java/appeng/recipes/handlers/Macerator.java b/src/main/java/appeng/recipes/handlers/Macerator.java index 244ea34e6..3f13da898 100644 --- a/src/main/java/appeng/recipes/handlers/Macerator.java +++ b/src/main/java/appeng/recipes/handlers/Macerator.java @@ -47,8 +47,8 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -61,11 +61,11 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) { IIC2 ic2 = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { try { - ic2.maceratorRecipe( is, pro_output[0].getItemStack() ); + ic2.maceratorRecipe( is, this.pro_output[0].getItemStack() ); } catch (java.lang.RuntimeException err) { @@ -78,7 +78,7 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/MekCrusher.java b/src/main/java/appeng/recipes/handlers/MekCrusher.java index af28753e4..c1dbfeb6b 100644 --- a/src/main/java/appeng/recipes/handlers/MekCrusher.java +++ b/src/main/java/appeng/recipes/handlers/MekCrusher.java @@ -47,8 +47,8 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -61,11 +61,11 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer if ( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) ) { IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { try { - rc.addCrusherRecipe( is, pro_output[0].getItemStack() ); + rc.addCrusherRecipe( is, this.pro_output[0].getItemStack() ); } catch (java.lang.RuntimeException err) { @@ -78,7 +78,7 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/MekEnrichment.java b/src/main/java/appeng/recipes/handlers/MekEnrichment.java index 3524afe8d..a22d75c3b 100644 --- a/src/main/java/appeng/recipes/handlers/MekEnrichment.java +++ b/src/main/java/appeng/recipes/handlers/MekEnrichment.java @@ -47,8 +47,8 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -61,11 +61,11 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer if ( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) ) { IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { try { - rc.addEnrichmentChamberRecipe( is, pro_output[0].getItemStack() ); + rc.addEnrichmentChamberRecipe( is, this.pro_output[0].getItemStack() ); } catch (java.lang.RuntimeException err) { @@ -78,7 +78,7 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/OreRegistration.java b/src/main/java/appeng/recipes/handlers/OreRegistration.java index 7caa995a5..118f819a8 100644 --- a/src/main/java/appeng/recipes/handlers/OreRegistration.java +++ b/src/main/java/appeng/recipes/handlers/OreRegistration.java @@ -35,18 +35,18 @@ public class OreRegistration implements ICraftHandler final String name; public OreRegistration(List in, String out) { - inputs = in; - name = out; + this.inputs = in; + this.name = out; } @Override public void register() throws RegistrationError, MissingIngredientError { - for (IIngredient i : inputs) + for (IIngredient i : this.inputs) { for (ItemStack is : i.getItemStackSet()) { - OreDictionary.registerOre( name, is ); + OreDictionary.registerOre( this.name, is ); } } } diff --git a/src/main/java/appeng/recipes/handlers/Press.java b/src/main/java/appeng/recipes/handlers/Press.java index 7c9c6c884..66dc08cb5 100644 --- a/src/main/java/appeng/recipes/handlers/Press.java +++ b/src/main/java/appeng/recipes/handlers/Press.java @@ -22,7 +22,7 @@ public class Press extends Inscribe { public Press() { - usePlates = true; + this.usePlates = true; } } diff --git a/src/main/java/appeng/recipes/handlers/Pulverizer.java b/src/main/java/appeng/recipes/handlers/Pulverizer.java index dac7ee927..769cca5ef 100644 --- a/src/main/java/appeng/recipes/handlers/Pulverizer.java +++ b/src/main/java/appeng/recipes/handlers/Pulverizer.java @@ -45,8 +45,8 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer int outs = output.get( 0 ).size(); if ( input.get( 0 ).size() == 1 && outs == 1 ) { - pro_input = input.get( 0 ).get( 0 ); - pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); + this.pro_input = input.get( 0 ).get( 0 ); + this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] ); return; } } @@ -60,9 +60,9 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer toSend.setInteger( "energy", 800 ); toSend.setTag( "primaryOutput", new NBTTagCompound() ); - pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) ); + this.pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) ); - for (ItemStack is : pro_input.getItemStackSet()) + for (ItemStack is : this.pro_input.getItemStackSet()) { toSend.setTag( "input", new NBTTagCompound() ); is.writeToNBT( toSend.getCompoundTag( "input" ) ); @@ -73,7 +73,7 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output ); + return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } @Override diff --git a/src/main/java/appeng/recipes/handlers/Shaped.java b/src/main/java/appeng/recipes/handlers/Shaped.java index e6061da43..e79a6ada3 100644 --- a/src/main/java/appeng/recipes/handlers/Shaped.java +++ b/src/main/java/appeng/recipes/handlers/Shaped.java @@ -50,21 +50,21 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer { if ( output.size() == 1 && output.get( 0 ).size() == 1 ) { - rows = input.size(); - if ( rows > 0 && input.size() <= 3 ) + this.rows = input.size(); + if ( this.rows > 0 && input.size() <= 3 ) { - cols = input.get( 0 ).size(); - if ( cols <= 3 && cols >= 1 ) + this.cols = input.get( 0 ).size(); + if ( this.cols <= 3 && this.cols >= 1 ) { for (List anInput : input) { - if ( anInput.size() != cols ) + if ( anInput.size() != this.cols ) { throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." ); } } - inputs = input; + this.inputs = input; this.output = output.get( 0 ).get( 0 ); } else @@ -83,18 +83,18 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer char first = 'A'; List args = new ArrayList(); - for (int y = 0; y < rows; y++) + for (int y = 0; y < this.rows; y++) { StringBuilder row = new StringBuilder(); - for (int x = 0; x < cols; x++) + for (int x = 0; x < this.cols; x++) { - if ( inputs.get( y ).get( x ).isAir() ) + if ( this.inputs.get( y ).get( x ).isAir() ) row.append( ' ' ); else { row.append( first ); args.add( first ); - args.add( inputs.get( y ).get( x ) ); + args.add( this.inputs.get( y ).get( x ) ); first++; } @@ -102,7 +102,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer args.add( y, row.toString() ); } - ItemStack outIS = output.getItemStack(); + ItemStack outIS = this.output.getItemStack(); try { @@ -118,10 +118,10 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError { - for (int y = 0; y < rows; y++) - for (int x = 0; x < cols; x++) + for (int y = 0; y < this.rows; y++) + for (int x = 0; x < this.cols; x++) { - IIngredient i = inputs.get( y ).get( x ); + IIngredient i = this.inputs.get( y ).get( x ); if ( !i.isAir() ) { @@ -133,25 +133,25 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer } } - return Platform.isSameItemPrecise( output.getItemStack(), reqOutput ); + return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput ); } @Override public String getPattern(RecipeHandler h) { - String o = "shaped " + output.getQty() + ' ' + cols + 'x' + rows + '\n'; + String o = "shaped " + this.output.getQty() + ' ' + this.cols + 'x' + this.rows + '\n'; - o += h.getName( output ) + '\n'; + o += h.getName( this.output ) + '\n'; - for (int y = 0; y < rows; y++) - for (int x = 0; x < cols; x++) + for (int y = 0; y < this.rows; y++) + for (int x = 0; x < this.cols; x++) { - IIngredient i = inputs.get( y ).get( x ); + IIngredient i = this.inputs.get( y ).get( x ); if ( i.isAir() ) - o += "air" + (x + 1 == cols ? "\n" : " "); + o += "air" + (x + 1 == this.cols ? "\n" : " "); else - o += h.getName( i ) + (x + 1 == cols ? "\n" : " "); + o += h.getName( i ) + (x + 1 == this.cols ? "\n" : " "); } return o.trim(); diff --git a/src/main/java/appeng/recipes/handlers/Shapeless.java b/src/main/java/appeng/recipes/handlers/Shapeless.java index db1cc8496..cfcde935b 100644 --- a/src/main/java/appeng/recipes/handlers/Shapeless.java +++ b/src/main/java/appeng/recipes/handlers/Shapeless.java @@ -49,7 +49,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer { if ( input.size() == 1 ) { - inputs = input.get( 0 ); + this.inputs = input.get( 0 ); this.output = output.get( 0 ).get( 0 ); } else @@ -63,10 +63,10 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer public void register() throws RegistrationError, MissingIngredientError { List args = new ArrayList(); - for (IIngredient i : inputs) + for (IIngredient i : this.inputs) args.add( i ); - ItemStack outIS = output.getItemStack(); + ItemStack outIS = this.output.getItemStack(); try { @@ -83,7 +83,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError { - for (IIngredient i : inputs) + for (IIngredient i : this.inputs) { if ( !i.isAir() ) { @@ -97,19 +97,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer } } - return Platform.isSameItemPrecise( output.getItemStack(), reqOutput ); + return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput ); } @Override public String getPattern(RecipeHandler h) { - StringBuilder o = new StringBuilder( "shapeless " + output.getQty() + '\n' ); + StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' ); - o.append( h.getName( output ) ).append( '\n' ); + o.append( h.getName( this.output ) ).append( '\n' ); - for (int y = 0; y < inputs.size(); y++) + for (int y = 0; y < this.inputs.size(); y++) { - IIngredient i = inputs.get( y ); + IIngredient i = this.inputs.get( y ); if ( i.isAir() ) { diff --git a/src/main/java/appeng/recipes/handlers/Smelt.java b/src/main/java/appeng/recipes/handlers/Smelt.java index 47b31d656..d3a45aaa1 100644 --- a/src/main/java/appeng/recipes/handlers/Smelt.java +++ b/src/main/java/appeng/recipes/handlers/Smelt.java @@ -48,8 +48,8 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer List outputList = output.get( 0 ); if ( inputList.size() == 1 && outputList.size() == 1 ) { - in = inputList.get( 0 ); - out = outputList.get( 0 ); + this.in = inputList.get( 0 ); + this.out = outputList.get( 0 ); return; } } @@ -59,24 +59,24 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - if ( in.getItemStack().getItem() == null ) - throw new RegistrationError( in.toString() + ": Smelting Input is not a valid item." ); + if ( this.in.getItemStack().getItem() == null ) + throw new RegistrationError( this.in.toString() + ": Smelting Input is not a valid item." ); - if ( out.getItemStack().getItem() == null ) - throw new RegistrationError( out.toString() + ": Smelting Output is not a valid item." ); + if ( this.out.getItemStack().getItem() == null ) + throw new RegistrationError( this.out.toString() + ": Smelting Output is not a valid item." ); - GameRegistry.addSmelting( in.getItemStack(), out.getItemStack(), 0 ); + GameRegistry.addSmelting( this.in.getItemStack(), this.out.getItemStack(), 0 ); } @Override public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError { - return Platform.isSameItemPrecise( out.getItemStack(),reqOutput ); + return Platform.isSameItemPrecise( this.out.getItemStack(),reqOutput ); } @Override public String getPattern( RecipeHandler h ) { - return "smelt "+out.getQty()+ '\n' + - h.getName(out)+ '\n' + - h.getName(in); + return "smelt "+this.out.getQty()+ '\n' + + h.getName(this.out)+ '\n' + + h.getName(this.in); } } diff --git a/src/main/java/appeng/recipes/loader/ConfigLoader.java b/src/main/java/appeng/recipes/loader/ConfigLoader.java index a64ff3990..19ee7a6dd 100644 --- a/src/main/java/appeng/recipes/loader/ConfigLoader.java +++ b/src/main/java/appeng/recipes/loader/ConfigLoader.java @@ -31,13 +31,13 @@ public class ConfigLoader implements IRecipeLoader private final String rootPath; public ConfigLoader(String s) { - rootPath = s; + this.rootPath = s; } @Override public BufferedReader getFile(String s) throws Exception { - File f = new File( rootPath + s ); + File f = new File( this.rootPath + s ); return new BufferedReader( new InputStreamReader( new FileInputStream( f ), "UTF-8" ) ); } } diff --git a/src/main/java/appeng/recipes/loader/JarLoader.java b/src/main/java/appeng/recipes/loader/JarLoader.java index f4d3dedb3..27f45a4ee 100644 --- a/src/main/java/appeng/recipes/loader/JarLoader.java +++ b/src/main/java/appeng/recipes/loader/JarLoader.java @@ -29,13 +29,13 @@ public class JarLoader implements IRecipeLoader private final String rootPath; public JarLoader(String s) { - rootPath = s; + this.rootPath = s; } @Override public BufferedReader getFile(String s) throws Exception { - return new BufferedReader( new InputStreamReader( getClass().getResourceAsStream( rootPath + s ), "UTF-8" ) ); + return new BufferedReader( new InputStreamReader( this.getClass().getResourceAsStream( this.rootPath + s ), "UTF-8" ) ); } } diff --git a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java index 9d24398fb..1cc135d9b 100644 --- a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java +++ b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java @@ -54,14 +54,14 @@ public class OreDictionaryHandler if ( event.Name == null || event.Ore == null ) return; - if ( shouldCare( event.Name ) ) + if ( this.shouldCare( event.Name ) ) { - for (IOreListener v : ol) + for (IOreListener v : this.ol) v.oreRegistered( event.Name, event.Ore ); } - if ( enableRebaking ) - bakeRecipes(); + if ( this.enableRebaking ) + this.bakeRecipes(); } /** @@ -72,12 +72,12 @@ public class OreDictionaryHandler */ public void observe(IOreListener n) { - ol.add( n ); + this.ol.add( n ); // notify the listener of any ore already in existence. for (String name : OreDictionary.getOreNames()) { - if ( name != null && shouldCare( name ) ) + if ( name != null && this.shouldCare( name ) ) { for (ItemStack item : OreDictionary.getOres( name )) { @@ -90,7 +90,7 @@ public class OreDictionaryHandler public void bakeRecipes() { - enableRebaking = true; + this.enableRebaking = true; for (Object o : CraftingManager.getInstance().getRecipeList()) { diff --git a/src/main/java/appeng/server/AECommand.java b/src/main/java/appeng/server/AECommand.java index 38c4f4f41..bbb848b08 100644 --- a/src/main/java/appeng/server/AECommand.java +++ b/src/main/java/appeng/server/AECommand.java @@ -31,7 +31,7 @@ public class AECommand extends CommandBase final MinecraftServer srv; public AECommand(MinecraftServer server) { - srv = server; + this.srv = server; } @Override @@ -66,7 +66,7 @@ public class AECommand extends CommandBase if ( args.length > 1 ) { Commands c = Commands.valueOf( args[1] ); - throw new WrongUsageException( c.command.getHelp( srv ) ); + throw new WrongUsageException( c.command.getHelp( this.srv ) ); } } catch (Throwable er) @@ -85,8 +85,8 @@ public class AECommand extends CommandBase try { Commands c = Commands.valueOf( args[0] ); - if ( sender.canCommandSenderUseCommand( c.level, getCommandName() ) ) - c.command.call( srv, args, sender ); + if ( sender.canCommandSenderUseCommand( c.level, this.getCommandName() ) ) + c.command.call( this.srv, args, sender ); else throw new WrongUsageException( "commands.ae2.permissions" ); } diff --git a/src/main/java/appeng/server/Commands.java b/src/main/java/appeng/server/Commands.java index 480f18759..94c5ea15a 100644 --- a/src/main/java/appeng/server/Commands.java +++ b/src/main/java/appeng/server/Commands.java @@ -31,12 +31,12 @@ public enum Commands @Override public String toString() { - return name(); + return this.name(); } private Commands(int level, ISubCommand w) { this.level = level; - command = w; + this.command = w; } } diff --git a/src/main/java/appeng/server/ServerHelper.java b/src/main/java/appeng/server/ServerHelper.java index 59c01de3f..bcff79930 100644 --- a/src/main/java/appeng/server/ServerHelper.java +++ b/src/main/java/appeng/server/ServerHelper.java @@ -69,7 +69,7 @@ public class ServerHelper extends CommonHelper if ( Platform.isClient() ) return; - for (EntityPlayer o : getPlayers()) + for (EntityPlayer o : this.getPlayers()) { EntityPlayerMP entityplayermp = (EntityPlayerMP) o; @@ -132,10 +132,10 @@ public class ServerHelper extends CommonHelper @Override public CableRenderMode getRenderMode() { - if ( renderModeBased == null ) + if ( this.renderModeBased == null ) return CableRenderMode.Standard; - return renderModeForPlayer( renderModeBased ); + return this.renderModeForPlayer( this.renderModeBased ); } private EntityPlayer renderModeBased; @@ -143,7 +143,7 @@ public class ServerHelper extends CommonHelper @Override public void updateRenderMode(EntityPlayer player) { - renderModeBased = player; + this.renderModeBased = player; } protected CableRenderMode renderModeForPlayer(EntityPlayer player) diff --git a/src/main/java/appeng/server/subcommands/ChunkLogger.java b/src/main/java/appeng/server/subcommands/ChunkLogger.java index 55742d4fe..1f087b3b5 100644 --- a/src/main/java/appeng/server/subcommands/ChunkLogger.java +++ b/src/main/java/appeng/server/subcommands/ChunkLogger.java @@ -43,7 +43,7 @@ public class ChunkLogger implements ISubCommand if ( !load.world.isRemote ) { AELog.info( "Chunk Loaded: " + load.getChunk().xPosition + ", " + load.getChunk().zPosition ); - displayStack(); + this.displayStack(); } } @@ -70,16 +70,16 @@ public class ChunkLogger implements ISubCommand if ( !unload.world.isRemote ) { AELog.info( "Chunk Unloaded: " + unload.getChunk().xPosition + ", " + unload.getChunk().zPosition ); - displayStack(); + this.displayStack(); } } @Override public void call(MinecraftServer srv, String[] data, ICommandSender sender) { - enabled = !enabled; + this.enabled = !this.enabled; - if ( enabled ) + if ( this.enabled ) { MinecraftForge.EVENT_BUS.register( this ); sender.addChatMessage( new ChatComponentTranslation( "commands.ae2.ChunkLoggerOn" ) ); diff --git a/src/main/java/appeng/services/CompassService.java b/src/main/java/appeng/services/CompassService.java index e3d08477d..93e0fdc8a 100644 --- a/src/main/java/appeng/services/CompassService.java +++ b/src/main/java/appeng/services/CompassService.java @@ -49,23 +49,23 @@ public class CompassService implements ThreadFactory public final boolean value; public CMUpdatePost(World w, int cx, int cz, int dcy, boolean val) { - world = w; - chunkX = cx; - doubleChunkY = dcy; - chunkZ = cz; - value = val; + this.world = w; + this.chunkX = cx; + this.doubleChunkY = dcy; + this.chunkZ = cz; + this.value = val; } @Override public void run() { - jobSize--; + CompassService.this.jobSize--; - CompassReader cr = getReader( world ); - cr.setHasBeacon( chunkX, chunkZ, doubleChunkY, value ); + CompassReader cr = CompassService.this.getReader( this.world ); + cr.setHasBeacon( this.chunkX, this.chunkZ, this.doubleChunkY, this.value ); - if ( jobSize() < 2 ) - cleanUp(); + if ( CompassService.this.jobSize() < 2 ) + CompassService.this.cleanUp(); } } @@ -80,32 +80,32 @@ public class CompassService implements ThreadFactory public CMDirectionRequest(DimensionalCoord coord, int getMaxRange, ICompassCallback cc) { this.coord = coord; this.maxRange = getMaxRange; - callback = cc; + this.callback = cc; } @Override public void run() { - jobSize--; + CompassService.this.jobSize--; - int cx = coord.x >> 4; - int cz = coord.z >> 4; + int cx = this.coord.x >> 4; + int cz = this.coord.z >> 4; - CompassReader cr = getReader( coord.getWorld() ); + CompassReader cr = CompassService.this.getReader( this.coord.getWorld() ); // Am I standing on it? if ( cr.hasBeacon( cx, cz ) ) { - callback.calculatedDirection( true, true, -999, 0 ); + this.callback.calculatedDirection( true, true, -999, 0 ); - if ( jobSize() < 2 ) - cleanUp(); + if ( CompassService.this.jobSize() < 2 ) + CompassService.this.cleanUp(); return; } // spiral outward... - for (int offset = 1; offset < maxRange; offset++) + for (int offset = 1; offset < this.maxRange; offset++) { int minX = cx - offset; int minZ = cz - offset; @@ -120,7 +120,7 @@ public class CompassService implements ThreadFactory { if ( cr.hasBeacon( minX, z ) ) { - int closeness = dist( cx, cz, minX, z ); + int closeness = CompassService.this.dist( cx, cz, minX, z ); if ( closeness < closest ) { closest = closeness; @@ -131,7 +131,7 @@ public class CompassService implements ThreadFactory if ( cr.hasBeacon( maxX, z ) ) { - int closeness = dist( cx, cz, maxX, z ); + int closeness = CompassService.this.dist( cx, cz, maxX, z ); if ( closeness < closest ) { closest = closeness; @@ -145,7 +145,7 @@ public class CompassService implements ThreadFactory { if ( cr.hasBeacon( x, minZ ) ) { - int closeness = dist( cx, cz, x, minZ ); + int closeness = CompassService.this.dist( cx, cz, x, minZ ); if ( closeness < closest ) { closest = closeness; @@ -156,7 +156,7 @@ public class CompassService implements ThreadFactory if ( cr.hasBeacon( x, maxZ ) ) { - int closeness = dist( cx, cz, x, maxZ ); + int closeness = CompassService.this.dist( cx, cz, x, maxZ ); if ( closeness < closest ) { closest = closeness; @@ -168,37 +168,37 @@ public class CompassService implements ThreadFactory if ( closest < Integer.MAX_VALUE ) { - callback.calculatedDirection( true, false, rad( cx, cz, chosen_x, chosen_z ), dist( cx, cz, chosen_x, chosen_z ) ); + this.callback.calculatedDirection( true, false, CompassService.this.rad( cx, cz, chosen_x, chosen_z ), CompassService.this.dist( cx, cz, chosen_x, chosen_z ) ); - if ( jobSize() < 2 ) - cleanUp(); + if ( CompassService.this.jobSize() < 2 ) + CompassService.this.cleanUp(); return; } } // didn't find shit... - callback.calculatedDirection( false, true, -999, 999 ); + this.callback.calculatedDirection( false, true, -999, 999 ); - if ( jobSize() < 2 ) - cleanUp(); + if ( CompassService.this.jobSize() < 2 ) + CompassService.this.cleanUp(); } } public Future getCompassDirection(DimensionalCoord coord, int maxRange, ICompassCallback cc) { - jobSize++; - return executor.submit( new CMDirectionRequest( coord, maxRange, cc ) ); + this.jobSize++; + return this.executor.submit( new CMDirectionRequest( coord, maxRange, cc ) ); } public int jobSize() { - return jobSize; + return this.jobSize; } public void cleanUp() { - for (CompassReader cr : worldSet.values()) + for (CompassReader cr : this.worldSet.values()) cr.close(); } @@ -207,20 +207,20 @@ public class CompassService implements ThreadFactory int x = chunkX << 4; int z = chunkZ << 4; - updateArea( w, x, 16, z ); - updateArea( w, x, 16 + 32, z ); - updateArea( w, x, 16 + 64, z ); - updateArea( w, x, 16 + 96, z ); + this.updateArea( w, x, 16, z ); + this.updateArea( w, x, 16 + 32, z ); + this.updateArea( w, x, 16 + 64, z ); + this.updateArea( w, x, 16 + 96, z ); - updateArea( w, x, 16 + 128, z ); - updateArea( w, x, 16 + 160, z ); - updateArea( w, x, 16 + 192, z ); - updateArea( w, x, 16 + 224, z ); + this.updateArea( w, x, 16 + 128, z ); + this.updateArea( w, x, 16 + 160, z ); + this.updateArea( w, x, 16 + 192, z ); + this.updateArea( w, x, 16 + 224, z ); } public Future updateArea(World w, int x, int y, int z) { - jobSize++; + this.jobSize++; int cx = x >> 4; int cdy = y >> 5; @@ -243,13 +243,13 @@ public class CompassService implements ThreadFactory Block blk = c.getBlock( i, k, j ); if ( blk == skystone && c.getBlockMetadata( i, k, j ) == 0 ) { - return executor.submit( new CMUpdatePost( w, cx, cz, cdy, true ) ); + return this.executor.submit( new CMUpdatePost( w, cx, cz, cdy, true ) ); } } } } - return executor.submit( new CMUpdatePost( w, cx, cz, cdy, false ) ); + return this.executor.submit( new CMUpdatePost( w, cx, cz, cdy, false ) ); } final HashMap worldSet = new HashMap(); @@ -258,19 +258,19 @@ public class CompassService implements ThreadFactory final File rootFolder; public CompassService(File aEFolder) { - rootFolder = aEFolder; - executor = Executors.newSingleThreadExecutor( this ); - jobSize = 0; + this.rootFolder = aEFolder; + this.executor = Executors.newSingleThreadExecutor( this ); + this.jobSize = 0; } private CompassReader getReader(World w) { - CompassReader cr = worldSet.get( w ); + CompassReader cr = this.worldSet.get( w ); if ( cr == null ) { - cr = new CompassReader( w.provider.dimensionId, rootFolder ); - worldSet.put( w, cr ); + cr = new CompassReader( w.provider.dimensionId, this.rootFolder ); + this.worldSet.put( w, cr ); } return cr; @@ -294,19 +294,19 @@ public class CompassService implements ThreadFactory public void kill() { - executor.shutdown(); + this.executor.shutdown(); try { - executor.awaitTermination( 6, TimeUnit.MINUTES ); - jobSize = 0; + this.executor.awaitTermination( 6, TimeUnit.MINUTES ); + this.jobSize = 0; - for (CompassReader cr : worldSet.values()) + for (CompassReader cr : this.worldSet.values()) { cr.close(); } - worldSet.clear(); + this.worldSet.clear(); } catch (InterruptedException e) { diff --git a/src/main/java/appeng/services/VersionChecker.java b/src/main/java/appeng/services/VersionChecker.java index 2844c6124..0f698c415 100644 --- a/src/main/java/appeng/services/VersionChecker.java +++ b/src/main/java/appeng/services/VersionChecker.java @@ -57,7 +57,7 @@ public class VersionChecker implements Runnable { try { - sleep( delay ); + this.sleep( this.delay ); } catch (InterruptedException e) { @@ -128,13 +128,13 @@ public class VersionChecker implements Runnable } } - sleep( FOUR_HOURS ); + this.sleep( FOUR_HOURS ); } catch (Exception e) { try { - sleep( FOUR_HOURS ); + this.sleep( FOUR_HOURS ); } catch (InterruptedException e1) { diff --git a/src/main/java/appeng/services/helpers/CompassException.java b/src/main/java/appeng/services/helpers/CompassException.java index 5ec82030e..9ddf4991d 100644 --- a/src/main/java/appeng/services/helpers/CompassException.java +++ b/src/main/java/appeng/services/helpers/CompassException.java @@ -26,7 +26,7 @@ public class CompassException extends RuntimeException public final Throwable inner; public CompassException(Throwable t) { - inner = t; + this.inner = t; } } diff --git a/src/main/java/appeng/services/helpers/CompassReader.java b/src/main/java/appeng/services/helpers/CompassReader.java index 646c6dca6..000454ccf 100644 --- a/src/main/java/appeng/services/helpers/CompassReader.java +++ b/src/main/java/appeng/services/helpers/CompassReader.java @@ -46,13 +46,13 @@ public class CompassReader public void setHasBeacon(int cx, int cz, int cdy, boolean hasBeacon) { - CompassRegion r = getRegion( cx, cz ); + CompassRegion r = this.getRegion( cx, cz ); r.setHasBeacon( cx, cz, cdy, hasBeacon ); } public boolean hasBeacon(int cx, int cz) { - CompassRegion r = getRegion( cx, cz ); + CompassRegion r = this.getRegion( cx, cz ); return r.hasBeacon( cx, cz ); } diff --git a/src/main/java/appeng/services/helpers/CompassRegion.java b/src/main/java/appeng/services/helpers/CompassRegion.java index 97109aced..08e30c9e9 100644 --- a/src/main/java/appeng/services/helpers/CompassRegion.java +++ b/src/main/java/appeng/services/helpers/CompassRegion.java @@ -44,31 +44,31 @@ public class CompassRegion public CompassRegion( int cx, int cz, int worldID, File rootFolder ) { - world = worldID; + this.world = worldID; this.rootFolder = rootFolder; int region_x = cx >> 10; int region_z = cz >> 10; - low_x = region_x << 10; - low_z = region_z << 10; + this.low_x = region_x << 10; + this.low_z = region_z << 10; - hi_x = low_x + 1024; - hi_z = low_z + 1024; + this.hi_x = this.low_x + 1024; + this.hi_z = this.low_z + 1024; - openFile( false ); + this.openFile( false ); } public void close() { try { - if ( hasFile ) + if ( this.hasFile ) { - buffer = null; - raf.close(); - raf = null; - hasFile = false; + this.buffer = null; + this.raf.close(); + this.raf = null; + this.hasFile = false; } } catch ( Throwable t ) @@ -79,12 +79,12 @@ public class CompassRegion public boolean hasBeacon( int cx, int cz ) { - if ( hasFile ) + if ( this.hasFile ) { cx = cx & 0x3FF; cz = cz & 0x3FF; - int val = read( cx, cz ); + int val = this.read( cx, cz ); if ( val != 0 ) return true; } @@ -97,11 +97,11 @@ public class CompassRegion cx &= 0x3FF; cz &= 0x3FF; - openFile( hasBeacon ); + this.openFile( hasBeacon ); - if ( hasFile ) + if ( this.hasFile ) { - int val = read( cx, cz ); + int val = this.read( cx, cz ); int originalVal = val; if ( hasBeacon ) @@ -110,7 +110,7 @@ public class CompassRegion val &= ~( 1 << cdy ); if ( originalVal != val ) - write( cx, cz, val ); + this.write( cx, cz, val ); } } @@ -118,7 +118,7 @@ public class CompassRegion { try { - buffer.put( cx + cz * 0x400, ( byte ) val ); + this.buffer.put( cx + cz * 0x400, ( byte ) val ); // raf.seek( cx + cz * 0x400 ); // raf.writeByte( val ); } @@ -132,7 +132,7 @@ public class CompassRegion { try { - return buffer.get( cx + cz * 0x400 ); + return this.buffer.get( cx + cz * 0x400 ); // raf.seek( cx + cz * 0x400 ); // return raf.readByte(); } @@ -148,18 +148,18 @@ public class CompassRegion private void openFile( boolean create ) { - File fName = getFileName(); - if ( hasFile ) + File fName = this.getFileName(); + if ( this.hasFile ) return; - if ( create || fileExists( fName ) ) + if ( create || this.fileExists( fName ) ) { try { - raf = new RandomAccessFile( fName, "rw" ); - FileChannel fc = raf.getChannel(); - buffer = fc.map( FileChannel.MapMode.READ_WRITE, 0, 0x400 * 0x400 );// fc.size() ); - hasFile = true; + this.raf = new RandomAccessFile( fName, "rw" ); + FileChannel fc = this.raf.getChannel(); + this.buffer = fc.map( FileChannel.MapMode.READ_WRITE, 0, 0x400 * 0x400 );// fc.size() ); + this.hasFile = true; } catch ( Throwable t ) { @@ -176,7 +176,7 @@ public class CompassRegion private File getFileName() { - String folder = rootFolder.getPath() + File.separatorChar + "compass"; + String folder = this.rootFolder.getPath() + File.separatorChar + "compass"; File folderFile = new File( folder ); if ( !folderFile.exists() || !folderFile.isDirectory() ) @@ -185,6 +185,6 @@ public class CompassRegion AELog.info( "Failed to create AE2/compass/" ); } - return new File( folder + File.separatorChar + world + '_' + low_x + '_' + low_z + ".dat" ); + return new File( folder + File.separatorChar + this.world + '_' + this.low_x + '_' + this.low_z + ".dat" ); } } diff --git a/src/main/java/appeng/spatial/CachedPlane.java b/src/main/java/appeng/spatial/CachedPlane.java index 6fc8845f8..8485ca01b 100644 --- a/src/main/java/appeng/spatial/CachedPlane.java +++ b/src/main/java/appeng/spatial/CachedPlane.java @@ -54,56 +54,56 @@ public class CachedPlane private final ExtendedBlockStorage[] storage; public Column(Chunk _c, int _x, int _z, int cy, int chunkHeight) { - x = _x; - z = _z; - c = _c; - storage = c.getBlockStorageArray(); + this.x = _x; + this.z = _z; + this.c = _c; + this.storage = this.c.getBlockStorageArray(); // make sure storage exists before hand... for (int ay = 0; ay < chunkHeight; ay++) { int by = (ay + cy); - ExtendedBlockStorage extendedblockstorage = storage[by]; + ExtendedBlockStorage extendedblockstorage = this.storage[by]; if ( extendedblockstorage == null ) - extendedblockstorage = storage[by] = new ExtendedBlockStorage( by << 4, !c.worldObj.provider.hasNoSky ); + extendedblockstorage = this.storage[by] = new ExtendedBlockStorage( by << 4, !this.c.worldObj.provider.hasNoSky ); } } public void setBlockIDWithMetadata(int y, Object[] blk) { - if ( blk[0] == matrixFrame ) + if ( blk[0] == CachedPlane.this.matrixFrame ) blk[0] = Platform.air; - ExtendedBlockStorage extendedBlockStorage = storage[y >> 4]; - extendedBlockStorage.func_150818_a( x, y & 15, z, (Block) blk[0] ); + ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4]; + extendedBlockStorage.func_150818_a( this.x, y & 15, this.z, (Block) blk[0] ); // extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] ); - extendedBlockStorage.setExtBlockMetadata( x, y & 15, z, (Integer) blk[1] ); - extendedBlockStorage.setExtBlocklightValue( x, y & 15, z, (Integer) blk[2] ); + extendedBlockStorage.setExtBlockMetadata( this.x, y & 15, this.z, (Integer) blk[1] ); + extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[2] ); } public Object[] getDetails(int y) { - ExtendedBlockStorage extendedblockstorage = storage[y >> 4]; - ch[0] = extendedblockstorage.getBlockByExtId( x, y & 15, z ); - ch[1] = extendedblockstorage.getExtBlockMetadata( x, y & 15, z ); - ch[2] = extendedblockstorage.getExtBlocklightValue( x, y & 15, z ); - return ch; + ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + this.ch[0] = extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ); + this.ch[1] = extendedblockstorage.getExtBlockMetadata( this.x, y & 15, this.z ); + this.ch[2] = extendedblockstorage.getExtBlocklightValue( this.x, y & 15, this.z ); + return this.ch; } public boolean doNotSkip(int y) { - ExtendedBlockStorage extendedblockstorage = storage[y >> 4]; - if ( reg.isBlacklisted( extendedblockstorage.getBlockByExtId( x, y & 15, z ) ) ) + ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + if ( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ) ) ) return false; - return skipThese == null || !skipThese.contains( y ); + return this.skipThese == null || !this.skipThese.contains( y ); } public void setSkip(int yCoord) { - if ( skipThese == null ) - skipThese = new LinkedList(); - skipThese.add( yCoord ); + if ( this.skipThese == null ) + this.skipThese = new LinkedList(); + this.skipThese.add( yCoord ); } } @@ -136,15 +136,15 @@ public class CachedPlane public CachedPlane(World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { - world = w; + this.world = w; - x_size = maxX - minX + 1; - y_size = maxY - minY + 1; - z_size = maxZ - minZ + 1; + this.x_size = maxX - minX + 1; + this.y_size = maxY - minY + 1; + this.z_size = maxZ - minZ + 1; - x_offset = minX; - y_offset = minY; - z_offset = minZ; + this.x_offset = minX; + this.y_offset = minY; + this.z_offset = minZ; int minCX = minX >> 4; int minCY = minY >> 4; @@ -153,35 +153,35 @@ public class CachedPlane int maxCY = maxY >> 4; int maxCZ = maxZ >> 4; - cx_size = maxCX - minCX + 1; + this.cx_size = maxCX - minCX + 1; int cy_size = maxCY - minCY + 1; - cz_size = maxCZ - minCZ + 1; + this.cz_size = maxCZ - minCZ + 1; - myChunks = new Chunk[cx_size][cz_size]; - myColumns = new Column[x_size][z_size]; + this.myChunks = new Chunk[this.cx_size][this.cz_size]; + this.myColumns = new Column[this.x_size][this.z_size]; - verticalBits = 0; + this.verticalBits = 0; for (int cy = 0; cy < cy_size; cy++) { - verticalBits |= 1 << (minCY + cy); + this.verticalBits |= 1 << (minCY + cy); } - for (int x = 0; x < x_size; x++) - for (int z = 0; z < z_size; z++) + for (int x = 0; x < this.x_size; x++) + for (int z = 0; z < this.z_size; z++) { - myColumns[x][z] = new Column( w.getChunkFromChunkCoords( (minX + x) >> 4, (minZ + z) >> 4 ), (minX + x) & 0xF, (minZ + z) & 0xF, minCY, cy_size ); + this.myColumns[x][z] = new Column( w.getChunkFromChunkCoords( (minX + x) >> 4, (minZ + z) >> 4 ), (minX + x) & 0xF, (minZ + z) & 0xF, minCY, cy_size ); } IMovableRegistry mr = AEApi.instance().registries().movable(); - for (int cx = 0; cx < cx_size; cx++) - for (int cz = 0; cz < cz_size; cz++) + for (int cx = 0; cx < this.cx_size; cx++) + for (int cz = 0; cz < this.cz_size; cz++) { LinkedList> rawTiles = new LinkedList>(); LinkedList deadTiles = new LinkedList(); Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); - myChunks[cx][cz] = c; + this.myChunks[cx][cz] = c; rawTiles.addAll( ( ( HashMap ) c.chunkTileEntityMap ).entrySet() ); for (Entry tx : rawTiles) @@ -192,12 +192,12 @@ public class CachedPlane { if ( mr.askToMove( te ) ) { - tiles.add( te ); + this.tiles.add( te ); deadTiles.add( cp ); } else { - Object[] details = myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord ); + Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord ); Block blk = (Block) details[0]; // don't skip air, just let the code replace it... @@ -208,7 +208,7 @@ public class CachedPlane c.worldObj.notifyBlocksOfNeighborChange( te.xCoord, te.yCoord, te.zCoord, Platform.air ); } else - myColumns[te.xCoord - minX][te.zCoord - minZ].setSkip( te.yCoord ); + this.myColumns[te.xCoord - minX][te.zCoord - minZ].setSkip( te.yCoord ); } } } @@ -218,8 +218,8 @@ public class CachedPlane c.chunkTileEntityMap.remove( cp ); } - long k = world.getTotalWorldTime(); - List list = world.getPendingBlockUpdates( c, false ); + long k = this.world.getTotalWorldTime(); + List list = this.world.getPendingBlockUpdates( c, false ); if ( list != null ) { for (Object o : list) @@ -230,18 +230,18 @@ public class CachedPlane { NextTickListEntry newEntry = new NextTickListEntry( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() ); newEntry.scheduledTime = entry.scheduledTime - k; - ticks.add( newEntry ); + this.ticks.add( newEntry ); } } } } - for (TileEntity te : tiles) + for (TileEntity te : this.tiles) { try { - world.loadedTileEntityList.remove( te ); + this.world.loadedTileEntityList.remove( te ); } catch (Exception e) { @@ -260,22 +260,22 @@ public class CachedPlane { IMovableRegistry mr = AEApi.instance().registries().movable(); - if ( dst.x_size == x_size && dst.y_size == y_size && dst.z_size == z_size ) + if ( dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size ) { - AELog.info( "Block Copy Scale: " + x_size + ", " + y_size + ", " + z_size ); + AELog.info( "Block Copy Scale: " + this.x_size + ", " + this.y_size + ", " + this.z_size ); long startTime = System.nanoTime(); - for (int x = 0; x < x_size; x++) + for (int x = 0; x < this.x_size; x++) { - for (int z = 0; z < z_size; z++) + for (int z = 0; z < this.z_size; z++) { - Column a = myColumns[x][z]; + Column a = this.myColumns[x][z]; Column b = dst.myColumns[x][z]; - for (int y = 0; y < y_size; y++) + for (int y = 0; y < this.y_size; y++) { - int src_y = y + y_offset; + int src_y = y + this.y_offset; int dst_y = y + dst.y_offset; if ( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) ) @@ -288,7 +288,7 @@ public class CachedPlane } else { - markForUpdate( x + x_offset, src_y, z + z_offset ); + this.markForUpdate( x + this.x_offset, src_y, z + this.z_offset ); dst.markForUpdate( x + dst.x_offset, dst_y, z + dst.z_offset ); } } @@ -300,28 +300,28 @@ public class CachedPlane long duration = endTime - startTime; AELog.info( "Block Copy Time: " + duration ); - for (TileEntity te : tiles) + for (TileEntity te : this.tiles) { - dst.addTile( te.xCoord - x_offset, te.yCoord - y_offset, te.zCoord - z_offset, te, this, mr ); + dst.addTile( te.xCoord - this.x_offset, te.yCoord - this.y_offset, te.zCoord - this.z_offset, te, this, mr ); } for (TileEntity te : dst.tiles) { - addTile( te.xCoord - dst.x_offset, te.yCoord - dst.y_offset, te.zCoord - dst.z_offset, te, dst, mr ); + this.addTile( te.xCoord - dst.x_offset, te.yCoord - dst.y_offset, te.zCoord - dst.z_offset, te, dst, mr ); } - for (NextTickListEntry entry : ticks) + for (NextTickListEntry entry : this.ticks) { - dst.addTick( entry.xCoord - x_offset, entry.yCoord - y_offset, entry.zCoord - z_offset, entry ); + dst.addTick( entry.xCoord - this.x_offset, entry.yCoord - this.y_offset, entry.zCoord - this.z_offset, entry ); } for (NextTickListEntry entry : dst.ticks) { - addTick( entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry ); + this.addTick( entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry ); } startTime = System.nanoTime(); - updateChunks(); + this.updateChunks(); dst.updateChunks(); endTime = System.nanoTime(); @@ -332,36 +332,36 @@ public class CachedPlane private void markForUpdate(int src_x, int src_y, int src_z) { - updates.add( new WorldCoord( src_x, src_y, src_z ) ); + this.updates.add( new WorldCoord( src_x, src_y, src_z ) ); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - updates.add( new WorldCoord( src_x + d.offsetX, src_y + d.offsetY, src_z + d.offsetZ ) ); + this.updates.add( new WorldCoord( src_x + d.offsetX, src_y + d.offsetY, src_z + d.offsetZ ) ); } private void addTick(int x, int y, int z, NextTickListEntry entry) { - world.scheduleBlockUpdate( x + x_offset, y + y_offset, z + z_offset, entry.func_151351_a(), (int) entry.scheduledTime ); + this.world.scheduleBlockUpdate( x + this.x_offset, y + this.y_offset, z + this.z_offset, entry.func_151351_a(), (int) entry.scheduledTime ); } private void addTile(int x, int y, int z, TileEntity te, CachedPlane alternateDestination, IMovableRegistry mr) { try { - Column c = myColumns[x][z]; + Column c = this.myColumns[x][z]; - if ( c.doNotSkip( y + y_offset ) || alternateDestination == null ) + if ( c.doNotSkip( y + this.y_offset ) || alternateDestination == null ) { - IMovableHandler handler = getHandler( te ); + IMovableHandler handler = this.getHandler( te ); try { - handler.moveTile( te, world, x + x_offset, y + y_offset, z + z_offset ); + handler.moveTile( te, this.world, x + this.x_offset, y + this.y_offset, z + this.z_offset ); } catch (Throwable e) { AELog.error( e ); // attempt recovery... - te.setWorldObj( world ); + te.setWorldObj( this.world ); te.xCoord = x; te.yCoord = y; te.zCoord = z; @@ -371,8 +371,8 @@ public class CachedPlane if ( c.c.isChunkLoaded ) { - world.addTileEntity( te ); - world.markBlockForUpdate( x, y, z ); + this.world.addTileEntity( te ); + this.world.markBlockForUpdate( x, y, z ); } } @@ -393,26 +393,26 @@ public class CachedPlane { // update shit.. - for (int x = 0; x < cx_size; x++) - for (int z = 0; z < cz_size; z++) + for (int x = 0; x < this.cx_size; x++) + for (int z = 0; z < this.cz_size; z++) { - Chunk c = myChunks[x][z]; + Chunk c = this.myChunks[x][z]; c.resetRelightChecks(); c.generateSkylightMap(); c.isModified = true; } // send shit... - for (int x = 0; x < cx_size; x++) - for (int z = 0; z < cz_size; z++) + for (int x = 0; x < this.cx_size; x++) + for (int z = 0; z < this.cz_size; z++) { - Chunk c = myChunks[x][z]; + Chunk c = this.myChunks[x][z]; for (int y = 1; y < 255; y += 32) - WorldSettings.getInstance().getCompass().updateArea( world, c.xPosition << 4, y, c.zPosition << 4 ); + WorldSettings.getInstance().getCompass().updateArea( this.world, c.xPosition << 4, y, c.zPosition << 4 ); - Platform.sendChunk( c, verticalBits ); + Platform.sendChunk( c, this.verticalBits ); } diff --git a/src/main/java/appeng/spatial/StorageChunkProvider.java b/src/main/java/appeng/spatial/StorageChunkProvider.java index 87a7bd023..612017ef2 100644 --- a/src/main/java/appeng/spatial/StorageChunkProvider.java +++ b/src/main/java/appeng/spatial/StorageChunkProvider.java @@ -61,7 +61,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate @Override public Chunk provideChunk(int x, int z) { - Chunk chunk = new Chunk( w, blocks, x, z ); + Chunk chunk = new Chunk( this.w, blocks, x, z ); byte[] biomes = chunk.getBiomeArray(); AEConfig config = AEConfig.instance; diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index e286e5edb..cee0e7043 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -55,14 +55,14 @@ public class StorageHelper final World dst; public TriggerUpdates(World dst2) { - dst = dst2; + this.dst = dst2; } @Override public void visit(int x, int y, int z) { - Block blk = dst.getBlock( x, y, z ); - blk.onNeighborBlockChange( dst, x, y, z, Platform.air ); + Block blk = this.dst.getBlock( x, y, z ); + blk.onNeighborBlockChange( this.dst, x, y, z, Platform.air ); } } @@ -74,15 +74,15 @@ public class StorageHelper final int Meta; public WrapInMatrixFrame(Block blockID, int metaData, World dst2) { - dst = dst2; - blkID = blockID; - Meta = metaData; + this.dst = dst2; + this.blkID = blockID; + this.Meta = metaData; } @Override public void visit(int x, int y, int z) { - dst.setBlock( x, y, z, blkID, Meta, 3 ); + this.dst.setBlock( x, y, z, this.blkID, this.Meta, 3 ); } } @@ -90,13 +90,13 @@ public class StorageHelper { TelDestination(World _dim, AxisAlignedBB srcBox, double _x, double _y, double _z, int tileX, int tileY, int tileZ) { - dim = _dim; - x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, _x + tileX ) ); - y = Math.min( srcBox.maxY - 0.5, Math.max( srcBox.minY + 0.5, _y + tileY ) ); - z = Math.min( srcBox.maxZ - 0.5, Math.max( srcBox.minZ + 0.5, _z + tileZ ) ); - xOff = tileX; - yOff = tileY; - zOff = tileZ; + this.dim = _dim; + this.x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, _x + tileX ) ); + this.y = Math.min( srcBox.maxY - 0.5, Math.max( srcBox.minY + 0.5, _y + tileY ) ); + this.z = Math.min( srcBox.maxZ - 0.5, Math.max( srcBox.minZ + 0.5, _z + tileZ ) ); + this.xOff = tileX; + this.yOff = tileY; + this.zOff = tileZ; } final World dim; @@ -116,13 +116,13 @@ public class StorageHelper public METeleporter(WorldServer par1WorldServer, TelDestination d) { super( par1WorldServer ); - destination = d; + this.destination = d; } @Override public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) { - par1Entity.setLocationAndAngles( destination.x, destination.y, destination.z, par1Entity.rotationYaw, 0.0F ); + par1Entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F ); par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; } @@ -179,14 +179,14 @@ public class StorageHelper // Is something riding? Handle it first. if ( entity.riddenByEntity != null ) { - return teleportEntity( entity.riddenByEntity, link ); + return this.teleportEntity( entity.riddenByEntity, link ); } // Are we riding something? Dismount and tell the mount to go first. Entity cart = entity.ridingEntity; if ( cart != null ) { entity.mountEntity( null ); - cart = teleportEntity( cart, link ); + cart = this.teleportEntity( cart, link ); // We keep track of both so we can remount them on the other side. } @@ -290,7 +290,7 @@ public class StorageHelper { BlockMatrixFrame blkMF = (BlockMatrixFrame) AEApi.instance().blocks().blockMatrixFrame.block(); - transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( blkMF, 0, dst ) ); + this.transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( blkMF, 0, dst ) ); AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 ); @@ -307,12 +307,12 @@ public class StorageHelper for (Entity e : dstE) { - teleportEntity( e, new TelDestination( src, srcBox, e.posX, e.posY, e.posZ, -i + x, -j + y, -k + z ) ); + this.teleportEntity( e, new TelDestination( src, srcBox, e.posX, e.posY, e.posZ, -i + x, -j + y, -k + z ) ); } for (Entity e : srcE) { - teleportEntity( e, new TelDestination( dst, dstBox, e.posX, e.posY, e.posZ, -x + i, -y + j, -z + k ) ); + this.teleportEntity( e, new TelDestination( dst, dstBox, e.posX, e.posY, e.posZ, -x + i, -y + j, -z + k ) ); } for (WorldCoord wc : cDst.updates) @@ -321,11 +321,11 @@ public class StorageHelper for (WorldCoord wc : cSrc.updates) cSrc.world.notifyBlockOfNeighborChange( wc.x, wc.y, wc.z, Platform.air ); - transverseEdges( x - 1, y - 1, z - 1, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1, new TriggerUpdates( src ) ); - transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new TriggerUpdates( dst ) ); + this.transverseEdges( x - 1, y - 1, z - 1, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1, new TriggerUpdates( src ) ); + this.transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new TriggerUpdates( dst ) ); - transverseEdges( x, y, z, x + scaleX, y + scaleY, z + scaleZ, new TriggerUpdates( src ) ); - transverseEdges( i, j, k, i + scaleX, j + scaleY, k + scaleZ, new TriggerUpdates( dst ) ); + this.transverseEdges( x, y, z, x + scaleX, y + scaleY, z + scaleZ, new TriggerUpdates( src ) ); + this.transverseEdges( i, j, k, i + scaleX, j + scaleY, k + scaleZ, new TriggerUpdates( dst ) ); /* * IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) { ChunkProviderServer diff --git a/src/main/java/appeng/spatial/StorageWorldProvider.java b/src/main/java/appeng/spatial/StorageWorldProvider.java index 48718ef37..cd1c4ad43 100644 --- a/src/main/java/appeng/spatial/StorageWorldProvider.java +++ b/src/main/java/appeng/spatial/StorageWorldProvider.java @@ -133,7 +133,7 @@ public class StorageWorldProvider extends WorldProvider @Override public IChunkProvider createChunkGenerator() { - return new StorageChunkProvider( worldObj, 0 ); + return new StorageChunkProvider( this.worldObj, 0 ); } @Override diff --git a/src/main/java/appeng/tile/AEBaseInvTile.java b/src/main/java/appeng/tile/AEBaseInvTile.java index 51305463e..46b791d0c 100644 --- a/src/main/java/appeng/tile/AEBaseInvTile.java +++ b/src/main/java/appeng/tile/AEBaseInvTile.java @@ -36,7 +36,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_AEBaseInvTile(net.minecraft.nbt.NBTTagCompound data) { - IInventory inv = getInternalInventory(); + IInventory inv = this.getInternalInventory(); NBTTagCompound opt = data.getCompoundTag( "inv" ); for (int x = 0; x < inv.getSizeInventory(); x++) { @@ -48,12 +48,12 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_AEBaseInvTile(net.minecraft.nbt.NBTTagCompound data) { - IInventory inv = getInternalInventory(); + IInventory inv = this.getInternalInventory(); NBTTagCompound opt = new NBTTagCompound(); for (int x = 0; x < inv.getSizeInventory(); x++) { NBTTagCompound item = new NBTTagCompound(); - ItemStack is = getStackInSlot( x ); + ItemStack is = this.getStackInSlot( x ); if ( is != null ) is.writeToNBT( item ); opt.setTag( "item" + x, item ); @@ -64,19 +64,19 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public int getSizeInventory() { - return getInternalInventory().getSizeInventory(); + return this.getInternalInventory().getSizeInventory(); } @Override public ItemStack getStackInSlot(int i) { - return getInternalInventory().getStackInSlot( i ); + return this.getInternalInventory().getStackInSlot( i ); } @Override public ItemStack decrStackSize(int i, int j) { - return getInternalInventory().decrStackSize( i, j ); + return this.getInternalInventory().decrStackSize( i, j ); } @Override @@ -88,7 +88,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - getInternalInventory().setInventorySlotContents( i, itemstack ); + this.getInternalInventory().setInventorySlotContents( i, itemstack ); } @Override @@ -123,7 +123,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return isItemValidForSlot( i, itemstack ); + return this.isItemValidForSlot( i, itemstack ); } @Override @@ -142,13 +142,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override final public int[] getAccessibleSlotsFromSide(int side) { - Block blk = worldObj.getBlock( xCoord, yCoord, zCoord ); + Block blk = this.worldObj.getBlock( this.xCoord, this.yCoord, this.zCoord ); if ( blk instanceof AEBaseBlock ) { ForgeDirection mySide = ForgeDirection.getOrientation( side ); - return getAccessibleSlotsBySide( ((AEBaseBlock) blk).mapRotation( this, mySide ) ); + return this.getAccessibleSlotsBySide( ((AEBaseBlock) blk).mapRotation( this, mySide ) ); } - return getAccessibleSlotsBySide( ForgeDirection.getOrientation( side ) ); + return this.getAccessibleSlotsBySide( ForgeDirection.getOrientation( side ) ); } /** @@ -157,7 +157,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public String getInventoryName() { - return getCustomName(); + return this.getCustomName(); } /** @@ -166,7 +166,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public boolean hasCustomInventoryName() { - return hasCustomName(); + return this.hasCustomName(); } } diff --git a/src/main/java/appeng/tile/AEBaseTile.java b/src/main/java/appeng/tile/AEBaseTile.java index a110ae2e8..05c38fd53 100644 --- a/src/main/java/appeng/tile/AEBaseTile.java +++ b/src/main/java/appeng/tile/AEBaseTile.java @@ -81,7 +81,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, public boolean notLoaded() { - return !worldObj.blockExists( xCoord, yCoord, zCoord ); + return !this.worldObj.blockExists( this.xCoord, this.yCoord, this.zCoord ); } public TileEntity getTile() @@ -104,13 +104,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, protected boolean hasHandlerFor(TileEventType type) { - List list = getHandlerListFor( type ); + List list = this.getHandlerListFor( type ); return list != null && !list.isEmpty(); } protected List getHandlerListFor(TileEventType type) { - Class clz = getClass(); + Class clz = this.getClass(); EnumMap> handlerSet = handlers.get( clz ); if ( handlerSet == null ) @@ -122,7 +122,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, TileEvent te = m.getAnnotation( TileEvent.class ); if ( te != null ) { - addHandler( handlerSet, te.value(), m ); + this.addHandler( handlerSet, te.value(), m ); } } } @@ -148,7 +148,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override final public boolean canUpdate() { - return hasHandlerFor( TileEventType.TICK ); + return this.hasHandlerFor( TileEventType.TICK ); } final public void Tick() @@ -159,15 +159,15 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override final public void updateEntity() { - for (AETileEventHandler h : getHandlerListFor( TileEventType.TICK )) + for (AETileEventHandler h : this.getHandlerListFor( TileEventType.TICK )) h.Tick( this ); } @Override public void onChunkUnload() { - if ( !isInvalid() ) - invalidate(); + if ( !this.isInvalid() ) + this.invalidate(); } /** @@ -175,8 +175,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, */ public void onChunkLoad() { - if ( isInvalid() ) - validate(); + if ( this.isInvalid() ) + this.validate(); } @Override @@ -185,16 +185,16 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, { super.writeToNBT( data ); - if ( canBeRotated() ) + if ( this.canBeRotated() ) { - data.setString( "orientation_forward", forward.name() ); - data.setString( "orientation_up", up.name() ); + data.setString( "orientation_forward", this.forward.name() ); + data.setString( "orientation_up", this.up.name() ); } - if ( customName != null ) - data.setString( "customName", customName ); + if ( this.customName != null ) + data.setString( "customName", this.customName ); - for (AETileEventHandler h : getHandlerListFor( TileEventType.WORLD_NBT_WRITE )) + for (AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_WRITE )) h.writeToNBT( this, data ); } @@ -205,23 +205,23 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, super.readFromNBT( data ); if ( data.hasKey( "customName" ) ) - customName = data.getString( "customName" ); + this.customName = data.getString( "customName" ); else - customName = null; + this.customName = null; try { - if ( canBeRotated() ) + if ( this.canBeRotated() ) { - forward = ForgeDirection.valueOf( data.getString( "orientation_forward" ) ); - up = ForgeDirection.valueOf( data.getString( "orientation_up" ) ); + this.forward = ForgeDirection.valueOf( data.getString( "orientation_forward" ) ); + this.up = ForgeDirection.valueOf( data.getString( "orientation_up" ) ); } } catch (IllegalArgumentException ignored) { } - for (AETileEventHandler h : getHandlerListFor( TileEventType.WORLD_NBT_READ )) + for (AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_READ )) { h.readFromNBT( this, data ); } @@ -231,13 +231,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, { try { - if ( canBeRotated() ) + if ( this.canBeRotated() ) { - byte orientation = (byte) ((up.ordinal() << 3) | forward.ordinal()); + byte orientation = (byte) ((this.up.ordinal() << 3) | this.forward.ordinal()); data.writeByte( orientation ); } - for (AETileEventHandler h : getHandlerListFor( TileEventType.NETWORK_WRITE )) + for (AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_WRITE )) h.writeToStream( this, data ); } catch (Throwable t) @@ -253,26 +253,26 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, try { - if ( canBeRotated() ) + if ( this.canBeRotated() ) { - ForgeDirection old_Forward = forward; - ForgeDirection old_Up = up; + ForgeDirection old_Forward = this.forward; + ForgeDirection old_Up = this.up; byte orientation = data.readByte(); - forward = ForgeDirection.getOrientation( orientation & 0x7 ); - up = ForgeDirection.getOrientation( orientation >> 3 ); + this.forward = ForgeDirection.getOrientation( orientation & 0x7 ); + this.up = ForgeDirection.getOrientation( orientation >> 3 ); - output = !forward.equals( old_Forward ) || !up.equals( old_Up ); + output = !this.forward.equals( old_Forward ) || !this.up.equals( old_Up ); } - renderFragment = 100; - for (AETileEventHandler h : getHandlerListFor( TileEventType.NETWORK_READ )) + this.renderFragment = 100; + for (AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_READ )) if ( h.readFromStream( this, data ) ) output = true; - if ( (renderFragment & 1) == 1 ) + if ( (this.renderFragment & 1) == 1 ) output = true; - renderFragment = 0; + this.renderFragment = 0; } catch (Throwable t) { @@ -296,29 +296,29 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public ForgeDirection getForward() { - return forward; + return this.forward; } @Override public ForgeDirection getUp() { - return up; + return this.up; } @Override public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { - forward = inForward; - up = inUp; - markForUpdate(); - Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); + this.forward = inForward; + this.up = inUp; + this.markForUpdate(); + Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord ); } public void onPlacement(ItemStack stack, EntityPlayer player, int side) { if ( stack.hasTagCompound() ) { - uploadSettings( SettingsFrom.DISMANTLE_ITEM, stack.getTagCompound() ); + this.uploadSettings( SettingsFrom.DISMANTLE_ITEM, stack.getTagCompound() ); } } @@ -331,7 +331,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, try { - writeToStream( stream ); + this.writeToStream( stream ); if ( stream.readableBytes() == 0 ) return null; } @@ -342,7 +342,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, stream.capacity( stream.readableBytes() ); data.setByteArray( "X", stream.array() ); - return new S35PacketUpdateTileEntity( xCoord, yCoord, zCoord, 64, data ); + return new S35PacketUpdateTileEntity( this.xCoord, this.yCoord, this.zCoord, 64, data ); } @Override @@ -352,22 +352,22 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if ( pkt.func_148853_f() == 64 ) { ByteBuf stream = Unpooled.copiedBuffer( pkt.func_148857_g().getByteArray( "X" ) ); - if ( readFromStream( stream ) ) - markForUpdate(); + if ( this.readFromStream( stream ) ) + this.markForUpdate(); } } public void markForUpdate() { - if ( renderFragment > 0 ) - renderFragment = renderFragment | 1; + if ( this.renderFragment > 0 ) + this.renderFragment = this.renderFragment | 1; else { // TODO: Optimize Network Load - if ( worldObj != null ) + if ( this.worldObj != null ) { - AELog.blockUpdate( xCoord, yCoord, zCoord, this ); - worldObj.markBlockForUpdate( xCoord, yCoord, zCoord ); + AELog.blockUpdate( this.xCoord, this.yCoord, this.zCoord, this ); + this.worldObj.markBlockForUpdate( this.xCoord, this.yCoord, this.zCoord ); } } } @@ -453,10 +453,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, { NBTTagCompound output = new NBTTagCompound(); - if ( hasCustomName() ) + if ( this.hasCustomName() ) { NBTTagCompound dsp = new NBTTagCompound(); - dsp.setString( "Name", getCustomName() ); + dsp.setString( "Name", this.getCustomName() ); output.setTag( "display", dsp ); } @@ -487,8 +487,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, public void securityBreak() { - worldObj.func_147480_a( xCoord, yCoord, zCoord, true ); - disableDrops(); + this.worldObj.func_147480_a( this.xCoord, this.yCoord, this.zCoord, true ); + this.disableDrops(); } public void saveChanges() @@ -509,13 +509,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public String getCustomName() { - return hasCustomName() ? customName : getClass().getSimpleName(); + return this.hasCustomName() ? this.customName : this.getClass().getSimpleName(); } @Override public boolean hasCustomName() { - return customName != null && customName.length() > 0; + return this.customName != null && this.customName.length() > 0; } } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java index ffd87a5f4..2a57e26cf 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java @@ -49,31 +49,31 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileCraftingMonitorTile(ByteBuf data) throws IOException { - AEColor oldPaintedColor = paintedColor; - paintedColor = AEColor.values()[data.readByte()]; + AEColor oldPaintedColor = this.paintedColor; + this.paintedColor = AEColor.values()[data.readByte()]; boolean hasItem = data.readBoolean(); if ( hasItem ) - dspPlay = AEItemStack.loadItemStackFromPacket( data ); + this.dspPlay = AEItemStack.loadItemStackFromPacket( data ); else - dspPlay = null; + this.dspPlay = null; - updateList = true; - return oldPaintedColor != paintedColor; // tesr! + this.updateList = true; + return oldPaintedColor != this.paintedColor; // tesr! } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileCraftingMonitorTile(ByteBuf data) throws IOException { - data.writeByte( paintedColor.ordinal() ); + data.writeByte( this.paintedColor.ordinal() ); - if ( dspPlay == null ) + if ( this.dspPlay == null ) data.writeBoolean( false ); else { data.writeBoolean( true ); - dspPlay.writeToPacket( data ); + this.dspPlay.writeToPacket( data ); } } @@ -81,13 +81,13 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora public void readFromNBT_TileCraftingMonitorTile(NBTTagCompound data) { if ( data.hasKey( "paintedColor" ) ) - paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; + this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCraftingMonitorTile(NBTTagCompound data) { - data.setByte( "paintedColor", (byte) paintedColor.ordinal() ); + data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); } @Override @@ -104,47 +104,47 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora public void setJob(IAEItemStack is) { - if ( (is == null) != (dspPlay == null) ) + if ( (is == null) != (this.dspPlay == null) ) { - dspPlay = is == null ? null : is.copy(); - markForUpdate(); + this.dspPlay = is == null ? null : is.copy(); + this.markForUpdate(); } - else if ( is != null && dspPlay != null ) + else if ( is != null && this.dspPlay != null ) { - if ( is.getStackSize() != dspPlay.getStackSize() ) + if ( is.getStackSize() != this.dspPlay.getStackSize() ) { - dspPlay = is.copy(); - markForUpdate(); + this.dspPlay = is.copy(); + this.markForUpdate(); } } } public IAEItemStack getJobProgress() { - return dspPlay;// AEItemStack.create( new ItemStack( Items.diamond, 64 ) ); + return this.dspPlay;// AEItemStack.create( new ItemStack( Items.diamond, 64 ) ); } @Override public boolean requiresTESR() { - return getJobProgress() != null; + return this.getJobProgress() != null; } @Override public AEColor getColor() { - return paintedColor; + return this.paintedColor; } @Override public boolean recolourBlock(ForgeDirection side, AEColor newPaintedColor, EntityPlayer who) { - if ( paintedColor == newPaintedColor ) + if ( this.paintedColor == newPaintedColor ) return false; - paintedColor = newPaintedColor; - markDirty(); - markForUpdate(); + this.paintedColor = newPaintedColor; + this.markDirty(); + this.markForUpdate(); return true; } } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java index a3ccc2341..3d6adf56f 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java @@ -58,10 +58,10 @@ public class TileCraftingStorageTile extends TileCraftingTile @Override public int getStorageBytes() { - if ( worldObj == null || notLoaded() ) + if ( this.worldObj == null || this.notLoaded() ) return 0; - switch (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3) + switch (this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ) & 3) { default: case 0: diff --git a/src/main/java/appeng/tile/crafting/TileCraftingTile.java b/src/main/java/appeng/tile/crafting/TileCraftingTile.java index 7ee1d93c4..17898472c 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingTile.java @@ -68,7 +68,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP @Override protected AENetworkProxy createProxy() { - return new AENetworkProxyMultiblock( this, "proxy", getItemFromTile( this ), true ); + return new AENetworkProxyMultiblock( this, "proxy", this.getItemFromTile( this ), true ); } @Override @@ -81,58 +81,58 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP public void updateStatus(CraftingCPUCluster c) { - if ( cluster != null && cluster != c ) - cluster.breakCluster(); + if ( this.cluster != null && this.cluster != c ) + this.cluster.breakCluster(); - cluster = c; - updateMeta( true ); + this.cluster = c; + this.updateMeta( true ); } public void updateMultiBlock() { - calc.calculateMultiblock( worldObj, getLocation() ); + this.calc.calculateMultiblock( this.worldObj, this.getLocation() ); } @Override public void setName(String name) { super.setName( name ); - if ( cluster != null ) - cluster.updateName(); + if ( this.cluster != null ) + this.cluster.updateName(); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCraftingTile(NBTTagCompound data) { - data.setBoolean( "core", isCoreBlock ); - if ( isCoreBlock && cluster != null ) - cluster.writeToNBT( data ); + data.setBoolean( "core", this.isCoreBlock ); + if ( this.isCoreBlock && this.cluster != null ) + this.cluster.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileCraftingTile(NBTTagCompound data) { - isCoreBlock = data.getBoolean( "core" ); - if ( isCoreBlock ) + this.isCoreBlock = data.getBoolean( "core" ); + if ( this.isCoreBlock ) { - if ( cluster != null ) - cluster.readFromNBT( data ); + if ( this.cluster != null ) + this.cluster.readFromNBT( data ); else - previousState = (NBTTagCompound) data.copy(); + this.previousState = (NBTTagCompound) data.copy(); } } public TileCraftingTile() { - gridProxy.setFlags( GridFlags.MULTIBLOCK, GridFlags.REQUIRE_CHANNEL ); - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags( GridFlags.MULTIBLOCK, GridFlags.REQUIRE_CHANNEL ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override public void onReady() { super.onReady(); - gridProxy.setVisualRepresentation( getItemFromTile( this ) ); - updateMultiBlock(); + this.gridProxy.setVisualRepresentation( this.getItemFromTile( this ) ); + this.updateMultiBlock(); } @Override @@ -145,56 +145,56 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP @Override public void disconnect(boolean update) { - if ( cluster != null ) + if ( this.cluster != null ) { - cluster.destroy(); + this.cluster.destroy(); if ( update ) - updateMeta( true ); + this.updateMeta( true ); } } @MENetworkEventSubscribe public void onPowerStateChange(MENetworkChannelsChanged ev) { - updateMeta( false ); + this.updateMeta( false ); } @MENetworkEventSubscribe public void onPowerStateChange(MENetworkPowerStatusChange ev) { - updateMeta( false ); + this.updateMeta( false ); } public void updateMeta(boolean updateFormed) { - if ( worldObj == null || notLoaded() ) + if ( this.worldObj == null || this.notLoaded() ) return; - boolean formed = isFormed(); + boolean formed = this.isFormed(); boolean power = false; - if ( gridProxy.isReady() ) - power = gridProxy.isActive(); + if ( this.gridProxy.isReady() ) + power = this.gridProxy.isActive(); - int current = worldObj.getBlockMetadata( xCoord, yCoord, zCoord ); + int current = this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ); int newMeta = (current & 3) | (formed ? 8 : 0) | (power ? 4 : 0); if ( current != newMeta ) - worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, newMeta, 2 ); + this.worldObj.setBlockMetadataWithNotify( this.xCoord, this.yCoord, this.zCoord, newMeta, 2 ); if ( updateFormed ) { if ( formed ) - gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); + this.gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); else - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } } @Override public IAECluster getCluster() { - return cluster; + return this.cluster; } @Override @@ -207,22 +207,22 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP public boolean isPowered() { if ( Platform.isClient() ) - return (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 4) == 4; - return gridProxy.isActive(); + return (this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ) & 4) == 4; + return this.gridProxy.isActive(); } public boolean isFormed() { if ( Platform.isClient() ) - return (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 8) == 8; - return cluster != null; + return (this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ) & 8) == 8; + return this.cluster != null; } public boolean isAccelerator() { - if ( worldObj == null ) + if ( this.worldObj == null ) return false; - return (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3) == 1; + return (this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ) & 3) == 1; } public boolean isStatus() @@ -244,20 +244,20 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP public boolean isActive() { if ( Platform.isServer() ) - return gridProxy.isActive(); - return isPowered() && isFormed(); + return this.gridProxy.isActive(); + return this.isPowered() && this.isFormed(); } public void breakCluster() { - if ( cluster != null ) + if ( this.cluster != null ) { - cluster.cancel(); - IMEInventory inv = cluster.getInventory(); + this.cluster.cancel(); + IMEInventory inv = this.cluster.getInventory(); LinkedList places = new LinkedList(); - Iterator i = cluster.getTiles(); + Iterator i = this.cluster.getTiles(); while (i.hasNext()) { IGridHost h = i.next(); @@ -271,7 +271,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP { WorldCoord wc = new WorldCoord( te ); wc.add( d, 1 ); - if ( worldObj.isAirBlock( wc.x, wc.y, wc.z ) ) + if ( this.worldObj.isAirBlock( wc.x, wc.y, wc.z ) ) places.add( wc ); } @@ -289,19 +289,19 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP ais.setStackSize( ais.getItemStack().getMaxStackSize() ); while (true) { - IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, cluster.getActionSource() ); + IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, this.cluster.getActionSource() ); if ( g == null ) break; WorldCoord wc = places.poll(); places.add( wc ); - Platform.spawnDrops( worldObj, wc.x, wc.y, wc.z, Collections.singletonList( g.getItemStack() ) ); + Platform.spawnDrops( this.worldObj, wc.x, wc.y, wc.z, Collections.singletonList( g.getItemStack() ) ); } } - cluster.destroy(); + this.cluster.destroy(); } } } diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index 3bdd5a68a..b150cab23 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -81,7 +81,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private final InventoryCrafting craftingInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 9 + 2 ); private final IConfigManager settings = new ConfigManager( this ); - private final UpgradeInventory upgrades = new UpgradeInventory( assemblerStack, this, getUpgradeSlots() ); + private final UpgradeInventory upgrades = new UpgradeInventory( assemblerStack, this, this.getUpgradeSlots() ); private ForgeDirection pushDirection = ForgeDirection.UNKNOWN; private ItemStack myPattern = null; @@ -96,23 +96,23 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table, ForgeDirection where) { - if ( myPattern == null ) + if ( this.myPattern == null ) { boolean isEmpty = true; - for (int x = 0; x < inv.getSizeInventory(); x++) - isEmpty = inv.getStackInSlot( x ) == null && isEmpty; + for (int x = 0; x < this.inv.getSizeInventory(); x++) + isEmpty = this.inv.getStackInSlot( x ) == null && isEmpty; if ( isEmpty && patternDetails.isCraftable() ) { - forcePlan = true; - myPlan = patternDetails; - pushDirection = where; + this.forcePlan = true; + this.myPlan = patternDetails; + this.pushDirection = where; for (int x = 0; x < table.getSizeInventory(); x++) - inv.setInventorySlotContents( x, table.getStackInSlot( x ) ); + this.inv.setInventorySlotContents( x, table.getStackInSlot( x ) ); - updateSleepiness(); - markDirty(); + this.updateSleepiness(); + this.markDirty(); return true; } } @@ -121,53 +121,53 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private void recalculatePlan() { - reboot = true; + this.reboot = true; - if ( forcePlan ) + if ( this.forcePlan ) return; - ItemStack is = inv.getStackInSlot( 10 ); + ItemStack is = this.inv.getStackInSlot( 10 ); if ( is != null && is.getItem() instanceof ItemEncodedPattern ) { - if ( !Platform.isSameItem( is, myPattern ) ) + if ( !Platform.isSameItem( is, this.myPattern ) ) { - World w = getWorldObj(); + World w = this.getWorldObj(); ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); if ( ph != null && ph.isCraftable() ) { - progress = 0; - myPattern = is; - myPlan = ph; + this.progress = 0; + this.myPattern = is; + this.myPlan = ph; } } } else { - progress = 0; - forcePlan = false; - myPlan = null; - myPattern = null; - pushDirection = ForgeDirection.UNKNOWN; + this.progress = 0; + this.forcePlan = false; + this.myPlan = null; + this.myPattern = null; + this.pushDirection = ForgeDirection.UNKNOWN; } - updateSleepiness(); + this.updateSleepiness(); } private void updateSleepiness() { - boolean wasEnabled = isAwake; - isAwake = myPlan != null && hasMats() || canPush(); - if ( wasEnabled != isAwake ) + boolean wasEnabled = this.isAwake; + this.isAwake = this.myPlan != null && this.hasMats() || this.canPush(); + if ( wasEnabled != this.isAwake ) { try { - if ( isAwake ) - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + if ( this.isAwake ) + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); else - gridProxy.getTick().sleepDevice( gridProxy.getNode() ); + this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -178,13 +178,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private boolean canPush() { - return inv.getStackInSlot( 9 ) != null; + return this.inv.getStackInSlot( 9 ) != null; } @Override public int getInstalledUpgrades(Upgrades u) { - return upgrades.getInstalledUpgrades( u ); + return this.upgrades.getInstalledUpgrades( u ); } protected int getUpgradeSlots() @@ -195,35 +195,35 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileMolecularAssembler(ByteBuf data) { - boolean oldPower = isPowered; - isPowered = data.readBoolean(); - return isPowered != oldPower; + boolean oldPower = this.isPowered; + this.isPowered = data.readBoolean(); + return this.isPowered != oldPower; } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileMolecularAssembler(ByteBuf data) { - data.writeBoolean( isPowered ); + data.writeBoolean( this.isPowered ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileMolecularAssembler(NBTTagCompound data) { - if ( forcePlan && myPlan != null ) + if ( this.forcePlan && this.myPlan != null ) { - ItemStack pattern = myPlan.getPattern(); + ItemStack pattern = this.myPlan.getPattern(); if ( pattern != null ) { NBTTagCompound compound = new NBTTagCompound(); pattern.writeToNBT( compound ); data.setTag( "myPlan", compound ); - data.setInteger( "pushDirection", pushDirection.ordinal() ); + data.setInteger( "pushDirection", this.pushDirection.ordinal() ); } } - upgrades.writeToNBT( data, "upgrades" ); - inv.writeToNBT( data, "inv" ); - settings.writeToNBT( data ); + this.upgrades.writeToNBT( data, "upgrades" ); + this.inv.writeToNBT( data, "inv" ); + this.settings.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) @@ -235,28 +235,28 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade if ( myPat != null && myPat.getItem() instanceof ItemEncodedPattern ) { - World w = getWorldObj(); + World w = this.getWorldObj(); ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem(); ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w ); if ( ph != null && ph.isCraftable() ) { - forcePlan = true; - myPlan = ph; - pushDirection = ForgeDirection.getOrientation( data.getInteger( "pushDirection" ) ); + this.forcePlan = true; + this.myPlan = ph; + this.pushDirection = ForgeDirection.getOrientation( data.getInteger( "pushDirection" ) ); } } } - upgrades.readFromNBT( data, "upgrades" ); - inv.readFromNBT( data, "inv" ); - settings.readFromNBT( data ); - recalculatePlan(); + this.upgrades.readFromNBT( data, "upgrades" ); + this.inv.readFromNBT( data, "inv" ); + this.settings.readFromNBT( data ); + this.recalculatePlan(); } public TileMolecularAssembler() { - settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - inv.setMaxStackSize( 1 ); - gridProxy.setIdlePowerUsage( 0.0 ); + this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.inv.setMaxStackSize( 1 ); + this.gridProxy.setIdlePowerUsage( 0.0 ); } @Override @@ -265,8 +265,8 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade if ( i >= 9 ) return false; - if ( hasPattern() ) - return myPlan.isValidItemForSlot( i, itemstack, getWorldObj() ); + if ( this.hasPattern() ) + return this.myPlan.isValidItemForSlot( i, itemstack, this.getWorldObj() ); return false; } @@ -274,12 +274,12 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public boolean acceptsPlans() { - return inv.getStackInSlot( 10 ) == null; + return this.inv.getStackInSlot( 10 ) == null; } private boolean hasPattern() { - return myPlan != null && inv.getStackInSlot( 10 ) != null; + return this.myPlan != null && this.inv.getStackInSlot( 10 ) != null; } @Override @@ -291,14 +291,14 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { if ( inv == this.inv ) - recalculatePlan(); + this.recalculatePlan(); } @Override @@ -322,17 +322,17 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public IConfigManager getConfigManager() { - return settings; + return this.settings; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "upgrades" ) ) - return upgrades; + return this.upgrades; if ( name.equals( "mac" ) ) - return inv; + return this.inv; return null; } @@ -351,7 +351,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade public int getCraftingProgress() { - return (int) progress; + return (int) this.progress; } @Override @@ -359,9 +359,9 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { super.getDrops( w, x, y, z, drops ); - for (int h = 0; h < upgrades.getSizeInventory(); h++) + for (int h = 0; h < this.upgrades.getSizeInventory(); h++) { - ItemStack is = upgrades.getStackInSlot( h ); + ItemStack is = this.upgrades.getStackInSlot( h ); if ( is != null ) drops.add( is ); } @@ -370,114 +370,114 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public TickingRequest getTickingRequest(IGridNode node) { - recalculatePlan(); - updateSleepiness(); - return new TickingRequest( 1, 1, !isAwake, false ); + this.recalculatePlan(); + this.updateSleepiness(); + return new TickingRequest( 1, 1, !this.isAwake, false ); } private boolean hasMats() { - if ( myPlan == null ) + if ( this.myPlan == null ) return false; - for (int x = 0; x < craftingInv.getSizeInventory(); x++) - craftingInv.setInventorySlotContents( x, inv.getStackInSlot( x ) ); + for (int x = 0; x < this.craftingInv.getSizeInventory(); x++) + this.craftingInv.setInventorySlotContents( x, this.inv.getStackInSlot( x ) ); - return myPlan.getOutput( craftingInv, getWorldObj() ) != null; + return this.myPlan.getOutput( this.craftingInv, this.getWorldObj() ) != null; } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( inv.getStackInSlot( 9 ) != null ) + if ( this.inv.getStackInSlot( 9 ) != null ) { - pushOut( inv.getStackInSlot( 9 ) ); + this.pushOut( this.inv.getStackInSlot( 9 ) ); // did it eject? - if ( inv.getStackInSlot( 9 ) == null ) - markDirty(); + if ( this.inv.getStackInSlot( 9 ) == null ) + this.markDirty(); - ejectHeldItems(); - updateSleepiness(); - progress = 0; - return isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP; + this.ejectHeldItems(); + this.updateSleepiness(); + this.progress = 0; + return this.isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP; } - if ( myPlan == null ) + if ( this.myPlan == null ) { - updateSleepiness(); + this.updateSleepiness(); return TickRateModulation.SLEEP; } - if ( reboot ) + if ( this.reboot ) TicksSinceLastCall = 1; - if ( !isAwake ) + if ( !this.isAwake ) return TickRateModulation.SLEEP; - reboot = false; + this.reboot = false; int speed = 10; - switch (upgrades.getInstalledUpgrades( Upgrades.SPEED )) + switch (this.upgrades.getInstalledUpgrades( Upgrades.SPEED )) { case 0: - progress += userPower( TicksSinceLastCall, speed = 10, 1.0 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 10, 1.0 ); break; case 1: - progress += userPower( TicksSinceLastCall, speed = 13, 1.3 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 13, 1.3 ); break; case 2: - progress += userPower( TicksSinceLastCall, speed = 17, 1.7 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 17, 1.7 ); break; case 3: - progress += userPower( TicksSinceLastCall, speed = 20, 2.0 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 20, 2.0 ); break; case 4: - progress += userPower( TicksSinceLastCall, speed = 25, 2.5 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 25, 2.5 ); break; case 5: - progress += userPower( TicksSinceLastCall, speed = 50, 5.0 ); + this.progress += this.userPower( TicksSinceLastCall, speed = 50, 5.0 ); break; } - if ( progress >= 100 ) + if ( this.progress >= 100 ) { - for (int x = 0; x < craftingInv.getSizeInventory(); x++) - craftingInv.setInventorySlotContents( x, inv.getStackInSlot( x ) ); + for (int x = 0; x < this.craftingInv.getSizeInventory(); x++) + this.craftingInv.setInventorySlotContents( x, this.inv.getStackInSlot( x ) ); - progress = 0; - ItemStack output = myPlan.getOutput( craftingInv, getWorldObj() ); + this.progress = 0; + ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorldObj() ); if ( output != null ) { - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) getWorldObj() ), output, craftingInv ); + FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorldObj() ), output, this.craftingInv ); - pushOut( output.copy() ); + this.pushOut( output.copy() ); - for (int x = 0; x < craftingInv.getSizeInventory(); x++) - inv.setInventorySlotContents( x, Platform.getContainerItem( craftingInv.getStackInSlot( x ) ) ); + for (int x = 0; x < this.craftingInv.getSizeInventory(); x++) + this.inv.setInventorySlotContents( x, Platform.getContainerItem( this.craftingInv.getStackInSlot( x ) ) ); - if ( inv.getStackInSlot( 10 ) == null ) + if ( this.inv.getStackInSlot( 10 ) == null ) { - forcePlan = false; - myPlan = null; - pushDirection = ForgeDirection.UNKNOWN; + this.forcePlan = false; + this.myPlan = null; + this.pushDirection = ForgeDirection.UNKNOWN; } - ejectHeldItems(); + this.ejectHeldItems(); try { - TargetPoint where = new TargetPoint( worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32 ); + TargetPoint where = new TargetPoint( this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32 ); IAEItemStack item = AEItemStack.create( output ); - NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( xCoord, yCoord, zCoord, (byte) speed, item ), where ); + NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( this.xCoord, this.yCoord, this.zCoord, (byte) speed, item ), where ); } catch (IOException e) { // ;P } - markDirty(); - updateSleepiness(); - return isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP; + this.markDirty(); + this.updateSleepiness(); + return this.isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP; } } @@ -486,18 +486,18 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private void ejectHeldItems() { - if ( inv.getStackInSlot( 9 ) == null ) + if ( this.inv.getStackInSlot( 9 ) == null ) { for (int x = 0; x < 9; x++) { - ItemStack is = inv.getStackInSlot( x ); + ItemStack is = this.inv.getStackInSlot( x ); if ( is != null ) { - if ( myPlan == null || !myPlan.isValidItemForSlot( x, is, worldObj ) ) + if ( this.myPlan == null || !this.myPlan.isValidItemForSlot( x, is, this.worldObj ) ) { - inv.setInventorySlotContents( 9, is ); - inv.setInventorySlotContents( x, null ); - markDirty(); + this.inv.setInventorySlotContents( 9, is ); + this.inv.setInventorySlotContents( x, null ); + this.markDirty(); return; } } @@ -509,7 +509,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { try { - return (int) (gridProxy.getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE, PowerMultiplier.CONFIG ) / acceleratorTax); + return (int) (this.gridProxy.getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE, PowerMultiplier.CONFIG ) / acceleratorTax); } catch (GridAccessException e) { @@ -519,21 +519,21 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private void pushOut(ItemStack output) { - if ( pushDirection == ForgeDirection.UNKNOWN ) + if ( this.pushDirection == ForgeDirection.UNKNOWN ) { for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) - output = pushTo( output, d ); + output = this.pushTo( output, d ); } else - output = pushTo( output, pushDirection ); + output = this.pushTo( output, this.pushDirection ); - if ( output == null && forcePlan ) + if ( output == null && this.forcePlan ) { - forcePlan = false; - recalculatePlan(); + this.forcePlan = false; + this.recalculatePlan(); } - inv.setInventorySlotContents( 9, output ); + this.inv.setInventorySlotContents( 9, output ); } private ItemStack pushTo(ItemStack output, ForgeDirection d) @@ -541,7 +541,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade if ( output == null ) return output; - TileEntity te = getWorldObj().getTileEntity( xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ ); + TileEntity te = this.getWorldObj().getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); if ( te == null ) return output; @@ -556,7 +556,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade int newSize = output == null ? 0 : output.stackSize; if ( size != newSize ) - markDirty(); + this.markDirty(); return output; } @@ -566,7 +566,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @MENetworkEventSubscribe public void onPowerEvent(MENetworkPowerStatusChange p) { - updatePowerState(); + this.updatePowerState(); } private void updatePowerState() @@ -575,30 +575,30 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade try { - newState = gridProxy.isActive() && gridProxy.getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001; + newState = this.gridProxy.isActive() && this.gridProxy.getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001; } catch (GridAccessException ignored) { } - if ( newState != isPowered ) + if ( newState != this.isPowered ) { - isPowered = newState; - markForUpdate(); + this.isPowered = newState; + this.markForUpdate(); } } @Override public boolean isPowered() { - return isPowered; + return this.isPowered; } @Override public boolean isActive() { - return isPowered; + return this.isPowered; } } diff --git a/src/main/java/appeng/tile/events/AETileEventHandler.java b/src/main/java/appeng/tile/events/AETileEventHandler.java index 3328b67c9..0bee5c429 100644 --- a/src/main/java/appeng/tile/events/AETileEventHandler.java +++ b/src/main/java/appeng/tile/events/AETileEventHandler.java @@ -39,7 +39,7 @@ public class AETileEventHandler public AETileEventHandler( Method m, TileEventType which ) { - method = m; + this.method = m; } // TICK @@ -47,7 +47,7 @@ public class AETileEventHandler { try { - method.invoke( tile ); + this.method.invoke( tile ); } catch ( IllegalAccessException e ) { @@ -68,7 +68,7 @@ public class AETileEventHandler { try { - method.invoke( tile, data ); + this.method.invoke( tile, data ); } catch ( IllegalAccessException e ) { @@ -89,7 +89,7 @@ public class AETileEventHandler { try { - method.invoke( tile, data ); + this.method.invoke( tile, data ); } catch ( IllegalAccessException e ) { @@ -110,7 +110,7 @@ public class AETileEventHandler { try { - method.invoke( tile, data ); + this.method.invoke( tile, data ); } catch ( IllegalAccessException e ) { @@ -138,7 +138,7 @@ public class AETileEventHandler { try { - return ( Boolean ) method.invoke( tile, data ); + return ( Boolean ) this.method.invoke( tile, data ); } catch ( IllegalAccessException e ) { diff --git a/src/main/java/appeng/tile/grid/AENetworkInvTile.java b/src/main/java/appeng/tile/grid/AENetworkInvTile.java index 7f66c54b6..d6cad4a95 100644 --- a/src/main/java/appeng/tile/grid/AENetworkInvTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkInvTile.java @@ -34,55 +34,55 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_AENetwork(NBTTagCompound data) { - gridProxy.readFromNBT( data ); + this.gridProxy.readFromNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_AENetwork(NBTTagCompound data) { - gridProxy.writeToNBT( data ); + this.gridProxy.writeToNBT( data ); } - protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", getItemFromTile( this ), true ); + protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @Override public AENetworkProxy getProxy() { - return gridProxy; + return this.gridProxy; } @Override public IGridNode getGridNode(ForgeDirection dir) { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } @Override public void onReady() { super.onReady(); - gridProxy.onReady(); + this.gridProxy.onReady(); } @Override public void onChunkUnload() { super.onChunkUnload(); - gridProxy.onChunkUnload(); + this.gridProxy.onChunkUnload(); } @Override public void validate() { super.validate(); - gridProxy.validate(); + this.gridProxy.validate(); } @Override public void invalidate() { super.invalidate(); - gridProxy.invalidate(); + this.gridProxy.invalidate(); } @Override @@ -94,6 +94,6 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH @Override public IGridNode getActionableNode() { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } } diff --git a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java index 209e298cd..50791020a 100644 --- a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java @@ -36,21 +36,21 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_AENetwork(NBTTagCompound data) { - gridProxy.readFromNBT( data ); + this.gridProxy.readFromNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_AENetwork(NBTTagCompound data) { - gridProxy.writeToNBT( data ); + this.gridProxy.writeToNBT( data ); } - protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", getItemFromTile( this ), true ); + protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @Override public AENetworkProxy getProxy() { - return gridProxy; + return this.gridProxy; } @Override @@ -68,35 +68,35 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA @Override public IGridNode getGridNode(ForgeDirection dir) { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } @Override public void onReady() { super.onReady(); - gridProxy.onReady(); + this.gridProxy.onReady(); } @Override public void onChunkUnload() { super.onChunkUnload(); - gridProxy.onChunkUnload(); + this.gridProxy.onChunkUnload(); } @Override public void validate() { super.validate(); - gridProxy.validate(); + this.gridProxy.validate(); } @Override public void invalidate() { super.invalidate(); - gridProxy.invalidate(); + this.gridProxy.invalidate(); } @Override @@ -108,6 +108,6 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA @Override public IGridNode getActionableNode() { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } } diff --git a/src/main/java/appeng/tile/grid/AENetworkTile.java b/src/main/java/appeng/tile/grid/AENetworkTile.java index 0bd2fc837..59ab9c6a2 100644 --- a/src/main/java/appeng/tile/grid/AENetworkTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkTile.java @@ -36,54 +36,54 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_AENetwork(NBTTagCompound data) { - gridProxy.readFromNBT( data ); + this.gridProxy.readFromNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_AENetwork(NBTTagCompound data) { - gridProxy.writeToNBT( data ); + this.gridProxy.writeToNBT( data ); } - final protected AENetworkProxy gridProxy = createProxy(); + final protected AENetworkProxy gridProxy = this.createProxy(); protected AENetworkProxy createProxy() { - return new AENetworkProxy( this, "proxy", getItemFromTile( this ), true ); + return new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); } @Override public IGridNode getGridNode(ForgeDirection dir) { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } @Override public void onReady() { super.onReady(); - gridProxy.onReady(); + this.gridProxy.onReady(); } @Override public void onChunkUnload() { super.onChunkUnload(); - gridProxy.onChunkUnload(); + this.gridProxy.onChunkUnload(); } @Override public void validate() { super.validate(); - gridProxy.validate(); + this.gridProxy.validate(); } @Override public void invalidate() { super.invalidate(); - gridProxy.invalidate(); + this.gridProxy.invalidate(); } @Override @@ -107,12 +107,12 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy @Override public AENetworkProxy getProxy() { - return gridProxy; + return this.gridProxy; } @Override public IGridNode getActionableNode() { - return gridProxy.getNode(); + return this.gridProxy.getNode(); } } diff --git a/src/main/java/appeng/tile/grindstone/TileCrank.java b/src/main/java/appeng/tile/grindstone/TileCrank.java index f2d7ed716..fa4dc1041 100644 --- a/src/main/java/appeng/tile/grindstone/TileCrank.java +++ b/src/main/java/appeng/tile/grindstone/TileCrank.java @@ -52,33 +52,33 @@ public class TileCrank extends AEBaseTile implements ICustomCollision @TileEvent(TileEventType.TICK) public void Tick_TileCrank() { - if ( rotation > 0 ) + if ( this.rotation > 0 ) { - visibleRotation -= 360 / (ticksPerRotation); - charge++; - if ( charge >= ticksPerRotation ) + this.visibleRotation -= 360 / (this.ticksPerRotation); + this.charge++; + if ( this.charge >= this.ticksPerRotation ) { - charge -= ticksPerRotation; - ICrankable g = getGrinder(); + this.charge -= this.ticksPerRotation; + ICrankable g = this.getGrinder(); if ( g != null ) g.applyTurn(); } - rotation--; + this.rotation--; } } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileCrank(ByteBuf data) { - rotation = data.readInt(); + this.rotation = data.readInt(); return false; } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileCrank(ByteBuf data) { - data.writeInt( rotation ); + data.writeInt( this.rotation ); } public ICrankable getGrinder() @@ -86,8 +86,8 @@ public class TileCrank extends AEBaseTile implements ICustomCollision if ( Platform.isClient() ) return null; - ForgeDirection grinder = getUp().getOpposite(); - TileEntity te = worldObj.getTileEntity( xCoord + grinder.offsetX, yCoord + grinder.offsetY, zCoord + grinder.offsetZ ); + ForgeDirection grinder = this.getUp().getOpposite(); + TileEntity te = this.worldObj.getTileEntity( this.xCoord + grinder.offsetX, this.yCoord + grinder.offsetY, this.zCoord + grinder.offsetZ ); if ( te instanceof ICrankable ) return (ICrankable) te; return null; @@ -97,7 +97,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { super.setOrientation( inForward, inUp ); - getBlockType().onNeighborBlockChange( worldObj, xCoord, yCoord, zCoord, Platform.air ); + this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.air ); } /** @@ -108,24 +108,24 @@ public class TileCrank extends AEBaseTile implements ICustomCollision if ( Platform.isClient() ) return false; - if ( rotation < 3 ) + if ( this.rotation < 3 ) { - ICrankable g = getGrinder(); + ICrankable g = this.getGrinder(); if ( g != null ) { if ( g.canTurn() ) { - hits = 0; - rotation += ticksPerRotation; + this.hits = 0; + this.rotation += this.ticksPerRotation; this.markForUpdate(); return true; } else { - hits++; - if ( hits > 10 ) + this.hits++; + if ( this.hits > 10 ) { - worldObj.func_147480_a( xCoord, yCoord, zCoord, false ); + this.worldObj.func_147480_a( this.xCoord, this.yCoord, this.zCoord, false ); // worldObj.destroyBlock( xCoord, yCoord, zCoord, false ); } } @@ -138,18 +138,18 @@ public class TileCrank extends AEBaseTile implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - double xOff = -0.15 * getUp().offsetX; - double yOff = -0.15 * getUp().offsetY; - double zOff = -0.15 * getUp().offsetZ; + double xOff = -0.15 * this.getUp().offsetX; + double yOff = -0.15 * this.getUp().offsetY; + double zOff = -0.15 * this.getUp().offsetZ; return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } @Override public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e) { - double xOff = -0.15 * getUp().offsetX; - double yOff = -0.15 * getUp().offsetY; - double zOff = -0.15 * getUp().offsetZ; + double xOff = -0.15 * this.getUp().offsetX; + double yOff = -0.15 * this.getUp().offsetY; + double zOff = -0.15 * this.getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15,// ahh xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } diff --git a/src/main/java/appeng/tile/grindstone/TileGrinder.java b/src/main/java/appeng/tile/grindstone/TileGrinder.java index e2286fabe..68a3623c5 100644 --- a/src/main/java/appeng/tile/grindstone/TileGrinder.java +++ b/src/main/java/appeng/tile/grindstone/TileGrinder.java @@ -48,7 +48,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { super.setOrientation( inForward, inUp ); - getBlockType().onNeighborBlockChange( worldObj, xCoord, yCoord, zCoord, Platform.air ); + this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.air ); } private void addItem(InventoryAdaptor sia, ItemStack output) @@ -59,14 +59,14 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable ItemStack notAdded = sia.addItems( output ); if ( notAdded != null ) { - WorldCoord wc = new WorldCoord( xCoord, yCoord, zCoord ); + WorldCoord wc = new WorldCoord( this.xCoord, this.yCoord, this.zCoord ); - wc.add( getForward(), 1 ); + wc.add( this.getForward(), 1 ); List out = new ArrayList(); out.add( notAdded ); - Platform.spawnDrops( worldObj, wc.x, wc.y, wc.z, out ); + Platform.spawnDrops( this.worldObj, wc.x, wc.y, wc.z, out ); } } @@ -88,13 +88,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } @Override @@ -111,7 +111,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable if ( null == this.getStackInSlot( 6 ) ) // Add if there isn't one... { - IInventory src = new WrapperInventoryRange( this, inputs, true ); + IInventory src = new WrapperInventoryRange( this, this.inputs, true ); for (int x = 0; x < src.getSizeInventory(); x++) { ItemStack item = src.getStackInSlot( x ); @@ -147,27 +147,27 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable if ( Platform.isClient() ) return; - points++; + this.points++; ItemStack processing = this.getStackInSlot( 6 ); IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing ); if ( r != null ) { - if ( r.getEnergyCost() > points ) + if ( r.getEnergyCost() > this.points ) return; - points = 0; + this.points = 0; InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), ForgeDirection.EAST ); - addItem( sia, r.getOutput() ); + this.addItem( sia, r.getOutput() ); float chance = (Platform.getRandomInt() % 2000) / 2000.0f; if ( chance <= r.getOptionalChance() ) - addItem( sia, r.getOptionalOutput() ); + this.addItem( sia, r.getOptionalOutput() ); chance = (Platform.getRandomInt() % 2000) / 2000.0f; if ( chance <= r.getSecondOptionalChance() ) - addItem( sia, r.getSecondOptionalOutput() ); + this.addItem( sia, r.getSecondOptionalOutput() ); this.setInventorySlotContents( 6, null ); } @@ -176,7 +176,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable @Override public boolean canCrankAttach(ForgeDirection directionToCrank) { - return getUp().equals( directionToCrank ); + return this.getUp().equals( directionToCrank ); } } diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java index 523ee4dee..232984be5 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java @@ -43,57 +43,57 @@ public class AppEngInternalAEInventory implements IInventory, Iterable= split.stackSize ) { - ns = getStackInSlot( slot ); - inv[slot] = null; + ns = this.getStackInSlot( slot ); + this.inv[slot] = null; } else ns = split.splitStack( qty ); - if ( te != null && Platform.isServer() ) + if ( this.te != null && Platform.isServer() ) { - te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null ); + this.te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null ); } return ns; @@ -111,10 +111,10 @@ public class AppEngInternalAEInventory implements IInventory, Iterable 64 ? 64 : maxStack; + return this.maxStack > 64 ? 64 : this.maxStack; } @Override @@ -176,15 +176,15 @@ public class AppEngInternalAEInventory implements IInventory, Iterable public boolean isEmpty() { - for (int x = 0; x < getSizeInventory(); x++) - if ( getStackInSlot( x ) != null ) + for (int x = 0; x < this.getSizeInventory(); x++) + if ( this.getStackInSlot( x ) != null ) return false; return true; } public AppEngInternalInventory(IAEAppEngInventory _te, int s) { - te = _te; - size = s; - maxStack = 64; - inv = new ItemStack[s]; + this.te = _te; + this.size = s; + this.maxStack = 64; + this.inv = new ItemStack[s]; } protected boolean eventsEnabled() { - return Platform.isServer() || enableClientEvents; + return Platform.isServer() || this.enableClientEvents; } public void setMaxStackSize(int s) { - maxStack = s; + this.maxStack = s; } @Override public ItemStack getStackInSlot(int var1) { - return inv[var1]; + return this.inv[var1]; } @Override public ItemStack decrStackSize(int slot, int qty) { - if ( inv[slot] != null ) + if ( this.inv[slot] != null ) { - ItemStack split = getStackInSlot( slot ); + ItemStack split = this.getStackInSlot( slot ); ItemStack ns = null; if ( qty >= split.stackSize ) { - ns = inv[slot]; - inv[slot] = null; + ns = this.inv[slot]; + this.inv[slot] = null; } else ns = split.splitStack( qty ); - if ( te != null && eventsEnabled() ) + if ( this.te != null && this.eventsEnabled() ) { - te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null ); + this.te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null ); } - markDirty(); + this.markDirty(); return ns; } @@ -113,10 +113,10 @@ public class AppEngInternalInventory implements IInventory, Iterable @Override public void setInventorySlotContents(int slot, ItemStack newItemStack) { - ItemStack oldStack = inv[slot]; - inv[slot] = newItemStack; + ItemStack oldStack = this.inv[slot]; + this.inv[slot] = newItemStack; - if ( te != null && eventsEnabled() ) + if ( this.te != null && this.eventsEnabled() ) { ItemStack removed = oldStack; ItemStack added = newItemStack; @@ -141,34 +141,34 @@ public class AppEngInternalInventory implements IInventory, Iterable } } - te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added ); + this.te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added ); - markDirty(); + this.markDirty(); } } @Override public void markDirty() { - if ( te != null && eventsEnabled() ) + if ( this.te != null && this.eventsEnabled() ) { - te.onChangeInventory( this, -1, InvOperation.markDirty, null, null ); + this.te.onChangeInventory( this, -1, InvOperation.markDirty, null, null ); } } // for guis... public void markDirty(int slotIndex) { - if ( te != null && eventsEnabled() ) + if ( this.te != null && this.eventsEnabled() ) { - te.onChangeInventory( this, slotIndex, InvOperation.markDirty, null, null ); + this.te.onChangeInventory( this, slotIndex, InvOperation.markDirty, null, null ); } } @Override public int getInventoryStackLimit() { - return maxStack > 64 ? 64 : maxStack; + return this.maxStack > 64 ? 64 : this.maxStack; } @Override @@ -189,15 +189,15 @@ public class AppEngInternalInventory implements IInventory, Iterable public void writeToNBT(NBTTagCompound target) { - for (int x = 0; x < size; x++) + for (int x = 0; x < this.size; x++) { try { NBTTagCompound c = new NBTTagCompound(); - if ( inv[x] != null ) + if ( this.inv[x] != null ) { - inv[x].writeToNBT( c ); + this.inv[x].writeToNBT( c ); } target.setTag( "#" + x, c ); @@ -210,14 +210,14 @@ public class AppEngInternalInventory implements IInventory, Iterable public void readFromNBT(NBTTagCompound target) { - for (int x = 0; x < size; x++) + for (int x = 0; x < this.size; x++) { try { NBTTagCompound c = target.getCompoundTag( "#" + x ); if ( c != null ) - inv[x] = ItemStack.loadItemStackFromNBT( c ); + this.inv[x] = ItemStack.loadItemStackFromNBT( c ); } catch (Exception e) @@ -230,7 +230,7 @@ public class AppEngInternalInventory implements IInventory, Iterable public void writeToNBT(NBTTagCompound data, String name) { NBTTagCompound c = new NBTTagCompound(); - writeToNBT( c ); + this.writeToNBT( c ); data.setTag( name, c ); } @@ -238,13 +238,13 @@ public class AppEngInternalInventory implements IInventory, Iterable { NBTTagCompound c = data.getCompoundTag( name ); if ( c != null ) - readFromNBT( c ); + this.readFromNBT( c ); } @Override public int getSizeInventory() { - return size; + return this.size; } @Override diff --git a/src/main/java/appeng/tile/misc/TileCellWorkbench.java b/src/main/java/appeng/tile/misc/TileCellWorkbench.java index d8af1de5d..0fbef68aa 100644 --- a/src/main/java/appeng/tile/misc/TileCellWorkbench.java +++ b/src/main/java/appeng/tile/misc/TileCellWorkbench.java @@ -52,9 +52,9 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I public IInventory getCellUpgradeInventory() { - if ( cacheUpgrades == null ) + if ( this.cacheUpgrades == null ) { - ICellWorkbenchItem cell = getCell(); + ICellWorkbenchItem cell = this.getCell(); if ( cell == null ) return null; @@ -66,16 +66,16 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I if ( inv == null ) return null; - return cacheUpgrades = inv; + return this.cacheUpgrades = inv; } - return cacheUpgrades; + return this.cacheUpgrades; } public IInventory getCellConfigInventory() { - if ( cacheConfig == null ) + if ( this.cacheConfig == null ) { - ICellWorkbenchItem cell = getCell(); + ICellWorkbenchItem cell = this.getCell(); if ( cell == null ) return null; @@ -87,40 +87,40 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I if ( inv == null ) return null; - return cacheConfig = inv; + return this.cacheConfig = inv; } - return cacheConfig; + return this.cacheConfig; } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCellWorkbench(NBTTagCompound data) { - cell.writeToNBT( data, "cell" ); - config.writeToNBT( data, "config" ); - cm.writeToNBT( data ); + this.cell.writeToNBT( data, "cell" ); + this.config.writeToNBT( data, "config" ); + this.cm.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileCellWorkbench(NBTTagCompound data) { - cell.readFromNBT( data, "cell" ); - config.readFromNBT( data, "config" ); - cm.readFromNBT( data ); + this.cell.readFromNBT( data, "cell" ); + this.config.readFromNBT( data, "config" ); + this.cm.readFromNBT( data ); } public TileCellWorkbench() { - cm.registerSetting( Settings.COPY_MODE, CopyMode.CLEAR_ON_REMOVE ); - cell.enableClientEvents = true; + this.cm.registerSetting( Settings.COPY_MODE, CopyMode.CLEAR_ON_REMOVE ); + this.cell.enableClientEvents = true; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "config" ) ) - return config; + return this.config; if ( name.equals( "cell" ) ) - return cell; + return this.cell; return null; } @@ -136,14 +136,14 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) { - if ( inv == cell && !locked ) + if ( inv == this.cell && !this.locked ) { - locked = true; + this.locked = true; - cacheUpgrades = null; - cacheConfig = null; + this.cacheUpgrades = null; + this.cacheConfig = null; - IInventory c = getCellConfigInventory(); + IInventory c = this.getCellConfigInventory(); if ( c != null ) { boolean cellHasConfig = false; @@ -158,34 +158,34 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I if ( cellHasConfig ) { - for (int x = 0; x < config.getSizeInventory(); x++) - config.setInventorySlotContents( x, c.getStackInSlot( x ) ); + for (int x = 0; x < this.config.getSizeInventory(); x++) + this.config.setInventorySlotContents( x, c.getStackInSlot( x ) ); } else { - for (int x = 0; x < config.getSizeInventory(); x++) - c.setInventorySlotContents( x, config.getStackInSlot( x ) ); + for (int x = 0; x < this.config.getSizeInventory(); x++) + c.setInventorySlotContents( x, this.config.getStackInSlot( x ) ); c.markDirty(); } } - else if ( cm.getSetting( Settings.COPY_MODE ) == CopyMode.CLEAR_ON_REMOVE ) + else if ( this.cm.getSetting( Settings.COPY_MODE ) == CopyMode.CLEAR_ON_REMOVE ) { - for (int x = 0; x < config.getSizeInventory(); x++) - config.setInventorySlotContents( x, null ); + for (int x = 0; x < this.config.getSizeInventory(); x++) + this.config.setInventorySlotContents( x, null ); this.markDirty(); } - locked = false; + this.locked = false; } - else if ( inv == config && !locked ) + else if ( inv == this.config && !this.locked ) { - IInventory c = getCellConfigInventory(); + IInventory c = this.getCellConfigInventory(); if ( c != null ) { - for (int x = 0; x < config.getSizeInventory(); x++) - c.setInventorySlotContents( x, config.getStackInSlot( x ) ); + for (int x = 0; x < this.config.getSizeInventory(); x++) + c.setInventorySlotContents( x, this.config.getStackInSlot( x ) ); c.markDirty(); } @@ -197,17 +197,17 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { super.getDrops( w, x, y, z, drops ); - if ( cell.getStackInSlot( 0 ) != null ) - drops.add( cell.getStackInSlot( 0 ) ); + if ( this.cell.getStackInSlot( 0 ) != null ) + drops.add( this.cell.getStackInSlot( 0 ) ); } public ICellWorkbenchItem getCell() { - if ( cell.getStackInSlot( 0 ) == null ) + if ( this.cell.getStackInSlot( 0 ) == null ) return null; - if ( cell.getStackInSlot( 0 ).getItem() instanceof ICellWorkbenchItem ) - return ((ICellWorkbenchItem) cell.getStackInSlot( 0 ).getItem()); + if ( this.cell.getStackInSlot( 0 ).getItem() instanceof ICellWorkbenchItem ) + return ((ICellWorkbenchItem) this.cell.getStackInSlot( 0 ).getItem()); return null; } @@ -215,7 +215,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I @Override public IConfigManager getConfigManager() { - return cm; + return this.cm; } @Override diff --git a/src/main/java/appeng/tile/misc/TileCharger.java b/src/main/java/appeng/tile/misc/TileCharger.java index d94d30de5..03ad797a6 100644 --- a/src/main/java/appeng/tile/misc/TileCharger.java +++ b/src/main/java/appeng/tile/misc/TileCharger.java @@ -70,11 +70,11 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable { IAEItemStack item = AEItemStack.loadItemStackFromPacket( data ); ItemStack is = item.getItemStack(); - inv.setInventorySlotContents( 0, is ); + this.inv.setInventorySlotContents( 0, is ); } catch (Throwable t) { - inv.setInventorySlotContents( 0, null ); + this.inv.setInventorySlotContents( 0, null ); } return false; // TESR doesn't need updates! } @@ -82,7 +82,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileCharger(ByteBuf data) throws IOException { - AEItemStack is = AEItemStack.create( getStackInSlot( 0 ) ); + AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) ); if ( is != null ) is.writeToPacket( data ); } @@ -90,29 +90,29 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable @TileEvent(TileEventType.TICK) public void Tick_TileCharger() { - if ( lastUpdate > 60 && requiresUpdate ) + if ( this.lastUpdate > 60 && this.requiresUpdate ) { - requiresUpdate = false; - markForUpdate(); - lastUpdate = 0; + this.requiresUpdate = false; + this.markForUpdate(); + this.lastUpdate = 0; } - lastUpdate++; + this.lastUpdate++; - tickTickTimer++; - if ( tickTickTimer < 20 ) + this.tickTickTimer++; + if ( this.tickTickTimer < 20 ) return; - tickTickTimer = 0; + this.tickTickTimer = 0; - ItemStack myItem = getStackInSlot( 0 ); + ItemStack myItem = this.getStackInSlot( 0 ); // charge from the network! - if ( internalCurrentPower < 1499 ) + if ( this.internalCurrentPower < 1499 ) { try { - injectExternalPower( PowerUnits.AE, - gridProxy.getEnergy().extractAEPower( Math.min( 150.0, 1500.0 - internalCurrentPower ), Actionable.MODULATE, PowerMultiplier.ONE ) ); - tickTickTimer = 20; // keep ticking... + this.injectExternalPower( PowerUnits.AE, + this.gridProxy.getEnergy().extractAEPower( Math.min( 150.0, 1500.0 - this.internalCurrentPower ), Actionable.MODULATE, PowerMultiplier.ONE ) ); + this.tickTickTimer = 20; // keep ticking... } catch (GridAccessException e) { @@ -123,86 +123,86 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable if ( myItem == null ) return; - if ( internalCurrentPower > 149 && Platform.isChargeable( myItem ) ) + if ( this.internalCurrentPower > 149 && Platform.isChargeable( myItem ) ) { IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem(); if ( ps.getAEMaxPower( myItem ) > ps.getAECurrentPower( myItem ) ) { - double oldPower = internalCurrentPower; + double oldPower = this.internalCurrentPower; - double adjustment = ps.injectAEPower( myItem, extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); - internalCurrentPower += adjustment; - if ( oldPower > internalCurrentPower ) - requiresUpdate = true; - tickTickTimer = 20; // keep ticking... + double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); + this.internalCurrentPower += adjustment; + if ( oldPower > this.internalCurrentPower ) + this.requiresUpdate = true; + this.tickTickTimer = 20; // keep ticking... } } - else if ( internalCurrentPower > 1499 && AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( myItem ) ) + else if ( this.internalCurrentPower > 1499 && AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( myItem ) ) { if ( Platform.getRandomFloat() > 0.8f ) // simulate wait { - extractAEPower( internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - setInventorySlotContents( 0, AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( myItem.stackSize ) ); + this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 + this.setInventorySlotContents( 0, AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( myItem.stackSize ) ); } } } public TileCharger() { - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - gridProxy.setFlags(); - internalMaxPower = 1500; - gridProxy.setIdlePowerUsage( 0 ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags(); + this.internalMaxPower = 1500; + this.gridProxy.setIdlePowerUsage( 0 ); } @Override public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { super.setOrientation( inForward, inUp ); - gridProxy.setValidSides( EnumSet.of( getUp(), getUp().getOpposite() ) ); - setPowerSides( EnumSet.of( getUp(), getUp().getOpposite() ) ); + this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); + this.setPowerSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); } @Override public boolean canTurn() { - return internalCurrentPower < internalMaxPower; + return this.internalCurrentPower < this.internalMaxPower; } @Override public void applyTurn() { - injectExternalPower( PowerUnits.AE, 150 ); + this.injectExternalPower( PowerUnits.AE, 150 ); - ItemStack myItem = getStackInSlot( 0 ); - if ( internalCurrentPower > 1499 && AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( myItem ) ) + ItemStack myItem = this.getStackInSlot( 0 ); + if ( this.internalCurrentPower > 1499 && AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( myItem ) ) { - extractAEPower( internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - setInventorySlotContents( 0, AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( myItem.stackSize ) ); + this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 + this.setInventorySlotContents( 0, AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( myItem.stackSize ) ); } } @Override public boolean canCrankAttach(ForgeDirection directionToCrank) { - return getUp().equals( directionToCrank ) || getUp().getOpposite().equals( directionToCrank ); + return this.getUp().equals( directionToCrank ) || this.getUp().getOpposite().equals( directionToCrank ); } @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - markForUpdate(); + this.markForUpdate(); } @Override public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) { - return sides; + return this.sides; } @Override @@ -235,22 +235,22 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable if ( !Platform.hasPermissions( new DimensionalCoord( this ), player ) ) return; - ItemStack myItem = getStackInSlot( 0 ); + ItemStack myItem = this.getStackInSlot( 0 ); if ( myItem == null ) { ItemStack held = player.inventory.getCurrentItem(); if ( AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( held ) || Platform.isChargeable( held ) ) { held = player.inventory.decrStackSize( player.inventory.currentItem, 1 ); - setInventorySlotContents( 0, held ); + this.setInventorySlotContents( 0, held ); } } else { List drops = new ArrayList(); drops.add( myItem ); - setInventorySlotContents( 0, null ); - Platform.spawnDrops( worldObj, xCoord + getForward().offsetX, yCoord + getForward().offsetY, zCoord + getForward().offsetZ, drops ); + this.setInventorySlotContents( 0, null ); + Platform.spawnDrops( this.worldObj, this.xCoord + this.getForward().offsetX, this.yCoord + this.getForward().offsetY, this.zCoord + this.getForward().offsetZ, drops ); } } diff --git a/src/main/java/appeng/tile/misc/TileCondenser.java b/src/main/java/appeng/tile/misc/TileCondenser.java index c2c483569..ff5787053 100644 --- a/src/main/java/appeng/tile/misc/TileCondenser.java +++ b/src/main/java/appeng/tile/misc/TileCondenser.java @@ -54,24 +54,24 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCondenser(NBTTagCompound data) { - cm.writeToNBT( data ); - data.setDouble( "storedPower", storedPower ); + this.cm.writeToNBT( data ); + data.setDouble( "storedPower", this.storedPower ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileCondenser(NBTTagCompound data) { - cm.readFromNBT( data ); - storedPower = data.getDouble( "storedPower" ); + this.cm.readFromNBT( data ); + this.storedPower = data.getDouble( "storedPower" ); } public TileCondenser() { - cm.registerSetting( Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH ); + this.cm.registerSetting( Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH ); } public double getStorage() { - ItemStack is = inv.getStackInSlot( 2 ); + ItemStack is = this.inv.getStackInSlot( 2 ); if ( is != null ) { if ( is.getItem() instanceof IStorageComponent ) @@ -86,17 +86,17 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf public void addPower(double rawPower) { - storedPower += rawPower; - storedPower = Math.max( 0.0, Math.min( getStorage(), storedPower ) ); + this.storedPower += rawPower; + this.storedPower = Math.max( 0.0, Math.min( this.getStorage(), this.storedPower ) ); - double requiredPower = getRequiredPower(); - ItemStack output = getOutput(); - while (requiredPower <= storedPower && output != null && requiredPower > 0) + double requiredPower = this.getRequiredPower(); + ItemStack output = this.getOutput(); + while (requiredPower <= this.storedPower && output != null && requiredPower > 0) { - if ( canAddOutput( output ) ) + if ( this.canAddOutput( output ) ) { - storedPower -= requiredPower; - addOutput( output ); + this.storedPower -= requiredPower; + this.addOutput( output ); } else break; @@ -106,7 +106,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf private boolean canAddOutput(ItemStack output) { - ItemStack outputStack = getStackInSlot( 1 ); + ItemStack outputStack = this.getStackInSlot( 1 ); return outputStack == null || (Platform.isSameItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize()); } @@ -117,19 +117,19 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf */ private void addOutput(ItemStack output) { - ItemStack outputStack = getStackInSlot( 1 ); + ItemStack outputStack = this.getStackInSlot( 1 ); if ( outputStack == null ) - setInventorySlotContents( 1, output.copy() ); + this.setInventorySlotContents( 1, output.copy() ); else { outputStack.stackSize++; - setInventorySlotContents( 1, outputStack ); + this.setInventorySlotContents( 1, outputStack ); } } private ItemStack getOutput() { - switch ((CondenserOutput) cm.getSetting( Settings.CONDENSER_OUTPUT )) + switch ((CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT )) { case MATTER_BALLS: return AEApi.instance().materials().materialMatterBall.stack( 1 ); @@ -143,7 +143,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf public double getRequiredPower() { - return ((CondenserOutput) cm.getSetting( Settings.CONDENSER_OUTPUT )).requiredPower; + return ((CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT )).requiredPower; } @Override @@ -152,11 +152,11 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf if ( i == 0 ) { if ( itemstack != null ) - addPower( itemstack.stackSize ); + this.addPower( itemstack.stackSize ); } else { - inv.setInventorySlotContents( 1, itemstack ); + this.inv.setInventorySlotContents( 1, itemstack ); } } @@ -181,13 +181,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override @@ -198,7 +198,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf ItemStack is = inv.getStackInSlot( 0 ); if ( is != null ) { - addPower( is.stackSize ); + this.addPower( is.stackSize ); inv.setInventorySlotContents( 0, null ); } } @@ -208,7 +208,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { if ( doFill ) - addPower( (resource == null ? 0.0 : (double) resource.amount) / 500.0 ); + this.addPower( (resource == null ? 0.0 : (double) resource.amount) / 500.0 ); return resource == null ? 0 : resource.amount; } @@ -246,13 +246,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - addPower( 0 ); + this.addPower( 0 ); } @Override public IConfigManager getConfigManager() { - return cm; + return this.cm; } } diff --git a/src/main/java/appeng/tile/misc/TileInscriber.java b/src/main/java/appeng/tile/misc/TileInscriber.java index 11465149a..4185a9a52 100644 --- a/src/main/java/appeng/tile/misc/TileInscriber.java +++ b/src/main/java/appeng/tile/misc/TileInscriber.java @@ -79,7 +79,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, static final ItemStack inscriberStack = AEApi.instance().blocks().blockInscriber.stack( 1 ); private final IConfigManager settings = new ConfigManager( this ); - private final UpgradeInventory upgrades = new UpgradeInventory( inscriberStack, this, getUpgradeSlots() ); + private final UpgradeInventory upgrades = new UpgradeInventory( inscriberStack, this, this.getUpgradeSlots() ); @Override public AECableType getCableConnectionType(ForgeDirection dir) @@ -90,17 +90,17 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileInscriber(NBTTagCompound data) { - inv.writeToNBT( data, "inscriberInv" ); - upgrades.writeToNBT( data, "upgrades" ); - settings.writeToNBT( data ); + this.inv.writeToNBT( data, "inscriberInv" ); + this.upgrades.writeToNBT( data, "upgrades" ); + this.settings.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileInscriber(NBTTagCompound data) { - inv.readFromNBT( data, "inscriberInv" ); - upgrades.readFromNBT( data, "upgrades" ); - settings.readFromNBT( data ); + this.inv.readFromNBT( data, "inscriberInv" ); + this.upgrades.readFromNBT( data, "upgrades" ); + this.settings.readFromNBT( data ); } @TileEvent(TileEventType.NETWORK_READ) @@ -108,21 +108,21 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { int slot = data.readByte(); - boolean oldSmash = smash; + boolean oldSmash = this.smash; boolean newSmash = (slot & 64) == 64; if ( oldSmash != newSmash && newSmash ) { - smash = true; - clientStart = System.currentTimeMillis(); + this.smash = true; + this.clientStart = System.currentTimeMillis(); } - for (int num = 0; num < inv.getSizeInventory(); num++) + for (int num = 0; num < this.inv.getSizeInventory(); num++) { if ( (slot & (1 << num)) > 0 ) - inv.setInventorySlotContents( num, AEItemStack.loadItemStackFromPacket( data ).getItemStack() ); + this.inv.setInventorySlotContents( num, AEItemStack.loadItemStackFromPacket( data ).getItemStack() ); else - inv.setInventorySlotContents( num, null ); + this.inv.setInventorySlotContents( num, null ); } return false; @@ -131,20 +131,20 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileInscriber(ByteBuf data) throws IOException { - int slot = smash ? 64 : 0; + int slot = this.smash ? 64 : 0; - for (int num = 0; num < inv.getSizeInventory(); num++) + for (int num = 0; num < this.inv.getSizeInventory(); num++) { - if ( inv.getStackInSlot( num ) != null ) + if ( this.inv.getStackInSlot( num ) != null ) slot = slot | (1 << num); } data.writeByte( slot ); - for (int num = 0; num < inv.getSizeInventory(); num++) + for (int num = 0; num < this.inv.getSizeInventory(); num++) { if ( (slot & (1 << num)) > 0 ) { - AEItemStack st = AEItemStack.create( inv.getStackInSlot( num ) ); + AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) ); st.writeToPacket( data ); } } @@ -158,35 +158,35 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, public TileInscriber() { - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - internalMaxPower = 1500; - gridProxy.setIdlePowerUsage( 0 ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.internalMaxPower = 1500; + this.gridProxy.setIdlePowerUsage( 0 ); } @Override public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { super.setOrientation( inForward, inUp ); - gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( getForward() ) ) ); - setPowerSides( EnumSet.complementOf( EnumSet.of( getForward() ) ) ); + this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) ); + this.setPowerSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) ); } @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public int[] getAccessibleSlotsBySide(ForgeDirection d) { if ( d == ForgeDirection.UP ) - return top; + return this.top; if ( d == ForgeDirection.DOWN ) - return bottom; + return this.bottom; - return sides; + return this.sides; } @Override @@ -198,7 +198,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - if ( smash ) + if ( this.smash ) return false; if ( i == 0 || i == 1 ) @@ -225,7 +225,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Override public boolean canExtractItem(int i, ItemStack itemstack, int j) { - if ( smash ) + if ( this.smash ) return false; return i == 0 || i == 1 || i == 3; @@ -239,12 +239,12 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if ( mc != InvOperation.markDirty ) { if ( slot != 3 ) - processingTime = 0; + this.processingTime = 0; - if ( !smash ) - markForUpdate(); + if ( !this.smash ) + this.markForUpdate(); - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } } catch (GridAccessException e) @@ -255,9 +255,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, public InscriberRecipe getTask() { - ItemStack PlateA = getStackInSlot( 0 ); - ItemStack PlateB = getStackInSlot( 1 ); - ItemStack renamedItem = getStackInSlot( 2 ); + ItemStack PlateA = this.getStackInSlot( 0 ); + ItemStack PlateB = this.getStackInSlot( 1 ); + ItemStack renamedItem = this.getStackInSlot( 2 ); if ( PlateA != null && PlateA.stackSize > 1 ) return null; @@ -320,7 +320,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { for (ItemStack option : i.imprintable) { - if ( Platform.isSameItemPrecise( option, getStackInSlot( 2 ) ) ) + if ( Platform.isSameItemPrecise( option, this.getStackInSlot( 2 ) ) ) return i; } } @@ -331,55 +331,55 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, private boolean hasWork() { - if ( getTask() != null ) + if ( this.getTask() != null ) return true; - processingTime = 0; - return smash; + this.processingTime = 0; + return this.smash; } @Override public TickingRequest getTickingRequest(IGridNode node) { - return new TickingRequest( TickRates.Inscriber.min, TickRates.Inscriber.max, !hasWork(), false ); + return new TickingRequest( TickRates.Inscriber.min, TickRates.Inscriber.max, !this.hasWork(), false ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( smash ) + if ( this.smash ) { - finalStep++; - if ( finalStep == 8 ) + this.finalStep++; + if ( this.finalStep == 8 ) { - InscriberRecipe out = getTask(); + InscriberRecipe out = this.getTask(); if ( out != null ) { ItemStack is = out.output.copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( inv, 3, 1, true ), ForgeDirection.UNKNOWN ); + InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); if ( ad.addItems( is ) == null ) { - processingTime = 0; + this.processingTime = 0; if ( out.usePlates ) { - setInventorySlotContents( 0, null ); - setInventorySlotContents( 1, null ); + this.setInventorySlotContents( 0, null ); + this.setInventorySlotContents( 1, null ); } - setInventorySlotContents( 2, null ); + this.setInventorySlotContents( 2, null ); } } - markDirty(); + this.markDirty(); } - else if ( finalStep == 16 ) + else if ( this.finalStep == 16 ) { - finalStep = 0; - smash = false; - markForUpdate(); + this.finalStep = 0; + this.smash = false; + this.markForUpdate(); } } else @@ -387,14 +387,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, IEnergyGrid eg; try { - eg = gridProxy.getEnergy(); + eg = this.gridProxy.getEnergy(); IEnergySource src = this; // Base 1, increase by 1 for each card - int speedFactor = 1 + upgrades.getInstalledUpgrades( Upgrades.SPEED ); + int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED ); int powerConsumption = 10 * speedFactor; double powerThreshold = powerConsumption - 0.01; - double powerReq = extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + double powerReq = this.extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if ( powerReq <= powerThreshold ) { @@ -406,10 +406,10 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { src.extractAEPower( powerConsumption, Actionable.MODULATE, PowerMultiplier.CONFIG ); - if ( processingTime == 0 ) - processingTime = processingTime + speedFactor; + if ( this.processingTime == 0 ) + this.processingTime = this.processingTime + speedFactor; else - processingTime += TicksSinceLastCall * speedFactor; + this.processingTime += TicksSinceLastCall * speedFactor; } } catch (GridAccessException e) @@ -417,41 +417,41 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, // :P } - if ( processingTime > maxProcessingTime ) + if ( this.processingTime > this.maxProcessingTime ) { - processingTime = maxProcessingTime; - InscriberRecipe out = getTask(); + this.processingTime = this.maxProcessingTime; + InscriberRecipe out = this.getTask(); if ( out != null ) { ItemStack is = out.output.copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( inv, 3, 1, true ), ForgeDirection.UNKNOWN ); + InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); if ( ad.simulateAdd( is ) == null ) { - smash = true; - finalStep = 0; - markForUpdate(); + this.smash = true; + this.finalStep = 0; + this.markForUpdate(); } } } } - return hasWork() ? TickRateModulation.URGENT : TickRateModulation.SLEEP; + return this.hasWork() ? TickRateModulation.URGENT : TickRateModulation.SLEEP; } @Override public IConfigManager getConfigManager() { - return settings; + return this.settings; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "inv" ) ) - return inv; + return this.inv; if ( name.equals( "upgrades" ) ) - return upgrades; + return this.upgrades; return null; } @@ -459,7 +459,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Override public int getInstalledUpgrades(Upgrades u) { - return upgrades.getInstalledUpgrades( u ); + return this.upgrades.getInstalledUpgrades( u ); } protected int getUpgradeSlots() @@ -472,9 +472,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { super.getDrops( w, x, y, z, drops ); - for (int h = 0; h < upgrades.getSizeInventory(); h++) + for (int h = 0; h < this.upgrades.getSizeInventory(); h++) { - ItemStack is = upgrades.getStackInSlot( h ); + ItemStack is = this.upgrades.getStackInSlot( h ); if ( is != null ) drops.add( is ); } diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index 9088f8e26..fce61015d 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -66,18 +66,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT { ForgeDirection pointAt = ForgeDirection.UNKNOWN; - final DualityInterface duality = new DualityInterface( gridProxy, this ); + final DualityInterface duality = new DualityInterface( this.gridProxy, this ); @MENetworkEventSubscribe public void stateChange(MENetworkChannelsChanged c) { - duality.notifyNeighbors(); + this.duality.notifyNeighbors(); } @MENetworkEventSubscribe public void stateChange(MENetworkPowerStatusChange c) { - duality.notifyNeighbors(); + this.duality.notifyNeighbors(); } public void setSide(ForgeDirection axis) @@ -85,42 +85,42 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT if ( Platform.isClient() ) return; - if ( pointAt == axis.getOpposite() ) - pointAt = axis; - else if ( pointAt == axis || pointAt == axis.getOpposite() ) - pointAt = ForgeDirection.UNKNOWN; - else if ( pointAt == ForgeDirection.UNKNOWN ) - pointAt = axis.getOpposite(); + if ( this.pointAt == axis.getOpposite() ) + this.pointAt = axis; + else if ( this.pointAt == axis || this.pointAt == axis.getOpposite() ) + this.pointAt = ForgeDirection.UNKNOWN; + else if ( this.pointAt == ForgeDirection.UNKNOWN ) + this.pointAt = axis.getOpposite(); else - pointAt = Platform.rotateAround( pointAt, axis ); + this.pointAt = Platform.rotateAround( this.pointAt, axis ); - if ( ForgeDirection.UNKNOWN == pointAt ) - setOrientation( pointAt, pointAt ); + if ( ForgeDirection.UNKNOWN == this.pointAt ) + this.setOrientation( this.pointAt, this.pointAt ); else - setOrientation( pointAt.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP, pointAt.getOpposite() ); + this.setOrientation( this.pointAt.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP, this.pointAt.getOpposite() ); - gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( pointAt ) ) ); - markForUpdate(); - markDirty(); + this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.pointAt ) ) ); + this.markForUpdate(); + this.markDirty(); } @Override public void getDrops(World w, int x, int y, int z, ArrayList drops) { - duality.addDrops( drops ); + this.duality.addDrops( drops ); } @Override public void gridChanged() { - duality.gridChanged(); + this.duality.gridChanged(); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileInterface(NBTTagCompound data) { - data.setInteger( "pointAt", pointAt.ordinal() ); - duality.writeToNBT( data ); + data.setInteger( "pointAt", this.pointAt.ordinal() ); + this.duality.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) @@ -129,31 +129,31 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT int val = data.getInteger( "pointAt" ); if ( val >= 0 && val < ForgeDirection.values().length ) - pointAt = ForgeDirection.values()[val]; + this.pointAt = ForgeDirection.values()[val]; else - pointAt = ForgeDirection.UNKNOWN; + this.pointAt = ForgeDirection.UNKNOWN; - duality.readFromNBT( data ); + this.duality.readFromNBT( data ); } @Override public void onReady() { - gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( pointAt ) ) ); + this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.pointAt ) ) ); super.onReady(); - duality.initialize(); + this.duality.initialize(); } @Override public AECableType getCableConnectionType(ForgeDirection dir) { - return duality.getCableConnectionType( dir ); + return this.duality.getCableConnectionType( dir ); } @Override public DimensionalCoord getLocation() { - return duality.getLocation(); + return this.duality.getLocation(); } @Override @@ -165,140 +165,140 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT @Override public boolean canInsert(ItemStack stack) { - return duality.canInsert( stack ); + return this.duality.canInsert( stack ); } @Override public IMEMonitor getItemInventory() { - return duality.getItemInventory(); + return this.duality.getItemInventory(); } @Override public IMEMonitor getFluidInventory() { - return duality.getFluidInventory(); + return this.duality.getFluidInventory(); } @Override public IInventory getInventoryByName(String name) { - return duality.getInventoryByName( name ); + return this.duality.getInventoryByName( name ); } @Override public TickingRequest getTickingRequest(IGridNode node) { - return duality.getTickingRequest( node ); + return this.duality.getTickingRequest( node ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - return duality.tickingRequest( node, TicksSinceLastCall ); + return this.duality.tickingRequest( node, TicksSinceLastCall ); } @Override public IInventory getInternalInventory() { - return duality.getInternalInventory(); + return this.duality.getInternalInventory(); } @Override public void markDirty() { - duality.markDirty(); + this.duality.markDirty(); } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - duality.onChangeInventory( inv, slot, mc, removed, added ); + this.duality.onChangeInventory( inv, slot, mc, removed, added ); } @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return duality.getAccessibleSlotsFromSide( side.ordinal() ); + return this.duality.getAccessibleSlotsFromSide( side.ordinal() ); } @Override public DualityInterface getInterfaceDuality() { - return duality; + return this.duality; } @Override public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) { - return duality.getMonitorable( side, src, this ); + return this.duality.getMonitorable( side, src, this ); } @Override public IConfigManager getConfigManager() { - return duality.getConfigManager(); + return this.duality.getConfigManager(); } @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) { - return duality.pushPattern( patternDetails, table ); + return this.duality.pushPattern( patternDetails, table ); } @Override public void provideCrafting(ICraftingProviderHelper craftingTracker) { - duality.provideCrafting( craftingTracker ); + this.duality.provideCrafting( craftingTracker ); } @Override public EnumSet getTargets() { - if ( pointAt == null || pointAt == ForgeDirection.UNKNOWN ) + if ( this.pointAt == null || this.pointAt == ForgeDirection.UNKNOWN ) return EnumSet.complementOf( EnumSet.of( ForgeDirection.UNKNOWN ) ); - return EnumSet.of( pointAt ); + return EnumSet.of( this.pointAt ); } @Override public boolean isBusy() { - return duality.isBusy(); + return this.duality.isBusy(); } @Override public int getInstalledUpgrades(Upgrades u) { - return duality.getInstalledUpgrades( u ); + return this.duality.getInstalledUpgrades( u ); } @Override public ImmutableSet getRequestedJobs() { - return duality.getRequestedJobs(); + return this.duality.getRequestedJobs(); } @Override public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) { - return duality.injectCraftedItems( link, items, mode ); + return this.duality.injectCraftedItems( link, items, mode ); } @Override public void jobStateChange(ICraftingLink link) { - duality.jobStateChange( link ); + this.duality.jobStateChange( link ); } @Override public int getPriority() { - return duality.getPriority(); + return this.duality.getPriority(); } @Override public void setPriority(int newValue) { - duality.setPriority( newValue ); + this.duality.setPriority( newValue ); } } diff --git a/src/main/java/appeng/tile/misc/TileLightDetector.java b/src/main/java/appeng/tile/misc/TileLightDetector.java index 8b185f330..c5179c106 100644 --- a/src/main/java/appeng/tile/misc/TileLightDetector.java +++ b/src/main/java/appeng/tile/misc/TileLightDetector.java @@ -31,28 +31,28 @@ public class TileLightDetector extends AEBaseTile public boolean isReady() { - return lastLight > 0; + return this.lastLight > 0; } @TileEvent(TileEventType.TICK) public void Tick_TileLightDetector() { - lastCheck++; - if ( lastCheck > 30 ) + this.lastCheck++; + if ( this.lastCheck > 30 ) { - lastCheck = 0; - updateLight(); + this.lastCheck = 0; + this.updateLight(); } } public void updateLight() { - int val = worldObj.getBlockLightValue( xCoord, yCoord, zCoord ); + int val = this.worldObj.getBlockLightValue( this.xCoord, this.yCoord, this.zCoord ); - if ( lastLight != val ) + if ( this.lastLight != val ) { - lastLight = val; - Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); + this.lastLight = val; + Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord ); } } diff --git a/src/main/java/appeng/tile/misc/TilePaint.java b/src/main/java/appeng/tile/misc/TilePaint.java index e1051ed38..ff7d146f7 100644 --- a/src/main/java/appeng/tile/misc/TilePaint.java +++ b/src/main/java/appeng/tile/misc/TilePaint.java @@ -51,15 +51,15 @@ public class TilePaint extends AEBaseTile void writeBuffer(ByteBuf out) { - if ( dots == null ) + if ( this.dots == null ) { out.writeByte( 0 ); return; } - out.writeByte( dots.size() ); + out.writeByte( this.dots.size() ); - for (Splotch s : dots) + for (Splotch s : this.dots) s.writeToStream( out ); } @@ -69,32 +69,32 @@ public class TilePaint extends AEBaseTile if ( howMany == 0 ) { - isLit = 0; - dots = null; + this.isLit = 0; + this.dots = null; return; } - dots = new ArrayList( howMany ); + this.dots = new ArrayList( howMany ); for (int x = 0; x < howMany; x++) - dots.add( new Splotch( in ) ); + this.dots.add( new Splotch( in ) ); - isLit = 0; - for (Splotch s : dots) + this.isLit = 0; + for (Splotch s : this.dots) { if ( s.lumen ) { - isLit += LIGHT_PER_DOT; + this.isLit += LIGHT_PER_DOT; } } - maxLit(); + this.maxLit(); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TilePaint(NBTTagCompound data) { ByteBuf myDat = Unpooled.buffer(); - writeBuffer( myDat ); + this.writeBuffer( myDat ); if ( myDat.hasArray() ) data.setByteArray( "dots", myDat.array() ); } @@ -103,75 +103,75 @@ public class TilePaint extends AEBaseTile public void readFromNBT_TilePaint(NBTTagCompound data) { if ( data.hasKey( "dots" ) ) - readBuffer( Unpooled.copiedBuffer( data.getByteArray( "dots" ) ) ); + this.readBuffer( Unpooled.copiedBuffer( data.getByteArray( "dots" ) ) ); } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TilePaint(ByteBuf data) { - writeBuffer( data ); + this.writeBuffer( data ); } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TilePaint(ByteBuf data) { - readBuffer( data ); + this.readBuffer( data ); return true; } public void onNeighborBlockChange() { - if ( dots == null ) + if ( this.dots == null ) return; for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - if ( !isSideValid( side ) ) - removeSide( side ); + if ( !this.isSideValid( side ) ) + this.removeSide( side ); } - updateData(); + this.updateData(); } private void updateData() { - isLit = 0; - for (Splotch s : dots) + this.isLit = 0; + for (Splotch s : this.dots) { if ( s.lumen ) { - isLit += LIGHT_PER_DOT; + this.isLit += LIGHT_PER_DOT; } } - maxLit(); + this.maxLit(); - if ( dots.isEmpty() ) - dots = null; + if ( this.dots.isEmpty() ) + this.dots = null; - if ( dots == null ) - worldObj.setBlock( xCoord, yCoord, zCoord, Blocks.air ); + if ( this.dots == null ) + this.worldObj.setBlock( this.xCoord, this.yCoord, this.zCoord, Blocks.air ); } public void cleanSide(ForgeDirection side) { - if ( dots == null ) + if ( this.dots == null ) return; - removeSide( side ); + this.removeSide( side ); - updateData(); + this.updateData(); } public boolean isSideValid(ForgeDirection side) { - Block blk = worldObj.getBlock( xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ ); - return blk.isSideSolid( worldObj, xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ, side.getOpposite() ); + Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); + return blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, side.getOpposite() ); } private void removeSide(ForgeDirection side) { - Iterator i = dots.iterator(); + Iterator i = this.dots.iterator(); while (i.hasNext()) { Splotch s = i.next(); @@ -179,55 +179,55 @@ public class TilePaint extends AEBaseTile i.remove(); } - markForUpdate(); - markDirty(); + this.markForUpdate(); + this.markDirty(); } public int getLightLevel() { - return isLit; + return this.isLit; } public void addBlot(ItemStack type, ForgeDirection side, Vec3 hitVec) { - Block blk = worldObj.getBlock( xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ ); - if ( blk.isSideSolid( worldObj, xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ, side.getOpposite() ) ) + Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); + if ( blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, side.getOpposite() ) ) { ItemPaintBall ipb = (ItemPaintBall) type.getItem(); AEColor col = ipb.getColor( type ); boolean lit = ipb.isLumen( type ); - if ( dots == null ) - dots = new ArrayList(); + if ( this.dots == null ) + this.dots = new ArrayList(); - if ( dots.size() > 20 ) - dots.remove( 0 ); + if ( this.dots.size() > 20 ) + this.dots.remove( 0 ); - dots.add( new Splotch( col, lit, side, hitVec ) ); + this.dots.add( new Splotch( col, lit, side, hitVec ) ); if ( lit ) - isLit += LIGHT_PER_DOT; + this.isLit += LIGHT_PER_DOT; - maxLit(); - markForUpdate(); - markDirty(); + this.maxLit(); + this.markForUpdate(); + this.markDirty(); } } private void maxLit() { - if ( isLit > 14 ) - isLit = 14; + if ( this.isLit > 14 ) + this.isLit = 14; - if ( worldObj != null ) - worldObj.updateLightByType( EnumSkyBlock.Block, xCoord, yCoord, zCoord ); + if ( this.worldObj != null ) + this.worldObj.updateLightByType( EnumSkyBlock.Block, this.xCoord, this.yCoord, this.zCoord ); } public Collection getDots() { - if ( dots == null ) + if ( this.dots == null ) return ImmutableList.of(); - return dots; + return this.dots; } } diff --git a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java index 4b087cb6f..e12d17d53 100644 --- a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java @@ -42,7 +42,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower @MENetworkEventSubscribe public void onPower(MENetworkPowerStatusChange ch) { - markForUpdate(); + this.markForUpdate(); } @Override @@ -54,9 +54,9 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileQuartzGrowthAccelerator(ByteBuf data) { - boolean hadPower = hasPower; - hasPower = data.readBoolean(); - return hasPower != hadPower; + boolean hadPower = this.hasPower; + this.hasPower = data.readBoolean(); + return this.hasPower != hadPower; } @TileEvent(TileEventType.NETWORK_WRITE) @@ -64,7 +64,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower { try { - data.writeBoolean( gridProxy.getEnergy().isNetworkPowered() ); + data.writeBoolean( this.gridProxy.getEnergy().isNetworkPowered() ); } catch (GridAccessException e) { @@ -73,16 +73,16 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower } public TileQuartzGrowthAccelerator() { - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - gridProxy.setFlags(); - gridProxy.setIdlePowerUsage( 8 ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags(); + this.gridProxy.setIdlePowerUsage( 8 ); } @Override public void setOrientation(ForgeDirection inForward, ForgeDirection inUp) { super.setOrientation( inForward, inUp ); - gridProxy.setValidSides( EnumSet.of( getUp(), getUp().getOpposite() ) ); + this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); } @Override @@ -92,7 +92,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower { try { - return gridProxy.getEnergy().isNetworkPowered(); + return this.gridProxy.getEnergy().isNetworkPowered(); } catch (GridAccessException e) { @@ -100,13 +100,13 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower } } - return hasPower; + return this.hasPower; } @Override public boolean isActive() { - return isPowered(); + return this.isPowered(); } } diff --git a/src/main/java/appeng/tile/misc/TileSecurity.java b/src/main/java/appeng/tile/misc/TileSecurity.java index 183a4ded3..8d3868f1f 100644 --- a/src/main/java/appeng/tile/misc/TileSecurity.java +++ b/src/main/java/appeng/tile/misc/TileSecurity.java @@ -84,7 +84,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp private final IConfigManager cm = new ConfigManager( this ); private final SecurityInventory inventory = new SecurityInventory( this ); - private final MEMonitorHandler securityMonitor = new MEMonitorHandler( inventory ); + private final MEMonitorHandler securityMonitor = new MEMonitorHandler( this.inventory ); private boolean isActive = false; @@ -102,16 +102,16 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp @Override public void getDrops(World w, int x, int y, int z, ArrayList drops) { - if ( !configSlot.isEmpty() ) - drops.add( configSlot.getStackInSlot( 0 ) ); + if ( !this.configSlot.isEmpty() ) + drops.add( this.configSlot.getStackInSlot( 0 ) ); - for (IAEItemStack ais : inventory.storedItems) + for (IAEItemStack ais : this.inventory.storedItems) drops.add( ais.getItemStack() ); } IMEInventoryHandler getSecurityInventory() { - return inventory; + return this.inventory; } @Override @@ -120,7 +120,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp super.onReady(); if ( Platform.isServer() ) { - isActive = true; + this.isActive = true; MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Register ) ); } } @@ -130,7 +130,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp { super.onChunkUnload(); MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); - isActive = false; + this.isActive = false; } @Override @@ -138,41 +138,41 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp { super.invalidate(); MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); - isActive = false; + this.isActive = false; } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileSecurity(ByteBuf data) { - boolean wasActive = isActive; - isActive = data.readBoolean(); + boolean wasActive = this.isActive; + this.isActive = data.readBoolean(); - AEColor oldPaintedColor = paintedColor; - paintedColor = AEColor.values()[data.readByte()]; + AEColor oldPaintedColor = this.paintedColor; + this.paintedColor = AEColor.values()[data.readByte()]; - return oldPaintedColor != paintedColor || wasActive != isActive; + return oldPaintedColor != this.paintedColor || wasActive != this.isActive; } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileSecurity(ByteBuf data) { - data.writeBoolean( gridProxy.isActive() ); - data.writeByte( paintedColor.ordinal() ); + data.writeBoolean( this.gridProxy.isActive() ); + data.writeByte( this.paintedColor.ordinal() ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileSecurity(NBTTagCompound data) { - cm.writeToNBT( data ); - data.setByte( "paintedColor", (byte) paintedColor.ordinal() ); + this.cm.writeToNBT( data ); + data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); - data.setLong( "securityKey", securityKey ); - configSlot.writeToNBT( data, "config" ); + data.setLong( "securityKey", this.securityKey ); + this.configSlot.writeToNBT( data, "config" ); NBTTagCompound storedItems = new NBTTagCompound(); int offset = 0; - for (IAEItemStack ais : inventory.storedItems) + for (IAEItemStack ais : this.inventory.storedItems) { NBTTagCompound it = new NBTTagCompound(); ais.getItemStack().writeToNBT( it ); @@ -185,12 +185,12 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileSecurity(NBTTagCompound data) { - cm.readFromNBT( data ); + this.cm.readFromNBT( data ); if ( data.hasKey( "paintedColor" ) ) - paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; + this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; - securityKey = data.getLong( "securityKey" ); - configSlot.readFromNBT( data, "config" ); + this.securityKey = data.getLong( "securityKey" ); + this.configSlot.readFromNBT( data, "config" ); NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); for (Object key : storedItems.func_150296_c()) @@ -198,7 +198,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp NBTBase obj = storedItems.getTag( (String) key ); if ( obj instanceof NBTTagCompound ) { - inventory.storedItems.add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) ); + this.inventory.storedItems.add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) ); } } } @@ -207,8 +207,8 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp { try { - saveChanges(); - gridProxy.getGrid().postEvent( new MENetworkSecurityChange() ); + this.saveChanges(); + this.gridProxy.getGrid().postEvent( new MENetworkSecurityChange() ); } catch (GridAccessException e) { @@ -222,7 +222,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp IPlayerRegistry pr = AEApi.instance().registries().players(); // read permissions - for (IAEItemStack ais : inventory.storedItems) + for (IAEItemStack ais : this.inventory.storedItems) { ItemStack is = ais.getItemStack(); Item i = is.getItem(); @@ -234,45 +234,45 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } // make sure thea admin is Boss. - playerPerms.put( gridProxy.getNode().getPlayerID(), EnumSet.allOf( SecurityPermissions.class ) ); + playerPerms.put( this.gridProxy.getNode().getPlayerID(), EnumSet.allOf( SecurityPermissions.class ) ); } @MENetworkEventSubscribe public void bootUpdate(MENetworkChannelsChanged changed) { - markForUpdate(); + this.markForUpdate(); } @MENetworkEventSubscribe public void powerUpdate(MENetworkPowerStatusChange changed) { - markForUpdate(); + this.markForUpdate(); } @Override public boolean isSecurityEnabled() { - return isActive && gridProxy.isActive(); + return this.isActive && this.gridProxy.isActive(); } public TileSecurity() { - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - gridProxy.setIdlePowerUsage( 2.0 ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.gridProxy.setIdlePowerUsage( 2.0 ); difference++; - securityKey = System.currentTimeMillis() * 10 + difference; + this.securityKey = System.currentTimeMillis() * 10 + difference; if ( difference > 10 ) difference = 0; - cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); - cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); - cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); + this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME ); + this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); + this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); } @Override public int getOwner() { - return gridProxy.getNode().getPlayerID(); + return this.gridProxy.getNode().getPlayerID(); } @Override @@ -289,13 +289,13 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp public boolean isActive() { - return isActive; + return this.isActive; } @Override public IMEMonitor getItemInventory() { - return securityMonitor; + return this.securityMonitor; } @Override @@ -307,18 +307,18 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp @Override public long getLocatableSerial() { - return securityKey; + return this.securityKey; } public boolean isPowered() { - return gridProxy.isActive(); + return this.gridProxy.isActive(); } @Override public IConfigManager getConfigManager() { - return cm; + return this.cm; } @Override @@ -330,24 +330,24 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp @Override public long getSecurityKey() { - return securityKey; + return this.securityKey; } @Override public AEColor getColor() { - return paintedColor; + return this.paintedColor; } @Override public boolean recolourBlock(ForgeDirection side, AEColor newPaintedColor, EntityPlayer who) { - if ( paintedColor == newPaintedColor ) + if ( this.paintedColor == newPaintedColor ) return false; - paintedColor = newPaintedColor; - markDirty(); - markForUpdate(); + this.paintedColor = newPaintedColor; + this.markDirty(); + this.markForUpdate(); return true; } diff --git a/src/main/java/appeng/tile/misc/TileVibrationChamber.java b/src/main/java/appeng/tile/misc/TileVibrationChamber.java index b0e94a16c..aec8303ff 100644 --- a/src/main/java/appeng/tile/misc/TileVibrationChamber.java +++ b/src/main/java/appeng/tile/misc/TileVibrationChamber.java @@ -65,54 +65,54 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileVibrationChamber(ByteBuf data) { - boolean wasOn = isOn; - isOn = data.readBoolean(); - return wasOn != isOn; // TESR doesn't need updates! + boolean wasOn = this.isOn; + this.isOn = data.readBoolean(); + return wasOn != this.isOn; // TESR doesn't need updates! } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileVibrationChamber(ByteBuf data) { - data.writeBoolean( burnTime > 0 ); + data.writeBoolean( this.burnTime > 0 ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileVibrationChamber(NBTTagCompound data) { - data.setDouble( "burnTime", burnTime ); - data.setDouble( "maxBurnTime", maxBurnTime ); - data.setInteger( "burnSpeed", burnSpeed ); + data.setDouble( "burnTime", this.burnTime ); + data.setDouble( "maxBurnTime", this.maxBurnTime ); + data.setInteger( "burnSpeed", this.burnSpeed ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileVibrationChamber(NBTTagCompound data) { - burnTime = data.getDouble( "burnTime" ); - maxBurnTime = data.getDouble( "maxBurnTime" ); - burnSpeed = data.getInteger( "burnSpeed" ); + this.burnTime = data.getDouble( "burnTime" ); + this.maxBurnTime = data.getDouble( "maxBurnTime" ); + this.burnSpeed = data.getInteger( "burnSpeed" ); } public TileVibrationChamber() { - gridProxy.setIdlePowerUsage( 0 ); - gridProxy.setFlags(); + this.gridProxy.setIdlePowerUsage( 0 ); + this.gridProxy.setFlags(); } @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( burnTime <= 0 ) + if ( this.burnTime <= 0 ) { - if ( canEatFuel() ) + if ( this.canEatFuel() ) { try { - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -125,7 +125,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } @Override @@ -155,65 +155,65 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka @Override public TickingRequest getTickingRequest(IGridNode node) { - if ( burnTime <= 0 ) - eatFuel(); + if ( this.burnTime <= 0 ) + this.eatFuel(); - return new TickingRequest( TickRates.VibrationChamber.min, TickRates.VibrationChamber.max, burnTime <= 0, false ); + return new TickingRequest( TickRates.VibrationChamber.min, TickRates.VibrationChamber.max, this.burnTime <= 0, false ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( burnTime <= 0 ) + if ( this.burnTime <= 0 ) { - eatFuel(); + this.eatFuel(); - if ( burnTime > 0 ) + if ( this.burnTime > 0 ) return TickRateModulation.URGENT; - burnSpeed = 100; + this.burnSpeed = 100; return TickRateModulation.SLEEP; } - burnSpeed = Math.max( 20, Math.min( burnSpeed, 200 ) ); - double dilation = burnSpeed / 100.0; + this.burnSpeed = Math.max( 20, Math.min( this.burnSpeed, 200 ) ); + double dilation = this.burnSpeed / 100.0; double timePassed = TicksSinceLastCall * dilation; - burnTime -= timePassed; - if ( burnTime < 0 ) + this.burnTime -= timePassed; + if ( this.burnTime < 0 ) { - timePassed += burnTime; - burnTime = 0; + timePassed += this.burnTime; + this.burnTime = 0; } try { - IEnergyGrid grid = gridProxy.getEnergy(); - double newPower = timePassed * powerPerTick; + IEnergyGrid grid = this.gridProxy.getEnergy(); + double newPower = timePassed * this.powerPerTick; double overFlow = grid.injectPower( newPower, Actionable.SIMULATE ); // burn the over flow. grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE ); if ( overFlow > 0 ) - burnSpeed -= TicksSinceLastCall; + this.burnSpeed -= TicksSinceLastCall; else - burnSpeed += TicksSinceLastCall; + this.burnSpeed += TicksSinceLastCall; - burnSpeed = Math.max( 20, Math.min( burnSpeed, 200 ) ); + this.burnSpeed = Math.max( 20, Math.min( this.burnSpeed, 200 ) ); return overFlow > 0 ? TickRateModulation.SLOWER : TickRateModulation.FASTER; } catch (GridAccessException e) { - burnSpeed -= TicksSinceLastCall; - burnSpeed = Math.max( 20, Math.min( burnSpeed, 200 ) ); + this.burnSpeed -= TicksSinceLastCall; + this.burnSpeed = Math.max( 20, Math.min( this.burnSpeed, 200 ) ); return TickRateModulation.SLOWER; } } private boolean canEatFuel() { - ItemStack is = getStackInSlot( 0 ); + ItemStack is = this.getStackInSlot( 0 ); if ( is != null ) { int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); @@ -225,14 +225,14 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka private void eatFuel() { - ItemStack is = getStackInSlot( 0 ); + ItemStack is = this.getStackInSlot( 0 ); if ( is != null ) { int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); if ( newBurnTime > 0 && is.stackSize > 0 ) { - burnTime += newBurnTime; - maxBurnTime = burnTime; + this.burnTime += newBurnTime; + this.maxBurnTime = this.burnTime; is.stackSize--; if ( is.stackSize <= 0 ) { @@ -241,18 +241,18 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka if ( is.getItem().hasContainerItem( is ) ) container = is.getItem().getContainerItem( is ); - setInventorySlotContents( 0, container ); + this.setInventorySlotContents( 0, container ); } else - setInventorySlotContents( 0, is ); + this.setInventorySlotContents( 0, is ); } } - if ( burnTime > 0 ) + if ( this.burnTime > 0 ) { try { - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -260,10 +260,10 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } } - if ( (!isOn && burnTime > 0) || (isOn && burnTime <= 0) ) + if ( (!this.isOn && this.burnTime > 0) || (this.isOn && this.burnTime <= 0) ) { - isOn = burnTime > 0; - markForUpdate(); + this.isOn = this.burnTime > 0; + this.markForUpdate(); } } } diff --git a/src/main/java/appeng/tile/networking/TileCableBus.java b/src/main/java/appeng/tile/networking/TileCableBus.java index 722cc17da..0d0ce6362 100644 --- a/src/main/java/appeng/tile/networking/TileCableBus.java +++ b/src/main/java/appeng/tile/networking/TileCableBus.java @@ -64,54 +64,54 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileCableBus(NBTTagCompound data) { - cb.readFromNBT( data ); + this.cb.readFromNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCableBus(NBTTagCompound data) { - cb.writeToNBT( data ); + this.cb.writeToNBT( data ); } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileCableBus(ByteBuf data) throws IOException { - boolean ret = cb.readFromStream( data ); + boolean ret = this.cb.readFromStream( data ); - int newLV = cb.getLightValue(); - if ( newLV != oldLV ) + int newLV = this.cb.getLightValue(); + if ( newLV != this.oldLV ) { - oldLV = newLV; - worldObj.func_147451_t( xCoord, yCoord, zCoord ); + this.oldLV = newLV; + this.worldObj.func_147451_t( this.xCoord, this.yCoord, this.zCoord ); // worldObj.updateAllLightTypes( xCoord, yCoord, zCoord ); } - updateTileSetting(); + this.updateTileSetting(); return ret; } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileCableBus(ByteBuf data) throws IOException { - cb.writeToStream( data ); + this.cb.writeToStream( data ); } @Override public boolean isInWorld() { - return cb.isInWorld(); + return this.cb.isInWorld(); } protected void updateTileSetting() { - if ( cb.requiresDynamicRender ) + if ( this.cb.requiresDynamicRender ) { TileCableBus tcb; try { tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance(); tcb.copyFrom( this ); - getWorldObj().setTileEntity( xCoord, yCoord, zCoord, tcb ); + this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb ); } catch (Throwable ignored) { @@ -122,9 +122,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl protected void copyFrom(TileCableBus oldTile) { - CableBusContainer tmpCB = cb; - cb = oldTile.cb; - oldLV = oldTile.oldLV; + CableBusContainer tmpCB = this.cb; + this.cb = oldTile.cb; + this.oldLV = oldTile.oldLV; oldTile.cb = tmpCB; } @@ -132,20 +132,20 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl public void onReady() { super.onReady(); - if ( cb.isEmpty() ) + if ( this.cb.isEmpty() ) { - if ( worldObj.getTileEntity( xCoord, yCoord, zCoord ) == this ) - worldObj.func_147480_a( xCoord, yCoord, zCoord, true ); + if ( this.worldObj.getTileEntity( this.xCoord, this.yCoord, this.zCoord ) == this ) + this.worldObj.func_147480_a( this.xCoord, this.yCoord, this.zCoord, true ); } else - cb.addToWorld(); + this.cb.addToWorld(); } @Override public void onChunkUnload() { super.onChunkUnload(); - cb.removeFromWorld(); + this.cb.removeFromWorld(); } @Override @@ -159,7 +159,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl public void invalidate() { super.invalidate(); - cb.removeFromWorld(); + this.cb.removeFromWorld(); } @Override @@ -177,43 +177,43 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public void getDrops(World w, int x, int y, int z, ArrayList drops) { - cb.getDrops( drops ); + this.cb.getDrops( drops ); } @Override public void getNoDrops(World w, int x, int y, int z, ArrayList drops) { - cb.getNoDrops( drops ); + this.cb.getNoDrops( drops ); } @Override public IGridNode getGridNode(ForgeDirection dir) { - return cb.getGridNode( dir ); + return this.cb.getGridNode( dir ); } @Override public boolean canAddPart(ItemStack is, ForgeDirection side) { - return cb.canAddPart( is, side ); + return this.cb.canAddPart( is, side ); } @Override public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer player) { - return cb.addPart( is, side, player ); + return this.cb.addPart( is, side, player ); } @Override public void removePart(ForgeDirection side, boolean suppressUpdate) { - cb.removePart( side, suppressUpdate ); + this.cb.removePart( side, suppressUpdate ); } @Override public IPart getPart(ForgeDirection side) { - return cb.getPart( side ); + return this.cb.getPart( side ); } @Override @@ -231,57 +231,57 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean visual) { - return cb.getSelectedBoundingBoxesFromPool( false, true, e, visual ); + return this.cb.getSelectedBoundingBoxesFromPool( false, true, e, visual ); } @Override public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e) { - for (AxisAlignedBB bx : getSelectedBoundingBoxesFromPool( w, x, y, z, e, false )) + for (AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, x, y, z, e, false )) out.add( AxisAlignedBB.getBoundingBox( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) ); } @Override public AECableType getCableConnectionType(ForgeDirection side) { - return cb.getCableConnectionType( side ); + return this.cb.getCableConnectionType( side ); } @Override public AEColor getColor() { - return cb.getColor(); + return this.cb.getColor(); } @Override public IFacadeContainer getFacadeContainer() { - return cb.getFacadeContainer(); + return this.cb.getFacadeContainer(); } @Override public void clearContainer() { - cb = new CableBusContainer( this ); + this.cb = new CableBusContainer( this ); } @Override public boolean isBlocked(ForgeDirection side) { - return !ImmibisMicroblocks_isSideOpen( side.ordinal() ); + return !this.ImmibisMicroblocks_isSideOpen( side.ordinal() ); } @Override public void markForUpdate() { - if ( worldObj == null ) + if ( this.worldObj == null ) return; - int newLV = cb.getLightValue(); - if ( newLV != oldLV ) + int newLV = this.cb.getLightValue(); + if ( newLV != this.oldLV ) { - oldLV = newLV; - worldObj.func_147451_t( xCoord, yCoord, zCoord ); + this.oldLV = newLV; + this.worldObj.func_147451_t( this.xCoord, this.yCoord, this.zCoord ); // worldObj.updateAllLightTypes( xCoord, yCoord, zCoord ); } @@ -291,20 +291,20 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public SelectedPart selectPart(Vec3 pos) { - return cb.selectPart( pos ); + return this.cb.selectPart( pos ); } @Override public void partChanged() { - notifyNeighbors(); + this.notifyNeighbors(); } @Override public void notifyNeighbors() { - if ( worldObj != null && worldObj.blockExists( xCoord, yCoord, zCoord ) && !CableBusContainer.isLoading() ) - Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); + if ( this.worldObj != null && this.worldObj.blockExists( this.xCoord, this.yCoord, this.zCoord ) && !CableBusContainer.isLoading() ) + Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord ); } @Override @@ -316,25 +316,25 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public boolean hasRedstone(ForgeDirection side) { - return cb.hasRedstone( side ); + return this.cb.hasRedstone( side ); } @Override public boolean isEmpty() { - return cb.isEmpty(); + return this.cb.isEmpty(); } @Override public boolean requiresTESR() { - return cb.requiresDynamicRender; + return this.cb.requiresDynamicRender; } @Override public Set getLayerFlags() { - return cb.getLayerFlags(); + return this.cb.getLayerFlags(); } @Override @@ -347,7 +347,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return; } - getWorldObj().setBlock( xCoord, yCoord, zCoord, Platform.air ); + this.getWorldObj().setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.air ); } /** @@ -363,13 +363,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl public void ImmibisMicroblocks_onMicroblocksChanged() { - cb.updateConnections(); + this.cb.updateConnections(); } @Override public boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who) { - return cb.recolourBlock( side, colour, who ); + return this.cb.recolourBlock( side, colour, who ); } } diff --git a/src/main/java/appeng/tile/networking/TileCableBusTESR.java b/src/main/java/appeng/tile/networking/TileCableBusTESR.java index 517466dd4..959f7eb0b 100644 --- a/src/main/java/appeng/tile/networking/TileCableBusTESR.java +++ b/src/main/java/appeng/tile/networking/TileCableBusTESR.java @@ -26,14 +26,14 @@ public class TileCableBusTESR extends TileCableBus @Override protected void updateTileSetting() { - if ( !cb.requiresDynamicRender ) + if ( !this.cb.requiresDynamicRender ) { TileCableBus tcb; try { tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance(); tcb.copyFrom( this ); - getWorldObj().setTileEntity( xCoord, yCoord, zCoord, tcb ); + this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb ); } catch (Throwable ignored) { diff --git a/src/main/java/appeng/tile/networking/TileController.java b/src/main/java/appeng/tile/networking/TileController.java index c9d1d198b..6b4730e00 100644 --- a/src/main/java/appeng/tile/networking/TileController.java +++ b/src/main/java/appeng/tile/networking/TileController.java @@ -43,10 +43,10 @@ public class TileController extends AENetworkPowerTile boolean isValid = false; public TileController() { - internalMaxPower = 8000; - internalPublicPowerStorage = true; - gridProxy.setIdlePowerUsage( 3 ); - gridProxy.setFlags( GridFlags.CANNOT_CARRY, GridFlags.DENSE_CAPACITY ); + this.internalMaxPower = 8000; + this.internalPublicPowerStorage = true; + this.gridProxy.setIdlePowerUsage( 3 ); + this.gridProxy.setFlags( GridFlags.CANNOT_CARRY, GridFlags.DENSE_CAPACITY ); } @Override @@ -60,7 +60,7 @@ public class TileController extends AENetworkPowerTile { try { - return gridProxy.getEnergy().getEnergyDemand( 8000 ); + return this.gridProxy.getEnergy().getEnergyDemand( 8000 ); } catch (GridAccessException e) { @@ -74,7 +74,7 @@ public class TileController extends AENetworkPowerTile { try { - double ret = gridProxy.getEnergy().injectPower( AEUnits, mode ); + double ret = this.gridProxy.getEnergy().injectPower( AEUnits, mode ); if ( mode == Actionable.SIMULATE ) return ret; return 0; @@ -91,7 +91,7 @@ public class TileController extends AENetworkPowerTile { try { - gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, x ) ); + this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, x ) ); } catch (GridAccessException e) { @@ -102,64 +102,64 @@ public class TileController extends AENetworkPowerTile @MENetworkEventSubscribe public void onControllerChange(MENetworkControllerChange status) { - updateMeta(); + this.updateMeta(); } @MENetworkEventSubscribe public void onPowerChange(MENetworkPowerStatusChange status) { - updateMeta(); + this.updateMeta(); } @Override public void onReady() { - onNeighborChange( true ); + this.onNeighborChange( true ); super.onReady(); } public void onNeighborChange(boolean force) { - boolean xx = worldObj.getTileEntity( xCoord - 1, yCoord, zCoord ) instanceof TileController - && worldObj.getTileEntity( xCoord + 1, yCoord, zCoord ) instanceof TileController; - boolean yy = worldObj.getTileEntity( xCoord, yCoord - 1, zCoord ) instanceof TileController - && worldObj.getTileEntity( xCoord, yCoord + 1, zCoord ) instanceof TileController; - boolean zz = worldObj.getTileEntity( xCoord, yCoord, zCoord - 1 ) instanceof TileController - && worldObj.getTileEntity( xCoord, yCoord, zCoord + 1 ) instanceof TileController; + boolean xx = this.worldObj.getTileEntity( this.xCoord - 1, this.yCoord, this.zCoord ) instanceof TileController + && this.worldObj.getTileEntity( this.xCoord + 1, this.yCoord, this.zCoord ) instanceof TileController; + boolean yy = this.worldObj.getTileEntity( this.xCoord, this.yCoord - 1, this.zCoord ) instanceof TileController + && this.worldObj.getTileEntity( this.xCoord, this.yCoord + 1, this.zCoord ) instanceof TileController; + boolean zz = this.worldObj.getTileEntity( this.xCoord, this.yCoord, this.zCoord - 1 ) instanceof TileController + && this.worldObj.getTileEntity( this.xCoord, this.yCoord, this.zCoord + 1 ) instanceof TileController; // int meta = world.getBlockMetadata( xCoord, yCoord, zCoord ); // boolean hasPower = meta > 0; // boolean isConflict = meta == 2; - boolean oldValid = isValid; + boolean oldValid = this.isValid; - isValid = (xx && !yy && !zz) || (!xx && yy && !zz) || (!xx && !yy && zz) || ((xx ? 1 : 0) + (yy ? 1 : 0) + (zz ? 1 : 0) <= 1); + this.isValid = (xx && !yy && !zz) || (!xx && yy && !zz) || (!xx && !yy && zz) || ((xx ? 1 : 0) + (yy ? 1 : 0) + (zz ? 1 : 0) <= 1); - if ( oldValid != isValid || force ) + if ( oldValid != this.isValid || force ) { - if ( isValid ) - gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); + if ( this.isValid ) + this.gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); else - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } - updateMeta(); + this.updateMeta(); } private void updateMeta() { - if ( !gridProxy.isReady() ) + if ( !this.gridProxy.isReady() ) return; int meta = 0; try { - if ( gridProxy.getEnergy().isNetworkPowered() ) + if ( this.gridProxy.getEnergy().isNetworkPowered() ) { meta = 1; - if ( gridProxy.getPath().getControllerState() == ControllerState.CONTROLLER_CONFLICT ) + if ( this.gridProxy.getPath().getControllerState() == ControllerState.CONTROLLER_CONFLICT ) meta = 2; } } @@ -168,7 +168,7 @@ public class TileController extends AENetworkPowerTile meta = 0; } - worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, meta, 2 ); + this.worldObj.setBlockMetadataWithNotify( this.xCoord, this.yCoord, this.zCoord, meta, 2 ); } final int sides[] = new int[] {}; @@ -189,7 +189,7 @@ public class TileController extends AENetworkPowerTile @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } } diff --git a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java index 6311febb1..2906b9ec9 100644 --- a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java @@ -30,7 +30,7 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto { public TileCreativeEnergyCell() { - gridProxy.setIdlePowerUsage( 0 ); + this.gridProxy.setIdlePowerUsage( 0 ); } @Override diff --git a/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java b/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java index 11e39627a..8e4e842e2 100644 --- a/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java @@ -22,7 +22,7 @@ public class TileDenseEnergyCell extends TileEnergyCell { public TileDenseEnergyCell() { - internalMaxPower = 200000 * 8; + this.internalMaxPower = 200000 * 8; } } diff --git a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java index b334a2229..1fbfe8000 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java +++ b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java @@ -47,16 +47,16 @@ public class TileEnergyAcceptor extends AENetworkPowerTile @TileEvent(TileEventType.TICK) public void Tick_TileEnergyAcceptor() { - if ( internalCurrentPower > 0 ) + if ( this.internalCurrentPower > 0 ) { try { - IEnergyGrid eg = gridProxy.getEnergy(); - double powerRequested = internalCurrentPower - eg.injectPower( internalCurrentPower, Actionable.SIMULATE ); + IEnergyGrid eg = this.gridProxy.getEnergy(); + double powerRequested = this.internalCurrentPower - eg.injectPower( this.internalCurrentPower, Actionable.SIMULATE ); if ( powerRequested > 0 ) { - eg.injectPower( extractAEPower( powerRequested, Actionable.MODULATE, PowerMultiplier.ONE ), Actionable.MODULATE ); + eg.injectPower( this.extractAEPower( powerRequested, Actionable.MODULATE, PowerMultiplier.ONE ), Actionable.MODULATE ); } } catch (GridAccessException e) @@ -72,7 +72,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile { try { - IEnergyGrid grid = gridProxy.getEnergy(); + IEnergyGrid grid = this.gridProxy.getEnergy(); return grid.getEnergyDemand( maxRequired ); } catch (GridAccessException e) @@ -86,7 +86,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile { try { - IEnergyGrid grid = gridProxy.getEnergy(); + IEnergyGrid grid = this.gridProxy.getEnergy(); double leftOver = grid.injectPower( newPower, mode ); if ( mode == Actionable.SIMULATE ) return leftOver; @@ -99,8 +99,8 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } public TileEnergyAcceptor() { - gridProxy.setIdlePowerUsage( 0.0 ); - internalMaxPower = 100; + this.gridProxy.setIdlePowerUsage( 0.0 ); + this.internalMaxPower = 100; } @Override @@ -118,7 +118,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } } diff --git a/src/main/java/appeng/tile/networking/TileEnergyCell.java b/src/main/java/appeng/tile/networking/TileEnergyCell.java index 6fe166e70..a8f0c3709 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileEnergyCell.java @@ -49,38 +49,38 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage private void changePowerLevel() { - if ( notLoaded() ) + if ( this.notLoaded() ) return; - byte boundMetadata = (byte) (8.0 * (internalCurrentPower / internalMaxPower)); + byte boundMetadata = (byte) (8.0 * (this.internalCurrentPower / this.internalMaxPower)); if ( boundMetadata > 7 ) boundMetadata = 7; if ( boundMetadata < 0 ) boundMetadata = 0; - if ( currentMeta != boundMetadata ) + if ( this.currentMeta != boundMetadata ) { - currentMeta = boundMetadata; - worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, currentMeta, 2 ); + this.currentMeta = boundMetadata; + this.worldObj.setBlockMetadataWithNotify( this.xCoord, this.yCoord, this.zCoord, this.currentMeta, 2 ); } } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileEnergyCell(NBTTagCompound data) { - if ( !worldObj.isRemote ) - data.setDouble( "internalCurrentPower", internalCurrentPower ); + if ( !this.worldObj.isRemote ) + data.setDouble( "internalCurrentPower", this.internalCurrentPower ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileEnergyCell(NBTTagCompound data) { - internalCurrentPower = data.getDouble( "internalCurrentPower" ); + this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } public TileEnergyCell() { - gridProxy.setIdlePowerUsage( 0 ); + this.gridProxy.setIdlePowerUsage( 0 ); } @Override @@ -94,29 +94,29 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { if ( mode == Actionable.SIMULATE ) { - double fakeBattery = internalCurrentPower + amt; - if ( fakeBattery > internalMaxPower ) + double fakeBattery = this.internalCurrentPower + amt; + if ( fakeBattery > this.internalMaxPower ) { - return fakeBattery - internalMaxPower; + return fakeBattery - this.internalMaxPower; } return 0; } - if ( internalCurrentPower < 0.01 && amt > 0.01 ) - gridProxy.getNode().getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.PROVIDE_POWER ) ); + if ( this.internalCurrentPower < 0.01 && amt > 0.01 ) + this.gridProxy.getNode().getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.PROVIDE_POWER ) ); - internalCurrentPower += amt; - if ( internalCurrentPower > internalMaxPower ) + this.internalCurrentPower += amt; + if ( this.internalCurrentPower > this.internalMaxPower ) { - amt = internalCurrentPower - internalMaxPower; - internalCurrentPower = internalMaxPower; + amt = this.internalCurrentPower - this.internalMaxPower; + this.internalCurrentPower = this.internalMaxPower; - changePowerLevel(); + this.changePowerLevel(); return amt; } - changePowerLevel(); + this.changePowerLevel(); return 0; } @@ -124,18 +124,18 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { if ( mode == Actionable.SIMULATE ) { - if ( internalCurrentPower > amt ) + if ( this.internalCurrentPower > amt ) return amt; - return internalCurrentPower; + return this.internalCurrentPower; } - boolean wasFull = internalCurrentPower >= internalMaxPower - 0.001; + boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if ( wasFull && amt > 0.001 ) { try { - gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); + this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } catch (GridAccessException ignored) { @@ -143,37 +143,37 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } } - if ( internalCurrentPower > amt ) + if ( this.internalCurrentPower > amt ) { - internalCurrentPower -= amt; + this.internalCurrentPower -= amt; - changePowerLevel(); + this.changePowerLevel(); return amt; } - amt = internalCurrentPower; - internalCurrentPower = 0; + amt = this.internalCurrentPower; + this.internalCurrentPower = 0; - changePowerLevel(); + this.changePowerLevel(); return amt; } @Override final public double extractAEPower(double amt, Actionable mode, PowerMultiplier pm) { - return pm.divide( extractAEPower( pm.multiply( amt ), mode ) ); + return pm.divide( this.extractAEPower( pm.multiply( amt ), mode ) ); } @Override public double getAEMaxPower() { - return internalMaxPower; + return this.internalMaxPower; } @Override public double getAECurrentPower() { - return internalCurrentPower; + return this.internalCurrentPower; } @Override @@ -192,8 +192,8 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage public void onReady() { super.onReady(); - currentMeta = (byte) worldObj.getBlockMetadata( xCoord, yCoord, zCoord ); - changePowerLevel(); + this.currentMeta = (byte) this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ); + this.changePowerLevel(); } @Override @@ -202,8 +202,8 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage if ( from == SettingsFrom.DISMANTLE_ITEM ) { NBTTagCompound tag = new NBTTagCompound(); - tag.setDouble( "internalCurrentPower", internalCurrentPower ); - tag.setDouble( "internalMaxPower", internalMaxPower ); // used for tool tip. + tag.setDouble( "internalCurrentPower", this.internalCurrentPower ); + tag.setDouble( "internalMaxPower", this.internalMaxPower ); // used for tool tip. return tag; } return null; @@ -214,7 +214,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { if ( from == SettingsFrom.DISMANTLE_ITEM ) { - internalCurrentPower = compound.getDouble( "internalCurrentPower" ); + this.internalCurrentPower = compound.getDouble( "internalCurrentPower" ); } } } diff --git a/src/main/java/appeng/tile/networking/TileWireless.java b/src/main/java/appeng/tile/networking/TileWireless.java index d42ad0a31..49526c64c 100644 --- a/src/main/java/appeng/tile/networking/TileWireless.java +++ b/src/main/java/appeng/tile/networking/TileWireless.java @@ -61,57 +61,57 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi public TileWireless() { - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); - gridProxy.setValidSides( EnumSet.of( getForward().getOpposite() ) ); + this.gridProxy.setValidSides( EnumSet.of( this.getForward().getOpposite() ) ); } @MENetworkEventSubscribe public void chanRender( MENetworkChannelsChanged c ) { - markForUpdate(); + this.markForUpdate(); } @MENetworkEventSubscribe public void powerRender( MENetworkPowerStatusChange c ) { - markForUpdate(); + this.markForUpdate(); } @TileEvent( TileEventType.NETWORK_READ ) public boolean readFromStream_TileWireless( ByteBuf data ) { - int old = clientFlags; - clientFlags = data.readByte(); + int old = this.clientFlags; + this.clientFlags = data.readByte(); - return old != clientFlags; + return old != this.clientFlags; } @TileEvent( TileEventType.NETWORK_WRITE ) public void writeToStream_TileWireless( ByteBuf data ) { - clientFlags = 0; + this.clientFlags = 0; try { - if ( gridProxy.getEnergy().isNetworkPowered() ) - clientFlags |= POWERED_FLAG; + if ( this.gridProxy.getEnergy().isNetworkPowered() ) + this.clientFlags |= POWERED_FLAG; - if ( gridProxy.getNode().meetsChannelRequirements() ) - clientFlags |= CHANNEL_FLAG; + if ( this.gridProxy.getNode().meetsChannelRequirements() ) + this.clientFlags |= CHANNEL_FLAG; } catch ( GridAccessException e ) { // meh } - data.writeByte( ( byte ) clientFlags ); + data.writeByte( ( byte ) this.clientFlags ); } @Override @@ -129,46 +129,46 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public void onReady() { - updatePower(); + this.updatePower(); super.onReady(); } @Override public void markDirty() { - updatePower(); + this.updatePower(); } private void updatePower() { - gridProxy.setIdlePowerUsage( AEConfig.instance.wireless_getPowerDrain( getBoosters() ) ); + this.gridProxy.setIdlePowerUsage( AEConfig.instance.wireless_getPowerDrain( this.getBoosters() ) ); } @Override public int[] getAccessibleSlotsBySide( ForgeDirection side ) { - return sides; + return this.sides; } @Override public double getRange() { - return AEConfig.instance.wireless_getMaxRange( getBoosters() ); + return AEConfig.instance.wireless_getMaxRange( this.getBoosters() ); } @Override public boolean isActive() { if ( Platform.isClient() ) - return isPowered() && ( CHANNEL_FLAG == ( clientFlags & CHANNEL_FLAG ) ); + return this.isPowered() && ( CHANNEL_FLAG == ( this.clientFlags & CHANNEL_FLAG ) ); - return gridProxy.isActive(); + return this.gridProxy.isActive(); } @Override @@ -176,7 +176,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi { try { - return gridProxy.getGrid(); + return this.gridProxy.getGrid(); } catch ( GridAccessException e ) { @@ -186,7 +186,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi private int getBoosters() { - ItemStack boosters = inv.getStackInSlot( 0 ); + ItemStack boosters = this.inv.getStackInSlot( 0 ); return boosters == null ? 0 : boosters.stackSize; } @@ -205,7 +205,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi @Override public boolean isPowered() { - return POWERED_FLAG == ( clientFlags & POWERED_FLAG ); + return POWERED_FLAG == ( this.clientFlags & POWERED_FLAG ); } } diff --git a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java index 84a3e3942..456e2c20f 100644 --- a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java +++ b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java @@ -49,45 +49,45 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe protected void setPowerSides(EnumSet sides) { - internalPowerSides = sides; + this.internalPowerSides = sides; // trigger re-calc! } protected EnumSet getPowerSides() { - return internalPowerSides.clone(); + return this.internalPowerSides.clone(); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_AERootPoweredTile(NBTTagCompound data) { - data.setDouble( "internalCurrentPower", internalCurrentPower ); + data.setDouble( "internalCurrentPower", this.internalCurrentPower ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_AERootPoweredTile(NBTTagCompound data) { - internalCurrentPower = data.getDouble( "internalCurrentPower" ); + this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } final protected double getExternalPowerDemand(PowerUnits externalUnit, double maxPowerRequired) { - return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) ); + return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, this.getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) ); } protected double getFunnelPowerDemand(double maxRequired) { - return internalMaxPower - internalCurrentPower; + return this.internalMaxPower - this.internalCurrentPower; } final public double injectExternalPower(PowerUnits input, double amt) { - return PowerUnits.AE.convertTo( input, funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) ); + return PowerUnits.AE.convertTo( input, this.funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) ); } protected double funnelPowerIntoStorage(double AEUnits, Actionable mode) { - return injectAEPower( AEUnits, mode ); + return this.injectAEPower( AEUnits, mode ); } @Override @@ -98,23 +98,23 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe if ( mode == Actionable.SIMULATE ) { - double fakeBattery = internalCurrentPower + amt; + double fakeBattery = this.internalCurrentPower + amt; - if ( fakeBattery > internalMaxPower ) - return fakeBattery - internalMaxPower; + if ( fakeBattery > this.internalMaxPower ) + return fakeBattery - this.internalMaxPower; return 0; } else { - if ( internalCurrentPower < 0.01 && amt > 0.01 ) - PowerEvent( PowerEventType.PROVIDE_POWER ); + if ( this.internalCurrentPower < 0.01 && amt > 0.01 ) + this.PowerEvent( PowerEventType.PROVIDE_POWER ); - internalCurrentPower += amt; - if ( internalCurrentPower > internalMaxPower ) + this.internalCurrentPower += amt; + if ( this.internalCurrentPower > this.internalMaxPower ) { - amt = internalCurrentPower - internalMaxPower; - internalCurrentPower = internalMaxPower; + amt = this.internalCurrentPower - this.internalMaxPower; + this.internalCurrentPower = this.internalMaxPower; return amt; } @@ -131,55 +131,55 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe { if ( mode == Actionable.SIMULATE ) { - if ( internalCurrentPower > amt ) + if ( this.internalCurrentPower > amt ) return amt; - return internalCurrentPower; + return this.internalCurrentPower; } - boolean wasFull = internalCurrentPower >= internalMaxPower - 0.001; + boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if ( wasFull && amt > 0.001 ) { - PowerEvent( PowerEventType.REQUEST_POWER ); + this.PowerEvent( PowerEventType.REQUEST_POWER ); } - if ( internalCurrentPower > amt ) + if ( this.internalCurrentPower > amt ) { - internalCurrentPower -= amt; + this.internalCurrentPower -= amt; return amt; } - amt = internalCurrentPower; - internalCurrentPower = 0; + amt = this.internalCurrentPower; + this.internalCurrentPower = 0; return amt; } @Override final public double extractAEPower(double amt, Actionable mode, PowerMultiplier multiplier) { - return multiplier.divide( extractAEPower( multiplier.multiply( amt ), mode ) ); + return multiplier.divide( this.extractAEPower( multiplier.multiply( amt ), mode ) ); } @Override final public double getAEMaxPower() { - return internalMaxPower; + return this.internalMaxPower; } @Override final public double getAECurrentPower() { - return internalCurrentPower; + return this.internalCurrentPower; } @Override final public boolean isAEPublicPowerStorage() { - return internalPublicPowerStorage; + return this.internalPublicPowerStorage; } @Override final public AccessRestriction getPowerFlow() { - return internalPowerFlow; + return this.internalPowerFlow; } } diff --git a/src/main/java/appeng/tile/powersink/IC2.java b/src/main/java/appeng/tile/powersink/IC2.java index aafd251ce..7b40ac6bd 100644 --- a/src/main/java/appeng/tile/powersink/IC2.java +++ b/src/main/java/appeng/tile/powersink/IC2.java @@ -40,13 +40,13 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink @Override final public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - return getPowerSides().contains( direction ); + return this.getPowerSides().contains( direction ); } @Override final public double getDemandedEnergy() { - return getExternalPowerDemand( PowerUnits.EU, Double.MAX_VALUE ); + return this.getExternalPowerDemand( PowerUnits.EU, Double.MAX_VALUE ); } @Override @@ -54,8 +54,8 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink { // just store the excess in the current block, if I return the waste, // IC2 will just disintegrate it - Oct 20th 2013 - double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, injectExternalPower( PowerUnits.EU, amount ) ); - internalCurrentPower += overflow; + double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, this.injectExternalPower( PowerUnits.EU, amount ) ); + this.internalCurrentPower += overflow; return 0; // see above comment. } @@ -69,29 +69,29 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink public void invalidate() { super.invalidate(); - removeFromENet(); + this.removeFromENet(); } @Override public void onChunkUnload() { super.onChunkUnload(); - removeFromENet(); + this.removeFromENet(); } @Override public void onReady() { super.onReady(); - addToENet(); + this.addToENet(); } @Override protected void setPowerSides(EnumSet sides) { super.setPowerSides( sides ); - removeFromENet(); - addToENet(); + this.removeFromENet(); + this.addToENet(); } private void addToENet() @@ -99,10 +99,10 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) { IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); - if ( !isInIC2 && Platform.isServer() && ic2Integration != null ) + if ( !this.isInIC2 && Platform.isServer() && ic2Integration != null ) { ic2Integration.addToEnergyNet( this ); - isInIC2 = true; + this.isInIC2 = true; } } } @@ -112,10 +112,10 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) { IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 ); - if ( isInIC2 && Platform.isServer() && ic2Integration != null ) + if ( this.isInIC2 && Platform.isServer() && ic2Integration != null ) { ic2Integration.removeFromEnergyNet( this ); - isInIC2 = false; + this.isInIC2 = false; } } } diff --git a/src/main/java/appeng/tile/powersink/MekJoules.java b/src/main/java/appeng/tile/powersink/MekJoules.java index bbfc5c20a..2ddd64d20 100644 --- a/src/main/java/appeng/tile/powersink/MekJoules.java +++ b/src/main/java/appeng/tile/powersink/MekJoules.java @@ -33,8 +33,8 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc @Override public void setEnergy(double energy) { - double extra = injectExternalPower( PowerUnits.MK, energy ); - internalCurrentPower += PowerUnits.MK.convertTo(PowerUnits.AE, extra ); + double extra = this.injectExternalPower( PowerUnits.MK, energy ); + this.internalCurrentPower += PowerUnits.MK.convertTo(PowerUnits.AE, extra ); } @Override @@ -45,17 +45,17 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc @Override public double transferEnergyToAcceptor(ForgeDirection side, double amount) { - double demand = getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); + double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); if ( amount > demand ) amount = demand; - double overflow = injectExternalPower( PowerUnits.MK, amount ); + double overflow = this.injectExternalPower( PowerUnits.MK, amount ); return amount - overflow; } @Override public boolean canReceiveEnergy(ForgeDirection side) { - return getPowerSides().contains(side); + return this.getPowerSides().contains(side); } } diff --git a/src/main/java/appeng/tile/powersink/MinecraftJoules5.java b/src/main/java/appeng/tile/powersink/MinecraftJoules5.java index 91a4674c8..54ed243d7 100644 --- a/src/main/java/appeng/tile/powersink/MinecraftJoules5.java +++ b/src/main/java/appeng/tile/powersink/MinecraftJoules5.java @@ -44,8 +44,8 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow @TileEvent(TileEventType.TICK) public void Tick_MinecraftJoules5() { - if ( bcPowerWrapper != null ) - bcPowerWrapper.Tick(); + if ( this.bcPowerWrapper != null ) + this.bcPowerWrapper.Tick(); } public MinecraftJoules5() { @@ -58,9 +58,9 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow IMJ5 mjIntegration = (IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 ); if ( mjIntegration != null ) { - bcPowerWrapper = (BaseMJPerdition) mjIntegration.createPerdition( this ); - if ( bcPowerWrapper != null ) - bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 ); + this.bcPowerWrapper = (BaseMJPerdition) mjIntegration.createPerdition( this ); + if ( this.bcPowerWrapper != null ) + this.bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 ); } } } @@ -75,8 +75,8 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow @Method(iname = "MJ5") final public PowerReceiver getPowerReceiver(ForgeDirection side) { - if ( getPowerSides().contains( side ) && bcPowerWrapper != null ) - return bcPowerWrapper.getPowerReceiver(); + if ( this.getPowerSides().contains( side ) && this.bcPowerWrapper != null ) + return this.bcPowerWrapper.getPowerReceiver(); return null; } @@ -84,17 +84,17 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow @Method(iname = "MJ5") final public void doWork(PowerHandler workProvider) { - float required = (float) getExternalPowerDemand( PowerUnits.MJ, bcPowerWrapper.getPowerReceiver().getEnergyStored() ); - double failed = injectExternalPower( PowerUnits.MJ, bcPowerWrapper.useEnergy( 0.0f, required, true ) ); + float required = (float) this.getExternalPowerDemand( PowerUnits.MJ, this.bcPowerWrapper.getPowerReceiver().getEnergyStored() ); + double failed = this.injectExternalPower( PowerUnits.MJ, this.bcPowerWrapper.useEnergy( 0.0f, required, true ) ); if ( failed > 0.01 ) - bcPowerWrapper.addEnergy( (float) failed ); + this.bcPowerWrapper.addEnergy( (float) failed ); } @Override @Method(iname = "MJ5") final public World getWorld() { - return worldObj; + return this.worldObj; } } diff --git a/src/main/java/appeng/tile/powersink/MinecraftJoules6.java b/src/main/java/appeng/tile/powersink/MinecraftJoules6.java index 9d181b2fd..3c1241545 100644 --- a/src/main/java/appeng/tile/powersink/MinecraftJoules6.java +++ b/src/main/java/appeng/tile/powersink/MinecraftJoules6.java @@ -41,18 +41,18 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt @Method(iname = "MJ6") public double getEnergyRequested() { - return getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE ); + return this.getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE ); } @Override @Method(iname = "MJ6") public double addEnergy(double amount) { - double demand = getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE ); + double demand = this.getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE ); if ( amount > demand ) amount = demand; - double overflow = injectExternalPower( PowerUnits.MJ, amount ); + double overflow = this.injectExternalPower( PowerUnits.MJ, amount ); return amount - overflow; } @@ -60,7 +60,7 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt @Method(iname = "MJ6") public double addEnergy(double amount, boolean ignoreCycleLimit) { - double overflow = injectExternalPower( PowerUnits.MJ, amount ); + double overflow = this.injectExternalPower( PowerUnits.MJ, amount ); return amount - overflow; } @@ -68,21 +68,21 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt @Method(iname = "MJ6") public double getEnergyStored() { - return PowerUnits.AE.convertTo( PowerUnits.MJ, internalCurrentPower ); + return PowerUnits.AE.convertTo( PowerUnits.MJ, this.internalCurrentPower ); } @Override @Method(iname = "MJ6") public void setEnergyStored(double mj) { - internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj ); + this.internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj ); } @Override @Method(iname = "MJ6") public double maxCapacity() { - return PowerUnits.AE.convertTo( PowerUnits.MJ, internalMaxPower ); + return PowerUnits.AE.convertTo( PowerUnits.MJ, this.internalMaxPower ); } @Override @@ -103,7 +103,7 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt @Method(iname = "MJ6") public IBatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption) { - return getMjBattery( "" ); + return this.getMjBattery( "" ); } @Override diff --git a/src/main/java/appeng/tile/powersink/RotaryCraft.java b/src/main/java/appeng/tile/powersink/RotaryCraft.java index d4201556f..80eafccfa 100644 --- a/src/main/java/appeng/tile/powersink/RotaryCraft.java +++ b/src/main/java/appeng/tile/powersink/RotaryCraft.java @@ -40,26 +40,26 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver @Method(iname = "RotaryCraft") public void Tick_RotaryCraft() { - if ( worldObj != null && !worldObj.isRemote && power > 0 ) - injectExternalPower( PowerUnits.WA, power ); + if ( this.worldObj != null && !this.worldObj.isRemote && this.power > 0 ) + this.injectExternalPower( PowerUnits.WA, this.power ); } @Override final public int getOmega() { - return omega; + return this.omega; } @Override final public int getTorque() { - return torque; + return this.torque; } @Override final public long getPower() { - return power; + return this.power; } @Override @@ -71,44 +71,44 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver @Override final public int getIORenderAlpha() { - return alpha; + return this.alpha; } @Override final public void setIORenderAlpha(int io) { - alpha = io; + this.alpha = io; } @Override final public int getMachineX() { - return xCoord; + return this.xCoord; } @Override final public int getMachineY() { - return yCoord; + return this.yCoord; } @Override final public int getMachineZ() { - return zCoord; + return this.zCoord; } @Override final public void setOmega(int o) { - omega = o; + this.omega = o; } @Override final public void setTorque(int t) { - torque = t; + this.torque = t; } @Override @@ -117,27 +117,27 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver if ( Platform.isClient() ) return; - power = p; + this.power = p; } final public boolean canReadFromBlock(int x, int y, int z) { ForgeDirection side = ForgeDirection.UNKNOWN; - if ( x == xCoord - 1 ) + if ( x == this.xCoord - 1 ) side = ForgeDirection.WEST; - else if ( x == xCoord + 1 ) + else if ( x == this.xCoord + 1 ) side = ForgeDirection.EAST; - else if ( z == zCoord - 1 ) + else if ( z == this.zCoord - 1 ) side = ForgeDirection.NORTH; - else if ( z == zCoord + 1 ) + else if ( z == this.zCoord + 1 ) side = ForgeDirection.SOUTH; - else if ( y == yCoord - 1 ) + else if ( y == this.yCoord - 1 ) side = ForgeDirection.DOWN; - else if ( y == yCoord + 1 ) + else if ( y == this.yCoord + 1 ) side = ForgeDirection.UP; - return getPowerSides().contains( side ); + return this.getPowerSides().contains( side ); } @Override @@ -149,15 +149,15 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver @Override final public void noInputMachine() { - power = 0; - torque = 0; - omega = 0; + this.power = 0; + this.torque = 0; + this.omega = 0; } @Override final public boolean canReadFrom(ForgeDirection side) { - return getPowerSides().contains( side ); + return this.getPowerSides().contains( side ); } @Override diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index adabcf4ce..4977f1a3b 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -70,25 +70,25 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @TileEvent(TileEventType.TICK) public void Tick_TileQuantumBridge() { - if ( updateStatus ) + if ( this.updateStatus ) { - updateStatus = false; - if ( cluster != null ) - cluster.updateStatus( true ); - markForUpdate(); + this.updateStatus = false; + if ( this.cluster != null ) + this.cluster.updateStatus( true ); + this.markForUpdate(); } } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileQuantumBridge(ByteBuf data) { - int out = constructed; + int out = this.constructed; - if ( getStackInSlot( 0 ) != null && constructed != -1 ) - out = out | hasSingularity; + if ( this.getStackInSlot( 0 ) != null && this.constructed != -1 ) + out = out | this.hasSingularity; - if ( gridProxy.isActive() && constructed != -1 ) - out = out | powered; + if ( this.gridProxy.isActive() && this.constructed != -1 ) + out = out | this.powered; data.writeByte( (byte) out ); } @@ -96,121 +96,121 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileQuantumBridge(ByteBuf data) { - int oldValue = constructed; - constructed = data.readByte(); - bridgePowered = (constructed | powered) == powered; - return constructed != oldValue; + int oldValue = this.constructed; + this.constructed = data.readByte(); + this.bridgePowered = (this.constructed | this.powered) == this.powered; + return this.constructed != oldValue; } public TileQuantumBridge() { - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - gridProxy.setFlags( GridFlags.DENSE_CAPACITY ); - gridProxy.setIdlePowerUsage( 22 ); - inv.setMaxStackSize( 1 ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags( GridFlags.DENSE_CAPACITY ); + this.gridProxy.setIdlePowerUsage( 22 ); + this.inv.setMaxStackSize( 1 ); } @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @MENetworkEventSubscribe public void PowerSwitch(MENetworkPowerStatusChange c) { - updateStatus = true; + this.updateStatus = true; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( cluster != null ) - cluster.updateStatus( true ); + if ( this.cluster != null ) + this.cluster.updateStatus( true ); } @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - if ( isCenter() ) - return sidesLink; - return sidesRing; + if ( this.isCenter() ) + return this.sidesLink; + return this.sidesRing; } @Override public void disconnect(boolean affectWorld) { - if ( cluster != null ) + if ( this.cluster != null ) { if ( !affectWorld ) - cluster.updateStatus = false; + this.cluster.updateStatus = false; - cluster.destroy(); + this.cluster.destroy(); } - cluster = null; + this.cluster = null; if ( affectWorld ) - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override public IAECluster getCluster() { - return cluster; + return this.cluster; } @Override public boolean isValid() { - return !isInvalid(); + return !this.isInvalid(); } @Override public void onReady() { super.onReady(); - if ( worldObj.getBlock( xCoord, yCoord, zCoord ) == AEApi.instance().blocks().blockQuantumRing.block() ) - gridProxy.setVisualRepresentation( ring ); + if ( this.worldObj.getBlock( this.xCoord, this.yCoord, this.zCoord ) == AEApi.instance().blocks().blockQuantumRing.block() ) + this.gridProxy.setVisualRepresentation( ring ); } @Override public void invalidate() { - disconnect( false ); + this.disconnect( false ); super.invalidate(); } @Override public void onChunkUnload() { - disconnect( false ); + this.disconnect( false ); super.onChunkUnload(); } public void updateStatus(QuantumCluster c, byte flags, boolean affectWorld) { - cluster = c; + this.cluster = c; if ( affectWorld ) { - if ( constructed != flags ) + if ( this.constructed != flags ) { - constructed = flags; - markForUpdate(); + this.constructed = flags; + this.markForUpdate(); } - if ( isCorner() || isCenter() ) + if ( this.isCorner() || this.isCenter() ) { - gridProxy.setValidSides( getConnections() ); + this.gridProxy.setValidSides( this.getConnections() ); } else - gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); + this.gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); } } public long getQEFrequency() { - ItemStack is = inv.getStackInSlot( 0 ); + ItemStack is = this.inv.getStackInSlot( 0 ); if ( is != null ) { NBTTagCompound c = is.getTagCompound(); @@ -222,22 +222,22 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isCenter() { - return getBlockType() == AEApi.instance().blocks().blockQuantumLink.block(); + return this.getBlockType() == AEApi.instance().blocks().blockQuantumLink.block(); } public boolean isCorner() { - return (constructed & corner) == corner && constructed != -1; + return (this.constructed & this.corner) == this.corner && this.constructed != -1; } public boolean isPowered() { if ( Platform.isClient() ) - return (constructed & powered) == powered && constructed != -1; + return (this.constructed & this.powered) == this.powered && this.constructed != -1; try { - return gridProxy.getEnergy().isNetworkPowered(); + return this.gridProxy.getEnergy().isNetworkPowered(); } catch (GridAccessException e) { @@ -249,7 +249,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isFormed() { - return constructed != -1; + return this.constructed != -1; } @Override @@ -266,7 +266,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public void neighborUpdate() { - calc.calculateMultiblock( worldObj, getLocation() ); + this.calc.calculateMultiblock( this.worldObj, this.getLocation() ); } public EnumSet getConnections() @@ -275,7 +275,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { - TileEntity te = worldObj.getTileEntity( xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ ); + TileEntity te = this.worldObj.getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); if ( te instanceof TileQuantumBridge ) set.add( d ); } @@ -285,15 +285,15 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean hasQES() { - if ( constructed == -1 ) + if ( this.constructed == -1 ) return false; - return (constructed & hasSingularity) == hasSingularity; + return (this.constructed & this.hasSingularity) == this.hasSingularity; } public void breakCluster() { - if ( cluster != null ) - cluster.destroy(); + if ( this.cluster != null ) + this.cluster.destroy(); } } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index 06644ec7b..442837cf7 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -56,45 +56,45 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileSpatialIOPort(NBTTagCompound data) { - data.setInteger( "lastRedstoneState", lastRedstoneState.ordinal() ); + data.setInteger( "lastRedstoneState", this.lastRedstoneState.ordinal() ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileSpatialIOPort(NBTTagCompound data) { if ( data.hasKey( "lastRedstoneState" ) ) - lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )]; + this.lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )]; } public TileSpatialIOPort() { - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); } public void updateRedstoneState() { - YesNo currentState = worldObj.isBlockIndirectlyGettingPowered( xCoord, yCoord, zCoord ) ? YesNo.YES : YesNo.NO; - if ( lastRedstoneState != currentState ) + YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; + if ( this.lastRedstoneState != currentState ) { - lastRedstoneState = currentState; - if ( lastRedstoneState == YesNo.YES ) - triggerTransition(); + this.lastRedstoneState = currentState; + if ( this.lastRedstoneState == YesNo.YES ) + this.triggerTransition(); } } public boolean getRedstoneState() { - if ( lastRedstoneState == YesNo.UNDECIDED ) - updateRedstoneState(); + if ( this.lastRedstoneState == YesNo.UNDECIDED ) + this.updateRedstoneState(); - return lastRedstoneState == YesNo.YES; + return this.lastRedstoneState == YesNo.YES; } private void triggerTransition() { if ( Platform.isServer() ) { - ItemStack cell = getStackInSlot( 0 ); - if ( isSpatialCell( cell ) ) + ItemStack cell = this.getStackInSlot( 0 ); + if ( this.isSpatialCell( cell ) ) { TickHandler.instance.addCallable( null, this );// this needs to be cross world synced. } @@ -105,11 +105,11 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable public Object call() throws Exception { - ItemStack cell = getStackInSlot( 0 ); - if ( isSpatialCell( cell ) && getStackInSlot( 1 ) == null ) + ItemStack cell = this.getStackInSlot( 0 ); + if ( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null ) { - IGrid gi = gridProxy.getGrid(); - IEnergyGrid energy = gridProxy.getEnergy(); + IGrid gi = this.gridProxy.getGrid(); + IEnergyGrid energy = this.gridProxy.getEnergy(); ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); @@ -123,12 +123,12 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) ); if ( !res.isCanceled() ) { - TransitionResult tr = sc.doSpatialTransition( cell, worldObj, spc.getMin(), spc.getMax(), true ); + TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true ); if ( tr.success ) { energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); - setInventorySlotContents( 0, null ); - setInventorySlotContents( 1, cell ); + this.setInventorySlotContents( 0, null ); + this.setInventorySlotContents( 1, cell ); } } } @@ -153,13 +153,13 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return (i == 0 && isSpatialCell( itemstack )); + return (i == 0 && this.isSpatialCell( itemstack )); } private boolean isSpatialCell(ItemStack cell) @@ -175,7 +175,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return isItemValidForSlot( i, itemstack ); + return this.isItemValidForSlot( i, itemstack ); } @Override @@ -193,7 +193,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java index 034acc3d4..95b83f895 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java @@ -61,7 +61,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @Override protected AENetworkProxy createProxy() { - return new AENetworkProxyMultiblock( this, "proxy", getItemFromTile( this ), true ); + return new AENetworkProxyMultiblock( this, "proxy", this.getItemFromTile( this ), true ); } @Override @@ -73,46 +73,46 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileSpatialPylon(ByteBuf data) { - int old = displayBits; - displayBits = data.readByte(); - return old != displayBits; + int old = this.displayBits; + this.displayBits = data.readByte(); + return old != this.displayBits; } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileSpatialPylon(ByteBuf data) { - data.writeByte( displayBits ); + data.writeByte( this.displayBits ); } public TileSpatialPylon() { - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK ); - gridProxy.setIdlePowerUsage( 0.5 ); - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK ); + this.gridProxy.setIdlePowerUsage( 0.5 ); + this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override public void onReady() { super.onReady(); - onNeighborBlockChange(); + this.onNeighborBlockChange(); } @Override public void markForUpdate() { super.markForUpdate(); - boolean hasLight = getLightValue() > 0; - if ( hasLight != didHaveLight ) + boolean hasLight = this.getLightValue() > 0; + if ( hasLight != this.didHaveLight ) { - didHaveLight = hasLight; - worldObj.func_147451_t( xCoord, yCoord, zCoord ); + this.didHaveLight = hasLight; + this.worldObj.func_147451_t( this.xCoord, this.yCoord, this.zCoord ); // worldObj.updateAllLightTypes( xCoord, yCoord, zCoord ); } } public int getLightValue() { - if ( (displayBits & DISPLAY_POWERED_ENABLED) == DISPLAY_POWERED_ENABLED ) + if ( (this.displayBits & this.DISPLAY_POWERED_ENABLED) == this.DISPLAY_POWERED_ENABLED ) { return 8; } @@ -122,78 +122,78 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - recalculateDisplay(); + this.recalculateDisplay(); } @MENetworkEventSubscribe public void activeRender(MENetworkChannelsChanged c) { - recalculateDisplay(); + this.recalculateDisplay(); } @Override public void invalidate() { - disconnect( false ); + this.disconnect( false ); super.invalidate(); } @Override public void onChunkUnload() { - disconnect( false ); + this.disconnect( false ); super.onChunkUnload(); } public void onNeighborBlockChange() { - calc.calculateMultiblock( worldObj, getLocation() ); + this.calc.calculateMultiblock( this.worldObj, this.getLocation() ); } @Override public SpatialPylonCluster getCluster() { - return cluster; + return this.cluster; } public void recalculateDisplay() { - int oldBits = displayBits; + int oldBits = this.displayBits; - displayBits = 0; + this.displayBits = 0; - if ( cluster != null ) + if ( this.cluster != null ) { - if ( cluster.min.equals( getLocation() ) ) - displayBits = DISPLAY_END_MIN; - else if ( cluster.max.equals( getLocation() ) ) - displayBits = DISPLAY_END_MAX; + if ( this.cluster.min.equals( this.getLocation() ) ) + this.displayBits = this.DISPLAY_END_MIN; + else if ( this.cluster.max.equals( this.getLocation() ) ) + this.displayBits = this.DISPLAY_END_MAX; else - displayBits = DISPLAY_MIDDLE; + this.displayBits = this.DISPLAY_MIDDLE; - switch (cluster.currentAxis) + switch (this.cluster.currentAxis) { case X: - displayBits |= DISPLAY_X; + this.displayBits |= this.DISPLAY_X; break; case Y: - displayBits |= DISPLAY_Y; + this.displayBits |= this.DISPLAY_Y; break; case Z: - displayBits |= DISPLAY_Z; + this.displayBits |= this.DISPLAY_Z; break; default: - displayBits = 0; + this.displayBits = 0; break; } try { - if ( gridProxy.getEnergy().isNetworkPowered() ) - displayBits |= DISPLAY_POWERED_ENABLED; + if ( this.gridProxy.getEnergy().isNetworkPowered() ) + this.displayBits |= this.DISPLAY_POWERED_ENABLED; - if ( cluster.isValid && gridProxy.isActive() ) - displayBits |= DISPLAY_ENABLED; + if ( this.cluster.isValid && this.gridProxy.isActive() ) + this.displayBits |= this.DISPLAY_ENABLED; } catch (GridAccessException e) { @@ -202,24 +202,24 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } - if ( oldBits != displayBits ) - markForUpdate(); + if ( oldBits != this.displayBits ) + this.markForUpdate(); } public void updateStatus(SpatialPylonCluster c) { - cluster = c; - gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) ); - recalculateDisplay(); + this.cluster = c; + this.gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) ); + this.recalculateDisplay(); } @Override public void disconnect(boolean b) { - if ( cluster != null ) + if ( this.cluster != null ) { - cluster.destroy(); - updateStatus( null ); + this.cluster.destroy(); + this.updateStatus( null ); } } @@ -231,7 +231,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public int getDisplayBits() { - return displayBits; + return this.displayBits; } } diff --git a/src/main/java/appeng/tile/storage/TileChest.java b/src/main/java/appeng/tile/storage/TileChest.java index 1958e826c..1d1f7a6ed 100644 --- a/src/main/java/appeng/tile/storage/TileChest.java +++ b/src/main/java/appeng/tile/storage/TileChest.java @@ -121,23 +121,23 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan private void recalculateDisplay() { - int oldState = state; + int oldState = this.state; - for (int x = 0; x < getCellCount(); x++) - state |= (getCellStatus( x ) << (3 * x)); + for (int x = 0; x < this.getCellCount(); x++) + this.state |= (this.getCellStatus( x ) << (3 * x)); - if ( isPowered() ) - state |= 0x40; + if ( this.isPowered() ) + this.state |= 0x40; else - state &= ~0x40; + this.state &= ~0x40; - boolean currentActive = gridProxy.isActive(); - if ( wasActive != currentActive ) + boolean currentActive = this.gridProxy.isActive(); + if ( this.wasActive != currentActive ) { - wasActive = currentActive; + this.wasActive = currentActive; try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch (GridAccessException e) { @@ -145,8 +145,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } } - if ( oldState != state ) - markForUpdate(); + if ( oldState != this.state ) + this.markForUpdate(); } @Override @@ -156,7 +156,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); + this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } catch (GridAccessException e) { @@ -164,59 +164,59 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } } else - recalculateDisplay(); + this.recalculateDisplay(); } @TileEvent(TileEventType.TICK) public void Tick_TileChest() { - if ( worldObj.isRemote ) + if ( this.worldObj.isRemote ) return; - double idleUsage = gridProxy.getIdlePowerUsage(); + double idleUsage = this.gridProxy.getIdlePowerUsage(); try { - if ( !gridProxy.getEnergy().isNetworkPowered() ) + if ( !this.gridProxy.getEnergy().isNetworkPowered() ) { - double powerUsed = extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain - if ( powerUsed + 0.1 >= idleUsage != (state & 0x40) > 0 ) - recalculateDisplay(); + double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + if ( powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0 ) + this.recalculateDisplay(); } } catch (GridAccessException e) { - double powerUsed = extractAEPower( gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain - if ( powerUsed + 0.1 >= idleUsage != (state & 0x40) > 0 ) - recalculateDisplay(); + double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + if ( powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0 ) + this.recalculateDisplay(); } - if ( inv.getStackInSlot( 0 ) != null ) + if ( this.inv.getStackInSlot( 0 ) != null ) { - tryToStoreContents(); + this.tryToStoreContents(); } } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileChest(ByteBuf data) { - if ( worldObj.getTotalWorldTime() - lastStateChange > 8 ) - state = 0; + if ( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) + this.state = 0; else - state &= 0x24924924; // just keep the blinks... + this.state &= 0x24924924; // just keep the blinks... - for (int x = 0; x < getCellCount(); x++) - state |= (getCellStatus( x ) << (3 * x)); + for (int x = 0; x < this.getCellCount(); x++) + this.state |= (this.getCellStatus( x ) << (3 * x)); - if ( isPowered() ) - state |= 0x40; + if ( this.isPowered() ) + this.state |= 0x40; else - state &= ~0x40; + this.state &= ~0x40; - data.writeByte( state ); - data.writeByte( paintedColor.ordinal() ); + data.writeByte( this.state ); + data.writeByte( this.paintedColor.ordinal() ); - ItemStack is = inv.getStackInSlot( 1 ); + ItemStack is = this.inv.getStackInSlot( 1 ); if ( is == null ) { @@ -231,64 +231,64 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileChest(ByteBuf data) { - int oldState = state; - ItemStack oldType = storageType; + int oldState = this.state; + ItemStack oldType = this.storageType; - state = data.readByte(); - AEColor oldPaintedColor = paintedColor; - paintedColor = AEColor.values()[data.readByte()]; + this.state = data.readByte(); + AEColor oldPaintedColor = this.paintedColor; + this.paintedColor = AEColor.values()[data.readByte()]; int item = data.readInt(); if ( item == 0 ) - storageType = null; + this.storageType = null; else - storageType = new ItemStack( Item.getItemById( item & 0xffff ), 1, item >> Platform.DEF_OFFSET ); + this.storageType = new ItemStack( Item.getItemById( item & 0xffff ), 1, item >> Platform.DEF_OFFSET ); - lastStateChange = worldObj.getTotalWorldTime(); + this.lastStateChange = this.worldObj.getTotalWorldTime(); - return oldPaintedColor != paintedColor || (state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB) || !Platform.isSameItemPrecise( oldType, storageType ); + return oldPaintedColor != this.paintedColor || (this.state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB) || !Platform.isSameItemPrecise( oldType, this.storageType ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileChest(NBTTagCompound data) { - config.readFromNBT( data ); - priority = data.getInteger( "priority" ); + this.config.readFromNBT( data ); + this.priority = data.getInteger( "priority" ); if ( data.hasKey( "paintedColor" ) ) - paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; + this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileChest(NBTTagCompound data) { - config.writeToNBT( data ); - data.setInteger( "priority", priority ); - data.setByte( "paintedColor", (byte) paintedColor.ordinal() ); + this.config.writeToNBT( data ); + data.setInteger( "priority", this.priority ); + data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - recalculateDisplay(); + this.recalculateDisplay(); } @MENetworkEventSubscribe public void channelRender(MENetworkChannelsChanged c) { - recalculateDisplay(); + this.recalculateDisplay(); } public TileChest() { - internalMaxPower = PowerMultiplier.CONFIG.multiply( 40 ); - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - config.registerSetting( Settings.SORT_BY, SortOrder.NAME ); - config.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); - config.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); + this.internalMaxPower = PowerMultiplier.CONFIG.multiply( 40 ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.config.registerSetting( Settings.SORT_BY, SortOrder.NAME ); + this.config.registerSetting( Settings.VIEW_MODE, ViewItems.ALL ); + this.config.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); - internalPublicPowerStorage = true; - internalPowerFlow = AccessRestriction.WRITE; + this.internalPublicPowerStorage = true; + this.internalPowerFlow = AccessRestriction.WRITE; } boolean isCached = false; @@ -300,13 +300,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public IMEMonitor getItemInventory() { - return itemCell; + return this.itemCell; } @Override public IMEMonitor getFluidInventory() { - return fluidCell; + return this.fluidCell; } class ChestNetNotifier> implements IMEMonitorHandlerReceiver @@ -322,12 +322,12 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public void postChange(IBaseMonitor monitor, Iterable change, BaseActionSource source) { - if ( source == mySrc || (source instanceof PlayerSource && ((PlayerSource) source).via == TileChest.this) ) + if ( source == TileChest.this.mySrc || (source instanceof PlayerSource && ((PlayerSource) source).via == TileChest.this) ) { try { - if ( gridProxy.isActive() ) - gridProxy.getStorage().postAlterationOfStoredItems( chan, change, mySrc ); + if ( TileChest.this.gridProxy.isActive() ) + TileChest.this.gridProxy.getStorage().postAlterationOfStoredItems( this.chan, change, TileChest.this.mySrc ); } catch (GridAccessException e) { @@ -335,16 +335,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } } - blinkCell( 0 ); + TileChest.this.blinkCell( 0 ); } @Override public boolean isValid(Object verificationToken) { - if ( chan == StorageChannel.ITEMS ) - return verificationToken == itemCell; - if ( chan == StorageChannel.FLUIDS ) - return verificationToken == fluidCell; + if ( this.chan == StorageChannel.ITEMS ) + return verificationToken == TileChest.this.itemCell; + if ( this.chan == StorageChannel.FLUIDS ) + return verificationToken == TileChest.this.fluidCell; return false; } @@ -366,7 +366,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan public IMEInventoryHandler getInternalHandler() { - IMEInventoryHandler h = getHandler(); + IMEInventoryHandler h = this.getHandler(); if ( h instanceof MEInventoryHandler ) return (IMEInventoryHandler) ((MEInventoryHandler) h).getInternal(); return this.getHandler(); @@ -374,11 +374,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan private boolean securityCheck(EntityPlayer player, SecurityPermissions requiredPermission) { - if ( getTile() instanceof IActionHost && requiredPermission != null ) + if ( TileChest.this.getTile() instanceof IActionHost && requiredPermission != null ) { boolean requirePower = false; - IGridNode gn = ((IActionHost) getTile()).getActionableNode(); + IGridNode gn = ((IActionHost) TileChest.this.getTile()).getActionableNode(); if ( gn != null ) { IGrid g = gn.getGrid(); @@ -407,7 +407,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public T injectItems(T input, Actionable mode, BaseActionSource src) { - if ( src.isPlayer() && !securityCheck(((PlayerSource) src).player, SecurityPermissions.INJECT) ) + if ( src.isPlayer() && !this.securityCheck(((PlayerSource) src).player, SecurityPermissions.INJECT) ) return input; return super.injectItems(input, mode, src); } @@ -415,7 +415,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public T extractItems(T request, Actionable mode, BaseActionSource src) { - if ( src.isPlayer() && !securityCheck(((PlayerSource) src).player, SecurityPermissions.EXTRACT) ) + if ( src.isPlayer() && !this.securityCheck(((PlayerSource) src).player, SecurityPermissions.EXTRACT) ) return null; return super.extractItems(request, mode, src); } @@ -427,7 +427,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return null; MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); - ih.myPriority = priority; + ih.myPriority = this.priority; MEMonitorHandler g = new ChestMonitorHandler( ih ); g.addListener( new ChestNetNotifier( h.getChannel() ), g ); @@ -437,32 +437,32 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan public IMEInventoryHandler getHandler(StorageChannel channel) throws ChestNoHandler { - if ( !isCached ) + if ( !this.isCached ) { - itemCell = null; - fluidCell = null; + this.itemCell = null; + this.fluidCell = null; - ItemStack is = inv.getStackInSlot( 1 ); + ItemStack is = this.inv.getStackInSlot( 1 ); if ( is != null ) { - isCached = true; - cellHandler = AEApi.instance().registries().cell().getHandler( is ); - if ( cellHandler != null ) + this.isCached = true; + this.cellHandler = AEApi.instance().registries().cell().getHandler( is ); + if ( this.cellHandler != null ) { double power = 1.0; - IMEInventoryHandler itemCell = cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); - IMEInventoryHandler fluidCell = cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); + IMEInventoryHandler itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); + IMEInventoryHandler fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); if ( itemCell != null ) - power += cellHandler.cellIdleDrain( is, itemCell ); + power += this.cellHandler.cellIdleDrain( is, itemCell ); else if ( fluidCell != null ) - power += cellHandler.cellIdleDrain( is, fluidCell ); + power += this.cellHandler.cellIdleDrain( is, fluidCell ); - gridProxy.setIdlePowerUsage( power ); + this.gridProxy.setIdlePowerUsage( power ); - this.itemCell = wrap( itemCell ); - this.fluidCell = wrap( fluidCell ); + this.itemCell = this.wrap( itemCell ); + this.fluidCell = this.wrap( fluidCell ); } } } @@ -470,13 +470,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan switch (channel) { case FLUIDS: - if ( fluidCell == null ) + if ( this.fluidCell == null ) throw noHandler; - return fluidCell; + return this.fluidCell; case ITEMS: - if ( itemCell == null ) + if ( this.itemCell == null ) throw noHandler; - return itemCell; + return this.itemCell; default: } @@ -486,7 +486,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override @@ -494,16 +494,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if ( slot == 1 ) { - itemCell = null; - fluidCell = null; - isCached = false; // recalculate the storage cell. + this.itemCell = null; + this.fluidCell = null; + this.isCached = false; // recalculate the storage cell. try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = gridProxy.getStorage(); - Platform.postChanges( gs, removed, added, mySrc ); + IStorageGrid gs = this.gridProxy.getStorage(); + Platform.postChanges( gs, removed, added, this.mySrc ); } catch (GridAccessException ignored) { @@ -511,10 +511,10 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } // update the neighbors - if ( worldObj != null ) + if ( this.worldObj != null ) { - Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); - markForUpdate(); + Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord ); + this.markForUpdate(); } } } @@ -522,24 +522,24 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - inv.setInventorySlotContents( i, itemstack ); - tryToStoreContents(); + this.inv.setInventorySlotContents( i, itemstack ); + this.tryToStoreContents(); } private void tryToStoreContents() { try { - if ( getStackInSlot( 0 ) != null ) + if ( this.getStackInSlot( 0 ) != null ) { - IMEInventory cell = getHandler( StorageChannel.ITEMS ); + IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( inv.getStackInSlot( 0 ) ), mySrc ); + IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc ); if ( returns == null ) - inv.setInventorySlotContents( 0, null ); + this.inv.setInventorySlotContents( 0, null ); else - inv.setInventorySlotContents( 0, returns.getItemStack() ); + this.inv.setInventorySlotContents( 0, returns.getItemStack() ); } } catch (ChestNoHandler ignored) @@ -567,8 +567,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - IMEInventory cell = getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, mySrc ); + IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); + IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc ); return returns == null || returns.getStackSize() != itemstack.stackSize; } catch (ChestNoHandler ignored) @@ -584,11 +584,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan if ( ForgeDirection.SOUTH == side ) return front; - if ( isPowered() ) + if ( this.isPowered() ) { try { - if ( getHandler( StorageChannel.ITEMS ) != null ) + if ( this.getHandler( StorageChannel.ITEMS ) != null ) return sides; } catch (ChestNoHandler e) @@ -602,11 +602,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public List getCellArray(StorageChannel channel) { - if ( gridProxy.isActive() ) + if ( this.gridProxy.isActive() ) { try { - return Collections.singletonList( getHandler( channel ) ); + return Collections.singletonList( this.getHandler( channel ) ); } catch (ChestNoHandler e) { @@ -619,7 +619,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public int getPriority() { - return priority; + return this.priority; } @Override @@ -631,40 +631,40 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public void blinkCell(int slot) { - long now = worldObj.getTotalWorldTime(); - if ( now - lastStateChange > 8 ) - state = 0; - lastStateChange = now; + long now = this.worldObj.getTotalWorldTime(); + if ( now - this.lastStateChange > 8 ) + this.state = 0; + this.lastStateChange = now; - state |= 1 << (slot * 3 + 2); + this.state |= 1 << (slot * 3 + 2); - recalculateDisplay(); + this.recalculateDisplay(); } @Override public boolean isCellBlinking(int slot) { - long now = worldObj.getTotalWorldTime(); - if ( now - lastStateChange > 8 ) + long now = this.worldObj.getTotalWorldTime(); + if ( now - this.lastStateChange > 8 ) return false; - return ((state >> (slot * 3 + 2)) & 0x01) == 0x01; + return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01; } @Override public int getCellStatus(int slot) { if ( Platform.isClient() ) - return (state >> (slot * 3)) & 3; + return (this.state >> (slot * 3)) & 3; - ItemStack cell = inv.getStackInSlot( 1 ); + ItemStack cell = this.inv.getStackInSlot( 1 ); ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); if ( ch != null ) { try { - IMEInventoryHandler handler = getHandler( StorageChannel.ITEMS ); + IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS ); if ( handler instanceof ChestMonitorHandler ) return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() ); } @@ -674,7 +674,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan try { - IMEInventoryHandler handler = getHandler( StorageChannel.FLUIDS ); + IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS ); if ( handler instanceof ChestMonitorHandler ) return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() ); } @@ -690,15 +690,15 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { double req = resource.amount / 500.0; - double available = extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if ( available >= req - 0.01 ) { try { - IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS ); + IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); - extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); - IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, mySrc ); + this.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); + IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc ); if ( results == null ) return resource.amount; @@ -729,7 +729,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS ); + IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); return h.canAccept( AEFluidStack.create( new FluidStack( fluid, 1 ) ) ); } catch (ChestNoHandler ignored) @@ -749,7 +749,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS ); + IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); if ( h.getChannel() == StorageChannel.FLUIDS ) return new FluidTankInfo[] { new FluidTankInfo( null, 1 ) }; // eh? } @@ -768,7 +768,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan IEnergyGrid eg; try { - eg = gridProxy.getEnergy(); + eg = this.gridProxy.getEnergy(); stash = eg.extractAEPower( amt, mode, PowerMultiplier.ONE ); if ( stash >= amt ) return stash; @@ -786,15 +786,15 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan public boolean isPowered() { if ( Platform.isClient() ) - return (state & 0x40) == 0x40; + return (this.state & 0x40) == 0x40; - boolean gridPowered = getAECurrentPower() > 64; + boolean gridPowered = this.getAECurrentPower() > 64; if ( !gridPowered ) { try { - gridPowered = gridProxy.getEnergy().isNetworkPowered(); + gridPowered = this.gridProxy.getEnergy().isNetworkPowered(); } catch (GridAccessException ignored) { @@ -807,30 +807,30 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) { - if ( Platform.canAccess( gridProxy, src ) && side != getForward() ) + if ( Platform.canAccess( this.gridProxy, src ) && side != this.getForward() ) return this; return null; } public ItemStack getStorageType() { - if ( isPowered() ) - return storageType; + if ( this.isPowered() ) + return this.storageType; return null; } @Override public void setPriority(int newValue) { - priority = newValue; + this.priority = newValue; - itemCell = null; - fluidCell = null; - isCached = false; // recalculate the storage cell. + this.itemCell = null; + this.fluidCell = null; + this.isCached = false; // recalculate the storage cell. try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch (GridAccessException e) { @@ -841,7 +841,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public IConfigManager getConfigManager() { - return config; + return this.config; } @Override @@ -887,24 +887,24 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public AEColor getColor() { - return paintedColor; + return this.paintedColor; } @Override public boolean recolourBlock(ForgeDirection side, AEColor newPaintedColor, EntityPlayer who) { - if ( paintedColor == newPaintedColor ) + if ( this.paintedColor == newPaintedColor ) return false; - paintedColor = newPaintedColor; - markDirty(); - markForUpdate(); + this.paintedColor = newPaintedColor; + this.markDirty(); + this.markForUpdate(); return true; } @Override public void saveChanges(IMEInventory cellInventory) { - worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); + this.worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); } } diff --git a/src/main/java/appeng/tile/storage/TileDrive.java b/src/main/java/appeng/tile/storage/TileDrive.java index 2c694eda5..3bec8fae6 100644 --- a/src/main/java/appeng/tile/storage/TileDrive.java +++ b/src/main/java/appeng/tile/storage/TileDrive.java @@ -78,18 +78,18 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { int oldState = 0; - boolean currentActive = gridProxy.isActive(); + boolean currentActive = this.gridProxy.isActive(); if ( currentActive ) - state |= 0x80000000; + this.state |= 0x80000000; else - state &= ~0x80000000; + this.state &= ~0x80000000; - if ( wasActive != currentActive ) + if ( this.wasActive != currentActive ) { - wasActive = currentActive; + this.wasActive = currentActive; try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch (GridAccessException e) { @@ -97,69 +97,69 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } } - for (int x = 0; x < getCellCount(); x++) - state |= (getCellStatus( x ) << (3 * x)); + for (int x = 0; x < this.getCellCount(); x++) + this.state |= (this.getCellStatus( x ) << (3 * x)); - if ( oldState != state ) - markForUpdate(); + if ( oldState != this.state ) + this.markForUpdate(); } @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileDrive(ByteBuf data) { - if ( worldObj.getTotalWorldTime() - lastStateChange > 8 ) - state = 0; + if ( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) + this.state = 0; else - state &= 0x24924924; // just keep the blinks... + this.state &= 0x24924924; // just keep the blinks... - if ( gridProxy.isActive() ) - state |= 0x80000000; + if ( this.gridProxy.isActive() ) + this.state |= 0x80000000; else - state &= ~0x80000000; + this.state &= ~0x80000000; - for (int x = 0; x < getCellCount(); x++) - state |= (getCellStatus( x ) << (3 * x)); + for (int x = 0; x < this.getCellCount(); x++) + this.state |= (this.getCellStatus( x ) << (3 * x)); - data.writeInt( state ); + data.writeInt( this.state ); } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileDrive(ByteBuf data) { - int oldState = state; - state = data.readInt(); - lastStateChange = worldObj.getTotalWorldTime(); - return (state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB); + int oldState = this.state; + this.state = data.readInt(); + this.lastStateChange = this.worldObj.getTotalWorldTime(); + return (this.state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileDrive(NBTTagCompound data) { - isCached = false; - priority = data.getInteger( "priority" ); + this.isCached = false; + this.priority = data.getInteger( "priority" ); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileDrive(NBTTagCompound data) { - data.setInteger( "priority", priority ); + data.setInteger( "priority", this.priority ); } @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { - recalculateDisplay(); + this.recalculateDisplay(); } @MENetworkEventSubscribe public void channelRender(MENetworkChannelsChanged c) { - recalculateDisplay(); + this.recalculateDisplay(); } public TileDrive() { - mySrc = new MachineSource( this ); - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.mySrc = new MachineSource( this ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); } @Override @@ -177,108 +177,108 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public void onReady() { super.onReady(); - updateState(); + this.updateState(); } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( isCached ) + if ( this.isCached ) { - isCached = false; // recalculate the storage cell. - updateState(); + this.isCached = false; // recalculate the storage cell. + this.updateState(); } try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = gridProxy.getStorage(); - Platform.postChanges( gs, removed, added, mySrc ); + IStorageGrid gs = this.gridProxy.getStorage(); + Platform.postChanges( gs, removed, added, this.mySrc ); } catch (GridAccessException ignored) { } - markForUpdate(); + this.markForUpdate(); } @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } public void updateState() { - if ( !isCached ) + if ( !this.isCached ) { - items = new LinkedList(); - fluids = new LinkedList(); + this.items = new LinkedList(); + this.fluids = new LinkedList(); double power = 2.0; - for (int x = 0; x < inv.getSizeInventory(); x++) + for (int x = 0; x < this.inv.getSizeInventory(); x++) { - ItemStack is = inv.getStackInSlot( x ); - invBySlot[x] = null; - handlersBySlot[x] = null; + ItemStack is = this.inv.getStackInSlot( x ); + this.invBySlot[x] = null; + this.handlersBySlot[x] = null; if ( is != null ) { - handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is ); + this.handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is ); - if ( handlersBySlot[x] != null ) + if ( this.handlersBySlot[x] != null ) { - IMEInventoryHandler cell = handlersBySlot[x].getCellInventory( is, this, StorageChannel.ITEMS ); + IMEInventoryHandler cell = this.handlersBySlot[x].getCellInventory( is, this, StorageChannel.ITEMS ); if ( cell != null ) { - power += handlersBySlot[x].cellIdleDrain( is, cell ); + power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, handlersBySlot[x], this ); - ih.myPriority = priority; - invBySlot[x] = ih; - items.add( ih ); + DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + ih.myPriority = this.priority; + this.invBySlot[x] = ih; + this.items.add( ih ); } else { - cell = handlersBySlot[x].getCellInventory( is, this, StorageChannel.FLUIDS ); + cell = this.handlersBySlot[x].getCellInventory( is, this, StorageChannel.FLUIDS ); if ( cell != null ) { - power += handlersBySlot[x].cellIdleDrain( is, cell ); + power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, handlersBySlot[x], this ); - ih.myPriority = priority; - invBySlot[x] = ih; - fluids.add( ih ); + DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + ih.myPriority = this.priority; + this.invBySlot[x] = ih; + this.fluids.add( ih ); } } } } } - gridProxy.setIdlePowerUsage( power ); + this.gridProxy.setIdlePowerUsage( power ); - isCached = true; + this.isCached = true; } } @Override public List getCellArray(StorageChannel channel) { - if ( gridProxy.isActive() ) + if ( this.gridProxy.isActive() ) { - updateState(); - return (List) (channel == StorageChannel.ITEMS ? items : fluids); + this.updateState(); + return (List) (channel == StorageChannel.ITEMS ? this.items : this.fluids); } return new ArrayList(); } @@ -286,7 +286,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior @Override public int getPriority() { - return priority; + return this.priority; } @Override @@ -298,36 +298,36 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior @Override public void blinkCell(int slot) { - long now = worldObj.getTotalWorldTime(); - if ( now - lastStateChange > 8 ) - state = 0; - lastStateChange = now; + long now = this.worldObj.getTotalWorldTime(); + if ( now - this.lastStateChange > 8 ) + this.state = 0; + this.lastStateChange = now; - state |= 1 << (slot * 3 + 2); + this.state |= 1 << (slot * 3 + 2); - recalculateDisplay(); + this.recalculateDisplay(); } @Override public boolean isCellBlinking(int slot) { - long now = worldObj.getTotalWorldTime(); - if ( now - lastStateChange > 8 ) + long now = this.worldObj.getTotalWorldTime(); + if ( now - this.lastStateChange > 8 ) return false; - return ((state >> (slot * 3 + 2)) & 0x01) == 0x01; + return ((this.state >> (slot * 3 + 2)) & 0x01) == 0x01; } @Override public int getCellStatus(int slot) { if ( Platform.isClient() ) - return (state >> (slot * 3)) & 3; + return (this.state >> (slot * 3)) & 3; - ItemStack cell = inv.getStackInSlot( 2 ); - ICellHandler ch = handlersBySlot[slot]; + ItemStack cell = this.inv.getStackInSlot( 2 ); + ICellHandler ch = this.handlersBySlot[slot]; - MEInventoryHandler handler = invBySlot[slot]; + MEInventoryHandler handler = this.invBySlot[slot]; if ( handler == null ) return 0; @@ -350,23 +350,23 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior public boolean isPowered() { if ( Platform.isClient() ) - return (state & 0x80000000) == 0x80000000; + return (this.state & 0x80000000) == 0x80000000; - return gridProxy.isActive(); + return this.gridProxy.isActive(); } @Override public void setPriority(int newValue) { - priority = newValue; - markDirty(); + this.priority = newValue; + this.markDirty(); - isCached = false; // recalculate the storage cell. - updateState(); + this.isCached = false; // recalculate the storage cell. + this.updateState(); try { - gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); + this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } catch (GridAccessException e) { @@ -383,6 +383,6 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior @Override public void saveChanges(IMEInventory cellInventory) { - worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); + this.worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); } } diff --git a/src/main/java/appeng/tile/storage/TileIOPort.java b/src/main/java/appeng/tile/storage/TileIOPort.java index 08c3ccf47..97d35a78a 100644 --- a/src/main/java/appeng/tile/storage/TileIOPort.java +++ b/src/main/java/appeng/tile/storage/TileIOPort.java @@ -86,27 +86,27 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileIOPort(NBTTagCompound data) { - cm.writeToNBT( data ); - cells.writeToNBT( data, "cells" ); - upgrades.writeToNBT( data, "upgrades" ); - data.setInteger( "lastRedstoneState", lastRedstoneState.ordinal() ); + this.cm.writeToNBT( data ); + this.cells.writeToNBT( data, "cells" ); + this.upgrades.writeToNBT( data, "upgrades" ); + data.setInteger( "lastRedstoneState", this.lastRedstoneState.ordinal() ); } @TileEvent(TileEventType.WORLD_NBT_READ) public void readFromNBT_TileIOPort(NBTTagCompound data) { - cm.readFromNBT( data ); - cells.readFromNBT( data, "cells" ); - upgrades.readFromNBT( data, "upgrades" ); + this.cm.readFromNBT( data ); + this.cells.readFromNBT( data, "cells" ); + this.upgrades.readFromNBT( data, "upgrades" ); if ( data.hasKey( "lastRedstoneState" ) ) - lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )]; + this.lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )]; } public TileIOPort() { - gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); - cm.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); - cm.registerSetting( Settings.FULLNESS_MODE, FullnessMode.EMPTY ); - cm.registerSetting( Settings.OPERATION_MODE, OperationMode.EMPTY ); + this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); + this.cm.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); + this.cm.registerSetting( Settings.FULLNESS_MODE, FullnessMode.EMPTY ); + this.cm.registerSetting( Settings.OPERATION_MODE, OperationMode.EMPTY ); } @Override @@ -124,15 +124,15 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC @Override public IInventory getInternalInventory() { - return cells; + return this.cells; } @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( cells == inv ) + if ( this.cells == inv ) { - updateTask(); + this.updateTask(); } } @@ -140,10 +140,10 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC { try { - if ( hasWork() ) - gridProxy.getTick().wakeDevice( gridProxy.getNode() ); + if ( this.hasWork() ) + this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); else - gridProxy.getTick().sleepDevice( gridProxy.getNode() ); + this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } catch (GridAccessException e) { @@ -153,56 +153,56 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC public void updateRedstoneState() { - YesNo currentState = worldObj.isBlockIndirectlyGettingPowered( xCoord, yCoord, zCoord ) ? YesNo.YES : YesNo.NO; - if ( lastRedstoneState != currentState ) + YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; + if ( this.lastRedstoneState != currentState ) { - lastRedstoneState = currentState; - updateTask(); + this.lastRedstoneState = currentState; + this.updateTask(); } } public boolean getRedstoneState() { - if ( lastRedstoneState == YesNo.UNDECIDED ) - updateRedstoneState(); + if ( this.lastRedstoneState == YesNo.UNDECIDED ) + this.updateRedstoneState(); - return lastRedstoneState == YesNo.YES; + return this.lastRedstoneState == YesNo.YES; } private boolean isEnabled() { - if ( getInstalledUpgrades( Upgrades.REDSTONE ) == 0 ) + if ( this.getInstalledUpgrades( Upgrades.REDSTONE ) == 0 ) return true; - RedstoneMode rs = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED ); + RedstoneMode rs = (RedstoneMode) this.cm.getSetting( Settings.REDSTONE_CONTROLLED ); if ( rs == RedstoneMode.HIGH_SIGNAL ) - return getRedstoneState(); - return !getRedstoneState(); + return this.getRedstoneState(); + return !this.getRedstoneState(); } @Override public int[] getAccessibleSlotsBySide(ForgeDirection d) { if ( d == ForgeDirection.UP || d == ForgeDirection.DOWN ) - return input; + return this.input; - return output; + return this.output; } @Override public IConfigManager getConfigManager() { - return cm; + return this.cm; } @Override public IInventory getInventoryByName(String name) { if ( name.equals( "upgrades" ) ) - return upgrades; + return this.upgrades; if ( name.equals( "cells" ) ) - return cells; + return this.cells; return null; } @@ -210,21 +210,21 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC @Override public int getInstalledUpgrades(Upgrades u) { - return upgrades.getInstalledUpgrades( u ); + return this.upgrades.getInstalledUpgrades( u ); } @Override public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) { - updateTask(); + this.updateTask(); } boolean hasWork() { - if ( isEnabled() ) + if ( this.isEnabled() ) { for (int x = 0; x < 6; x++) - if ( cells.getStackInSlot( x ) != null ) + if ( this.cells.getStackInSlot( x ) != null ) return true; } @@ -234,18 +234,18 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC @Override public TickingRequest getTickingRequest(IGridNode node) { - return new TickingRequest( TickRates.IOPort.min, TickRates.IOPort.max, hasWork(), false ); + return new TickingRequest( TickRates.IOPort.min, TickRates.IOPort.max, this.hasWork(), false ); } @Override public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) { - if ( !gridProxy.isActive() ) + if ( !this.gridProxy.isActive() ) return TickRateModulation.IDLE; long ItemsToMove = 256; - switch (getInstalledUpgrades( Upgrades.SPEED )) + switch (this.getInstalledUpgrades( Upgrades.SPEED )) { case 1: ItemsToMove *= 2; @@ -260,35 +260,35 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC try { - IMEInventory itemNet = gridProxy.getStorage().getItemInventory(); - IMEInventory fluidNet = gridProxy.getStorage().getFluidInventory(); - IEnergySource energy = gridProxy.getEnergy(); + IMEInventory itemNet = this.gridProxy.getStorage().getItemInventory(); + IMEInventory fluidNet = this.gridProxy.getStorage().getFluidInventory(); + IEnergySource energy = this.gridProxy.getEnergy(); for (int x = 0; x < 6; x++) { - ItemStack is = cells.getStackInSlot( x ); + ItemStack is = this.cells.getStackInSlot( x ); if ( is != null ) { if ( ItemsToMove > 0 ) { - IMEInventory itemInv = getInv( is, StorageChannel.ITEMS ); - IMEInventory fluidInv = getInv( is, StorageChannel.FLUIDS ); + IMEInventory itemInv = this.getInv( is, StorageChannel.ITEMS ); + IMEInventory fluidInv = this.getInv( is, StorageChannel.FLUIDS ); - if ( cm.getSetting( Settings.OPERATION_MODE ) == OperationMode.EMPTY ) + if ( this.cm.getSetting( Settings.OPERATION_MODE ) == OperationMode.EMPTY ) { if ( itemInv != null ) - ItemsToMove = transferContents( energy, itemInv, itemNet, ItemsToMove, StorageChannel.ITEMS ); + ItemsToMove = this.transferContents( energy, itemInv, itemNet, ItemsToMove, StorageChannel.ITEMS ); if ( fluidInv != null ) - ItemsToMove = transferContents( energy, fluidInv, fluidNet, ItemsToMove, StorageChannel.FLUIDS ); + ItemsToMove = this.transferContents( energy, fluidInv, fluidNet, ItemsToMove, StorageChannel.FLUIDS ); } else { if ( itemInv != null ) - ItemsToMove = transferContents( energy, itemNet, itemInv, ItemsToMove, StorageChannel.ITEMS ); + ItemsToMove = this.transferContents( energy, itemNet, itemInv, ItemsToMove, StorageChannel.ITEMS ); if ( fluidInv != null ) - ItemsToMove = transferContents( energy, fluidNet, fluidInv, ItemsToMove, StorageChannel.FLUIDS ); + ItemsToMove = this.transferContents( energy, fluidNet, fluidInv, ItemsToMove, StorageChannel.FLUIDS ); } - if ( ItemsToMove > 0 && shouldMove( itemInv, fluidInv ) && !moveSlot( x ) ) + if ( ItemsToMove > 0 && this.shouldMove( itemInv, fluidInv ) && !this.moveSlot( x ) ) return TickRateModulation.IDLE; return TickRateModulation.URGENT; @@ -310,14 +310,14 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC private boolean shouldMove(IMEInventory itemInv, IMEInventory fluidInv) { - FullnessMode fm = (FullnessMode) cm.getSetting( Settings.FULLNESS_MODE ); + FullnessMode fm = (FullnessMode) this.cm.getSetting( Settings.FULLNESS_MODE ); if ( itemInv != null && fluidInv != null ) - return matches( fm, itemInv ) && matches( fm, fluidInv ); + return this.matches( fm, itemInv ) && this.matches( fm, fluidInv ); else if ( itemInv != null ) - return matches( fm, itemInv ); + return this.matches( fm, itemInv ); else if ( fluidInv != null ) - return matches( fm, fluidInv ); + return this.matches( fm, fluidInv ); return true; } @@ -341,7 +341,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC if ( test != null ) { test.setStackSize( 1 ); - return src.injectItems( test, Actionable.SIMULATE, mySrc ) != null; + return src.injectItems( test, Actionable.SIMULATE, this.mySrc ) != null; } return false; } @@ -352,17 +352,17 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC private IMEInventory getInv(ItemStack is, StorageChannel chan) { - if ( currentCell != is ) + if ( this.currentCell != is ) { - currentCell = is; - cachedFluid = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.FLUIDS ); - cachedItem = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); + this.currentCell = is; + this.cachedFluid = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.FLUIDS ); + this.cachedItem = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); } if ( StorageChannel.ITEMS == chan ) - return cachedItem; + return this.cachedItem; - return cachedFluid; + return this.cachedFluid; } private long transferContents(IEnergySource energy, IMEInventory src, IMEInventory destination, long itemsToMove, StorageChannel chan) @@ -384,7 +384,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC long totalStackSize = s.getStackSize(); if ( totalStackSize > 0 ) { - IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, mySrc ); + IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc ); long possible = 0; if ( stack == null ) @@ -397,16 +397,16 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC possible = Math.min( possible, itemsToMove ); s.setStackSize( possible ); - IAEStack extracted = src.extractItems( s, Actionable.MODULATE, mySrc ); + IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc ); if ( extracted != null ) { possible = extracted.getStackSize(); - IAEStack failed = Platform.poweredInsert( energy, destination, extracted, mySrc ); + IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc ); if ( failed != null ) { possible -= failed.getStackSize(); - src.injectItems( failed, Actionable.MODULATE, mySrc ); + src.injectItems( failed, Actionable.MODULATE, this.mySrc ); } if ( possible > 0 ) @@ -428,12 +428,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC private boolean moveSlot(int x) { - WrapperInventoryRange wir = new WrapperInventoryRange( this, outputSlots, true ); - ItemStack result = InventoryAdaptor.getAdaptor( wir, ForgeDirection.UNKNOWN ).addItems( getStackInSlot( x ) ); + WrapperInventoryRange wir = new WrapperInventoryRange( this, this.outputSlots, true ); + ItemStack result = InventoryAdaptor.getAdaptor( wir, ForgeDirection.UNKNOWN ).addItems( this.getStackInSlot( x ) ); if ( result == null ) { - setInventorySlotContents( x, null ); + this.setInventorySlotContents( x, null ); return true; } diff --git a/src/main/java/appeng/tile/storage/TileSkyChest.java b/src/main/java/appeng/tile/storage/TileSkyChest.java index ef846b29d..68be39e57 100644 --- a/src/main/java/appeng/tile/storage/TileSkyChest.java +++ b/src/main/java/appeng/tile/storage/TileSkyChest.java @@ -39,17 +39,17 @@ public class TileSkyChest extends AEBaseInvTile @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileSkyChest(ByteBuf data) { - data.writeBoolean( playerOpen > 0 ); + data.writeBoolean( this.playerOpen > 0 ); } @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileSkyChest(ByteBuf data) { - int wasOpen = playerOpen; - playerOpen = data.readBoolean() ? 1 : 0; + int wasOpen = this.playerOpen; + this.playerOpen = data.readBoolean() ? 1 : 0; - if ( wasOpen != playerOpen ) - lastEvent = System.currentTimeMillis(); + if ( wasOpen != this.playerOpen ) + this.lastEvent = System.currentTimeMillis(); return false; // TESR yo! } @@ -76,13 +76,13 @@ public class TileSkyChest extends AEBaseInvTile @Override public IInventory getInternalInventory() { - return inv; + return this.inv; } @Override public int[] getAccessibleSlotsBySide(ForgeDirection side) { - return sides; + return this.sides; } @Override @@ -91,12 +91,12 @@ public class TileSkyChest extends AEBaseInvTile if ( Platform.isClient() ) return; - playerOpen++; + this.playerOpen++; - if ( playerOpen == 1 ) + if ( this.playerOpen == 1 ) { - getWorldObj().playSoundEffect( xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "random.chestopen", 0.5F, getWorldObj().rand.nextFloat() * 0.1F + 0.9F ); - markForUpdate(); + this.getWorldObj().playSoundEffect( this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, "random.chestopen", 0.5F, this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F ); + this.markForUpdate(); } } @@ -106,16 +106,16 @@ public class TileSkyChest extends AEBaseInvTile if ( Platform.isClient() ) return; - playerOpen--; + this.playerOpen--; - if ( playerOpen < 0 ) - playerOpen = 0; + if ( this.playerOpen < 0 ) + this.playerOpen = 0; - if ( playerOpen == 0 ) + if ( this.playerOpen == 0 ) { - getWorldObj().playSoundEffect( xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "random.chestclosed", 0.5F, - getWorldObj().rand.nextFloat() * 0.1F + 0.9F ); - markForUpdate(); + this.getWorldObj().playSoundEffect( this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, "random.chestclosed", 0.5F, + this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F ); + this.markForUpdate(); } } diff --git a/src/main/java/appeng/transformer/AppEngCore.java b/src/main/java/appeng/transformer/AppEngCore.java index c50372a4f..54544a6ce 100644 --- a/src/main/java/appeng/transformer/AppEngCore.java +++ b/src/main/java/appeng/transformer/AppEngCore.java @@ -42,16 +42,16 @@ public class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin protected final ModMetadata md = new ModMetadata(); public AppEngCore() { - instance = this; + this.instance = this; FMLRelaunchLog.info( "[AppEng] Core Init" ); - md.autogenerated = false; - md.authorList.add( "AlgorithmX2" ); - md.credits = "AlgorithmX2"; - md.modId = getModId(); - md.version = getVersion(); - md.name = getName(); - md.url = "http://ae2.ae-mod.info"; - md.description = "Embedded Coremod for Applied Energistics 2"; + this.md.autogenerated = false; + this.md.authorList.add( "AlgorithmX2" ); + this.md.credits = "AlgorithmX2"; + this.md.modId = this.getModId(); + this.md.version = this.getVersion(); + this.md.name = this.getName(); + this.md.url = "http://ae2.ae-mod.info"; + this.md.description = "Embedded Coremod for Applied Energistics 2"; } @EventHandler @@ -110,13 +110,13 @@ public class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin @Override public String getDisplayVersion() { - return getVersion(); + return this.getVersion(); } @Override public ModMetadata getMetadata() { - return md; + return this.md; } @Override diff --git a/src/main/java/appeng/transformer/MissingCoreMod.java b/src/main/java/appeng/transformer/MissingCoreMod.java index 123d8a476..0a288f5ed 100644 --- a/src/main/java/appeng/transformer/MissingCoreMod.java +++ b/src/main/java/appeng/transformer/MissingCoreMod.java @@ -35,7 +35,7 @@ public class MissingCoreMod extends CustomModLoadingErrorDisplayException try { clz.getField( "mc" ); - deobf = true; + this.deobf = true; } catch (Throwable ignored) { @@ -47,30 +47,30 @@ public class MissingCoreMod extends CustomModLoadingErrorDisplayException public void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) { int offset = 10; - drawCenteredString( fontRenderer, "Sorry, couldn't load AE2 Properly.", errorScreen.width / 2, offset += 15, 0xffffff ); - drawCenteredString( fontRenderer, "Please make sure that AE2 is installed into your mods folder.", errorScreen.width / 2, offset += 15, 0xeeeeee ); + this.drawCenteredString( fontRenderer, "Sorry, couldn't load AE2 Properly.", errorScreen.width / 2, offset += 15, 0xffffff ); + this.drawCenteredString( fontRenderer, "Please make sure that AE2 is installed into your mods folder.", errorScreen.width / 2, offset += 15, 0xeeeeee ); offset += 15; - if ( deobf ) + if ( this.deobf ) { offset += 15; - drawCenteredString( fontRenderer, "In a developer environment add the following too your args,", errorScreen.width / 2, offset += 15, 0xffffff ); - drawCenteredString( fontRenderer, "-Dfml.coreMods.load=appeng.transformer.AppEngCore", errorScreen.width / 2, offset += 15, 0xeeeeee ); + this.drawCenteredString( fontRenderer, "In a developer environment add the following too your args,", errorScreen.width / 2, offset += 15, 0xffffff ); + this.drawCenteredString( fontRenderer, "-Dfml.coreMods.load=appeng.transformer.AppEngCore", errorScreen.width / 2, offset += 15, 0xeeeeee ); } else { - drawCenteredString( fontRenderer, "You're launcher may refer to this by different names,", errorScreen.width / 2, offset += 15, 0xffffff ); + this.drawCenteredString( fontRenderer, "You're launcher may refer to this by different names,", errorScreen.width / 2, offset += 15, 0xffffff ); offset += 5; - drawCenteredString( fontRenderer, "MultiMC calls this tab \"Loader Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); - drawCenteredString( fontRenderer, "Magic Launcher calls this tab \"External Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); - drawCenteredString( fontRenderer, "Most other launchers refer to this tab as just \"Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); + this.drawCenteredString( fontRenderer, "MultiMC calls this tab \"Loader Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); + this.drawCenteredString( fontRenderer, "Magic Launcher calls this tab \"External Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); + this.drawCenteredString( fontRenderer, "Most other launchers refer to this tab as just \"Mods\"", errorScreen.width / 2, offset += 15, 0xeeeeee ); offset += 15; - drawCenteredString( fontRenderer, "Also make sure that the AE2 file is a .jar, and not a .zip", errorScreen.width / 2, offset += 15, 0xffffff ); + this.drawCenteredString( fontRenderer, "Also make sure that the AE2 file is a .jar, and not a .zip", errorScreen.width / 2, offset += 15, 0xffffff ); } } diff --git a/src/main/java/appeng/transformer/asm/ASMIntegration.java b/src/main/java/appeng/transformer/asm/ASMIntegration.java index 5e46820fe..65f314437 100644 --- a/src/main/java/appeng/transformer/asm/ASMIntegration.java +++ b/src/main/java/appeng/transformer/asm/ASMIntegration.java @@ -80,7 +80,7 @@ public class ASMIntegration implements IClassTransformer try { - boolean reWrite = removeOptionals( classNode ); + boolean reWrite = this.removeOptionals( classNode ); if ( reWrite ) { @@ -105,16 +105,16 @@ public class ASMIntegration implements IClassTransformer { for ( AnnotationNode an : classNode.visibleAnnotations ) { - if ( hasAnnotation( an, integration.Interface.class ) ) + if ( this.hasAnnotation( an, integration.Interface.class ) ) { - if ( stripInterface( classNode, integration.Interface.class, an ) ) + if ( this.stripInterface( classNode, integration.Interface.class, an ) ) changed = true; } - else if ( hasAnnotation( an, integration.InterfaceList.class ) ) + else if ( this.hasAnnotation( an, integration.InterfaceList.class ) ) { for ( Object o : ( ( List ) an.values.get( 1 ) ) ) { - if ( stripInterface( classNode, integration.InterfaceList.class, ( AnnotationNode ) o ) ) + if ( this.stripInterface( classNode, integration.InterfaceList.class, ( AnnotationNode ) o ) ) changed = true; } } @@ -130,9 +130,9 @@ public class ASMIntegration implements IClassTransformer { for ( AnnotationNode an : mn.visibleAnnotations ) { - if ( hasAnnotation( an, integration.Method.class ) ) + if ( this.hasAnnotation( an, integration.Method.class ) ) { - if ( stripMethod( classNode, mn, i, integration.Method.class, an ) ) + if ( this.stripMethod( classNode, mn, i, integration.Method.class, an ) ) changed = true; } } @@ -141,7 +141,7 @@ public class ASMIntegration implements IClassTransformer } if ( changed ) - log( "Updated " + classNode.name ); + this.log( "Updated " + classNode.name ); return changed; } @@ -166,12 +166,12 @@ public class ASMIntegration implements IClassTransformer IntegrationType type = IntegrationType.valueOf( iName ); if ( !IntegrationRegistry.INSTANCE.isEnabled( type ) ) { - log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." ); + this.log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." ); i.remove(); return true; } else - log( "Allowing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is enabled." ); + this.log( "Allowing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is enabled." ); } else throw new RuntimeException( "Unable to handle Method annotation on " + classNode.name ); @@ -203,12 +203,12 @@ public class ASMIntegration implements IClassTransformer { if ( !IntegrationRegistry.INSTANCE.isEnabled( type ) ) { - log( "Removing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is disabled." ); + this.log( "Removing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is disabled." ); classNode.interfaces.remove( iFace.replace( '.', '/' ) ); return true; } else - log( "Allowing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is enabled." ); + this.log( "Allowing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is enabled." ); } else throw new RuntimeException( "Unable to handle Method annotation on " + classNode.name ); diff --git a/src/main/java/appeng/transformer/asm/ASMTweaker.java b/src/main/java/appeng/transformer/asm/ASMTweaker.java index d83fac3bb..168f4e731 100644 --- a/src/main/java/appeng/transformer/asm/ASMTweaker.java +++ b/src/main/java/appeng/transformer/asm/ASMTweaker.java @@ -56,16 +56,16 @@ public class ASMTweaker implements IClassTransformer final Multimap privateToPublicMethods = HashMultimap.create(); public ASMTweaker() { - privateToPublicMethods.put( "net.minecraft.client.gui.inventory.GuiContainer", new publicLine( "func_146977_a", "(Lnet/minecraft/inventory/Slot;)V" ) ); - privateToPublicMethods.put( "net.minecraft.client.gui.inventory.GuiContainer", new publicLine( "a", "(Lzk;)V" ) ); + this.privateToPublicMethods.put( "net.minecraft.client.gui.inventory.GuiContainer", new publicLine( "func_146977_a", "(Lnet/minecraft/inventory/Slot;)V" ) ); + this.privateToPublicMethods.put( "net.minecraft.client.gui.inventory.GuiContainer", new publicLine( "a", "(Lzk;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "writeToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "func_145841_b", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "b", "(Ldh;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "writeToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "func_145841_b", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "b", "(Ldh;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "readFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "func_145839_a", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); - privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "a", "(Ldh;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "readFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "func_145839_a", "(Lnet/minecraft/nbt/NBTTagCompound;)V" ) ); + this.privateToPublicMethods.put( "appeng.tile.AEBaseTile", new publicLine( "a", "(Ldh;)V" ) ); } @Override @@ -76,15 +76,15 @@ public class ASMTweaker implements IClassTransformer try { - if ( transformedName != null && privateToPublicMethods.containsKey( transformedName ) ) + if ( transformedName != null && this.privateToPublicMethods.containsKey( transformedName ) ) { ClassNode classNode = new ClassNode(); ClassReader classReader = new ClassReader( basicClass ); classReader.accept( classNode, 0 ); - for (publicLine Set : privateToPublicMethods.get( transformedName )) + for (publicLine Set : this.privateToPublicMethods.get( transformedName )) { - makePublic( classNode, Set ); + this.makePublic( classNode, Set ); } // CALL VIRTUAL! @@ -99,7 +99,7 @@ public class ASMTweaker implements IClassTransformer newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 1 ) ); newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc, false ) ); newNode.instructions.add( new InsnNode( Opcodes.RETURN ) ); - log( newNode.name + newNode.desc + " - New Method" ); + this.log( newNode.name + newNode.desc + " - New Method" ); classNode.methods.add( newNode ); break; } @@ -118,7 +118,7 @@ public class ASMTweaker implements IClassTransformer MethodInsnNode n = (MethodInsnNode) in; if ( n.name.equals( "func_146977_a" ) || (n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" )) ) { - log( n.name + n.desc + " - Invoke Virtual" ); + this.log( n.name + n.desc + " - Invoke Virtual" ); mn.instructions.insertBefore( n, new MethodInsnNode( Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc, false ) ); mn.instructions.remove( in ); break; @@ -153,7 +153,7 @@ public class ASMTweaker implements IClassTransformer if ( mn.name.equals( set.name ) && mn.desc.equals( set.desc ) ) { mn.access = (mn.access & (~(Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED))) | Opcodes.ACC_PUBLIC; - log( mn.name + mn.desc + " - Transformed" ); + this.log( mn.name + mn.desc + " - Transformed" ); } } } diff --git a/src/main/java/appeng/util/BlockUpdate.java b/src/main/java/appeng/util/BlockUpdate.java index 28c5384f4..65682c6ba 100644 --- a/src/main/java/appeng/util/BlockUpdate.java +++ b/src/main/java/appeng/util/BlockUpdate.java @@ -38,8 +38,8 @@ public class BlockUpdate implements Callable @Override public Object call() throws Exception { - if ( w.blockExists( x, y, z ) ) - w.notifyBlocksOfNeighborChange( x, y, z, Platform.air ); + if ( this.w.blockExists( this.x, this.y, this.z ) ) + this.w.notifyBlocksOfNeighborChange( this.x, this.y, this.z, Platform.air ); return true; } diff --git a/src/main/java/appeng/util/ClassInstantiation.java b/src/main/java/appeng/util/ClassInstantiation.java index 05ba655b4..63b67aaa7 100644 --- a/src/main/java/appeng/util/ClassInstantiation.java +++ b/src/main/java/appeng/util/ClassInstantiation.java @@ -46,14 +46,14 @@ public class ClassInstantiation for ( Constructor constructor : constructors ) { Class[] paramTypes = constructor.getParameterTypes(); - if ( paramTypes.length == args.length ) + if ( paramTypes.length == this.args.length ) { boolean valid = true; for ( int idx = 0; idx < paramTypes.length; idx++ ) { - Class cz = args[idx].getClass(); - if ( !isClassMatch( paramTypes[idx], cz, args[idx] ) ) + Class cz = this.args[idx].getClass(); + if ( !this.isClassMatch( paramTypes[idx], cz, this.args[idx] ) ) valid = false; } @@ -61,7 +61,7 @@ public class ClassInstantiation { try { - return Optional.of( constructor.newInstance( args ) ); + return Optional.of( constructor.newInstance( this.args ) ); } catch ( InstantiationException e ) { @@ -88,8 +88,8 @@ public class ClassInstantiation if ( value == null && !expected.isPrimitive() ) return true; - expected = condense( expected, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class ); - got = condense( got, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class ); + expected = this.condense( expected, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class ); + got = this.condense( got, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class ); return expected == got || expected.isAssignableFrom( got ); } diff --git a/src/main/java/appeng/util/ConfigManager.java b/src/main/java/appeng/util/ConfigManager.java index f4916ede9..5718b4313 100644 --- a/src/main/java/appeng/util/ConfigManager.java +++ b/src/main/java/appeng/util/ConfigManager.java @@ -34,7 +34,7 @@ public class ConfigManager implements IConfigManager final IConfigManagerHost target; public ConfigManager(IConfigManagerHost tile) { - target = tile; + this.target = tile; } /** @@ -45,7 +45,7 @@ public class ConfigManager implements IConfigManager @Override public void readFromNBT(NBTTagCompound tagCompound) { - for (Enum key : Settings.keySet()) + for (Enum key : this.Settings.keySet()) { try { @@ -60,11 +60,11 @@ public class ConfigManager implements IConfigManager value = LevelEmitterMode.STORABLE_AMOUNT.toString(); } - Enum oldValue = Settings.get( key ); + Enum oldValue = this.Settings.get( key ); Enum newValue = Enum.valueOf( oldValue.getClass(), value ); - putSetting( key, newValue ); + this.putSetting( key, newValue ); } } catch (IllegalArgumentException e) @@ -83,9 +83,9 @@ public class ConfigManager implements IConfigManager public void writeToNBT(NBTTagCompound tagCompound) { - for (Enum e : Settings.keySet()) + for (Enum e : this.Settings.keySet()) { - tagCompound.setString( e.name(), Settings.get( e ).toString() ); + tagCompound.setString( e.name(), this.Settings.get( e ).toString() ); } } @@ -93,19 +93,19 @@ public class ConfigManager implements IConfigManager @Override public Set getSettings() { - return Settings.keySet(); + return this.Settings.keySet(); } @Override public void registerSetting(Enum settingName, Enum defaultValue) { - Settings.put( settingName, defaultValue ); + this.Settings.put( settingName, defaultValue ); } @Override public Enum getSetting(Enum settingName) { - Enum oldValue = Settings.get( settingName ); + Enum oldValue = this.Settings.get( settingName ); if ( oldValue != null ) return oldValue; @@ -116,9 +116,9 @@ public class ConfigManager implements IConfigManager @Override public Enum putSetting(Enum settingName, Enum newValue) { - Enum oldValue = getSetting( settingName ); - Settings.put( settingName, newValue ); - target.updateSetting( this, settingName, newValue ); + Enum oldValue = this.getSetting( settingName ); + this.Settings.put( settingName, newValue ); + this.target.updateSetting( this, settingName, newValue ); return oldValue; } diff --git a/src/main/java/appeng/util/InWorldToolOperationResult.java b/src/main/java/appeng/util/InWorldToolOperationResult.java index 54ec7a449..dbb1ce613 100644 --- a/src/main/java/appeng/util/InWorldToolOperationResult.java +++ b/src/main/java/appeng/util/InWorldToolOperationResult.java @@ -56,17 +56,17 @@ public class InWorldToolOperationResult } public InWorldToolOperationResult() { - BlockItem = null; - Drops = null; + this.BlockItem = null; + this.Drops = null; } public InWorldToolOperationResult(ItemStack block, List drops) { - BlockItem = block; - Drops = drops; + this.BlockItem = block; + this.Drops = drops; } public InWorldToolOperationResult(ItemStack block) { - BlockItem = block; - Drops = null; + this.BlockItem = block; + this.Drops = null; } } diff --git a/src/main/java/appeng/util/ItemSorters.java b/src/main/java/appeng/util/ItemSorters.java index 7113255ed..dd27e685e 100644 --- a/src/main/java/appeng/util/ItemSorters.java +++ b/src/main/java/appeng/util/ItemSorters.java @@ -91,8 +91,8 @@ public class ItemSorters AEItemStack op2 = (AEItemStack) o2; if ( Direction == SortDir.ASCENDING ) - return secondarySort( op2.getModID().compareToIgnoreCase( op1.getModID() ), o1, o2 ); - return secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 ); + return this.secondarySort( op2.getModID().compareToIgnoreCase( op1.getModID() ), o1, o2 ); + return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 ); } private int secondarySort(int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2) diff --git a/src/main/java/appeng/util/ReadOnlyCollection.java b/src/main/java/appeng/util/ReadOnlyCollection.java index de34be57d..396a982c4 100644 --- a/src/main/java/appeng/util/ReadOnlyCollection.java +++ b/src/main/java/appeng/util/ReadOnlyCollection.java @@ -29,31 +29,31 @@ public class ReadOnlyCollection implements IReadOnlyCollection private final Collection c; public ReadOnlyCollection(Collection in) { - c = in; + this.c = in; } @Override public Iterator iterator() { - return c.iterator(); + return this.c.iterator(); } @Override public int size() { - return c.size(); + return this.c.size(); } @Override public boolean isEmpty() { - return c.isEmpty(); + return this.c.isEmpty(); } @Override public boolean contains(Object node) { - return c.contains( node ); + return this.c.contains( node ); } } diff --git a/src/main/java/appeng/util/inv/AdaptorBCPipe.java b/src/main/java/appeng/util/inv/AdaptorBCPipe.java index 67e5a4f01..729e3515e 100644 --- a/src/main/java/appeng/util/inv/AdaptorBCPipe.java +++ b/src/main/java/appeng/util/inv/AdaptorBCPipe.java @@ -38,18 +38,18 @@ public class AdaptorBCPipe extends InventoryAdaptor final private ForgeDirection d; public AdaptorBCPipe(TileEntity s, ForgeDirection dd) { - bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - if ( bc != null ) + this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); + if ( this.bc != null ) { - if ( bc.isPipe( s, dd ) ) + if ( this.bc.isPipe( s, dd ) ) { - i = s; - d = dd; + this.i = s; + this.d = dd; return; } } - i = null; - d = null; + this.i = null; + this.d = null; } @Override @@ -79,14 +79,14 @@ public class AdaptorBCPipe extends InventoryAdaptor @Override public ItemStack addItems(ItemStack A) { - if ( i == null ) + if ( this.i == null ) return A; if ( A == null ) return null; if ( A.stackSize == 0 ) return null; - if ( bc.addItemsToPipe( i, A, d ) ) + if ( this.bc.addItemsToPipe( this.i, A, this.d ) ) return null; return A; } @@ -94,7 +94,7 @@ public class AdaptorBCPipe extends InventoryAdaptor @Override public ItemStack simulateAdd(ItemStack A) { - if ( i == null ) + if ( this.i == null ) return A; return null; } diff --git a/src/main/java/appeng/util/inv/AdaptorIInventory.java b/src/main/java/appeng/util/inv/AdaptorIInventory.java index c718be48e..d593e5ec1 100644 --- a/src/main/java/appeng/util/inv/AdaptorIInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorIInventory.java @@ -36,24 +36,24 @@ public class AdaptorIInventory extends InventoryAdaptor public AdaptorIInventory( IInventory s ) { - i = s; - wrapperEnabled = s instanceof IInventoryWrapper; + this.i = s; + this.wrapperEnabled = s instanceof IInventoryWrapper; } boolean canRemoveStackFromSlot( int x, ItemStack is ) { - if ( wrapperEnabled ) - return ( ( IInventoryWrapper ) i ).canRemoveItemFromSlot( x, is ); + if ( this.wrapperEnabled ) + return ( ( IInventoryWrapper ) this.i ).canRemoveItemFromSlot( x, is ); return true; } @Override public boolean containsItems() { - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); for ( int x = 0; x < s; x++ ) { - if ( i.getStackInSlot( x ) != null ) + if ( this.i.getStackInSlot( x ) != null ) return true; } return false; @@ -62,11 +62,11 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) { - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); for ( int x = 0; x < s; x++ ) { - ItemStack is = i.getStackInSlot( x ); - if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) + ItemStack is = this.i.getStackInSlot( x ); + if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { int newAmount = amount; if ( newAmount > is.stackSize ) @@ -82,15 +82,15 @@ public class AdaptorIInventory extends InventoryAdaptor if ( is.stackSize == rv.stackSize ) { - i.setInventorySlotContents( x, null ); - i.markDirty(); + this.i.setInventorySlotContents( x, null ); + this.i.markDirty(); } else { ItemStack po = is.copy(); po.stackSize -= rv.stackSize; - i.setInventorySlotContents( x, po ); - i.markDirty(); + this.i.setInventorySlotContents( x, po ); + this.i.markDirty(); } } @@ -107,12 +107,12 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) { - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); for ( int x = 0; x < s; x++ ) { - ItemStack is = i.getStackInSlot( x ); + ItemStack is = this.i.getStackInSlot( x ); - if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) + if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { int boundAmount = amount; if ( boundAmount > is.stackSize ) @@ -134,13 +134,13 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) { - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); ItemStack rv = null; for ( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = i.getStackInSlot( x ); - if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) + ItemStack is = this.i.getStackInSlot( x ); + if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmounts = amount; if ( boundAmounts > is.stackSize ) @@ -165,15 +165,15 @@ public class AdaptorIInventory extends InventoryAdaptor if ( is.stackSize == boundAmounts ) { - i.setInventorySlotContents( x, null ); - i.markDirty(); + this.i.setInventorySlotContents( x, null ); + this.i.markDirty(); } else { ItemStack po = is.copy(); po.stackSize -= boundAmounts; - i.setInventorySlotContents( x, po ); - i.markDirty(); + this.i.setInventorySlotContents( x, po ); + this.i.markDirty(); } } } @@ -188,13 +188,13 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) { - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); ItemStack rv = null; for ( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = i.getStackInSlot( x ); - if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) + ItemStack is = this.i.getStackInSlot( x ); + if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmount = amount; if ( boundAmount > is.stackSize ) @@ -225,13 +225,13 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemStack addItems( ItemStack itemsToAdd ) { - return addItems( itemsToAdd, true ); + return this.addItems( itemsToAdd, true ); } @Override public ItemStack simulateAdd( ItemStack itemsToAdd ) { - return addItems( itemsToAdd, false ); + return this.addItems( itemsToAdd, false ); } /** @@ -254,25 +254,25 @@ public class AdaptorIInventory extends InventoryAdaptor ItemStack left = itemsToAdd.copy(); int stackLimit = itemsToAdd.getMaxStackSize(); - int perOperationLimit = Math.min( i.getInventoryStackLimit(), stackLimit ); - int inventorySize = i.getSizeInventory(); + int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit ); + int inventorySize = this.i.getSizeInventory(); for ( int slot = 0; slot < inventorySize; slot++ ) { ItemStack next = left.copy(); next.stackSize = Math.min( perOperationLimit, next.stackSize ); - if ( i.isItemValidForSlot( slot, next ) ) + if ( this.i.isItemValidForSlot( slot, next ) ) { - ItemStack is = i.getStackInSlot( slot ); + ItemStack is = this.i.getStackInSlot( slot ); if ( is == null ) { left.stackSize -= next.stackSize; if ( modulate ) { - i.setInventorySlotContents( slot, next ); - i.markDirty(); + this.i.setInventorySlotContents( slot, next ); + this.i.markDirty(); } if ( left.stackSize <= 0 ) @@ -288,8 +288,8 @@ public class AdaptorIInventory extends InventoryAdaptor if ( modulate ) { is.stackSize += used; - i.setInventorySlotContents( slot, is ); - i.markDirty(); + this.i.setInventorySlotContents( slot, is ); + this.i.markDirty(); } left.stackSize -= used; @@ -313,19 +313,19 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public boolean hasNext() { - return x < i.getSizeInventory(); + return this.x < AdaptorIInventory.this.i.getSizeInventory(); } @Override public ItemSlot next() { - ItemStack iss = i.getStackInSlot( x ); + ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x ); - is.isExtractable = canRemoveStackFromSlot( x, iss ); - is.setItemStack( iss ); + this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss ); + this.is.setItemStack( iss ); - is.slot = x++; - return is; + this.is.slot = this.x++; + return this.is; } @Override diff --git a/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java b/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java index 328197ce7..db8ced6fc 100644 --- a/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java @@ -36,37 +36,37 @@ public class AdaptorISpecialInventory extends InventoryAdaptor private final ForgeDirection d; public AdaptorISpecialInventory(ISpecialInventory s, ForgeDirection dd) { - i = s; - d = dd; + this.i = s; + this.d = dd; if ( s instanceof ISidedInventory ) - remover = new AdaptorIInventory( new WrapperMCISidedInventory( (ISidedInventory) s, d ) ); + this.remover = new AdaptorIInventory( new WrapperMCISidedInventory( (ISidedInventory) s, this.d ) ); else - remover = new AdaptorIInventory( s ); + this.remover = new AdaptorIInventory( s ); } @Override public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { - return remover.removeSimilarItems( how_many, filter, fuzzyMode, destination ); + return this.remover.removeSimilarItems( how_many, filter, fuzzyMode, destination ); } @Override public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { - return remover.simulateSimilarRemove( how_many, filter, fuzzyMode, destination ); + return this.remover.simulateSimilarRemove( how_many, filter, fuzzyMode, destination ); } @Override public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination) { - return remover.removeItems( how_many, filter, destination ); + return this.remover.removeItems( how_many, filter, destination ); } @Override public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination) { - return remover.simulateRemove( how_many, filter, destination ); + return this.remover.simulateRemove( how_many, filter, destination ); } @Override @@ -77,7 +77,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor if ( A.stackSize == 0 ) return null; - int used = i.addItem( A, true, d ); + int used = this.i.addItem( A, true, this.d ); ItemStack out = A.copy(); out.stackSize -= used; if ( out.stackSize > 0 ) @@ -88,7 +88,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor @Override public ItemStack simulateAdd(ItemStack A) { - int used = i.addItem( A, false, d ); + int used = this.i.addItem( A, false, this.d ); ItemStack out = A.copy(); out.stackSize -= used; if ( out.stackSize > 0 ) @@ -99,17 +99,17 @@ public class AdaptorISpecialInventory extends InventoryAdaptor @Override public boolean containsItems() { - if ( i instanceof ISidedInventory ) + if ( this.i instanceof ISidedInventory ) { - ISidedInventory sided = (ISidedInventory) i; - int slots[] = sided.getAccessibleSlotsFromSide( d.ordinal() ); + ISidedInventory sided = (ISidedInventory) this.i; + int slots[] = sided.getAccessibleSlotsFromSide( this.d.ordinal() ); if ( slots == null ) return false; for (int slot : slots) { - if ( i.getStackInSlot( slot ) != null ) + if ( this.i.getStackInSlot( slot ) != null ) { return true; } @@ -118,9 +118,9 @@ public class AdaptorISpecialInventory extends InventoryAdaptor return false; } - int s = i.getSizeInventory(); + int s = this.i.getSizeInventory(); for (int x = 0; x < s; x++) - if ( i.getStackInSlot( x ) != null ) + if ( this.i.getStackInSlot( x ) != null ) return true; return false; } @@ -128,7 +128,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor @Override public Iterator iterator() { - return remover.iterator(); + return this.remover.iterator(); } } diff --git a/src/main/java/appeng/util/inv/AdaptorList.java b/src/main/java/appeng/util/inv/AdaptorList.java index e8be21288..338213f90 100644 --- a/src/main/java/appeng/util/inv/AdaptorList.java +++ b/src/main/java/appeng/util/inv/AdaptorList.java @@ -33,16 +33,16 @@ public class AdaptorList extends InventoryAdaptor private final List i; public AdaptorList(List s) { - i = s; + this.i = s; } @Override public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { - int s = i.size(); + int s = this.i.size(); for (int x = 0; x < s; x++) { - ItemStack is = i.get( x ); + ItemStack is = this.i.get( x ); if ( is != null && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) ) { if ( how_many > is.stackSize ) @@ -58,7 +58,7 @@ public class AdaptorList extends InventoryAdaptor // remove it.. if ( is.stackSize <= 0 ) - i.remove( x ); + this.i.remove( x ); return rv; } @@ -70,7 +70,7 @@ public class AdaptorList extends InventoryAdaptor @Override public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { - for (ItemStack is : i) + for (ItemStack is : this.i) { if ( is != null && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) ) { @@ -98,10 +98,10 @@ public class AdaptorList extends InventoryAdaptor @Override public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination) { - int s = i.size(); + int s = this.i.size(); for (int x = 0; x < s; x++) { - ItemStack is = i.get( x ); + ItemStack is = this.i.get( x ); if ( is != null && (filter == null || Platform.isSameItemPrecise( is, filter )) ) { if ( how_many > is.stackSize ) @@ -117,7 +117,7 @@ public class AdaptorList extends InventoryAdaptor // remove it.. if ( is.stackSize <= 0 ) - i.remove( x ); + this.i.remove( x ); return rv; } @@ -129,7 +129,7 @@ public class AdaptorList extends InventoryAdaptor @Override public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination) { - for (ItemStack is : i) + for (ItemStack is : this.i) { if ( is != null && (filter == null || Platform.isSameItemPrecise( is, filter )) ) { @@ -164,7 +164,7 @@ public class AdaptorList extends InventoryAdaptor ItemStack left = A.copy(); - for (ItemStack is : i) + for (ItemStack is : this.i) { if ( Platform.isSameItem( is, left ) ) { @@ -173,7 +173,7 @@ public class AdaptorList extends InventoryAdaptor } } - i.add( left ); + this.i.add( left ); return null; } @@ -186,7 +186,7 @@ public class AdaptorList extends InventoryAdaptor @Override public boolean containsItems() { - for (ItemStack is : i) + for (ItemStack is : this.i) { if ( is != null ) { @@ -199,7 +199,7 @@ public class AdaptorList extends InventoryAdaptor @Override public Iterator iterator() { - return new StackToSlotIterator( i.iterator() ); + return new StackToSlotIterator( this.i.iterator() ); } } diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java index 13986d495..d535703c0 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java @@ -40,13 +40,13 @@ public class AdaptorPlayerHand extends InventoryAdaptor public AdaptorPlayerHand( EntityPlayer _p ) { - p = _p; + this.p = _p; } @Override public ItemStack removeSimilarItems( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) { - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( hand == null ) return null; @@ -56,7 +56,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor result.stackSize = hand.stackSize > how_many ? how_many : hand.stackSize; hand.stackSize -= how_many; if ( hand.stackSize <= 0 ) - p.inventory.setItemStack( null ); + this.p.inventory.setItemStack( null ); return result; } @@ -67,7 +67,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor public ItemStack simulateSimilarRemove( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) { - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( hand == null ) return null; @@ -84,7 +84,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor @Override public ItemStack removeItems( int how_many, ItemStack Filter, IInventoryDestination destination ) { - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( hand == null ) return null; @@ -94,7 +94,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor result.stackSize = hand.stackSize > how_many ? how_many : hand.stackSize; hand.stackSize -= how_many; if ( hand.stackSize <= 0 ) - p.inventory.setItemStack( null ); + this.p.inventory.setItemStack( null ); return result; } @@ -105,7 +105,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor public ItemStack simulateRemove( int how_many, ItemStack Filter, IInventoryDestination destination ) { - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( hand == null ) return null; @@ -127,12 +127,12 @@ public class AdaptorPlayerHand extends InventoryAdaptor return null; if ( A.stackSize == 0 ) return null; - if ( p == null ) + if ( this.p == null ) return A; - if ( p.inventory == null ) + if ( this.p.inventory == null ) return A; - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( hand != null && !Platform.isSameItemPrecise( A, hand ) ) return A; @@ -153,18 +153,18 @@ public class AdaptorPlayerHand extends InventoryAdaptor newHand.stackSize = newHand.getMaxStackSize(); ItemStack B = A.copy(); B.stackSize -= newHand.stackSize - original; - p.inventory.setItemStack( newHand ); + this.p.inventory.setItemStack( newHand ); return B; } - p.inventory.setItemStack( newHand ); + this.p.inventory.setItemStack( newHand ); return null; } @Override public ItemStack simulateAdd( ItemStack A ) { - ItemStack hand = p.inventory.getItemStack(); + ItemStack hand = this.p.inventory.getItemStack(); if ( A == null ) return null; @@ -196,7 +196,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor @Override public boolean containsItems() { - return p.inventory.getItemStack() != null; + return this.p.inventory.getItemStack() != null; } @Override diff --git a/src/main/java/appeng/util/inv/IMEAdaptor.java b/src/main/java/appeng/util/inv/IMEAdaptor.java index 31116a27e..214e7b864 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptor.java +++ b/src/main/java/appeng/util/inv/IMEAdaptor.java @@ -41,19 +41,19 @@ public class IMEAdaptor extends InventoryAdaptor int maxSlots = 0; public IMEAdaptor(IMEInventory input, BaseActionSource src) { - target = input; + this.target = input; this.src = src; } IItemList getList() { - return target.getAvailableItems( AEApi.instance().storage().createItemList() ); + return this.target.getAvailableItems( AEApi.instance().storage().createItemList() ); } @Override public Iterator iterator() { - return new IMEAdaptorIterator( this, getList() ); + return new IMEAdaptorIterator( this, this.getList() ); } public ItemStack doRemoveItemsFuzzy(int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode) @@ -64,12 +64,12 @@ public class IMEAdaptor extends InventoryAdaptor IAEItemStack out = null; - for (IAEItemStack req : ImmutableList.copyOf( getList().findFuzzy( reqFilter, fuzzyMode ) )) + for (IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) )) { if ( req != null ) { req.setStackSize( how_many ); - out = target.extractItems( req, type, src ); + out = this.target.extractItems( req, type, this.src ); if ( out != null ) return out.getItemStack(); } @@ -84,7 +84,7 @@ public class IMEAdaptor extends InventoryAdaptor if ( Filter == null ) { - IItemList list = getList(); + IItemList list = this.getList(); if ( !list.isEmpty() ) req = list.getFirstItem(); } @@ -96,7 +96,7 @@ public class IMEAdaptor extends InventoryAdaptor if ( req != null ) { req.setStackSize( how_many ); - out = target.extractItems( req, type, src ); + out = this.target.extractItems( req, type, this.src ); } if ( out != null ) @@ -108,29 +108,29 @@ public class IMEAdaptor extends InventoryAdaptor @Override public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestination destination) { - return doRemoveItems( how_many, Filter, destination, Actionable.MODULATE ); + return this.doRemoveItems( how_many, Filter, destination, Actionable.MODULATE ); } @Override public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestination destination) { - return doRemoveItems( how_many, Filter, destination, Actionable.SIMULATE ); + return this.doRemoveItems( how_many, Filter, destination, Actionable.SIMULATE ); } @Override public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { if ( filter == null ) - return doRemoveItems( how_many, null, destination, Actionable.MODULATE ); - return doRemoveItemsFuzzy( how_many, filter, destination, Actionable.MODULATE, fuzzyMode ); + return this.doRemoveItems( how_many, null, destination, Actionable.MODULATE ); + return this.doRemoveItemsFuzzy( how_many, filter, destination, Actionable.MODULATE, fuzzyMode ); } @Override public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { if ( filter == null ) - return doRemoveItems( how_many, null, destination, Actionable.SIMULATE ); - return doRemoveItemsFuzzy( how_many, filter, destination, Actionable.SIMULATE, fuzzyMode ); + return this.doRemoveItems( how_many, null, destination, Actionable.SIMULATE ); + return this.doRemoveItemsFuzzy( how_many, filter, destination, Actionable.SIMULATE, fuzzyMode ); } @Override @@ -139,7 +139,7 @@ public class IMEAdaptor extends InventoryAdaptor IAEItemStack in = AEItemStack.create( A ); if ( in != null ) { - IAEItemStack out = target.injectItems( in, Actionable.MODULATE, src ); + IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src ); if ( out != null ) return out.getItemStack(); } @@ -152,7 +152,7 @@ public class IMEAdaptor extends InventoryAdaptor IAEItemStack in = AEItemStack.create( A ); if ( in != null ) { - IAEItemStack out = target.injectItems( in, Actionable.SIMULATE, src ); + IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src ); if ( out != null ) return out.getItemStack(); } @@ -162,7 +162,7 @@ public class IMEAdaptor extends InventoryAdaptor @Override public boolean containsItems() { - return !getList().isEmpty(); + return !this.getList().isEmpty(); } } diff --git a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java index a644c1e22..d20610462 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java +++ b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java @@ -35,36 +35,36 @@ public class IMEAdaptorIterator implements Iterator final int containerSize; public IMEAdaptorIterator(IMEAdaptor parent, IItemList availableItems) { - stack = availableItems.iterator(); - containerSize = parent.maxSlots; + this.stack = availableItems.iterator(); + this.containerSize = parent.maxSlots; this.parent = parent; } @Override public boolean hasNext() { - hasNext = stack.hasNext(); - return offset < containerSize || hasNext; + this.hasNext = this.stack.hasNext(); + return this.offset < this.containerSize || this.hasNext; } @Override public ItemSlot next() { - slot.slot = offset++; - slot.isExtractable=true; + this.slot.slot = this.offset++; + this.slot.isExtractable=true; - if ( parent.maxSlots < offset ) - parent.maxSlots = offset; + if ( this.parent.maxSlots < this.offset ) + this.parent.maxSlots = this.offset; - if ( hasNext ) + if ( this.hasNext ) { - IAEItemStack item = stack.next(); - slot.setAEItemStack( item ); - return slot; + IAEItemStack item = this.stack.next(); + this.slot.setAEItemStack( item ); + return this.slot; } - slot.setItemStack( null ); - return slot; + this.slot.setItemStack( null ); + return this.slot; } @Override diff --git a/src/main/java/appeng/util/inv/IMEInventoryDestination.java b/src/main/java/appeng/util/inv/IMEInventoryDestination.java index 2fce37842..049f84aba 100644 --- a/src/main/java/appeng/util/inv/IMEInventoryDestination.java +++ b/src/main/java/appeng/util/inv/IMEInventoryDestination.java @@ -30,7 +30,7 @@ public class IMEInventoryDestination implements IInventoryDestination final IMEInventory me; public IMEInventoryDestination(IMEInventory o) { - me = o; + this.me = o; } @Override @@ -40,7 +40,7 @@ public class IMEInventoryDestination implements IInventoryDestination if ( stack == null ) return false; - IAEItemStack failed = me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); + IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); if ( failed == null ) return true; diff --git a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java index 0a53c85fd..7ef223ec6 100644 --- a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java +++ b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java @@ -31,7 +31,7 @@ public class ItemListIgnoreCrafting implements IItemList final IItemList target; public ItemListIgnoreCrafting(IItemList cla) { - target = cla; + this.target = cla; } @Override @@ -43,7 +43,7 @@ public class ItemListIgnoreCrafting implements IItemList option.setCraftable( false ); } - target.add( option ); + this.target.add( option ); } @Override @@ -55,54 +55,54 @@ public class ItemListIgnoreCrafting implements IItemList @Override public T findPrecise(T i) { - return target.findPrecise( i ); + return this.target.findPrecise( i ); } @Override public Collection findFuzzy(T input, FuzzyMode fuzzy) { - return target.findFuzzy( input, fuzzy ); + return this.target.findFuzzy( input, fuzzy ); } @Override public boolean isEmpty() { - return target.isEmpty(); + return this.target.isEmpty(); } @Override public void addStorage(T option) { - target.addStorage( option ); + this.target.addStorage( option ); } @Override public void addRequestable(T option) { - target.addRequestable( option ); + this.target.addRequestable( option ); } @Override public T getFirstItem() { - return target.getFirstItem(); + return this.target.getFirstItem(); } @Override public int size() { - return target.size(); + return this.target.size(); } @Override public Iterator iterator() { - return target.iterator(); + return this.target.iterator(); } @Override public void resetStatus() { - target.resetStatus(); + this.target.resetStatus(); } } diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index 24a5068f8..11bf8adff 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -35,24 +35,24 @@ public class ItemSlot public void setItemStack(ItemStack is) { - aeItemStack = null; - itemStack = is; + this.aeItemStack = null; + this.itemStack = is; } public void setAEItemStack(IAEItemStack is) { - aeItemStack = is; - itemStack = null; + this.aeItemStack = is; + this.itemStack = null; } public ItemStack getItemStack() { - return itemStack == null ? (aeItemStack == null ? null : (itemStack = aeItemStack.getItemStack())) : itemStack; + return this.itemStack == null ? (this.aeItemStack == null ? null : (this.itemStack = this.aeItemStack.getItemStack())) : this.itemStack; } public IAEItemStack getAEItemStack() { - return aeItemStack == null ? (itemStack == null ? null : (aeItemStack = AEItemStack.create( itemStack ))) : aeItemStack; + return this.aeItemStack == null ? (this.itemStack == null ? null : (this.aeItemStack = AEItemStack.create( this.itemStack ))) : this.aeItemStack; } } diff --git a/src/main/java/appeng/util/inv/WrapperBCPipe.java b/src/main/java/appeng/util/inv/WrapperBCPipe.java index becec4cfb..0118893a1 100644 --- a/src/main/java/appeng/util/inv/WrapperBCPipe.java +++ b/src/main/java/appeng/util/inv/WrapperBCPipe.java @@ -35,9 +35,9 @@ public class WrapperBCPipe implements IInventory final private ForgeDirection dir; public WrapperBCPipe(TileEntity te, ForgeDirection d) { - bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - ad = te; - dir = d; + this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); + this.ad = te; + this.dir = d; } @Override @@ -67,7 +67,7 @@ public class WrapperBCPipe implements IInventory @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - bc.addItemsToPipe( ad, itemstack, dir ); + this.bc.addItemsToPipe( this.ad, itemstack, this.dir ); } @Override @@ -115,7 +115,7 @@ public class WrapperBCPipe implements IInventory @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return bc.canAddItemsToPipe( ad, itemstack, dir ); + return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir ); } } diff --git a/src/main/java/appeng/util/inv/WrapperChainedInventory.java b/src/main/java/appeng/util/inv/WrapperChainedInventory.java index f28c6e50e..ad3eab001 100644 --- a/src/main/java/appeng/util/inv/WrapperChainedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperChainedInventory.java @@ -45,31 +45,31 @@ public class WrapperChainedInventory implements IInventory private HashMap offsets; public WrapperChainedInventory(IInventory... inventories) { - setInventory( inventories ); + this.setInventory( inventories ); } public WrapperChainedInventory(List inventories) { - setInventory( inventories ); + this.setInventory( inventories ); } public void cycleOrder() { - if ( l.size() > 1 ) + if ( this.l.size() > 1 ) { - List newOrder = new ArrayList( l.size() ); - newOrder.add( l.get( l.size() - 1 ) ); - for (int x = 0; x < l.size() - 1; x++) - newOrder.add( l.get( x ) ); - setInventory( newOrder ); + List newOrder = new ArrayList( this.l.size() ); + newOrder.add( this.l.get( this.l.size() - 1 ) ); + for (int x = 0; x < this.l.size() - 1; x++) + newOrder.add( this.l.get( x ) ); + this.setInventory( newOrder ); } } public void calculateSizes() { - offsets = new HashMap(); + this.offsets = new HashMap(); int offset = 0; - for (IInventory in : l) + for (IInventory in : this.l) { InvOffset io = new InvOffset(); io.offset = offset; @@ -78,30 +78,30 @@ public class WrapperChainedInventory implements IInventory for (int y = 0; y < io.size; y++) { - offsets.put( y + io.offset, io ); + this.offsets.put( y + io.offset, io ); } offset += io.size; } - fullSize = offset; + this.fullSize = offset; } public void setInventory(IInventory... a) { - l = ImmutableList.copyOf( a ); - calculateSizes(); + this.l = ImmutableList.copyOf( a ); + this.calculateSizes(); } public void setInventory(List a) { - l = a; - calculateSizes(); + this.l = a; + this.calculateSizes(); } public IInventory getInv(int idx) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return io.i; @@ -111,7 +111,7 @@ public class WrapperChainedInventory implements IInventory public int getInvSlot(int idx) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return idx - io.offset; @@ -122,13 +122,13 @@ public class WrapperChainedInventory implements IInventory @Override public int getSizeInventory() { - return fullSize; + return this.fullSize; } @Override public ItemStack getStackInSlot(int idx) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return io.i.getStackInSlot( idx - io.offset ); @@ -139,7 +139,7 @@ public class WrapperChainedInventory implements IInventory @Override public ItemStack decrStackSize(int idx, int var2) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return io.i.decrStackSize( idx - io.offset, var2 ); @@ -150,7 +150,7 @@ public class WrapperChainedInventory implements IInventory @Override public ItemStack getStackInSlotOnClosing(int idx) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return io.i.getStackInSlotOnClosing( idx - io.offset ); @@ -161,7 +161,7 @@ public class WrapperChainedInventory implements IInventory @Override public void setInventorySlotContents(int idx, ItemStack var2) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { io.i.setInventorySlotContents( idx - io.offset, var2 ); @@ -179,7 +179,7 @@ public class WrapperChainedInventory implements IInventory { int smallest = 64; - for (IInventory i : l) + for (IInventory i : this.l) smallest = Math.min( smallest, i.getInventoryStackLimit() ); return smallest; @@ -188,7 +188,7 @@ public class WrapperChainedInventory implements IInventory @Override public void markDirty() { - for (IInventory i : l) + for (IInventory i : this.l) { i.markDirty(); } @@ -219,7 +219,7 @@ public class WrapperChainedInventory implements IInventory @Override public boolean isItemValidForSlot(int idx, ItemStack itemstack) { - InvOffset io = offsets.get( idx ); + InvOffset io = this.offsets.get( idx ); if ( io != null ) { return io.i.isItemValidForSlot( idx - io.offset, itemstack ); diff --git a/src/main/java/appeng/util/inv/WrapperInvSlot.java b/src/main/java/appeng/util/inv/WrapperInvSlot.java index f1283b5b8..2c85cdcf0 100644 --- a/src/main/java/appeng/util/inv/WrapperInvSlot.java +++ b/src/main/java/appeng/util/inv/WrapperInvSlot.java @@ -45,73 +45,73 @@ public class WrapperInvSlot @Override public ItemStack getStackInSlot(int i) { - return inv.getStackInSlot( slot ); + return this.inv.getStackInSlot( this.slot ); } @Override public ItemStack decrStackSize(int i, int num) { - return inv.decrStackSize( slot, num ); + return this.inv.decrStackSize( this.slot, num ); } @Override public ItemStack getStackInSlotOnClosing(int i) { - return inv.getStackInSlotOnClosing( slot ); + return this.inv.getStackInSlotOnClosing( this.slot ); } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - inv.setInventorySlotContents( slot, itemstack ); + this.inv.setInventorySlotContents( this.slot, itemstack ); } @Override public String getInventoryName() { - return inv.getInventoryName(); + return this.inv.getInventoryName(); } @Override public boolean hasCustomInventoryName() { - return inv.hasCustomInventoryName(); + return this.inv.hasCustomInventoryName(); } @Override public int getInventoryStackLimit() { - return inv.getInventoryStackLimit(); + return this.inv.getInventoryStackLimit(); } @Override public void markDirty() { - inv.markDirty(); + this.inv.markDirty(); } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return inv.isUseableByPlayer( entityplayer ); + return this.inv.isUseableByPlayer( entityplayer ); } @Override public void openInventory() { - inv.openInventory(); + this.inv.openInventory(); } @Override public void closeInventory() { - inv.closeInventory(); + this.inv.closeInventory(); } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return isItemValid( itemstack ) && inv.isItemValidForSlot( slot, itemstack ); + return WrapperInvSlot.this.isItemValid( itemstack ) && this.inv.isItemValidForSlot( this.slot, itemstack ); } } @@ -123,7 +123,7 @@ public class WrapperInvSlot public IInventory getWrapper(int slot) { - return new InternalInterfaceWrapper( inv, slot ); + return new InternalInterfaceWrapper( this.inv, slot ); } protected boolean isItemValid(ItemStack itemstack) diff --git a/src/main/java/appeng/util/inv/WrapperInventoryRange.java b/src/main/java/appeng/util/inv/WrapperInventoryRange.java index 0860f9128..7f05f7ab9 100644 --- a/src/main/java/appeng/util/inv/WrapperInventoryRange.java +++ b/src/main/java/appeng/util/inv/WrapperInventoryRange.java @@ -48,87 +48,87 @@ public class WrapperInventoryRange implements IInventory } public WrapperInventoryRange(IInventory a, int[] s, boolean ignoreValid) { - src = a; - slots = s; + this.src = a; + this.slots = s; - if ( slots == null ) - slots = new int[0]; + if ( this.slots == null ) + this.slots = new int[0]; - ignoreValidItems = ignoreValid; + this.ignoreValidItems = ignoreValid; } public WrapperInventoryRange(IInventory a, int _min, int _size, boolean ignoreValid) { - src = a; - slots = new int[_size]; + this.src = a; + this.slots = new int[_size]; for (int x = 0; x < _size; x++) - slots[x] = _min + x; - ignoreValidItems = ignoreValid; + this.slots[x] = _min + x; + this.ignoreValidItems = ignoreValid; } @Override public int getSizeInventory() { - return slots.length; + return this.slots.length; } @Override public ItemStack getStackInSlot(int var1) { - return src.getStackInSlot( slots[var1] ); + return this.src.getStackInSlot( this.slots[var1] ); } @Override public ItemStack decrStackSize(int var1, int var2) { - return src.decrStackSize( slots[var1], var2 ); + return this.src.decrStackSize( this.slots[var1], var2 ); } @Override public ItemStack getStackInSlotOnClosing(int var1) { - return src.getStackInSlotOnClosing( slots[var1] ); + return this.src.getStackInSlotOnClosing( this.slots[var1] ); } @Override public void setInventorySlotContents(int var1, ItemStack var2) { - src.setInventorySlotContents( slots[var1], var2 ); + this.src.setInventorySlotContents( this.slots[var1], var2 ); } @Override public String getInventoryName() { - return src.getInventoryName(); + return this.src.getInventoryName(); } @Override public int getInventoryStackLimit() { - return src.getInventoryStackLimit(); + return this.src.getInventoryStackLimit(); } @Override public void markDirty() { - src.markDirty(); + this.src.markDirty(); } @Override public boolean isUseableByPlayer(EntityPlayer var1) { - return src.isUseableByPlayer( var1 ); + return this.src.isUseableByPlayer( var1 ); } @Override public void openInventory() { - src.openInventory(); + this.src.openInventory(); } @Override public void closeInventory() { - src.closeInventory(); + this.src.closeInventory(); } @Override @@ -140,10 +140,10 @@ public class WrapperInventoryRange implements IInventory @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - if ( ignoreValidItems ) + if ( this.ignoreValidItems ) return true; - return src.isItemValidForSlot( slots[i], itemstack ); + return this.src.isItemValidForSlot( this.slots[i], itemstack ); } } diff --git a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java index 90c957955..a9d82e9cc 100644 --- a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java @@ -30,19 +30,19 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I public WrapperMCISidedInventory(ISidedInventory a, ForgeDirection d) { super( a, a.getAccessibleSlotsFromSide( d.ordinal() ), false ); - side = a; - dir = d; + this.side = a; + this.dir = d; } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - if ( ignoreValidItems ) + if ( this.ignoreValidItems ) return true; - if ( side.isItemValidForSlot( slots[i], itemstack ) ) - return side.canInsertItem( slots[i], itemstack, dir.ordinal() ); + if ( this.side.isItemValidForSlot( this.slots[i], itemstack ) ) + return this.side.canInsertItem( this.slots[i], itemstack, this.dir.ordinal() ); return false; } @@ -53,13 +53,13 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I if ( is == null ) return false; - return side.canExtractItem( slots[i], is, dir.ordinal() ); + return this.side.canExtractItem( this.slots[i], is, this.dir.ordinal() ); } @Override public ItemStack decrStackSize(int var1, int var2) { - if ( canRemoveItemFromSlot( var1, getStackInSlot( var1 ) ) ) + if ( this.canRemoveItemFromSlot( var1, this.getStackInSlot( var1 ) ) ) return super.decrStackSize( var1, var2 ); return null; } diff --git a/src/main/java/appeng/util/inv/WrapperTEPipe.java b/src/main/java/appeng/util/inv/WrapperTEPipe.java index be9595700..57fc4d4e3 100644 --- a/src/main/java/appeng/util/inv/WrapperTEPipe.java +++ b/src/main/java/appeng/util/inv/WrapperTEPipe.java @@ -31,8 +31,8 @@ public class WrapperTEPipe implements IInventory final ForgeDirection dir; public WrapperTEPipe(TileEntity te, ForgeDirection d) { - ad = te; - dir = d; + this.ad = te; + this.dir = d; } @Override diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index e0856ce3b..a1537583d 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -47,13 +47,13 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public String toString() { - return getFluidStack().toString(); + return this.getFluidStack().toString(); } @Override public IAETagCompound getTagCompound() { - return tagCompound; + return this.tagCompound; } @Override @@ -65,19 +65,19 @@ public final class AEFluidStack extends AEStack implements IAEFlu // if ( priority < ((AEFluidStack) option).priority ) // priority = ((AEFluidStack) option).priority; - incStackSize( option.getStackSize() ); - setCountRequestable( getCountRequestable() + option.getCountRequestable() ); - setCraftable( isCraftable() || option.isCraftable() ); + this.incStackSize( option.getStackSize() ); + this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() ); + this.setCraftable( this.isCraftable() || option.isCraftable() ); } private AEFluidStack(AEFluidStack is) { - fluid = is.fluid; - stackSize = is.stackSize; + this.fluid = is.fluid; + this.stackSize = is.stackSize; // priority = is.priority; - setCraftable( is.isCraftable() ); - setCountRequestable( is.getCountRequestable() ); + this.setCraftable( is.isCraftable() ); + this.setCountRequestable( is.getCountRequestable() ); this.myHash = is.myHash; } @@ -86,16 +86,16 @@ public final class AEFluidStack extends AEStack implements IAEFlu if ( is == null ) throw new RuntimeException( "Invalid Itemstack." ); - fluid = is.getFluid(); + this.fluid = is.getFluid(); - if ( fluid == null ) + if ( this.fluid == null ) throw new RuntimeException( "Fluid is null." ); - stackSize = is.amount; - setCraftable( false ); - setCountRequestable( 0 ); + this.stackSize = is.amount; + this.setCraftable( false ); + this.setCountRequestable( 0 ); - myHash = fluid.hashCode() ^ (tagCompound == null ? 0 : System.identityHashCode( tagCompound )); + this.myHash = this.fluid.hashCode() ^ (this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound )); } public static AEFluidStack create(Object a) @@ -114,7 +114,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu { if ( ia instanceof AEFluidStack ) { - return ((AEFluidStack) ia).fluid == fluid && tagCompound == ((AEFluidStack) ia).tagCompound; + return ((AEFluidStack) ia).fluid == this.fluid && this.tagCompound == ((AEFluidStack) ia).tagCompound; } else if ( ia instanceof FluidStack ) { @@ -122,7 +122,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu if ( is.fluidID == this.fluid.getID() ) { - NBTTagCompound ta = (NBTTagCompound) tagCompound; + NBTTagCompound ta = (NBTTagCompound) this.tagCompound; NBTTagCompound tb = is.tag; if ( ta == tb ) return true; @@ -146,9 +146,9 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public FluidStack getFluidStack() { - FluidStack is = new FluidStack( fluid, (int) Math.min( Integer.MAX_VALUE, stackSize ) ); - if ( tagCompound != null ) - is.tag = tagCompound.getNBTTagCompoundCopy(); + FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) ); + if ( this.tagCompound != null ) + is.tag = this.tagCompound.getNBTTagCompoundCopy(); return is; } @@ -197,8 +197,8 @@ public final class AEFluidStack extends AEStack implements IAEFlu * 1 : 0); else */i.setBoolean( "Craft", this.isCraftable() ); - if ( tagCompound != null ) - i.setTag( "tag", (NBTTagCompound) tagCompound ); + if ( this.tagCompound != null ) + i.setTag( "tag", (NBTTagCompound) this.tagCompound ); else i.removeTag( "tag" ); @@ -220,26 +220,26 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public boolean hasTagCompound() { - return tagCompound != null; + return this.tagCompound != null; } @Override public int hashCode() { - return myHash; + return this.myHash; } @Override public int compareTo(AEFluidStack b) { - int diff = hashCode() - b.hashCode(); + int diff = this.hashCode() - b.hashCode(); return diff > 0 ? 1 : (diff < 0 ? -1 : 0); } @Override void writeIdentity(ByteBuf i) throws IOException { - byte[] name = fluid.getName().getBytes( "UTF-8" ); + byte[] name = this.fluid.getName().getBytes( "UTF-8" ); i.writeByte( (byte) name.length ); i.writeBytes( name ); } @@ -247,12 +247,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override void readNBT(ByteBuf i) throws IOException { - if ( hasTagCompound() ) + if ( this.hasTagCompound() ) { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DataOutputStream data = new DataOutputStream( bytes ); - CompressedStreamTools.write( (NBTTagCompound) getTagCompound(), data ); + CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data ); byte[] tagBytes = bytes.toByteArray(); int size = tagBytes.length; @@ -311,13 +311,13 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public Fluid getFluid() { - return fluid; + return this.fluid; } @Override public IAEFluidStack empty() { - IAEFluidStack dup = copy(); + IAEFluidStack dup = this.copy(); dup.reset(); return dup; } @@ -327,12 +327,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu { if ( st instanceof FluidStack ) { - return ((FluidStack) st).getFluid() == getFluid(); + return ((FluidStack) st).getFluid() == this.getFluid(); } if ( st instanceof IAEFluidStack ) { - return ((IAEFluidStack) st).getFluid() == getFluid(); + return ((IAEFluidStack) st).getFluid() == this.getFluid(); } return false; diff --git a/src/main/java/appeng/util/item/AEItemDef.java b/src/main/java/appeng/util/item/AEItemDef.java index 510770626..c3ce1fd06 100644 --- a/src/main/java/appeng/util/item/AEItemDef.java +++ b/src/main/java/appeng/util/item/AEItemDef.java @@ -59,19 +59,19 @@ public class AEItemDef static final AESharedNBT highTag = new AESharedNBT( Integer.MAX_VALUE ); public AEItemDef(Item it) { - item = it; - itemID = System.identityHashCode( item ); + this.item = it; + this.itemID = System.identityHashCode( this.item ); } public AEItemDef copy() { - AEItemDef t = new AEItemDef( item ); - t.def = def; - t.damageValue = damageValue; - t.displayDamage = displayDamage; - t.maxDamage = maxDamage; - t.tagCompound = tagCompound; - t.isOre = isOre; + AEItemDef t = new AEItemDef( this.item ); + t.def = this.def; + t.damageValue = this.damageValue; + t.displayDamage = this.displayDamage; + t.maxDamage = this.maxDamage; + t.tagCompound = this.tagCompound; + t.isOre = this.isOre; return t; } @@ -80,10 +80,10 @@ public class AEItemDef { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; AEItemDef other = (AEItemDef) obj; - return other.damageValue == damageValue && other.item == item && tagCompound == other.tagCompound; + return other.damageValue == this.damageValue && other.item == this.item && this.tagCompound == other.tagCompound; } public int getDamageValueHack(ItemStack is) @@ -94,15 +94,15 @@ public class AEItemDef public boolean isItem(ItemStack otherStack) { // hackery! - int dmg = getDamageValueHack( otherStack ); + int dmg = this.getDamageValueHack( otherStack ); - if ( item == otherStack.getItem() && dmg == damageValue ) + if ( this.item == otherStack.getItem() && dmg == this.damageValue ) { - if ( (tagCompound != null) == otherStack.hasTagCompound() ) + if ( (this.tagCompound != null) == otherStack.hasTagCompound() ) return true; - if ( tagCompound != null && otherStack.hasTagCompound() ) - return Platform.NBTEqualityTest( tagCompound, otherStack.getTagCompound() ); + if ( this.tagCompound != null && otherStack.hasTagCompound() ) + return Platform.NBTEqualityTest( this.tagCompound, otherStack.getTagCompound() ); return true; } @@ -111,7 +111,7 @@ public class AEItemDef public void reHash() { - def = itemID << Platform.DEF_OFFSET | damageValue; - myHash = def ^ (tagCompound == null ? 0 : System.identityHashCode( tagCompound )); + this.def = this.itemID << Platform.DEF_OFFSET | this.damageValue; + this.myHash = this.def ^ (this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound )); } } diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index b2403ee6d..c35ba444f 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -49,7 +49,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public String toString() { - return getItemStack().toString(); + return this.getItemStack().toString(); } @Override @@ -61,25 +61,25 @@ public final class AEItemStack extends AEStack implements IAEItemS // if ( priority < ((AEItemStack) option).priority ) // priority = ((AEItemStack) option).priority; - incStackSize( option.getStackSize() ); - setCountRequestable( getCountRequestable() + option.getCountRequestable() ); - setCraftable( isCraftable() || option.isCraftable() ); + this.incStackSize( option.getStackSize() ); + this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() ); + this.setCraftable( this.isCraftable() || option.isCraftable() ); } private AEItemStack(AEItemStack is) { - def = is.def; - stackSize = is.stackSize; - setCraftable( is.isCraftable() ); - setCountRequestable( is.getCountRequestable() ); + this.def = is.def; + this.stackSize = is.stackSize; + this.setCraftable( is.isCraftable() ); + this.setCountRequestable( is.getCountRequestable() ); } protected AEItemStack(ItemStack is) { if ( is == null ) throw new RuntimeException( "Invalid Itemstack." ); - def = new AEItemDef( is.getItem() ); + this.def = new AEItemDef( is.getItem() ); - if ( def.item == null ) + if ( this.def.item == null ) throw new RuntimeException( "This ItemStack is bad, it has a null item." ); /* @@ -95,20 +95,20 @@ public final class AEItemStack extends AEStack implements IAEItemS /* * Kinda hackery */ - def.damageValue = def.getDamageValueHack( is ); - def.displayDamage = is.getItemDamageForDisplay(); - def.maxDamage = is.getMaxDamage(); + this.def.damageValue = this.def.getDamageValueHack( is ); + this.def.displayDamage = is.getItemDamageForDisplay(); + this.def.maxDamage = is.getMaxDamage(); NBTTagCompound tagCompound = is.getTagCompound(); if ( tagCompound != null ) - def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is ); + this.def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is ); - stackSize = is.stackSize; - setCraftable( false ); - setCountRequestable( 0 ); + this.stackSize = is.stackSize; + this.setCraftable( false ); + this.setCountRequestable( 0 ); - def.reHash(); - def.isOre = OreHelper.instance.isOre( is ); + this.def.reHash(); + this.def.isOre = OreHelper.instance.isOre( is ); } public static AEItemStack create(Object a) @@ -123,7 +123,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public Item getItem() { - return def.item; + return this.def.item; } @Override @@ -131,15 +131,15 @@ public final class AEItemStack extends AEStack implements IAEItemS { if ( ia instanceof AEItemStack ) { - return ((AEItemStack) ia).def.equals( def );// && def.tagCompound == ((AEItemStack) ia).def.tagCompound; + return ((AEItemStack) ia).def.equals( this.def );// && def.tagCompound == ((AEItemStack) ia).def.tagCompound; } else if ( ia instanceof ItemStack ) { ItemStack is = (ItemStack) ia; - if ( is.getItem() == def.item && is.getItemDamage() == this.def.damageValue ) + if ( is.getItem() == this.def.item && is.getItemDamage() == this.def.damageValue ) { - NBTTagCompound ta = def.tagCompound; + NBTTagCompound ta = this.def.tagCompound; NBTTagCompound tb = is.getTagCompound(); if ( ta == tb ) return true; @@ -163,9 +163,9 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public ItemStack getItemStack() { - ItemStack is = new ItemStack( def.item, (int) Math.min( Integer.MAX_VALUE, stackSize ), def.damageValue ); - if ( def.tagCompound != null ) - is.setTagCompound( def.tagCompound.getNBTTagCompoundCopy() ); + ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue ); + if ( this.def.tagCompound != null ) + is.setTagCompound( this.def.tagCompound.getNBTTagCompoundCopy() ); return is; } @@ -220,8 +220,8 @@ public final class AEItemStack extends AEStack implements IAEItemS */ i.setShort( "Damage", (short) this.def.damageValue ); - if ( def.tagCompound != null ) - i.setTag( "tag", def.tagCompound ); + if ( this.def.tagCompound != null ) + i.setTag( "tag", this.def.tagCompound ); else i.removeTag( "tag" ); @@ -247,30 +247,30 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public boolean hasTagCompound() { - return def.tagCompound != null; + return this.def.tagCompound != null; } @Override public int hashCode() { - return def.myHash; + return this.def.myHash; } @Override public int compareTo(AEItemStack b) { - int id = compare( def.item.hashCode(), b.def.item.hashCode() ); - int damageValue = compare( def.damageValue, b.def.damageValue ); - int displayDamage = compare( def.displayDamage, b.def.displayDamage ); + int id = this.compare( this.def.item.hashCode(), b.def.item.hashCode() ); + int damageValue = this.compare( this.def.damageValue, b.def.damageValue ); + int displayDamage = this.compare( this.def.displayDamage, b.def.displayDamage ); // AELog.info( "NBT: " + nbt ); - return id == 0 ? (damageValue == 0 ? (displayDamage == 0 ? compareNBT( b.def ) : displayDamage) : damageValue) : id; + return id == 0 ? (damageValue == 0 ? (displayDamage == 0 ? this.compareNBT( b.def ) : displayDamage) : damageValue) : id; } private int compareNBT(AEItemDef b) { - int nbt = compare( (def.tagCompound == null ? 0 : def.tagCompound.getHash()), (b.tagCompound == null ? 0 : b.tagCompound.getHash()) ); + int nbt = this.compare( (this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash()), (b.tagCompound == null ? 0 : b.tagCompound.getHash()) ); if ( nbt == 0 ) - return compare( System.identityHashCode( def.tagCompound ), System.identityHashCode( b.tagCompound ) ); + return this.compare( System.identityHashCode( this.def.tagCompound ), System.identityHashCode( b.tagCompound ) ); return nbt; } @@ -282,28 +282,28 @@ public final class AEItemStack extends AEStack implements IAEItemS @SideOnly(Side.CLIENT) public List getToolTip() { - if ( def.tooltip != null ) - return def.tooltip; + if ( this.def.tooltip != null ) + return this.def.tooltip; - return def.tooltip = Platform.getTooltip( getItemStack() ); + return this.def.tooltip = Platform.getTooltip( this.getItemStack() ); } @SideOnly(Side.CLIENT) public String getDisplayName() { - if ( def.displayName != null ) - return def.displayName; + if ( this.def.displayName != null ) + return this.def.displayName; - return def.displayName = Platform.getItemDisplayName( getItemStack() ); + return this.def.displayName = Platform.getItemDisplayName( this.getItemStack() ); } @SideOnly(Side.CLIENT) public String getModID() { - if ( def.uniqueID != null ) - return getModName( def.uniqueID ); + if ( this.def.uniqueID != null ) + return this.getModName( this.def.uniqueID ); - return getModName( def.uniqueID = GameRegistry.findUniqueIdentifierFor( def.item ) ); + return this.getModName( this.def.uniqueID = GameRegistry.findUniqueIdentifierFor( this.def.item ) ); } private String getModName(UniqueIdentifier uniqueIdentifier) @@ -317,7 +317,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public IAEItemStack empty() { - IAEItemStack dup = copy(); + IAEItemStack dup = this.copy(); dup.reset(); return dup; } @@ -325,25 +325,25 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public int getItemDamage() { - return def.damageValue; + return this.def.damageValue; } @Override void writeIdentity(ByteBuf i) throws IOException { - i.writeShort( Item.itemRegistry.getIDForObject( def.item ) ); - i.writeShort( getItemDamage() ); + i.writeShort( Item.itemRegistry.getIDForObject( this.def.item ) ); + i.writeShort( this.getItemDamage() ); } @Override void readNBT(ByteBuf i) throws IOException { - if ( hasTagCompound() ) + if ( this.hasTagCompound() ) { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DataOutputStream data = new DataOutputStream( bytes ); - CompressedStreamTools.write( (NBTTagCompound) getTagCompound(), data ); + CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data ); byte[] tagBytes = bytes.toByteArray(); int size = tagBytes.length; @@ -409,14 +409,14 @@ public final class AEItemStack extends AEStack implements IAEItemS { IAEItemStack o = (IAEItemStack) st; - if ( sameOre( o ) ) + if ( this.sameOre( o ) ) return true; - if ( o.getItem() == getItem() ) + if ( o.getItem() == this.getItem() ) { - if ( def.item.isDamageable() ) + if ( this.def.item.isDamageable() ) { - ItemStack a = getItemStack(); + ItemStack a = this.getItemStack(); ItemStack b = o.getItemStack(); try @@ -467,11 +467,11 @@ public final class AEItemStack extends AEStack implements IAEItemS OreHelper.instance.sameOre( this, o ); - if ( o.getItem() == getItem() ) + if ( o.getItem() == this.getItem() ) { - if ( def.item.isDamageable() ) + if ( this.def.item.isDamageable() ) { - ItemStack a = getItemStack(); + ItemStack a = this.getItemStack(); try { @@ -538,7 +538,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } else if ( fuzzy == FuzzyMode.PERCENT_99 ) { - if ( def.damageValue == 0 ) + if ( this.def.damageValue == 0 ) newDef.displayDamage = 0; else newDef.displayDamage = 1; @@ -546,8 +546,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage ); - newDef.displayDamage = breakpoint <= def.displayDamage ? breakpoint : 0; + int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + newDef.displayDamage = breakpoint <= this.def.displayDamage ? breakpoint : 0; } newDef.damageValue = newDef.displayDamage; @@ -574,19 +574,19 @@ public final class AEItemStack extends AEStack implements IAEItemS { if ( fuzzy == FuzzyMode.IGNORE_ALL ) { - newDef.displayDamage = def.maxDamage + 1; + newDef.displayDamage = this.def.maxDamage + 1; } else if ( fuzzy == FuzzyMode.PERCENT_99 ) { - if ( def.damageValue == 0 ) + if ( this.def.damageValue == 0 ) newDef.displayDamage = 0; else - newDef.displayDamage = def.maxDamage + 1; + newDef.displayDamage = this.def.maxDamage + 1; } else { - int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage ); - newDef.displayDamage = def.displayDamage < breakpoint ? breakpoint - 1 : def.maxDamage + 1; + int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + newDef.displayDamage = this.def.displayDamage < breakpoint ? breakpoint - 1 : this.def.maxDamage + 1; } newDef.damageValue = newDef.displayDamage; @@ -600,7 +600,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public IAETagCompound getTagCompound() { - return def.tagCompound; + return this.def.tagCompound; } @Override @@ -609,7 +609,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( otherStack == null ) return false; - return def.equals( ((AEItemStack) otherStack).def ); + return this.def.equals( ((AEItemStack) otherStack).def ); } @Override @@ -618,7 +618,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( otherStack == null ) return false; - return def.isItem( otherStack ); + return this.def.isItem( otherStack ); } @Override @@ -641,7 +641,7 @@ public final class AEItemStack extends AEStack implements IAEItemS public boolean isOre() { - return def.isOre != null; + return this.def.isOre != null; } } diff --git a/src/main/java/appeng/util/item/AESharedNBT.java b/src/main/java/appeng/util/item/AESharedNBT.java index cff281ef8..56198e00f 100644 --- a/src/main/java/appeng/util/item/AESharedNBT.java +++ b/src/main/java/appeng/util/item/AESharedNBT.java @@ -43,32 +43,32 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound public int getHash() { - return hash; + return this.hash; } @Override public IItemComparison getSpecialComparison() { - return comp; + return this.comp; } private AESharedNBT(Item itemID, int damageValue) { super(); - item = itemID; - meta = damageValue; + this.item = itemID; + this.meta = damageValue; } public AESharedNBT(int fakeValue) { super(); - item = null; - meta = 0; - hash = fakeValue; + this.item = null; + this.meta = 0; + this.hash = fakeValue; } @Override public NBTTagCompound getNBTTagCompoundCopy() { - return (NBTTagCompound) copy(); + return (NBTTagCompound) this.copy(); } public static AESharedNBT createFromCompound(Item itemID, int damageValue, NBTTagCompound c) @@ -101,7 +101,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound public boolean matches(Item item, int meta, int orderlessHash) { - return item == this.item && this.meta == meta && hash == orderlessHash; + return item == this.item && this.meta == meta && this.hash == orderlessHash; } public boolean comparePreciseWithRegistry(AESharedNBT tagCompound) @@ -109,9 +109,9 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound if ( this == tagCompound ) return true; - if ( comp != null && tagCompound.comp != null ) + if ( this.comp != null && tagCompound.comp != null ) { - return comp.sameAsPrecise( tagCompound.comp ); + return this.comp.sameAsPrecise( tagCompound.comp ); } return false; @@ -124,12 +124,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound if ( tagCompound == null ) return false; - if ( comp == tagCompound.comp ) + if ( this.comp == tagCompound.comp ) return true; - if ( comp != null ) + if ( this.comp != null ) { - return comp.sameAsFuzzy( tagCompound.comp ); + return this.comp.sameAsFuzzy( tagCompound.comp ); } return false; diff --git a/src/main/java/appeng/util/item/AEStack.java b/src/main/java/appeng/util/item/AEStack.java index 9b065ca4c..4e5974038 100644 --- a/src/main/java/appeng/util/item/AEStack.java +++ b/src/main/java/appeng/util/item/AEStack.java @@ -34,36 +34,36 @@ public abstract class AEStack implements IAEStack 0 || isCraftable(); + return this.stackSize != 0 || this.getCountRequestable() > 0 || this.isCraftable(); } @Override public StackType reset() { - stackSize = 0; + this.stackSize = 0; // priority = Integer.MIN_VALUE; - setCountRequestable( 0 ); - setCraftable( false ); + this.setCountRequestable( 0 ); + this.setCraftable( false ); return (StackType) this; } @Override public long getStackSize() { - return stackSize; + return this.stackSize; } @Override public StackType setStackSize(long ss) { - stackSize = ss; + this.stackSize = ss; return (StackType) this; } @Override public long getCountRequestable() { - return countRequestable; + return this.countRequestable; } @Override @@ -76,7 +76,7 @@ public abstract class AEStack implements IAEStack implements IAEStack implements IAEStack implements IItemList cla ) { - clz = cla; + this.clz = cla; } private boolean checkStackType( StackType st ) @@ -60,8 +60,8 @@ public final class ItemList implements IItemList implements IItemList implements IItemList implements IItemList implements IItemList implements IItemList implements IItemList implements IItemList iterator() { - return new MeaningfulIterator( records.values().iterator() ); + return new MeaningfulIterator( this.records.values().iterator() ); } @Override synchronized public StackType findPrecise( StackType i ) { - if ( checkStackType( i ) ) + if ( this.checkStackType( i ) ) return null; - StackType is = records.get( i ); + StackType is = this.records.get( i ); if ( is != null ) { return is; @@ -203,26 +203,26 @@ public final class ItemList implements IItemList findFuzzyDamage( AEItemStack filter, FuzzyMode fuzzy, boolean ignoreMeta ) { StackType low = ( StackType ) filter.getLow( fuzzy, ignoreMeta ); StackType high = ( StackType ) filter.getHigh( fuzzy, ignoreMeta ); - return records.subMap( low, true, high, true ).descendingMap().values(); + return this.records.subMap( low, true, high, true ).descendingMap().values(); } @Override public Collection findFuzzy( StackType filter, FuzzyMode fuzzy ) { - if ( checkStackType( filter ) ) + if ( this.checkStackType( filter ) ) return new ArrayList(); if ( filter instanceof IAEFluidStack ) @@ -244,19 +244,19 @@ public final class ItemList implements IItemList output = new LinkedList(); for ( IAEItemStack is : or.getAEEquivalents() ) - output.addAll( findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) ); + output.addAll( this.findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) ); return output; } } - return findFuzzyDamage( ais, fuzzy, false ); + return this.findFuzzyDamage( ais, fuzzy, false ); } } diff --git a/src/main/java/appeng/util/item/ItemModList.java b/src/main/java/appeng/util/item/ItemModList.java index abcf292f3..b316f8060 100644 --- a/src/main/java/appeng/util/item/ItemModList.java +++ b/src/main/java/appeng/util/item/ItemModList.java @@ -32,47 +32,47 @@ public class ItemModList implements IItemContainer final IItemContainer overrides = AEApi.instance().storage().createItemList(); public ItemModList(IItemContainer backend) { - backingStore = backend; + this.backingStore = backend; } @Override public void add(IAEItemStack option) { - IAEItemStack over = overrides.findPrecise( option ); + IAEItemStack over = this.overrides.findPrecise( option ); if ( over == null ) { - over = backingStore.findPrecise( option ); + over = this.backingStore.findPrecise( option ); if ( over == null ) - overrides.add( option ); + this.overrides.add( option ); else { option.add( over ); - overrides.add( option ); + this.overrides.add( option ); } } else - overrides.add( option ); + this.overrides.add( option ); } @Override public IAEItemStack findPrecise(IAEItemStack i) { - IAEItemStack over = overrides.findPrecise( i ); + IAEItemStack over = this.overrides.findPrecise( i ); if ( over == null ) - return backingStore.findPrecise( i ); + return this.backingStore.findPrecise( i ); return over; } @Override public Collection findFuzzy(IAEItemStack input, FuzzyMode fuzzy) { - return overrides.findFuzzy( input, fuzzy ); + return this.overrides.findFuzzy( input, fuzzy ); } @Override public boolean isEmpty() { - return overrides.isEmpty() && backingStore.isEmpty(); + return this.overrides.isEmpty() && this.backingStore.isEmpty(); } } diff --git a/src/main/java/appeng/util/item/MeaningfulIterator.java b/src/main/java/appeng/util/item/MeaningfulIterator.java index 57115e2cd..18941f670 100644 --- a/src/main/java/appeng/util/item/MeaningfulIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulIterator.java @@ -61,7 +61,7 @@ public class MeaningfulIterator implements Iterator< @Override public void remove() { - parent.remove(); + this.parent.remove(); } } diff --git a/src/main/java/appeng/util/item/OreHelper.java b/src/main/java/appeng/util/item/OreHelper.java index 51004175c..321bc7800 100644 --- a/src/main/java/appeng/util/item/OreHelper.java +++ b/src/main/java/appeng/util/item/OreHelper.java @@ -36,14 +36,14 @@ public class OreHelper ItemRef(ItemStack stack) { - ref = stack.getItem(); + this.ref = stack.getItem(); if ( stack.getItem().isDamageable() ) - damage = 0; // IGNORED + this.damage = 0; // IGNORED else - damage = stack.getItemDamage(); // might be important... + this.damage = stack.getItemDamage(); // might be important... - hash = ref.hashCode() ^ damage; + this.hash = this.ref.hashCode() ^ this.damage; } final Item ref; @@ -55,16 +55,16 @@ public class OreHelper { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; ItemRef other = (ItemRef) obj; - return damage == other.damage && ref == other.ref; + return this.damage == other.damage && this.ref == other.ref; } @Override public int hashCode() { - return hash; + return this.hash; } } @@ -81,12 +81,12 @@ public class OreHelper public OreReference isOre(ItemStack ItemStack) { ItemRef ir = new ItemRef( ItemStack ); - OreResult or = references.get( ir ); + OreResult or = this.references.get( ir ); if ( or == null ) { or = new OreResult(); - references.put( ir, or ); + this.references.put( ir, or ); OreReference ref = new OreReference(); Collection ores = ref.getOres(); diff --git a/src/main/java/appeng/util/item/OreReference.java b/src/main/java/appeng/util/item/OreReference.java index 9406ac291..cbe086298 100644 --- a/src/main/java/appeng/util/item/OreReference.java +++ b/src/main/java/appeng/util/item/OreReference.java @@ -36,27 +36,27 @@ public class OreReference public Collection getEquivalents() { - return otherOptions; + return this.otherOptions; } public List getAEEquivalents() { - if ( aeOtherOptions == null ) + if ( this.aeOtherOptions == null ) { - aeOtherOptions = new ArrayList( otherOptions.size() ); + this.aeOtherOptions = new ArrayList( this.otherOptions.size() ); // SUMMON AE STACKS! - for (ItemStack is : otherOptions) + for (ItemStack is : this.otherOptions) if ( is.getItem() != null ) - aeOtherOptions.add( AEItemStack.create( is ) ); + this.aeOtherOptions.add( AEItemStack.create( is ) ); } - return aeOtherOptions; + return this.aeOtherOptions; } public Collection getOres() { - return ores; + return this.ores; } } diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index 323373429..aa64ca037 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -31,9 +31,9 @@ public class SharedSearchObject public AESharedNBT shared; public SharedSearchObject(Item itemID, int damageValue, NBTTagCompound tagCompound) { - def = (damageValue << Platform.DEF_OFFSET) | Item.itemRegistry.getIDForObject( itemID ); - hash = Platform.NBTOrderlessHash( tagCompound ); - compound = tagCompound; + this.def = (damageValue << Platform.DEF_OFFSET) | Item.itemRegistry.getIDForObject( itemID ); + this.hash = Platform.NBTOrderlessHash( tagCompound ); + this.compound = tagCompound; } @Override @@ -41,12 +41,12 @@ public class SharedSearchObject { if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) + if ( this.getClass() != obj.getClass() ) return false; SharedSearchObject other = (SharedSearchObject) obj; - if ( def == other.def && hash == other.hash ) + if ( this.def == other.def && this.hash == other.hash ) { - return Platform.NBTEqualityTest( compound, other.compound ); + return Platform.NBTEqualityTest( this.compound, other.compound ); } return false; } @@ -54,7 +54,7 @@ public class SharedSearchObject @Override public int hashCode() { - return def ^ hash; + return this.def ^ this.hash; } } diff --git a/src/main/java/appeng/util/iterators/AEInvIterator.java b/src/main/java/appeng/util/iterators/AEInvIterator.java index 64728824f..ceac8c6a6 100644 --- a/src/main/java/appeng/util/iterators/AEInvIterator.java +++ b/src/main/java/appeng/util/iterators/AEInvIterator.java @@ -32,20 +32,20 @@ public class AEInvIterator implements Iterator int x = 0; public AEInvIterator(AppEngInternalAEInventory i) { - inv = i; - size = inv.getSizeInventory(); + this.inv = i; + this.size = this.inv.getSizeInventory(); } @Override public boolean hasNext() { - return x < size; + return this.x < this.size; } @Override public IAEItemStack next() { - return inv.getAEStackInSlot( x++ ); + return this.inv.getAEStackInSlot( this.x++ ); } @Override diff --git a/src/main/java/appeng/util/iterators/ChainedIterator.java b/src/main/java/appeng/util/iterators/ChainedIterator.java index 726107234..b0eb4d960 100644 --- a/src/main/java/appeng/util/iterators/ChainedIterator.java +++ b/src/main/java/appeng/util/iterators/ChainedIterator.java @@ -33,13 +33,13 @@ public class ChainedIterator implements Iterator @Override public boolean hasNext() { - return offset < list.length; + return this.offset < this.list.length; } @Override public T next() { - return list[offset++]; + return this.list[this.offset++]; } @Override diff --git a/src/main/java/appeng/util/iterators/InvIterator.java b/src/main/java/appeng/util/iterators/InvIterator.java index df15ed3d5..3f4dd94c1 100644 --- a/src/main/java/appeng/util/iterators/InvIterator.java +++ b/src/main/java/appeng/util/iterators/InvIterator.java @@ -32,20 +32,20 @@ public class InvIterator implements Iterator int x = 0; public InvIterator(IInventory i) { - inv = i; - size = inv.getSizeInventory(); + this.inv = i; + this.size = this.inv.getSizeInventory(); } @Override public boolean hasNext() { - return x < size; + return this.x < this.size; } @Override public ItemStack next() { - return inv.getStackInSlot( x++ ); + return this.inv.getStackInSlot( this.x++ ); } @Override diff --git a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java index db57ca61a..9bb9231c5 100644 --- a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java +++ b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java @@ -36,13 +36,13 @@ public class ProxyNodeIterator implements Iterator @Override public boolean hasNext() { - return hosts.hasNext(); + return this.hosts.hasNext(); } @Override public IGridNode next() { - IGridHost host = hosts.next(); + IGridHost host = this.hosts.next(); return host.getGridNode( ForgeDirection.UNKNOWN ); } diff --git a/src/main/java/appeng/util/iterators/StackToSlotIterator.java b/src/main/java/appeng/util/iterators/StackToSlotIterator.java index 00e1d8c6e..9d183eafe 100644 --- a/src/main/java/appeng/util/iterators/StackToSlotIterator.java +++ b/src/main/java/appeng/util/iterators/StackToSlotIterator.java @@ -37,15 +37,15 @@ public class StackToSlotIterator implements Iterator @Override public boolean hasNext() { - return is.hasNext(); + return this.is.hasNext(); } @Override public ItemSlot next() { - iss.slot = x++; - iss.setItemStack( is.next() ); - return iss; + this.iss.slot = this.x++; + this.iss.setItemStack( this.is.next() ); + return this.iss; } @Override diff --git a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java index e0d949820..76df7ac76 100644 --- a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java @@ -31,27 +31,27 @@ public class FuzzyPriorityList> implements IPartitionList< final FuzzyMode mode; public FuzzyPriorityList(IItemList in, FuzzyMode mode) { - list = in; + this.list = in; this.mode = mode; } @Override public boolean isListed(T input) { - Collection out = list.findFuzzy( input, mode ); + Collection out = this.list.findFuzzy( input, this.mode ); return out != null && !out.isEmpty(); } @Override public boolean isEmpty() { - return list.isEmpty(); + return this.list.isEmpty(); } @Override public Iterable getItems() { - return list; + return this.list; } } diff --git a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java index dc19aa454..96dfc38cf 100644 --- a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java @@ -32,21 +32,21 @@ public class MergedPriorityList> implements IPartitionList public void addNewList(IPartitionList list, boolean isWhitelist) { if ( isWhitelist ) - positive.add( list ); + this.positive.add( list ); else - negative.add( list ); + this.negative.add( list ); } @Override public boolean isListed(T input) { - for (IPartitionList l : negative) + for (IPartitionList l : this.negative) if ( l.isListed( input ) ) return false; - if ( !positive.isEmpty() ) + if ( !this.positive.isEmpty() ) { - for (IPartitionList l : positive) + for (IPartitionList l : this.positive) if ( l.isListed( input ) ) return true; @@ -59,7 +59,7 @@ public class MergedPriorityList> implements IPartitionList @Override public boolean isEmpty() { - return positive.isEmpty() && negative.isEmpty(); + return this.positive.isEmpty() && this.negative.isEmpty(); } @Override diff --git a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java index 4c37faec7..1a507bbdc 100644 --- a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java +++ b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java @@ -27,25 +27,25 @@ public class PrecisePriorityList> implements IPartitionLis final IItemList list; public PrecisePriorityList(IItemList in) { - list = in; + this.list = in; } @Override public boolean isListed(T input) { - return list.findPrecise( input ) != null; + return this.list.findPrecise( input ) != null; } @Override public boolean isEmpty() { - return list.isEmpty(); + return this.list.isEmpty(); } @Override public Iterable getItems() { - return list; + return this.list; } }