diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index 7b02ef52..11ccac53 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -72,15 +72,15 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient return; } - TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z ); + TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z ); - if( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) + if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) { double d0 = r.nextFloat() - 0.5F; double d1 = r.nextFloat() - 0.5F; - ForgeDirection up = tileQuartzGrowthAccelerator.getUp(); - ForgeDirection forward = tileQuartzGrowthAccelerator.getForward(); + ForgeDirection up = cga.getUp(); + ForgeDirection forward = cga.getForward(); ForgeDirection west = Platform.crossProduct( forward, up ); double rx = 0.5 + x; diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index fe1de65b..22f1e8d6 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -129,14 +129,14 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli @Override public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) { - double OnePx = 2.0 / 16.0; - return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); + double onePixel = 2.0 / 16.0; + return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } @Override public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) { - double OnePx = 2.0 / 16.0; - out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); + double onePixel = 2.0 / 16.0; + out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } } diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index b8bc40c4..8a4d8f20 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -82,32 +82,32 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) { - double OnePx = 2.0 / 16.0; + double onePixel = 2.0 / 16.0; TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null && bridge.isCorner() ) { - OnePx = 4.0 / 16.0; + onePixel = 4.0 / 16.0; } else if( bridge != null && bridge.isFormed() ) { - OnePx = 1.0 / 16.0; + onePixel = 1.0 / 16.0; } - return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); + return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } @Override public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) { - double OnePx = 2.0 / 16.0; + double onePixel = 2.0 / 16.0; TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null && bridge.isCorner() ) { - OnePx = 4.0 / 16.0; + onePixel = 4.0 / 16.0; } else if( bridge != null && bridge.isFormed() ) { - OnePx = 1.0 / 16.0; + onePixel = 1.0 / 16.0; } - out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); + out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } } diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index 18cb99b1..97b9f9aa 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -148,11 +148,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision o = sk.getUp(); } - double X = o.offsetX == 0 ? 0.06 : 0.0; - double Y = o.offsetY == 0 ? 0.06 : 0.0; - double Z = o.offsetZ == 0 ? 0.06 : 0.0; + double offsetX = o.offsetX == 0 ? 0.06 : 0.0; + double offsetY = o.offsetY == 0 ? 0.06 : 0.0; + double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0; - return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ), Math.max( 0.0, Z - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - X ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - Y ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - Z ) - o.offsetZ * sc ) ) ); + return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) ); } @Override diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java index a0ae285f..c1a1be4c 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java @@ -99,13 +99,13 @@ public class RenderBlockPaint extends BaseBlockRender double offset = offsetConstant; offsetConstant += 0.001; - double H = 0.1; + double buffer = 0.1; double pos_x = s.x(); double pos_y = s.y(); - pos_x = Math.max( H, Math.min( 1.0 - H, pos_x ) ); - pos_y = Math.max( H, Math.min( 1.0 - H, pos_y ) ); + pos_x = Math.max( buffer, Math.min( 1.0 - buffer, pos_x ) ); + pos_y = Math.max( buffer, Math.min( 1.0 - buffer, pos_y ) ); if( s.side == ForgeDirection.SOUTH || s.side == ForgeDirection.NORTH ) { @@ -131,47 +131,47 @@ public class RenderBlockPaint extends BaseBlockRender { case UP: offset = 1.0 - offset; - tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x - buffer, y + offset, pos_y - buffer, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x + buffer, y + offset, pos_y - buffer, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x + buffer, y + offset, pos_y + buffer, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x - buffer, y + offset, pos_y + buffer, ico.getMinU(), ico.getMaxV() ); break; case DOWN: - tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x + buffer, y + offset, pos_y - buffer, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x - buffer, y + offset, pos_y - buffer, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x - buffer, y + offset, pos_y + buffer, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x + buffer, y + offset, pos_y + buffer, ico.getMinU(), ico.getMaxV() ); break; case EAST: offset = 1.0 - offset; - tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( x + offset, pos_x + buffer, pos_y - buffer, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( x + offset, pos_x - buffer, pos_y - buffer, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( x + offset, pos_x - buffer, pos_y + buffer, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( x + offset, pos_x + buffer, pos_y + buffer, ico.getMinU(), ico.getMaxV() ); break; case WEST: - tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( x + offset, pos_x - buffer, pos_y - buffer, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( x + offset, pos_x + buffer, pos_y - buffer, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( x + offset, pos_x + buffer, pos_y + buffer, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( x + offset, pos_x - buffer, pos_y + buffer, ico.getMinU(), ico.getMaxV() ); break; case SOUTH: offset = 1.0 - offset; - tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x + buffer, pos_y - buffer, z + offset, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x - buffer, pos_y - buffer, z + offset, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x - buffer, pos_y + buffer, z + offset, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x + buffer, pos_y + buffer, z + offset, ico.getMinU(), ico.getMaxV() ); break; case NORTH: - tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() ); - tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() ); - tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x - buffer, pos_y - buffer, z + offset, ico.getMinU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x + buffer, pos_y - buffer, z + offset, ico.getMaxU(), ico.getMinV() ); + tess.addVertexWithUV( pos_x + buffer, pos_y + buffer, z + offset, ico.getMaxU(), ico.getMaxV() ); + tess.addVertexWithUV( pos_x - buffer, pos_y + buffer, z + offset, ico.getMinU(), ico.getMaxV() ); break; default: diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index 22315797..a1f31d8d 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -24,6 +24,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.concurrent.Future; +import com.google.common.collect.ImmutableSet; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -32,8 +34,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; -import com.google.common.collect.ImmutableSet; - import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.SecurityPermissions; @@ -323,27 +323,27 @@ public class ContainerCraftConfirm extends AEBaseContainer public void startJob() { - GuiBridge OriginalGui = null; + GuiBridge originalGui = null; IActionHost ah = this.getActionHost(); if( ah instanceof WirelessTerminalGuiObject ) { - OriginalGui = GuiBridge.GUI_WIRELESS_TERM; + originalGui = GuiBridge.GUI_WIRELESS_TERM; } if( ah instanceof PartTerminal ) { - OriginalGui = GuiBridge.GUI_ME; + originalGui = GuiBridge.GUI_ME; } if( ah instanceof PartCraftingTerminal ) { - OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL; + originalGui = GuiBridge.GUI_CRAFTING_TERMINAL; } if( ah instanceof PartPatternTerminal ) { - OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL; + originalGui = GuiBridge.GUI_PATTERN_TERMINAL; } if( this.result != null && !this.simulation ) @@ -351,12 +351,12 @@ public class ContainerCraftConfirm extends AEBaseContainer ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); this.autoStart = false; - if( g != null && OriginalGui != null && this.openContext != null ) + if( g != null && originalGui != null && this.openContext != null ) { - NetworkHandler.instance.sendTo( new PacketSwitchGuis( OriginalGui ), (EntityPlayerMP) this.invPlayer.player ); + NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.invPlayer.player ); TileEntity te = this.openContext.getTile(); - Platform.openGUI( this.invPlayer.player, te, this.openContext.side, OriginalGui ); + Platform.openGUI( this.invPlayer.player, te, this.openContext.side, originalGui ); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index cfb3c5b4..70dd268e 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -240,9 +240,9 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.updatePowerStatus(); - boolean oldCanAccessViewCells = this.canAccessViewCells; + boolean oldAccessible = this.canAccessViewCells; this.canAccessViewCells = this.hasAccess( SecurityPermissions.BUILD, false ); - if( this.canAccessViewCells != oldCanAccessViewCells ) + if( this.canAccessViewCells != oldAccessible ) { for( int y = 0; y < 5; y++ ) { diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index f66635c2..c0c2ef2b 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -84,25 +84,25 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul this.parent = generator; RecipeTemplate craftingTemplate; - RecipeTemplate smallCraftingTemplate; + RecipeTemplate smallTemplate; if( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle ) { craftingTemplate = generator.createRecipeTemplate( this.craftingSlotsOwnBackground, null ); - smallCraftingTemplate = generator.createRecipeTemplate( this.smallCraftingSlotsOwnBackground, null ); + smallTemplate = generator.createRecipeTemplate( this.smallCraftingSlotsOwnBackground, null ); } else { craftingTemplate = new DefaultRecipeTemplate( this.craftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, 79, 58 ) ); - smallCraftingTemplate = new DefaultRecipeTemplate( this.smallCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, 79, 58 ) ); + smallTemplate = new DefaultRecipeTemplate( this.smallCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, 79, 58 ) ); } RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( this.shapelessCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, 79, 58 ) ); RecipeTemplate furnaceTemplate = new DefaultRecipeTemplate( this.furnaceSlots, new ItemStack( Blocks.furnace ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 181, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 181, 79, 58 ) ); - this.addCraftingRecipes( craftingTemplate, smallCraftingTemplate, shapelessTemplate, this ); + this.addCraftingRecipes( craftingTemplate, smallTemplate, shapelessTemplate, this ); this.addGrinderRecipes( furnaceTemplate, this ); this.addInscriberRecipes( furnaceTemplate, this ); } diff --git a/src/main/java/appeng/integration/modules/NEI.java b/src/main/java/appeng/integration/modules/NEI.java index 3f360ab3..9e13313a 100644 --- a/src/main/java/appeng/integration/modules/NEI.java +++ b/src/main/java/appeng/integration/modules/NEI.java @@ -95,16 +95,16 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler // crafting terminal... Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); - Class IOverlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); - Class DefaultOverlayHandler = NEICraftingHandler.class; + Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); + Class defaultHandler = NEICraftingHandler.class; - Method registerGuiOverlayHandler = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, IOverlayHandler, String.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() ); - Constructor DefaultOverlayHandlerConstructor = DefaultOverlayHandler.getConstructor( int.class, int.class ); - registerGuiOverlayHandler.invoke( this.apiClass, GuiCraftingTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); - registerGuiOverlayHandler.invoke( this.apiClass, GuiPatternTerm.class, DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" ); + 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" ); } public void registerRecipeHandler( Object o ) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java index d83cc1fc..f7b12c65 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java @@ -193,13 +193,13 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor public ItemStack simulateAdd( ItemStack toBeSimulated ) { int items = this.cs.getSpaceForItem( toBeSimulated ); - ItemStack B = Platform.cloneItemStack( toBeSimulated ); + ItemStack cloned = Platform.cloneItemStack( toBeSimulated ); if( toBeSimulated.stackSize <= items ) { return null; } - B.stackSize -= items; - return B; + cloned.stackSize -= items; + return cloned; } @Override diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index 7c56b5c9..f198937c 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -22,6 +22,8 @@ package appeng.items.tools.powered; import java.util.EnumSet; import java.util.List; +import com.google.common.base.Optional; + import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.entity.Entity; @@ -41,8 +43,6 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.google.common.base.Optional; - import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -325,10 +325,10 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell private void standardAmmo( float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 ) { - boolean hasDestroyedSomething = true; - while( penetration > 0 && hasDestroyedSomething ) + boolean hasDestroyed = true; + while( penetration > 0 && hasDestroyed ) { - hasDestroyedSomething = false; + hasDestroyed = false; AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); @@ -408,17 +408,17 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell el.attackEntityFrom( dmgSrc, dmg ); if( !el.isEntityAlive() ) { - hasDestroyedSomething = true; + hasDestroyed = true; } } else if( pos.entityHit instanceof EntityItem ) { - hasDestroyedSomething = true; + hasDestroyed = true; pos.entityHit.setDead(); } else if( pos.entityHit.attackEntityFrom( dmgSrc, dmg ) ) { - hasDestroyedSomething = true; + hasDestroyed = true; } } else if( pos.typeOfHit == MovingObjectType.BLOCK ) @@ -438,7 +438,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { if( penetration > hardness && Platform.hasPermissions( new DimensionalCoord( w, pos.blockX, pos.blockY, pos.blockZ ), p ) ) { - hasDestroyedSomething = true; + hasDestroyed = true; penetration -= hardness; penetration *= 0.60; w.func_147480_a( pos.blockX, pos.blockY, pos.blockZ, true ); diff --git a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java index 538023c7..eb192059 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java @@ -164,40 +164,40 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i return amount; } - LinkedList Options = new LinkedList(); + LinkedList options = new LinkedList(); for( PartP2PIC2Power o : outs ) { if( o.OutputEnergyA <= 0.01 ) { - Options.add( o ); + options.add( o ); } } - if( Options.isEmpty() ) + if( options.isEmpty() ) { for( PartP2PIC2Power o : outs ) { if( o.OutputEnergyB <= 0.01 ) { - Options.add( o ); + options.add( o ); } } } - if( Options.isEmpty() ) + if( options.isEmpty() ) { for( PartP2PIC2Power o : outs ) { - Options.add( o ); + options.add( o ); } } - if( Options.isEmpty() ) + if( options.isEmpty() ) { return amount; } - PartP2PIC2Power x = Platform.pickRandom( Options ); + PartP2PIC2Power x = Platform.pickRandom( options ); if( x != null && x.OutputEnergyA <= 0.001 ) { diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index 96079123..69b9a728 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -46,9 +46,9 @@ public class GroupIngredient implements IIngredient { this.name = myName; - for( IIngredient I : ingredients ) + for( IIngredient ingredient : ingredients ) { - if( I.isAir() ) + if( ingredient.isAir() ) { throw new RecipeError( "Cannot include air in a group." ); } diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index ac4081a5..26db0413 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -31,6 +31,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import javax.annotation.Nonnull; +import com.google.common.base.Optional; +import com.google.common.collect.HashMultimap; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -38,9 +41,6 @@ import cpw.mods.fml.common.LoaderState; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; -import com.google.common.base.Optional; -import com.google.common.collect.HashMultimap; - import appeng.api.AEApi; import appeng.api.definitions.IBlocks; import appeng.api.definitions.IDefinitions; @@ -128,8 +128,8 @@ public class RecipeHandler implements IRecipeHandler final Optional maybeCrystalSeedItem = items.crystalSeed().maybeItem(); final Optional maybeSkyStoneItem = blocks.skyStone().maybeItem(); - final Optional maybeCraftingStorageItem = blocks.craftingStorage1k().maybeItem(); - final Optional maybeCraftingUnitItem = blocks.craftingUnit().maybeItem(); + final Optional maybeCStorageItem = blocks.craftingStorage1k().maybeItem(); + final Optional maybeCUnitItem = blocks.craftingUnit().maybeItem(); final Optional maybeSkyChestItem = blocks.skyChest().maybeItem(); if( maybeCrystalSeedItem.isPresent() && is.getItem() == maybeCrystalSeedItem.get() ) @@ -164,7 +164,7 @@ public class RecipeHandler implements IRecipeHandler default: } } - else if( maybeCraftingStorageItem.isPresent() && is.getItem() == maybeCraftingStorageItem.get() ) + else if( maybeCStorageItem.isPresent() && is.getItem() == maybeCStorageItem.get() ) { switch( is.getItemDamage() ) { @@ -180,7 +180,7 @@ public class RecipeHandler implements IRecipeHandler default: } } - else if( maybeCraftingUnitItem.isPresent() && is.getItem() == maybeCraftingUnitItem.get() ) + else if( maybeCUnitItem.isPresent() && is.getItem() == maybeCUnitItem.get() ) { switch( is.getItemDamage() ) { diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index f67b0459..cebbc60a 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -191,7 +191,7 @@ public class Platform p = PowerUnits.AE.convertTo( displayUnits, p ); int offset = 0; - String Lvl = ""; + String level = ""; String[] preFixes = new String[] { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" }; String unitName = displayUnits.name(); @@ -208,12 +208,12 @@ public class Platform while( p > 1000 && offset < preFixes.length ) { p /= 1000; - Lvl = preFixes[offset]; + level = preFixes[offset]; offset++; } DecimalFormat df = new DecimalFormat( "#.##" ); - return df.format( p ) + ' ' + Lvl + unitName + ( isRate ? "/t" : "" ); + return df.format( p ) + ' ' + level + unitName + ( isRate ? "/t" : "" ); } public static ForgeDirection crossProduct( ForgeDirection forward, ForgeDirection up ) @@ -1273,10 +1273,10 @@ public class Platform } else { - float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float BPercentDamaged = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + float percentDamagedOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + float percentDamagedOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } catch( Throwable e ) @@ -1291,10 +1291,10 @@ public class Platform } else { - float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float BPercentDamaged = (float) b.getItemDamage() / (float) b.getMaxDamage(); + float percentDamagedOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + float percentDamagedOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } } @@ -1649,9 +1649,9 @@ public class Platform return 0; } - for( Integer Side : sides ) + for( int side : sides ) { - int c = ( Side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); + int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); offset++; hash = c + ( hash << 6 ) + ( hash << 16 ) - hash; } diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index d99894a0..61d31ff7 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -113,8 +113,8 @@ public final class AEFluidStack extends AEStack implements IAEFlu { byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte StackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte CountReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); boolean isCraftable = ( mask & 0x40 ) > 0; boolean hasTagCompound = ( mask & 0x80 ) > 0; @@ -140,8 +140,8 @@ public final class AEFluidStack extends AEStack implements IAEFlu } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( StackType, data ); - long countRequestable = getPacketValue( CountReqType, data ); + long stackSize = getPacketValue( stackType, data ); + long countRequestable = getPacketValue( countReqType, data ); FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d ); if( fluidStack == null ) diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index 13e7e60b..68078495 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -147,8 +147,8 @@ public final class AEItemStack extends AEStack implements IAEItemS { byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte StackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte CountReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); boolean isCraftable = ( mask & 0x40 ) > 0; boolean hasTagCompound = ( mask & 0x80 ) > 0; @@ -171,8 +171,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( StackType, data ); - long countRequestable = getPacketValue( CountReqType, data ); + long stackSize = getPacketValue( stackType, data ); + long countRequestable = getPacketValue( countReqType, data ); ItemStack itemstack = ItemStack.loadItemStackFromNBT( d ); if( itemstack == null ) @@ -289,10 +289,10 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float BPercentDamaged = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + float percentDamageOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } catch( Throwable e ) @@ -307,10 +307,10 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float BPercentDamaged = (float) b.getItemDamage() / (float) b.getMaxDamage(); + float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } } @@ -343,10 +343,10 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float BPercentDamaged = 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); + float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + float percentDamageOfB = 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } catch( Throwable e ) @@ -361,10 +361,10 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float BPercentDamaged = (float) o.getItemDamage() / (float) o.getMaxDamage(); + float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage(); - return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint ); + return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } } diff --git a/src/main/java/appeng/worldgen/MeteoritePlacer.java b/src/main/java/appeng/worldgen/MeteoritePlacer.java index b7cc3db9..25895528 100644 --- a/src/main/java/appeng/worldgen/MeteoritePlacer.java +++ b/src/main/java/appeng/worldgen/MeteoritePlacer.java @@ -437,10 +437,10 @@ public final class MeteoritePlacer public double getSqDistance( int x, int z ) { - int Cx = this.settings.getInteger( "x" ) - x; - int Cz = this.settings.getInteger( "z" ) - z; + int chunkX = this.settings.getInteger( "x" ) - x; + int chunkZ = this.settings.getInteger( "z" ) - z; - return Cx * Cx + Cz * Cz; + return chunkX * chunkX + chunkZ * chunkZ; } public boolean spawnMeteorite( IMeteoriteWorld w, int x, int y, int z )