Reduce scope of variables

This commit is contained in:
thatsIch 2015-09-25 22:52:41 +02:00
parent f4ff28d2a6
commit 0387d30d1c
78 changed files with 174 additions and 218 deletions

View file

@ -408,21 +408,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
public void registerBlockIcons( IIconRegister iconRegistry )
{
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon topIcon;
final FlippableIcon bottomIcon;
final FlippableIcon sideIcon;
final FlippableIcon eastIcon;
final FlippableIcon westIcon;
final FlippableIcon southIcon;
final FlippableIcon northIcon;
final FlippableIcon topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
final FlippableIcon bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
final FlippableIcon sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
final FlippableIcon eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
final FlippableIcon westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
final FlippableIcon southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
final FlippableIcon northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
this.blockIcon = topIcon;
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
}
@ -557,7 +551,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
final ForgeDirection forward = ori.getForward();
final ForgeDirection up = ori.getUp();
ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null )
{
@ -568,6 +561,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
ForgeDirection west = ForgeDirection.UNKNOWN;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )

View file

@ -103,8 +103,6 @@ public class AEBaseItemBlock extends ItemBlock
ForgeDirection up = ForgeDirection.UNKNOWN;
ForgeDirection forward = ForgeDirection.UNKNOWN;
IOrientable ori = null;
if( this.blockType instanceof AEBaseTileBlock )
{
if( this.blockType instanceof BlockLightDetector )
@ -167,6 +165,7 @@ public class AEBaseItemBlock extends ItemBlock
}
}
IOrientable ori = null;
if( this.blockType instanceof IOrientableBlock )
{
ori = ( (IOrientableBlock) this.blockType ).getOrientable( w, x, y, z );

View file

@ -84,13 +84,12 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
double ry = 0.5 + y;
double rz = 0.5 + z;
double dx = 0;
double dz = 0;
rx += up.offsetX * d0;
ry += up.offsetY * d0;
rz += up.offsetZ * d0;
double dz = 0;
double dx = 0;
switch( r.nextInt( 4 ) )
{
case 0:

View file

@ -140,7 +140,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
TileSkyChest sk = this.getTileEntity( w, x, y, z );
double sc = 0.06;
ForgeDirection o = ForgeDirection.UNKNOWN;
if( sk != null )
@ -152,6 +151,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
double offsetY = o.offsetY == 0 ? 0.06 : 0.0;
double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0;
double sc = 0.06;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) );
}

View file

@ -818,14 +818,14 @@ public abstract class AEBaseGui extends GuiContainer
float par2 = aes.yDisplayPosition;
float par3 = uv_x * 16;
float par4 = uv_y * 16;
float par5 = 16;
float par6 = 16;
float f = 0.00390625F;
float f1 = 0.00390625F;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() );
float f1 = 0.00390625F;
float f = 0.00390625F;
float par6 = 16;
tessellator.addVertexWithUV( par1 + 0, par2 + par6, this.zLevel, ( par3 + 0 ) * f, ( par4 + par6 ) * f1 );
float par5 = 16;
tessellator.addVertexWithUV( par1 + par5, par2 + par6, this.zLevel, ( par3 + par5 ) * f, ( par4 + par6 ) * f1 );
tessellator.addVertexWithUV( par1 + par5, par2 + 0, this.zLevel, ( par3 + par5 ) * f, ( par4 + 0 ) * f1 );
tessellator.addVertexWithUV( par1 + 0, par2 + 0, this.zLevel, ( par3 + 0 ) * f, ( par4 + 0 ) * f1 );

View file

@ -138,15 +138,14 @@ public class GuiCraftConfirm extends AEBaseGui
this.start.enabled = !( this.ccc.noCPU || this.isSimulation() );
this.selectCPU.enabled = !this.isSimulation();
int x = 0;
int y = 0;
int gx = ( this.width - this.xSize ) / 2;
int gy = ( this.height - this.ySize ) / 2;
int offY = 23;
this.tooltip = -1;
int offY = 23;
int y = 0;
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 9 + x * 67;
@ -269,7 +268,6 @@ public class GuiCraftConfirm extends AEBaseGui
int negY = ( ( lines - 1 ) * 5 ) / 2;
int downY = 0;
boolean red = false;
if( stored != null && stored.getStackSize() > 0 )
{
@ -295,6 +293,7 @@ public class GuiCraftConfirm extends AEBaseGui
downY += 5;
}
boolean red = false;
if( missingStack != null && missingStack.getStackSize() > 0 )
{
String str = Long.toString( missingStack.getStackSize() );

View file

@ -154,15 +154,14 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
this.cancel.enabled = !this.visual.isEmpty();
int x = 0;
int y = 0;
final int gx = ( this.width - this.xSize ) / 2;
final int gy = ( this.height - this.ySize ) / 2;
final int offY = 23;
this.tooltip = -1;
final int offY = 23;
int y = 0;
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 9 + x * 67;
@ -192,7 +191,6 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
@ -216,6 +214,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int offY = 23;
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ )
{
IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
@ -229,18 +228,18 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
final IAEItemStack pendingStack = this.pending.findPrecise( refStack );
int lines = 0;
boolean active = false;
boolean scheduled = false;
if( stored != null && stored.getStackSize() > 0 )
{
lines++;
}
boolean active = false;
if( activeStack != null && activeStack.getStackSize() > 0 )
{
lines++;
active = true;
}
boolean scheduled = false;
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
lines++;

View file

@ -66,8 +66,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
if( s != null )
{
PacketInventoryAction p;
p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
NetworkHandler.instance.sendToServer( p );
}
}

