Changed access to use this qualifier

This commit is contained in:
yueh
2014-12-29 15:13:47 +01:00
parent 2a5e57a59b
commit f471513bd0
604 changed files with 11573 additions and 11573 deletions
@@ -43,9 +43,9 @@ public class PartConversionMonitor extends PartStorageMonitor
public PartConversionMonitor(ItemStack is) {
super( PartConversionMonitor.class, is );
frontBright = CableBusTextures.PartConversionMonitor_Bright;
frontColored = CableBusTextures.PartConversionMonitor_Colored;
frontDark = CableBusTextures.PartConversionMonitor_Dark;
this.frontBright = CableBusTextures.PartConversionMonitor_Bright;
this.frontColored = CableBusTextures.PartConversionMonitor_Colored;
this.frontDark = CableBusTextures.PartConversionMonitor_Dark;
// frontSolid = CableBusTextures.PartConversionMonitor_Solid;
}
@@ -55,30 +55,30 @@ public class PartConversionMonitor extends PartStorageMonitor
if ( Platform.isClient() )
return true;
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
if ( !Platform.hasPermissions( getLocation(), player ) )
if ( !Platform.hasPermissions( this.getLocation(), player ) )
return false;
boolean ModeB = false;
ItemStack item = player.getCurrentEquippedItem();
if ( item == null && getDisplayed() != null )
if ( item == null && this.getDisplayed() != null )
{
ModeB = true;
item = ((IAEItemStack) getDisplayed()).getItemStack();
item = ((IAEItemStack) this.getDisplayed()).getItemStack();
}
if ( item != null )
{
try
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
IEnergySource energy = proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = proxy.getStorage().getItemInventory();
IEnergySource energy = this.proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
IAEItemStack input = AEItemStack.create( item );
if ( ModeB )
@@ -112,16 +112,16 @@ public class PartConversionMonitor extends PartStorageMonitor
@Override
protected void extractItem(EntityPlayer player)
{
IAEItemStack input = (IAEItemStack) getDisplayed();
IAEItemStack input = (IAEItemStack) this.getDisplayed();
if ( input != null )
{
try
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return;
IEnergySource energy = proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = proxy.getStorage().getItemInventory();
IEnergySource energy = this.proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
ItemStack is = input.getItemStack();
input.setStackSize( is.getMaxStackSize() );
@@ -134,9 +134,9 @@ public class PartConversionMonitor extends PartStorageMonitor
newItems = adaptor.addItems( newItems );
if ( newItems != null )
{
TileEntity te = tile;
TileEntity te = this.tile;
List<ItemStack> list = Collections.singletonList( newItems );
Platform.spawnDrops( player.worldObj, te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ, list );
Platform.spawnDrops( player.worldObj, te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ, list );
}
if ( player.openContainer != null )
@@ -38,14 +38,14 @@ public class PartCraftingTerminal extends PartTerminal
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
craftingGrid.writeToNBT( data, "craftingGrid" );
this.craftingGrid.writeToNBT( data, "craftingGrid" );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
craftingGrid.readFromNBT( data, "craftingGrid" );
this.craftingGrid.readFromNBT( data, "craftingGrid" );
}
@Override
@@ -53,16 +53,16 @@ public class PartCraftingTerminal extends PartTerminal
{
super.getDrops(drops, wrenched);
for (ItemStack is : craftingGrid)
for (ItemStack is : this.craftingGrid)
if ( is != null )
drops.add( is );
}
public PartCraftingTerminal(ItemStack is) {
super( PartCraftingTerminal.class, is );
frontBright = CableBusTextures.PartCraftingTerm_Bright;
frontColored = CableBusTextures.PartCraftingTerm_Colored;
frontDark = CableBusTextures.PartCraftingTerm_Dark;
this.frontBright = CableBusTextures.PartCraftingTerm_Bright;
this.frontColored = CableBusTextures.PartCraftingTerm_Colored;
this.frontDark = CableBusTextures.PartCraftingTerm_Dark;
// frontSolid = CableBusTextures.PartCraftingTerm_Solid;
}
@@ -70,14 +70,14 @@ public class PartCraftingTerminal extends PartTerminal
public GuiBridge getGui( EntityPlayer p )
{
int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ;
if ( getHost().getTile() != null )
if ( this.getHost().getTile() != null )
{
x = tile.xCoord;
y = tile.yCoord;
z = tile.zCoord;
x = this.tile.xCoord;
y = this.tile.yCoord;
z = this.tile.zCoord;
}
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) )
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
return GuiBridge.GUI_CRAFTING_TERMINAL;
return GuiBridge.GUI_ME;
}
@@ -85,14 +85,14 @@ public class PartCraftingTerminal extends PartTerminal
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
host.markForSave();
this.host.markForSave();
}
@Override
public IInventory getInventoryByName(String name)
{
if ( name.equals( "crafting" ) )
return craftingGrid;
return this.craftingGrid;
return super.getInventoryByName( name );
}
@@ -32,7 +32,7 @@ public class PartDarkMonitor extends PartMonitor
public PartDarkMonitor(ItemStack is) {
super( PartDarkMonitor.class, is, false );
notLightSource = false;
this.notLightSource = false;
}
@Override
@@ -42,11 +42,11 @@ public class PartDarkMonitor extends PartMonitor
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
rh.setInvColor( getColor().mediumVariant );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().mediumVariant );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -57,19 +57,19 @@ public class PartDarkMonitor extends PartMonitor
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
}
Tessellator.instance.setColorOpaque_I( getColor().mediumVariant );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
@@ -30,9 +30,9 @@ public class PartInterfaceTerminal extends PartMonitor
public PartInterfaceTerminal(ItemStack is) {
super( PartInterfaceTerminal.class, is, true );
frontBright = CableBusTextures.PartInterfaceTerm_Bright;
frontColored = CableBusTextures.PartInterfaceTerm_Colored;
frontDark = CableBusTextures.PartInterfaceTerm_Dark;
this.frontBright = CableBusTextures.PartInterfaceTerm_Bright;
this.frontColored = CableBusTextures.PartInterfaceTerm_Colored;
this.frontDark = CableBusTextures.PartInterfaceTerm_Dark;
}
@Override
@@ -45,7 +45,7 @@ public class PartInterfaceTerminal extends PartMonitor
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_INTERFACE_TERMINAL );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_INTERFACE_TERMINAL );
return true;
}
@@ -71,17 +71,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
byte rotation = (byte) (MathHelper.floor_double( (player.rotationYaw * 4F) / 360F + 2.5D ) & 3);
if ( side == ForgeDirection.UP )
spin = rotation;
this.spin = rotation;
else if ( side == ForgeDirection.DOWN )
spin = rotation;
this.spin = rotation;
}
@Override
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
data.setFloat( "opacity", opacity );
data.setByte( "spin", spin );
data.setFloat( "opacity", this.opacity );
data.setByte( "spin", this.spin );
}
@Override
@@ -89,35 +89,35 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
{
super.readFromNBT( data );
if ( data.hasKey( "opacity" ) )
opacity = data.getFloat( "opacity" );
spin = data.getByte( "spin" );
this.opacity = data.getFloat( "opacity" );
this.spin = data.getByte( "spin" );
}
@Override
public boolean onPartActivate(EntityPlayer player, Vec3 pos)
{
TileEntity te = getTile();
TileEntity te = this.getTile();
if ( !player.isSneaking() && Platform.isWrench( player, player.inventory.getCurrentItem(), te.xCoord, te.yCoord, te.zCoord ) )
{
if ( Platform.isServer() )
{
if ( spin > 3 )
spin = 0;
if ( this.spin > 3 )
this.spin = 0;
switch (spin)
switch (this.spin)
{
case 0:
spin = 1;
this.spin = 1;
break;
case 1:
spin = 3;
this.spin = 3;
break;
case 2:
spin = 0;
this.spin = 0;
break;
case 3:
spin = 2;
this.spin = 2;
break;
}
@@ -133,56 +133,56 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@MENetworkEventSubscribe
public void bootingRender(MENetworkBootingStatusChange c)
{
if ( notLightSource )
getHost().markForUpdate();
if ( this.notLightSource )
this.getHost().markForUpdate();
}
@Override
public void onNeighborChanged()
{
opacity = -1;
getHost().markForUpdate();
this.opacity = -1;
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@Override
public void writeToStream(ByteBuf data) throws IOException
{
super.writeToStream( data );
clientFlags = spin & 3;
this.clientFlags = this.spin & 3;
try
{
if ( proxy.getEnergy().isNetworkPowered() )
clientFlags = clientFlags | POWERED_FLAG;
if ( this.proxy.getEnergy().isNetworkPowered() )
this.clientFlags = this.clientFlags | this.POWERED_FLAG;
if ( proxy.getPath().isNetworkBooting() )
clientFlags = clientFlags | BOOTING_FLAG;
if ( this.proxy.getPath().isNetworkBooting() )
this.clientFlags = this.clientFlags | this.BOOTING_FLAG;
if ( proxy.getNode().meetsChannelRequirements() )
clientFlags = clientFlags | CHANNEL_FLAG;
if ( this.proxy.getNode().meetsChannelRequirements() )
this.clientFlags = this.clientFlags | this.CHANNEL_FLAG;
}
catch (GridAccessException e)
{
// um.. nothing.
}
data.writeByte( (byte) clientFlags );
data.writeByte( (byte) this.clientFlags );
}
@Override
public boolean readFromStream(ByteBuf data) throws IOException
{
super.readFromStream( data );
int oldFlags = clientFlags;
clientFlags = data.readByte();
spin = (byte) (clientFlags & 3);
if ( clientFlags == oldFlags )
int oldFlags = this.clientFlags;
this.clientFlags = data.readByte();
this.spin = (byte) (this.clientFlags & 3);
if ( this.clientFlags == oldFlags )
return false;
return true;
}
@@ -190,18 +190,18 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@Override
public int getLightLevel()
{
return blockLight( isPowered() ? (notLightSource ? 9 : 15) : 0 );
return this.blockLight( this.isPowered() ? (this.notLightSource ? 9 : 15) : 0 );
}
private int blockLight(int emit)
{
if ( opacity < 0 )
if ( this.opacity < 0 )
{
TileEntity te = this.getTile();
opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ );
this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
}
return (int) (emit * (opacity / 255.0f));
return (int) (emit * (this.opacity / 255.0f));
}
@Override
@@ -210,9 +210,9 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
try
{
if ( Platform.isServer() )
return proxy.getEnergy().isNetworkPowered();
return this.proxy.getEnergy().isNetworkPowered();
else
return ((clientFlags & POWERED_FLAG) == POWERED_FLAG);
return ((this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG);
}
catch (GridAccessException e)
{
@@ -229,11 +229,11 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
if ( requireChannel )
{
proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
proxy.setIdlePowerUsage( 1.0 / 2.0 );
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
this.proxy.setIdlePowerUsage( 1.0 / 2.0 );
}
else
proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
this.proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
}
@@ -244,17 +244,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
rh.setInvColor( getColor().whiteVariant );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().whiteVariant );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( getColor().mediumVariant );
rh.renderInventoryFace( frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().mediumVariant );
rh.renderInventoryFace( this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( getColor().blackVariant );
rh.renderInventoryFace( frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().blackVariant );
rh.renderInventoryFace( this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -264,15 +264,15 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
@@ -280,43 +280,43 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this.spin;
Tessellator.instance.setColorOpaque_I( getColor().whiteVariant );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( getColor().mediumVariant );
rh.renderFace( x, y, z, frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant );
rh.renderFace( x, y, z, this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( getColor().blackVariant );
rh.renderFace( x, y, z, frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant );
rh.renderFace( x, y, z, this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
if ( notLightSource )
if ( this.notLightSource )
{
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
}
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
if ( notLightSource )
if ( this.notLightSource )
{
boolean hasChan = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
boolean hasPower = (clientFlags & POWERED_FLAG) == POWERED_FLAG;
boolean hasChan = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG);
boolean hasPower = (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG;
if ( hasChan )
{
int l = 14;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant );
}
else if ( hasPower )
{
int l = 9;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant );
}
else
{
@@ -342,10 +342,10 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@Override
public boolean isActive()
{
if ( notLightSource )
return ((clientFlags & (CHANNEL_FLAG | POWERED_FLAG)) == (CHANNEL_FLAG | POWERED_FLAG));
if ( this.notLightSource )
return ((this.clientFlags & (this.CHANNEL_FLAG | this.POWERED_FLAG)) == (this.CHANNEL_FLAG | this.POWERED_FLAG));
else
return isPowered();
return this.isPowered();
}
}
@@ -45,49 +45,49 @@ public class PartPatternTerminal extends PartTerminal
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
data.setBoolean( "craftingMode", isCraftingRecipe() );
pattern.writeToNBT( data, "pattern" );
output.writeToNBT( data, "outputList" );
crafting.writeToNBT( data, "craftingGrid" );
data.setBoolean( "craftingMode", this.isCraftingRecipe() );
this.pattern.writeToNBT( data, "pattern" );
this.output.writeToNBT( data, "outputList" );
this.crafting.writeToNBT( data, "craftingGrid" );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
setCraftingRecipe( data.getBoolean( "craftingMode" ) );
pattern.readFromNBT( data, "pattern" );
output.readFromNBT( data, "outputList" );
crafting.readFromNBT( data, "craftingGrid" );
this.setCraftingRecipe( data.getBoolean( "craftingMode" ) );
this.pattern.readFromNBT( data, "pattern" );
this.output.readFromNBT( data, "outputList" );
this.crafting.readFromNBT( data, "craftingGrid" );
}
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
for (ItemStack is : pattern)
for (ItemStack is : this.pattern)
if ( is != null )
drops.add( is );
}
public PartPatternTerminal(ItemStack is) {
super( PartPatternTerminal.class, is );
frontBright = CableBusTextures.PartPatternTerm_Bright;
frontColored = CableBusTextures.PartPatternTerm_Colored;
frontDark = CableBusTextures.PartPatternTerm_Dark;
this.frontBright = CableBusTextures.PartPatternTerm_Bright;
this.frontColored = CableBusTextures.PartPatternTerm_Colored;
this.frontDark = CableBusTextures.PartPatternTerm_Dark;
}
@Override
public GuiBridge getGui( EntityPlayer p )
{
int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ;
if ( getHost().getTile() != null )
if ( this.getHost().getTile() != null )
{
x = tile.xCoord;
y = tile.yCoord;
z = tile.zCoord;
x = this.tile.xCoord;
y = this.tile.yCoord;
z = this.tile.zCoord;
}
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) )
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
return GuiBridge.GUI_PATTERN_TERMINAL;
return GuiBridge.GUI_ME;
}
@@ -96,13 +96,13 @@ public class PartPatternTerminal extends PartTerminal
public IInventory getInventoryByName(String name)
{
if ( name.equals( "crafting" ) )
return crafting;
return this.crafting;
if ( name.equals( "output" ) )
return output;
return this.output;
if ( name.equals( "pattern" ) )
return pattern;
return this.pattern;
return super.getInventoryByName( name );
}
@@ -110,57 +110,57 @@ public class PartPatternTerminal extends PartTerminal
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
if ( inv == pattern && slot == 1 )
if ( inv == this.pattern && slot == 1 )
{
ItemStack is = pattern.getStackInSlot( 1 );
ItemStack is = this.pattern.getStackInSlot( 1 );
if ( is != null && is.getItem() instanceof ICraftingPatternItem )
{
ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
ICraftingPatternDetails details = pattern.getPatternForItem( is, this.getHost().getTile().getWorldObj() );
if ( details != null )
{
setCraftingRecipe( details.isCraftable() );
this.setCraftingRecipe( details.isCraftable() );
for (int x = 0; x < crafting.getSizeInventory() && x < details.getInputs().length; x++)
for (int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++)
{
IAEItemStack item = details.getInputs()[x];
crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
this.crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
}
for (int x = 0; x < output.getSizeInventory() && x < details.getOutputs().length; x++)
for (int x = 0; x < this.output.getSizeInventory() && x < details.getOutputs().length; x++)
{
IAEItemStack item = details.getOutputs()[x];
output.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
this.output.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
}
}
}
}
else if ( inv == crafting )
else if ( inv == this.crafting )
{
fixCraftingRecipes();
this.fixCraftingRecipes();
}
host.markForSave();
this.host.markForSave();
}
public boolean isCraftingRecipe()
{
return craftingMode;
return this.craftingMode;
}
public void setCraftingRecipe(boolean craftingMode)
{
this.craftingMode = craftingMode;
fixCraftingRecipes();
this.fixCraftingRecipes();
}
private void fixCraftingRecipes()
{
if ( isCraftingRecipe() )
if ( this.isCraftingRecipe() )
{
for (int x = 0; x < crafting.getSizeInventory(); x++)
for (int x = 0; x < this.crafting.getSizeInventory(); x++)
{
ItemStack is = crafting.getStackInSlot( x );
ItemStack is = this.crafting.getStackInSlot( x );
if ( is != null )
is.stackSize = 1;
}
@@ -32,7 +32,7 @@ public class PartSemiDarkMonitor extends PartMonitor
public PartSemiDarkMonitor(ItemStack is) {
super( PartSemiDarkMonitor.class, is,false );
notLightSource = false;
this.notLightSource = false;
}
@Override
@@ -42,14 +42,14 @@ public class PartSemiDarkMonitor extends PartMonitor
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
int light = getColor().whiteVariant;
int dark = getColor().mediumVariant;
int light = this.getColor().whiteVariant;
int dark = this.getColor().mediumVariant;
rh.setInvColor( (((((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2) << 16) | (((((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2) << 8)
| ((((light) & 0xff) + ((dark) & 0xff)) / 2) );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -60,22 +60,22 @@ public class PartSemiDarkMonitor extends PartMonitor
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
}
int light = getColor().whiteVariant;
int dark = getColor().mediumVariant;
int light = this.getColor().whiteVariant;
int dark = this.getColor().mediumVariant;
Tessellator.instance.setColorOpaque( (((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2, (((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2,
(((light) & 0xff) + ((dark) & 0xff)) / 2 );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
@@ -72,11 +72,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.writeToNBT( data );
data.setBoolean( "isLocked", isLocked );
data.setBoolean( "isLocked", this.isLocked );
NBTTagCompound myItem = new NBTTagCompound();
if ( configuredItem != null )
configuredItem.writeToNBT( myItem );
if ( this.configuredItem != null )
this.configuredItem.writeToNBT( myItem );
data.setTag( "configuredItem", myItem );
}
@@ -86,10 +86,10 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.readFromNBT( data );
isLocked = data.getBoolean( "isLocked" );
this.isLocked = data.getBoolean( "isLocked" );
NBTTagCompound myItem = data.getCompoundTag( "configuredItem" );
configuredItem = AEItemStack.loadItemStackFromNBT( myItem );
this.configuredItem = AEItemStack.loadItemStackFromNBT( myItem );
}
@Override
@@ -97,11 +97,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.writeToStream( data );
data.writeByte( spin );
data.writeBoolean( isLocked );
data.writeBoolean( configuredItem != null );
if ( configuredItem != null )
configuredItem.writeToPacket( data );
data.writeByte( this.spin );
data.writeBoolean( this.isLocked );
data.writeBoolean( this.configuredItem != null );
if ( this.configuredItem != null )
this.configuredItem.writeToPacket( data );
}
@Override
@@ -109,15 +109,15 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
boolean stuff = super.readFromStream( data );
spin = data.readByte();
isLocked = data.readBoolean();
this.spin = data.readByte();
this.isLocked = data.readBoolean();
boolean val = data.readBoolean();
if ( val )
configuredItem = AEItemStack.loadItemStackFromPacket( data );
this.configuredItem = AEItemStack.loadItemStackFromPacket( data );
else
configuredItem = null;
this.configuredItem = null;
updateList = true;
this.updateList = true;
return stuff;
}
@@ -128,28 +128,28 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
if ( Platform.isClient() )
return true;
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
if ( !Platform.hasPermissions( getLocation(), player ) )
if ( !Platform.hasPermissions( this.getLocation(), player ) )
return false;
TileEntity te = this.tile;
ItemStack eq = player.getCurrentEquippedItem();
if ( Platform.isWrench( player, eq, te.xCoord, te.yCoord, te.zCoord ) )
{
isLocked = !isLocked;
player.addChatMessage( (isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() );
this.isLocked = !this.isLocked;
player.addChatMessage( (this.isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() );
this.getHost().markForUpdate();
}
else if ( !isLocked )
else if ( !this.isLocked )
{
configuredItem = AEItemStack.create( eq );
configureWatchers();
this.configuredItem = AEItemStack.create( eq );
this.configureWatchers();
this.getHost().markForUpdate();
}
else
extractItem( player );
this.extractItem( player );
return true;
}
@@ -165,9 +165,9 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
public PartStorageMonitor(ItemStack is) {
super( PartStorageMonitor.class, is, true );
frontBright = CableBusTextures.PartStorageMonitor_Bright;
frontColored = CableBusTextures.PartStorageMonitor_Colored;
frontDark = CableBusTextures.PartStorageMonitor_Dark;
this.frontBright = CableBusTextures.PartStorageMonitor_Bright;
this.frontColored = CableBusTextures.PartStorageMonitor_Colored;
this.frontDark = CableBusTextures.PartStorageMonitor_Dark;
// frontSolid = CableBusTextures.PartStorageMonitor_Solid;
}
@@ -188,39 +188,39 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
protected void finalize() throws Throwable
{
super.finalize();
if ( dspList != null )
GLAllocation.deleteDisplayLists( dspList );
if ( this.dspList != null )
GLAllocation.deleteDisplayLists( this.dspList );
}
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer)
{
if ( dspList == null )
dspList = GLAllocation.generateDisplayLists( 1 );
if ( this.dspList == null )
this.dspList = GLAllocation.generateDisplayLists( 1 );
Tessellator tess = Tessellator.instance;
if ( Platform.isDrawing( tess ) )
return;
if ( (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) != (POWERED_FLAG | CHANNEL_FLAG) )
if ( (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) != (this.POWERED_FLAG | this.CHANNEL_FLAG) )
return;
IAEItemStack ais = (IAEItemStack) getDisplayed();
IAEItemStack ais = (IAEItemStack) this.getDisplayed();
if ( ais != null )
{
GL11.glPushMatrix();
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
if ( updateList )
if ( this.updateList )
{
updateList = false;
GL11.glNewList( dspList, GL11.GL_COMPILE_AND_EXECUTE );
tesrRenderScreen( tess, ais );
this.updateList = false;
GL11.glNewList( this.dspList, GL11.GL_COMPILE_AND_EXECUTE );
this.tesrRenderScreen( tess, ais );
GL11.glEndList();
}
else
GL11.glCallList( dspList );
GL11.glCallList( this.dspList );
GL11.glPopMatrix();
}
@@ -229,21 +229,21 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
private void tesrRenderScreen(Tessellator tess, IAEItemStack ais)
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
ForgeDirection d = side;
ForgeDirection d = this.side;
GL11.glTranslated( d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77 );
if ( d == ForgeDirection.UP )
{
GL11.glScalef( 1.0f, -1.0f, 1.0f );
GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
GL11.glRotatef( spin * 90.0F, 0, 0, 1 );
GL11.glRotatef( this.spin * 90.0F, 0, 0, 1 );
}
if ( d == ForgeDirection.DOWN )
{
GL11.glScalef( 1.0f, -1.0f, 1.0f );
GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f );
GL11.glRotatef( spin * -90.0F, 0, 0, 1 );
GL11.glRotatef( this.spin * -90.0F, 0, 0, 1 );
}
if ( d == ForgeDirection.EAST )
@@ -323,13 +323,13 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
@Override
public IAEStack getDisplayed()
{
return configuredItem;
return this.configuredItem;
}
@Override
public boolean isLocked()
{
return isLocked;
return this.isLocked;
}
IStackWatcher myWatcher;
@@ -337,24 +337,24 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
@Override
public void updateWatcher(IStackWatcher newWatcher)
{
myWatcher = newWatcher;
configureWatchers();
this.myWatcher = newWatcher;
this.configureWatchers();
}
// update the system...
public void configureWatchers()
{
if ( myWatcher != null )
myWatcher.clear();
if ( this.myWatcher != null )
this.myWatcher.clear();
try
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
if ( myWatcher != null )
myWatcher.add( configuredItem );
if ( this.myWatcher != null )
this.myWatcher.add( this.configuredItem );
updateReportingValue( proxy.getStorage().getItemInventory() );
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
}
}
catch (GridAccessException e)
@@ -365,27 +365,27 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
private void updateReportingValue(IMEMonitor<IAEItemStack> itemInventory)
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
IAEItemStack result = itemInventory.getStorageList().findPrecise( configuredItem );
IAEItemStack result = itemInventory.getStorageList().findPrecise( this.configuredItem );
if ( result == null )
configuredItem.setStackSize( 0 );
this.configuredItem.setStackSize( 0 );
else
configuredItem.setStackSize( result.getStackSize() );
this.configuredItem.setStackSize( result.getStackSize() );
}
}
@Override
public void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan)
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
if ( fullStack == null )
configuredItem.setStackSize( 0 );
this.configuredItem.setStackSize( 0 );
else
configuredItem.setStackSize( fullStack.getStackSize() );
this.configuredItem.setStackSize( fullStack.getStackSize() );
getHost().markForUpdate();
this.getHost().markForUpdate();
}
}
@@ -52,9 +52,9 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
public PartTerminal(Class clz, ItemStack is) {
super( clz, is, true );
cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
}
@Override
@@ -62,7 +62,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
super.getDrops( drops, wrenched );
for (ItemStack is : viewCell)
for (ItemStack is : this.viewCell)
if ( is != null )
drops.add( is );
}
@@ -71,28 +71,28 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
cm.readFromNBT( data );
viewCell.readFromNBT( data, "viewCell" );
this.cm.readFromNBT( data );
this.viewCell.readFromNBT( data, "viewCell" );
}
@Override
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
cm.writeToNBT( data );
viewCell.writeToNBT( data, "viewCell" );
this.cm.writeToNBT( data );
this.viewCell.writeToNBT( data, "viewCell" );
}
public PartTerminal(ItemStack is) {
super( PartTerminal.class, is, true );
frontBright = CableBusTextures.PartTerminal_Bright;
frontColored = CableBusTextures.PartTerminal_Colored;
frontDark = CableBusTextures.PartTerminal_Dark;
this.frontBright = CableBusTextures.PartTerminal_Bright;
this.frontColored = CableBusTextures.PartTerminal_Colored;
this.frontDark = CableBusTextures.PartTerminal_Dark;
// frontSolid = CableBusTextures.PartTerminal_Solid;
cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
}
public GuiBridge getGui( EntityPlayer player )
@@ -110,7 +110,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, getGui( player ) );
Platform.openGUI( player, this.getHost().getTile(), this.side, this.getGui( player ) );
return true;
}
@@ -123,7 +123,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
try
{
return proxy.getStorage().getFluidInventory();
return this.proxy.getStorage().getFluidInventory();
}
catch (GridAccessException e)
{
@@ -137,7 +137,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
try
{
return proxy.getStorage().getItemInventory();
return this.proxy.getStorage().getItemInventory();
}
catch (GridAccessException e)
{
@@ -149,7 +149,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
@Override
public IConfigManager getConfigManager()
{
return cm;
return this.cm;
}
@Override
@@ -161,12 +161,12 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
@Override
public IInventory getViewCellStorage()
{
return viewCell;
return this.viewCell;
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
host.markForSave();
this.host.markForSave();
}
}