Compare commits

...

13 Commits

Author SHA1 Message Date
thatsIch 02e59faa59 Remove comment 2014-12-29 23:02:48 +01:00
thatsIch a23a8ed165 Merge pull request #657 from yueh/organize-imports
Organize imports
2014-12-29 22:16:24 +01:00
yueh 9b7b0fc0fb Organize imports 2014-12-29 21:59:05 +01:00
thatsIch ddf71c5072 Merge pull request #611 from TheJulianJES/Log-Fix
Better log output at AE2 starting
2014-12-29 21:54:34 +01:00
thatsIch 2b34ba5840 Merge pull request #652 from thatsIch/b-644-NPE-on-disabled-features
Fixes #644 Several missing null checks when disabling huge chunks of the mod via config
2014-12-29 20:20:38 +01:00
thatsIch 3554b5f48d Fixes #644 Several missing null checks when disabling huge chunks of the mod via config 2014-12-29 17:58:19 +01:00
thatsIch eb74fb33b8 Merge pull request #653 from yueh/qualified-this
Changed access to use this qualifier
2014-12-29 15:44:27 +01:00
yueh f471513bd0 Changed access to use this qualifier 2014-12-29 15:13:47 +01:00
thatsIch 2a5e57a59b Merge pull request #642 from Adaptivity/patch-1
Update ru_RU.lang
2014-12-28 23:45:57 +01:00
Anton e37d9099c7 Update ru_RU.lang 2014-12-28 22:24:53 +03:00
thatsIch e712a9d8ce Merge pull request #640 from thatsIch/b-639-crash-on-disabled-channels
Fixes #639 Missing null check for people with disabled channels
2014-12-28 18:38:56 +01:00
thatsIch 0cb58b4d93 Fixes #639 Missing null check for people with disabled channels 2014-12-28 18:00:04 +01:00
TheJulianJES 20ccf65906 Better output log of starting
thatsIch wanted it ;)
2014-12-21 12:18:53 +01:00
681 changed files with 12882 additions and 12243 deletions
+26 -7
View File
@@ -23,27 +23,32 @@
package appeng.api.config; package appeng.api.config;
import java.util.HashMap; import java.util.HashMap;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.util.AEItemDefinition;
public enum Upgrades public enum Upgrades
{ {
/** /**
* Gold Tier Upgrades. * Gold Tier Upgrades.
*/ */
CAPACITY(0), REDSTONE(0), CRAFTING(0), CAPACITY( 0 ), REDSTONE( 0 ), CRAFTING( 0 ),
/** /**
* Diamond Tier Upgrades. * Diamond Tier Upgrades.
*/ */
FUZZY(1), SPEED(1), INVERTER(1); FUZZY( 1 ), SPEED( 1 ), INVERTER( 1 );
public final int myTier; public final int myTier;
public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>(); public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
private Upgrades(int tier) { private Upgrades( int tier )
myTier = tier; {
this.myTier = tier;
} }
/** /**
@@ -51,12 +56,26 @@ public enum Upgrades
*/ */
public HashMap<ItemStack, Integer> getSupported() public HashMap<ItemStack, Integer> getSupported()
{ {
return supportedMax; return this.supportedMax;
} }
public void registerItem(ItemStack myItem, int maxSupported)
public void registerItem( AEItemDefinition myItem, int maxSupported )
{ {
if ( myItem != null ) if ( myItem != null )
supportedMax.put( myItem, maxSupported ); {
final ItemStack stack = myItem.stack( 1 );
this.registerItem( stack, maxSupported );
}
}
public void registerItem( ItemStack stack, int maxSupported )
{
if ( stack != null )
{
this.supportedMax.put( stack, maxSupported );
}
} }
} }
@@ -73,5 +73,4 @@ public class Parts
public AEItemDefinition partTerminal; public AEItemDefinition partTerminal;
public AEItemDefinition partStorageMonitor; public AEItemDefinition partStorageMonitor;
public AEItemDefinition partConversionMonitor; public AEItemDefinition partConversionMonitor;
} }
+72 -72
View File
@@ -102,11 +102,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat ) protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
{ {
this( c, mat, Optional.<String> absent() ); this( c, mat, Optional.<String> absent() );
setLightOpacity( 255 ); this.setLightOpacity( 255 );
setLightLevel( 0 ); this.setLightLevel( 0 );
setHardness( 2.2F ); this.setHardness( 2.2F );
setTileProvider( false ); this.setTileProvider( false );
setHarvestLevel( "pickaxe", 0 ); this.setHarvestLevel( "pickaxe", 0 );
} }
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName ) protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
@@ -114,27 +114,27 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
super( mat ); super( mat );
if ( mat == AEGlassMaterial.instance || mat == Material.glass ) if ( mat == AEGlassMaterial.instance || mat == Material.glass )
setStepSound( Block.soundTypeGlass ); this.setStepSound( Block.soundTypeGlass );
else if ( mat == Material.rock ) else if ( mat == Material.rock )
setStepSound( Block.soundTypeStone ); this.setStepSound( Block.soundTypeStone );
else if ( mat == Material.wood ) else if ( mat == Material.wood )
setStepSound( Block.soundTypeWood ); this.setStepSound( Block.soundTypeWood );
else else
setStepSound( Block.soundTypeMetal ); this.setStepSound( Block.soundTypeMetal );
featureFullName = new FeatureNameExtractor( c, subName ).get(); this.featureFullName = new FeatureNameExtractor( c, subName ).get();
featureSubName = subName; this.featureSubName = subName;
} }
@Override @Override
public String toString() public String toString()
{ {
return featureFullName; return this.featureFullName;
} }
public void registerNoIcons() public void registerNoIcons()
{ {
BlockRenderInfo info = getRendererInstance(); BlockRenderInfo info = this.getRendererInstance();
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) ); FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
info.updateIcons( i, i, i, i, i, i ); info.updateIcons( i, i, i, i, i, i );
} }
@@ -147,9 +147,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
protected void setTileEntity( Class<? extends TileEntity> c ) protected void setTileEntity( Class<? extends TileEntity> c )
{ {
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) ); AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
GameRegistry.registerTileEntity( tileEntityType = c, featureFullName ); GameRegistry.registerTileEntity( this.tileEntityType = c, this.featureFullName );
isInventory = IInventory.class.isAssignableFrom( c ); this.isInventory = IInventory.class.isAssignableFrom( c );
setTileProvider( hasBlockTileEntity() ); this.setTileProvider( this.hasBlockTileEntity() );
} }
// update Block value. // update Block value.
@@ -166,7 +166,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
final public IFeatureHandler handler() final public IFeatureHandler handler()
{ {
return handler; return this.handler;
} }
@Override @Override
@@ -177,13 +177,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public boolean isOpaque() public boolean isOpaque()
{ {
return isOpaque; return this.isOpaque;
} }
@Override @Override
public boolean renderAsNormalBlock() public boolean renderAsNormalBlock()
{ {
return isFullSize && isOpaque; return this.isFullSize && this.isOpaque;
} }
@Override @Override
@@ -196,17 +196,17 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) 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 @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata ) public IIcon getIcon( int direction, int metadata )
{ {
if ( renderIcon != null ) if ( this.renderIcon != null )
return renderIcon; return this.renderIcon;
return getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) ); return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
} }
@Override @Override
@@ -220,7 +220,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
collisionHandler = ( ICustomCollision ) this; collisionHandler = ( ICustomCollision ) this;
else else
{ {
AEBaseTile te = getTileEntity( w, x, y, z ); AEBaseTile te = this.getTileEntity( w, x, y, z );
if ( te instanceof ICustomCollision ) if ( te instanceof ICustomCollision )
collisionHandler = ( ICustomCollision ) te; collisionHandler = ( ICustomCollision ) te;
} }
@@ -256,7 +256,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
collisionHandler = ( ICustomCollision ) this; collisionHandler = ( ICustomCollision ) this;
else else
{ {
AEBaseTile te = getTileEntity( w, x, y, z ); AEBaseTile te = this.getTileEntity( w, x, y, z );
if ( te instanceof ICustomCollision ) if ( te instanceof ICustomCollision )
collisionHandler = ( ICustomCollision ) te; collisionHandler = ( ICustomCollision ) te;
} }
@@ -275,11 +275,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
for ( AxisAlignedBB bb : bbs ) 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 ); 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 ) if ( r != null )
{ {
@@ -330,7 +330,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
final public boolean isOpaqueCube() final public boolean isOpaqueCube()
{ {
return isOpaque; return this.isOpaque;
} }
@Override @Override
@@ -342,7 +342,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
collisionHandler = ( ICustomCollision ) this; collisionHandler = ( ICustomCollision ) this;
else else
{ {
AEBaseTile te = getTileEntity( w, x, y, z ); AEBaseTile te = this.getTileEntity( w, x, y, z );
if ( te instanceof ICustomCollision ) if ( te instanceof ICustomCollision )
collisionHandler = ( ICustomCollision ) te; collisionHandler = ( ICustomCollision ) te;
} }
@@ -356,11 +356,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
for ( AxisAlignedBB bb : bbs ) 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 ); 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 ) if ( r != null )
{ {
@@ -384,7 +384,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return null; 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 ); 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 ); Block id = w.getBlock( x, y, z );
if ( id != null ) 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 ); ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if ( tile == null ) if ( tile == null )
@@ -436,10 +436,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
IMemoryCard memoryCard = ( IMemoryCard ) is.getItem(); IMemoryCard memoryCard = ( IMemoryCard ) is.getItem();
if ( player.isSneaking() ) if ( player.isSneaking() )
{ {
AEBaseTile t = getTileEntity( w, x, y, z ); AEBaseTile t = this.getTileEntity( w, x, y, z );
if ( t != null ) if ( t != null )
{ {
String name = getUnlocalizedName(); String name = this.getUnlocalizedName();
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD ); NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if ( data != null ) if ( data != null )
{ {
@@ -453,9 +453,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{ {
String name = memoryCard.getSettingsName( is ); String name = memoryCard.getSettingsName( is );
NBTTagCompound data = memoryCard.getData( 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 ); t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); 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 ) 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() ) if ( is.hasDisplayName() )
{ {
TileEntity te = getTileEntity( w, x, y, z ); TileEntity te = this.getTileEntity( w, x, y, z );
if ( te instanceof AEBaseTile ) if ( te instanceof AEBaseTile )
( ( AEBaseTile ) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() ); ( ( AEBaseTile ) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
} }
@@ -497,13 +497,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
public boolean hasComparatorInputOverride() public boolean hasComparatorInputOverride()
{ {
return isInventory; return this.isInventory;
} }
@Override @Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s ) 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 ) if ( te instanceof IInventory )
return Container.calcRedstoneFromInventory( ( IInventory ) te ); return Container.calcRedstoneFromInventory( ( IInventory ) te );
return 0; return 0;
@@ -513,7 +513,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister iconRegistry ) public void registerBlockIcons( IIconRegister iconRegistry )
{ {
BlockRenderInfo info = getRendererInstance(); BlockRenderInfo info = this.getRendererInstance();
FlippableIcon topIcon; FlippableIcon topIcon;
FlippableIcon bottomIcon; FlippableIcon bottomIcon;
FlippableIcon sideIcon; FlippableIcon sideIcon;
@@ -522,13 +522,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
FlippableIcon southIcon; FlippableIcon southIcon;
FlippableIcon northIcon; FlippableIcon northIcon;
this.blockIcon = topIcon = optionalIcon( iconRegistry, this.getTextureName(), null ); this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon ); bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
sideIcon = optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon ); sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
eastIcon = optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon ); eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
westIcon = optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon ); westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
southIcon = optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon ); southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
northIcon = optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon ); northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon ); info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
} }
@@ -536,7 +536,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
final public boolean isNormalCube( IBlockAccess world, int x, int y, int z ) final public boolean isNormalCube( IBlockAccess world, int x, int y, int z )
{ {
return isFullSize; return this.isFullSize;
} }
@Override @Override
@@ -544,9 +544,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{ {
IOrientable rotatable = null; 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 ) else if ( this instanceof IOrientableBlock )
{ {
@@ -555,9 +555,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
if ( rotatable != null && rotatable.canBeRotated() ) if ( rotatable != null && rotatable.canBeRotated() )
{ {
if ( hasCustomRotation() ) if ( this.hasCustomRotation() )
{ {
customRotateBlock( rotatable, axis ); this.customRotateBlock( rotatable, axis );
return true; return true;
} }
else else
@@ -600,9 +600,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
final public ForgeDirection[] getValidRotations( World w, int x, int y, int z ) 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() ) if ( obj != null && obj.canBeRotated() )
{ {
return ForgeDirection.VALID_DIRECTIONS; return ForgeDirection.VALID_DIRECTIONS;
@@ -615,7 +615,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour ) 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 ) if ( te instanceof IColorableTile )
{ {
@@ -637,12 +637,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public BlockRenderInfo getRendererInstance() public BlockRenderInfo getRendererInstance()
{ {
if ( renderInfo != null ) if ( this.renderInfo != null )
return renderInfo; return this.renderInfo;
try try
{ {
return renderInfo = new BlockRenderInfo( getRenderer().newInstance() ); return this.renderInfo = new BlockRenderInfo( this.getRenderer().newInstance() );
} }
catch ( Throwable t ) catch ( Throwable t )
{ {
@@ -694,9 +694,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{ {
IOrientable ori = null; 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 ) else if ( this instanceof IOrientableBlock )
{ {
@@ -705,7 +705,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
if ( ori != null && ori.canBeRotated() ) if ( ori != null && ori.canBeRotated() )
{ {
return mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal(); return this.mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal();
} }
return s; return s;
@@ -713,16 +713,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public boolean hasBlockTileEntity() public boolean hasBlockTileEntity()
{ {
return tileEntityType != null; return this.tileEntityType != null;
} }
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z ) public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{ {
if ( !hasBlockTileEntity() ) if ( !this.hasBlockTileEntity() )
return null; return null;
TileEntity te = w.getTileEntity( x, y, z ); TileEntity te = w.getTileEntity( x, y, z );
if ( tileEntityType.isInstance( te ) ) if ( this.tileEntityType.isInstance( te ) )
return ( T ) te; return ( T ) te;
return null; return null;
@@ -772,7 +772,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public Class<? extends TileEntity> getTileEntityClass() public Class<? extends TileEntity> getTileEntityClass()
{ {
return tileEntityType; return this.tileEntityType;
} }
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
@@ -784,11 +784,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
final public TileEntity createNewTileEntity( World var1, int var2 ) final public TileEntity createNewTileEntity( World var1, int var2 )
{ {
if ( hasBlockTileEntity() ) if ( this.hasBlockTileEntity() )
{ {
try try
{ {
return tileEntityType.newInstance(); return this.tileEntityType.newInstance();
} }
catch ( Throwable e ) catch ( Throwable e )
{ {
@@ -801,7 +801,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override @Override
public void breakBlock( World w, int x, int y, int z, Block a, int b ) 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 ) if ( te != null )
{ {
ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
@@ -821,7 +821,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public String getUnlocalizedName( ItemStack is ) public String getUnlocalizedName( ItemStack is )
{ {
return getUnlocalizedName(); return this.getUnlocalizedName();
} }
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips ) public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
@@ -836,6 +836,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public boolean hasSubtypes() public boolean hasSubtypes()
{ {
return hasSubtypes; return this.hasSubtypes;
} }
} }
+18 -16
View File
@@ -28,6 +28,10 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.misc.BlockLightDetector; import appeng.block.misc.BlockLightDetector;
@@ -37,8 +41,6 @@ import appeng.client.render.ItemRenderer;
import appeng.me.helpers.IGridProxyable; import appeng.me.helpers.IGridProxyable;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class AEBaseItemBlock extends ItemBlock public class AEBaseItemBlock extends ItemBlock
{ {
@@ -48,8 +50,8 @@ public class AEBaseItemBlock extends ItemBlock
public AEBaseItemBlock(Block id) public AEBaseItemBlock(Block id)
{ {
super( id ); super( id );
blockType = (AEBaseBlock) id; this.blockType = (AEBaseBlock) id;
hasSubtypes = blockType.hasSubtypes; this.hasSubtypes = this.blockType.hasSubtypes;
if ( Platform.isClient() ) if ( Platform.isClient() )
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance ); MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance );
@@ -58,7 +60,7 @@ public class AEBaseItemBlock extends ItemBlock
@Override @Override
public int getMetadata(int dmg) public int getMetadata(int dmg)
{ {
if ( hasSubtypes ) if ( this.hasSubtypes )
return dmg; return dmg;
return 0; return 0;
} }
@@ -66,7 +68,7 @@ public class AEBaseItemBlock extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack is) public String getUnlocalizedName(ItemStack is)
{ {
return blockType.getUnlocalizedName( is ); return this.blockType.getUnlocalizedName( is );
} }
@Override @Override
@@ -91,9 +93,9 @@ public class AEBaseItemBlock extends ItemBlock
IOrientable ori = null; IOrientable ori = null;
if ( blockType.hasBlockTileEntity() ) if ( this.blockType.hasBlockTileEntity() )
{ {
if ( blockType instanceof BlockLightDetector ) if ( this.blockType instanceof BlockLightDetector )
{ {
up = ForgeDirection.getOrientation( side ); up = ForgeDirection.getOrientation( side );
if ( up == ForgeDirection.UP || up == ForgeDirection.DOWN ) if ( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
@@ -101,7 +103,7 @@ public class AEBaseItemBlock extends ItemBlock
else else
forward = ForgeDirection.UP; 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 ); forward = ForgeDirection.getOrientation( side );
if ( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN ) if ( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
@@ -145,9 +147,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 ); up = ForgeDirection.getOrientation( side );
forward = ForgeDirection.SOUTH; forward = ForgeDirection.SOUTH;
if ( up.offsetY == 0 ) if ( up.offsetY == 0 )
@@ -156,20 +158,20 @@ public class AEBaseItemBlock extends ItemBlock
ori.setOrientation( forward, up ); 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; return false;
if ( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) ) 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; ori = tile;
if ( tile == null ) if ( tile == null )
return true; return true;
if ( ori.canBeRotated() && !blockType.hasCustomRotation() ) if ( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
{ {
if ( ori.getForward() == null || ori.getUp() == null || // null if ( ori.getForward() == null || ori.getUp() == null || // null
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN ) tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
@@ -183,7 +185,7 @@ public class AEBaseItemBlock extends ItemBlock
tile.onPlacement( stack, player, side ); tile.onPlacement( stack, player, side );
} }
else if ( blockType instanceof IOrientableBlock ) else if ( this.blockType instanceof IOrientableBlock )
{ {
ori.setOrientation( forward, up ); ori.setOrientation( forward, up );
} }
@@ -88,47 +88,47 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
@Override @Override
public double injectAEPower(ItemStack is, double amt) public double injectAEPower(ItemStack is, double amt)
{ {
double internalCurrentPower = getInternal( is ); double internalCurrentPower = this.getInternal( is );
double internalMaxPower = getMaxEnergyCapacity(); double internalMaxPower = this.getMaxEnergyCapacity();
internalCurrentPower += amt; internalCurrentPower += amt;
if ( internalCurrentPower > internalMaxPower ) if ( internalCurrentPower > internalMaxPower )
{ {
amt = internalCurrentPower - internalMaxPower; amt = internalCurrentPower - internalMaxPower;
internalCurrentPower = internalMaxPower; internalCurrentPower = internalMaxPower;
setInternal( is, internalCurrentPower ); this.setInternal( is, internalCurrentPower );
return amt; return amt;
} }
setInternal( is, internalCurrentPower ); this.setInternal( is, internalCurrentPower );
return 0; return 0;
} }
@Override @Override
public double extractAEPower(ItemStack is, double amt) public double extractAEPower(ItemStack is, double amt)
{ {
double internalCurrentPower = getInternal( is ); double internalCurrentPower = this.getInternal( is );
if ( internalCurrentPower > amt ) if ( internalCurrentPower > amt )
{ {
internalCurrentPower -= amt; internalCurrentPower -= amt;
setInternal( is, internalCurrentPower ); this.setInternal( is, internalCurrentPower );
return amt; return amt;
} }
amt = internalCurrentPower; amt = internalCurrentPower;
setInternal( is, 0 ); this.setInternal( is, 0 );
return amt; return amt;
} }
@Override @Override
public double getAEMaxPower(ItemStack is) public double getAEMaxPower(ItemStack is)
{ {
return getMaxEnergyCapacity(); return this.getMaxEnergyCapacity();
} }
@Override @Override
public double getAECurrentPower(ItemStack is) public double getAECurrentPower(ItemStack is)
{ {
return getInternal( is ); return this.getInternal( is );
} }
@Override @Override
@@ -20,13 +20,15 @@ package appeng.block.crafting;
import java.util.List; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor; import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
@@ -20,12 +20,14 @@ package appeng.block.crafting;
import java.util.List; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.tile.crafting.TileCraftingStorageTile; import appeng.tile.crafting.TileCraftingStorageTile;
@@ -35,7 +37,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
{ {
super( BlockCraftingStorage.class ); super( BlockCraftingStorage.class );
setTileEntity( TileCraftingStorageTile.class ); this.setTileEntity( TileCraftingStorageTile.class );
} }
@Override @Override
@@ -56,7 +58,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
if ( is.getItemDamage() == 3 ) if ( is.getItemDamage() == 3 )
return "tile.appliedenergistics2.BlockCraftingStorage64k"; return "tile.appliedenergistics2.BlockCraftingStorage64k";
return getItemUnlocalizedName( is ); return this.getItemUnlocalizedName( is );
} }
@Override @Override
@@ -21,8 +21,6 @@ package appeng.block.crafting;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -32,6 +30,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPU; import appeng.client.render.blocks.RenderBlockCraftingCPU;
@@ -49,21 +51,21 @@ public class BlockCraftingUnit extends AEBaseBlock
{ {
super( childClass, Material.iron ); super( childClass, Material.iron );
hasSubtypes = true; this.hasSubtypes = true;
setFeature( EnumSet.of( AEFeature.CraftingCPU ) ); this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
} }
public BlockCraftingUnit() public BlockCraftingUnit()
{ {
this( BlockCraftingUnit.class ); this( BlockCraftingUnit.class );
setTileEntity( TileCraftingTile.class ); this.setTileEntity( TileCraftingTile.class );
} }
@Override @Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) public boolean onActivated(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 ( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{ {
if ( Platform.isClient() ) if ( Platform.isClient() )
@@ -80,7 +82,7 @@ public class BlockCraftingUnit extends AEBaseBlock
public int getDamageValue(World w, int x, int y, int z) public int getDamageValue(World w, int x, int y, int z)
{ {
int meta = w.getBlockMetadata( x, y, z ); int meta = w.getBlockMetadata( x, y, z );
return damageDropped( meta ); return this.damageDropped( meta );
} }
@Override @Override
@@ -95,7 +97,7 @@ public class BlockCraftingUnit extends AEBaseBlock
if ( is.getItemDamage() == 1 ) if ( is.getItemDamage() == 1 )
return "tile.appliedenergistics2.BlockCraftingAccelerator"; return "tile.appliedenergistics2.BlockCraftingAccelerator";
return getItemUnlocalizedName( is ); return this.getItemUnlocalizedName( is );
} }
protected String getItemUnlocalizedName(ItemStack is) protected String getItemUnlocalizedName(ItemStack is)
@@ -106,9 +108,9 @@ public class BlockCraftingUnit extends AEBaseBlock
@Override @Override
public void setRenderStateByMeta(int itemDamage) public void setRenderStateByMeta(int itemDamage)
{ {
IIcon front = getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage ); IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
IIcon other = getIcon( ForgeDirection.NORTH.ordinal(), itemDamage ); IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other ); this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
} }
@Override @Override
@@ -137,7 +139,7 @@ public class BlockCraftingUnit extends AEBaseBlock
@Override @Override
public void breakBlock(World w, int x, int y, int z, Block a, int b) 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 ) if ( cp != null )
cp.breakCluster(); cp.breakCluster();
@@ -147,7 +149,7 @@ public class BlockCraftingUnit extends AEBaseBlock
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) 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 ) if ( cp != null )
cp.updateMultiBlock(); cp.updateMultiBlock();
} }
@@ -24,6 +24,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockAssembler; import appeng.client.render.blocks.RenderBlockAssembler;
@@ -31,18 +35,16 @@ import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.crafting.TileMolecularAssembler; import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMolecularAssembler extends AEBaseBlock public class BlockMolecularAssembler extends AEBaseBlock
{ {
public BlockMolecularAssembler() { public BlockMolecularAssembler() {
super( BlockMolecularAssembler.class, Material.iron ); super( BlockMolecularAssembler.class, Material.iron );
setFeature( EnumSet.of( AEFeature.MolecularAssembler ) ); this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
setTileEntity( TileMolecularAssembler.class ); this.setTileEntity( TileMolecularAssembler.class );
isOpaque = false; this.isOpaque = false;
lightOpacity = 1; this.lightOpacity = 1;
} }
public static boolean booleanAlphaPass = false; public static boolean booleanAlphaPass = false;
@@ -70,7 +72,7 @@ public class BlockMolecularAssembler extends AEBaseBlock
@Override @Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) public boolean onActivated(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() ) if ( tg != null && !p.isSneaking() )
{ {
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC ); Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
@@ -20,6 +20,7 @@ package appeng.block.crafting;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.block.AEBaseItemBlock; import appeng.block.AEBaseItemBlock;
import appeng.core.AEConfig; import appeng.core.AEConfig;
@@ -29,6 +29,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.tiles.ICrankable; import appeng.api.implementations.tiles.ICrankable;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
@@ -43,10 +44,10 @@ public class BlockCrank extends AEBaseBlock
public BlockCrank() { public BlockCrank() {
super( BlockCrank.class, Material.wood ); super( BlockCrank.class, Material.wood );
setFeature( EnumSet.of( AEFeature.GrindStone ) ); this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
setTileEntity( TileCrank.class ); this.setTileEntity( TileCrank.class );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
@@ -54,11 +55,11 @@ public class BlockCrank extends AEBaseBlock
{ {
if ( player instanceof FakePlayer || player == null ) if ( player instanceof FakePlayer || player == null )
{ {
dropCrank(w, x, y, z); this.dropCrank(w, x, y, z);
return true; return true;
} }
AEBaseTile tile = getTileEntity( w, x, y, z ); AEBaseTile tile = this.getTileEntity( w, x, y, z );
if ( tile instanceof TileCrank ) if ( tile instanceof TileCrank )
{ {
if ( ((TileCrank) tile).power() ) if ( ((TileCrank) tile).power() )
@@ -86,7 +87,7 @@ public class BlockCrank extends AEBaseBlock
private ForgeDirection findCrankable( World world, int x, int y, int z ) private ForgeDirection findCrankable( World world, int x, int y, int z )
{ {
for ( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) for ( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
if ( isCrankable( world, x, y, z, dir ) ) if ( this.isCrankable( world, x, y, z, dir ) )
{ {
return dir; return dir;
} }
@@ -96,14 +97,14 @@ public class BlockCrank extends AEBaseBlock
@Override @Override
public boolean canPlaceBlockAt( World world, int x, int y, int z ) 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 @Override
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{ {
TileEntity te = world.getTileEntity( x, y, z ); 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 ) private void dropCrank( World world, int x, int y, int z )
@@ -115,10 +116,10 @@ public class BlockCrank extends AEBaseBlock
@Override @Override
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack ) 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 ) if ( tile != null )
{ {
ForgeDirection mnt = findCrankable( world, x, y, z ); ForgeDirection mnt = this.findCrankable( world, x, y, z );
ForgeDirection forward = ForgeDirection.UP; ForgeDirection forward = ForgeDirection.UP;
if ( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN ) if ( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
{ {
@@ -128,24 +129,24 @@ public class BlockCrank extends AEBaseBlock
} }
else else
{ {
dropCrank( world, x, y, z ); this.dropCrank( world, x, y, z );
} }
} }
@Override @Override
public void onNeighborBlockChange (World world, int x, int y, int z, Block block ) 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 ( 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 else
{ {
dropCrank( world, x, y, z ); this.dropCrank( world, x, y, z );
} }
} }
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
@@ -35,15 +36,15 @@ public class BlockGrinder extends AEBaseBlock
public BlockGrinder() { public BlockGrinder() {
super( BlockGrinder.class, Material.rock ); super( BlockGrinder.class, Material.rock );
setFeature( EnumSet.of( AEFeature.GrindStone ) ); this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
setTileEntity( TileGrinder.class ); this.setTileEntity( TileGrinder.class );
setHardness( 3.2F ); this.setHardness( 3.2F );
} }
@Override @Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) public boolean onActivated(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() ) if ( tg != null && !p.isSneaking() )
{ {
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER ); Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
@@ -35,8 +36,8 @@ public class BlockCellWorkbench extends AEBaseBlock
public BlockCellWorkbench() { public BlockCellWorkbench() {
super( BlockCellWorkbench.class, Material.iron ); super( BlockCellWorkbench.class, Material.iron );
setFeature( EnumSet.of( AEFeature.StorageCells ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
setTileEntity( TileCellWorkbench.class ); this.setTileEntity( TileCellWorkbench.class );
} }
@Override @Override
@@ -45,7 +46,7 @@ public class BlockCellWorkbench extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileCellWorkbench tg = getTileEntity( w, x, y, z ); TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -53,10 +53,10 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public BlockCharger() { public BlockCharger() {
super( BlockCharger.class, Material.iron ); super( BlockCharger.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileCharger.class ); this.setTileEntity( TileCharger.class );
setLightOpacity( 2 ); this.setLightOpacity( 2 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
@@ -67,7 +67,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
if ( Platform.isServer() ) if ( Platform.isServer() )
{ {
TileCharger tc = getTileEntity( w, x, y, z ); TileCharger tc = this.getTileEntity( w, x, y, z );
if ( tc != null ) if ( tc != null )
{ {
tc.activate( player ); tc.activate( player );
@@ -93,7 +93,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
if ( r.nextFloat() < 0.98 ) if ( r.nextFloat() < 0.98 )
return; return;
AEBaseTile tile = getTileEntity( w, x, y, z ); AEBaseTile tile = this.getTileEntity( w, x, y, z );
if ( tile instanceof TileCharger ) if ( tile instanceof TileCharger )
{ {
TileCharger tc = (TileCharger) tile; TileCharger tc = (TileCharger) tile;
@@ -120,7 +120,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> 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 ) if ( tile != null )
{ {
double twoPixels = 2.0 / 16.0; double twoPixels = 2.0 / 16.0;
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
@@ -35,8 +36,8 @@ public class BlockCondenser extends AEBaseBlock
public BlockCondenser() { public BlockCondenser() {
super( BlockCondenser.class, Material.iron ); super( BlockCondenser.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileCondenser.class ); this.setTileEntity( TileCondenser.class );
} }
@Override @Override
@@ -47,7 +48,7 @@ public class BlockCondenser extends AEBaseBlock
if ( Platform.isServer() ) if ( Platform.isServer() )
{ {
TileCondenser tc = getTileEntity( w, x, y, z ); TileCondenser tc = this.getTileEntity( w, x, y, z );
if ( tc != null && !player.isSneaking() ) if ( tc != null && !player.isSneaking() )
{ {
Platform.openGUI( player, tc, ForgeDirection.getOrientation(side), GuiBridge.GUI_CONDENSER ); Platform.openGUI( player, tc, ForgeDirection.getOrientation(side), GuiBridge.GUI_CONDENSER );
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInscriber; import appeng.client.render.blocks.RenderBlockInscriber;
@@ -37,10 +38,10 @@ public class BlockInscriber extends AEBaseBlock
public BlockInscriber() { public BlockInscriber() {
super( BlockInscriber.class, Material.iron ); super( BlockInscriber.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Inscriber ) ); this.setFeature( EnumSet.of( AEFeature.Inscriber ) );
setTileEntity( TileInscriber.class ); this.setTileEntity( TileInscriber.class );
setLightOpacity( 2 ); this.setLightOpacity( 2 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
@@ -55,7 +56,7 @@ public class BlockInscriber extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileInscriber tg = getTileEntity( w, x, y, z ); TileInscriber tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
@@ -38,8 +39,8 @@ public class BlockInterface extends AEBaseBlock
public BlockInterface() { public BlockInterface() {
super( BlockInterface.class, Material.iron ); super( BlockInterface.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileInterface.class ); this.setTileEntity( TileInterface.class );
} }
@Override @Override
@@ -69,7 +70,7 @@ public class BlockInterface extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileInterface tg = getTileEntity( w, x, y, z ); TileInterface tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -23,18 +23,20 @@ import java.util.Random;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.core.features.AEFeature;
import appeng.tile.misc.TileLightDetector;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.core.features.AEFeature;
import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends BlockQuartzTorch public class BlockLightDetector extends BlockQuartzTorch
{ {
public BlockLightDetector() { public BlockLightDetector() {
super( BlockLightDetector.class ); super( BlockLightDetector.class );
setFeature( EnumSet.of( AEFeature.LightDetector ) ); this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
setTileEntity( TileLightDetector.class ); this.setTileEntity( TileLightDetector.class );
} }
@Override @Override
@@ -42,7 +44,7 @@ public class BlockLightDetector extends BlockQuartzTorch
{ {
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ ); 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 ) if ( tld != null )
tld.updateLight(); tld.updateLight();
} }
@@ -50,7 +52,7 @@ public class BlockLightDetector extends BlockQuartzTorch
@Override @Override
public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) 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 ((World) w).getBlockLightValue( x, y, z ) - 6;
return 0; return 0;
@@ -22,8 +22,6 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.MaterialLiquid; import net.minecraft.block.material.MaterialLiquid;
@@ -33,6 +31,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockPaint; import appeng.client.render.blocks.RenderBlockPaint;
@@ -45,11 +47,11 @@ public class BlockPaint extends AEBaseBlock
public BlockPaint() { public BlockPaint() {
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) ); super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
setFeature( EnumSet.of( AEFeature.PaintBalls ) ); this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
setTileEntity( TilePaint.class ); this.setTileEntity( TilePaint.class );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = false; this.isFullSize = false;
isOpaque = false; this.isOpaque = false;
} }
@Override @Override
@@ -61,7 +63,7 @@ public class BlockPaint extends AEBaseBlock
@Override @Override
public int getLightValue(IBlockAccess w, int x, int y, int z) 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 ) if ( tp != null )
{ {
@@ -88,7 +90,7 @@ public class BlockPaint extends AEBaseBlock
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) 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 ) if ( tp != null )
tp.onNeighborBlockChange(); tp.onNeighborBlockChange();
@@ -27,6 +27,10 @@ import net.minecraft.client.Minecraft;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
@@ -39,17 +43,15 @@ import appeng.core.features.AEFeature;
import appeng.helpers.MetaRotation; import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileQuartzGrowthAccelerator; import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
{ {
public BlockQuartzGrowthAccelerator() { public BlockQuartzGrowthAccelerator() {
super( BlockQuartzGrowthAccelerator.class, Material.rock ); super( BlockQuartzGrowthAccelerator.class, Material.rock );
setStepSound( Block.soundTypeMetal ); this.setStepSound( Block.soundTypeMetal );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileQuartzGrowthAccelerator.class ); this.setTileEntity( TileQuartzGrowthAccelerator.class );
} }
@Override @Override
@@ -71,7 +73,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
if ( !AEConfig.instance.enableEffects ) if ( !AEConfig.instance.enableEffects )
return; 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 ) ) if ( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
{ {
@@ -53,14 +53,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
protected BlockQuartzTorch(Class which) { protected BlockQuartzTorch(Class which) {
super( which, Material.circuits ); super( which, Material.circuits );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
public BlockQuartzTorch() { public BlockQuartzTorch() {
this( BlockQuartzTorch.class ); this( BlockQuartzTorch.class );
setFeature( EnumSet.of( AEFeature.DecorativeLights ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
setLightLevel( 0.9375F ); this.setLightLevel( 0.9375F );
} }
@Override @Override
@@ -86,7 +86,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public boolean canPlaceBlockAt(World w, int x, int y, int z) public boolean canPlaceBlockAt(World w, int x, int y, int z)
{ {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
if ( canPlaceAt( w, x, y, z, dir ) ) if ( this.canPlaceAt( w, x, y, z, dir ) )
return true; return true;
return false; return false;
} }
@@ -99,21 +99,21 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
@Override @Override
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up) 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 @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block id) public void onNeighborBlockChange(World w, int x, int y, int z, Block id)
{ {
ForgeDirection up = getOrientable( w, x, y, z ).getUp(); ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) ) if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
dropTorch( w, x, y, z ); this.dropTorch( w, x, y, z );
} }
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> 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 xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY; double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ; double zOff = -0.3 * up.offsetZ;
@@ -139,7 +139,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
if ( r.nextFloat() < 0.98 ) if ( r.nextFloat() < 0.98 )
return; 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 xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY; double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ; double zOff = -0.3 * up.offsetZ;
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RendererSecurity; import appeng.client.render.blocks.RendererSecurity;
@@ -37,8 +38,8 @@ public class BlockSecurity extends AEBaseBlock
public BlockSecurity() { public BlockSecurity() {
super( BlockSecurity.class, Material.iron ); super( BlockSecurity.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Security ) ); this.setFeature( EnumSet.of( AEFeature.Security ) );
setTileEntity( TileSecurity.class ); this.setTileEntity( TileSecurity.class );
} }
@Override @Override
@@ -53,7 +54,7 @@ public class BlockSecurity extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileSecurity tg = getTileEntity( w, x, y, z ); TileSecurity tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isClient() ) if ( Platform.isClient() )
@@ -48,10 +48,10 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public BlockSkyCompass() { public BlockSkyCompass() {
super( BlockSkyCompass.class, Material.iron ); super( BlockSkyCompass.class, Material.iron );
setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) ); this.setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) );
setTileEntity( TileSkyCompass.class ); this.setTileEntity( TileSkyCompass.class );
isOpaque = isFullSize = false; this.isOpaque = this.isFullSize = false;
lightOpacity = 0; this.lightOpacity = 0;
} }
@Override @Override
@@ -78,7 +78,7 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public boolean canPlaceBlockAt(World w, int x, int y, int z) public boolean canPlaceBlockAt(World w, int x, int y, int z)
{ {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
if ( canPlaceAt( w, x, y, z, dir ) ) if ( this.canPlaceAt( w, x, y, z, dir ) )
return true; return true;
return false; return false;
} }
@@ -91,25 +91,25 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
@Override @Override
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up) 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 ) if ( sc != null )
return false; return false;
return canPlaceAt( w, x, y, z, forward.getOpposite() ); return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
} }
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block id) 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(); ForgeDirection up = sc.getForward();
if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) ) if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
dropTorch( w, x, y, z ); this.dropTorch( w, x, y, z );
} }
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> 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 ) if ( tile != null )
{ {
ForgeDirection forward = tile.getForward(); ForgeDirection forward = tile.getForward();
@@ -57,12 +57,12 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public BlockTinyTNT() { public BlockTinyTNT() {
super( BlockTinyTNT.class, Material.tnt ); super( BlockTinyTNT.class, Material.tnt );
setFeature( EnumSet.of( AEFeature.TinyTNT ) ); this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
setLightOpacity( 1 ); this.setLightOpacity( 1 );
setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
setStepSound( soundTypeGrass ); this.setStepSound( soundTypeGrass );
setHardness( 0F ); this.setHardness( 0F );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
} }
@@ -27,6 +27,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig; import appeng.core.AEConfig;
@@ -41,9 +42,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public BlockVibrationChamber() { public BlockVibrationChamber() {
super( BlockVibrationChamber.class, Material.iron ); super( BlockVibrationChamber.class, Material.iron );
setFeature( EnumSet.of( AEFeature.PowerGen ) ); this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
setTileEntity( TileVibrationChamber.class ); this.setTileEntity( TileVibrationChamber.class );
setHardness( 4.2F ); this.setHardness( 4.2F );
} }
@Override @Override
@@ -54,7 +55,7 @@ public class BlockVibrationChamber extends AEBaseBlock
if ( Platform.isServer() ) if ( Platform.isServer() )
{ {
TileVibrationChamber tc = getTileEntity( w, x, y, z ); TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
if ( tc != null && !player.isSneaking() ) if ( tc != null && !player.isSneaking() )
{ {
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER ); Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
@@ -69,9 +70,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s) public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
{ {
IIcon ico = super.getIcon( w, x, y, z, 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(); return ExtraBlockTextures.BlockVibrationChamberFrontOn.getIcon();
} }
@@ -85,7 +86,7 @@ public class BlockVibrationChamber extends AEBaseBlock
if ( !AEConfig.instance.enableEffects ) if ( !AEConfig.instance.enableEffects )
return; return;
AEBaseTile tile = getTileEntity( w, x, y, z ); AEBaseTile tile = this.getTileEntity( w, x, y, z );
if ( tile instanceof TileVibrationChamber ) if ( tile instanceof TileVibrationChamber )
{ {
TileVibrationChamber tc = (TileVibrationChamber) tile; TileVibrationChamber tc = (TileVibrationChamber) tile;
@@ -39,8 +39,14 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection; import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection;
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType; import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost; import appeng.api.parts.IPartHost;
import appeng.api.parts.PartItemStack; import appeng.api.parts.PartItemStack;
@@ -67,9 +73,6 @@ import appeng.tile.networking.TileCableBusTESR;
import appeng.transformer.annotations.integration.Interface; import appeng.transformer.annotations.integration.Interface;
import appeng.transformer.annotations.integration.Method; import appeng.transformer.annotations.integration.Method;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR") @Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@@ -95,9 +98,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public BlockCableBus() { public BlockCableBus() {
super( BlockCableBus.class, AEGlassMaterial.instance ); super( BlockCableBus.class, AEGlassMaterial.instance );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
@@ -112,7 +115,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer) 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 ) if ( object instanceof IPartHost )
{ {
IPartHost host = (IPartHost) object; IPartHost host = (IPartHost) object;
@@ -120,7 +123,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
for (ForgeDirection side : ForgeDirection.values()) for (ForgeDirection side : ForgeDirection.values())
{ {
IPart p = host.getPart( side ); IPart p = host.getPart( side );
IIcon ico = getIcon( p ); IIcon ico = this.getIcon( p );
if ( ico == null ) if ( ico == null )
continue; continue;
@@ -159,7 +162,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) 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 ) if ( object instanceof IPartHost )
{ {
IPartHost host = (IPartHost) object; IPartHost host = (IPartHost) object;
@@ -167,7 +170,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
for (ForgeDirection side : ForgeDirection.values()) for (ForgeDirection side : ForgeDirection.values())
{ {
IPart p = host.getPart( side ); IPart p = host.getPart( side );
IIcon ico = getIcon( p ); IIcon ico = this.getIcon( p );
if ( ico == null ) if ( ico == null )
continue; continue;
@@ -235,20 +238,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) 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 @Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) 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) public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who)
{ {
try 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) catch (Throwable ignored)
{ {
@@ -259,7 +262,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public void randomDisplayTick(World world, int x, int y, int z, Random r) 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 @Override
@@ -272,14 +275,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
} }
if ( block == null ) if ( block == null )
return 0; return 0;
return cb( world, x, y, z ).getLightValue(); return this.cb( world, x, y, z ).getLightValue();
} }
@Override @Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{ {
Vec3 v3 = target.hitVec.addVector( -x, -y, -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 ) if ( sp.part != null )
return sp.part.getItemStack( PartItemStack.Pick ); return sp.part.getItemStack( PartItemStack.Pick );
@@ -292,7 +295,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public boolean isReplaceable(IBlockAccess world, int x, int y, int z) 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") @SuppressWarnings("deprecation")
@@ -301,7 +304,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{ {
if ( player.capabilities.isCreativeMode ) if ( player.capabilities.isCreativeMode )
{ {
AEBaseTile tile = getTileEntity( world, x, y, z ); AEBaseTile tile = this.getTileEntity( world, x, y, z );
if ( tile != null ) if ( tile != null )
tile.disableDrops(); tile.disableDrops();
// maybe ray trace? // maybe ray trace?
@@ -312,7 +315,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s) public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
{ {
return getIcon( s, 0 ); return this.getIcon( s, 0 );
} }
@Override @Override
@@ -346,20 +349,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public boolean isSideSolid(IBlockAccess w, int x, int y, int z, ForgeDirection side) 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 @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block meh) 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 @Override
public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ) public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ)
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
cb( w, x, y, z ).onNeighborChanged(); this.cb( w, x, y, z ).onNeighborChanged();
} }
@Override @Override
@@ -371,13 +374,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) public boolean onActivated(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 @Override
public void onEntityCollidedWithBlock(World w, int x, int y, int z, Entity e) 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 @Override
@@ -387,15 +390,15 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{ {
case -1: case -1:
case 4: 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: 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: 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: 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: 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; return false;
} }
@@ -403,13 +406,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Override @Override
public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) 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 @Override
public int isProvidingStrongPower(IBlockAccess w, int x, int y, int z, int side) 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 @Override
@@ -421,7 +424,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public void setupTile() 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() ) if ( Platform.isClient() )
{ {
tesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() ); tesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() );
@@ -453,20 +456,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
@Method(iname = "MFR") @Method(iname = "MFR")
public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side) 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; int myColorMultiplier = 0xffffff;
public void setRenderColor(int color) public void setRenderColor(int color)
{ {
myColorMultiplier = color; this.myColorMultiplier = color;
} }
@Override @Override
public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
{ {
return myColorMultiplier; return this.myColorMultiplier;
} }
} }
@@ -23,6 +23,7 @@ import java.util.EnumSet;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockController; import appeng.client.render.blocks.RenderBlockController;
@@ -34,15 +35,15 @@ public class BlockController extends AEBaseBlock
public BlockController() { public BlockController() {
super( BlockController.class, Material.iron ); super( BlockController.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Channels ) ); this.setFeature( EnumSet.of( AEFeature.Channels ) );
setTileEntity( TileController.class ); this.setTileEntity( TileController.class );
setHardness( 6 ); this.setHardness( 6 );
} }
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block id_junk) 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 ) if ( tc != null )
tc.onNeighborChange( false ); tc.onNeighborChange( false );
} }
@@ -30,8 +30,8 @@ public class BlockCreativeEnergyCell extends AEBaseBlock
public BlockCreativeEnergyCell() { public BlockCreativeEnergyCell() {
super( BlockCreativeEnergyCell.class, AEGlassMaterial.instance ); super( BlockCreativeEnergyCell.class, AEGlassMaterial.instance );
setFeature( EnumSet.of( AEFeature.Creative ) ); this.setFeature( EnumSet.of( AEFeature.Creative ) );
setTileEntity( TileCreativeEnergyCell.class ); this.setTileEntity( TileCreativeEnergyCell.class );
} }
} }
@@ -21,6 +21,7 @@ package appeng.block.networking;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.tile.networking.TileDenseEnergyCell; import appeng.tile.networking.TileDenseEnergyCell;
@@ -36,8 +37,8 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
public BlockDenseEnergyCell() { public BlockDenseEnergyCell() {
super( BlockDenseEnergyCell.class ); super( BlockDenseEnergyCell.class );
setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) ); this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
setTileEntity( TileDenseEnergyCell.class ); this.setTileEntity( TileDenseEnergyCell.class );
} }
@Override @Override
@@ -21,6 +21,7 @@ package appeng.block.networking;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.tile.networking.TileEnergyAcceptor; import appeng.tile.networking.TileEnergyAcceptor;
@@ -30,8 +31,8 @@ public class BlockEnergyAcceptor extends AEBaseBlock
public BlockEnergyAcceptor() { public BlockEnergyAcceptor() {
super( BlockEnergyAcceptor.class, Material.iron ); super( BlockEnergyAcceptor.class, Material.iron );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileEnergyAcceptor.class ); this.setTileEntity( TileEnergyAcceptor.class );
} }
} }
@@ -21,15 +21,17 @@ package appeng.block.networking;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseItemBlock;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.block.AEBaseItemBlockChargeable; import appeng.block.AEBaseItemBlockChargeable;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockEnergyCube; import appeng.client.render.blocks.RenderBlockEnergyCube;
@@ -53,8 +55,8 @@ public class BlockEnergyCell extends AEBaseBlock
public BlockEnergyCell() { public BlockEnergyCell() {
this( BlockEnergyCell.class ); this( BlockEnergyCell.class );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setTileEntity( TileEnergyCell.class ); this.setTileEntity( TileEnergyCell.class );
} }
@Override @Override
@@ -65,8 +67,8 @@ public class BlockEnergyCell extends AEBaseBlock
ItemStack charged = new ItemStack( this, 1 ); ItemStack charged = new ItemStack( this, 1 );
NBTTagCompound tag = Platform.openNbtData( charged ); NBTTagCompound tag = Platform.openNbtData( charged );
tag.setDouble( "internalCurrentPower", getMaxPower() ); tag.setDouble( "internalCurrentPower", this.getMaxPower() );
tag.setDouble( "internalMaxPower", getMaxPower() ); tag.setDouble( "internalMaxPower", this.getMaxPower() );
itemStacks.add( charged ); itemStacks.add( charged );
} }
@@ -44,11 +44,11 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
public BlockWireless() { public BlockWireless() {
super( BlockWireless.class, AEGlassMaterial.instance ); super( BlockWireless.class, AEGlassMaterial.instance );
setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) ); this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) );
setTileEntity( TileWireless.class ); this.setTileEntity( TileWireless.class );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = false; this.isFullSize = false;
isOpaque = false; this.isOpaque = false;
} }
@Override @Override
@@ -60,7 +60,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> 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 ) if ( tile != null )
{ {
ForgeDirection forward = tile.getForward(); ForgeDirection forward = tile.getForward();
@@ -122,7 +122,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
@Override @Override
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e) public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
{ {
TileWireless tile = getTileEntity( w, x, y, z ); TileWireless tile = this.getTileEntity( w, x, y, z );
if ( tile != null ) if ( tile != null )
{ {
ForgeDirection forward = tile.getForward(); ForgeDirection forward = tile.getForward();
@@ -188,7 +188,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileWireless tg = getTileEntity( w, x, y, z ); TileWireless tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -51,19 +51,19 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
public BlockQuantumLinkChamber() { public BlockQuantumLinkChamber() {
super( BlockQuantumLinkChamber.class, AEGlassMaterial.instance ); super( BlockQuantumLinkChamber.class, AEGlassMaterial.instance );
setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
setTileEntity( TileQuantumBridge.class ); this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f; float shave = 2.0f / 16.0f;
setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World w, int bx, int by, int bz, Random r) 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 != null )
{ {
if ( bridge.hasQES() ) if ( bridge.hasQES() )
@@ -77,7 +77,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) 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 ) if ( bridge != null )
bridge.neighborUpdate(); bridge.neighborUpdate();
} }
@@ -85,7 +85,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
@Override @Override
public void breakBlock(World w, int x, int y, int z, Block a, int b) 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 ) if ( bridge != null )
bridge.breakCluster(); bridge.breakCluster();
@@ -104,7 +104,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileQuantumBridge tg = getTileEntity( w, x, y, z ); TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -41,18 +41,18 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
public BlockQuantumRing() { public BlockQuantumRing() {
super( BlockQuantumRing.class, Material.iron ); super( BlockQuantumRing.class, Material.iron );
setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) ); this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
setTileEntity( TileQuantumBridge.class ); this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f; float shave = 2.0f / 16.0f;
setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
setLightOpacity( 1 ); this.setLightOpacity( 1 );
isFullSize = isOpaque = false; this.isFullSize = this.isOpaque = false;
} }
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) 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 ) if ( bridge != null )
bridge.neighborUpdate(); bridge.neighborUpdate();
} }
@@ -60,7 +60,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
@Override @Override
public void breakBlock(World w, int x, int y, int z, Block a, int b) 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 ) if ( bridge != null )
bridge.breakCluster(); bridge.breakCluster();
@@ -77,7 +77,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
{ {
double OnePx = 2.0 / 16.0; 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() ) if ( bridge != null && bridge.isCorner() )
{ {
OnePx = 4.0 / 16.0; 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<AxisAlignedBB> out, Entity e) public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
{ {
double OnePx = 2.0 / 16.0; 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() ) if ( bridge != null && bridge.isCorner() )
{ {
OnePx = 4.0 / 16.0; OnePx = 4.0 / 16.0;
@@ -32,6 +32,6 @@ public class BlockFluix extends AEDecorativeBlock
public BlockFluix() public BlockFluix()
{ {
super( BlockFluix.class, Material.rock ); super( BlockFluix.class, Material.rock );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -21,6 +21,7 @@ package appeng.block.solids;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import appeng.block.AEDecorativeBlock; import appeng.block.AEDecorativeBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -29,7 +30,7 @@ public class BlockQuartz extends AEDecorativeBlock
public BlockQuartz() { public BlockQuartz() {
super( BlockQuartz.class, Material.rock ); super( BlockQuartz.class, Material.rock );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -21,6 +21,7 @@ package appeng.block.solids;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import appeng.block.AEDecorativeBlock; import appeng.block.AEDecorativeBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -29,7 +30,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock
public BlockQuartzChiseled() { public BlockQuartzChiseled() {
super( BlockQuartzChiseled.class, Material.rock ); super( BlockQuartzChiseled.class, Material.rock );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -22,13 +22,15 @@ import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzGlass; import appeng.client.render.blocks.RenderQuartzGlass;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuartzGlass extends AEBaseBlock public class BlockQuartzGlass extends AEBaseBlock
{ {
@@ -58,9 +60,9 @@ public class BlockQuartzGlass extends AEBaseBlock
public BlockQuartzGlass(Class c) { public BlockQuartzGlass(Class c) {
super( c, Material.glass ); super( c, Material.glass );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isOpaque = false; this.isOpaque = false;
} }
} }
@@ -23,21 +23,23 @@ import java.util.Random;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.client.render.effects.VibrantFX; import appeng.client.render.effects.VibrantFX;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuartzLamp extends BlockQuartzGlass public class BlockQuartzLamp extends BlockQuartzGlass
{ {
public BlockQuartzLamp() { public BlockQuartzLamp() {
super( BlockQuartzLamp.class ); super( BlockQuartzLamp.class );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
setLightLevel( 1.0f ); this.setLightLevel( 1.0f );
setBlockTextureName( "BlockQuartzGlass" ); this.setBlockTextureName( "BlockQuartzGlass" );
} }
@Override @Override
@@ -22,6 +22,7 @@ import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
@@ -33,7 +34,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
public BlockQuartzPillar() { public BlockQuartzPillar() {
super( BlockQuartzPillar.class, Material.rock ); super( BlockQuartzPillar.class, Material.rock );
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
@Override @Override
@@ -34,7 +34,13 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import rblocks.api.RotatableBlockEnable; import rblocks.api.RotatableBlockEnable;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
@@ -46,9 +52,6 @@ import appeng.helpers.NullRotation;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IRB; import appeng.integration.abstraction.IRB;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@RotatableBlockEnable @RotatableBlockEnable
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
@@ -81,11 +84,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public BlockSkyStone() { public BlockSkyStone() {
super( BlockSkyStone.class, Material.rock ); super( BlockSkyStone.class, Material.rock );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setHardness( 50 ); this.setHardness( 50 );
hasSubtypes = true; this.hasSubtypes = true;
blockResistance = 150.0f; this.blockResistance = 150.0f;
setHarvestLevel( "pickaxe", 3, 0 ); this.setHarvestLevel( "pickaxe", 3, 0 );
MinecraftForge.EVENT_BUS.register( this ); MinecraftForge.EVENT_BUS.register( this );
} }
@@ -99,15 +102,15 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public String getUnlocalizedName(ItemStack is) public String getUnlocalizedName(ItemStack is)
{ {
if ( is.getItemDamage() == 1 ) if ( is.getItemDamage() == 1 )
return getUnlocalizedName() + ".Block"; return this.getUnlocalizedName() + ".Block";
if ( is.getItemDamage() == 2 ) if ( is.getItemDamage() == 2 )
return getUnlocalizedName() + ".Brick"; return this.getUnlocalizedName() + ".Brick";
if ( is.getItemDamage() == 3 ) if ( is.getItemDamage() == 3 )
return getUnlocalizedName() + ".SmallBrick"; return this.getUnlocalizedName() + ".SmallBrick";
return getUnlocalizedName(); return this.getUnlocalizedName();
} }
@Override @Override
@@ -135,9 +138,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public void registerBlockIcons(IIconRegister ir) public void registerBlockIcons(IIconRegister ir)
{ {
super.registerBlockIcons( ir ); super.registerBlockIcons( ir );
Block = ir.registerIcon( getTextureName() + ".Block" ); this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
Brick = ir.registerIcon( getTextureName() + ".Brick" ); this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
SmallBrick = ir.registerIcon( getTextureName() + ".SmallBrick" ); this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
} }
@Override @Override
@@ -145,18 +148,18 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public IIcon getIcon(int direction, int metadata) public IIcon getIcon(int direction, int metadata)
{ {
if ( metadata == 1 ) if ( metadata == 1 )
return Block; return this.Block;
if ( metadata == 2 ) if ( metadata == 2 )
return Brick; return this.Brick;
if ( metadata == 3 ) if ( metadata == 3 )
return SmallBrick; return this.SmallBrick;
return super.getIcon( direction, metadata ); return super.getIcon( direction, metadata );
} }
@Override @Override
public void setRenderStateByMeta(int metadata) public void setRenderStateByMeta(int metadata)
{ {
getRendererInstance().setTemporaryRenderIcon( getIcon( 0, metadata ) ); this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) );
} }
@Override @Override
@@ -197,7 +200,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
// use AE2's renderer, no rotatable blocks. // use AE2's renderer, no rotatable blocks.
int getRealRenderType() int getRealRenderType()
{ {
return getRenderType(); return this.getRenderType();
} }
@Override @Override
@@ -28,6 +28,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
@@ -43,12 +44,12 @@ public class OreQuartz extends AEBaseBlock
public OreQuartz(Class self) { public OreQuartz(Class self) {
super( self, Material.rock ); super( self, Material.rock );
setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
setHardness( 3.0F ); this.setHardness( 3.0F );
setResistance( 5.0F ); this.setResistance( 5.0F );
boostBrightnessLow = 0; this.boostBrightnessLow = 0;
boostBrightnessHigh = 1; this.boostBrightnessHigh = 1;
enhanceBrightness = false; this.enhanceBrightness = false;
} }
@Override @Override
@@ -67,14 +68,14 @@ public class OreQuartz extends AEBaseBlock
public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4)
{ {
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 ); int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
if ( enhanceBrightness ) if ( this.enhanceBrightness )
{ {
j1 = Math.max( j1 >> 20, j1 >> 4 ); j1 = Math.max( j1 >> 20, j1 >> 4 );
if ( j1 > 4 ) if ( j1 > 4 )
j1 += boostBrightnessHigh; j1 += this.boostBrightnessHigh;
else else
j1 += boostBrightnessLow; j1 += this.boostBrightnessLow;
if ( j1 > 15 ) if ( j1 > 15 )
j1 = 15; j1 = 15;
@@ -95,13 +96,13 @@ public class OreQuartz extends AEBaseBlock
@Override @Override
public Item getItemDropped(int id, Random rand, int meta) public Item getItemDropped(int id, Random rand, int meta)
{ {
return getItemDropped().getItem(); return this.getItemDropped().getItem();
} }
@Override @Override
public int damageDropped(int id) public int damageDropped(int id)
{ {
return getItemDropped().getItemDamage(); return this.getItemDropped().getItemDamage();
} }
@Override @Override
@@ -113,7 +114,7 @@ public class OreQuartz extends AEBaseBlock
@Override @Override
public int quantityDroppedWithBonus(int fortune, Random rand) 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; int j = rand.nextInt( fortune + 2 ) - 1;
@@ -135,7 +136,7 @@ public class OreQuartz extends AEBaseBlock
{ {
super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta ); 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 ); int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
@@ -23,20 +23,22 @@ import java.util.Random;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.render.effects.ChargedOreFX; import appeng.client.render.effects.ChargedOreFX;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class OreQuartzCharged extends OreQuartz public class OreQuartzCharged extends OreQuartz
{ {
public OreQuartzCharged() { public OreQuartzCharged() {
super( OreQuartzCharged.class ); super( OreQuartzCharged.class );
boostBrightnessLow = 2; this.boostBrightnessLow = 2;
boostBrightnessHigh = 5; this.boostBrightnessHigh = 5;
} }
@Override @Override
@@ -31,13 +31,15 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderNull; import appeng.client.render.blocks.RenderNull;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
{ {
@@ -45,11 +47,11 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
public BlockMatrixFrame() public BlockMatrixFrame()
{ {
super( BlockMatrixFrame.class, Material.anvil ); super( BlockMatrixFrame.class, Material.anvil );
setFeature( EnumSet.of( AEFeature.SpatialIO ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
setResistance( 6000000.0F ); this.setResistance( 6000000.0F );
setBlockUnbreakable(); this.setBlockUnbreakable();
setLightOpacity( 0 ); this.setLightOpacity( 0 );
isOpaque = false; this.isOpaque = false;
} }
@Override @Override
@@ -25,6 +25,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
@@ -36,14 +37,14 @@ public class BlockSpatialIOPort extends AEBaseBlock
public BlockSpatialIOPort() { public BlockSpatialIOPort() {
super( BlockSpatialIOPort.class, Material.iron ); super( BlockSpatialIOPort.class, Material.iron );
setFeature( EnumSet.of( AEFeature.SpatialIO ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
setTileEntity( TileSpatialIOPort.class ); this.setTileEntity( TileSpatialIOPort.class );
} }
@Override @Override
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk) 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 ) if ( te != null )
te.updateRedstoneState(); te.updateRedstoneState();
} }
@@ -54,7 +55,7 @@ public class BlockSpatialIOPort extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileSpatialIOPort tg = getTileEntity( w, x, y, z ); TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -23,6 +23,7 @@ import java.util.EnumSet;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderSpatialPylon; import appeng.client.render.blocks.RenderSpatialPylon;
@@ -35,14 +36,14 @@ public class BlockSpatialPylon extends AEBaseBlock
public BlockSpatialPylon() { public BlockSpatialPylon() {
super( BlockSpatialPylon.class, AEGlassMaterial.instance ); super( BlockSpatialPylon.class, AEGlassMaterial.instance );
setFeature( EnumSet.of( AEFeature.SpatialIO ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
setTileEntity( TileSpatialPylon.class ); this.setTileEntity( TileSpatialPylon.class );
} }
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk) 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 ) if ( tsp != null )
tsp.onNeighborBlockChange(); tsp.onNeighborBlockChange();
} }
@@ -50,7 +51,7 @@ public class BlockSpatialPylon extends AEBaseBlock
@Override @Override
public int getLightValue(IBlockAccess w, int x, int y, int z) 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 ) if ( tsp != null )
return tsp.getLightValue(); return tsp.getLightValue();
return super.getLightValue( w, x, y, z ); return super.getLightValue( w, x, y, z );
@@ -25,6 +25,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ICellHandler; import appeng.api.storage.ICellHandler;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
@@ -41,8 +42,8 @@ public class BlockChest extends AEBaseBlock
public BlockChest() { public BlockChest() {
super( BlockChest.class, Material.iron ); super( BlockChest.class, Material.iron );
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
setTileEntity( TileChest.class ); this.setTileEntity( TileChest.class );
} }
@Override @Override
@@ -54,7 +55,7 @@ public class BlockChest extends AEBaseBlock
@Override @Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) public boolean onActivated(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 ( tg != null && !p.isSneaking() )
{ {
if ( Platform.isClient() ) if ( Platform.isClient() )
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderDrive; import appeng.client.render.blocks.RenderDrive;
@@ -37,8 +38,8 @@ public class BlockDrive extends AEBaseBlock
public BlockDrive() { public BlockDrive() {
super( BlockDrive.class, Material.iron ); super( BlockDrive.class, Material.iron );
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
setTileEntity( TileDrive.class ); this.setTileEntity( TileDrive.class );
} }
@Override @Override
@@ -53,7 +54,7 @@ public class BlockDrive extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileDrive tg = getTileEntity( w, x, y, z ); TileDrive tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -25,6 +25,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
@@ -36,14 +37,14 @@ public class BlockIOPort extends AEBaseBlock
public BlockIOPort() { public BlockIOPort() {
super( BlockIOPort.class, Material.iron ); super( BlockIOPort.class, Material.iron );
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
setTileEntity( TileIOPort.class ); this.setTileEntity( TileIOPort.class );
} }
@Override @Override
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk) 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 ) if ( te != null )
te.updateRedstoneState(); te.updateRedstoneState();
} }
@@ -54,7 +55,7 @@ public class BlockIOPort extends AEBaseBlock
if ( p.isSneaking() ) if ( p.isSneaking() )
return false; return false;
TileIOPort tg = getTileEntity( w, x, y, z ); TileIOPort tg = this.getTileEntity( w, x, y, z );
if ( tg != null ) if ( tg != null )
{ {
if ( Platform.isServer() ) if ( Platform.isServer() )
@@ -54,22 +54,22 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public BlockSkyChest() { public BlockSkyChest() {
super( BlockSkyChest.class, Material.rock ); super( BlockSkyChest.class, Material.rock );
setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) ); this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
setTileEntity( TileSkyChest.class ); this.setTileEntity( TileSkyChest.class );
isOpaque = isFullSize = false; this.isOpaque = this.isFullSize = false;
lightOpacity = 0; this.lightOpacity = 0;
hasSubtypes = true; this.hasSubtypes = true;
setHardness( 50 ); this.setHardness( 50 );
blockResistance = 150.0f; this.blockResistance = 150.0f;
} }
@Override @Override
public String getUnlocalizedName(ItemStack is) public String getUnlocalizedName(ItemStack is)
{ {
if ( is.getItemDamage() == 1 ) if ( is.getItemDamage() == 1 )
return getUnlocalizedName() + ".Block"; return this.getUnlocalizedName() + ".Block";
return getUnlocalizedName(); return this.getUnlocalizedName();
} }
@Override @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) public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{ {
if ( Platform.isServer() ) 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; return true;
} }
@@ -121,7 +121,7 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) public Iterable<AxisAlignedBB> 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; double sc = 0.06;
ForgeDirection o = ForgeDirection.UNKNOWN; ForgeDirection o = ForgeDirection.UNKNOWN;
+12 -11
View File
@@ -26,6 +26,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
@@ -48,7 +50,9 @@ import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import appeng.api.parts.CableRenderMode; import appeng.api.parts.CableRenderMode;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
@@ -81,9 +85,6 @@ import appeng.hooks.TickHandler.PlayerColor;
import appeng.server.ServerHelper; import appeng.server.ServerHelper;
import appeng.transformer.MissingCoreMod; import appeng.transformer.MissingCoreMod;
import appeng.util.Platform; import appeng.util.Platform;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class ClientHelper extends ServerHelper public class ClientHelper extends ServerHelper
{ {
@@ -100,7 +101,7 @@ public class ClientHelper extends ServerHelper
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer; EntityPlayer player = mc.thePlayer;
return renderModeForPlayer( player ); return this.renderModeForPlayer( player );
} }
@Override @Override
@@ -314,22 +315,22 @@ public class ClientHelper extends ServerHelper
switch (effect) switch (effect)
{ {
case Assembler: case Assembler:
spawnAssembler( worldObj, posX, posY, posZ, o ); this.spawnAssembler( worldObj, posX, posY, posZ, o );
return; return;
case Vibrant: case Vibrant:
spawnVibrant( worldObj, posX, posY, posZ ); this.spawnVibrant( worldObj, posX, posY, posZ );
return; return;
case Crafting: case Crafting:
spawnCrafting( worldObj, posX, posY, posZ ); this.spawnCrafting( worldObj, posX, posY, posZ );
return; return;
case Energy: case Energy:
spawnEnergy( worldObj, posX, posY, posZ ); this.spawnEnergy( worldObj, posX, posY, posZ );
return; return;
case Lightning: case Lightning:
spawnLightning( worldObj, posX, posY, posZ ); this.spawnLightning( worldObj, posX, posY, posZ );
return; return;
case LightningArc: case LightningArc:
spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o ); this.spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o );
return; return;
default: default:
} }
+62 -62
View File
@@ -30,6 +30,9 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -49,9 +52,6 @@ import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.GuiScrollbar;
import appeng.client.gui.widgets.ITooltip; import appeng.client.gui.widgets.ITooltip;
@@ -92,7 +92,7 @@ public abstract class AEBaseGui extends GuiContainer
public AEBaseGui(Container container) public AEBaseGui(Container container)
{ {
super( container ); super( container );
subGui = switchingGuis; this.subGui = switchingGuis;
switchingGuis = false; switchingGuis = false;
} }
@@ -111,7 +111,7 @@ public abstract class AEBaseGui extends GuiContainer
public boolean isSubGui() public boolean isSubGui()
{ {
return subGui; return this.subGui;
} }
@Override @Override
@@ -125,7 +125,7 @@ public abstract class AEBaseGui extends GuiContainer
if ( i.next() instanceof SlotME ) if ( i.next() instanceof SlotME )
i.remove(); i.remove();
for (InternalSlotME me : meSlots) for (InternalSlotME me : this.meSlots)
slots.add( new SlotME( me ) ); 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 x = Mouse.getEventX() * this.width / this.mc.displayWidth;
int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; 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 ) else if ( i != 0 && this.myScrollBar != null )
myScrollBar.wheel( i ); this.myScrollBar.wheel( i );
} }
protected void mouseWheelEvent(int x, int y, int wheel) protected void mouseWheelEvent(int x, int y, int wheel)
{ {
Slot slot = getSlot( x, y ); Slot slot = this.getSlot( x, y );
if ( slot instanceof SlotME ) if ( slot instanceof SlotME )
{ {
IAEItemStack item = ((SlotME) slot).getAEStack(); IAEItemStack item = ((SlotME) slot).getAEStack();
if ( item != null ) if ( item != null )
{ {
((AEBaseContainer) inventorySlots).setTargetStack( item ); ((AEBaseContainer) this.inventorySlots).setTargetStack( item );
InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
int times = Math.abs( wheel ); int times = Math.abs( wheel );
final int inventorySize = this.getInventorySlots().size(); final int inventorySize = this.getInventorySlots().size();
@@ -176,13 +176,13 @@ public abstract class AEBaseGui extends GuiContainer
public void onGuiClosed() public void onGuiClosed()
{ {
super.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 @Override
protected void mouseClicked(int xCoord, int yCoord, int btn) protected void mouseClicked(int xCoord, int yCoord, int btn)
{ {
drag_click.clear(); this.drag_click.clear();
if ( btn == 1 ) 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; 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; return;
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
@@ -259,7 +259,7 @@ public abstract class AEBaseGui extends GuiContainer
if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) ) if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
{ {
if ( enableSpaceClicking() ) if ( this.enableSpaceClicking() )
{ {
IAEItemStack stack = null; IAEItemStack stack = null;
if ( slot instanceof SlotME ) if ( slot instanceof SlotME )
@@ -270,7 +270,7 @@ public abstract class AEBaseGui extends GuiContainer
if ( !(slot instanceof SlotME) && slot != null ) if ( !(slot instanceof SlotME) && slot != null )
slotNum = slot.slotNumber; slotNum = slot.slotNumber;
((AEBaseContainer) inventorySlots).setTargetStack( stack ); ((AEBaseContainer) this.inventorySlots).setTargetStack( stack );
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
NetworkHandler.instance.sendToServer( p ); NetworkHandler.instance.sendToServer( p );
return; return;
@@ -356,7 +356,7 @@ public abstract class AEBaseGui extends GuiContainer
if ( action != null ) if ( action != null )
{ {
((AEBaseContainer) inventorySlots).setTargetStack( stack ); ((AEBaseContainer) this.inventorySlots).setTargetStack( stack );
PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
NetworkHandler.instance.sendToServer( p ); NetworkHandler.instance.sendToServer( p );
} }
@@ -364,21 +364,21 @@ public abstract class AEBaseGui extends GuiContainer
return; 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. // some simple double click logic.
bl_clicked = slot; this.bl_clicked = slot;
dbl_clickTimer = Stopwatch.createStarted(); this.dbl_clickTimer = Stopwatch.createStarted();
if ( slot != null ) if ( slot != null )
dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null; this.dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null;
else 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. // a replica of the weird broken vanilla feature.
@@ -386,14 +386,14 @@ public abstract class AEBaseGui extends GuiContainer
for (Slot inventorySlot : slots) for (Slot inventorySlot : slots)
{ {
if ( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() 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 ); this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, ctrlDown, 1 );
} }
} }
} }
disableShiftClick = false; this.disableShiftClick = false;
} }
super.handleMouseClick( slot, slotIdx, ctrlDown, key ); super.handleMouseClick( slot, slotIdx, ctrlDown, key );
@@ -407,10 +407,10 @@ public abstract class AEBaseGui extends GuiContainer
if ( slot instanceof SlotFake && itemstack != null ) if ( slot instanceof SlotFake && itemstack != null )
{ {
drag_click.add( slot ); this.drag_click.add( slot );
if ( drag_click.size() > 1 ) 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, PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
dr.slotNumber, 0 ); dr.slotNumber, 0 );
@@ -450,9 +450,9 @@ public abstract class AEBaseGui extends GuiContainer
final List<Slot> slots = this.getInventorySlots(); final List<Slot> slots = this.getInventorySlots();
for (Slot s : slots) 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; return false;
} }
@@ -468,7 +468,7 @@ public abstract class AEBaseGui extends GuiContainer
{ {
for (Slot s : slots) 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 ) ); NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
return true; return true;
@@ -488,10 +488,10 @@ public abstract class AEBaseGui extends GuiContainer
super.drawScreen( mouse_x, mouse_y, btn ); super.drawScreen( mouse_x, mouse_y, btn );
boolean hasClicked = Mouse.isButtonDown( 0 ); boolean hasClicked = Mouse.isButtonDown( 0 );
if ( hasClicked && myScrollBar != null ) if ( hasClicked && this.myScrollBar != null )
myScrollBar.click( this, mouse_x - guiLeft, mouse_y - guiTop ); 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 ) if ( c instanceof ITooltip )
{ {
@@ -508,7 +508,7 @@ public abstract class AEBaseGui extends GuiContainer
String msg = tooltip.getMessage(); String msg = tooltip.getMessage();
if ( msg != null ) 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) for (var6 = 0; var6 < var4.length; ++var6)
{ {
var7 = fontRendererObj.getStringWidth( var4[var6] ); var7 = this.fontRendererObj.getStringWidth( var4[var6] );
if ( var7 > var5 ) if ( var7 > var5 )
{ {
@@ -637,10 +637,10 @@ public abstract class AEBaseGui extends GuiContainer
@Override @Override
final protected void drawGuiContainerBackgroundLayer(float f, int x, int y) final protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
{ {
int ox = guiLeft; // (width - xSize) / 2; int ox = this.guiLeft; // (width - xSize) / 2;
int oy = guiTop; // (height - ySize) / 2; int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
drawBG( ox, oy, x, y ); this.drawBG( ox, oy, x, y );
final List<Slot> slots = this.getInventorySlots(); final List<Slot> slots = this.getInventorySlots();
for (Slot slot : slots) for (Slot slot : slots)
@@ -671,30 +671,30 @@ public abstract class AEBaseGui extends GuiContainer
@Override @Override
final protected void drawGuiContainerForegroundLayer(int x, int y) final protected void drawGuiContainerForegroundLayer(int x, int y)
{ {
int ox = guiLeft; // (width - xSize) / 2; int ox = this.guiLeft; // (width - xSize) / 2;
int oy = guiTop; // (height - ySize) / 2; int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
if ( myScrollBar != null ) if ( this.myScrollBar != null )
myScrollBar.draw( this ); this.myScrollBar.draw( this );
drawFG( ox, oy, x, y ); this.drawFG( ox, oy, x, y );
} }
protected String getGuiDisplayName(String in) protected String getGuiDisplayName(String in)
{ {
return hasCustomInventoryName() ? getInventoryName() : in; return this.hasCustomInventoryName() ? this.getInventoryName() : in;
} }
private String getInventoryName() private String getInventoryName()
{ {
return ((AEBaseContainer) inventorySlots).customName; return ((AEBaseContainer) this.inventorySlots).customName;
} }
private boolean hasCustomInventoryName() private boolean hasCustomInventoryName()
{ {
if ( inventorySlots instanceof AEBaseContainer ) if ( this.inventorySlots instanceof AEBaseContainer )
return ((AEBaseContainer) inventorySlots).customName != null; return ((AEBaseContainer) this.inventorySlots).customName != null;
return false; return false;
} }
@@ -704,7 +704,7 @@ public abstract class AEBaseGui extends GuiContainer
for (Slot slot : slots) for (Slot slot : slots)
{ {
// isPointInRegion // 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; return slot;
} }
@@ -761,25 +761,25 @@ public abstract class AEBaseGui extends GuiContainer
public void a(Slot s) public void a(Slot s)
{ {
drawSlot( s ); this.drawSlot( s );
} }
public void func_146977_a(Slot s) public void func_146977_a(Slot s)
{ {
drawSlot( s ); this.drawSlot( s );
} }
public void drawSlot(Slot s) public void drawSlot(Slot s)
{ {
if ( s instanceof SlotME ) if ( s instanceof SlotME )
{ {
RenderItem pIR = setItemRender( aeRenderItem ); RenderItem pIR = this.setItemRender( this.aeRenderItem );
try try
{ {
this.zLevel = 100.0F; this.zLevel = 100.0F;
itemRender.zLevel = 100.0F; itemRender.zLevel = 100.0F;
if ( !isPowered() ) if ( !this.isPowered() )
{ {
GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_LIGHTING );
drawRect( s.xDisplayPosition, s.yDisplayPosition, 16 + s.xDisplayPosition, 16 + s.yDisplayPosition, 0x66111111 ); 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; this.zLevel = 0.0F;
itemRender.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) catch (Exception err)
{ {
@@ -799,7 +799,7 @@ public abstract class AEBaseGui extends GuiContainer
if ( Platform.isDrawing( Tessellator.instance ) ) if ( Platform.isDrawing( Tessellator.instance ) )
Tessellator.instance.draw(); Tessellator.instance.draw();
} }
setItemRender( pIR ); this.setItemRender( pIR );
return; return;
} }
else else
@@ -812,7 +812,7 @@ public abstract class AEBaseGui extends GuiContainer
AppEngSlot aes = (AppEngSlot) s; AppEngSlot aes = (AppEngSlot) s;
if ( aes.getIcon() >= 0 ) if ( aes.getIcon() >= 0 )
{ {
bindTexture( "guis/states.png" ); this.bindTexture( "guis/states.png" );
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
@@ -894,10 +894,10 @@ public abstract class AEBaseGui extends GuiContainer
if ( s instanceof AppEngSlot ) if ( s instanceof AppEngSlot )
{ {
((AppEngSlot) s).isDisplay = true; ((AppEngSlot) s).isDisplay = true;
safeDrawSlot( s ); this.safeDrawSlot( s );
} }
else else
safeDrawSlot( s ); this.safeDrawSlot( s );
return; return;
} }
@@ -907,7 +907,7 @@ public abstract class AEBaseGui extends GuiContainer
} }
} }
// do the usual for non-ME Slots. // do the usual for non-ME Slots.
safeDrawSlot( s ); this.safeDrawSlot( s );
} }
} }
@@ -25,6 +25,7 @@ import java.util.Locale;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.client.me.SlotME; import appeng.client.me.SlotME;
import appeng.core.AEConfig; import appeng.core.AEConfig;
@@ -40,7 +41,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
{ {
if ( stack != null ) if ( stack != null )
{ {
Slot s = getSlot( mouseX, mouseY ); Slot s = this.getSlot( mouseX, mouseY );
if ( s instanceof SlotME ) if ( s instanceof SlotME )
{ {
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
@@ -78,7 +79,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
@Override @Override
protected void renderToolTip(ItemStack stack, int x, int y) 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 ) if ( s instanceof SlotME && stack != null )
{ {
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
@@ -105,13 +106,13 @@ public abstract class AEBaseMEGui extends AEBaseGui
if ( myStack.getCountRequestable() > 0 ) if ( myStack.getCountRequestable() > 0 )
currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); 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 ) else if ( stack.stackSize > BigNumber )
{ {
List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); 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; return;
} }
} }
@@ -22,6 +22,7 @@ import java.util.Set;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory; import cpw.mods.fml.client.IModGuiFactory;
public class AEConfigGuiFactory implements IModGuiFactory public class AEConfigGuiFactory implements IModGuiFactory
@@ -20,13 +20,13 @@ package appeng.client.gui.implementations;
import java.io.IOException; import java.io.IOException;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.input.Mouse;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.CopyMode; import appeng.api.config.CopyMode;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -54,37 +54,37 @@ public class GuiCellWorkbench extends GuiUpgradeable
public GuiCellWorkbench(InventoryPlayer inventoryPlayer, TileCellWorkbench te) { public GuiCellWorkbench(InventoryPlayer inventoryPlayer, TileCellWorkbench te) {
super( new ContainerCellWorkbench( inventoryPlayer, te ) ); super( new ContainerCellWorkbench( inventoryPlayer, te ) );
workbench = (ContainerCellWorkbench) inventorySlots; this.workbench = (ContainerCellWorkbench) this.inventorySlots;
ySize = 251; this.ySize = 251;
tcw = te; this.tcw = te;
} }
@Override @Override
protected boolean drawUpgrades() protected boolean drawUpgrades()
{ {
return workbench.availableUpgrades() > 0; return this.workbench.availableUpgrades() > 0;
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
handleButtonVisibility(); this.handleButtonVisibility();
bindTexture( getBackground() ); this.bindTexture( this.getBackground() );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
if ( drawUpgrades() ) 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, 177, 0, 35, 7 + this.workbench.availableUpgrades() * 18 );
this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (workbench.availableUpgrades()) * 18), 177, 151, 35, 7 ); 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, 177, 0, 35, 7 + 8 * 18 );
this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (8) * 18), 177, 151, 35, 7 ); 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 ); this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if ( dx == 8 ) if ( dx == 8 )
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); 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, 186, 0, 35 - 8, 7 + 8 * 18 );
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + (7 + (8) * 18), 186, 151, 35 - 8, 7 ); 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 ); this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if ( dx == 8 ) if ( dx == 8 )
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); 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 ); this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8, 7 );
} }
} }
if ( hasToolbox() ) if ( this.hasToolbox() )
this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, 161, 68, 68 ); this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 );
} }
@Override @Override
@@ -117,23 +117,23 @@ public class GuiCellWorkbench extends GuiUpgradeable
{ {
try try
{ {
if ( btn == copyMode ) if ( btn == this.copyMode )
{ {
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "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" ) ); 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" ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) );
} }
else if ( btn == fuzzyMode ) else if ( btn == this.fuzzyMode )
{ {
boolean backwards = Mouse.isButtonDown( 1 ); 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() ); fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
@@ -149,24 +149,24 @@ public class GuiCellWorkbench extends GuiUpgradeable
@Override @Override
protected void addButtons() protected void addButtons()
{ {
clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); this.clear = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE );
partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); this.partition = new GuiImgButton( this.guiLeft - 18, this.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() ); this.copyMode = new GuiToggleButton( this.guiLeft - 18, this.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.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
buttonList.add( fuzzyMode ); this.buttonList.add( this.fuzzyMode );
buttonList.add( partition ); this.buttonList.add( this.partition );
buttonList.add( clear ); this.buttonList.add( this.clear );
buttonList.add( copyMode ); this.buttonList.add( this.copyMode );
} }
@Override @Override
protected void handleButtonVisibility() protected void handleButtonVisibility()
{ {
copyMode.setState( workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE );
boolean hasFuzzy = false; boolean hasFuzzy = false;
IInventory inv = workbench.getCellUpgradeInventory(); IInventory inv = this.workbench.getCellUpgradeInventory();
for (int x = 0; x < inv.getSizeInventory(); x++) for (int x = 0; x < inv.getSizeInventory(); x++)
{ {
ItemStack is = inv.getStackInSlot( x ); ItemStack is = inv.getStackInSlot( x );
@@ -176,7 +176,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
hasFuzzy = true; hasFuzzy = true;
} }
} }
fuzzyMode.setVisibility( hasFuzzy ); this.fuzzyMode.setVisibility( hasFuzzy );
} }
@Override @Override
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton; import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerChest; import appeng.container.implementations.ContainerChest;
@@ -39,7 +40,7 @@ public class GuiChest extends AEBaseGui
{ {
super.actionPerformed( par1GuiButton ); super.actionPerformed( par1GuiButton );
if ( par1GuiButton == priority ) if ( par1GuiButton == this.priority )
{ {
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
} }
@@ -50,7 +51,7 @@ public class GuiChest extends AEBaseGui
{ {
super.initGui(); 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) { public GuiChest(InventoryPlayer inventoryPlayer, TileChest te) {
@@ -61,15 +62,15 @@ public class GuiChest extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/chest.png" ); this.bindTexture( "guis/chest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -45,7 +45,7 @@ public class GuiCondenser extends AEBaseGui
public GuiCondenser(InventoryPlayer inventoryPlayer, TileCondenser te) public GuiCondenser(InventoryPlayer inventoryPlayer, TileCondenser te)
{ {
super( new ContainerCondenser( inventoryPlayer, te ) ); super( new ContainerCondenser( inventoryPlayer, te ) );
cvc = (ContainerCondenser) inventorySlots; this.cvc = (ContainerCondenser) this.inventorySlots;
this.ySize = 197; this.ySize = 197;
} }
@@ -56,7 +56,7 @@ public class GuiCondenser extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( mode == btn ) if ( this.mode == btn )
{ {
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
} }
@@ -67,30 +67,30 @@ public class GuiCondenser extends AEBaseGui
{ {
super.initGui(); 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( this.pb );
this.buttonList.add( mode ); this.buttonList.add( this.mode );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) 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 @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
mode.set( cvc.output ); this.mode.set( this.cvc.output );
mode.fillVar = String.valueOf( cvc.output.requiredPower ); this.mode.fillVar = String.valueOf( this.cvc.output.requiredPower );
} }
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
@@ -66,55 +67,55 @@ public class GuiCraftAmount extends AEBaseGui
int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); int c = AEConfig.instance.craftItemsByStackAmounts( 2 );
int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); int d = AEConfig.instance.craftItemsByStackAmounts( 3 );
buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.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; ItemStack myIcon = null;
Object target = ((AEBaseContainer) inventorySlots).getTarget(); Object target = ((AEBaseContainer) this.inventorySlots).getTarget();
if ( target instanceof WirelessTerminalGuiObject ) if ( target instanceof WirelessTerminalGuiObject )
{ {
myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 ); myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_WIRELESS_TERM; this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
} }
if ( target instanceof PartTerminal ) if ( target instanceof PartTerminal )
{ {
myIcon = AEApi.instance().parts().partTerminal.stack( 1 ); myIcon = AEApi.instance().parts().partTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_ME; this.OriginalGui = GuiBridge.GUI_ME;
} }
if ( target instanceof PartCraftingTerminal ) if ( target instanceof PartCraftingTerminal )
{ {
myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 ); myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
} }
if ( target instanceof PartPatternTerminal ) if ( target instanceof PartPatternTerminal )
{ {
myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 ); myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL;
} }
if ( OriginalGui != null ) if ( this.OriginalGui != null )
buttonList.add( originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); 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 ); this.amountToCraft = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT, Integer.class );
amountToCraft.setEnableBackgroundDrawing( false ); this.amountToCraft.setEnableBackgroundDrawing( false );
amountToCraft.setMaxStringLength( 16 ); this.amountToCraft.setMaxStringLength( 16 );
amountToCraft.setTextColor( 0xFFFFFF ); this.amountToCraft.setTextColor( 0xFFFFFF );
amountToCraft.setVisible( true ); this.amountToCraft.setVisible( true );
amountToCraft.setFocused( true ); this.amountToCraft.setFocused( true );
amountToCraft.setText( "1" ); this.amountToCraft.setText( "1" );
} }
@Override @Override
@@ -125,12 +126,12 @@ public class GuiCraftAmount extends AEBaseGui
try 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() ) ); NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
} }
@@ -139,21 +140,21 @@ public class GuiCraftAmount extends AEBaseGui
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
// nope.. // nope..
amountToCraft.setText( "1" ); this.amountToCraft.setText( "1" );
} }
boolean isPlus = btn == plus1 || btn == plus10 || btn == plus100 || btn == plus1000; boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if ( isPlus || isMinus ) if ( isPlus || isMinus )
addQty( getQty( btn ) ); this.addQty( this.getQty( btn ) );
} }
private void addQty(int i) private void addQty(int i)
{ {
try try
{ {
String Out = amountToCraft.getText(); String Out = this.amountToCraft.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -163,7 +164,7 @@ public class GuiCraftAmount extends AEBaseGui
} }
if ( Fixed ) if ( Fixed )
amountToCraft.setText( Out ); this.amountToCraft.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -179,7 +180,7 @@ public class GuiCraftAmount extends AEBaseGui
Out = Long.toString( result ); Out = Long.toString( result );
Integer.parseInt( Out ); Integer.parseInt( Out );
amountToCraft.setText( Out ); this.amountToCraft.setText( Out );
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -194,14 +195,14 @@ public class GuiCraftAmount extends AEBaseGui
{ {
if ( key == 28 ) if ( key == 28 )
{ {
actionPerformed( next ); this.actionPerformed( this.next );
} }
if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character )) if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character ))
&& amountToCraft.textboxKeyTyped( character, key ) ) && this.amountToCraft.textboxKeyTyped( character, key ) )
{ {
try try
{ {
String Out = amountToCraft.getText(); String Out = this.amountToCraft.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -211,7 +212,7 @@ public class GuiCraftAmount extends AEBaseGui
} }
if ( Fixed ) if ( Fixed )
amountToCraft.setText( Out ); this.amountToCraft.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -219,7 +220,7 @@ public class GuiCraftAmount extends AEBaseGui
long result = Long.parseLong( Out ); long result = Long.parseLong( Out );
if ( result < 0 ) if ( result < 0 )
{ {
amountToCraft.setText( "1" ); this.amountToCraft.setText( "1" );
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
@@ -237,22 +238,22 @@ public class GuiCraftAmount extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) 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.bindTexture( "guis/craftAmt.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
try try
{ {
Long.parseLong( amountToCraft.getText() ); Long.parseLong( this.amountToCraft.getText() );
next.enabled = amountToCraft.getText().length() > 0; this.next.enabled = this.amountToCraft.getText().length() > 0;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
next.enabled = false; this.next.enabled = false;
} }
amountToCraft.drawTextBox(); this.amountToCraft.drawTextBox();
} }
protected String getBackground() protected String getBackground()
@@ -263,6 +264,6 @@ public class GuiCraftAmount extends AEBaseGui
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 );
} }
} }
@@ -26,6 +26,8 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -33,8 +35,6 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
@@ -71,33 +71,33 @@ public class GuiCraftConfirm extends AEBaseGui
boolean isAutoStart() boolean isAutoStart()
{ {
return ((ContainerCraftConfirm) inventorySlots).autoStart; return ((ContainerCraftConfirm) this.inventorySlots).autoStart;
} }
boolean isSimulation() boolean isSimulation()
{ {
return ((ContainerCraftConfirm) inventorySlots).simulation; return ((ContainerCraftConfirm) this.inventorySlots).simulation;
} }
public GuiCraftConfirm(InventoryPlayer inventoryPlayer, ITerminalHost te) { public GuiCraftConfirm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( new ContainerCraftConfirm( inventoryPlayer, te ) ); super( new ContainerCraftConfirm( inventoryPlayer, te ) );
xSize = 238; this.xSize = 238;
ySize = 206; this.ySize = 206;
myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
ccc = (ContainerCraftConfirm) this.inventorySlots; this.ccc = (ContainerCraftConfirm) this.inventorySlots;
if ( te instanceof WirelessTerminalGuiObject ) if ( te instanceof WirelessTerminalGuiObject )
OriginalGui = GuiBridge.GUI_WIRELESS_TERM; this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
if ( te instanceof PartTerminal ) if ( te instanceof PartTerminal )
OriginalGui = GuiBridge.GUI_ME; this.OriginalGui = GuiBridge.GUI_ME;
if ( te instanceof PartCraftingTerminal ) if ( te instanceof PartCraftingTerminal )
OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
if ( te instanceof PartPatternTerminal ) 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(); super.initGui();
start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + ySize - 25, 50, 20, GuiText.Start.getLocal() ); this.start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal() );
start.enabled = false; this.start.enabled = false;
buttonList.add( start ); 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 ); + GuiText.Automatic );
selectCPU.enabled = false; this.selectCPU.enabled = false;
buttonList.add( selectCPU ); this.buttonList.add( this.selectCPU );
if ( OriginalGui != null ) if ( this.OriginalGui != null )
cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); 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() private void updateCPUButtonText()
{ {
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal(); 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; btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
} }
else 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(); btnTextText = GuiText.NoCraftingCPUs.getLocal();
selectCPU.displayString = btnTextText; this.selectCPU.displayString = btnTextText;
} }
@Override @Override
@@ -152,7 +152,7 @@ public class GuiCraftConfirm extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == selectCPU ) if ( btn == this.selectCPU )
{ {
try 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 try
{ {
@@ -185,9 +185,9 @@ public class GuiCraftConfirm extends AEBaseGui
private long getTotal(IAEItemStack is) private long getTotal(IAEItemStack is)
{ {
IAEItemStack a = storage.findPrecise( is ); IAEItemStack a = this.storage.findPrecise( is );
IAEItemStack c = pending.findPrecise( is ); IAEItemStack c = this.pending.findPrecise( is );
IAEItemStack m = missing.findPrecise( is ); IAEItemStack m = this.missing.findPrecise( is );
long total = 0; long total = 0;
@@ -209,34 +209,34 @@ public class GuiCraftConfirm extends AEBaseGui
{ {
case 0: case 0:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( storage, l ); this.handleInput( this.storage, l );
break; break;
case 1: case 1:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( pending, l ); this.handleInput( this.pending, l );
break; break;
case 2: case 2:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( missing, l ); this.handleInput( this.missing, l );
break; break;
} }
for (IAEItemStack l : list) for (IAEItemStack l : list)
{ {
long amt = getTotal( l ); long amt = this.getTotal( l );
if ( amt <= 0 ) if ( amt <= 0 )
deleteVisualStack( l ); this.deleteVisualStack( l );
else else
{ {
IAEItemStack is = findVisualStack( l ); IAEItemStack is = this.findVisualStack( l );
is.setStackSize( amt ); is.setStackSize( amt );
} }
} }
setScrollBar(); this.setScrollBar();
} }
private void handleInput(IItemList<IAEItemStack> s, IAEItemStack l) private void handleInput(IItemList<IAEItemStack> s, IAEItemStack l)
@@ -263,7 +263,7 @@ public class GuiCraftConfirm extends AEBaseGui
private IAEItemStack findVisualStack(IAEItemStack l) private IAEItemStack findVisualStack(IAEItemStack l)
{ {
for (IAEItemStack o : visual) for (IAEItemStack o : this.visual)
{ {
if ( o.equals( l ) ) if ( o.equals( l ) )
{ {
@@ -272,13 +272,13 @@ public class GuiCraftConfirm extends AEBaseGui
} }
IAEItemStack stack = l.copy(); IAEItemStack stack = l.copy();
visual.add( stack ); this.visual.add( stack );
return stack; return stack;
} }
private void deleteVisualStack(IAEItemStack l) private void deleteVisualStack(IAEItemStack l)
{ {
Iterator<IAEItemStack> i = visual.iterator(); Iterator<IAEItemStack> i = this.visual.iterator();
while (i.hasNext()) while (i.hasNext())
{ {
IAEItemStack o = i.next(); IAEItemStack o = i.next();
@@ -292,10 +292,10 @@ public class GuiCraftConfirm extends AEBaseGui
private void setScrollBar() private void setScrollBar()
{ {
int size = visual.size(); int size = this.visual.size();
myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 ); this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 );
myScrollBar.setRange( 0, (size + 2) / 3 - rows, 1 ); this.myScrollBar.setRange( 0, (size + 2) / 3 - this.rows, 1 );
} }
@Override @Override
@@ -305,7 +305,7 @@ public class GuiCraftConfirm extends AEBaseGui
{ {
if ( key == 28 ) if ( key == 28 )
{ {
actionPerformed( start ); this.actionPerformed( this.start );
} }
super.keyTyped( character, key ); super.keyTyped( character, key );
} }
@@ -314,9 +314,9 @@ public class GuiCraftConfirm extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
setScrollBar(); this.setScrollBar();
bindTexture( "guis/craftingreport.png" ); this.bindTexture( "guis/craftingreport.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
int tooltip = -1; int tooltip = -1;
@@ -324,19 +324,19 @@ public class GuiCraftConfirm extends AEBaseGui
@Override @Override
public void drawScreen(int mouse_x, int mouse_y, float btn) public void drawScreen(int mouse_x, int mouse_y, float btn)
{ {
updateCPUButtonText(); this.updateCPUButtonText();
start.enabled = !(ccc.noCPU || isSimulation()); this.start.enabled = !(this.ccc.noCPU || this.isSimulation());
selectCPU.enabled = !isSimulation(); this.selectCPU.enabled = !this.isSimulation();
int x = 0; int x = 0;
int y = 0; int y = 0;
int gx = (width - xSize) / 2; int gx = (this.width - this.xSize) / 2;
int gy = (height - ySize) / 2; int gy = (this.height - this.ySize) / 2;
int offY = 23; int offY = 23;
tooltip = -1; this.tooltip = -1;
for (int z = 0; z <= 4 * 5; z++) 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 ) if ( minY < mouse_y && minY + offY - 2 > mouse_y )
{ {
tooltip = z; this.tooltip = z;
break; break;
} }
@@ -368,21 +368,21 @@ public class GuiCraftConfirm extends AEBaseGui
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 byteUsed = NumberFormat.getInstance().format( BytesUsed );
String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal()) : GuiText.CalculatingWait.getLocal(); 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; String dsp = null;
if ( isSimulation() ) if ( this.isSimulation() )
dsp = GuiText.Simulation.getLocal(); dsp = GuiText.Simulation.getLocal();
else 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"; : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
int offset = (219 - fontRendererObj.getStringWidth( dsp )) / 2; int offset = (219 - this.fontRendererObj.getStringWidth( dsp )) / 2;
fontRendererObj.drawString( dsp, offset, 165, 4210752 ); this.fontRendererObj.drawString( dsp, offset, 165, 4210752 );
int sectionLength = 67; int sectionLength = 67;
@@ -390,8 +390,8 @@ public class GuiCraftConfirm extends AEBaseGui
int y = 0; int y = 0;
int xo = 9; int xo = 9;
int yo = 22; int yo = 22;
int viewStart = myScrollBar.getCurrentScroll() * 3; int viewStart = this.myScrollBar.getCurrentScroll() * 3;
int viewEnd = viewStart + 3 * rows; int viewEnd = viewStart + 3 * this.rows;
String dspToolTip = ""; String dspToolTip = "";
List<String> lineList = new LinkedList<String>(); List<String> lineList = new LinkedList<String>();
@@ -400,17 +400,17 @@ public class GuiCraftConfirm extends AEBaseGui
int offY = 23; 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 ) if ( refStack != null )
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 ); GL11.glScaled( 0.5, 0.5, 0.5 );
IAEItemStack stored = storage.findPrecise( refStack ); IAEItemStack stored = this.storage.findPrecise( refStack );
IAEItemStack pendingStack = pending.findPrecise( refStack ); IAEItemStack pendingStack = this.pending.findPrecise( refStack );
IAEItemStack missingStack = missing.findPrecise( refStack ); IAEItemStack missingStack = this.missing.findPrecise( refStack );
int lines = 0; int lines = 0;
@@ -434,11 +434,11 @@ public class GuiCraftConfirm extends AEBaseGui
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm'; str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
str = GuiText.FromStorage.getLocal() + ": " + str; str = GuiText.FromStorage.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
downY += 5; downY += 5;
@@ -453,11 +453,11 @@ public class GuiCraftConfirm extends AEBaseGui
str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm'; str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm';
str = GuiText.Missing.getLocal() + ": " + str; str = GuiText.Missing.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) ); lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) );
red = true; red = true;
@@ -473,11 +473,11 @@ public class GuiCraftConfirm extends AEBaseGui
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm'; str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
str = GuiText.ToCraft.getLocal() + ": " + str; str = GuiText.ToCraft.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
} }
@@ -488,7 +488,7 @@ public class GuiCraftConfirm extends AEBaseGui
ItemStack is = refStack.copy().getItemStack(); ItemStack is = refStack.copy().getItemStack();
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
{ {
dspToolTip = Platform.getItemDisplayName( is ); dspToolTip = Platform.getItemDisplayName( is );
@@ -499,7 +499,7 @@ public class GuiCraftConfirm extends AEBaseGui
toolPosY = y * offY + yo; toolPosY = y * offY + yo;
} }
drawItem( posX, posY, is ); this.drawItem( posX, posY, is );
if ( red ) 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 ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
GL11.glPopAttrib(); GL11.glPopAttrib();
} }
@@ -25,14 +25,14 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.SortDir; import appeng.api.config.SortDir;
import appeng.api.config.SortOrder; import appeng.api.config.SortOrder;
@@ -62,17 +62,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
public void clearItems() public void clearItems()
{ {
storage = AEApi.instance().storage().createItemList(); this.storage = AEApi.instance().storage().createItemList();
active = AEApi.instance().storage().createItemList(); this.active = AEApi.instance().storage().createItemList();
pending = AEApi.instance().storage().createItemList(); this.pending = AEApi.instance().storage().createItemList();
visual = new ArrayList<IAEItemStack>(); this.visual = new ArrayList<IAEItemStack>();
} }
protected GuiCraftingCPU(ContainerCraftingCPU container) { protected GuiCraftingCPU(ContainerCraftingCPU container) {
super( container ); super( container );
this.ySize = 184; this.ySize = 184;
this.xSize = 238; this.xSize = 238;
myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
} }
public GuiCraftingCPU(InventoryPlayer inventoryPlayer, Object te) { public GuiCraftingCPU(InventoryPlayer inventoryPlayer, Object te) {
@@ -86,7 +86,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{ {
super.actionPerformed( btn ); super.actionPerformed( btn );
if ( cancel == btn ) if ( this.cancel == btn )
{ {
try try
{ {
@@ -103,16 +103,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
public void initGui() public void initGui()
{ {
super.initGui(); super.initGui();
setScrollBar(); this.setScrollBar();
cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); this.cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
buttonList.add( cancel ); this.buttonList.add( this.cancel );
} }
private long getTotal(IAEItemStack is) private long getTotal(IAEItemStack is)
{ {
IAEItemStack a = storage.findPrecise( is ); IAEItemStack a = this.storage.findPrecise( is );
IAEItemStack b = active.findPrecise( is ); IAEItemStack b = this.active.findPrecise( is );
IAEItemStack c = pending.findPrecise( is ); IAEItemStack c = this.pending.findPrecise( is );
long total = 0; long total = 0;
@@ -134,34 +134,34 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{ {
case 0: case 0:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( storage, l ); this.handleInput( this.storage, l );
break; break;
case 1: case 1:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( active, l ); this.handleInput( this.active, l );
break; break;
case 2: case 2:
for (IAEItemStack l : list) for (IAEItemStack l : list)
handleInput( pending, l ); this.handleInput( this.pending, l );
break; break;
} }
for (IAEItemStack l : list) for (IAEItemStack l : list)
{ {
long amt = getTotal( l ); long amt = this.getTotal( l );
if ( amt <= 0 ) if ( amt <= 0 )
deleteVisualStack( l ); this.deleteVisualStack( l );
else else
{ {
IAEItemStack is = findVisualStack( l ); IAEItemStack is = this.findVisualStack( l );
is.setStackSize( amt ); is.setStackSize( amt );
} }
} }
setScrollBar(); this.setScrollBar();
} }
private void handleInput(IItemList<IAEItemStack> s, IAEItemStack l) private void handleInput(IItemList<IAEItemStack> s, IAEItemStack l)
@@ -188,7 +188,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private IAEItemStack findVisualStack(IAEItemStack l) private IAEItemStack findVisualStack(IAEItemStack l)
{ {
for (IAEItemStack o : visual) for (IAEItemStack o : this.visual)
{ {
if ( o.equals( l ) ) if ( o.equals( l ) )
{ {
@@ -197,13 +197,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
} }
IAEItemStack stack = l.copy(); IAEItemStack stack = l.copy();
visual.add( stack ); this.visual.add( stack );
return stack; return stack;
} }
private void deleteVisualStack(IAEItemStack l) private void deleteVisualStack(IAEItemStack l)
{ {
Iterator<IAEItemStack> i = visual.iterator(); Iterator<IAEItemStack> i = this.visual.iterator();
while (i.hasNext()) while (i.hasNext())
{ {
IAEItemStack o = i.next(); IAEItemStack o = i.next();
@@ -217,17 +217,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private void setScrollBar() private void setScrollBar()
{ {
int size = visual.size(); int size = this.visual.size();
myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 ); this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 );
myScrollBar.setRange( 0, (size + 2) / 3 - rows, 1 ); this.myScrollBar.setRange( 0, (size + 2) / 3 - this.rows, 1 );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/craftingcpu.png" ); this.bindTexture( "guis/craftingcpu.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
int tooltip = -1; int tooltip = -1;
@@ -235,16 +235,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
@Override @Override
public void drawScreen(int mouse_x, int mouse_y, float btn) 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 x = 0;
int y = 0; int y = 0;
int gx = (width - xSize) / 2; int gx = (this.width - this.xSize) / 2;
int gy = (height - ySize) / 2; int gy = (this.height - this.ySize) / 2;
int offY = 23; int offY = 23;
tooltip = -1; this.tooltip = -1;
for (int z = 0; z <= 4 * 5; z++) 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 ) if ( minY < mouse_y && minY + offY - 2 > mouse_y )
{ {
tooltip = z; this.tooltip = z;
break; break;
} }
@@ -276,7 +276,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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; int sectionLength = 67;
@@ -284,7 +284,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int y = 0; int y = 0;
int xo = 9; int xo = 9;
int yo = 22; int yo = 22;
int viewStart = myScrollBar.getCurrentScroll() * 3; int viewStart = this.myScrollBar.getCurrentScroll() * 3;
int viewEnd = viewStart + 3 * 6; int viewEnd = viewStart + 3 * 6;
String dspToolTip = ""; String dspToolTip = "";
@@ -294,17 +294,17 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int offY = 23; 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 ) if ( refStack != null )
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 ); GL11.glScaled( 0.5, 0.5, 0.5 );
IAEItemStack stored = storage.findPrecise( refStack ); IAEItemStack stored = this.storage.findPrecise( refStack );
IAEItemStack activeStack = active.findPrecise( refStack ); IAEItemStack activeStack = this.active.findPrecise( refStack );
IAEItemStack pendingStack = pending.findPrecise( refStack ); IAEItemStack pendingStack = this.pending.findPrecise( refStack );
int lines = 0; int lines = 0;
@@ -327,11 +327,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm'; str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
str = GuiText.Stored.getLocal() + ": " + str; str = GuiText.Stored.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
downY += 5; downY += 5;
@@ -346,11 +346,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm'; str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm';
str = GuiText.Crafting.getLocal() + ": " + str; str = GuiText.Crafting.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) ); lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) );
downY += 5; downY += 5;
@@ -365,11 +365,11 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm'; str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
str = GuiText.Scheduled.getLocal() + ": " + str; str = GuiText.Scheduled.getLocal() + ": " + str;
int w = 4 + fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo this.fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo
+ 6 - negY + downY) * 2, 4210752 ); + 6 - negY + downY) * 2, 4210752 );
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); 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(); ItemStack is = refStack.copy().getItemStack();
if ( tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
{ {
dspToolTip = Platform.getItemDisplayName( is ); dspToolTip = Platform.getItemDisplayName( is );
@@ -391,7 +391,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
toolPosY = y * offY + yo; toolPosY = y * offY + yo;
} }
drawItem( posX, posY, is ); this.drawItem( posX, posY, is );
x++; 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 ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip ); this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
GL11.glPopAttrib(); GL11.glPopAttrib();
} }
@@ -23,12 +23,12 @@ package appeng.client.gui.implementations;
import java.io.IOException; import java.io.IOException;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.input.Mouse;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.client.gui.widgets.GuiTabButton; import appeng.client.gui.widgets.GuiTabButton;
@@ -57,31 +57,31 @@ public class GuiCraftingStatus extends GuiCraftingCPU
public GuiCraftingStatus(InventoryPlayer inventoryPlayer, ITerminalHost te) { public GuiCraftingStatus(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( new ContainerCraftingStatus( inventoryPlayer, te ) ); super( new ContainerCraftingStatus( inventoryPlayer, te ) );
ccc = (ContainerCraftingStatus) inventorySlots; this.ccc = (ContainerCraftingStatus) this.inventorySlots;
Object target = ccc.getTarget(); Object target = this.ccc.getTarget();
if ( target instanceof WirelessTerminalGuiObject ) if ( target instanceof WirelessTerminalGuiObject )
{ {
myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 ); this.myIcon = AEApi.instance().items().itemWirelessTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_WIRELESS_TERM; this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
} }
if ( target instanceof PartTerminal ) if ( target instanceof PartTerminal )
{ {
myIcon = AEApi.instance().parts().partTerminal.stack( 1 ); this.myIcon = AEApi.instance().parts().partTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_ME; this.OriginalGui = GuiBridge.GUI_ME;
} }
if ( target instanceof PartCraftingTerminal ) if ( target instanceof PartCraftingTerminal )
{ {
myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 ); this.myIcon = AEApi.instance().parts().partCraftingTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
} }
if ( target instanceof PartPatternTerminal ) if ( target instanceof PartPatternTerminal )
{ {
myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 ); this.myIcon = AEApi.instance().parts().partPatternTerminal.stack( 1 );
OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL;
} }
} }
@@ -92,7 +92,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == selectCPU ) if ( btn == this.selectCPU )
{ {
try 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(); 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; // 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 ) ); this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), itemRender ) );
originalGuiBtn.hideEdge = 13; this.originalGuiBtn.hideEdge = 13;
} }
} }
@@ -136,27 +136,27 @@ public class GuiCraftingStatus extends GuiCraftingCPU
{ {
String btnTextText = GuiText.NoCraftingJobs.getLocal(); 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; btnTextText = GuiText.CPUs.getLocal() + ": " + name;
} }
else 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(); btnTextText = GuiText.NoCraftingJobs.getLocal();
selectCPU.displayString = btnTextText; this.selectCPU.displayString = btnTextText;
} }
@Override @Override
public void drawScreen(int mouse_x, int mouse_y, float btn) public void drawScreen(int mouse_x, int mouse_y, float btn)
{ {
updateCPUButtonText(); this.updateCPUButtonText();
super.drawScreen( mouse_x, mouse_y, btn ); super.drawScreen( mouse_x, mouse_y, btn );
} }
} }
@@ -22,6 +22,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
@@ -42,8 +43,8 @@ public class GuiCraftingTerm extends GuiMEMonitorable
public void initGui() public void initGui()
{ {
super.initGui(); super.initGui();
buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) ); this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
clearBtn.halfSize = true; this.clearBtn.halfSize = true;
} }
@Override @Override
@@ -51,10 +52,10 @@ public class GuiCraftingTerm extends GuiMEMonitorable
{ {
super.actionPerformed( btn ); super.actionPerformed( btn );
if ( clearBtn == btn ) if ( this.clearBtn == btn )
{ {
Slot s = null; Slot s = null;
Container c = inventorySlots; Container c = this.inventorySlots;
for (Object j : c.inventorySlots) for (Object j : c.inventorySlots)
{ {
if ( j instanceof SlotCraftingMatrix ) if ( j instanceof SlotCraftingMatrix )
@@ -72,7 +73,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
public GuiCraftingTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) { public GuiCraftingTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) ); super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) );
reservedSpace = 73; this.reservedSpace = 73;
} }
@Override @Override
@@ -85,7 +86,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
super.drawFG( offsetX, offsetY, mouseX, 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 );
} }
} }
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton; import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerDrive; import appeng.container.implementations.ContainerDrive;
@@ -39,7 +40,7 @@ public class GuiDrive extends AEBaseGui
{ {
super.actionPerformed( par1GuiButton ); super.actionPerformed( par1GuiButton );
if ( par1GuiButton == priority ) if ( par1GuiButton == this.priority )
{ {
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
} }
@@ -50,7 +51,7 @@ public class GuiDrive extends AEBaseGui
{ {
super.initGui(); 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) { public GuiDrive(InventoryPlayer inventoryPlayer, TileDrive te) {
@@ -61,15 +62,15 @@ public class GuiDrive extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/drive.png" ); this.bindTexture( "guis/drive.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -44,21 +45,21 @@ public class GuiFormationPlane extends GuiUpgradeable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if ( fuzzyMode != null ) if ( this.fuzzyMode != null )
fuzzyMode.set( cvb.fzMode ); this.fuzzyMode.set( this.cvb.fzMode );
} }
@Override @Override
protected void addButtons() 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 @Override
@@ -66,7 +67,7 @@ public class GuiFormationPlane extends GuiUpgradeable
{ {
super.actionPerformed( btn ); super.actionPerformed( btn );
if ( btn == priority ) if ( btn == this.priority )
{ {
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
} }
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerGrinder; import appeng.container.implementations.ContainerGrinder;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
@@ -35,15 +36,15 @@ public class GuiGrinder extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/grinder.png" ); this.bindTexture( "guis/grinder.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -18,11 +18,11 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.FullnessMode; import appeng.api.config.FullnessMode;
import appeng.api.config.OperationMode; import appeng.api.config.OperationMode;
@@ -57,29 +57,29 @@ public class GuiIOPort extends GuiUpgradeable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if ( redstoneMode != null ) if ( this.redstoneMode != null )
redstoneMode.set( cvb.rsMode ); this.redstoneMode.set( this.cvb.rsMode );
if ( operationMode != null ) if ( this.operationMode != null )
operationMode.set( ((ContainerIOPort) cvb).opMode ); this.operationMode.set( ((ContainerIOPort) this.cvb).opMode );
if ( fullMode != null ) if ( this.fullMode != null )
fullMode.set( ((ContainerIOPort) cvb).fMode ); this.fullMode.set( ((ContainerIOPort) this.cvb).fMode );
} }
@Override @Override
protected void addButtons() protected void addButtons()
{ {
redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
fullMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY ); this.fullMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY );
operationMode = new GuiImgButton( this.guiLeft + 80, guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY ); this.operationMode = new GuiImgButton( this.guiLeft + 80, this.guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY );
buttonList.add( operationMode ); this.buttonList.add( this.operationMode );
buttonList.add( redstoneMode ); this.buttonList.add( this.redstoneMode );
buttonList.add( fullMode ); this.buttonList.add( this.fullMode );
} }
@Override @Override
@@ -89,11 +89,11 @@ public class GuiIOPort extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == fullMode ) if ( btn == this.fullMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( fullMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
if ( btn == operationMode ) if ( btn == this.operationMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( operationMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
} }
@Override @Override
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiProgressBar; import appeng.client.gui.widgets.GuiProgressBar;
import appeng.client.gui.widgets.GuiProgressBar.Direction; import appeng.client.gui.widgets.GuiProgressBar.Direction;
@@ -36,9 +37,9 @@ public class GuiInscriber extends AEBaseGui
public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te) public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te)
{ {
super( new ContainerInscriber( inventoryPlayer, te ) ); super( new ContainerInscriber( inventoryPlayer, te ) );
cvc = (ContainerInscriber) inventorySlots; this.cvc = (ContainerInscriber) this.inventorySlots;
this.ySize = 176; this.ySize = 176;
this.xSize = hasToolbox() ? 246 : 211; this.xSize = this.hasToolbox() ? 246 : 211;
} }
@Override @Override
@@ -46,32 +47,32 @@ public class GuiInscriber extends AEBaseGui
{ {
super.initGui(); super.initGui();
pb = new GuiProgressBar( cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL ); this.pb = new GuiProgressBar( this.cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL );
this.buttonList.add( pb ); this.buttonList.add( this.pb );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/inscriber.png" ); this.bindTexture( "guis/inscriber.png" );
pb.xPosition = 135 + guiLeft; this.pb.xPosition = 135 + this.guiLeft;
pb.yPosition = 39 + guiTop; 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() ) if ( this.drawUpgrades() )
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + cvc.availableUpgrades() * 18 ); this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18 );
if ( hasToolbox() ) if ( this.hasToolbox() )
this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, ySize - 90, 68, 68 ); this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
protected boolean drawUpgrades() protected boolean drawUpgrades()
@@ -81,7 +82,7 @@ public class GuiInscriber extends AEBaseGui
protected boolean hasToolbox() protected boolean hasToolbox()
{ {
return ((ContainerUpgradeable) inventorySlots).hasToolbox(); return ((ContainerUpgradeable) this.inventorySlots).hasToolbox();
} }
} }
@@ -18,11 +18,11 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -55,30 +55,30 @@ public class GuiInterface extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == priority ) if ( btn == this.priority )
{ {
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_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 ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
if ( btn == BlockMode ) if ( btn == this.BlockMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( BlockMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
} }
@Override @Override
protected void addButtons() protected void addButtons()
{ {
priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ); this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender );
buttonList.add( priority ); this.buttonList.add( this.priority );
BlockMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.BLOCK, YesNo.NO ); this.BlockMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO );
buttonList.add( BlockMode ); 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() ); GuiText.InterfaceTerminalHint.getLocal() );
buttonList.add( interfaceMode ); this.buttonList.add( this.interfaceMode );
} }
@Override @Override
@@ -90,18 +90,18 @@ public class GuiInterface extends GuiUpgradeable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
if ( BlockMode != null ) if ( this.BlockMode != null )
BlockMode.set( ((ContainerInterface) cvb).bMode ); this.BlockMode.set( ((ContainerInterface) this.cvb).bMode );
if ( interfaceMode != null ) if ( this.interfaceMode != null )
interfaceMode.setState( ((ContainerInterface) cvb).iTermMode == YesNo.YES ); 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 ); this.fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 );
fontRendererObj.drawString( GuiText.StoredItems.getLocal(), 18, 6 + 60 + 7, 4210752 ); this.fontRendererObj.drawString( GuiText.StoredItems.getLocal(), 18, 6 + 60 + 7, 4210752 );
fontRendererObj.drawString( GuiText.Patterns.getLocal(), 8, 6 + 73 + 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 );
} }
} }
@@ -28,6 +28,8 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import com.google.common.collect.HashMultimap;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
@@ -35,8 +37,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import com.google.common.collect.HashMultimap;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.GuiScrollbar;
@@ -79,24 +79,24 @@ public class GuiInterfaceTerminal extends AEBaseGui
{ {
super.initGui(); super.initGui();
myScrollBar.setLeft( 175 ); this.myScrollBar.setLeft( 175 );
myScrollBar.setHeight( 106 ); this.myScrollBar.setHeight( 106 );
myScrollBar.setTop( 18 ); this.myScrollBar.setTop( 18 );
searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 104, offsetX ), this.guiTop + 4, 65, 12 ); this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
searchField.setEnableBackgroundDrawing( false ); this.searchField.setEnableBackgroundDrawing( false );
searchField.setMaxStringLength( 25 ); this.searchField.setMaxStringLength( 25 );
searchField.setTextColor( 0xFFFFFF ); this.searchField.setTextColor( 0xFFFFFF );
searchField.setVisible( true ); this.searchField.setVisible( true );
searchField.setFocused( true ); this.searchField.setFocused( true );
} }
@Override @Override
protected void mouseClicked(int xCoord, int yCoord, int btn) 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.searchField.setText( "" );
this.refreshList(); this.refreshList();
@@ -113,9 +113,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
if ( character == ' ' && this.searchField.getText().length() == 0 ) if ( character == ' ' && this.searchField.getText().length() == 0 )
return; return;
if ( searchField.textboxKeyTyped( character, key ) ) if ( this.searchField.textboxKeyTyped( character, key ) )
{ {
refreshList(); this.refreshList();
} }
else else
{ {
@@ -127,15 +127,15 @@ public class GuiInterfaceTerminal extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/interfaceterminal.png" ); this.bindTexture( "guis/interfaceterminal.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
int offset = 17; 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 ) if ( lineObj instanceof ClientDCInternalInv )
{ {
ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
@@ -147,48 +147,48 @@ public class GuiInterfaceTerminal extends AEBaseGui
offset += 18; offset += 18;
} }
if ( searchField != null ) if ( this.searchField != null )
searchField.drawTextBox(); this.searchField.drawTextBox();
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
int offset = 17; int offset = 17;
int ex = myScrollBar.getCurrentScroll(); int ex = this.myScrollBar.getCurrentScroll();
Iterator<Object> o = inventorySlots.inventorySlots.iterator(); Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
while (o.hasNext()) while (o.hasNext())
{ {
if ( o.next() instanceof SlotDisconnected ) if ( o.next() instanceof SlotDisconnected )
o.remove(); 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 ) if ( lineObj instanceof ClientDCInternalInv )
{ {
ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
for (int z = 0; z < inv.inv.getSizeInventory(); z++) 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 ) else if ( lineObj instanceof String )
{ {
String name = (String) lineObj; String name = (String) lineObj;
int rows = byName.get( name ).size(); int rows = this.byName.get( name ).size();
if ( rows > 1 ) if ( rows > 1 )
name = name + " (" + rows + ')'; 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 ); name = name.substring( 0, name.length() - 1 );
fontRendererObj.drawString( name, 10, 6 + offset, 4210752 ); this.fontRendererObj.drawString( name, 10, 6 + offset, 4210752 );
} }
offset += 18; offset += 18;
} }
@@ -198,8 +198,8 @@ public class GuiInterfaceTerminal extends AEBaseGui
{ {
if ( in.getBoolean( "clear" ) ) if ( in.getBoolean( "clear" ) )
{ {
byId.clear(); this.byId.clear();
refreshList = true; this.refreshList = true;
} }
for (Object oKey : in.func_150296_c()) 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 ); long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX );
NBTTagCompound invData = in.getCompoundTag( key ); 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++) 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 // invalid caches on refresh
cachedSearches.clear(); this.cachedSearches.clear();
refreshList(); this.refreshList();
} }
} }
@@ -242,14 +242,14 @@ public class GuiInterfaceTerminal extends AEBaseGui
*/ */
private void refreshList() private void refreshList()
{ {
byName.clear(); this.byName.clear();
final String searchFilterLowerCase = searchField.getText().toLowerCase(); final String searchFilterLowerCase = this.searchField.getText().toLowerCase();
final Set<Object> cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase ); final Set<Object> cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase );
final boolean rebuild = cachedSearch.isEmpty(); 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. // ignore inventory if not doing a full rebuild or cache already marks it as miss.
if ( !rebuild && !cachedSearch.contains( entry ) ) if ( !rebuild && !cachedSearch.contains( entry ) )
@@ -265,7 +265,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
{ {
for (ItemStack itemStack : entry.inv) for (ItemStack itemStack : entry.inv)
{ {
found = itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase ); found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase );
if ( found ) if ( found )
{ {
break; 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, filter skipped or machine name matching the search term, add it
if ( found || entry.getName().toLowerCase().contains( searchFilterLowerCase ) ) if ( found || entry.getName().toLowerCase().contains( searchFilterLowerCase ) )
{ {
byName.put( entry.getName(), entry ); this.byName.put( entry.getName(), entry );
cachedSearch.add( entry ); cachedSearch.add( entry );
} }
else else
@@ -285,26 +285,26 @@ public class GuiInterfaceTerminal extends AEBaseGui
} }
} }
names.clear(); this.names.clear();
names.addAll( byName.keySet() ); this.names.addAll( this.byName.keySet() );
Collections.sort( names ); Collections.sort( this.names );
lines.clear(); this.lines.clear();
lines.ensureCapacity( getMaxRows() ); this.lines.ensureCapacity( this.getMaxRows() );
for (String n : names) for (String n : this.names)
{ {
lines.add( n ); this.lines.add( n );
ArrayList<ClientDCInternalInv> clientInventories = new ArrayList<ClientDCInternalInv>(); ArrayList<ClientDCInternalInv> clientInventories = new ArrayList<ClientDCInternalInv>();
clientInventories.addAll( byName.get( n ) ); clientInventories.addAll( this.byName.get( n ) );
Collections.sort( clientInventories ); 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) private boolean itemStackMatchesSearchTerm(ItemStack itemStack, String searchTerm)
@@ -354,16 +354,16 @@ public class GuiInterfaceTerminal extends AEBaseGui
*/ */
private Set<Object> getCacheForSearchTerm(String searchTerm) private Set<Object> getCacheForSearchTerm(String searchTerm)
{ {
if ( !cachedSearches.containsKey( searchTerm ) ) if ( !this.cachedSearches.containsKey( searchTerm ) )
{ {
cachedSearches.put( searchTerm, new HashSet<Object>() ); this.cachedSearches.put( searchTerm, new HashSet<Object>() );
} }
Set<Object> cache = cachedSearches.get( searchTerm ); Set<Object> cache = this.cachedSearches.get( searchTerm );
if ( cache.isEmpty() && searchTerm.length() > 1 ) 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; return cache;
} }
@@ -377,17 +377,17 @@ public class GuiInterfaceTerminal extends AEBaseGui
*/ */
private int getMaxRows() private int getMaxRows()
{ {
return names.size() + byId.size(); return this.names.size() + this.byId.size();
} }
private ClientDCInternalInv getById(long id, long sortBy, String string) private ClientDCInternalInv getById(long id, long sortBy, String string)
{ {
ClientDCInternalInv o = byId.get( id ); ClientDCInternalInv o = this.byId.get( id );
if ( o == null ) if ( o == null )
{ {
byId.put( id, o = new ClientDCInternalInv( 9, id, sortBy, string ) ); this.byId.put( id, o = new ClientDCInternalInv( 9, id, sortBy, string ) );
refreshList = true; this.refreshList = true;
} }
return o; return o;
@@ -20,11 +20,11 @@ package appeng.client.gui.implementations;
import java.io.IOException; import java.io.IOException;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.LevelType; import appeng.api.config.LevelType;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
@@ -62,42 +62,42 @@ public class GuiLevelEmitter extends GuiUpgradeable
{ {
super.initGui(); super.initGui();
level = new GuiNumberBox( fontRendererObj, this.guiLeft + 24, this.guiTop + 43, 79, fontRendererObj.FONT_HEIGHT, Long.class ); this.level = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 24, this.guiTop + 43, 79, this.fontRendererObj.FONT_HEIGHT, Long.class );
level.setEnableBackgroundDrawing( false ); this.level.setEnableBackgroundDrawing( false );
level.setMaxStringLength( 16 ); this.level.setMaxStringLength( 16 );
level.setTextColor( 0xFFFFFF ); this.level.setTextColor( 0xFFFFFF );
level.setVisible( true ); this.level.setVisible( true );
level.setFocused( true ); this.level.setFocused( true );
((ContainerLevelEmitter) inventorySlots).setTextField( level ); ((ContainerLevelEmitter) this.inventorySlots).setTextField( this.level );
} }
@Override @Override
protected void addButtons() protected void addButtons()
{ {
levelMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL ); this.levelMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL );
redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL ); this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL );
fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
craftingMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
int a = AEConfig.instance.levelByStackAmounts( 0 ); int a = AEConfig.instance.levelByStackAmounts( 0 );
int b = AEConfig.instance.levelByStackAmounts( 1 ); int b = AEConfig.instance.levelByStackAmounts( 1 );
int c = AEConfig.instance.levelByStackAmounts( 2 ); int c = AEConfig.instance.levelByStackAmounts( 2 );
int d = AEConfig.instance.levelByStackAmounts( 3 ); int d = AEConfig.instance.levelByStackAmounts( 3 );
buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) );
buttonList.add( levelMode ); this.buttonList.add( this.levelMode );
buttonList.add( redstoneMode ); this.buttonList.add( this.redstoneMode );
buttonList.add( fuzzyMode ); this.buttonList.add( this.fuzzyMode );
buttonList.add( craftingMode ); this.buttonList.add( this.craftingMode );
} }
@Override @Override
@@ -107,24 +107,24 @@ public class GuiLevelEmitter extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == craftingMode ) if ( btn == this.craftingMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( craftingMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
if ( btn == levelMode ) if ( btn == this.levelMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( levelMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
boolean isPlus = btn == plus1 || btn == plus10 || btn == plus100 || btn == plus1000; boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if ( isPlus || isMinus ) if ( isPlus || isMinus )
addQty( getQty( btn ) ); this.addQty( this.getQty( btn ) );
} }
private void addQty(long i) private void addQty(long i)
{ {
try try
{ {
String Out = level.getText(); String Out = this.level.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -134,7 +134,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
} }
if ( Fixed ) if ( Fixed )
level.setText( Out ); this.level.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -144,14 +144,14 @@ public class GuiLevelEmitter extends GuiUpgradeable
if ( result < 0 ) if ( result < 0 )
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 ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
// nope.. // nope..
level.setText( "0" ); this.level.setText( "0" );
} }
catch (IOException e) catch (IOException e)
{ {
@@ -162,8 +162,8 @@ public class GuiLevelEmitter extends GuiUpgradeable
@Override @Override
protected void handleButtonVisibility() protected void handleButtonVisibility()
{ {
craftingMode.setVisibility( bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); this.craftingMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 );
fuzzyMode.setVisibility( bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); this.fuzzyMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 );
} }
@Override @Override
@@ -171,11 +171,11 @@ public class GuiLevelEmitter extends GuiUpgradeable
{ {
if ( !this.checkHotbarKeys( key ) ) 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 try
{ {
String Out = level.getText(); String Out = this.level.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -185,7 +185,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
} }
if ( Fixed ) if ( Fixed )
level.setText( Out ); this.level.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -207,35 +207,35 @@ public class GuiLevelEmitter extends GuiUpgradeable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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... // configure enabled status...
level.setEnabled( notCraftingMode ); this.level.setEnabled( notCraftingMode );
plus1.enabled = notCraftingMode; this.plus1.enabled = notCraftingMode;
plus10.enabled = notCraftingMode; this.plus10.enabled = notCraftingMode;
plus100.enabled = notCraftingMode; this.plus100.enabled = notCraftingMode;
plus1000.enabled = notCraftingMode; this.plus1000.enabled = notCraftingMode;
minus1.enabled = notCraftingMode; this.minus1.enabled = notCraftingMode;
minus10.enabled = notCraftingMode; this.minus10.enabled = notCraftingMode;
minus100.enabled = notCraftingMode; this.minus100.enabled = notCraftingMode;
minus1000.enabled = notCraftingMode; this.minus1000.enabled = notCraftingMode;
levelMode.enabled = notCraftingMode; this.levelMode.enabled = notCraftingMode;
redstoneMode.enabled = notCraftingMode; this.redstoneMode.enabled = notCraftingMode;
super.drawFG( offsetX, offsetY, mouseX, mouseY ); super.drawFG( offsetX, offsetY, mouseX, mouseY );
if ( craftingMode != null ) if ( this.craftingMode != null )
craftingMode.set( ((ContainerLevelEmitter) cvb).cmType ); this.craftingMode.set( ((ContainerLevelEmitter) this.cvb).cmType );
if ( levelMode != null ) if ( this.levelMode != null )
levelMode.set( ((ContainerLevelEmitter) cvb).lvType ); this.levelMode.set( ((ContainerLevelEmitter) this.cvb).lvType );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
super.drawBG( offsetX, offsetY, mouseX, mouseY ); super.drawBG( offsetX, offsetY, mouseX, mouseY );
level.drawTextBox(); this.level.drawTextBox();
} }
@Override @Override
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -39,30 +40,30 @@ public class GuiMAC extends GuiUpgradeable
{ {
super.initGui(); super.initGui();
pb = new GuiProgressBar( container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL ); this.pb = new GuiProgressBar( this.container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
this.buttonList.add( pb ); this.buttonList.add( this.pb );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
pb.xPosition = 148 + guiLeft; this.pb.xPosition = 148 + this.guiLeft;
pb.yPosition = 48 + guiTop; this.pb.yPosition = 48 + this.guiTop;
super.drawBG( offsetX, offsetY, mouseX, mouseY ); super.drawBG( offsetX, offsetY, mouseX, mouseY );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 ); super.drawFG( offsetX, offsetY, mouseX, mouseY );
} }
@Override @Override
protected void addButtons() protected void addButtons()
{ {
redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
buttonList.add( redstoneMode ); this.buttonList.add( this.redstoneMode );
} }
@Override @Override
@@ -21,13 +21,13 @@ package appeng.client.gui.implementations;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.input.Mouse;
import appeng.api.config.SearchBoxMode; import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.TerminalStyle; import appeng.api.config.TerminalStyle;
@@ -110,47 +110,47 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c) { public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c) {
super( c ); super( c );
myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
repo = new ItemRepo( myScrollBar, this ); this.repo = new ItemRepo( this.myScrollBar, this );
xSize = 185; this.xSize = 185;
ySize = 204; this.ySize = 204;
if ( te instanceof IViewCellStorage ) if ( te instanceof IViewCellStorage )
xSize += 33; this.xSize += 33;
standardSize = xSize; this.standardSize = this.xSize;
configSrc = ((IConfigurableObject) inventorySlots).getConfigManager(); this.configSrc = ((IConfigurableObject) this.inventorySlots).getConfigManager();
(monitorableContainer = (ContainerMEMonitorable) inventorySlots).gui = this; (this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots).gui = this;
viewCell = te instanceof IViewCellStorage; this.viewCell = te instanceof IViewCellStorage;
if ( te instanceof TileSecurity ) if ( te instanceof TileSecurity )
myName = GuiText.Security; this.myName = GuiText.Security;
else if ( te instanceof WirelessTerminalGuiObject ) else if ( te instanceof WirelessTerminalGuiObject )
myName = GuiText.WirelessTerminal; this.myName = GuiText.WirelessTerminal;
else if ( te instanceof IPortableCell ) else if ( te instanceof IPortableCell )
myName = GuiText.PortableCell; this.myName = GuiText.PortableCell;
else if ( te instanceof IMEChest ) else if ( te instanceof IMEChest )
myName = GuiText.Chest; this.myName = GuiText.Chest;
else if ( te instanceof PartTerminal ) else if ( te instanceof PartTerminal )
myName = GuiText.Terminal; this.myName = GuiText.Terminal;
} }
public void postUpdate(List<IAEItemStack> list) public void postUpdate(List<IAEItemStack> list)
{ {
for (IAEItemStack is : list) for (IAEItemStack is : list)
repo.postUpdate( is ); this.repo.postUpdate( is );
repo.updateView(); this.repo.updateView();
setScrollBar(); this.setScrollBar();
} }
private void setScrollBar() private void setScrollBar()
{ {
myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( rows * 18 - 2 ); this.myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 );
myScrollBar.setRange( 0, (repo.size() + perRow - 1) / perRow - rows, Math.max( 1, rows / 6 ) ); this.myScrollBar.setRange( 0, (this.repo.size() + this.perRow - 1) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) );
} }
public void re_init() public void re_init()
@@ -163,14 +163,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
public void onGuiClosed() public void onGuiClosed()
{ {
super.onGuiClosed(); super.onGuiClosed();
memoryText = searchField.getText(); memoryText = this.searchField.getText();
} }
@Override @Override
public void initGui() public void initGui()
{ {
maxRows = getMaxRows(); this.maxRows = this.getMaxRows();
perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((width - standardSize) / 18); 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 ); 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 top = hasNEI ? 22 : 0;
int magicNumber = 114 + 1; 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 ); this.rows = (int) Math.floor( extraSpace / 18 );
if ( rows > maxRows ) if ( this.rows > this.maxRows )
{ {
top += (rows - maxRows) * 18 / 2; top += (this.rows - this.maxRows) * 18 / 2;
rows = maxRows; this.rows = this.maxRows;
} }
if ( hasNEI ) if ( hasNEI )
rows--; this.rows--;
if ( rows < 3 ) if ( this.rows < 3 )
rows = 3; this.rows = 3;
meSlots.clear(); this.meSlots.clear();
for (int y = 0; y < rows; y++) 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 ) 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 else
this.xSize = standardSize; this.xSize = this.standardSize;
super.initGui(); super.initGui();
// full size : 204 // full size : 204
// extra slots : 72 // extra slots : 72
// slot 18 // slot 18
this.ySize = magicNumber + rows * 18 + reservedSpace; this.ySize = magicNumber + this.rows * 18 + this.reservedSpace;
// this.guiTop = top; // this.guiTop = top;
int unusedSpace = height - ySize; int unusedSpace = this.height - this.ySize;
guiTop = (int) Math.floor( unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f) ); 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; 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; 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; 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 ) ) ); .getSetting( Settings.SEARCH_MODE ) ) );
offset += 20; offset += 20;
if ( !(this instanceof GuiMEPortableCell) || this instanceof GuiWirelessTerm ) 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 ) ) ); .getSetting( Settings.TERMINAL_STYLE ) ) );
} }
searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 80, offsetX ), this.guiTop + 4, 90, 12 ); this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 );
searchField.setEnableBackgroundDrawing( false ); this.searchField.setEnableBackgroundDrawing( false );
searchField.setMaxStringLength( 25 ); this.searchField.setMaxStringLength( 25 );
searchField.setTextColor( 0xFFFFFF ); this.searchField.setTextColor( 0xFFFFFF );
searchField.setVisible( true ); 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 ) ); itemRender ) );
craftingStatusBtn.hideEdge = 13; this.craftingStatusBtn.hideEdge = 13;
} }
// Enum setting = AEConfig.instance.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH ); // Enum setting = AEConfig.instance.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); 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 ); this.searchField.setText( memoryText );
repo.searchString = memoryText; this.repo.searchString = memoryText;
repo.updateView(); this.repo.updateView();
setScrollBar(); this.setScrollBar();
} }
CraftingGridOffsetX = Integer.MAX_VALUE; CraftingGridOffsetX = Integer.MAX_VALUE;
CraftingGridOffsetY = Integer.MAX_VALUE; CraftingGridOffsetY = Integer.MAX_VALUE;
for (Object s : inventorySlots.inventorySlots) for (Object s : this.inventorySlots.inventorySlots)
{ {
if ( s instanceof AppEngSlot ) if ( s instanceof AppEngSlot )
{ {
if ( ((AppEngSlot) s).xDisplayPosition < 197 ) if ( ((AppEngSlot) s).xDisplayPosition < 197 )
repositionSlot( (AppEngSlot) s ); this.repositionSlot( (AppEngSlot) s );
} }
if ( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix ) if ( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix )
@@ -297,13 +297,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
protected void repositionSlot(AppEngSlot s) protected void repositionSlot(AppEngSlot s)
{ {
s.yDisplayPosition = s.defY + ySize - 78 - 5; s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
} }
@Override @Override
protected void actionPerformed(GuiButton btn) protected void actionPerformed(GuiButton btn)
{ {
if ( btn == craftingStatusBtn ) if ( btn == this.craftingStatusBtn )
{ {
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) ); 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 cv = iBtn.getCurrentValue();
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
if ( btn == terminalStyleBox ) if ( btn == this.terminalStyleBox )
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next ); AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
else if ( btn == searchBoxSettings ) else if ( btn == this.searchBoxSettings )
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next ); AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
else else
{ {
@@ -337,7 +337,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
iBtn.set( next ); iBtn.set( next );
if ( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) 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 ) 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( "" ); this.searchField.setText( "" );
repo.searchString = ""; this.repo.searchString = "";
repo.updateView(); this.repo.updateView();
setScrollBar(); this.setScrollBar();
} }
super.mouseClicked( xCoord, yCoord, btn ); super.mouseClicked( xCoord, yCoord, btn );
@@ -371,11 +371,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if ( character == ' ' && this.searchField.getText().length() == 0 ) if ( character == ' ' && this.searchField.getText().length() == 0 )
return; return;
if ( searchField.textboxKeyTyped( character, key ) ) if ( this.searchField.textboxKeyTyped( character, key ) )
{ {
repo.searchString = this.searchField.getText(); this.repo.searchString = this.searchField.getText();
repo.updateView(); this.repo.updateView();
setScrollBar(); this.setScrollBar();
} }
else else
{ {
@@ -387,7 +387,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override @Override
public void updateScreen() public void updateScreen()
{ {
repo.setPower( monitorableContainer.hasPower ); this.repo.setPower( this.monitorableContainer.hasPower );
super.updateScreen(); super.updateScreen();
} }
@@ -396,36 +396,36 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{ {
int x_width = 197; int x_width = 197;
bindTexture( getBackground() ); this.bindTexture( this.getBackground() );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 ); 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 ); 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 + 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; boolean update = false;
for (int i = 0; i < 5; i++) 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; update = true;
myCurrentViewCells[i] = monitorableContainer.cellView[i].getStack(); this.myCurrentViewCells[i] = this.monitorableContainer.cellView[i].getStack();
} }
} }
if ( update ) if ( update )
repo.setViewCell( myCurrentViewCells ); this.repo.setViewCell( this.myCurrentViewCells );
} }
if ( searchField != null ) if ( this.searchField != null )
searchField.drawTextBox(); this.searchField.drawTextBox();
} }
protected String getBackground() protected String getBackground()
@@ -436,47 +436,47 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( myName.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
@Override @Override
public Enum getSortBy() public Enum getSortBy()
{ {
return configSrc.getSetting( Settings.SORT_BY ); return this.configSrc.getSetting( Settings.SORT_BY );
} }
@Override @Override
public Enum getSortDir() public Enum getSortDir()
{ {
return configSrc.getSetting( Settings.SORT_DIRECTION ); return this.configSrc.getSetting( Settings.SORT_DIRECTION );
} }
@Override @Override
public Enum getSortDisplay() public Enum getSortDisplay()
{ {
return configSrc.getSetting( Settings.VIEW_MODE ); return this.configSrc.getSetting( Settings.VIEW_MODE );
} }
@Override @Override
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
{ {
if ( SortByBox != null ) if ( this.SortByBox != null )
SortByBox.set( configSrc.getSetting( Settings.SORT_BY ) ); this.SortByBox.set( this.configSrc.getSetting( Settings.SORT_BY ) );
if ( SortDirBox != null ) if ( this.SortDirBox != null )
SortDirBox.set( configSrc.getSetting( Settings.SORT_DIRECTION ) ); this.SortDirBox.set( this.configSrc.getSetting( Settings.SORT_DIRECTION ) );
if ( ViewBox != null ) if ( this.ViewBox != null )
ViewBox.set( configSrc.getSetting( Settings.VIEW_MODE ) ); this.ViewBox.set( this.configSrc.getSetting( Settings.VIEW_MODE ) );
repo.updateView(); this.repo.updateView();
} }
@Override @Override
protected boolean isPowered() protected boolean isPowered()
{ {
return repo.hasPower(); return this.repo.hasPower();
} }
int getMaxRows() int getMaxRows()
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.container.implementations.ContainerMEPortableCell; import appeng.container.implementations.ContainerMEPortableCell;
@@ -58,9 +58,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
super( new ContainerNetworkStatus( inventoryPlayer, te ) ); super( new ContainerNetworkStatus( inventoryPlayer, te ) );
this.ySize = 153; this.ySize = 153;
this.xSize = 195; this.xSize = 195;
myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
repo = new ItemRepo( myScrollBar, this ); this.repo = new ItemRepo( this.myScrollBar, this );
repo.rowSize = 5; this.repo.rowSize = 5;
} }
@Override @Override
@@ -70,10 +70,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == units ) if ( btn == this.units )
{ {
AEConfig.instance.nextPowerUnit( backwards ); 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(); super.initGui();
units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
buttonList.add( units ); this.buttonList.add( this.units );
} }
public void postUpdate(List<IAEItemStack> list) public void postUpdate(List<IAEItemStack> list)
{ {
repo.clear(); this.repo.clear();
for (IAEItemStack is : list) for (IAEItemStack is : list)
repo.postUpdate( is ); this.repo.postUpdate( is );
repo.updateView(); this.repo.updateView();
setScrollBar(); this.setScrollBar();
} }
private void setScrollBar() private void setScrollBar()
{ {
int size = repo.size(); int size = this.repo.size();
myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 ); this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 );
myScrollBar.setRange( 0, (size + 4) / 5 - rows, 1 ); this.myScrollBar.setRange( 0, (size + 4) / 5 - this.rows, 1 );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/networkstatus.png" ); this.bindTexture( "guis/networkstatus.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
int tooltip = -1; int tooltip = -1;
@@ -119,10 +119,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int x = 0; int x = 0;
int y = 0; int y = 0;
int gx = (width - xSize) / 2; int gx = (this.width - this.xSize) / 2;
int gy = (height - ySize) / 2; int gy = (this.height - this.ySize) / 2;
tooltip = -1; this.tooltip = -1;
for (int z = 0; z <= 4 * 5; z++) 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 ) if ( minY < mouse_y && minY + 20 > mouse_y )
{ {
tooltip = z; this.tooltip = z;
break; break;
} }
@@ -154,15 +154,15 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 ); this.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.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.maxPower, false ), 13, 26, 4210752 );
fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 ); this.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.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 );
int sectionLength = 30; int sectionLength = 30;
@@ -177,9 +177,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int toolPosX = 0; int toolPosX = 0;
int toolPosY = 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 ) if ( refStack != null )
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -189,17 +189,17 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
if ( refStack.getStackSize() >= 10000 ) if ( refStack.getStackSize() >= 10000 )
str = Long.toString( refStack.getStackSize() / 1000 ) + 'k'; str = Long.toString( refStack.getStackSize() / 1000 ) + 'k';
int w = fontRendererObj.getStringWidth( str ); int w = this.fontRendererObj.getStringWidth( str );
fontRendererObj.drawString( str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * 18 + yo + 6) * 2, this.fontRendererObj.drawString( str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * 18 + yo + 6) * 2,
4210752 ); 4210752 );
GL11.glPopMatrix(); GL11.glPopMatrix();
int posX = x * sectionLength + xo + sectionLength - 18; int posX = x * sectionLength + xo + sectionLength - 18;
int posY = y * 18 + yo; 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())); ToolTip = ToolTip + ( '\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize()));
if ( refStack.getCountRequestable() > 0 ) if ( refStack.getCountRequestable() > 0 )
@@ -209,7 +209,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
toolPosY = y * 18 + yo; toolPosY = y * 18 + yo;
} }
drawItem( posX, posY, repo.getItem( z ) ); this.drawItem( posX, posY, this.repo.getItem( z ) );
x++; 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 ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip ); this.drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip );
GL11.glPopAttrib(); GL11.glPopAttrib();
} }
@@ -236,7 +236,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
{ {
if ( stack != null ) if ( stack != null )
{ {
Slot s = getSlot( mouseX, mouseY ); Slot s = this.getSlot( mouseX, mouseY );
if ( s instanceof SlotME ) if ( s instanceof SlotME )
{ {
IAEItemStack myStack = null; IAEItemStack myStack = null;
@@ -264,7 +264,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
// Vanilla version... // Vanilla version...
protected void drawItemStackTooltip(ItemStack stack, int x, int y) 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 ) if ( s instanceof SlotME && stack != null )
{ {
IAEItemStack myStack = 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.Installed.getLocal() + ": " + (myStack.getStackSize()) );
currentToolTip.add( GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( myStack.getCountRequestable(), true ) ); 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 ); // super.drawItemStackTooltip( stack, x, y );
@@ -22,6 +22,7 @@ import java.io.IOException;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.implementations.guiobjects.INetworkTool; import appeng.api.implementations.guiobjects.INetworkTool;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiToggleButton; import appeng.client.gui.widgets.GuiToggleButton;
@@ -48,7 +49,7 @@ public class GuiNetworkTool extends AEBaseGui
try try
{ {
if ( btn == tFacades ) if ( btn == this.tFacades )
NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
} }
catch (IOException e) catch (IOException e)
@@ -62,26 +63,26 @@ public class GuiNetworkTool extends AEBaseGui
{ {
super.initGui(); 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 @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/toolbox.png" ); this.bindTexture( "guis/toolbox.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
if ( tFacades != null ) if ( this.tFacades != null )
tFacades.setState( ((ContainerNetworkTool) inventorySlots).facadeMode ); this.tFacades.setState( ((ContainerNetworkTool) this.inventorySlots).facadeMode );
fontRendererObj.drawString( getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -24,6 +24,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
@@ -50,19 +51,19 @@ public class GuiPatternTerm extends GuiMEMonitorable
public void initGui() public void initGui()
{ {
super.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 ) ); 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 ) ); GuiText.ProcessingPattern.getLocal(), itemRender ) );
// buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, // buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163,
// Settings.ACTIONS, ActionItems.SUBSTITUTION ) ); // Settings.ACTIONS, ActionItems.SUBSTITUTION ) );
// substitutionsBtn.halfSize = true; // substitutionsBtn.halfSize = true;
buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) ); this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) );
clearBtn.halfSize = true; 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 @Override
@@ -73,17 +74,17 @@ public class GuiPatternTerm extends GuiMEMonitorable
try 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" ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
} }
if ( clearBtn == btn ) if ( this.clearBtn == btn )
{ {
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
} }
@@ -105,21 +106,21 @@ public class GuiPatternTerm extends GuiMEMonitorable
protected void repositionSlot(AppEngSlot s) protected void repositionSlot(AppEngSlot s)
{ {
if ( s.isPlayerSide() ) if ( s.isPlayerSide() )
s.yDisplayPosition = s.defY + ySize - 78 - 5; s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
else else
s.yDisplayPosition = s.defY + ySize - 78 - 3; s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
} }
public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) { public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) ); super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
container = (ContainerPatternTerm) this.inventorySlots; this.container = (ContainerPatternTerm) this.inventorySlots;
reservedSpace = 81; this.reservedSpace = 81;
} }
@Override @Override
protected String getBackground() protected String getBackground()
{ {
if ( container.craftingMode ) if ( this.container.craftingMode )
return "guis/pattern.png"; return "guis/pattern.png";
return "guis/pattern2.png"; return "guis/pattern2.png";
} }
@@ -127,19 +128,19 @@ public class GuiPatternTerm extends GuiMEMonitorable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
if ( !container.craftingMode ) if ( !this.container.craftingMode )
{ {
tabCraftButton.visible = false; this.tabCraftButton.visible = false;
tabProcessButton.visible = true; this.tabProcessButton.visible = true;
} }
else else
{ {
tabCraftButton.visible = true; this.tabCraftButton.visible = true;
tabProcessButton.visible = false; this.tabProcessButton.visible = false;
} }
super.drawFG( offsetX, offsetY, mouseX, mouseY ); 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 );
} }
} }
@@ -23,6 +23,7 @@ import java.io.IOException;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiNumberBox; import appeng.client.gui.widgets.GuiNumberBox;
@@ -69,65 +70,65 @@ public class GuiPriority extends AEBaseGui
int c = AEConfig.instance.priorityByStacksAmounts( 2 ); int c = AEConfig.instance.priorityByStacksAmounts( 2 );
int d = AEConfig.instance.priorityByStacksAmounts( 3 ); int d = AEConfig.instance.priorityByStacksAmounts( 3 );
buttonList.add( plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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 ) ); this.buttonList.add( this.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.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
ItemStack myIcon = null; ItemStack myIcon = null;
Object target = ((AEBaseContainer) inventorySlots).getTarget(); Object target = ((AEBaseContainer) this.inventorySlots).getTarget();
if ( target instanceof PartStorageBus ) if ( target instanceof PartStorageBus )
{ {
myIcon = AEApi.instance().parts().partStorageBus.stack( 1 ); myIcon = AEApi.instance().parts().partStorageBus.stack( 1 );
OriginalGui = GuiBridge.GUI_STORAGEBUS; this.OriginalGui = GuiBridge.GUI_STORAGEBUS;
} }
if ( target instanceof PartFormationPlane ) if ( target instanceof PartFormationPlane )
{ {
myIcon = AEApi.instance().parts().partFormationPlane.stack( 1 ); myIcon = AEApi.instance().parts().partFormationPlane.stack( 1 );
OriginalGui = GuiBridge.GUI_FORMATION_PLANE; this.OriginalGui = GuiBridge.GUI_FORMATION_PLANE;
} }
if ( target instanceof TileDrive ) if ( target instanceof TileDrive )
{ {
myIcon = AEApi.instance().blocks().blockDrive.stack( 1 ); myIcon = AEApi.instance().blocks().blockDrive.stack( 1 );
OriginalGui = GuiBridge.GUI_DRIVE; this.OriginalGui = GuiBridge.GUI_DRIVE;
} }
if ( target instanceof TileChest ) if ( target instanceof TileChest )
{ {
myIcon = AEApi.instance().blocks().blockChest.stack( 1 ); myIcon = AEApi.instance().blocks().blockChest.stack( 1 );
OriginalGui = GuiBridge.GUI_CHEST; this.OriginalGui = GuiBridge.GUI_CHEST;
} }
if ( target instanceof TileInterface ) if ( target instanceof TileInterface )
{ {
myIcon = AEApi.instance().blocks().blockInterface.stack( 1 ); myIcon = AEApi.instance().blocks().blockInterface.stack( 1 );
OriginalGui = GuiBridge.GUI_INTERFACE; this.OriginalGui = GuiBridge.GUI_INTERFACE;
} }
if ( target instanceof PartInterface ) if ( target instanceof PartInterface )
{ {
myIcon = AEApi.instance().parts().partInterface.stack( 1 ); myIcon = AEApi.instance().parts().partInterface.stack( 1 );
OriginalGui = GuiBridge.GUI_INTERFACE; this.OriginalGui = GuiBridge.GUI_INTERFACE;
} }
if ( OriginalGui != null ) if ( this.OriginalGui != null )
buttonList.add( originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) ); 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 ); this.priority = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT, Long.class );
priority.setEnableBackgroundDrawing( false ); this.priority.setEnableBackgroundDrawing( false );
priority.setMaxStringLength( 16 ); this.priority.setMaxStringLength( 16 );
priority.setTextColor( 0xFFFFFF ); this.priority.setTextColor( 0xFFFFFF );
priority.setVisible( true ); this.priority.setVisible( true );
priority.setFocused( true ); this.priority.setFocused( true );
((ContainerPriority) inventorySlots).setTextField( priority ); ((ContainerPriority) this.inventorySlots).setTextField( this.priority );
} }
@Override @Override
@@ -135,23 +136,23 @@ public class GuiPriority extends AEBaseGui
{ {
super.actionPerformed( btn ); 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 isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == minus1 || btn == minus10 || btn == minus100 || btn == minus1000; boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if ( isPlus || isMinus ) if ( isPlus || isMinus )
addQty( getQty( btn ) ); this.addQty( this.getQty( btn ) );
} }
private void addQty(int i) private void addQty(int i)
{ {
try try
{ {
String Out = priority.getText(); String Out = this.priority.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -161,7 +162,7 @@ public class GuiPriority extends AEBaseGui
} }
if ( Fixed ) if ( Fixed )
priority.setText( Out ); this.priority.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -169,14 +170,14 @@ public class GuiPriority extends AEBaseGui
long result = Long.parseLong( Out ); long result = Long.parseLong( Out );
result += i; result += i;
priority.setText( Out = Long.toString( result ) ); this.priority.setText( Out = Long.toString( result ) );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", Out ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", Out ) );
} }
catch(NumberFormatException e ) catch(NumberFormatException e )
{ {
// nope.. // nope..
priority.setText( "0" ); this.priority.setText( "0" );
} }
catch (IOException e) catch (IOException e)
{ {
@@ -190,11 +191,11 @@ public class GuiPriority extends AEBaseGui
if ( !this.checkHotbarKeys( key ) ) if ( !this.checkHotbarKeys( key ) )
{ {
if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character )) if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character ))
&& priority.textboxKeyTyped( character, key ) ) && this.priority.textboxKeyTyped( character, key ) )
{ {
try try
{ {
String Out = priority.getText(); String Out = this.priority.getText();
boolean Fixed = false; boolean Fixed = false;
while (Out.startsWith( "0" ) && Out.length() > 1) while (Out.startsWith( "0" ) && Out.length() > 1)
@@ -204,7 +205,7 @@ public class GuiPriority extends AEBaseGui
} }
if ( Fixed ) if ( Fixed )
priority.setText( Out ); this.priority.setText( Out );
if ( Out.length() == 0 ) if ( Out.length() == 0 )
Out = "0"; Out = "0";
@@ -226,10 +227,10 @@ public class GuiPriority extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/priority.png" ); this.bindTexture( "guis/priority.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
priority.drawTextBox(); this.priority.drawTextBox();
} }
protected String getBackground() protected String getBackground()
@@ -240,6 +241,6 @@ public class GuiPriority extends AEBaseGui
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) 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 );
} }
} }
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerQNB; import appeng.container.implementations.ContainerQNB;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
@@ -35,15 +36,15 @@ public class GuiQNB extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/chest.png" ); this.bindTexture( "guis/chest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -22,6 +22,7 @@ import java.io.IOException;
import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerQuartzKnife; import appeng.container.implementations.ContainerQuartzKnife;
import appeng.core.AELog; import appeng.core.AELog;
@@ -45,31 +46,31 @@ public class GuiQuartzKnife extends AEBaseGui
{ {
super.initGui(); super.initGui();
name = new GuiTextField( fontRendererObj, this.guiLeft + 24, this.guiTop + 32, 79, fontRendererObj.FONT_HEIGHT ); this.name = new GuiTextField( this.fontRendererObj, this.guiLeft + 24, this.guiTop + 32, 79, this.fontRendererObj.FONT_HEIGHT );
name.setEnableBackgroundDrawing( false ); this.name.setEnableBackgroundDrawing( false );
name.setMaxStringLength( 32 ); this.name.setMaxStringLength( 32 );
name.setTextColor( 0xFFFFFF ); this.name.setTextColor( 0xFFFFFF );
name.setVisible( true ); this.name.setVisible( true );
name.setFocused( true ); this.name.setFocused( true );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/quartzknife.png" ); this.bindTexture( "guis/quartzknife.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
name.drawTextBox(); this.name.drawTextBox();
} }
@Override @Override
protected void keyTyped(char character, int key) protected void keyTyped(char character, int key)
{ {
if ( name.textboxKeyTyped( character, key ) ) if ( this.name.textboxKeyTyped( character, key ) )
{ {
try try
{ {
String Out = name.getText(); String Out = this.name.getText();
((ContainerQuartzKnife) inventorySlots).setName( Out ); ((ContainerQuartzKnife) this.inventorySlots).setName( Out );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
} }
catch (IOException e) catch (IOException e)
@@ -86,8 +87,8 @@ public class GuiQuartzKnife extends AEBaseGui
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
} }
} }
@@ -38,12 +38,12 @@ public class GuiSecurity extends GuiMEMonitorable
public GuiSecurity(InventoryPlayer inventoryPlayer, ITerminalHost te) { public GuiSecurity(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) ); super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) );
customSortOrder = false; this.customSortOrder = false;
reservedSpace = 33; this.reservedSpace = 33;
// increase size so that the slot is over the gui. // increase size so that the slot is over the gui.
xSize += 56; this.xSize += 56;
standardSize = xSize; this.standardSize = this.xSize;
} }
GuiToggleButton inject, extract, craft, build, security; GuiToggleButton inject, extract, craft, build, security;
@@ -54,19 +54,19 @@ public class GuiSecurity extends GuiMEMonitorable
super.initGui(); super.initGui();
int top = this.guiTop + this.ySize - 116; 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() ) ); .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() ) ); .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() ) ); 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() ) ); 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() ) ); .getUnlocalizedName(), SecurityPermissions.SECURITY.getUnlocalizedTip() ) );
} }
@@ -77,15 +77,15 @@ public class GuiSecurity extends GuiMEMonitorable
SecurityPermissions toggleSetting = null; SecurityPermissions toggleSetting = null;
if ( btn == inject ) if ( btn == this.inject )
toggleSetting = SecurityPermissions.INJECT; toggleSetting = SecurityPermissions.INJECT;
if ( btn == extract ) if ( btn == this.extract )
toggleSetting = SecurityPermissions.EXTRACT; toggleSetting = SecurityPermissions.EXTRACT;
if ( btn == craft ) if ( btn == this.craft )
toggleSetting = SecurityPermissions.CRAFT; toggleSetting = SecurityPermissions.CRAFT;
if ( btn == build ) if ( btn == this.build )
toggleSetting = SecurityPermissions.BUILD; toggleSetting = SecurityPermissions.BUILD;
if ( btn == security ) if ( btn == this.security )
toggleSetting = SecurityPermissions.SECURITY; toggleSetting = SecurityPermissions.SECURITY;
if ( toggleSetting != null ) if ( toggleSetting != null )
@@ -105,13 +105,13 @@ public class GuiSecurity extends GuiMEMonitorable
@Override @Override
protected String getBackground() protected String getBackground()
{ {
ContainerSecurity cs = (ContainerSecurity) inventorySlots; ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
inject.setState( (cs.security & (1 << SecurityPermissions.INJECT.ordinal())) > 0 ); this.inject.setState( (cs.security & (1 << SecurityPermissions.INJECT.ordinal())) > 0 );
extract.setState( (cs.security & (1 << SecurityPermissions.EXTRACT.ordinal())) > 0 ); this.extract.setState( (cs.security & (1 << SecurityPermissions.EXTRACT.ordinal())) > 0 );
craft.setState( (cs.security & (1 << SecurityPermissions.CRAFT.ordinal())) > 0 ); this.craft.setState( (cs.security & (1 << SecurityPermissions.CRAFT.ordinal())) > 0 );
build.setState( (cs.security & (1 << SecurityPermissions.BUILD.ordinal())) > 0 ); this.build.setState( (cs.security & (1 << SecurityPermissions.BUILD.ordinal())) > 0 );
security.setState( (cs.security & (1 << SecurityPermissions.SECURITY.ordinal())) > 0 ); this.security.setState( (cs.security & (1 << SecurityPermissions.SECURITY.ordinal())) > 0 );
return "guis/security.png"; return "guis/security.png";
} }
@@ -120,7 +120,7 @@ public class GuiSecurity extends GuiMEMonitorable
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
super.drawFG( offsetX, offsetY, mouseX, 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 @Override
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerSkyChest; import appeng.container.implementations.ContainerSkyChest;
import appeng.core.AppEng; import appeng.core.AppEng;
@@ -37,15 +38,15 @@ public class GuiSkyChest extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/skychest.png" ); this.bindTexture( "guis/skychest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 2, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 );
} }
@Override @Override
@@ -42,7 +42,7 @@ public class GuiSpatialIOPort extends AEBaseGui
public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) { public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) {
super( new ContainerSpatialIOPort( inventoryPlayer, te ) ); super( new ContainerSpatialIOPort( inventoryPlayer, te ) );
this.ySize = 199; this.ySize = 199;
container = (ContainerSpatialIOPort) inventorySlots; this.container = (ContainerSpatialIOPort) this.inventorySlots;
} }
@Override @Override
@@ -52,10 +52,10 @@ public class GuiSpatialIOPort extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == units ) if ( btn == this.units )
{ {
AEConfig.instance.nextPowerUnit( backwards ); 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(); super.initGui();
units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
buttonList.add( units ); this.buttonList.add( this.units );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/spatialio.png" ); this.bindTexture( "guis/spatialio.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( container.currentPower, false ), 13, 21, 4210752 ); this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 );
fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( container.maxPower, false ), 13, 31, 4210752 ); this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 );
fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( container.reqPower, false ), 13, 78, 4210752 ); this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.reqPower, false ), 13, 78, 4210752 );
fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) container.eff) / 100) + '%', 13, 88, 4210752 ); this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) this.container.eff) / 100) + '%', 13, 88, 4210752 );
fontRendererObj.drawString( getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );
} }
} }
@@ -20,11 +20,11 @@ package appeng.client.gui.implementations;
import java.io.IOException; import java.io.IOException;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -59,35 +59,35 @@ public class GuiStorageBus extends GuiUpgradeable
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if ( fuzzyMode != null ) if ( this.fuzzyMode != null )
fuzzyMode.set( cvb.fzMode ); this.fuzzyMode.set( this.cvb.fzMode );
if ( storageFilter != null ) if ( this.storageFilter != null )
storageFilter.set( ((ContainerStorageBus) cvb).storageFilter ); this.storageFilter.set( ((ContainerStorageBus) this.cvb).storageFilter );
if ( rwMode != null ) if ( this.rwMode != null )
rwMode.set( ((ContainerStorageBus) cvb).rwMode ); this.rwMode.set( ((ContainerStorageBus) this.cvb).rwMode );
} }
@Override @Override
protected void addButtons() protected void addButtons()
{ {
clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE ); this.clear = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE );
partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH ); this.partition = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH );
rwMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE ); this.rwMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE );
storageFilter = new GuiImgButton( this.guiLeft - 18, guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY ); this.storageFilter = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY );
fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); 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 ); this.buttonList.add( this.storageFilter );
buttonList.add( fuzzyMode ); this.buttonList.add( this.fuzzyMode );
buttonList.add( rwMode ); this.buttonList.add( this.rwMode );
buttonList.add( partition ); this.buttonList.add( this.partition );
buttonList.add( clear ); this.buttonList.add( this.clear );
} }
@Override @Override
@@ -99,20 +99,20 @@ public class GuiStorageBus extends GuiUpgradeable
try try
{ {
if ( btn == partition ) if ( btn == this.partition )
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "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" ) ); 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 ) ); NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
else if ( btn == rwMode ) else if ( btn == this.rwMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
else if ( btn == storageFilter ) else if ( btn == this.storageFilter )
NetworkHandler.instance.sendToServer( new PacketConfigButton( storageFilter.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
} }
catch (IOException e) catch (IOException e)
@@ -18,11 +18,11 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
@@ -53,10 +53,10 @@ public class GuiUpgradeable extends AEBaseGui
public GuiUpgradeable(ContainerUpgradeable te) { public GuiUpgradeable(ContainerUpgradeable te) {
super( te ); super( te );
cvb = te; this.cvb = te;
bc = (IUpgradeableHost) te.getTarget(); this.bc = (IUpgradeableHost) te.getTarget();
this.xSize = hasToolbox() ? 246 : 211; this.xSize = this.hasToolbox() ? 246 : 211;
this.ySize = 184; this.ySize = 184;
} }
@@ -64,18 +64,18 @@ public class GuiUpgradeable extends AEBaseGui
public void initGui() public void initGui()
{ {
super.initGui(); super.initGui();
addButtons(); this.addButtons();
} }
protected void addButtons() protected void addButtons()
{ {
redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
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 );
craftMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO ); this.craftMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO );
buttonList.add( craftMode ); this.buttonList.add( this.craftMode );
buttonList.add( redstoneMode ); this.buttonList.add( this.redstoneMode );
buttonList.add( fuzzyMode ); this.buttonList.add( this.fuzzyMode );
} }
@Override @Override
@@ -85,32 +85,32 @@ public class GuiUpgradeable extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == redstoneMode ) if ( btn == this.redstoneMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( redstoneMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
if ( btn == craftMode ) if ( btn == this.craftMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( craftMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
if ( btn == fuzzyMode ) if ( btn == this.fuzzyMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( fuzzyMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
} }
protected boolean hasToolbox() protected boolean hasToolbox()
{ {
return ((ContainerUpgradeable) inventorySlots).hasToolbox(); return ((ContainerUpgradeable) this.inventorySlots).hasToolbox();
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
handleButtonVisibility(); this.handleButtonVisibility();
bindTexture( getBackground() ); this.bindTexture( this.getBackground() );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
if ( drawUpgrades() ) if ( this.drawUpgrades() )
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + cvb.availableUpgrades() * 18 ); this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18 );
if ( hasToolbox() ) if ( this.hasToolbox() )
this.drawTexturedModalRect( offsetX + 178, offsetY + ySize - 90, 178, ySize - 90, 68, 68 ); this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
} }
protected boolean drawUpgrades() protected boolean drawUpgrades()
@@ -125,33 +125,33 @@ public class GuiUpgradeable extends AEBaseGui
protected void handleButtonVisibility() protected void handleButtonVisibility()
{ {
if ( redstoneMode != null ) if ( this.redstoneMode != null )
redstoneMode.setVisibility( bc.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 ); this.redstoneMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 );
if ( fuzzyMode != null ) if ( this.fuzzyMode != null )
fuzzyMode.setVisibility( bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ); this.fuzzyMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 );
if ( craftMode != null ) if ( this.craftMode != null )
craftMode.setVisibility( bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( getName().getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if ( redstoneMode != null ) if ( this.redstoneMode != null )
redstoneMode.set( cvb.rsMode ); this.redstoneMode.set( this.cvb.rsMode );
if ( fuzzyMode != null ) if ( this.fuzzyMode != null )
fuzzyMode.set( cvb.fzMode ); this.fuzzyMode.set( this.cvb.fzMode );
if ( craftMode != null ) if ( this.craftMode != null )
craftMode.set( cvb.cMode ); this.craftMode.set( this.cvb.cMode );
} }
protected GuiText getName() protected GuiText getName()
{ {
return bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus; return this.bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus;
} }
} }
@@ -18,10 +18,10 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiProgressBar; import appeng.client.gui.widgets.GuiProgressBar;
import appeng.client.gui.widgets.GuiProgressBar.Direction; import appeng.client.gui.widgets.GuiProgressBar.Direction;
@@ -38,7 +38,7 @@ public class GuiVibrationChamber extends AEBaseGui
public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te) public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te)
{ {
super( new ContainerVibrationChamber( inventoryPlayer, te ) ); super( new ContainerVibrationChamber( inventoryPlayer, te ) );
cvc = (ContainerVibrationChamber) inventorySlots; this.cvc = (ContainerVibrationChamber) this.inventorySlots;
this.ySize = 166; this.ySize = 166;
} }
@@ -47,34 +47,34 @@ public class GuiVibrationChamber extends AEBaseGui
{ {
super.initGui(); super.initGui();
pb = new GuiProgressBar( cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL ); this.pb = new GuiProgressBar( this.cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL );
this.buttonList.add( pb ); this.buttonList.add( this.pb );
} }
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/vibchamber.png" ); this.bindTexture( "guis/vibchamber.png" );
pb.xPosition = 99 + guiLeft; this.pb.xPosition = 99 + this.guiLeft;
pb.yPosition = 36 + guiTop; this.pb.yPosition = 36 + this.guiTop;
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
int k = 25; int k = 25;
int l = -15; 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(); int i1 = this.cvc.getCurrentProgress();
bindTexture( "guis/vibchamber.png" ); this.bindTexture( "guis/vibchamber.png" );
GL11.glColor3f( 1, 1, 1 ); GL11.glColor3f( 1, 1, 1 );
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 ); this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
} }
@@ -18,11 +18,11 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import org.lwjgl.input.Mouse;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -44,10 +44,10 @@ public class GuiWireless extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 ); boolean backwards = Mouse.isButtonDown( 1 );
if ( btn == units ) if ( btn == this.units )
{ {
AEConfig.instance.nextPowerUnit( backwards ); 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(); super.initGui();
units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() ); this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
buttonList.add( units ); this.buttonList.add( this.units );
} }
public GuiWireless(InventoryPlayer inventoryPlayer, TileWireless te) { public GuiWireless(InventoryPlayer inventoryPlayer, TileWireless te) {
@@ -68,27 +68,27 @@ public class GuiWireless extends AEBaseGui
@Override @Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
bindTexture( "guis/wireless.png" ); this.bindTexture( "guis/wireless.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
} }
@Override @Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{ {
fontRendererObj.drawString( getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 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 ) if ( cw.range > 0 )
{ {
String firstMessage = GuiText.Range.getLocal() + ": " + (cw.range / 10.0) + " m"; String firstMessage = GuiText.Range.getLocal() + ": " + (cw.range / 10.0) + " m";
String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); 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); int cOffset = (this.xSize / 2) - (strWidth / 2);
fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 );
fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 );
} }
} }
@@ -19,6 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.guiobjects.IPortableCell;
public class GuiWirelessTerm extends GuiMEPortableCell public class GuiWirelessTerm extends GuiMEPortableCell
@@ -26,12 +27,12 @@ public class GuiWirelessTerm extends GuiMEPortableCell
public GuiWirelessTerm(InventoryPlayer inventoryPlayer, IPortableCell te) { public GuiWirelessTerm(InventoryPlayer inventoryPlayer, IPortableCell te) {
super( inventoryPlayer, te ); super( inventoryPlayer, te );
maxRows = Integer.MAX_VALUE; this.maxRows = Integer.MAX_VALUE;
} }
@Override @Override
int getMaxRows() int getMaxRows()
{ {
return defaultGetMaxRows(); return this.defaultGetMaxRows();
} }
} }
@@ -35,21 +35,21 @@ public class GuiNumberBox extends GuiTextField
@Override @Override
public void writeText(String p_146191_1_) public void writeText(String p_146191_1_)
{ {
String original = getText(); String original = this.getText();
super.writeText( p_146191_1_ ); super.writeText( p_146191_1_ );
try try
{ {
if ( type == int.class || type == Integer.class ) if ( this.type == int.class || this.type == Integer.class )
Integer.parseInt( getText() ); Integer.parseInt( this.getText() );
else if ( type == long.class || type == Long.class ) else if ( this.type == long.class || this.type == Long.class )
Long.parseLong( getText() ); Long.parseLong( this.getText() );
else if ( type == double.class || type == Double.class ) else if ( this.type == double.class || this.type == Double.class )
Double.parseDouble( getText() ); Double.parseDouble( this.getText() );
} }
catch(NumberFormatException e ) catch(NumberFormatException e )
{ {
setText( original ); this.setText( original );
} }
} }
@@ -55,12 +55,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip
this.xPosition = posX; this.xPosition = posX;
this.yPosition = posY; this.yPosition = posY;
this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture ); this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture );
width = _width; this.width = _width;
height = _height; this.height = _height;
fill_u = u; this.fill_u = u;
fill_v = y; this.fill_v = y;
layout = dir; this.layout = dir;
titleName = title; this.titleName = title;
} }
@Override @Override
@@ -68,19 +68,19 @@ public class GuiProgressBar extends GuiButton implements ITooltip
{ {
if ( this.visible ) if ( this.visible )
{ {
par1Minecraft.getTextureManager().bindTexture( texture ); par1Minecraft.getTextureManager().bindTexture( this.texture );
int max = source.getMaxProgress(); int max = this.source.getMaxProgress();
int current = source.getCurrentProgress(); int current = this.source.getCurrentProgress();
if ( layout == Direction.VERTICAL ) if ( this.layout == Direction.VERTICAL )
{ {
int diff = height - (max > 0 ? (height * current) / max : 0); int diff = this.height - (max > 0 ? (this.height * current) / max : 0);
this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, fill_u, fill_v + diff, width, height - diff ); this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, this.fill_u, this.fill_v + diff, this.width, this.height - diff );
} }
else else
{ {
int diff = width - (max > 0 ? (width * current) / max : 0); int diff = this.width - (max > 0 ? (this.width * current) / max : 0);
this.drawTexturedModalRect( this.xPosition, this.yPosition, fill_u + diff, fill_v, width - diff, height ); this.drawTexturedModalRect( this.xPosition, this.yPosition, this.fill_u + diff, this.fill_v, this.width - diff, this.height );
} }
this.mouseDragged( par1Minecraft, par2, par3 ); this.mouseDragged( par1Minecraft, par2, par3 );
@@ -95,34 +95,34 @@ public class GuiProgressBar extends GuiButton implements ITooltip
@Override @Override
public String getMessage() public String getMessage()
{ {
if ( fullMsg != null ) if ( this.fullMsg != null )
return fullMsg; 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 @Override
public int xPos() public int xPos()
{ {
return xPosition - 2; return this.xPosition - 2;
} }
@Override @Override
public int yPos() public int yPos()
{ {
return yPosition - 2; return this.yPosition - 2;
} }
@Override @Override
public int getWidth() public int getWidth()
{ {
return width + 4; return this.width + 4;
} }
@Override @Override
public int getHeight() public int getHeight()
{ {
return height + 4; return this.height + 4;
} }
@Override @Override
@@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource
private void applyRange() 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) public void draw(AEBaseGui g)
@@ -45,97 +45,97 @@ public class GuiScrollbar implements IScrollSource
g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" ); g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); 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 else
{ {
int offset = (currentScroll - minScroll) * (height - 15) / getRange(); int offset = (this.currentScroll - this.minScroll) * (this.height - 15) / this.getRange();
g.drawTexturedModalRect( displayX, offset + displayY, 232, 0, width, 15 ); g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 );
} }
} }
public int getRange() public int getRange()
{ {
return maxScroll - minScroll; return this.maxScroll - this.minScroll;
} }
public int getLeft() public int getLeft()
{ {
return displayX; return this.displayX;
} }
public int getTop() public int getTop()
{ {
return displayY; return this.displayY;
} }
public int getWidth() public int getWidth()
{ {
return width; return this.width;
} }
public int getHeight() public int getHeight()
{ {
return height; return this.height;
} }
public GuiScrollbar setLeft(int v) public GuiScrollbar setLeft(int v)
{ {
displayX = v; this.displayX = v;
return this; return this;
} }
public GuiScrollbar setTop(int v) public GuiScrollbar setTop(int v)
{ {
displayY = v; this.displayY = v;
return this; return this;
} }
public GuiScrollbar setWidth(int v) public GuiScrollbar setWidth(int v)
{ {
width = v; this.width = v;
return this; return this;
} }
public GuiScrollbar setHeight(int v) public GuiScrollbar setHeight(int v)
{ {
height = v; this.height = v;
return this; return this;
} }
public void setRange(int min, int max, int pageSize) public void setRange(int min, int max, int pageSize)
{ {
minScroll = min; this.minScroll = min;
maxScroll = max; this.maxScroll = max;
this.pageSize = pageSize; this.pageSize = pageSize;
if ( minScroll > maxScroll ) if ( this.minScroll > this.maxScroll )
maxScroll = minScroll; this.maxScroll = this.minScroll;
applyRange(); this.applyRange();
} }
@Override @Override
public int getCurrentScroll() public int getCurrentScroll()
{ {
return currentScroll; return this.currentScroll;
} }
public void click(AEBaseGui aeBaseGui, int x, int y) public void click(AEBaseGui aeBaseGui, int x, int y)
{ {
if ( getRange() == 0 ) if ( this.getRange() == 0 )
return; 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); this.currentScroll = (y - this.displayY);
currentScroll = minScroll + ((currentScroll * 2 * getRange() / height)); this.currentScroll = this.minScroll + ((this.currentScroll * 2 * this.getRange() / this.height));
currentScroll = (currentScroll + 1) >> 1; this.currentScroll = (this.currentScroll + 1) >> 1;
applyRange(); this.applyRange();
} }
} }
} }
@@ -143,8 +143,8 @@ public class GuiScrollbar implements IScrollSource
public void wheel(int delta) public void wheel(int delta)
{ {
delta = Math.max( Math.min( -delta, 1 ), -1 ); delta = Math.max( Math.min( -delta, 1 ), -1 );
currentScroll += delta * pageSize; this.currentScroll += delta * this.pageSize;
applyRange(); this.applyRange();
} }
} }
@@ -64,7 +64,7 @@ public class MEGuiTextField extends GuiTextField
{ {
super.mouseClicked( xPos, yPos, button ); super.mouseClicked( xPos, yPos, button );
final boolean requiresFocus = isMouseIn( xPos, yPos ); final boolean requiresFocus = this.isMouseIn( xPos, yPos );
this.setFocused( requiresFocus ); this.setFocused( requiresFocus );
} }
@@ -19,6 +19,7 @@
package appeng.client.me; package appeng.client.me;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.ItemSorters; import appeng.util.ItemSorters;
@@ -31,7 +32,7 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
final public long sortBy; final public long sortBy;
public ClientDCInternalInv(int size, long id, long sortBy, String unlocalizedName) { 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.unlocalizedName = unlocalizedName;
this.id = id; this.id = id;
this.sortBy = sortBy; this.sortBy = sortBy;
@@ -39,16 +40,16 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
public String getName() public String getName()
{ {
String s = StatCollector.translateToLocal( unlocalizedName + ".name" ); String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" );
if ( s.equals( unlocalizedName + ".name" ) ) if ( s.equals( this.unlocalizedName + ".name" ) )
return StatCollector.translateToLocal( unlocalizedName ); return StatCollector.translateToLocal( this.unlocalizedName );
return s; return s;
} }
@Override @Override
public int compareTo(ClientDCInternalInv o) public int compareTo(ClientDCInternalInv o)
{ {
return ItemSorters.compareLong( sortBy, o.sortBy ); return ItemSorters.compareLong( this.sortBy, o.sortBy );
} }
} }
@@ -19,6 +19,7 @@
package appeng.client.me; package appeng.client.me;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
public class InternalSlotME public class InternalSlotME
@@ -39,16 +40,16 @@ public class InternalSlotME
public ItemStack getStack() public ItemStack getStack()
{ {
return repo.getItem( offset ); return this.repo.getItem( this.offset );
} }
public IAEItemStack getAEStack() public IAEItemStack getAEStack()
{ {
return repo.getReferenceItem( offset ); return this.repo.getReferenceItem( this.offset );
} }
public boolean hasPower() public boolean hasPower()
{ {
return repo.hasPower(); return this.repo.hasPower();
} }
} }
+44 -42
View File
@@ -25,6 +25,9 @@ import java.util.Collections;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.ReflectionHelper;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.SearchBoxMode; import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
@@ -40,7 +43,6 @@ import appeng.items.storage.ItemViewCell;
import appeng.util.ItemSorters; import appeng.util.ItemSorters;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.prioitylist.IPartitionList; import appeng.util.prioitylist.IPartitionList;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class ItemRepo public class ItemRepo
{ {
@@ -64,30 +66,30 @@ public class ItemRepo
public IAEItemStack getReferenceItem(int idx) 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 null;
return view.get( idx ); return this.view.get( idx );
} }
public ItemStack getItem(int 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 null;
return dsp.get( idx ); return this.dsp.get( idx );
} }
void setSearch(String search) void setSearch(String search)
{ {
searchString = search == null ? "" : search; this.searchString = search == null ? "" : search;
} }
public void postUpdate(IAEItemStack is) public void postUpdate(IAEItemStack is)
{ {
IAEItemStack st = list.findPrecise( is ); IAEItemStack st = this.list.findPrecise( is );
if ( st != null ) if ( st != null )
{ {
@@ -95,15 +97,15 @@ public class ItemRepo
st.add( is ); st.add( is );
} }
else else
list.add( is ); this.list.add( is );
} }
IPartitionList<IAEItemStack> myPartitionList; IPartitionList<IAEItemStack> myPartitionList;
public void setViewCell(ItemStack[] list) public void setViewCell(ItemStack[] list)
{ {
myPartitionList = ItemViewCell.createFilter( list ); this.myPartitionList = ItemViewCell.createFilter( list );
updateView(); this.updateView();
} }
private String NEIWord = null; private String NEIWord = null;
@@ -112,16 +114,16 @@ public class ItemRepo
{ {
try 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" ); Field fldSearchField = c.getField( "searchField" );
Object searchField = fldSearchField.get( c ); Object searchField = fldSearchField.get( c );
Method a = searchField.getClass().getMethod( "setText", String.class ); Method a = searchField.getClass().getMethod( "setText", String.class );
Method b = searchField.getClass().getMethod( "onTextChange", String.class ); Method b = searchField.getClass().getMethod( "onTextChange", String.class );
NEIWord = filter; this.NEIWord = filter;
a.invoke( searchField, filter ); a.invoke( searchField, filter );
b.invoke( searchField, "" ); b.invoke( searchField, "" );
} }
@@ -134,38 +136,38 @@ public class ItemRepo
public void updateView() public void updateView()
{ {
view.clear(); this.view.clear();
dsp.clear(); this.dsp.clear();
view.ensureCapacity( list.size() ); this.view.ensureCapacity( this.list.size() );
dsp.ensureCapacity( 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 ); Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
if ( searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH ) 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 terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
// boolean terminalSearchMods = Configuration.instance.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO; // boolean terminalSearchMods = Configuration.instance.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO;
boolean searchMod = false; boolean searchMod = false;
if ( innerSearch.startsWith( "@" ) ) if ( this.innerSearch.startsWith( "@" ) )
{ {
searchMod = true; searchMod = true;
innerSearch = innerSearch.substring( 1 ); this.innerSearch = this.innerSearch.substring( 1 );
} }
Pattern m = null; Pattern m = null;
try try
{ {
m = Pattern.compile( innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE ); m = Pattern.compile( this.innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE );
} }
catch (Throwable ignore) catch (Throwable ignore)
{ {
try try
{ {
m = Pattern.compile( Pattern.quote( innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE ); m = Pattern.compile( Pattern.quote( this.innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE );
} }
catch (Throwable __) catch (Throwable __)
{ {
@@ -174,11 +176,11 @@ public class ItemRepo
} }
boolean notDone = false; 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; continue;
} }
@@ -199,7 +201,7 @@ public class ItemRepo
if ( m.matcher( dspName.toLowerCase() ).find() ) if ( m.matcher( dspName.toLowerCase() ).find() )
{ {
view.add( is ); this.view.add( is );
notDone = false; notDone = false;
} }
@@ -208,7 +210,7 @@ public class ItemRepo
for (Object lp : Platform.getTooltip( is )) for (Object lp : Platform.getTooltip( is ))
if ( lp instanceof String && m.matcher( (String) lp ).find() ) if ( lp instanceof String && m.matcher( (String) lp ).find() )
{ {
view.add( is ); this.view.add( is );
notDone = false; notDone = false;
break; break;
} }
@@ -220,40 +222,40 @@ public class ItemRepo
*/ */
} }
Enum SortBy = sortSrc.getSortBy(); Enum SortBy = this.sortSrc.getSortBy();
Enum SortDir = sortSrc.getSortDir(); Enum SortDir = this.sortSrc.getSortDir();
ItemSorters.Direction = (appeng.api.config.SortDir) SortDir; ItemSorters.Direction = (appeng.api.config.SortDir) SortDir;
ItemSorters.init(); ItemSorters.init();
if ( SortBy == SortOrder.MOD ) if ( SortBy == SortOrder.MOD )
Collections.sort( view, ItemSorters.ConfigBased_SortByMod ); Collections.sort( this.view, ItemSorters.ConfigBased_SortByMod );
else if ( SortBy == SortOrder.AMOUNT ) else if ( SortBy == SortOrder.AMOUNT )
Collections.sort( view, ItemSorters.ConfigBased_SortBySize ); Collections.sort( this.view, ItemSorters.ConfigBased_SortBySize );
else if ( SortBy == SortOrder.INVTWEAKS ) else if ( SortBy == SortOrder.INVTWEAKS )
Collections.sort( view, ItemSorters.ConfigBased_SortByInvTweaks ); Collections.sort( this.view, ItemSorters.ConfigBased_SortByInvTweaks );
else else
Collections.sort( view, ItemSorters.ConfigBased_SortByName ); Collections.sort( this.view, ItemSorters.ConfigBased_SortByName );
for (IAEItemStack is : view) for (IAEItemStack is : this.view)
dsp.add( is.getItemStack() ); this.dsp.add( is.getItemStack() );
} }
public int size() public int size()
{ {
return view.size(); return this.view.size();
} }
public void clear() public void clear()
{ {
list.resetStatus(); this.list.resetStatus();
} }
private boolean hasPower; private boolean hasPower;
public boolean hasPower() public boolean hasPower()
{ {
return hasPower; return this.hasPower;
} }
public void setPower(boolean hasPower) public void setPower(boolean hasPower)
@@ -21,6 +21,7 @@ package appeng.client.me;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.container.slot.AppEngSlot; import appeng.container.slot.AppEngSlot;
import appeng.items.misc.ItemEncodedPattern; import appeng.items.misc.ItemEncodedPattern;
import appeng.util.Platform; import appeng.util.Platform;
@@ -32,7 +33,7 @@ public class SlotDisconnected extends AppEngSlot
public SlotDisconnected(ClientDCInternalInv me, int which, int x, int y) { public SlotDisconnected(ClientDCInternalInv me, int which, int x, int y) {
super( me.inv, which, x, y ); super( me.inv, which, x, y );
mySlot = me; this.mySlot = me;
} }
@Override @Override
@@ -73,7 +74,7 @@ public class SlotDisconnected extends AppEngSlot
@Override @Override
public boolean getHasStack() public boolean getHasStack()
{ {
return getStack() != null; return this.getStack() != null;
} }
@Override @Override
+8 -7
View File
@@ -22,6 +22,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
public class SlotME extends Slot public class SlotME extends Slot
@@ -31,21 +32,21 @@ public class SlotME extends Slot
public SlotME(InternalSlotME me) { public SlotME(InternalSlotME me) {
super( null, 0, me.xPos, me.yPos ); super( null, 0, me.xPos, me.yPos );
mySlot = me; this.mySlot = me;
} }
@Override @Override
public ItemStack getStack() public ItemStack getStack()
{ {
if ( mySlot.hasPower() ) if ( this.mySlot.hasPower() )
return mySlot.getStack(); return this.mySlot.getStack();
return null; return null;
} }
public IAEItemStack getAEStack() public IAEItemStack getAEStack()
{ {
if ( mySlot.hasPower() ) if ( this.mySlot.hasPower() )
return mySlot.getAEStack(); return this.mySlot.getAEStack();
return null; return null;
} }
@@ -70,8 +71,8 @@ public class SlotME extends Slot
@Override @Override
public boolean getHasStack() public boolean getHasStack()
{ {
if ( mySlot.hasPower() ) if ( this.mySlot.hasPower() )
return getStack() != null; return this.getStack() != null;
return false; return false;
} }
@@ -102,7 +102,7 @@ public class AppEngRenderItem extends RenderItem
GL11.glEnable( GL11.GL_DEPTH_TEST ); 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 ) if ( amount > 999999999999L )
amount = 999999999999L; amount = 999999999999L;
@@ -276,14 +276,14 @@ public class BaseBlockRender
} }
public BaseBlockRender(boolean enableTESR, double tileEntitySpecialRendererRange) { public BaseBlockRender(boolean enableTESR, double tileEntitySpecialRendererRange) {
hasTESR = enableTESR; this.hasTESR = enableTESR;
MAX_DISTANCE = tileEntitySpecialRendererRange; this.MAX_DISTANCE = tileEntitySpecialRendererRange;
setOriMap(); setOriMap();
} }
public double getTesrRenderDistance() public double getTesrRenderDistance()
{ {
return MAX_DISTANCE; return this.MAX_DISTANCE;
} }
public IIcon firstNotNull(IIcon... s) public IIcon firstNotNull(IIcon... s)
@@ -313,7 +313,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.DOWN.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -328,7 +328,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.UP.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -343,7 +343,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.NORTH.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -358,7 +358,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.SOUTH.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -373,7 +373,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.WEST.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -388,7 +388,7 @@ public class BaseBlockRender
0.0D, 0.0D,
0.0D, 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 ) ) ); block.getIcon( ForgeDirection.EAST.ordinal(), meta ) ) );
tess.draw(); tess.draw();
} }
@@ -419,7 +419,7 @@ public class BaseBlockRender
getOrientation( ForgeDirection.SOUTH, ForgeDirection.SOUTH, ForgeDirection.UP ) ); 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() ) if ( block.hasSubtypes() )
info.setTemporaryRenderIcon( null ); info.setTemporaryRenderIcon( null );
@@ -442,7 +442,7 @@ public class BaseBlockRender
ForgeDirection up = ForgeDirection.UP; ForgeDirection up = ForgeDirection.UP;
BlockRenderInfo info = block.getRendererInstance(); BlockRenderInfo info = block.getRendererInstance();
IOrientable te = getOrientable( block, world, x, y, z ); IOrientable te = this.getOrientable( block, world, x, y, z );
if ( te != null ) if ( te != null )
{ {
forward = te.getForward(); 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) 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 ); boolean o = renderer.renderStandardBlock( block, x, y, z );
postRenderInWorld( renderer ); this.postRenderInWorld( renderer );
return o; return o;
} }
@@ -489,27 +489,27 @@ public class BaseBlockRender
ForgeDirection west = Platform.crossProduct( forward, up ); ForgeDirection west = Platform.crossProduct( forward, up );
rotMat.put( 0, west.offsetX ); this.rotMat.put( 0, west.offsetX );
rotMat.put( 1, west.offsetY ); this.rotMat.put( 1, west.offsetY );
rotMat.put( 2, west.offsetZ ); this.rotMat.put( 2, west.offsetZ );
rotMat.put( 3, 0 ); this.rotMat.put( 3, 0 );
rotMat.put( 4, up.offsetX ); this.rotMat.put( 4, up.offsetX );
rotMat.put( 5, up.offsetY ); this.rotMat.put( 5, up.offsetY );
rotMat.put( 6, up.offsetZ ); this.rotMat.put( 6, up.offsetZ );
rotMat.put( 7, 0 ); this.rotMat.put( 7, 0 );
rotMat.put( 8, forward.offsetX ); this.rotMat.put( 8, forward.offsetX );
rotMat.put( 9, forward.offsetY ); this.rotMat.put( 9, forward.offsetY );
rotMat.put( 10, forward.offsetZ ); this.rotMat.put( 10, forward.offsetZ );
rotMat.put( 11, 0 ); this.rotMat.put( 11, 0 );
rotMat.put( 12, 0 ); this.rotMat.put( 12, 0 );
rotMat.put( 13, 0 ); this.rotMat.put( 13, 0 );
rotMat.put( 14, 0 ); this.rotMat.put( 14, 0 );
rotMat.put( 15, 1 ); this.rotMat.put( 15, 1 );
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 ); 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.glTranslated( -0.5, -0.5, -0.5 );
GL11.glCullFace( GL11.GL_FRONT ); GL11.glCullFace( GL11.GL_FRONT );
} }
@@ -663,25 +663,25 @@ public class BaseBlockRender
offsetY += y; offsetY += y;
offsetZ += z; 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 // u -> u
0, 1.0, 0, 1.0,
// v -> v // v -> v
0, edgeThickness, ico, flip ); 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 // u -> u
0.0, edgeThickness, 0.0, edgeThickness,
// v -> v // v -> v
edgeThickness, 1.0 - edgeThickness, ico, flip ); 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 // u -> u
1.0 - edgeThickness, 1.0, 1.0 - edgeThickness, 1.0,
// v -> v // v -> v
edgeThickness, 1.0 - edgeThickness, ico, flip ); 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 // u -> u
0, 1.0, 0, 1.0,
// v -> v // v -> v
@@ -721,13 +721,13 @@ public class BaseBlockRender
v1 = 16 - v1; v1 = 16 - v1;
v2 = 16 - v2; v2 = 16 - v2;
double minX = (forward.offsetX > 0 ? 1 : 0) + mapFaceUV( west.offsetX, u1 ) + mapFaceUV( up.offsetX, 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) + mapFaceUV( west.offsetY, u1 ) + mapFaceUV( up.offsetY, 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) + mapFaceUV( west.offsetZ, u1 ) + mapFaceUV( up.offsetZ, 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 maxX = (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV( west.offsetX, u2 ) + this.mapFaceUV( up.offsetX, v2 );
double maxY = (forward.offsetY > 0 ? 1 : 0) + mapFaceUV( west.offsetY, u2 ) + mapFaceUV( up.offsetY, 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) + mapFaceUV( west.offsetZ, u2 ) + mapFaceUV( up.offsetZ, 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.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) ); 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; 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 ); Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
@@ -18,16 +18,17 @@
package appeng.client.render; package appeng.client.render;
import appeng.client.texture.FlippableIcon;
import appeng.client.texture.TmpFlippableIcon;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.client.texture.FlippableIcon;
import appeng.client.texture.TmpFlippableIcon;
public class BlockRenderInfo public class BlockRenderInfo
{ {
public BlockRenderInfo(BaseBlockRender inst) { public BlockRenderInfo(BaseBlockRender inst) {
rendererInstance = inst; this.rendererInstance = inst;
} }
final public BaseBlockRender rendererInstance; final public BaseBlockRender rendererInstance;
@@ -49,60 +50,60 @@ public class BlockRenderInfo
public void updateIcons(FlippableIcon Bottom, FlippableIcon Top, FlippableIcon North, FlippableIcon South, FlippableIcon East, FlippableIcon West) public void updateIcons(FlippableIcon Bottom, FlippableIcon Top, FlippableIcon North, FlippableIcon South, FlippableIcon East, FlippableIcon West)
{ {
topIcon = Top; this.topIcon = Top;
bottomIcon = Bottom; this.bottomIcon = Bottom;
southIcon = South; this.southIcon = South;
northIcon = North; this.northIcon = North;
eastIcon = East; this.eastIcon = East;
westIcon = West; this.westIcon = West;
} }
public void setTemporaryRenderIcon(IIcon IIcon) public void setTemporaryRenderIcon(IIcon IIcon)
{ {
if ( IIcon == null ) if ( IIcon == null )
useTmp = false; this.useTmp = false;
else else
{ {
useTmp = true; this.useTmp = true;
tmpTopIcon.setOriginal( IIcon ); this.tmpTopIcon.setOriginal( IIcon );
tmpBottomIcon.setOriginal( IIcon ); this.tmpBottomIcon.setOriginal( IIcon );
tmpSouthIcon.setOriginal( IIcon ); this.tmpSouthIcon.setOriginal( IIcon );
tmpNorthIcon.setOriginal( IIcon ); this.tmpNorthIcon.setOriginal( IIcon );
tmpEastIcon.setOriginal( IIcon ); this.tmpEastIcon.setOriginal( IIcon );
tmpWestIcon.setOriginal( IIcon ); this.tmpWestIcon.setOriginal( IIcon );
} }
} }
public void setTemporaryRenderIcons(IIcon nTopIcon, IIcon nBottomIcon, IIcon nSouthIcon, IIcon nNorthIcon, IIcon nEastIcon, IIcon nWestIcon) public void setTemporaryRenderIcons(IIcon nTopIcon, IIcon nBottomIcon, IIcon nSouthIcon, IIcon nNorthIcon, IIcon nEastIcon, IIcon nWestIcon)
{ {
tmpTopIcon.setOriginal( nTopIcon == null ? getTexture( ForgeDirection.UP ) : nTopIcon ); this.tmpTopIcon.setOriginal( nTopIcon == null ? this.getTexture( ForgeDirection.UP ) : nTopIcon );
tmpBottomIcon.setOriginal( nBottomIcon == null ? getTexture( ForgeDirection.DOWN ) : nBottomIcon ); this.tmpBottomIcon.setOriginal( nBottomIcon == null ? this.getTexture( ForgeDirection.DOWN ) : nBottomIcon );
tmpSouthIcon.setOriginal( nSouthIcon == null ? getTexture( ForgeDirection.SOUTH ) : nSouthIcon ); this.tmpSouthIcon.setOriginal( nSouthIcon == null ? this.getTexture( ForgeDirection.SOUTH ) : nSouthIcon );
tmpNorthIcon.setOriginal( nNorthIcon == null ? getTexture( ForgeDirection.NORTH ) : nNorthIcon ); this.tmpNorthIcon.setOriginal( nNorthIcon == null ? this.getTexture( ForgeDirection.NORTH ) : nNorthIcon );
tmpEastIcon.setOriginal( nEastIcon == null ? getTexture( ForgeDirection.EAST ) : nEastIcon ); this.tmpEastIcon.setOriginal( nEastIcon == null ? this.getTexture( ForgeDirection.EAST ) : nEastIcon );
tmpWestIcon.setOriginal( nWestIcon == null ? getTexture( ForgeDirection.WEST ) : nWestIcon ); this.tmpWestIcon.setOriginal( nWestIcon == null ? this.getTexture( ForgeDirection.WEST ) : nWestIcon );
useTmp = true; this.useTmp = true;
} }
public FlippableIcon getTexture(ForgeDirection dir) public FlippableIcon getTexture(ForgeDirection dir)
{ {
if ( useTmp ) if ( this.useTmp )
{ {
switch (dir) switch (dir)
{ {
case DOWN: case DOWN:
return tmpBottomIcon; return this.tmpBottomIcon;
case UP: case UP:
return tmpTopIcon; return this.tmpTopIcon;
case NORTH: case NORTH:
return tmpNorthIcon; return this.tmpNorthIcon;
case SOUTH: case SOUTH:
return tmpSouthIcon; return this.tmpSouthIcon;
case EAST: case EAST:
return tmpEastIcon; return this.tmpEastIcon;
case WEST: case WEST:
return tmpWestIcon; return this.tmpWestIcon;
default: default:
break; break;
} }
@@ -111,27 +112,27 @@ public class BlockRenderInfo
switch (dir) switch (dir)
{ {
case DOWN: case DOWN:
return bottomIcon; return this.bottomIcon;
case UP: case UP:
return topIcon; return this.topIcon;
case NORTH: case NORTH:
return northIcon; return this.northIcon;
case SOUTH: case SOUTH:
return southIcon; return this.southIcon;
case EAST: case EAST:
return eastIcon; return this.eastIcon;
case WEST: case WEST:
return westIcon; return this.westIcon;
default: default:
break; break;
} }
return topIcon; return this.topIcon;
} }
public boolean isValid() 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;
} }
} }
@@ -25,6 +25,10 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.parts.IBoxProvider; import appeng.api.parts.IBoxProvider;
import appeng.api.parts.IPartCollisionHelper; import appeng.api.parts.IPartCollisionHelper;
@@ -34,8 +38,6 @@ import appeng.block.AEBaseBlock;
import appeng.block.networking.BlockCableBus; import appeng.block.networking.BlockCableBus;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class BusRenderHelper implements IPartRenderHelper public class BusRenderHelper implements IPartRenderHelper
@@ -75,7 +77,7 @@ public class BusRenderHelper implements IPartRenderHelper
@Override @Override
public void addBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) 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.minX = Math.min( this.minX, (float) minX );
this.minY = Math.min( this.minY, (float) minY ); this.minY = Math.min( this.minY, (float) minY );
@@ -86,7 +88,7 @@ public class BusRenderHelper implements IPartRenderHelper
} }
else else
{ {
started = true; this.started = true;
this.minX = (float) minX; this.minX = (float) minX;
this.minY = (float) minY; this.minY = (float) minY;
this.minZ = (float) minZ; this.minZ = (float) minZ;
@@ -99,19 +101,19 @@ public class BusRenderHelper implements IPartRenderHelper
@Override @Override
public ForgeDirection getWorldX() public ForgeDirection getWorldX()
{ {
return ax; return BusRenderHelper.this.ax;
} }
@Override @Override
public ForgeDirection getWorldY() public ForgeDirection getWorldY()
{ {
return ay; return BusRenderHelper.this.ay;
} }
@Override @Override
public ForgeDirection getWorldZ() public ForgeDirection getWorldZ()
{ {
return az; return BusRenderHelper.this.az;
} }
@Override @Override
@@ -131,27 +133,27 @@ public class BusRenderHelper implements IPartRenderHelper
public int getItemsRendered() public int getItemsRendered()
{ {
return itemsRendered; return this.itemsRendered;
} }
public void setPass(int pass) public void setPass(int pass)
{ {
renderingForPass = 0; this.renderingForPass = 0;
currentPass = pass; this.currentPass = pass;
itemsRendered = 0; this.itemsRendered = 0;
} }
@Override @Override
public void renderForPass(int pass) public void renderForPass(int pass)
{ {
renderingForPass = pass; this.renderingForPass = pass;
} }
public boolean renderThis() public boolean renderThis()
{ {
if ( renderingForPass == currentPass || noAlphaPass ) if ( this.renderingForPass == this.currentPass || this.noAlphaPass )
{ {
itemsRendered++; this.itemsRendered++;
return true; return true;
} }
return false; return false;
@@ -171,7 +173,7 @@ public class BusRenderHelper implements IPartRenderHelper
{ {
RenderBlocksWorkaround rbw = BusRenderer.instance.renderer; 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.populate( sim );
rbw.faces = EnumSet.allOf( ForgeDirection.class ); rbw.faces = EnumSet.allOf( ForgeDirection.class );
@@ -187,35 +189,35 @@ public class BusRenderHelper implements IPartRenderHelper
rbw.calculations = true; rbw.calculations = true;
rbw.faces.clear(); rbw.faces.clear();
bbc.started = false; this.bbc.started = false;
if ( p == null ) if ( p == null )
{ {
bbc.minX = bbc.minY = bbc.minZ = 0; this.bbc.minX = this.bbc.minY = this.bbc.minZ = 0;
bbc.maxX = bbc.maxY = bbc.maxZ = 16; this.bbc.maxX = this.bbc.maxY = this.bbc.maxZ = 16;
} }
else else
{ {
p.getBoxes( bbc ); p.getBoxes( this.bbc );
if ( bbc.minX < 1 ) if ( this.bbc.minX < 1 )
bbc.minX = 1; this.bbc.minX = 1;
if ( bbc.minY < 1 ) if ( this.bbc.minY < 1 )
bbc.minY = 1; this.bbc.minY = 1;
if ( bbc.minZ < 1 ) if ( this.bbc.minZ < 1 )
bbc.minZ = 1; this.bbc.minZ = 1;
if ( bbc.maxX > 15 ) if ( this.bbc.maxX > 15 )
bbc.maxX = 15; this.bbc.maxX = 15;
if ( bbc.maxY > 15 ) if ( this.bbc.maxY > 15 )
bbc.maxY = 15; this.bbc.maxY = 15;
if ( bbc.maxZ > 15 ) if ( this.bbc.maxZ > 15 )
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 ); this.bbr.renderBlockBounds( rbw, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az );
rbw.renderStandardBlock( blk, x, y, z ); rbw.renderStandardBlock( this.blk, x, y, z );
rbw.faces = EnumSet.allOf( ForgeDirection.class ); rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.renderAllFaces = allFaces; rbw.renderAllFaces = allFaces;
@@ -245,17 +247,17 @@ public class BusRenderHelper implements IPartRenderHelper
case UNKNOWN: case UNKNOWN:
return 0.5; return 0.5;
case DOWN: case DOWN:
return minY; return this.minY;
case EAST: case EAST:
return maxX; return this.maxX;
case NORTH: case NORTH:
return minZ; return this.minZ;
case SOUTH: case SOUTH:
return maxZ; return this.maxZ;
case UP: case UP:
return maxY; return this.maxY;
case WEST: case WEST:
return minX; return this.minX;
} }
} }
@@ -263,13 +265,13 @@ public class BusRenderHelper implements IPartRenderHelper
@Override @Override
public void setInvColor(int newColor) public void setInvColor(int newColor)
{ {
color = newColor; this.color = newColor;
} }
@Override @Override
public void setTexture(IIcon ico) public void setTexture(IIcon ico)
{ {
blk.getRendererInstance().setTemporaryRenderIcon( ico ); this.blk.getRendererInstance().setTemporaryRenderIcon( ico );
} }
@Override @Override
@@ -284,16 +286,16 @@ public class BusRenderHelper implements IPartRenderHelper
list[4] = West; list[4] = West;
list[5] = East; list[5] = East;
blk.getRendererInstance().setTemporaryRenderIcons( list[mapRotation( ForgeDirection.UP ).ordinal()], this.blk.getRendererInstance().setTemporaryRenderIcons( list[this.mapRotation( ForgeDirection.UP ).ordinal()],
list[mapRotation( ForgeDirection.DOWN ).ordinal()], list[mapRotation( ForgeDirection.SOUTH ).ordinal()], list[this.mapRotation( ForgeDirection.DOWN ).ordinal()], list[this.mapRotation( ForgeDirection.SOUTH ).ordinal()],
list[mapRotation( ForgeDirection.NORTH ).ordinal()], list[mapRotation( ForgeDirection.EAST ).ordinal()], list[this.mapRotation( ForgeDirection.NORTH ).ordinal()], list[this.mapRotation( ForgeDirection.EAST ).ordinal()],
list[mapRotation( ForgeDirection.WEST ).ordinal()] ); list[this.mapRotation( ForgeDirection.WEST ).ordinal()] );
} }
public ForgeDirection mapRotation(ForgeDirection dir) public ForgeDirection mapRotation(ForgeDirection dir)
{ {
ForgeDirection forward = az; ForgeDirection forward = this.az;
ForgeDirection up = ay; ForgeDirection up = this.ay;
ForgeDirection west = ForgeDirection.UNKNOWN; ForgeDirection west = ForgeDirection.UNKNOWN;
if ( forward == null || up == null ) if ( forward == null || up == null )
@@ -328,22 +330,22 @@ public class BusRenderHelper implements IPartRenderHelper
@Override @Override
public void renderInventoryBox(RenderBlocks renderer) 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 ); 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 );
bbr.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, null, Tessellator.instance, color, renderer ); this.bbr.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), this.blk, null, Tessellator.instance, this.color, renderer );
} }
@Override @Override
public void renderInventoryFace(IIcon IIcon, ForgeDirection face, RenderBlocks renderer) 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 ); 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 );
setTexture( IIcon ); this.setTexture( IIcon );
bbr.renderInvBlock( EnumSet.of( face ), blk, null, Tessellator.instance, color, renderer ); this.bbr.renderInvBlock( EnumSet.of( face ), this.blk, null, Tessellator.instance, this.color, renderer );
} }
@Override @Override
public void renderBlock(int x, int y, int z, RenderBlocks renderer) public void renderBlock(int x, int y, int z, RenderBlocks renderer)
{ {
if ( !renderThis() ) if ( !this.renderThis() )
return; return;
AEBaseBlock blk = (AEBaseBlock) AEApi.instance().blocks().blockMultiPart.block(); AEBaseBlock blk = (AEBaseBlock) AEApi.instance().blocks().blockMultiPart.block();
@@ -360,7 +362,7 @@ public class BusRenderHelper implements IPartRenderHelper
renderer.uvRotateNorth = info.getTexture( ForgeDirection.NORTH ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.NORTH, forward, up ) ); 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 ) ); 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 ); renderer.renderStandardBlock( blk, x, y, z );
} }
@@ -379,7 +381,7 @@ public class BusRenderHelper implements IPartRenderHelper
public void prepareBounds(RenderBlocks renderer) 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 @Override
@@ -391,37 +393,37 @@ public class BusRenderHelper implements IPartRenderHelper
@Override @Override
public void renderBlockCurrentBounds(int x, int y, int z, RenderBlocks renderer) public void renderBlockCurrentBounds(int x, int y, int z, RenderBlocks renderer)
{ {
if ( !renderThis() ) if ( !this.renderThis() )
return; return;
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( this.blk, x, y, z );
} }
@Override @Override
public void renderFaceCutout(int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, RenderBlocks renderer) public void renderFaceCutout(int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, RenderBlocks renderer)
{ {
if ( !renderThis() ) if ( !this.renderThis() )
return; return;
switch (face) switch (face)
{ {
case DOWN: case DOWN:
face = ay.getOpposite(); face = this.ay.getOpposite();
break; break;
case EAST: case EAST:
face = ax; face = this.ax;
break; break;
case NORTH: case NORTH:
face = az.getOpposite(); face = this.az.getOpposite();
break; break;
case SOUTH: case SOUTH:
face = az; face = this.az;
break; break;
case UP: case UP:
face = ay; face = this.ay;
break; break;
case WEST: case WEST:
face = ax.getOpposite(); face = this.ax.getOpposite();
break; break;
case UNKNOWN: case UNKNOWN:
break; break;
@@ -429,35 +431,35 @@ public class BusRenderHelper implements IPartRenderHelper
break; break;
} }
bbr.renderCutoutFace( blk, ico, x, y, z, renderer, face, edgeThickness ); this.bbr.renderCutoutFace( this.blk, ico, x, y, z, renderer, face, edgeThickness );
} }
@Override @Override
public void renderFace(int x, int y, int z, IIcon ico, ForgeDirection face, RenderBlocks renderer) public void renderFace(int x, int y, int z, IIcon ico, ForgeDirection face, RenderBlocks renderer)
{ {
if ( !renderThis() ) if ( !this.renderThis() )
return; return;
prepareBounds( renderer ); this.prepareBounds( renderer );
switch (face) switch (face)
{ {
case DOWN: case DOWN:
face = ay.getOpposite(); face = this.ay.getOpposite();
break; break;
case EAST: case EAST:
face = ax; face = this.ax;
break; break;
case NORTH: case NORTH:
face = az.getOpposite(); face = this.az.getOpposite();
break; break;
case SOUTH: case SOUTH:
face = az; face = this.az;
break; break;
case UP: case UP:
face = ay; face = this.ay;
break; break;
case WEST: case WEST:
face = ax.getOpposite(); face = this.ax.getOpposite();
break; break;
case UNKNOWN: case UNKNOWN:
break; break;
@@ -465,37 +467,37 @@ public class BusRenderHelper implements IPartRenderHelper
break; break;
} }
bbr.renderFace( x, y, z, blk, ico, renderer, face ); this.bbr.renderFace( x, y, z, this.blk, ico, renderer, face );
} }
@Override @Override
public ForgeDirection getWorldX() public ForgeDirection getWorldX()
{ {
return ax; return this.ax;
} }
@Override @Override
public ForgeDirection getWorldY() public ForgeDirection getWorldY()
{ {
return ay; return this.ay;
} }
@Override @Override
public ForgeDirection getWorldZ() public ForgeDirection getWorldZ()
{ {
return az; return this.az;
} }
public void setOrientation(ForgeDirection dx, ForgeDirection dy, ForgeDirection dz) public void setOrientation(ForgeDirection dx, ForgeDirection dy, ForgeDirection dz)
{ {
ax = dx == null ? ForgeDirection.EAST : dx; this.ax = dx == null ? ForgeDirection.EAST : dx;
ay = dy == null ? ForgeDirection.UP : dy; this.ay = dy == null ? ForgeDirection.UP : dy;
az = dz == null ? ForgeDirection.SOUTH : dz; this.az = dz == null ? ForgeDirection.SOUTH : dz;
} }
public double[] getBounds() 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) public void setBounds(double[] bounds)
@@ -503,12 +505,12 @@ public class BusRenderHelper implements IPartRenderHelper
if ( bounds == null || bounds.length != 6 ) if ( bounds == null || bounds.length != 6 )
return; return;
minX = bounds[0]; this.minX = bounds[0];
minY = bounds[1]; this.minY = bounds[1];
minZ = bounds[2]; this.minZ = bounds[2];
maxX = bounds[3]; this.maxX = bounds[3];
maxY = bounds[4]; this.maxY = bounds[4];
maxZ = bounds[5]; this.maxZ = bounds[5];
} }
} }

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