View file

@ -98,7 +98,6 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
int offset = 17;
int ex = this.myScrollBar.getCurrentScroll();
Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
@ -110,6 +109,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
}
int offset = 17;
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
{
Object lineObj = this.lines.get( ex + x );

View file

@ -393,9 +393,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
{
int x_width = 197;
this.bindTexture( this.getBackground() );
int x_width = 197;
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
if( this.viewCell || ( this instanceof GuiSecurity ) )

View file

@ -91,14 +91,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
@Override
public void drawScreen( int mouseX, int mouseY, float btn )
{
int x = 0;
int y = 0;
int gx = ( this.width - this.xSize ) / 2;
int gy = ( this.height - this.ySize ) / 2;
this.tooltip = -1;
int y = 0;
int x = 0;
for( int z = 0; z <= 4 * 5; z++ )
{
int minX = gx + 14 + x * 31;

View file

@ -59,9 +59,6 @@ public class GuiVibrationChamber extends AEBaseGui
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
int k = 25;
int l = -15;
this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " AE/t" );
if( this.cvc.getCurrentProgress() > 0 )
@ -69,6 +66,8 @@ public class GuiVibrationChamber extends AEBaseGui
int i1 = this.cvc.getCurrentProgress();
this.bindTexture( "guis/vibchamber.png" );
GL11.glColor3f( 1, 1, 1 );
int l = -15;
int k = 25;
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
}
}

View file

@ -415,15 +415,13 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
public void preRenderInWorld( B block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{
ForgeDirection forward = ForgeDirection.SOUTH;
ForgeDirection up = ForgeDirection.UP;
BlockRenderInfo info = block.getRendererInstance();
IOrientable te = this.getOrientable( block, world, x, y, z );
if( te != null )
{
forward = te.getForward();
up = te.getUp();
ForgeDirection forward = te.getForward();
ForgeDirection up = te.getUp();
renderer.uvRotateBottom = info.getTexture( ForgeDirection.DOWN ).setFlip( getOrientation( ForgeDirection.DOWN, forward, up ) );
renderer.uvRotateTop = info.getTexture( ForgeDirection.UP ).setFlip( getOrientation( ForgeDirection.UP, forward, up ) );
@ -510,9 +508,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
double offsetY = 0.0;
double offsetZ = 0.0;
double layerAX = 0.0;
double layerAY = 0.0;
double layerAZ = 0.0;
double layerBX = 0.0;
double layerBY = 0.0;
double layerBZ = 0.0;
@ -569,6 +565,8 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
offsetY += y;
offsetZ += z;
double layerBX = 0.0;
double layerAY = 0.0;
this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ,
// u -> u
0, 1.0,
@ -681,11 +679,11 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
public void renderTile( B block, T tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{
ForgeDirection forward = ForgeDirection.SOUTH;
ForgeDirection up = ForgeDirection.UP;
renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0;
ForgeDirection up = ForgeDirection.UP;
ForgeDirection forward = ForgeDirection.SOUTH;
this.applyTESRRotation( x, y, z, forward, up );
Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );

View file

@ -396,7 +396,6 @@ public final class BusRenderHelper implements IPartRenderHelper
{
ForgeDirection forward = this.az;
ForgeDirection up = this.ay;
ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null )
{
@ -407,6 +406,7 @@ public final class BusRenderHelper implements IPartRenderHelper
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
ForgeDirection west = ForgeDirection.UNKNOWN;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )

View file

@ -122,9 +122,9 @@ public class CableRenderHelper
IFacadePart fPart = iFacadeContainer.getFacade( s );
if( fPart != null )
{
AxisAlignedBB b = null;
fPart.setThinFacades( useThinFacades );
AxisAlignedBB pb = fPart.getPrimaryBox();
AxisAlignedBB b = null;
for( AxisAlignedBB bb : boxes )
{
if( bb.intersectsWith( pb ) )

View file

@ -57,7 +57,6 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
@Override
public boolean renderInWorld( B blk, IBlockAccess w, int x, int y, int z, RenderBlocks renderer )
{
IIcon theIcon = null;
boolean formed = false;
boolean emitsLight = false;
@ -70,7 +69,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
int meta = w.getBlockMetadata( x, y, z ) & 3;
boolean isMonitor = blk.getClass() == BlockCraftingMonitor.class;
theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
IIcon theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
IIcon nonForward = theIcon;
if( isMonitor )
@ -301,10 +300,9 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRingLong.getIcon() );
}
double width = 3.0 / 16.0;
if( !( i.getBound( a ) < 0.001 || i.getBound( a ) > 15.999 ) )
{
double width = 3.0 / 16.0;
switch( a )
{
case DOWN:

View file

@ -63,11 +63,8 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
Tessellator tess = Tessellator.instance;
int lumen = 14 << 20 | 14 << 4;
int brightness = imb.getMixedBrightnessForBlock( world, x, y, z );
double offsetConstant = 0.001;
EnumSet<ForgeDirection> validSides = EnumSet.noneOf( ForgeDirection.class );
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
@ -78,6 +75,8 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
}
}
double offsetConstant = 0.001;
int lumen = 14 << 20 | 14 << 4;
for( Splotch s : tp.getDots() )
{
if( !validSides.contains( s.side ) )

View file

@ -61,12 +61,11 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
final float lidAngle = 0.0f;
GL11.glScalef( 1.0F, -1F, -1F );
GL11.glTranslatef( -0.0F, -1.0F, -1.0F );
this.model.chestLid.offsetY = -( 0.9f / 16.0f );
final float lidAngle = 0.0f;
this.model.chestLid.rotateAngleX = -( ( lidAngle * 3.141593F ) / 2.0F );
this.model.renderAll();

View file

@ -85,7 +85,6 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
this.selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 );
int offsetU = -4;
int offsetV = 8;
if( stat == 0 )
{
@ -96,6 +95,7 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
Tessellator.instance.setBrightness( b );
Tessellator.instance.setColorOpaque_I( 0xffffff );
int offsetU = -4;
FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) );
if( forward == ForgeDirection.EAST && ( up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH ) )
{

View file

@ -118,8 +118,8 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
renderMax = 12.1f / 16.0f;
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
int bn = 15;
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
int bn = 15;
Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
{
@ -146,8 +146,8 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
renderMax = 16.01f / 16.0f;
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
int bn = 15;
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
int bn = 15;
Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
{

View file

@ -49,18 +49,12 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
{
Tessellator tess = Tessellator.instance;
float Point2 = 6.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float singlePixel = 1.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float renderTop = 10.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float top = 8.0f / 16.0f;
float xOff = 0.0f;
float yOff = 0.0f;
float zOff = 0.0f;
@ -68,6 +62,7 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff );
this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
float singlePixel = 1.0f / 16.0f;
renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff );
this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
@ -78,6 +73,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
renderer.renderAllFaces = true;
float top = 8.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point2 = 6.0f / 16.0f;
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
@ -100,23 +99,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
{
IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, x, y, z );
float Point2 = 6.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float singlePixel = 1.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float renderTop = 10.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float top = 8.0f / 16.0f;
float xOff = 0.0f;
float yOff = 0.0f;
float zOff = 0.0f;
renderer.renderAllFaces = true;
float zOff = 0.0f;
float yOff = 0.0f;
float xOff = 0.0f;
if( te != null )
{
ForgeDirection forward = te.getUp();
@ -125,10 +111,15 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
zOff = forward.offsetZ * -( 4.0f / 16.0f );
}
float renderTop = 10.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff );
super.renderInWorld( block, world, x, y, z, renderer );
int r = ( x + y + z ) % 2;
float singlePixel = 1.0f / 16.0f;
if( r == 0 )
{
renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff );
@ -148,6 +139,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
block.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
float top = 8.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point2 = 6.0f / 16.0f;
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
boolean out = renderer.renderStandardBlock( block, x, y, z );

View file

@ -59,10 +59,10 @@ public class RenderSpatialPylon extends BaseBlockRender<BlockSpatialPylon, TileS
TileSpatialPylon sp = imb.getTileEntity( world, x, y, z );
int displayBits = ( sp == null ) ? 0 : sp.getDisplayBits();
ForgeDirection ori = ForgeDirection.UNKNOWN;
if( displayBits != 0 )
{
ForgeDirection ori = ForgeDirection.UNKNOWN;
if( ( displayBits & TileSpatialPylon.DISPLAY_Z ) == TileSpatialPylon.DISPLAY_X )
{
ori = ForgeDirection.EAST;

View file

@ -85,7 +85,6 @@ public class CraftingFx extends EntityBreakingFX
float offX = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick );
float offY = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick );
float offZ = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( offX );
int blkY = MathHelper.floor_double( offY );
@ -97,6 +96,7 @@ public class CraftingFx extends EntityBreakingFX
offZ -= interpPosZ;
// AELog.info( "" + partialTick );
float f14 = 1.0F;
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale, f7, f9 );
par1Tessellator.addVertexWithUV( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale, f7, f8 );

View file

@ -79,7 +79,6 @@ public class EnergyFx extends EntityBreakingFX
float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX );
float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY );
float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ );
float f14 = 1.0F;
int blkX = MathHelper.floor_double( this.posX );
int blkY = MathHelper.floor_double( this.posY );
@ -87,6 +86,7 @@ public class EnergyFx extends EntityBreakingFX
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
float f14 = 1.0F;
par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 );
par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8 );

View file

@ -60,7 +60,6 @@ public class PaintBallRender implements IItemRenderer
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
float f12 = 0.0625F;
ItemPaintBall ipb = (ItemPaintBall) item.getItem();
@ -75,11 +74,10 @@ public class PaintBallRender implements IItemRenderer
int g = ( colorValue >> 8 ) & 0xff;
int b = ( colorValue ) & 0xff;
int full = (int) ( 255 * 0.3 );
float fail = 0.7f;
if( item.getItemDamage() >= 20 )
{
float fail = 0.7f;
int full = (int) ( 255 * 0.3 );
GL11.glColor4ub( (byte) ( full + r * fail ), (byte) ( full + g * fail ), (byte) ( full + b * fail ), (byte) 255 );
}
else
@ -112,6 +110,7 @@ public class PaintBallRender implements IItemRenderer
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
}
float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );

View file

@ -58,7 +58,6 @@ public class ToolBiometricCardRender implements IItemRenderer
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
float f12 = 0.0625F;
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
@ -83,6 +82,7 @@ public class ToolBiometricCardRender implements IItemRenderer
else
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );
@ -111,7 +111,6 @@ public class ToolBiometricCardRender implements IItemRenderer
GL11.glDisable( GL11.GL_LIGHTING );
tessellator.startDrawingQuads();
float z = 0;
AEColor col = AEColor.values()[Math.abs( 3 + hash ) % AEColor.values().length];
if( hash == 0 )
@ -119,12 +118,12 @@ public class ToolBiometricCardRender implements IItemRenderer
col = AEColor.Black;
}
float z = 0;
for( int x = 0; x < 8; x++ )// 8
{
for( int y = 0; y < 6; y++ )// 6
{
boolean isLit = false;
float scale = 0.3f / 255.0f;
if( x == 0 || y == 0 || x == 7 || y == 5 )
{
@ -141,6 +140,7 @@ public class ToolBiometricCardRender implements IItemRenderer
}
else
{
float scale = 0.3f / 255.0f;
tessellator.setColorOpaque_F( ( ( col.blackVariant >> 16 ) & 0xff ) * scale, ( ( col.blackVariant >> 8 ) & 0xff ) * scale, ( col.blackVariant & 0xff ) * scale );
}

View file

@ -56,7 +56,6 @@ public class ToolColorApplicatorRender implements IItemRenderer
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
float f12 = 0.0625F;
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
@ -92,6 +91,7 @@ public class ToolColorApplicatorRender implements IItemRenderer
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
}
float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );
@ -112,9 +112,7 @@ public class ToolColorApplicatorRender implements IItemRenderer
}
GL11.glDisable( GL11.GL_LIGHTING );
AEColor col = null;
col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item );
AEColor col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item );
if( col != null )
{

View file

@ -475,7 +475,6 @@ public abstract class AEBaseContainer extends Container
return null;
}
ItemStack tis = null;
AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots!
if( clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessible )
@ -484,7 +483,7 @@ public abstract class AEBaseContainer extends Container
}
if( clickSlot != null && clickSlot.getHasStack() )
{
tis = clickSlot.getStack();
ItemStack tis = clickSlot.getStack();
if( tis == null )
{

View file

@ -91,9 +91,6 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
@Override
protected void setupConfig()
{
int x = 8;
int y = 29;
int offset = 0;
IInventory cell = this.upgradeable.getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) );
@ -102,6 +99,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
IInventory upgradeInventory = new Upgrades();
// null, 3 * 8 );
int offset = 0;
int y = 29;
int x = 8;
for( int w = 0; w < 7; w++ )
{
for( int z = 0; z < 9; z++ )

View file

@ -217,7 +217,6 @@ public class ContainerCraftConfirm extends AEBaseContainer
for( IAEItemStack out : plan )
{
IAEItemStack m = null;
IAEItemStack o = out.copy();
o.reset();
@ -230,6 +229,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class );
IMEInventory<IAEItemStack> items = sg.getItemInventory();
IAEItemStack m = null;
if( c != null && this.result.isSimulation() )
{
m = o.copy();

View file

@ -153,7 +153,6 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
if( ( s == this.top && bot != null ) || ( s == this.bottom && top != null ) )
{
boolean isValid = false;
ItemStack otherSlot = null;
if( s == this.top )
{
@ -172,6 +171,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
}
// everything else
boolean isValid = false;
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) )

View file

@ -76,8 +76,6 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
@Override
protected void setupConfig()
{
int x = 80 + 44;
int y = 40;
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
if( this.availableUpgrades() > 0 )
@ -98,6 +96,8 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
}
IInventory inv = this.upgradeable.getInventoryByName( "config" );
int y = 40;
int x = 80 + 44;
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
}

View file

@ -107,10 +107,9 @@ public class ContainerNetworkStatus extends AEBaseContainer
this.maxPower = (long) ( 100.0 * eg.getMaxStoredPower() );
}
PacketMEInventoryUpdate piu;
try
{
piu = new PacketMEInventoryUpdate();
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
for( Class<? extends IGridHost> machineClass : this.network.getMachinesClasses() )
{

View file

@ -133,11 +133,11 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
protected void setupConfig()
{
int x = 80;
int y = 40;
this.setupUpgrades();
IInventory inv = this.upgradeable.getInventoryByName( "config" );
int y = 40;
int x = 80;
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
if( this.supportCapacity() )

View file

@ -115,14 +115,14 @@ public final class AEConfig extends Configuration implements IConfigurableObject
FMLCommonHandler.instance().bus().register( this );
final double DEFAULT_IC2_EXCHANGE = 2.0;
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
final double DEFAULT_RF_EXCHANGE = 0.5;
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
final double DEFAULT_IC2_EXCHANGE = 2.0;
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
final double DEFAULT_RF_EXCHANGE = 0.5;
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );

View file

@ -238,12 +238,11 @@ public class ApiPart implements IPartHelper
public ClassNode getReader( String name )
{
ClassReader cr;
String path = '/' + name.replace( ".", "/" ) + ".class";
InputStream is = this.getClass().getResourceAsStream( path );
try
{
cr = new ClassReader( is );
ClassReader cr = new ClassReader( is );
ClassNode cn = new ClassNode();
cr.accept( cn, ClassReader.EXPAND_FRAMES );

View file

@ -54,10 +54,9 @@ public final class GridCacheRegistry implements IGridCacheRegistry
for( Class<? extends IGridCache> iface : this.caches.keySet() )
{
Constructor<? extends IGridCache> c;
try
{
c = this.caches.get( iface ).getConstructor( IGrid.class );
Constructor<? extends IGridCache> c = this.caches.get( iface ).getConstructor( IGrid.class );
map.put( iface, c.newInstance( g ) );
}
catch( NoSuchMethodException e )

View file

@ -544,7 +544,6 @@ public enum GuiBridge implements IGuiHandler
{
if( te instanceof IActionHost && this.requiredPermission != null )
{
boolean requirePower = false;
IGridNode gn = ( (IActionHost) te ).getActionableNode();
if( gn != null )
@ -552,6 +551,7 @@ public enum GuiBridge implements IGuiHandler
IGrid g = gn.getGrid();
if( g != null )
{
boolean requirePower = false;
if( requirePower )
{
IEnergyGrid eg = g.getCache( IEnergyGrid.class );

View file

@ -40,13 +40,12 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
public void onPacketData( INetworkInfo network, FMLProxyPacket packet, EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
player = Minecraft.getMinecraft().thePlayer;
try
{
packetType = stream.readInt();
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
pack.clientPacketData( network, pack, player );
}

View file

@ -39,11 +39,10 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
public void onPacketData( INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
try
{
packetType = stream.readInt();
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
pack.serverPacketData( manager, pack, player );
}

View file

@ -92,10 +92,9 @@ public class PacketCraftRequest extends AppEngPacket
return;
}
Future<ICraftingJob> futureJob = null;
cca.whatToMake.setStackSize( this.amount );
Future<ICraftingJob> futureJob = null;
try
{
ICraftingGrid cg = g.getCache( ICraftingGrid.class );

View file

@ -98,13 +98,13 @@ public class ToolDebugCard extends AEBaseItem
IPathingGrid pg = g.getCache( IPathingGrid.class );
if( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
{
int length = 0;
Set<IGridNode> next = new HashSet<IGridNode>();
next.add( node );
int maxLength = 10000;
int length = 0;
outer:
while( !next.isEmpty() )
{

View file

@ -65,10 +65,10 @@ public class ToolEraser extends AEBaseItem
Block blk = world.getBlock( x, y, z );
int meta = world.getBlockMetadata( x, y, z );
int blocks = 0;
List<WorldCoord> next = new LinkedList<WorldCoord>();
next.add( new WorldCoord( x, y, z ) );
int blocks = 0;
while( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() )
{
List<WorldCoord> c = next;

View file

@ -70,15 +70,14 @@ public class FMPEvent
BlockCoord pos = new BlockCoord( hit.blockX, hit.blockY, hit.blockZ ).offset( hit.sideHit );
ItemStack held = player.getHeldItem();
TMultiPart part = null;
Block blk = null;
if( held == null )
{
return false;
}
Block blk = null;
TMultiPart part = null;
if( held.getItem() instanceof AEBaseItemBlock )
{
AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem();

View file

@ -633,10 +633,10 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
private boolean usePlan( int x, IAEItemStack itemStack )
{
boolean changed = false;
InventoryAdaptor adaptor = this.getAdaptor( x );
this.isWorking = true;
boolean changed = false;
try
{
this.destination = this.gridProxy.getStorage().getItemInventory();

View file

@ -99,10 +99,9 @@ public class MultiCraftingTracker
}
else if( craftingJob != null )
{
ICraftingJob job = null;
try
{
ICraftingJob job = null;
if( craftingJob.isDone() )
{
job = craftingJob.get();

View file

@ -166,8 +166,8 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
throw new IllegalStateException( "No pattern here!" );
}
int offset = 0;
this.condensedInputs = new IAEItemStack[tmpInputs.size()];
int offset = 0;
for( IAEItemStack io : tmpInputs.values() )
{
this.condensedInputs[offset] = io;

View file

@ -101,12 +101,12 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule
// crafting terminal...
Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class );
Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" );
Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class );
registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() );
registerGuiOverlay.invoke( this.apiClass, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder() );
Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
Constructor defaultConstructor = defaultHandler.getConstructor( int.class, int.class );
registrar.invoke( this.apiClass, GuiCraftingTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" );
registrar.invoke( this.apiClass, GuiPatternTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" );

View file

@ -160,7 +160,6 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
int targetZ = max.z - min.z - 1;
int maxSize = this.getMaxStoredDim( is );
int floorBuffer = 64;
World destination = this.getWorld( is );
if( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) )
@ -172,6 +171,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
destination = this.createNewWorld( is );
}
int floorBuffer = 64;
StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
this.setStoredSize( is, targetX, targetY, targetZ );

View file

@ -119,7 +119,6 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
public boolean onItemUse( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
{
Block blk = w.getBlock( x, y, z );
double powerPerUse = 100;
ItemStack paintBall = this.getColor( is );
@ -143,6 +142,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
return false;
}
double powerPerUse = 100;
if( paintBall != null && paintBall.getItem() instanceof ItemSnowball )
{
ForgeDirection orientation = ForgeDirection.getOrientation( side );

View file

@ -211,9 +211,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
Entity entity = null;
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;
int l;
for( l = 0; l < list.size(); ++l )
for( int l = 0; l < list.size(); ++l )
{
Entity entity1 = (Entity) list.get( l );
@ -335,9 +334,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
Entity entity = null;
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;
int l;
for( l = 0; l < list.size(); ++l )
for( int l = 0; l < list.size(); ++l )
{
Entity entity1 = (Entity) list.get( l );

View file

@ -308,9 +308,9 @@ public class PathGridCache implements IPathingGrid
private int calculateRequiredChannels()
{
int depth = 0;
this.semiOpen.clear();
int depth = 0;
for( IGridNode nodes : this.requireChannels )
{
if( !this.semiOpen.contains( nodes ) )

View file

@ -64,13 +64,6 @@ public class SpatialPylonCache implements ISpatialCache
public void reset( IGrid grid )
{
int reqX = 0;
int reqY = 0;
int reqZ = 0;
int requirePylonBlocks = 1;
double minPower = 0;
double maxPower = 0;
this.clusters = new HashMap<SpatialPylonCluster, SpatialPylonCluster>();
this.ioPorts = new LinkedList<TileSpatialIOPort>();
@ -120,6 +113,8 @@ public class SpatialPylonCache implements ISpatialCache
this.captureMax.z = Math.max( this.captureMax.z, cl.max.z );
}
double maxPower = 0;
double minPower = 0;
if( this.hasRegion() )
{
this.isValid = this.captureMax.x - this.captureMin.x > 1 && this.captureMax.y - this.captureMin.y > 1 && this.captureMax.z - this.captureMin.z > 1;
@ -149,10 +144,10 @@ public class SpatialPylonCache implements ISpatialCache
}
}
reqX = this.captureMax.x - this.captureMin.x;
reqY = this.captureMax.y - this.captureMin.y;
reqZ = this.captureMax.z - this.captureMin.z;
requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 );
int reqX = this.captureMax.x - this.captureMin.x;
int reqY = this.captureMax.y - this.captureMin.y;
int reqZ = this.captureMax.z - this.captureMin.z;
int requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 );
this.efficiency = (double) pylonBlocks / (double) requirePylonBlocks;

View file

@ -1292,12 +1292,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
this.lastTime = System.nanoTime();
this.elapsedTime = 0;
int itemCount = 0;
final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
this.getListOfItem( list, CraftingItemList.ACTIVE );
this.getListOfItem( list, CraftingItemList.PENDING );
int itemCount = 0;
for( IAEItemStack ge : list )
{
itemCount += ge.getStackSize();

View file

@ -128,9 +128,8 @@ public class QuantumCalculator extends MBCalculator
{
TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z );
byte flags;
num++;
byte flags;
if( num == 5 )
{
flags = num;

View file

@ -79,9 +79,8 @@ public class QuantumCluster implements ILocatable, IAECluster
@Override
public void updateStatus( boolean updateGrid )
{
long qe;
qe = this.center.getQEFrequency();
long qe = this.center.getQEFrequency();
if( this.thisSide != qe && this.thisSide != -qe )
{

View file

@ -128,7 +128,6 @@ public class MEIInventoryWrapper implements IMEInventory<IAEItemStack>
@Override
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
{
ItemStack Gathered = null;
ItemStack Req = request.getItemStack();
int request_stackSize = Req.stackSize;
@ -140,6 +139,7 @@ public class MEIInventoryWrapper implements IMEInventory<IAEItemStack>
Req.stackSize = request_stackSize;
ItemStack Gathered = null;
if( this.adaptor != null )
{
Gathered = this.adaptor.removeItems( Req.stackSize, Req, null );

View file

@ -141,12 +141,12 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>
public TickRateModulation onTick()
{
boolean changed = false;
LinkedList<IAEItemStack> changes = new LinkedList<IAEItemStack>();
int high = 0;
this.list.resetStatus();
int high = 0;
boolean changed = false;
for( ItemSlot is : this.adaptor )
{
CachedItemStack old = this.memory.get( is.slot );

View file

@ -168,10 +168,9 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
IGrid gn = n.getGrid();
if( gn != this.security.myGrid )
{
int playerID = -1;
ISecurityGrid sg = gn.getCache( ISecurityGrid.class );
playerID = sg.getOwner();
int playerID = sg.getOwner();
if( !this.security.hasPermission( playerID, permission ) )
{

View file

@ -921,11 +921,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
for( int x = 0; x < 7; x++ )
{
ItemStack is = null;
IPart p = this.getPart( ForgeDirection.getOrientation( x ) );
if( p != null )
{
is = p.getItemStack( PartItemStack.Network );
ItemStack is = p.getItemStack( PartItemStack.Network );
data.writeShort( Item.getIdFromItem( is.getItem() ) );
data.writeShort( is.getItemDamage() );

View file

@ -161,9 +161,6 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
protected void renderStaticWithIcon( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, IIcon activeIcon )
{
int minX = 1;
int minY = 1;
int maxX = 15;
int maxY = 15;
final ForgeDirection e = rh.getWorldX();
final ForgeDirection u = rh.getWorldY();
@ -175,16 +172,19 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
minX = 0;
}
int maxX = 15;
if( this.isAnnihilationPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
{
maxX = 16;
}
int minY = 1;
if( this.isAnnihilationPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
{
minY = 0;
}
int maxY = 15;
if( this.isAnnihilationPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
{
maxY = 16;

View file

@ -284,9 +284,6 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
{
int minX = 1;
int minY = 1;
int maxX = 15;
int maxY = 15;
ForgeDirection e = rh.getWorldX();
ForgeDirection u = rh.getWorldY();
@ -298,16 +295,19 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
minX = 0;
}
int maxX = 15;
if( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
{
maxX = 16;
}
int minY = 1;
if( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
{
minY = 0;
}
int maxY = 15;
if( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
{
maxY = 16;

View file

@ -288,8 +288,6 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
private int calculateMaximumAmountToImport( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor<IAEItemStack> inv, FuzzyMode fzMode )
{
final int toSend = Math.min( this.itemToSend, 64 );
final ItemStack simResult;
final IAEItemStack itemAmountNotStorable;
final ItemStack itemStackToImport;
if( whatToImport == null )
@ -301,6 +299,8 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
itemStackToImport = whatToImport.getItemStack();
}
final IAEItemStack itemAmountNotStorable;
final ItemStack simResult;
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
{
simResult = myAdaptor.simulateSimilarRemove( toSend, itemStackToImport, fzMode, this.configDestination( inv ) );

View file

@ -433,9 +433,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
baseY += 7.0 / 16.0;
double par10 = 0;
// double par11 = 0;
double Zero = 0;
/*
* double d5 = (double)IIcon.func_94209_e(); double d6 = (double)IIcon.func_94206_g(); double d7 =
@ -475,9 +473,6 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
double var38 = baseX + 0.5D;
double var40 = baseZ - 0.5D;
double var42 = baseZ + 0.5D;
double var44 = 0.0625D;
double var422 = 0.1915D + 1.0 / 16.0;
double TorchLen = 0.625D;
double toff = 0.0d;
@ -493,11 +488,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
var12.setBrightness( 11 << 20 | 11 << 4 );
}
double TorchLen = 0.625D;
double var44 = 0.0625D;
double Zero = 0;
double par10 = 0;
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 );
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 );
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 );
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 );
double var422 = 0.1915D + 1.0 / 16.0;
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b );
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b );
this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b );

View file

@ -59,11 +59,8 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
public void notifyNeighbors()
{
// cache of inventory state.
int[][] sideData = null;
List<ISidedInventory> inventories = null;
List<InvSot> slots = null;
inventories = new ArrayList<ISidedInventory>();
List<ISidedInventory> inventories = new ArrayList<ISidedInventory>();
int slotCount = 0;
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
@ -77,6 +74,8 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
}
List<InvSot> slots = null;
int[][] sideData = null;
if( inventories.isEmpty() || slotCount == 0 )
{
inventories = null;

View file

@ -464,10 +464,10 @@ public class PartCable extends AEBasePart implements IPartCable
if( Platform.isServer() )
{
IGridNode node = this.getGridNode();
int howMany = 0;
if( node != null )
{
int howMany = 0;
for( IGridConnection gc : node.getConnections() )
{
howMany = Math.max( gc.getUsedChannels(), howMany );
@ -815,11 +815,11 @@ public class PartCable extends AEBasePart implements IPartCable
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
AEColor myColor = this.getCableColor();
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );
boolean isGlass = false;
if( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent )
{
isGlass = true;

View file

@ -365,7 +365,6 @@ public class PartDenseCable extends PartCable
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
AEColor myColor = this.getCableColor();
/*
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS &&
@ -434,6 +433,7 @@ public class PartDenseCable extends PartCable
rh.renderBlock( x, y, z, renderer );
rh.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
boolean isGlass = false;
if( !isGlass )
{
this.setSmartConnectionRotations( of, renderer );

View file

@ -149,9 +149,9 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
}
int available = resource.amount;
int used = 0;
i = list.iterator();
int used = 0;
while( i.hasNext() )
{
PartP2PLiquids l = i.next();

View file

@ -193,8 +193,6 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
return 0;
}
int total = 0;
Stack<PartP2PRFPower> stack = this.getDepth();
for( PartP2PRFPower t : stack )
@ -207,6 +205,7 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
stack.push( this );
int total = 0;
try
{
for( PartP2PRFPower t : this.getOutputs() )
@ -235,8 +234,6 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
return 0;
}
int total = 0;
Stack<PartP2PRFPower> stack = this.getDepth();
for( PartP2PRFPower t : stack )
@ -249,6 +246,7 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
stack.push( this );
int total = 0;
try
{
for( PartP2PRFPower t : this.getOutputs() )

View file

@ -88,10 +88,9 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
return null;
}
PartP2PTunnel tunnel;
try
{
tunnel = this.proxy.getP2P().getInput( this.freq );
PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq );
if( this.getClass().isInstance( tunnel ) )
{
return (T) tunnel;

View file

@ -454,10 +454,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
else
{
IEnergyGrid eg;
try
{
eg = this.gridProxy.getEnergy();
IEnergyGrid eg = this.gridProxy.getEnergy();
IEnergySource src = this;
// Base 1, increase by 1 for each card

View file

@ -100,10 +100,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
{
if( this.cb.requiresDynamicRender )
{
TileCableBus tcb;
try
{
tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance();
TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance();
tcb.copyFrom( this );
this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb );
}

View file

@ -30,10 +30,9 @@ public class TileCableBusTESR extends TileCableBus
{
if( !this.cb.requiresDynamicRender )
{
TileCableBus tcb;
try
{
tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance();
TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance();
tcb.copyFrom( this );
this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb );
}

View file

@ -343,10 +343,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
{
double stash = 0.0;
IEnergyGrid eg;
try
{
eg = this.gridProxy.getEnergy();
IEnergyGrid eg = this.gridProxy.getEnergy();
stash = eg.extractAEPower( amt, mode, PowerMultiplier.ONE );
if( stash >= amt )
{
@ -950,7 +949,6 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
{
if( TileChest.this.getTile() instanceof IActionHost && requiredPermission != null )
{
boolean requirePower = false;
IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode();
if( gn != null )
@ -958,6 +956,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
IGrid g = gn.getGrid();
if( g != null )
{
boolean requirePower = false;
if( requirePower )
{
IEnergyGrid eg = g.getCache( IEnergyGrid.class );

View file

@ -205,7 +205,6 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
private void recalculateDisplay()
{
int oldState = 0;
boolean currentActive = this.gridProxy.isActive();
if( currentActive )
@ -235,6 +234,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
this.state |= ( this.getCellStatus( x ) << ( 3 * x ) );
}
int oldState = 0;
if( oldState != this.state )
{
this.markForUpdate();

View file

@ -171,7 +171,6 @@ public final class ASMIntegration implements IClassTransformer
}
String iFace = null;
String iName = null;
if( an.values.get( 0 ).equals( "iface" ) )
{
@ -182,6 +181,7 @@ public final class ASMIntegration implements IClassTransformer
iFace = (String) an.values.get( 3 );
}
String iName = null;
if( an.values.get( 0 ).equals( "iname" ) )
{
iName = ( (String[]) an.values.get( 1 ) )[1];

View file

@ -187,9 +187,6 @@ public class Platform
PowerUnits displayUnits = AEConfig.instance.selectedPowerUnit();
p = PowerUnits.AE.convertTo( displayUnits, p );
int offset = 0;
String level = "";
String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
String unitName = displayUnits.name();
if( displayUnits == PowerUnits.WA )
@ -202,6 +199,20 @@ public class Platform
unitName = "J";
}
String[] preFixes = new String[] {
"k",
"M",
"G",
"T",
"P",
"T",
"P",
"E",
"Z",
"Y"
};
String level = "";
int offset = 0;
while( p > 1000 && offset < preFixes.length )
{
p /= 1000;
@ -1372,9 +1383,8 @@ public class Platform
if( hitEntities )
{
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
int l;
for( l = 0; l < list.size(); ++l )
for( int l = 0; l < list.size(); ++l )
{
Entity entity1 = (Entity) list.get( l );
@ -1634,7 +1644,6 @@ public class Platform
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
int offset = 0;
int[] sides = ( (ISidedInventory) target ).getAccessibleSlotsFromSide( dir.ordinal() );
@ -1643,6 +1652,7 @@ public class Platform
return 0;
}
int offset = 0;
for( int side : sides )
{
int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() );
@ -1729,10 +1739,10 @@ public class Platform
public static void configurePlayer( EntityPlayer player, ForgeDirection side, TileEntity tile )
{
float pitch = 0.0f;
float yaw = 0.0f;
player.yOffset = 1.8f;
float yaw = 0.0f;
float pitch = 0.0f;
switch( side )
{
case DOWN:

View file

@ -446,7 +446,6 @@ public final class MeteoritePlacer
public boolean spawnMeteorite( IMeteoriteWorld w, int x, int y, int z )
{
int validBlocks = 0;
if( !w.hasNoSky() )
{
@ -502,6 +501,7 @@ public final class MeteoritePlacer
}
}
int validBlocks = 0;
for( int i = x - 15; i < x + 15; i++ )
{
for( int j = y - 15; j < y + 15; j++ )