diff --git a/.gitignore b/.gitignore index 8ef44175d..e527eda8b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,6 @@ # include sourcecode !src/ -# include special libs like BC -!libs/ - # include git important files !.gitmodules !.gitignore diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..6dc10105c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,152 @@ +# How to contribute + +We want to keep it as easy as possible to contribute changes to support +the growth and stability of AE2. There are a few guidelines that we +need contributors to follow so that we can have a chance of keeping on +top of things. + +## Getting Started + +### Reporting an Issue + +Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now! + +1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it. +2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) +3. Click new issue +4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue. + * To help in resolving your issues please try to include the follow if applicable: + * The problem that is happening? + * What was expected? + * How to reproduce the problem? + * Server or Single Player? + * Mod Pack using and version? + * Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file) + * Screen shots or Pictures of the problem +5. Click `Submit New Issue`, and wait for feedback! + +### Submitting Changes + +* Submit an issue to the github project, assuming one does not already exist. + * Clearly describe the issue including steps to reproduce when it is a bug. + * Make sure you fill in the earliest version that you know has the issue. +* Fork the repository on GitHub +* Create a topic branch from where you want to base your work. + * This is revison branch that is under active development. + * Only target release branches if you are certain your fix must be on that + branch. + * To quickly create a topic branch based on the development branch; `git + checkout -b fix/master/my_contribution branch`. Please avoid working + directly on the `active development` branch. +* Make commits of logical units. +* Check for unnecessary whitespace with `git diff --check` before committing. +* Make sure your commit messages are in the proper format. + +```` + (#12345) Make the example in CONTRIBUTING imperative and concrete + + Without this patch applied the example commit message in the CONTRIBUTING + document is not a concrete example. This is a problem because the + contributor is left to imagine what the commit message should look like + based on a description rather than an example. This patch fixes the + problem by making the example concrete and imperative. + + The first line is a real life imperative statement with a ticket number + from our issue tracker. The body describes the behavior without the patch, + why this is a problem, and how the patch fixes the problem when applied. +```` +* Always fully test your changes. If they are large engouh in scope, then fully + test AE2. +* Describing the process you used to test your changes in detail will help speed + up this process. + +## Making Trivial Changes + +### Documentation + +For changes of a trivial nature to comments and documentation, it is not +always necessary to create a new issue. In this case, it is +appropriate to start the first line of a commit with '(doc)' instead of +a ticket number. + +```` + (doc) Add documentation commit example to CONTRIBUTING + + There is no example for contributing a documentation commit + to the Puppet repository. This is a problem because the contributor + is left to assume how a commit of this nature may appear. + + The first line is a real life imperative statement with '(doc)' in + place of what would have been the ticket number in a + non-documentation related commit. The body describes the nature of + the new documentation or comments added. +```` + +### Semantic Changes + +In order to keep the code in a state where PRs can be safely merged, it is important to +avoid changes to syntax or changes that don't add any real value to the code base. PRs +that make changes only to syntax or "clean up" the code will be rejected. Any code clean-up +should be coordinated with the core team first. + + +## Style Guidelines + +Applied Energistics does not follow standard Java syntax. The guidelines below illustrate +the styling guidelines used by AE. + +PRs that do not conform to these standards will be rejected. + +### Whitespace + +#### Tabs or spaces +Configure your IDE to use tabs as padding whitespace. Ensure that there is no extra whitespace +at the end of lines, or on blank lines. + +#### Pad parenthes with whitespace +```` +if( item.equals( newItem ) + +public void DeleteItem( item ) + +catch( Throwable ) +```` + +### Braces + +Place opening and closing braces on a new line. Always include open and close braces, even if +the body is a single line. + +```` +if( item.equals( newItem ) +{ + +} +else +{ + +} + +public void DeleteItem( item ) +{ + +} +```` + +## Submitting Changes + +* Push your changes to a topic branch in your fork of the repository. +* Submit a pull request to the repository in the puppetlabs organization. +* Update your issue to mark that you have submitted code and are ready for it to be reviewed. + * Include a link to the pull request in the ticket. +* The core team looks at Pull Requests on a regular basis. + * There are many reasons why it will take a long time to pull your PR. Be patient, we'll + get to it. +* After feedback has been given we expect responses within two weeks. After two + weeks will may close the pull request if it isn't showing any activity. + +# Additional Resources + +* [General GitHub documentation](http://help.github.com/) +* [GitHub pull request documentation](http://help.github.com/send-pull-requests/) +* #AppliedEnergistics IRC channel on esper.net diff --git a/README.md b/README.md index 74d1cc395..2c0ae989f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ * [License](#license) * [Downloads](#downloads) * [Installation](#installation) +* [Issues](#issues) * [Building](#building) * [Contribution](#contribution) * [Credits](#credits) @@ -23,7 +24,7 @@ A Mod about Matter, Energy and using them to conquer the world.. ## License -Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3. See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information. +Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3. See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information. Textures and Models are licensed under Creative Commons 3. ## Downloads @@ -33,6 +34,24 @@ Downloads can be found on [CurseForge](http://www.curse.com/mc-mods/minecraft/22 You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies. +## Issues + +Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now! + +1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it. +2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) +3. Click new issue +4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue. + * To help in resolving your issues please try to include the follow if applicable: + * The problem that is happening? + * What was expected? + * How to reproduce the problem? + * Server or Single Player? + * Mod Pack using and version? + * Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file) + * Screen shots or Pictures of the problem +5. Click `Submit New Issue`, and wait for feedback! + ## Building 1. Clone this repository via @@ -54,6 +73,18 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no Before you want to add major changes, you might want to discuss them with us first, before wasting your time. If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request). +Here are a few things to keep in mind that will help get your PR approved. + +* A PR should be focused on content. Any PRs where the changes are only syntax will be rejected. +* Use the file you are editing as a style guide. +* Consider your feature. [Suggestion Guidelines](http://ae-mod.info/Suggestion-Guidelines/) + - Is your suggestion already possible using Vanilla + AE2? + - Make sure your feature isn't already in the works, or hasn't been rejected previously. + - Does your feature simplify another feature of AE2? These changes will not be accepted. + - If your feature can be done by any popular mod, discuss with us first. + +Getting Started + 1. Fork this repository 2. Clone the fork via * SSH `git clone git@github.com:/Applied-Energistics-2.git` or @@ -64,7 +95,7 @@ If you are still willing to contribute to this project, you can contribute via [ 6. Push to your fork `git push` 7. Create a Pull-Request on GitHub -If you are only doing single file pull requests, GitHub supports using a quick way without the need of cloning your fork. +If you are only doing single file pull requests, GitHub supports using a quick way without the need of cloning your fork. Also read up about [synching](https://help.github.com/articles/syncing-a-fork) if you plan to contribute on regular basis. ## Credits diff --git a/build.gradle b/build.gradle index 73079fe8e..c984bfd7a 100644 --- a/build.gradle +++ b/build.gradle @@ -29,12 +29,21 @@ configurations.all { resolutionStrategy.cacheDynamicVersionsFor 7200, 'hours' } +sourceCompatibility = JavaVersion.VERSION_1_6 targetCompatibility = JavaVersion.VERSION_1_6 version = config.version + "-" + config.aechannel + "-" + config.build group = config.group archivesBaseName = config.archivesBaseName +// If TeamCity is running this build, lets set the version info +if (hasProperty("teamcity")) { + version = teamcity["build.number"] + + // Fix for main branch being built + version = version.replaceAll("/", "-") +} + // Add Coremod Manifest jar { manifest { diff --git a/build.properties b/build.properties index 9b4538669..2b4d7ec20 100644 --- a/build.properties +++ b/build.properties @@ -1,14 +1,41 @@ version=rv2 aechannel=alpha -build=_ +build=0 group=appeng archivesBaseName=appliedenergistics2 + +######################################################### +# Versions # +######################################################### minecraft_version=1.7.10 forge_version=10.13.1.1217 + +######################################################### +# APIs used for development # +######################################################### cb_minecraft_version=1.7.10 -fmp_version=1.1.0.306 +fmp_version=1.1.0.308 code_chicken_lib_version=1.1.1.104 code_chicken_core_version=1.0.3.26 nei_version=1.0.3.56 -ic2_version=2.2.643 -waila_version=1.5.3a_1.7.10 \ No newline at end of file +waila_version=1.5.5_1.7.10 + +######################################################### +# API Stubs # +# Note: Do not edit these version numbers as they are # +# not the version of the mod, but stub code for AE2 to # +# compile # +######################################################### +api_betterstorage_version=1 +api_coloredlightscore_version=1 +api_craftguide_version=1 +api_ic2_version=1 +api_immibis_version=1 +api_invtweaks_version=1 +api_mekansim_version=1 +api_mfr_version=1 +api_railcraft_version=1 +api_rblocks_version=1 +api_rf_version=1 +api_rotarycraft_version=1 +dev_buildcraft_version=1 diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index 00c7eb358..10dcbdcd9 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -11,7 +11,7 @@ repositories { } maven { - name "FireBall API Depo" + name "FireBall API Depot" url "http://dl.tsr.me/artifactory/libs-release-local" } } @@ -25,19 +25,19 @@ dependencies { compile "mcp.mobius.waila:Waila:${config.waila_version}" - compile(group: 'api', name: 'betterstorage', version: '1') - compile(group: 'api', name: 'coloredlightscore', version: '1') - compile(group: 'api', name: 'craftguide', version: '1') - compile(group: 'api', name: 'ic2', version: '1') - compile(group: 'api', name: 'immibis', version: '1') - compile(group: 'api', name: 'invtweaks', version: '1') - compile(group: 'api', name: 'mekansim', version: '1') - compile(group: 'api', name: 'mfr', version: '1') - compile(group: 'api', name: 'railcraft', version: '1') - compile(group: 'api', name: 'rblocks', version: '1') - compile(group: 'api', name: 'rf', version: '1') - compile(group: 'api', name: 'rotarycraft', version: '1') - compile(group: 'dev', name: 'buildcraft', version: '1') + compile(group: 'api', name: 'betterstorage', version: "${config.api_betterstorage_version}") + compile(group: 'api', name: 'coloredlightscore', version: "${config.api_coloredlightscore_version}") + compile(group: 'api', name: 'craftguide', version: "${config.api_craftguide_version}") + compile(group: 'api', name: 'ic2', version: "${config.api_ic2_version}") + compile(group: 'api', name: 'immibis', version: "${config.api_immibis_version}") + compile(group: 'api', name: 'invtweaks', version: "${config.api_invtweaks_version}") + compile(group: 'api', name: 'mekansim', version: "${config.api_mekansim_version}") + compile(group: 'api', name: 'mfr', version: "${config.api_mfr_version}") + compile(group: 'api', name: 'railcraft', version: "${config.api_railcraft_version}") + compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}") + compile(group: 'api', name: 'rf', version: "${config.api_rf_version}") + compile(group: 'api', name: 'rotarycraft', version: "${config.api_rotarycraft_version}") + compile(group: 'dev', name: 'buildcraft', version: "${config.dev_buildcraft_version}") // add hacked buildcraft jar to compile time (for facades) compile fileTree(dir: 'libs', include: '*.jar') diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/api/java/appeng/api b/src/api/java/appeng/api index 74e4e50c7..65dfd7ace 160000 --- a/src/api/java/appeng/api +++ b/src/api/java/appeng/api @@ -1 +1 @@ -Subproject commit 74e4e50c76e812cc227bea020f3c8646eacfedb1 +Subproject commit 65dfd7ace777c4972e920df715b34d84530ec637 diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index 98aa90e2d..4e46ec472 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -1,7 +1,6 @@ package appeng.block; import java.util.ArrayList; -import java.util.Collections; import java.util.EnumSet; import java.util.List; @@ -60,8 +59,8 @@ import cpw.mods.fml.relauncher.SideOnly; public class AEBaseBlock extends BlockContainer implements IAEFeature { - private String FeatureFullname; - private String FeatureSubname; + private String featureFullName; + private String featureSubName; private AEFeatureHandler feature; private Class tileEntityType = null; @@ -79,7 +78,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature @Override public String toString() { - return FeatureFullname; + return featureFullName; } @SideOnly(Side.CLIENT) @@ -107,8 +106,8 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature try { ResourceLocation resLoc = new ResourceLocation( Name ); - resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", new Object[] { "textures/blocks", - resLoc.getResourcePath(), ".png" } ) ); + resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", + resLoc.getResourcePath(), ".png" ) ); IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); if ( res != null ) @@ -178,14 +177,14 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature protected void setTileEntity(Class c) { AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) ); - GameRegistry.registerTileEntity( tileEntityType = c, FeatureFullname ); + GameRegistry.registerTileEntity( tileEntityType = c, featureFullName ); isInventory = IInventory.class.isAssignableFrom( c ); setTileProvider( hasBlockTileEntity() ); } protected void setFeature(EnumSet f) { - feature = new AEFeatureHandler( f, this, FeatureSubname ); + feature = new AEFeatureHandler( f, this, featureSubName ); } protected AEBaseBlock(Class c, Material mat) { @@ -203,7 +202,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" ); } - protected AEBaseBlock(Class c, Material mat, String subname) { + protected AEBaseBlock(Class c, Material mat, String subName) { super( mat ); if ( mat == AEGlassMaterial.instance ) @@ -215,8 +214,8 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature else setStepSound( Block.soundTypeMetal ); - FeatureFullname = AEFeatureHandler.getName( c, subname ); - FeatureSubname = subname; + featureFullName = AEFeatureHandler.getName( c, subName ); + featureSubName = subName; } @Override @@ -689,7 +688,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature if ( is.getItem() instanceof IMemoryCard && !(this instanceof BlockCableBus) ) { - IMemoryCard memc = (IMemoryCard) is.getItem(); + IMemoryCard memoryCard = (IMemoryCard) is.getItem(); if ( player.isSneaking() ) { AEBaseTile t = getTileEntity( w, x, y, z ); @@ -699,24 +698,24 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD ); if ( data != null ) { - memc.setMemoryCardContents( is, name, data ); - memc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED ); + memoryCard.setMemoryCardContents( is, name, data ); + memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED ); return true; } } } else { - String name = memc.getSettingsName( is ); - NBTTagCompound data = memc.getData( is ); + String name = memoryCard.getSettingsName( is ); + NBTTagCompound data = memoryCard.getData( is ); if ( getUnlocalizedName().equals( name ) ) { AEBaseTile t = getTileEntity( w, x, y, z ); t.uploadSettings( SettingsFrom.MEMORY_CARD, data ); - memc.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); + memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); } else - memc.notifyUser( player, MemoryCardMessages.INVALID_MACHINE ); + memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE ); return false; } } @@ -757,11 +756,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature return hasSubtypes; } + @Override public boolean hasComparatorInputOverride() { return isInventory; } + @Override public int getComparatorInputOverride(World w, int x, int y, int z, int s) { TileEntity te = getTileEntity( w, x, y, z ); diff --git a/src/main/java/appeng/block/AEBaseItemBlock.java b/src/main/java/appeng/block/AEBaseItemBlock.java index 338330389..6a11e0aa1 100644 --- a/src/main/java/appeng/block/AEBaseItemBlock.java +++ b/src/main/java/appeng/block/AEBaseItemBlock.java @@ -84,7 +84,7 @@ public class AEBaseItemBlock extends ItemBlock { up = ForgeDirection.UP; - byte rotation = (byte) (MathHelper.floor_double( (double) ((player.rotationYaw * 4F) / 360F) + 2.5D ) & 3); + byte rotation = (byte) (MathHelper.floor_double( (player.rotationYaw * 4F) / 360F + 2.5D ) & 3); switch (rotation) { diff --git a/src/main/java/appeng/block/misc/BlockCellWorkbench.java b/src/main/java/appeng/block/misc/BlockCellWorkbench.java index 468eb690b..fab1c2bc4 100644 --- a/src/main/java/appeng/block/misc/BlockCellWorkbench.java +++ b/src/main/java/appeng/block/misc/BlockCellWorkbench.java @@ -31,7 +31,7 @@ public class BlockCellWorkbench extends AEBaseBlock if ( tg != null ) { if ( Platform.isServer() ) - Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELLWORKBENCH ); + Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELL_WORKBENCH ); return true; } return false; diff --git a/src/main/java/appeng/block/misc/BlockCharger.java b/src/main/java/appeng/block/misc/BlockCharger.java index 869f91303..ac36e0a45 100644 --- a/src/main/java/appeng/block/misc/BlockCharger.java +++ b/src/main/java/appeng/block/misc/BlockCharger.java @@ -7,7 +7,6 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; @@ -89,7 +88,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision if ( CommonHelper.proxy.shouldAddParticles( r ) ) { LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } @@ -148,9 +147,9 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision break; } - return Arrays.asList( new AxisAlignedBB[] { bb } ); + return Arrays.asList( bb ); } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) ); } @Override diff --git a/src/main/java/appeng/block/misc/BlockLightDetector.java b/src/main/java/appeng/block/misc/BlockLightDetector.java index 575f6a5da..236283288 100644 --- a/src/main/java/appeng/block/misc/BlockLightDetector.java +++ b/src/main/java/appeng/block/misc/BlockLightDetector.java @@ -33,7 +33,7 @@ public class BlockLightDetector extends BlockQuartzTorch public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) { if ( w instanceof World && ((TileLightDetector) getTileEntity( w, x, y, z )).isReady() ) - return (int) ((World) w).getBlockLightValue( x, y, z ) - 6; + return ((World) w).getBlockLightValue( x, y, z ) - 6; return 0; } diff --git a/src/main/java/appeng/block/misc/BlockPaint.java b/src/main/java/appeng/block/misc/BlockPaint.java index 35de99a13..4e6031ccd 100644 --- a/src/main/java/appeng/block/misc/BlockPaint.java +++ b/src/main/java/appeng/block/misc/BlockPaint.java @@ -72,16 +72,19 @@ public class BlockPaint extends AEBaseBlock tp.onNeighborBlockChange(); } + @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; } + @Override public boolean canCollideCheck(int p_149678_1_, boolean p_149678_2_) { return false; } + @Override public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index 1e9931a6e..69a8025ef 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -5,7 +5,6 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -52,15 +51,15 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient if ( !AEConfig.instance.enableEffects ) return; - TileQuartzGrowthAccelerator tqga = getTileEntity( w, x, y, z ); + TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = getTileEntity( w, x, y, z ); - if ( tqga != null && tqga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) + if ( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = (double) (r.nextFloat() - 0.5F); - double d1 = (double) (r.nextFloat() - 0.5F); + double d0 = r.nextFloat() - 0.5F; + double d1 = r.nextFloat() - 0.5F; - ForgeDirection up = tqga.getUp(); - ForgeDirection forward = tqga.getForward(); + ForgeDirection up = tileQuartzGrowthAccelerator.getUp(); + ForgeDirection forward = tileQuartzGrowthAccelerator.getForward(); ForgeDirection west = Platform.crossProduct( forward, up ); double rx = 0.5 + x; @@ -113,7 +112,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient rz += dz * forward.offsetZ; LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/block/misc/BlockQuartzTorch.java b/src/main/java/appeng/block/misc/BlockQuartzTorch.java index 433f198a8..1ca8e4563 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -8,7 +8,6 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; @@ -97,7 +96,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I double xOff = -0.3 * up.offsetX; double yOff = -0.3 * up.offsetY; double zOff = -0.3 * up.offsetZ; - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); } @Override @@ -129,7 +128,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I { LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } } diff --git a/src/main/java/appeng/block/misc/BlockSkyCompass.java b/src/main/java/appeng/block/misc/BlockSkyCompass.java index c6913f2d8..c2666304b 100644 --- a/src/main/java/appeng/block/misc/BlockSkyCompass.java +++ b/src/main/java/appeng/block/misc/BlockSkyCompass.java @@ -142,9 +142,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision break; } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) ); } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) ); } @Override diff --git a/src/main/java/appeng/block/misc/BlockTinyTNT.java b/src/main/java/appeng/block/misc/BlockTinyTNT.java index ab9121263..d3de47967 100644 --- a/src/main/java/appeng/block/misc/BlockTinyTNT.java +++ b/src/main/java/appeng/block/misc/BlockTinyTNT.java @@ -127,19 +127,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision { if ( !w.isRemote ) { - EntityTinyTNTPrimed entitytntprimed = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() ); - entitytntprimed.fuse = w.rand.nextInt( entitytntprimed.fuse / 4 ) + entitytntprimed.fuse / 8; - w.spawnEntityInWorld( entitytntprimed ); + EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() ); + primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8; + w.spawnEntityInWorld( primedTinyTNTEntity ); } } - public void startFuse(World w, int x, int y, int z, EntityLivingBase ignitor) + public void startFuse(World w, int x, int y, int z, EntityLivingBase igniter) { if ( !w.isRemote ) { - EntityTinyTNTPrimed entitytntprimed = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, ignitor ); - w.spawnEntityInWorld( entitytntprimed ); - w.playSoundAtEntity( entitytntprimed, "game.tnt.primed", 1.0F, 1.0F ); + EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter ); + w.spawnEntityInWorld( primedTinyTNTEntity ); + w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F ); } } @@ -152,7 +152,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); } @Override diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index 607ef0306..af2586a4b 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -39,7 +39,7 @@ public class BlockVibrationChamber extends AEBaseBlock TileVibrationChamber tc = getTileEntity( w, x, y, z ); if ( tc != null && !player.isSneaking() ) { - Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATIONCHAMBER ); + Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER ); return true; } } @@ -73,9 +73,9 @@ public class BlockVibrationChamber extends AEBaseBlock TileVibrationChamber tc = (TileVibrationChamber) tile; if ( tc.isOn ) { - float f1 = (float) x + 0.5F; - float f2 = (float) y + 0.5F; - float f3 = (float) z + 0.5F; + float f1 = x + 0.5F; + float f2 = y + 0.5F; + float f3 = z + 0.5F; ForgeDirection forward = tc.getForward(); ForgeDirection up = tc.getUp(); @@ -99,8 +99,8 @@ public class BlockVibrationChamber extends AEBaseBlock f2 += west_y * (0.3 * ox - 0.15); f3 += west_z * (0.3 * ox - 0.15); - w.spawnParticle( "smoke", (double) f1, (double) f2, (double) f3, 0.0D, 0.0D, 0.0D ); - w.spawnParticle( "flame", (double) f1, (double) f2, (double) f3, 0.0D, 0.0D, 0.0D ); + w.spawnParticle( "smoke", f1, f2, f3, 0.0D, 0.0D, 0.0D ); + w.spawnParticle( "flame", f1, f2, f3, 0.0D, 0.0D, 0.0D ); } } } diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index 2b0084d41..55b75645b 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -61,6 +61,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection static public Class noTesrTile; static public Class tesrTile; + @Override public T getTileEntity(IBlockAccess w, int x, int y, int z) { TileEntity te = w.getTileEntity( x, y, z ); @@ -89,13 +90,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection return 0; } + @Override @SideOnly(Side.CLIENT) public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer) { - Object pobj = cb( world, target.blockX, target.blockY, target.blockZ ); - if ( pobj instanceof IPartHost ) + Object object = cb( world, target.blockX, target.blockY, target.blockZ ); + if ( object instanceof IPartHost ) { - IPartHost host = (IPartHost) pobj; + IPartHost host = (IPartHost) object; for (ForgeDirection side : ForgeDirection.values()) { @@ -113,15 +115,15 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection { for (int k1 = 0; k1 < b0; ++k1) { - double d0 = (double) target.blockX + ((double) i1 + 0.5D) / (double) b0; - double d1 = (double) target.blockY + ((double) j1 + 0.5D) / (double) b0; - double d2 = (double) target.blockZ + ((double) k1 + 0.5D) / (double) b0; + double d0 = target.blockX + (i1 + 0.5D) / b0; + double d1 = target.blockY + (j1 + 0.5D) / b0; + double d2 = target.blockZ + (k1 + 0.5D) / b0; double dd0 = target.hitVec.xCoord; double dd1 = target.hitVec.yCoord; double dd2 = target.hitVec.zCoord; - EntityDiggingFX fx = (new EntityDiggingFX( world, dd0, dd1, dd2, d0 - (double) target.blockX - 0.5D, d1 - (double) target.blockY - - 0.5D, d2 - (double) target.blockZ - 0.5D, this, 0 )).applyColourMultiplier( target.blockX, target.blockY, target.blockZ ); + EntityDiggingFX fx = (new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY + - 0.5D, d2 - target.blockZ - 0.5D, this, 0 )).applyColourMultiplier( target.blockX, target.blockY, target.blockZ ); fx.setParticleIcon( ico ); @@ -135,13 +137,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection return true; } + @Override @SideOnly(Side.CLIENT) public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) { - Object pobj = cb( world, x, y, z ); - if ( pobj instanceof IPartHost ) + Object object = cb( world, x, y, z ); + if ( object instanceof IPartHost ) { - IPartHost host = (IPartHost) pobj; + IPartHost host = (IPartHost) object; for (ForgeDirection side : ForgeDirection.values()) { @@ -159,10 +162,10 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection { for (int k1 = 0; k1 < b0; ++k1) { - double d0 = (double) x + ((double) i1 + 0.5D) / (double) b0; - double d1 = (double) y + ((double) j1 + 0.5D) / (double) b0; - double d2 = (double) z + ((double) k1 + 0.5D) / (double) b0; - EntityDiggingFX fx = (new EntityDiggingFX( world, d0, d1, d2, d0 - (double) x - 0.5D, d1 - (double) y - 0.5D, d2 - (double) z + double d0 = x + (i1 + 0.5D) / b0; + double d1 = y + (j1 + 0.5D) / b0; + double d2 = z + (k1 + 0.5D) / b0; + EntityDiggingFX fx = (new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta )).applyColourMultiplier( x, y, z ); fx.setParticleIcon( ico ); diff --git a/src/main/java/appeng/block/networking/BlockWireless.java b/src/main/java/appeng/block/networking/BlockWireless.java index 6dda040c3..57a5aecfa 100644 --- a/src/main/java/appeng/block/networking/BlockWireless.java +++ b/src/main/java/appeng/block/networking/BlockWireless.java @@ -101,9 +101,9 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision break; } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) ); } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( 0.0, 0, 0.0, 1.0, 1.0, 1.0 ) ); } @Override diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index bb179ef59..4a16c8f43 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -54,7 +54,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli } @Override - public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessnumber) + public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) { TileQuantumBridge bridge = getTileEntity( w, x, y, z ); if ( bridge != null ) @@ -97,7 +97,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) { double OnePx = 2.0 / 16.0; - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); } @Override diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index eac978874..585a0e3fe 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -30,7 +30,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision } @Override - public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessnumber) + public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber) { TileQuantumBridge bridge = getTileEntity( w, x, y, z ); if ( bridge != null ) @@ -66,7 +66,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision { OnePx = 1.0 / 16.0; } - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) } ); + return Arrays.asList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) ); } @Override diff --git a/src/main/java/appeng/block/solids/BlockQuartzLamp.java b/src/main/java/appeng/block/solids/BlockQuartzLamp.java index b6e248583..f0bf1a546 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzLamp.java +++ b/src/main/java/appeng/block/solids/BlockQuartzLamp.java @@ -4,7 +4,6 @@ import java.util.EnumSet; import java.util.Random; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; import appeng.client.render.effects.VibrantFX; import appeng.core.AEConfig; @@ -32,13 +31,13 @@ public class BlockQuartzLamp extends BlockQuartzGlass if ( CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = (double) (r.nextFloat() - 0.5F) * 0.96D; - double d1 = (double) (r.nextFloat() - 0.5F) * 0.96D; - double d2 = (double) (r.nextFloat() - 0.5F) * 0.96D; + double d0 = (r.nextFloat() - 0.5F) * 0.96D; + double d1 = (r.nextFloat() - 0.5F) * 0.96D; + double d2 = (r.nextFloat() - 0.5F) * 0.96D; VibrantFX fx = new VibrantFX( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/block/solids/OreQuartz.java b/src/main/java/appeng/block/solids/OreQuartz.java index 85f2c3d7a..7955267fd 100644 --- a/src/main/java/appeng/block/solids/OreQuartz.java +++ b/src/main/java/appeng/block/solids/OreQuartz.java @@ -113,11 +113,11 @@ public class OreQuartz extends AEBaseBlock } @Override - public void dropBlockAsItemWithChance(World w, int x, int y, int z, int blockid, float something, int meta) + public void dropBlockAsItemWithChance(World w, int x, int y, int z, int blockID, float something, int meta) { - super.dropBlockAsItemWithChance( w, x, y, z, blockid, something, meta ); + super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta ); - if ( getItemDropped( blockid, w.rand, meta ) != Item.getItemFromBlock( this ) ) + if ( getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) ) { int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); diff --git a/src/main/java/appeng/block/solids/OreQuartzCharged.java b/src/main/java/appeng/block/solids/OreQuartzCharged.java index 5fb85a22b..4358bc0c2 100644 --- a/src/main/java/appeng/block/solids/OreQuartzCharged.java +++ b/src/main/java/appeng/block/solids/OreQuartzCharged.java @@ -3,7 +3,6 @@ package appeng.block.solids; import java.util.Random; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import appeng.api.AEApi; @@ -35,9 +34,9 @@ public class OreQuartzCharged extends OreQuartz if ( !AEConfig.instance.enableEffects ) return; - double xOff = (double) (r.nextFloat()); - double yOff = (double) (r.nextFloat()); - double zOff = (double) (r.nextFloat()); + double xOff = (r.nextFloat()); + double yOff = (r.nextFloat()); + double zOff = (r.nextFloat()); switch (r.nextInt( 6 )) { @@ -67,7 +66,7 @@ public class OreQuartzCharged extends OreQuartz if ( CommonHelper.proxy.shouldAddParticles( r ) ) { ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java index a47f63215..4d042fb80 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java @@ -40,7 +40,7 @@ public class BlockSpatialIOPort extends AEBaseBlock if ( tg != null ) { if ( Platform.isServer() ) - Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SPATIALIOPORT ); + Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SPATIAL_IO_PORT ); return true; } return false; diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index 1bfc1a23a..39f8e74b6 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -110,9 +110,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision double Y = o.offsetY == 0 ? 0.06 : 0.0; double Z = o.offsetZ == 0 ? 0.06 : 0.0; - return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ), + return Arrays.asList( 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 ) ) } ); + Math.min( 1.0, (1.0 - Z) - o.offsetZ * sc ) ) ); } @Override diff --git a/src/main/java/appeng/client/ClientHelper.java b/src/main/java/appeng/client/ClientHelper.java index 90e5c36e7..57da84956 100644 --- a/src/main/java/appeng/client/ClientHelper.java +++ b/src/main/java/appeng/client/ClientHelper.java @@ -11,7 +11,6 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; @@ -115,9 +114,9 @@ public class ClientHelper extends ServerHelper { AEColor col = player.myColor; - float r = (float) (0xff & (col.mediumVariant >> 16)); - float g = (float) (0xff & (col.mediumVariant >> 8)); - float b = (float) (0xff & (col.mediumVariant)); + float r = 0xff & (col.mediumVariant >> 16); + float g = 0xff & (col.mediumVariant >> 8); + float b = 0xff & (col.mediumVariant); GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f ); } } @@ -192,7 +191,7 @@ public class ClientHelper extends ServerHelper RenderItem.renderInFrame = false; FontRenderer fr = Minecraft.getMinecraft().fontRenderer; - if ( !ForgeHooksClient.renderInventoryItem( blockRenderer, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, (float) 0, (float) 0 ) ) + if ( !ForgeHooksClient.renderInventoryItem( blockRenderer, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0 ) ) { itemRenderer.renderItemIntoGUI( fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false ); } @@ -209,7 +208,7 @@ public class ClientHelper extends ServerHelper } @Override - public void postinit() + public void postInit() { RenderingRegistry.registerBlockHandler( WorldRender.instance ); RenderManager.instance.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed() ); @@ -281,7 +280,7 @@ public class ClientHelper extends ServerHelper { if ( Platform.isClient() ) { - List o = new ArrayList(); + List o = new ArrayList(); o.add( Minecraft.getMinecraft().thePlayer ); return o; } @@ -314,6 +313,7 @@ public class ClientHelper extends ServerHelper case LightningArc: spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o ); return; + default: } } } @@ -323,32 +323,32 @@ public class ClientHelper extends ServerHelper PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } private void spawnVibrant(World w, double x, double y, double z) { if ( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - double d0 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; - double d1 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; - double d2 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; + double d0 = (Platform.getRandomFloat() - 0.5F) * 0.26D; + double d1 = (Platform.getRandomFloat() - 0.5F) * 0.26D; + double d2 = (Platform.getRandomFloat() - 0.5F) * 0.26D; VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } private void spawnLightningArc(World worldObj, double posX, double posY, double posZ, Vec3 second) { LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } private void spawnLightning(World worldObj, double posX, double posY, double posZ) { LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } private void spawnEnergy(World w, double posX, double posY, double posZ) @@ -363,7 +363,7 @@ public class ClientHelper extends ServerHelper fx.motionY = -y * 0.1; fx.motionZ = -z * 0.1; - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } private void spawnCrafting(World w, double posX, double posY, double posZ) @@ -378,7 +378,7 @@ public class ClientHelper extends ServerHelper fx.motionY = -y * 0.2; fx.motionZ = -z * 0.2; - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } @Override diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index 72196034e..a273d0c4a 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -127,7 +127,7 @@ public abstract class AEBaseGui extends GuiContainer try { ((AEBaseContainer) inventorySlots).setTargetStack( item ); - InventoryAction direction = wheel > 0 ? InventoryAction.ROLLDOWN : InventoryAction.ROLLUP; + InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; int times = Math.abs( wheel ); for (int h = 0; h < times; h++) { @@ -176,8 +176,8 @@ public abstract class AEBaseGui extends GuiContainer ItemStack dbl_whichItem; Slot bl_clicked; - // dragy - Set drag_click = new HashSet(); + // drag y + Set drag_click = new HashSet(); @Override protected void handleMouseClick(Slot slot, int slotIdx, int ctrlDown, int key) @@ -187,7 +187,7 @@ public abstract class AEBaseGui extends GuiContainer if ( slot instanceof SlotFake ) { InventoryAction action = null; - action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACESINGLE : InventoryAction.PICKUP_OR_SETDOWN; + action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; if ( drag_click.size() > 1 ) return; @@ -283,7 +283,7 @@ public abstract class AEBaseGui extends GuiContainer switch (key) { case 0: // pickup / set-down. - action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACESINGLE : InventoryAction.PICKUP_OR_SETDOWN; + action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; break; case 1: action = ctrlDown == 1 ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK; @@ -327,11 +327,11 @@ public abstract class AEBaseGui extends GuiContainer switch (key) { case 0: // pickup / set-down. - action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACESINGLE : InventoryAction.PICKUP_OR_SETDOWN; + action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; stack = ((SlotME) slot).getAEStack(); - if ( stack != null && action == InventoryAction.PICKUP_OR_SETDOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null ) - action = InventoryAction.AUTOCRAFT; + if ( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null ) + action = InventoryAction.AUTO_CRAFT; break; case 1: @@ -343,7 +343,7 @@ public abstract class AEBaseGui extends GuiContainer stack = ((SlotME) slot).getAEStack(); if ( stack != null && stack.isCraftable() ) - action = InventoryAction.AUTOCRAFT; + action = InventoryAction.AUTO_CRAFT; else if ( player.capabilities.isCreativeMode ) { @@ -394,11 +394,10 @@ public abstract class AEBaseGui extends GuiContainer else if ( dbl_whichItem != null ) { // a replica of the weird broken vanilla feature. - Iterator iterator = this.inventorySlots.inventorySlots.iterator(); - while (iterator.hasNext()) + for (Object inventorySlot : this.inventorySlots.inventorySlots) { - Slot targetSlot = (Slot) iterator.next(); + Slot targetSlot = (Slot) inventorySlot; if ( targetSlot != null && targetSlot.canTakeStack( this.mc.thePlayer ) && targetSlot.getHasStack() && targetSlot.inventory == slot.inventory && Container.func_94527_a( targetSlot, dbl_whichItem, true ) ) @@ -414,6 +413,7 @@ public abstract class AEBaseGui extends GuiContainer super.handleMouseClick( slot, slotIdx, ctrlDown, key ); } + @Override protected void mouseClickMove(int x, int y, int c, long d) { Slot slot = this.getSlot( x, y ); @@ -428,7 +428,7 @@ public abstract class AEBaseGui extends GuiContainer { for (Slot dr : drag_click) { - PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SETDOWN : InventoryAction.PLACE_SINGLE, + PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); NetworkHandler.instance.sendToServer( p ); } @@ -559,7 +559,7 @@ public abstract class AEBaseGui extends GuiContainer for (var6 = 0; var6 < var4.length; ++var6) { - var7 = fontRendererObj.getStringWidth( (String) var4[var6] ); + var7 = fontRendererObj.getStringWidth( var4[var6] ); if ( var7 > var5 ) { @@ -601,7 +601,7 @@ public abstract class AEBaseGui extends GuiContainer for (int var13 = 0; var13 < var4.length; ++var13) { - String var14 = (String) var4[var13]; + String var14 = var4[var13]; if ( var13 == 0 ) { @@ -724,14 +724,14 @@ public abstract class AEBaseGui extends GuiContainer return false; } - protected Slot getSlot(int mousex, int mousey) + protected Slot getSlot(int mouseX, int mouseY) { for (int j1 = 0; j1 < this.inventorySlots.inventorySlots.size(); ++j1) { Slot slot = (Slot) this.inventorySlots.inventorySlots.get( j1 ); // isPointInRegion - if ( func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mousex, mousey ) ) + if ( func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) ) { return slot; } @@ -743,11 +743,11 @@ public abstract class AEBaseGui extends GuiContainer protected static String join(Collection s, String delimiter) { StringBuilder builder = new StringBuilder(); - Iterator iter = s.iterator(); - while (iter.hasNext()) + Iterator iterator = s.iterator(); + while (iterator.hasNext()) { - builder.append( iter.next() ); - if ( !iter.hasNext() ) + builder.append( iterator.next() ); + if ( !iterator.hasNext() ) { break; } @@ -758,16 +758,16 @@ public abstract class AEBaseGui extends GuiContainer boolean useNEI = false; - private RenderItem setItemRender(RenderItem aeri2) + private RenderItem setItemRender(RenderItem item) { if ( AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) ) { - return ((INEI) AppEng.instance.getIntegration( IntegrationType.NEI )).setItemRender( aeri2 ); + return ((INEI) AppEng.instance.getIntegration( IntegrationType.NEI )).setItemRender( item ); } else { RenderItem ri = itemRender; - itemRender = aeri2; + itemRender = item; return ri; } } @@ -788,7 +788,7 @@ public abstract class AEBaseGui extends GuiContainer } } - AppEngRenderItem aeri = new AppEngRenderItem(); + AppEngRenderItem aeRenderItem = new AppEngRenderItem(); protected boolean isPowered() { @@ -809,7 +809,7 @@ public abstract class AEBaseGui extends GuiContainer { if ( s instanceof SlotME ) { - RenderItem pIR = setItemRender( aeri ); + RenderItem pIR = setItemRender( aeRenderItem ); try { this.zLevel = 100.0F; @@ -826,9 +826,9 @@ public abstract class AEBaseGui extends GuiContainer itemRender.zLevel = 0.0F; if ( s instanceof SlotME ) - aeri.aestack = ((SlotME) s).getAEStack(); + aeRenderItem.aeStack = ((SlotME) s).getAEStack(); else - aeri.aestack = null; + aeRenderItem.aeStack = null; safeDrawSlot( s ); } @@ -876,14 +876,14 @@ public abstract class AEBaseGui extends GuiContainer float f1 = 0.00390625F; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ); - tessellator.addVertexWithUV( (double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f), - (double) ((float) (par4 + par6) * f1) ); - tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, - (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + par6) * f1) ); - tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, - (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + 0) * f1) ); - tessellator.addVertexWithUV( (double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * f), - (double) ((float) (par4 + 0) * f1) ); + tessellator.addVertexWithUV( par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * f, + (par4 + par6) * f1 ); + 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 ); tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, 1.0f ); tessellator.draw(); } diff --git a/src/main/java/appeng/client/gui/AEBaseMEGui.java b/src/main/java/appeng/client/gui/AEBaseMEGui.java index 9c1a7027c..6cc143ef4 100644 --- a/src/main/java/appeng/client/gui/AEBaseMEGui.java +++ b/src/main/java/appeng/client/gui/AEBaseMEGui.java @@ -18,11 +18,11 @@ public abstract class AEBaseMEGui extends AEBaseGui super( container ); } - public List handleItemTooltip(ItemStack stack, int mousex, int mousey, List currenttip) + public List handleItemTooltip(ItemStack stack, int mouseX, int mouseY, List currentToolTip) { if ( stack != null ) { - Slot s = getSlot( mousex, mousey ); + Slot s = getSlot( mouseX, mouseY ); if ( s instanceof SlotME ) { int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; @@ -41,18 +41,18 @@ public abstract class AEBaseMEGui extends AEBaseGui if ( myStack != null ) { if ( myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged()) ) - currenttip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) ); + currentToolTip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) ); if ( myStack.getCountRequestable() > 0 ) - currenttip.add( "\u00a77Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); + currentToolTip.add( "\u00a77Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); } else if ( stack.stackSize > BigNumber || (stack.stackSize > 1 && stack.isItemDamaged()) ) { - currenttip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); + currentToolTip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); } } } - return currenttip; + return currentToolTip; } // Vanilla version... @@ -78,17 +78,17 @@ public abstract class AEBaseMEGui extends AEBaseGui if ( myStack != null ) { - List currenttip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); if ( myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged()) ) - currenttip.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) ); + currentToolTip.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) ); if ( myStack.getCountRequestable() > 0 ) - currenttip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); + currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) ); - drawTooltip( x, y, 0, join( currenttip, "\n" ) ); + drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); } - else if ( stack != null && stack.stackSize > BigNumber ) + else if ( stack.stackSize > BigNumber ) { List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java index 225984db6..ddb4ff06a 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java @@ -27,7 +27,7 @@ import appeng.util.Platform; public class GuiCellWorkbench extends GuiUpgradeable { - ContainerCellWorkbench ccwb; + ContainerCellWorkbench workbench; TileCellWorkbench tcw; GuiImgButton clear; @@ -36,7 +36,7 @@ public class GuiCellWorkbench extends GuiUpgradeable public GuiCellWorkbench(InventoryPlayer inventoryPlayer, TileCellWorkbench te) { super( new ContainerCellWorkbench( inventoryPlayer, te ) ); - ccwb = (ContainerCellWorkbench) inventorySlots; + workbench = (ContainerCellWorkbench) inventorySlots; ySize = 251; tcw = te; } @@ -44,13 +44,7 @@ public class GuiCellWorkbench extends GuiUpgradeable @Override protected boolean drawUpgrades() { - return ccwb.availableUpgrades() > 0; - } - - @Override - public void initGui() - { - super.initGui(); + return workbench.availableUpgrades() > 0; } @Override @@ -62,17 +56,17 @@ public class GuiCellWorkbench extends GuiUpgradeable this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, ySize ); if ( drawUpgrades() ) { - if ( ccwb.availableUpgrades() <= 8 ) + if ( workbench.availableUpgrades() <= 8 ) { - this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + ccwb.availableUpgrades() * 18 ); - this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (ccwb.availableUpgrades()) * 18), 177, 151, 35, 7 ); + this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + workbench.availableUpgrades() * 18 ); + this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (workbench.availableUpgrades()) * 18), 177, 151, 35, 7 ); } - else if ( ccwb.availableUpgrades() <= 16 ) + else if ( workbench.availableUpgrades() <= 16 ) { this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18 ); this.drawTexturedModalRect( offsetX + 177, offsetY + (7 + (8) * 18), 177, 151, 35, 7 ); - int dx = ccwb.availableUpgrades() - 8; + int dx = workbench.availableUpgrades() - 8; this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if ( dx == 8 ) this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); @@ -88,7 +82,7 @@ public class GuiCellWorkbench extends GuiUpgradeable this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18 ); this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + (7 + (8) * 18), 186, 151, 35 - 8, 7 ); - int dx = ccwb.availableUpgrades() - 16; + int dx = workbench.availableUpgrades() - 16; this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if ( dx == 8 ) this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7 ); @@ -148,12 +142,13 @@ public class GuiCellWorkbench extends GuiUpgradeable buttonList.add( copyMode ); } + @Override protected void handleButtonVisibility() { - copyMode.setState( ccwb.copyMode == CopyMode.CLEAR_ON_REMOVE ); + copyMode.setState( workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); boolean hasFuzzy = false; - IInventory inv = ccwb.getCellUpgradeInventory(); + IInventory inv = workbench.getCellUpgradeInventory(); for (int x = 0; x < inv.getSizeInventory(); x++) { ItemStack is = inv.getStackInSlot( x ); @@ -166,11 +161,13 @@ public class GuiCellWorkbench extends GuiUpgradeable fuzzyMode.setVisibility( hasFuzzy ); } + @Override protected String getBackground() { return "guis/cellworkbench.png"; } + @Override protected GuiText getName() { return GuiText.CellWorkbench; diff --git a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java index aef2349d6..4519aafbf 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java @@ -26,7 +26,8 @@ public class GuiCondenser extends AEBaseGui GuiProgressBar pb; GuiImgButton mode; - public GuiCondenser(InventoryPlayer inventoryPlayer, TileCondenser te) { + public GuiCondenser(InventoryPlayer inventoryPlayer, TileCondenser te) + { super( new ContainerCondenser( inventoryPlayer, te ) ); cvc = (ContainerCondenser) inventorySlots; this.ySize = 197; @@ -57,8 +58,7 @@ public class GuiCondenser extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( "guis/condenser.png", 120 + guiLeft, 25 + guiTop, 178, 25, 6, 18, Direction.VERTICAL ); - pb.TitleName = GuiText.StoredEnergy.getLocal(); + pb = new GuiProgressBar( cvc, "guis/condenser.png", 120 + guiLeft, 25 + guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() ); mode = new GuiImgButton( 128 + guiLeft, 52 + guiTop, Settings.CONDENSER_OUTPUT, cvc.output ); @@ -83,8 +83,6 @@ public class GuiCondenser extends AEBaseGui mode.set( cvc.output ); mode.FillVar = "" + cvc.output.requiredPower; - pb.max = (int) cvc.requiredEnergy; - pb.current = (int) cvc.storedPower; } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java index 980a2d4be..289cd3027 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java @@ -46,7 +46,7 @@ public class GuiCraftConfirm extends AEBaseGui IItemList pending = AEApi.instance().storage().createItemList(); IItemList missing = AEApi.instance().storage().createItemList(); - List visual = new ArrayList(); + List visual = new ArrayList(); GuiBridge OriginalGui; @@ -84,7 +84,7 @@ public class GuiCraftConfirm extends AEBaseGui GuiButton cancel; GuiButton start; - GuiButton selectcpu; + GuiButton selectCPU; @Override public void initGui() @@ -95,10 +95,10 @@ public class GuiCraftConfirm extends AEBaseGui start.enabled = false; buttonList.add( start ); - selectcpu = new GuiButton( 0, this.guiLeft + (219 - 180) / 2, this.guiTop + ySize - 68, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + selectCPU = new GuiButton( 0, this.guiLeft + (219 - 180) / 2, this.guiTop + ySize - 68, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic ); - selectcpu.enabled = false; - buttonList.add( selectcpu ); + selectCPU.enabled = false; + buttonList.add( selectCPU ); if ( OriginalGui != null ) cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); @@ -123,7 +123,7 @@ public class GuiCraftConfirm extends AEBaseGui if ( ccc.noCPU ) btnTextText = GuiText.NoCraftingCPUs.getLocal(); - selectcpu.displayString = btnTextText; + selectCPU.displayString = btnTextText; } @Override @@ -133,7 +133,7 @@ public class GuiCraftConfirm extends AEBaseGui boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == selectcpu ) + if ( btn == selectCPU ) { try { @@ -251,12 +251,12 @@ public class GuiCraftConfirm extends AEBaseGui private IAEItemStack findVisualStack(IAEItemStack l) { - Iterator i = visual.iterator(); - while (i.hasNext()) + for (IAEItemStack o : visual) { - IAEItemStack o = i.next(); if ( o.equals( l ) ) + { return o; + } } IAEItemStack stack = l.copy(); @@ -315,25 +315,25 @@ public class GuiCraftConfirm extends AEBaseGui updateCPUButtonText(); start.enabled = ccc.noCPU || isSimulation() ? false : true; - selectcpu.enabled = isSimulation() ? false : true; + selectCPU.enabled = isSimulation() ? false : true; int x = 0; int y = 0; int gx = (width - xSize) / 2; int gy = (height - ySize) / 2; - int yoff = 23; + int offY = 23; tooltip = -1; for (int z = 0; z <= 4 * 5; z++) { int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * yoff; + int minY = gy + 22 + y * offY; if ( minX < mouse_x && minX + 67 > mouse_x ) { - if ( minY < mouse_y && minY + yoff - 2 > mouse_y ) + if ( minY < mouse_y && minY + offY - 2 > mouse_y ) { tooltip = z; break; @@ -382,7 +382,7 @@ public class GuiCraftConfirm extends AEBaseGui int viewEnd = viewStart + 3 * rows; String dspToolTip = ""; - List lineList = new LinkedList(); + List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; @@ -423,8 +423,8 @@ public class GuiCraftConfirm extends AEBaseGui str = GuiText.FromStorage.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); @@ -442,8 +442,8 @@ public class GuiCraftConfirm extends AEBaseGui str = GuiText.Missing.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) ); @@ -462,8 +462,8 @@ public class GuiCraftConfirm extends AEBaseGui str = GuiText.ToCraft.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java index d782c93c7..275831b8b 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java @@ -39,14 +39,14 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource IItemList active = AEApi.instance().storage().createItemList(); IItemList pending = AEApi.instance().storage().createItemList(); - List visual = new ArrayList(); + List visual = new ArrayList(); public void clearItems() { storage = AEApi.instance().storage().createItemList(); active = AEApi.instance().storage().createItemList(); pending = AEApi.instance().storage().createItemList(); - visual = new ArrayList(); + visual = new ArrayList(); } protected GuiCraftingCPU(ContainerCraftingCPU container) { @@ -169,12 +169,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private IAEItemStack findVisualStack(IAEItemStack l) { - Iterator i = visual.iterator(); - while (i.hasNext()) + for (IAEItemStack o : visual) { - IAEItemStack o = i.next(); if ( o.equals( l ) ) + { return o; + } } IAEItemStack stack = l.copy(); @@ -223,18 +223,18 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int gx = (width - xSize) / 2; int gy = (height - ySize) / 2; - int yoff = 23; + int offY = 23; tooltip = -1; for (int z = 0; z <= 4 * 5; z++) { int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * yoff; + int minY = gy + 22 + y * offY; if ( minX < mouse_x && minX + 67 > mouse_x ) { - if ( minY < mouse_y && minY + yoff - 2 > mouse_y ) + if ( minY < mouse_y && minY + offY - 2 > mouse_y ) { tooltip = z; break; @@ -269,7 +269,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int viewEnd = viewStart + 3 * 6; String dspToolTip = ""; - List lineList = new LinkedList(); + List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; @@ -309,8 +309,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = GuiText.Stored.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) ); @@ -328,8 +328,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = GuiText.Crafting.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) ); @@ -347,8 +347,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource str = GuiText.Scheduled.getLocal() + ": " + str; int w = 4 + fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * offY + yo - + 6 - negY + downY) * 2), 4210752 ); + fontRendererObj.drawString( str, (int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * offY + yo + + 6 - negY + downY) * 2, 4210752 ); if ( tooltip == z - viewStart ) lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java index a5237dcf0..862ec26b8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java @@ -30,7 +30,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU { ContainerCraftingStatus ccc; - GuiButton selectcpu; + GuiButton selectCPU; GuiTabButton originalGuiBtn; GuiBridge OriginalGui; @@ -74,7 +74,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU boolean backwards = Mouse.isButtonDown( 1 ); - if ( btn == selectcpu ) + if ( btn == selectCPU ) { try { @@ -110,9 +110,9 @@ public class GuiCraftingStatus extends GuiCraftingCPU { super.initGui(); - selectcpu = new GuiButton( 0, this.guiLeft + 8, this.guiTop + ySize - 25, 150, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs ); - // selectcpu.enabled = false; - buttonList.add( selectcpu ); + selectCPU = new GuiButton( 0, this.guiLeft + 8, this.guiTop + ySize - 25, 150, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs ); + // selectCPU.enabled = false; + buttonList.add( selectCPU ); if ( myIcon != null ) { @@ -139,7 +139,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if ( ccc.noCPU ) btnTextText = GuiText.NoCraftingJobs.getLocal(); - selectcpu.displayString = btnTextText; + selectCPU.displayString = btnTextText; } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java index 0905d7c48..c01438fa2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java @@ -67,6 +67,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable reservedSpace = 73; } + @Override protected String getBackground() { return "guis/crafting.png"; diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index 623251104..6f7188d66 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -26,12 +26,6 @@ public class GuiFormationPlane extends GuiUpgradeable this.ySize = 251; } - @Override - public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) - { - super.drawBG( offsetX, offsetY, mouseX, mouseY ); - } - @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { @@ -70,6 +64,7 @@ public class GuiFormationPlane extends GuiUpgradeable } } + @Override protected String getBackground() { return "guis/storagebus.png"; diff --git a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java index d8901d9a2..0bed5d4f2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java @@ -88,6 +88,7 @@ public class GuiIOPort extends GuiUpgradeable } } + @Override protected String getBackground() { return "guis/ioport.png"; diff --git a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java index f2c39e6d3..271a47c60 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java @@ -15,7 +15,8 @@ public class GuiInscriber extends AEBaseGui ContainerInscriber cvc; GuiProgressBar pb; - public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te) { + public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te) + { super( new ContainerInscriber( inventoryPlayer, te ) ); cvc = (ContainerInscriber) inventorySlots; this.ySize = 176; @@ -27,7 +28,7 @@ public class GuiInscriber extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL ); + pb = new GuiProgressBar( cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL ); this.buttonList.add( pb ); } @@ -49,9 +50,7 @@ public class GuiInscriber extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - pb.max = cvc.maxProcessingTime; - pb.current = cvc.processingTime; - pb.FullMsg = (pb.current * 100 / pb.max) + "%"; + pb.setFullMsg( cvc.getCurrentProgress() * 100 / cvc.getMaxProgress() + "%" ); fontRendererObj.drawString( getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 ); fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterface.java b/src/main/java/appeng/client/gui/implementations/GuiInterface.java index 07a88448d..55193bbe0 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterface.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterface.java @@ -81,6 +81,7 @@ public class GuiInterface extends GuiUpgradeable buttonList.add( interfaceMode ); } + @Override protected String getBackground() { return "guis/interface.png"; diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java index a9e2bdf4b..69bfc36a8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java @@ -25,11 +25,11 @@ import com.google.common.collect.HashMultimap; public class GuiInterfaceTerminal extends AEBaseGui { - HashMap byId = new HashMap(); + HashMap byId = new HashMap(); HashMultimap byName = HashMultimap.create(); - ArrayList names = new ArrayList(); + ArrayList names = new ArrayList(); - ArrayList lines = new ArrayList(); + ArrayList lines = new ArrayList(); private int getTotalRows() { @@ -43,7 +43,7 @@ public class GuiInterfaceTerminal extends AEBaseGui ySize = 222; } - LinkedList dcSlots = new LinkedList(); + LinkedList dcSlots = new LinkedList(); @Override public void initGui() @@ -178,17 +178,17 @@ public class GuiInterfaceTerminal extends AEBaseGui Collections.sort( names ); - lines = new ArrayList( getTotalRows() ); + lines = new ArrayList( getTotalRows() ); for (String n : names) { lines.add( n ); - ArrayList lset = new ArrayList(); - lset.addAll( byName.get( n ) ); + ArrayList clientInventories = new ArrayList(); + clientInventories.addAll( byName.get( n ) ); - Collections.sort( lset ); + Collections.sort( clientInventories ); - for (ClientDCInternalInv i : lset) + for (ClientDCInternalInv i : clientInventories) { lines.add( i ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java index 9db1ba390..de48d72a0 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java @@ -148,6 +148,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } } + @Override protected void handleButtonVisibility() { craftingMode.setVisibility( bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); @@ -226,11 +227,13 @@ public class GuiLevelEmitter extends GuiUpgradeable level.drawTextBox(); } + @Override protected String getBackground() { return "guis/lvlemitter.png"; } + @Override protected GuiText getName() { return GuiText.LevelEmitter; diff --git a/src/main/java/appeng/client/gui/implementations/GuiMAC.java b/src/main/java/appeng/client/gui/implementations/GuiMAC.java index 10674c237..27a3a2f03 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMAC.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMAC.java @@ -13,7 +13,7 @@ import appeng.tile.crafting.TileMolecularAssembler; public class GuiMAC extends GuiUpgradeable { - ContainerMAC cmac; + ContainerMAC container; GuiProgressBar pb; @Override @@ -21,7 +21,7 @@ public class GuiMAC extends GuiUpgradeable { super.initGui(); - pb = new GuiProgressBar( "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL ); + pb = new GuiProgressBar( container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL ); this.buttonList.add( pb ); } @@ -36,10 +36,7 @@ public class GuiMAC extends GuiUpgradeable @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - pb.max = 100; - pb.current = cmac.craftProgress; - pb.FullMsg = pb.current + "%"; - + pb.setFullMsg( container.getCurrentProgress() + "%" ); super.drawFG( offsetX, offsetY, mouseX, mouseY ); } @@ -50,17 +47,20 @@ public class GuiMAC extends GuiUpgradeable buttonList.add( redstoneMode ); } + @Override protected String getBackground() { return "guis/mac.png"; } - public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te) { + public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te) + { super( new ContainerMAC( inventoryPlayer, te ) ); this.ySize = 197; - this.cmac = (ContainerMAC) this.inventorySlots; + this.container = (ContainerMAC) this.inventorySlots; } + @Override protected GuiText getName() { return GuiText.MolecularAssembler; diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 05fbbd1b9..15a3a4ce7 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -62,7 +62,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi GuiText myName; - int xoffset = 9; + int offsetX = 9; int perRow = 9; int reservedSpace = 0; int lowerTextureOffset = 0; @@ -83,7 +83,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi boolean viewCell; ItemStack myCurrentViewCells[] = new ItemStack[5]; - ContainerMEMonitorable mecontainer; + ContainerMEMonitorable monitorableContainer; public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te) { this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) ); @@ -104,7 +104,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi standardSize = xSize; configSrc = ((IConfigurableObject) inventorySlots).getConfigManager(); - (mecontainer = (ContainerMEMonitorable) inventorySlots).gui = this; + (monitorableContainer = (ContainerMEMonitorable) inventorySlots).gui = this; viewCell = te instanceof IViewCellStorage; @@ -180,7 +180,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi { for (int x = 0; x < perRow; x++) { - meSlots.add( new InternalSlotME( repo, x + y * perRow, xoffset + x * 18, 18 + y * 18 ) ); + meSlots.add( new InternalSlotME( repo, x + y * perRow, offsetX + x * 18, 18 + y * 18 ) ); } } @@ -197,7 +197,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi this.ySize = magicNumber + rows * 18 + reservedSpace; // this.guiTop = top; int unusedSpace = height - ySize; - guiTop = (int) Math.floor( (float) unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f) ); + guiTop = (int) Math.floor( unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f) ); int offset = guiTop + 8; @@ -226,7 +226,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi .getSetting( Settings.TERMINAL_STYLE ) ) ); } - searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT ); + searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, offsetX ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT ); searchField.setEnableBackgroundDrawing( false ); searchField.setMaxStringLength( 25 ); searchField.setTextColor( 0xFFFFFF ); @@ -373,7 +373,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi @Override public void updateScreen() { - repo.setPower( mecontainer.hasPower ); + repo.setPower( monitorableContainer.hasPower ); super.updateScreen(); } @@ -399,10 +399,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi for (int i = 0; i < 5; i++) { - if ( myCurrentViewCells[i] != mecontainer.cellView[i].getStack() ) + if ( myCurrentViewCells[i] != monitorableContainer.cellView[i].getStack() ) { update = true; - myCurrentViewCells[i] = mecontainer.cellView[i].getStack(); + myCurrentViewCells[i] = monitorableContainer.cellView[i].getStack(); } } @@ -459,6 +459,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi repo.updateView(); } + @Override protected boolean isPowered() { return repo.hasPower(); diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index 57fbdb522..19adb882d 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -171,7 +171,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource str = Long.toString( refStack.getStackSize() / 1000 ) + "k"; int w = fontRendererObj.getStringWidth( str ); - fontRendererObj.drawString( str, (int) ((x * sectionLength + xo + sectionLength - 19 - ((float) w * 0.5)) * 2), (int) ((y * 18 + yo + 6) * 2), + fontRendererObj.drawString( str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * 18 + yo + 6) * 2, 4210752 ); GL11.glPopMatrix(); @@ -213,11 +213,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } // @Override - NEI - public List handleItemTooltip(ItemStack stack, int mousex, int mousey, List currenttip) + public List handleItemTooltip(ItemStack stack, int mouseX, int mouseY, List currentToolTip) { if ( stack != null ) { - Slot s = getSlot( mousex, mousey ); + Slot s = getSlot( mouseX, mouseY ); if ( s instanceof SlotME ) { IAEItemStack myStack = null; @@ -233,13 +233,13 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource if ( myStack != null ) { - while (currenttip.size() > 1) - currenttip.remove( 1 ); + while (currentToolTip.size() > 1) + currentToolTip.remove( 1 ); } } } - return currenttip; + return currentToolTip; } // Vanilla version... @@ -261,15 +261,15 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource if ( myStack != null ) { - List currenttip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); - while (currenttip.size() > 1) - currenttip.remove( 1 ); + while (currentToolTip.size() > 1) + currentToolTip.remove( 1 ); - currenttip.add( GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()) ); - currenttip.add( GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( myStack.getCountRequestable(), true ) ); + currentToolTip.add( GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()) ); + currentToolTip.add( GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( myStack.getCountRequestable(), true ) ); - drawTooltip( x, y, 0, join( currenttip, "\n" ) ); + drawTooltip( x, y, 0, join( currentToolTip, "\n" ) ); } } // super.drawItemStackTooltip( stack, x, y ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java index d9ed69095..0b72c77b4 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java @@ -83,6 +83,7 @@ public class GuiPatternTerm extends GuiMEMonitorable // } } + @Override protected void repositionSlot(AppEngSlot s) { if ( s.isPlayerSide() ) @@ -97,6 +98,7 @@ public class GuiPatternTerm extends GuiMEMonitorable reservedSpace = 81; } + @Override protected String getBackground() { if ( container.craftingMode ) diff --git a/src/main/java/appeng/client/gui/implementations/GuiPriority.java b/src/main/java/appeng/client/gui/implementations/GuiPriority.java index 929a03184..35caf58e5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPriority.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPriority.java @@ -73,7 +73,7 @@ public class GuiPriority extends AEBaseGui if ( target instanceof PartFormationPlane ) { myIcon = AEApi.instance().parts().partFormationPlane.stack( 1 ); - OriginalGui = GuiBridge.GUI_FPLANE; + OriginalGui = GuiBridge.GUI_FORMATION_PLANE; } if ( target instanceof TileDrive ) diff --git a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java index 8ce92a727..160ef8e28 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java @@ -50,6 +50,7 @@ public class GuiSecurity extends GuiMEMonitorable .getUnlocalizedName(), SecurityPermissions.SECURITY.getUnlocalizedTip() ) ); } + @Override protected void actionPerformed(net.minecraft.client.gui.GuiButton btn) { super.actionPerformed( btn ); @@ -79,8 +80,9 @@ public class GuiSecurity extends GuiMEMonitorable } } - }; + } + @Override protected String getBackground() { ContainerSecurity cs = (ContainerSecurity) inventorySlots; diff --git a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java index 725d408f7..fb3a1ce1b 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java @@ -17,13 +17,13 @@ import appeng.util.Platform; public class GuiSpatialIOPort extends AEBaseGui { - ContainerSpatialIOPort csiop; + ContainerSpatialIOPort container; GuiImgButton units; public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) { super( new ContainerSpatialIOPort( inventoryPlayer, te ) ); this.ySize = 199; - csiop = (ContainerSpatialIOPort) inventorySlots; + container = (ContainerSpatialIOPort) inventorySlots; } @Override @@ -59,10 +59,10 @@ public class GuiSpatialIOPort extends AEBaseGui @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { - fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( csiop.currentPower, false ), 13, 21, 4210752 ); - fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( csiop.maxPower, false ), 13, 31, 4210752 ); - fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( csiop.reqPower, false ), 13, 78, 4210752 ); - fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) csiop.eff) / 100) + "%", 13, 88, 4210752 ); + fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( container.currentPower, false ), 13, 21, 4210752 ); + fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( container.maxPower, false ), 13, 31, 4210752 ); + fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( container.reqPower, false ), 13, 78, 4210752 ); + fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) container.eff) / 100) + "%", 13, 88, 4210752 ); fontRendererObj.drawString( getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 ); fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96, 4210752 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java index a20af4179..6fbbbef16 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java @@ -38,12 +38,6 @@ public class GuiStorageBus extends GuiUpgradeable this.ySize = 251; } - @Override - public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) - { - super.drawBG( offsetX, offsetY, mouseX, mouseY ); - } - @Override public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) { @@ -96,9 +90,6 @@ public class GuiStorageBus extends GuiUpgradeable else if ( btn == priority ) NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); - else if ( btn == fuzzyMode ) - NetworkHandler.instance.sendToServer( new PacketConfigButton( fuzzyMode.getSetting(), backwards ) ); - else if ( btn == rwMode ) NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) ); @@ -112,6 +103,7 @@ public class GuiStorageBus extends GuiUpgradeable } } + @Override protected String getBackground() { return "guis/storagebus.png"; diff --git a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java index 0ed3cf016..40fd54146 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java @@ -38,7 +38,7 @@ public class GuiUpgradeable extends AEBaseGui public GuiUpgradeable(ContainerUpgradeable te) { super( te ); - cvb = (ContainerUpgradeable) te; + cvb = te; bc = (IUpgradeableHost) te.getTarget(); this.xSize = hasToolbox() ? 246 : 211; diff --git a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java index 916687644..74d3f5d58 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java @@ -17,7 +17,8 @@ public class GuiVibrationChamber extends AEBaseGui ContainerVibrationChamber cvc; GuiProgressBar pb; - public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te) { + public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te) + { super( new ContainerVibrationChamber( inventoryPlayer, te ) ); cvc = (ContainerVibrationChamber) inventorySlots; this.ySize = 166; @@ -28,7 +29,7 @@ public class GuiVibrationChamber extends AEBaseGui { super.initGui(); - pb = new GuiProgressBar( "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL ); + pb = new GuiProgressBar( cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL ); this.buttonList.add( pb ); } @@ -50,13 +51,11 @@ public class GuiVibrationChamber extends AEBaseGui int k = 25; int l = -15; - pb.max = 200; - pb.current = cvc.burnProgress > 0 ? cvc.burnSpeed : 0; - pb.FullMsg = (cvc.aePerTick * pb.current / 100) + " ae/t"; + pb.setFullMsg( cvc.aePerTick * cvc.getCurrentProgress() / 100 + " ae/t" ); - if ( cvc.burnProgress > 0 ) + if ( cvc.getCurrentProgress() > 0 ) { - int i1 = cvc.burnProgress; + int i1 = cvc.getCurrentProgress(); bindTexture( "guis/vibchamber.png" ); GL11.glColor3f( 1, 1, 1 ); this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiWireless.java b/src/main/java/appeng/client/gui/implementations/GuiWireless.java index ac574bb20..2b80e51b2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWireless.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWireless.java @@ -64,13 +64,13 @@ public class GuiWireless extends AEBaseGui if ( cw.range > 0 ) { - String msga = GuiText.Range.getLocal() + ": " + ((double) cw.range / 10.0) + " m"; - String msgb = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); + String firstMessage = GuiText.Range.getLocal() + ": " + (cw.range / 10.0) + " m"; + String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); - int strWidth = Math.max( fontRendererObj.getStringWidth( msga ), fontRendererObj.getStringWidth( msgb ) ); + int strWidth = Math.max( fontRendererObj.getStringWidth( firstMessage ), fontRendererObj.getStringWidth( secondMessage ) ); int cOffset = (this.xSize / 2) - (strWidth / 2); - fontRendererObj.drawString( msga, cOffset, 20, 4210752 ); - fontRendererObj.drawString( msgb, cOffset, 20 + 12, 4210752 ); + fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); + fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); } } diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index a753d9ec2..dc1a3eb43 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -53,11 +53,15 @@ public class GuiImgButton extends GuiButton implements ITooltip @Override public boolean equals(Object obj) { - EnumPair d = (EnumPair) obj; - return d.setting.equals( setting ) && d.value.equals( value ); + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + EnumPair other = (EnumPair) obj; + return other.setting.equals( setting ) && other.value.equals( value ); } - }; + } class BtnAppearance { @@ -65,7 +69,7 @@ public class GuiImgButton extends GuiButton implements ITooltip public int index; public String DisplayName; public String DisplayValue; - }; + } public boolean halfSize = false; public String FillVar; @@ -101,7 +105,7 @@ public class GuiImgButton extends GuiButton implements ITooltip if ( Appearances == null ) { - Appearances = new HashMap(); + Appearances = new HashMap(); registerApp( 16 * 7 + 0, Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH, ButtonToolTips.CondenserOutput, ButtonToolTips.Trash ); registerApp( 16 * 7 + 1, Settings.CONDENSER_OUTPUT, CondenserOutput.MATTER_BALLS, ButtonToolTips.CondenserOutput, ButtonToolTips.MatterBalls ); registerApp( 16 * 7 + 2, Settings.CONDENSER_OUTPUT, CondenserOutput.SINGULARITY, ButtonToolTips.CondenserOutput, ButtonToolTips.Singularity ); diff --git a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java index 0c145987c..b460d7853 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java @@ -3,6 +3,7 @@ package appeng.client.gui.widgets; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; +import appeng.container.interfaces.IProgressProvider; import appeng.core.localization.GuiText; public class GuiProgressBar extends GuiButton implements ITooltip @@ -11,31 +12,35 @@ public class GuiProgressBar extends GuiButton implements ITooltip public enum Direction { HORIZONTAL, VERTICAL - }; + } + private IProgressProvider source; private ResourceLocation texture; private int fill_u; private int fill_v; private Direction layout; - public String FullMsg; + private String fullMsg; + private final String titleName; - public String TitleName; - public int current; - public int max; + public GuiProgressBar(IProgressProvider source, String texture, int posX, int posY, int u, int y, int _width, int _height, Direction dir) + { + this( source, texture, posX, posY, u, y, _width, _height, dir, null ); + } - public GuiProgressBar(String string, int posX, int posY, int u, int y, int _width, int _height, Direction dir) { + public GuiProgressBar(IProgressProvider source, String texture, int posX, int posY, int u, int y, int _width, int _height, Direction dir, String title) + { super( posX, posY, _width, "" ); + this.source = source; this.xPosition = posX; this.yPosition = posY; - texture = new ResourceLocation( "appliedenergistics2", "textures/" + string ); + this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture ); width = _width; height = _height; fill_u = u; fill_v = y; - current = 0; - max = 100; layout = dir; + titleName = title; } @Override @@ -44,6 +49,8 @@ public class GuiProgressBar extends GuiButton implements ITooltip if ( this.visible ) { par1Minecraft.getTextureManager().bindTexture( texture ); + int max = source.getMaxProgress(); + int current = source.getCurrentProgress(); if ( layout == Direction.VERTICAL ) { @@ -60,13 +67,18 @@ public class GuiProgressBar extends GuiButton implements ITooltip } } + public void setFullMsg(String msg) + { + this.fullMsg = msg; + } + @Override public String getMsg() { - if ( FullMsg != null ) - return FullMsg; + if ( fullMsg != null ) + return fullMsg; - return (TitleName != null ? TitleName : "") + "\n" + current + " " + GuiText.Of.getLocal() + " " + max; + return (titleName != null ? titleName : "") + "\n" + source.getCurrentProgress() + " " + GuiText.Of.getLocal() + " " + source.getMaxProgress(); } @Override diff --git a/src/main/java/appeng/client/me/ItemRepo.java b/src/main/java/appeng/client/me/ItemRepo.java index 725cd89dc..b101f3782 100644 --- a/src/main/java/appeng/client/me/ItemRepo.java +++ b/src/main/java/appeng/client/me/ItemRepo.java @@ -122,9 +122,9 @@ public class ItemRepo view.ensureCapacity( list.size() ); dsp.ensureCapacity( list.size() ); - Enum vmode = sortSrc.getSortDisplay(); - Enum mode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); - if ( mode == SearchBoxMode.NEI_AUTOSEARCH || mode == SearchBoxMode.NEI_MANUAL_SEARCH ) + Enum viewMode = sortSrc.getSortDisplay(); + Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + if ( searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH ) updateNEI( searchString ); innerSearch = searchString; @@ -164,16 +164,16 @@ public class ItemRepo continue; } - if ( vmode == ViewItems.CRAFTABLE && !is.isCraftable() ) + if ( viewMode == ViewItems.CRAFTABLE && !is.isCraftable() ) continue; - if ( vmode == ViewItems.CRAFTABLE ) + if ( viewMode == ViewItems.CRAFTABLE ) { is = is.copy(); is.setStackSize( 0 ); } - if ( vmode == ViewItems.STORED && is.getStackSize() == 0 ) + if ( viewMode == ViewItems.STORED && is.getStackSize() == 0 ) continue; String dspName = searchMod ? Platform.getModId( is ) : Platform.getItemDisplayName( is ); diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index f24531b8c..4ac2a551b 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -14,7 +14,7 @@ import appeng.core.AEConfig; public class AppEngRenderItem extends RenderItem { - public IAEItemStack aestack; + public IAEItemStack aeStack; private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) { @@ -30,7 +30,7 @@ public class AppEngRenderItem extends RenderItem @Override public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemOverlayIntoGUI( par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null ); + this.renderItemOverlayIntoGUI( par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, null ); } @Override @@ -83,7 +83,7 @@ public class AppEngRenderItem extends RenderItem GL11.glEnable( GL11.GL_DEPTH_TEST ); } - long amount = aestack != null ? aestack.getStackSize() : is.stackSize; + long amount = aeStack != null ? aeStack.getStackSize() : is.stackSize; if ( amount > 999999999999L ) amount = 999999999999L; diff --git a/src/main/java/appeng/client/render/BaseBlockRender.java b/src/main/java/appeng/client/render/BaseBlockRender.java index 88ac16bdb..0aa7066b7 100644 --- a/src/main/java/appeng/client/render/BaseBlockRender.java +++ b/src/main/java/appeng/client/render/BaseBlockRender.java @@ -255,9 +255,9 @@ public class BaseBlockRender this( false, 20 ); } - public BaseBlockRender(boolean enableTESR, double TESRrange) { + public BaseBlockRender(boolean enableTESR, double tileEntitySpecialRendererRange) { hasTESR = enableTESR; - MAX_DISTANCE = TESRrange; + MAX_DISTANCE = tileEntitySpecialRendererRange; setOriMap(); } @@ -587,52 +587,52 @@ public class BaseBlockRender Tessellator tess = Tessellator.instance; double offsetX = 0.0, offsetY = 0.0, offsetZ = 0.0; - double layaX = 0.0, layaY = 0.0, layaZ = 0.0; - double laybX = 0.0, laybY = 0.0, laybZ = 0.0; + double layerAX = 0.0, layerAY = 0.0, layerAZ = 0.0; + double layerBX = 0.0, layerBY = 0.0, layerBZ = 0.0; boolean flip = false; switch (orientation) { case NORTH: - layaX = 1.0; - laybY = 1.0; + layerAX = 1.0; + layerBY = 1.0; flip = true; break; case SOUTH: - layaX = 1.0; - laybY = 1.0; + layerAX = 1.0; + layerBY = 1.0; offsetZ = 1.0; break; case EAST: flip = true; - layaZ = 1.0; - laybY = 1.0; + layerAZ = 1.0; + layerBY = 1.0; offsetX = 1.0; break; case WEST: - layaZ = 1.0; - laybY = 1.0; + layerAZ = 1.0; + layerBY = 1.0; break; case UP: flip = true; - layaX = 1.0; - laybZ = 1.0; + layerAX = 1.0; + layerBZ = 1.0; offsetY = 1.0; break; case DOWN: - layaX = 1.0; - laybZ = 1.0; + layerAX = 1.0; + layerBZ = 1.0; break; default: @@ -643,25 +643,25 @@ public class BaseBlockRender offsetY += y; offsetZ += z; - renderFace( tess, offsetX, offsetY, offsetZ, layaX, layaY, layaZ, laybX, laybY, laybZ, + renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, // v -> v 0, edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layaX, layaY, layaZ, laybX, laybY, laybZ, + renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0.0, edgeThickness, // v -> v edgeThickness, 1.0 - edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layaX, layaY, layaZ, laybX, laybY, laybZ, + renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 1.0 - edgeThickness, 1.0, // v -> v edgeThickness, 1.0 - edgeThickness, ico, flip ); - renderFace( tess, offsetX, offsetY, offsetZ, layaX, layaY, layaZ, laybX, laybY, laybZ, + renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, // v -> v @@ -725,9 +725,9 @@ public class BaseBlockRender return 0; if ( offset > 0 ) - return (double) uv / 16.0; + return uv / 16.0; - return (16.0 - (double) uv) / 16.0; + return (16.0 - uv) / 16.0; } public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer) diff --git a/src/main/java/appeng/client/render/BusRenderHelper.java b/src/main/java/appeng/client/render/BusRenderHelper.java index 522b0c5e1..986b44f63 100644 --- a/src/main/java/appeng/client/render/BusRenderHelper.java +++ b/src/main/java/appeng/client/render/BusRenderHelper.java @@ -102,7 +102,7 @@ public class BusRenderHelper implements IPartRenderHelper return false; } - }; + } BoundBoxCalculator bbc = new BoundBoxCalculator(); @@ -209,14 +209,14 @@ public class BusRenderHelper implements IPartRenderHelper } @Override - public void setBounds(float minx, float miny, float minz, float maxx, float maxy, float maxz) + public void setBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { - minX = minx; - minY = miny; - minZ = minz; - maxX = maxx; - maxY = maxy; - maxZ = maxz; + this.minX = minX; + this.minY = minY; + this.minZ = minZ; + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; } public double getBound(ForgeDirection side) @@ -370,6 +370,7 @@ public class BusRenderHelper implements IPartRenderHelper BusRenderer.instance.renderer.renderFaces = faces; } + @Override public void renderBlockCurrentBounds(int x, int y, int z, RenderBlocks renderer) { if ( !renderThis() ) diff --git a/src/main/java/appeng/client/render/BusRenderer.java b/src/main/java/appeng/client/render/BusRenderer.java index 879f3dcce..1ad145e48 100644 --- a/src/main/java/appeng/client/render/BusRenderer.java +++ b/src/main/java/appeng/client/render/BusRenderer.java @@ -29,7 +29,7 @@ public class BusRenderer implements IItemRenderer public static final BusRenderer instance = new BusRenderer(); public RenderBlocksWorkaround renderer = new RenderBlocksWorkaround(); - public static final HashMap renderPart = new HashMap(); + public static final HashMap renderPart = new HashMap(); public IPart getRenderer(ItemStack is, IPartItem c) { diff --git a/src/main/java/appeng/client/render/CableRenderHelper.java b/src/main/java/appeng/client/render/CableRenderHelper.java index 4fbc2b907..36c6dc6cf 100644 --- a/src/main/java/appeng/client/render/CableRenderHelper.java +++ b/src/main/java/appeng/client/render/CableRenderHelper.java @@ -106,7 +106,7 @@ public class CableRenderHelper /** * snag list of boxes... */ - List boxes = new ArrayList(); + List boxes = new ArrayList(); for (ForgeDirection s : ForgeDirection.values()) { IPart part = cableBusContainer.getPart( s ); diff --git a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java index f8794d30b..f425a6eb0 100644 --- a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java +++ b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java @@ -126,7 +126,7 @@ public class RenderBlocksWorkaround extends RenderBlocks lightHash = 0; } - }; + } private LightingCache lightState = new LightingCache(); @@ -310,10 +310,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( this.renderMinZ * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( this.renderMaxZ * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); + double d3 = par8Icon.getInterpolatedU( this.renderMinZ * 16.0D ); + double d4 = par8Icon.getInterpolatedU( this.renderMaxZ * 16.0D ); + double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); double d11 = par2 + this.renderMinX; double d12 = par4 + this.renderMinY; @@ -364,10 +364,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( 16.0D - this.renderMinZ * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( 16.0D - this.renderMaxZ * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); + double d3 = par8Icon.getInterpolatedU( 16.0D - this.renderMinZ * 16.0D ); + double d4 = par8Icon.getInterpolatedU( 16.0D - this.renderMaxZ * 16.0D ); + double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); double d11 = par2 + this.renderMaxX; double d12 = par4 + this.renderMinY; @@ -446,10 +446,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); + double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + double d5 = par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); + double d6 = par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); double d11 = par2 + this.renderMinX; double d12 = par2 + this.renderMaxX; @@ -500,10 +500,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); + double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + double d5 = par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); + double d6 = par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); double d11 = par2 + this.renderMinX; double d12 = par2 + this.renderMaxX; @@ -554,10 +554,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( 16.0D - this.renderMinX * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( 16.0D - this.renderMaxX * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); + double d3 = par8Icon.getInterpolatedU( 16.0D - this.renderMinX * 16.0D ); + double d4 = par8Icon.getInterpolatedU( 16.0D - this.renderMaxX * 16.0D ); + double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); double d11 = par2 + this.renderMinX; double d12 = par2 + this.renderMaxX; @@ -608,10 +608,10 @@ public class RenderBlocksWorkaround extends RenderBlocks { Tessellator tessellator = Tessellator.instance; - double d3 = (double) par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); - double d4 = (double) par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); - double d5 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); - double d6 = (double) par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); + double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); double d11 = par2 + this.renderMinX; double d12 = par2 + this.renderMaxX; diff --git a/src/main/java/appeng/client/render/SpatialSkyRender.java b/src/main/java/appeng/client/render/SpatialSkyRender.java index b4d16d163..e82277c15 100644 --- a/src/main/java/appeng/client/render/SpatialSkyRender.java +++ b/src/main/java/appeng/client/render/SpatialSkyRender.java @@ -121,10 +121,10 @@ public class SpatialSkyRender extends IRenderHandler for (int i = 0; i < 50; ++i) { - double iX = (double) (random.nextFloat() * 2.0F - 1.0F); - double iY = (double) (random.nextFloat() * 2.0F - 1.0F); - double iZ = (double) (random.nextFloat() * 2.0F - 1.0F); - double d3 = (double) (0.05F + random.nextFloat() * 0.1F); + double iX = random.nextFloat() * 2.0F - 1.0F; + double iY = random.nextFloat() * 2.0F - 1.0F; + double iZ = random.nextFloat() * 2.0F - 1.0F; + double d3 = 0.05F + random.nextFloat() * 0.1F; double dist = iX * iX + iY * iY + iZ * iZ; if ( dist < 1.0D && dist > 0.01D ) @@ -149,8 +149,8 @@ public class SpatialSkyRender extends IRenderHandler for (int j = 0; j < 4; ++j) { double d17 = 0.0D; - double d18 = (double) ((j & 2) - 1) * d3; - double d19 = (double) ((j + 1 & 2) - 1) * d3; + double d18 = ((j & 2) - 1) * d3; + double d19 = ((j + 1 & 2) - 1) * d3; double d20 = d18 * d16 - d19 * d15; double d21 = d19 * d16 + d18 * d15; double d22 = d20 * d12 + d17 * d13; diff --git a/src/main/java/appeng/client/render/TESRWrapper.java b/src/main/java/appeng/client/render/TESRWrapper.java index edeadc58b..8e2cd1154 100644 --- a/src/main/java/appeng/client/render/TESRWrapper.java +++ b/src/main/java/appeng/client/render/TESRWrapper.java @@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class TESRWrapper extends TileEntitySpecialRenderer { - final public RenderBlocks rbinstance = new RenderBlocks(); + final public RenderBlocks renderBlocksInstance = new RenderBlocks(); final BaseBlockRender blkRender; final double MAX_DISTANCE; @@ -51,8 +51,8 @@ public class TESRWrapper extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - rbinstance.blockAccess = te.getWorldObj(); - blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, rbinstance ); + renderBlocksInstance.blockAccess = te.getWorldObj(); + blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, renderBlocksInstance ); if ( Platform.isDrawing( tess ) ) throw new RuntimeException( "Error during rendering." ); diff --git a/src/main/java/appeng/client/render/WorldRender.java b/src/main/java/appeng/client/render/WorldRender.java index 453fea84f..a22b820eb 100644 --- a/src/main/java/appeng/client/render/WorldRender.java +++ b/src/main/java/appeng/client/render/WorldRender.java @@ -23,7 +23,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler public static final WorldRender instance = new WorldRender(); boolean hasError = false; - public HashMap blockRenders = new HashMap(); + public HashMap blockRenders = new HashMap(); void setRender(AEBaseBlock in, BaseBlockRender r) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java index 687ae307f..9cf5ce690 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java @@ -36,7 +36,7 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide if ( ne instanceof IGridHost && ne instanceof IPartHost ) { IPartHost ph = (IPartHost) ne; - IPart pcx = (IPart) ph.getPart( ForgeDirection.UNKNOWN ); + IPart pcx = ph.getPart( ForgeDirection.UNKNOWN ); if ( pcx instanceof PartCable ) { PartCable pc = (PartCable) pcx; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java index 980dd1ff7..4b0f9460a 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java @@ -36,7 +36,7 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU if ( tile instanceof TileCraftingMonitorTile ) { TileCraftingMonitorTile cmt = (TileCraftingMonitorTile) tile; - IAEItemStack ais = (IAEItemStack) cmt.getJobProgress(); + IAEItemStack ais = cmt.getJobProgress(); if ( cmt.dspList == null ) { @@ -89,14 +89,14 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU { GL11.glScalef( 1.0f, -1.0f, 1.0f ); GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f ); - GL11.glRotatef( (float) spin * 90.0F, 0, 0, 1 ); + GL11.glRotatef( 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( (float) spin * -90.0F, 0, 0, 1 ); + GL11.glRotatef( spin * -90.0F, 0, 0, 1 ); } if ( d == ForgeDirection.EAST ) diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java index ac39af7b9..3afc9bb8e 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java @@ -45,7 +45,7 @@ public class RenderBlockCrank extends BaseBlockRender } @Override - public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks rbinstance) + public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks) { TileCrank tc = (TileCrank) tile; if ( tc.getUp() == null || tc.getUp() == ForgeDirection.UNKNOWN ) @@ -69,16 +69,16 @@ public class RenderBlockCrank extends BaseBlockRender tess.setTranslation( -tc.xCoord, -tc.yCoord, -tc.zCoord ); tess.startDrawingQuads(); - rbinstance.renderAllFaces = true; - rbinstance.blockAccess = tc.getWorldObj(); + renderBlocks.renderAllFaces = true; + renderBlocks.blockAccess = tc.getWorldObj(); - rbinstance.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.1, 0.5D + 0.05 ); + renderBlocks.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.1, 0.5D + 0.05 ); - rbinstance.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); + renderBlocks.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); - rbinstance.setRenderBounds( 0.70D - 0.15, 0.55D - 0.05, 0.5D - 0.05, 0.70D + 0.15, 0.55D + 0.05, 0.5D + 0.05 ); + renderBlocks.setRenderBounds( 0.70D - 0.15, 0.55D - 0.05, 0.5D - 0.05, 0.70D + 0.15, 0.55D + 0.05, 0.5D + 0.05 ); - rbinstance.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); + renderBlocks.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); tess.draw(); tess.setTranslation( 0, 0, 0 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java index 67e1c4e81..302adb8ed 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java @@ -144,17 +144,17 @@ public class RenderBlockInscriber extends BaseBlockRender float press = 0.2f; float base = 0.4f; - long lprogress = 0; + long absoluteProgress = 0; if ( inv.smash ) { long currentTime = System.currentTimeMillis(); - lprogress = currentTime - inv.clientStart; - if ( lprogress > 800 ) + absoluteProgress = currentTime - inv.clientStart; + if ( absoluteProgress > 800 ) inv.smash = false; } - float rprogress = (float) (lprogress % 800) / 400.0f; - float progress = rprogress; + float relativeProgress = absoluteProgress % 800 / 400.0f; + float progress = relativeProgress; if ( progress > 1.0f ) progress = 1.0f - (progress - 1.0f); @@ -197,7 +197,7 @@ public class RenderBlockInscriber extends BaseBlockRender if ( inv.getStackInSlot( 2 ) != null ) items++; - if ( rprogress > 1.0f || items == 0 ) + if ( relativeProgress > 1.0f || items == 0 ) { ItemStack is = inv.getStackInSlot( 3 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java index bbd2828af..f5438a6ca 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java @@ -2,6 +2,7 @@ package appeng.client.render.blocks; import java.util.EnumSet; +import appeng.helpers.Splotch; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; @@ -12,7 +13,6 @@ import net.minecraftforge.common.util.ForgeDirection; import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.texture.ExtraBlockTextures; -import appeng.helpers.Splot; import appeng.tile.misc.TilePaint; public class RenderBlockPaint extends BaseBlockRender @@ -42,9 +42,9 @@ public class RenderBlockPaint extends BaseBlockRender Tessellator tess = Tessellator.instance; int lumen = 14 << 20 | 14 << 4; - int worldb = imb.getMixedBrightnessForBlock( world, x, y, z ); + int brightness = imb.getMixedBrightnessForBlock( world, x, y, z ); - double offoff = 0.001; + double offsetConstant = 0.001; EnumSet validSides = EnumSet.noneOf( ForgeDirection.class ); @@ -54,7 +54,7 @@ public class RenderBlockPaint extends BaseBlockRender validSides.add( side ); } - for (Splot s : tp.getDots()) + for (Splotch s : tp.getDots()) { if ( !validSides.contains( s.side ) ) continue; @@ -67,11 +67,11 @@ public class RenderBlockPaint extends BaseBlockRender else { tess.setColorOpaque_I( s.color.mediumVariant ); - tess.setBrightness( worldb ); + tess.setBrightness( brightness ); } - double offset = offoff; - offoff += 0.001; + double offset = offsetConstant; + offsetConstant += 0.001; double H = 0.1; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java index a59000f4f..e217be5bc 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java @@ -39,13 +39,13 @@ public class RenderBlockSkyChest extends BaseBlockRender Minecraft.getMinecraft().getTextureManager().bindTexture( loc ); - float lidangle = 0.0f; + float lidAngle = 0.0f; GL11.glScalef( 1.0F, -1F, -1F ); GL11.glTranslatef( -0.0F, -1.0F, -1.0F ); model.chestLid.offsetY = -(0.9f / 16.0f); - model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); + model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); model.renderAll(); GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); @@ -100,12 +100,12 @@ public class RenderBlockSkyChest extends BaseBlockRender if ( skyChest.lidAngle < 0.0f ) skyChest.lidAngle = 0.0f; - float lidangle = skyChest.lidAngle; - lidangle = 1.0F - lidangle; - lidangle = 1.0F - lidangle * lidangle * lidangle; + float lidAngle = skyChest.lidAngle; + lidAngle = 1.0F - lidAngle; + lidAngle = 1.0F - lidAngle * lidAngle * lidAngle; model.chestLid.offsetY = -(1.01f / 16.0f); - model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); + model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F); model.renderAll(); GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java index bbc023891..df0069b14 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java @@ -101,7 +101,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender if ( cr.spin ) { now = now % 100000; - model.renderAll( ((float) now / 50000.0f) * (float) Math.PI * 500.0f ); + model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } else { @@ -122,14 +122,14 @@ public class RenderBlockSkyCompass extends BaseBlockRender else { now = now % 1000000; - model.renderAll( ((float) now / 500000.0f) * (float) Math.PI * 500.0f ); + model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); } } else { now = now % 100000; - model.renderAll( ((float) now / 50000.0f) * (float) Math.PI * 500.0f ); + model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); @@ -178,7 +178,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender if ( cr.spin ) { now = now % 100000; - model.renderAll( ((float) now / 50000.0f) * (float) Math.PI * 500.0f ); + model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); } else model.renderAll( (float) (skyCompass.getForward() == ForgeDirection.DOWN ? flipidiy( cr.rad ) : cr.rad) ); @@ -187,7 +187,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender else { now = now % 1000000; - model.renderAll( ((float) now / 500000.0f) * (float) Math.PI * 500.0f ); + model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); } GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java index 862aed51b..c596da955 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java @@ -30,9 +30,9 @@ public class RenderBlockWireless extends BaseBlockRender public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj) { this.blk = blk; - cenx = 0; - ceny = 0; - cenz = 0; + centerX = 0; + centerY = 0; + centerZ = 0; hasChan = false; hasPower = false; BlockRenderInfo ri = blk.getRendererInstance(); @@ -83,9 +83,9 @@ public class RenderBlockWireless extends BaseBlockRender } } - int cenx = 0; - int ceny = 0; - int cenz = 0; + int centerX = 0; + int centerY = 0; + int centerZ = 0; AEBaseBlock blk; boolean hasChan = false; boolean hasPower = false; @@ -118,9 +118,9 @@ public class RenderBlockWireless extends BaseBlockRender renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz ); super.renderInWorld( blk, world, x, y, z, renderer ); - cenx = x; - ceny = y; - cenz = z; + centerX = x; + centerY = y; + centerZ = z; ri.setTemporaryRenderIcon( null ); renderTorchAtAngle( renderer, fdx, fdy, fdz ); @@ -235,14 +235,14 @@ public class RenderBlockWireless extends BaseBlockRender Tessellator.instance.setColorOpaque_I( 0xffffff ); renderBlockBounds( renderer, 0, 7, 1, 16, 9, 16, x, y, z ); - renderFace( cenx, ceny, cenz, blk, sides, renderer, y ); - renderFace( cenx, ceny, cenz, blk, sides, renderer, y.getOpposite() ); + renderFace( centerX, centerY, centerZ, blk, sides, renderer, y ); + renderFace( centerX, centerY, centerZ, blk, sides, renderer, y.getOpposite() ); renderBlockBounds( renderer, 7, 0, 1, 9, 16, 16, x, y, z ); - renderFace( cenx, ceny, cenz, blk, sides, renderer, x ); - renderFace( cenx, ceny, cenz, blk, sides, renderer, x.getOpposite() ); + renderFace( centerX, centerY, centerZ, blk, sides, renderer, x ); + renderFace( centerX, centerY, centerZ, blk, sides, renderer, x.getOpposite() ); renderBlockBounds( renderer, 7, 7, 1, 9, 9, 10.6, x, y, z ); - renderFace( cenx, ceny, cenz, blk, r, renderer, z ); + renderFace( centerX, centerY, centerZ, blk, r, renderer, z ); } } diff --git a/src/main/java/appeng/client/render/blocks/RenderDrive.java b/src/main/java/appeng/client/render/blocks/RenderDrive.java index 54a29d26c..861467583 100644 --- a/src/main/java/appeng/client/render/blocks/RenderDrive.java +++ b/src/main/java/appeng/client/render/blocks/RenderDrive.java @@ -237,16 +237,16 @@ public class RenderDrive extends BaseBlockRender if ( stat != 0 ) { - IIcon wico = ExtraBlockTextures.White.getIcon(); - u1 = wico.getInterpolatedU( (spin % 4 < 2) ? 1 : 6 ); - u2 = wico.getInterpolatedU( ((spin + 1) % 4 < 2) ? 1 : 6 ); - u3 = wico.getInterpolatedU( ((spin + 2) % 4 < 2) ? 1 : 6 ); - u4 = wico.getInterpolatedU( ((spin + 3) % 4 < 2) ? 1 : 6 ); + IIcon whiteIcon = ExtraBlockTextures.White.getIcon(); + u1 = whiteIcon.getInterpolatedU( (spin % 4 < 2) ? 1 : 6 ); + u2 = whiteIcon.getInterpolatedU( ((spin + 1) % 4 < 2) ? 1 : 6 ); + u3 = whiteIcon.getInterpolatedU( ((spin + 2) % 4 < 2) ? 1 : 6 ); + u4 = whiteIcon.getInterpolatedU( ((spin + 3) % 4 < 2) ? 1 : 6 ); - v1 = wico.getInterpolatedV( ((spin + 1) % 4 < 2) ? 1 : 3 ); - v2 = wico.getInterpolatedV( ((spin + 2) % 4 < 2) ? 1 : 3 ); - v3 = wico.getInterpolatedV( ((spin + 3) % 4 < 2) ? 1 : 3 ); - v4 = wico.getInterpolatedV( ((spin + 0) % 4 < 2) ? 1 : 3 ); + v1 = whiteIcon.getInterpolatedV( ((spin + 1) % 4 < 2) ? 1 : 3 ); + v2 = whiteIcon.getInterpolatedV( ((spin + 2) % 4 < 2) ? 1 : 3 ); + v3 = whiteIcon.getInterpolatedV( ((spin + 3) % 4 < 2) ? 1 : 3 ); + v4 = whiteIcon.getInterpolatedV( ((spin + 0) % 4 < 2) ? 1 : 3 ); if ( sp.isPowered() ) tess.setBrightness( 15 << 20 | 15 << 4 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderMEChest.java b/src/main/java/appeng/client/render/blocks/RenderMEChest.java index d11ac59f7..500c792c0 100644 --- a/src/main/java/appeng/client/render/blocks/RenderMEChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderMEChest.java @@ -68,26 +68,26 @@ public class RenderMEChest extends BaseBlockRender Tessellator.instance.setBrightness( b ); Tessellator.instance.setColorOpaque_I( 0xffffff ); - FlippableIcon fico = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); + FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); if ( forward == ForgeDirection.EAST && (up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH) ) - fico.setFlip( true, false ); + flippableIcon.setFlip( true, false ); else if ( forward == ForgeDirection.NORTH && up == ForgeDirection.EAST ) - fico.setFlip( false, true ); + flippableIcon.setFlip( false, true ); else if ( forward == ForgeDirection.NORTH && up == ForgeDirection.WEST ) - fico.setFlip( true, false ); + flippableIcon.setFlip( true, false ); else if ( forward == ForgeDirection.DOWN && up == ForgeDirection.EAST ) - fico.setFlip( false, true ); + flippableIcon.setFlip( false, true ); else if ( forward == ForgeDirection.DOWN ) - fico.setFlip( true, false ); + flippableIcon.setFlip( true, false ); /* * 1.7.2 * - * else if ( forward == ForgeDirection.EAST && up == ForgeDirection.UP ) fico.setFlip( true, false ); else if ( - * forward == ForgeDirection.NORTH && up == ForgeDirection.UP ) fico.setFlip( true, false ); + * else if ( forward == ForgeDirection.EAST && up == ForgeDirection.UP ) flippableIcon.setFlip( true, false ); else if ( + * forward == ForgeDirection.NORTH && up == ForgeDirection.UP ) flippableIcon.setFlip( true, false ); */ - renderFace( x, y, z, imb, fico, renderer, forward ); + renderFace( x, y, z, imb, flippableIcon, renderer, forward ); if ( stat != 0 ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderQNB.java b/src/main/java/appeng/client/render/blocks/RenderQNB.java index 3f71c82e3..d89904e98 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQNB.java +++ b/src/main/java/appeng/client/render/blocks/RenderQNB.java @@ -74,9 +74,9 @@ public class RenderQNB extends BaseBlockRender @Override public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] obj) { - float px = 2.0f / 16.0f; - float maxpx = 14.0f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + float minPx = 2.0f / 16.0f; + float maxPx = 14.0f / 16.0f; + renderer.setRenderBounds( minPx, minPx, minPx, maxPx, maxPx, maxPx ); super.renderInventory( block, item, renderer, type, obj ); } @@ -94,20 +94,20 @@ public class RenderQNB extends BaseBlockRender { if ( tqb.isFormed() ) { - AEColoredItemDefinition cabldef = AEApi.instance().parts().partCableGlass; - Item cable = cabldef.item( AEColor.Transparent ); + AEColoredItemDefinition glassCableDefinition = AEApi.instance().parts().partCableGlass; + Item transparentGlassCable = glassCableDefinition.item( AEColor.Transparent ); - AEColoredItemDefinition ccabldef = AEApi.instance().parts().partCableCovered; - Item ccable = ccabldef.item( AEColor.Transparent ); + AEColoredItemDefinition coveredCableDefinition = AEApi.instance().parts().partCableCovered; + Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent ); EnumSet sides = tqb.getConnections(); - renderCableAt( 0.11D, world, x, y, z, block, renderer, cable.getIconIndex( cabldef.stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); - renderCableAt( 0.188D, world, x, y, z, block, renderer, ccable.getIconIndex( ccabldef.stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); + renderCableAt( 0.11D, world, x, y, z, block, renderer, transparentGlassCable.getIconIndex( glassCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); + renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); } - float px = 2.0f / 16.0f; - float maxpx = 14.0f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + float renderMin = 2.0f / 16.0f; + float renderMax = 14.0f / 16.0f; + renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax ); renderer.renderStandardBlock( block, x, y, z ); // super.renderWorldBlock(world, x, y, z, block, modelId, renderer); } @@ -115,9 +115,9 @@ public class RenderQNB extends BaseBlockRender { if ( !tqb.isFormed() ) { - float px = 2.0f / 16.0f; - float maxpx = 14.0f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + float renderMin = 2.0f / 16.0f; + float renderMax = 14.0f / 16.0f; + renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax ); renderer.renderStandardBlock( block, x, y, z ); } else if ( tqb.isCorner() ) @@ -125,24 +125,24 @@ public class RenderQNB extends BaseBlockRender // renderCableAt(0.11D, world, x, y, z, block, modelId, // renderer, // AppEngTextureRegistry.Blocks.MECable.get(), true, 0.0D); - AEColoredItemDefinition ccabldef = AEApi.instance().parts().partCableCovered; - Item ccable = ccabldef.item( AEColor.Transparent ); + AEColoredItemDefinition coveredCableDefinition = AEApi.instance().parts().partCableCovered; + Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent ); - renderCableAt( 0.188D, world, x, y, z, block, renderer, ccable.getIconIndex( ccabldef.stack( AEColor.Transparent, 1 ) ), 0.05D, + renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.05D, tqb.getConnections() ); - float px = 4.0f / 16.0f; - float maxpx = 12.0f / 16.0f; + float renderMin = 4.0f / 16.0f; + float renderMax = 12.0f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax ); renderer.renderStandardBlock( block, x, y, z ); if ( tqb.isPowered() ) { - px = 3.9f / 16.0f; - maxpx = 12.1f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + renderMin = 3.9f / 16.0f; + 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 ); @@ -154,22 +154,22 @@ public class RenderQNB extends BaseBlockRender } else { - float px = 2.0f / 16.0f; - float maxpx = 14.0f / 16.0f; - renderer.setRenderBounds( 0, px, px, 1, maxpx, maxpx ); + float renderMin = 2.0f / 16.0f; + float renderMax = 14.0f / 16.0f; + renderer.setRenderBounds( 0, renderMin, renderMin, 1, renderMax, renderMax ); renderer.renderStandardBlock( block, x, y, z ); - renderer.setRenderBounds( px, 0, px, maxpx, 1, maxpx ); + renderer.setRenderBounds( renderMin, 0, renderMin, renderMax, 1, renderMax ); renderer.renderStandardBlock( block, x, y, z ); - renderer.setRenderBounds( px, px, 0, maxpx, maxpx, 1 ); + renderer.setRenderBounds( renderMin, renderMin, 0, renderMax, renderMax, 1 ); renderer.renderStandardBlock( block, x, y, z ); if ( tqb.isPowered() ) { - px = -0.01f / 16.0f; - maxpx = 16.01f / 16.0f; - renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx ); + renderMin = -0.01f / 16.0f; + 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 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java index a27611ecd..ad8d08bc2 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java @@ -32,9 +32,9 @@ public class RenderQuartzTorch extends BaseBlockRender float Point13 = 10.0f / 16.0f; float Point12 = 9.0f / 16.0f; - float Onepx = 1.0f / 16.0f; - float rbottom = 5.0f / 16.0f; - float rtop = 10.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; @@ -43,13 +43,13 @@ public class RenderQuartzTorch extends BaseBlockRender float yOff = 0.0f; float zOff = 0.0f; - renderer.setRenderBounds( Point3 + xOff, rbottom + yOff, Point3 + zOff, Point12 + xOff, rtop + yOff, Point12 + zOff ); + renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - renderer.setRenderBounds( Point3 + xOff, rtop + yOff, Point3 + zOff, Point3 + Onepx + xOff, rtop + Onepx + yOff, Point3 + Onepx + zOff ); + renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - renderer.setRenderBounds( Point12 - Onepx + xOff, rbottom - Onepx + yOff, Point12 - Onepx + zOff, Point12 + xOff, rbottom + yOff, Point12 + zOff ); + renderer.setRenderBounds( Point12 - singlePixel + xOff, renderBottom - singlePixel + yOff, Point12 - singlePixel + zOff, Point12 + xOff, renderBottom + yOff, Point12 + zOff ); renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); @@ -86,9 +86,9 @@ public class RenderQuartzTorch extends BaseBlockRender float Point13 = 10.0f / 16.0f; float Point12 = 9.0f / 16.0f; - float Onepx = 1.0f / 16.0f; - float rbottom = 5.0f / 16.0f; - float rtop = 10.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; @@ -106,24 +106,24 @@ public class RenderQuartzTorch extends BaseBlockRender zOff = forward.offsetZ * -(4.0f / 16.0f); } - renderer.setRenderBounds( Point3 + xOff, rbottom + yOff, Point3 + zOff, Point12 + xOff, rtop + yOff, Point12 + zOff ); + 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; if ( r == 0 ) { - renderer.setRenderBounds( Point3 + xOff, rtop + yOff, Point3 + zOff, Point3 + Onepx + xOff, rtop + Onepx + yOff, Point3 + Onepx + zOff ); + renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); super.renderInWorld( block, world, x, y, z, renderer ); - renderer.setRenderBounds( Point12 - Onepx + xOff, rbottom - Onepx + yOff, Point12 - Onepx + zOff, Point12 + xOff, rbottom + yOff, Point12 + zOff ); + renderer.setRenderBounds( Point12 - singlePixel + xOff, renderBottom - singlePixel + yOff, Point12 - singlePixel + zOff, Point12 + xOff, renderBottom + yOff, Point12 + zOff ); super.renderInWorld( block, world, x, y, z, renderer ); } else { - renderer.setRenderBounds( Point3 + xOff, rbottom - Onepx + yOff, Point3 + zOff, Point3 + Onepx + xOff, rbottom + yOff, Point3 + Onepx + zOff ); + renderer.setRenderBounds( Point3 + xOff, renderBottom - singlePixel + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderBottom + yOff, Point3 + singlePixel + zOff ); super.renderInWorld( block, world, x, y, z, renderer ); - renderer.setRenderBounds( Point12 - Onepx + xOff, rtop + yOff, Point12 - Onepx + zOff, Point12 + xOff, rtop + Onepx + yOff, Point12 + zOff ); + renderer.setRenderBounds( Point12 - singlePixel + xOff, renderTop + yOff, Point12 - singlePixel + zOff, Point12 + xOff, renderTop + singlePixel + yOff, Point12 + zOff ); super.renderInWorld( block, world, x, y, z, renderer ); } diff --git a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java index 216598375..c0368ad99 100644 --- a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java +++ b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java @@ -44,14 +44,14 @@ public class RenderSpatialPylon extends BaseBlockRender if ( (displayBits & sp.DISPLAY_Z) == sp.DISPLAY_X ) { ori = ForgeDirection.EAST; - if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMAX ) + if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MAX ) { renderer.uvRotateEast = 1; renderer.uvRotateWest = 2; renderer.uvRotateTop = 2; renderer.uvRotateBottom = 1; } - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMIN ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MIN ) { renderer.uvRotateEast = 2; renderer.uvRotateWest = 1; @@ -70,7 +70,7 @@ public class RenderSpatialPylon extends BaseBlockRender else if ( (displayBits & sp.DISPLAY_Z) == sp.DISPLAY_Y ) { ori = ForgeDirection.UP; - if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMAX ) + if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MAX ) { renderer.uvRotateNorth = 3; renderer.uvRotateSouth = 3; @@ -82,12 +82,12 @@ public class RenderSpatialPylon extends BaseBlockRender else if ( (displayBits & sp.DISPLAY_Z) == sp.DISPLAY_Z ) { ori = ForgeDirection.NORTH; - if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMAX ) + if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MAX ) { renderer.uvRotateSouth = 1; renderer.uvRotateNorth = 2; } - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMIN ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MIN ) { renderer.uvRotateNorth = 1; renderer.uvRotateSouth = 2; @@ -112,7 +112,7 @@ public class RenderSpatialPylon extends BaseBlockRender boolean r = renderer.renderStandardBlock( imb, x, y, z ); - if ( (displayBits & sp.DISPLAY_POWEREDENABLED) == sp.DISPLAY_POWEREDENABLED ) + if ( (displayBits & sp.DISPLAY_POWERED_ENABLED) == sp.DISPLAY_POWERED_ENABLED ) { int bn = 15; Tessellator.instance.setBrightness( bn << 20 | bn << 4 ); @@ -159,10 +159,10 @@ public class RenderSpatialPylon extends BaseBlockRender if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_MIDDLE ) return ExtraBlockTextures.BlockSpatialPylonC.getIcon(); - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMIN ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MIN ) return ExtraBlockTextures.BlockSpatialPylonE.getIcon(); - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMAX ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MAX ) return ExtraBlockTextures.BlockSpatialPylonE.getIcon(); return blk.getIcon( 0, 0 ); @@ -178,10 +178,10 @@ public class RenderSpatialPylon extends BaseBlockRender if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_MIDDLE ) return good ? ExtraBlockTextures.BlockSpatialPylonC_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonC_red.getIcon(); - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMIN ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MIN ) return good ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonE_red.getIcon(); - else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_ENDMAX ) + else if ( (displayBits & sp.DISPLAY_MIDDLE) == sp.DISPLAY_END_MAX ) return good ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonE_red.getIcon(); return blk.getIcon( 0, 0 ); diff --git a/src/main/java/appeng/client/render/effects/CraftingFx.java b/src/main/java/appeng/client/render/effects/CraftingFx.java index 99acf0ba9..102dea036 100644 --- a/src/main/java/appeng/client/render/effects/CraftingFx.java +++ b/src/main/java/appeng/client/render/effects/CraftingFx.java @@ -21,6 +21,7 @@ public class CraftingFx extends EntityBreakingFX private int startBlkY; private int startBlkZ; + @Override public int getFXLayer() { return 1; @@ -50,6 +51,7 @@ public class CraftingFx extends EntityBreakingFX this.particleScale *= 0.8f; } + @Override public void onUpdate() { super.onUpdate(); @@ -57,6 +59,7 @@ public class CraftingFx extends EntityBreakingFX this.particleAlpha *= 0.51f; } + @Override public void renderParticle(Tessellator par1Tessellator, float partialTick, float x, float y, float z, float rx, float rz) { if ( partialTick < 0 || partialTick > 1 ) @@ -68,30 +71,30 @@ public class CraftingFx extends EntityBreakingFX float f9 = this.particleTextureIndex.getMaxV(); float scale = 0.1F * this.particleScale; - float offx = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) partialTick); - float offy = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) partialTick); - float offz = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTick); + 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 ); - int blkZ = MathHelper.floor_double( offz ); + int blkX = MathHelper.floor_double( offX ); + int blkY = MathHelper.floor_double( offY ); + int blkZ = MathHelper.floor_double( offZ ); if ( blkX == startBlkX && blkY == startBlkY && blkZ == startBlkZ ) { - offx -= interpPosX; - offy -= interpPosY; - offz -= interpPosZ; + offX -= interpPosX; + offY -= interpPosY; + offZ -= interpPosZ; // AELog.info( "" + partialTick ); par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); - par1Tessellator.addVertexWithUV( (double) (offx - x * scale - rx * scale), (double) (offy - y * scale), (double) (offz - z * scale - rz * scale), - (double) f7, (double) f9 ); - par1Tessellator.addVertexWithUV( (double) (offx - x * scale + rx * scale), (double) (offy + y * scale), (double) (offz - z * scale + rz * scale), - (double) f7, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (offx + x * scale + rx * scale), (double) (offy + y * scale), (double) (offz + z * scale + rz * scale), - (double) f6, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (offx + x * scale - rx * scale), (double) (offy - y * scale), (double) (offz + z * scale - rz * scale), - (double) f6, (double) f9 ); + 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 ); + par1Tessellator.addVertexWithUV( offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale, + f6, f8 ); + par1Tessellator.addVertexWithUV( offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale, + f6, f9 ); } } diff --git a/src/main/java/appeng/client/render/effects/EnergyFx.java b/src/main/java/appeng/client/render/effects/EnergyFx.java index 121ca3389..4b3bf2877 100644 --- a/src/main/java/appeng/client/render/effects/EnergyFx.java +++ b/src/main/java/appeng/client/render/effects/EnergyFx.java @@ -21,6 +21,7 @@ public class EnergyFx extends EntityBreakingFX private int startBlkY; private int startBlkZ; + @Override public int getFXLayer() { return 1; @@ -49,6 +50,7 @@ public class EnergyFx extends EntityBreakingFX this.particleScale *= 0.8f; } + @Override public void onUpdate() { super.onUpdate(); @@ -56,6 +58,7 @@ public class EnergyFx extends EntityBreakingFX this.particleAlpha *= 0.89f; } + @Override public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f6 = this.particleTextureIndex.getMinU(); @@ -64,9 +67,9 @@ public class EnergyFx extends EntityBreakingFX float f9 = this.particleTextureIndex.getMaxV(); float f10 = 0.1F * this.particleScale; - float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); - float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); - float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); + 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( posX ); @@ -76,14 +79,14 @@ public class EnergyFx extends EntityBreakingFX if ( blkX == startBlkX && blkY == startBlkY && blkZ == startBlkZ ) { par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); - par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10), - (double) f7, (double) f9 ); - par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10), - (double) f7, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10), - (double) f6, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10), - (double) f6, (double) f9 ); + 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 ); + par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, + f6, f8 ); + par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, + f6, f9 ); } } diff --git a/src/main/java/appeng/client/render/effects/LightningFX.java b/src/main/java/appeng/client/render/effects/LightningFX.java index bca5dc80d..8513f1f85 100644 --- a/src/main/java/appeng/client/render/effects/LightningFX.java +++ b/src/main/java/appeng/client/render/effects/LightningFX.java @@ -111,9 +111,9 @@ public class LightningFX extends EntityFX { clear(); - double x = (this.prevPosX + (this.posX - this.prevPosX) * (double) l - interpPosX) - offX; - double y = (this.prevPosY + (this.posY - this.prevPosY) * (double) l - interpPosY) - offY; - double z = (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) l - interpPosZ) - offZ; + double x = (this.prevPosX + (this.posX - this.prevPosX) * l - interpPosX) - offX; + double y = (this.prevPosY + (this.posY - this.prevPosY) * l - interpPosY) - offY; + double z = (this.prevPosZ + (this.posZ - this.prevPosZ) * l - interpPosZ) - offZ; for (int s = 0; s < steps; s++) { @@ -144,7 +144,7 @@ public class LightningFX extends EntityFX oz = (xD * 0) - (1 * yD); } - double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ((((double) steps - (double) s) / (double) steps) * scale); + double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ((((double) steps - (double) s) / steps) * scale); ox /= ss; oy /= ss; oz /= ss; diff --git a/src/main/java/appeng/client/render/effects/MatterCannonFX.java b/src/main/java/appeng/client/render/effects/MatterCannonFX.java index 1839080fa..199bed7d4 100644 --- a/src/main/java/appeng/client/render/effects/MatterCannonFX.java +++ b/src/main/java/appeng/client/render/effects/MatterCannonFX.java @@ -55,20 +55,20 @@ public class MatterCannonFX extends EntityBreakingFX float f9 = this.particleTextureIndex.getMaxV(); float f10 = 0.05F * this.particleScale; - float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); - float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); - float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); + 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; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); - par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10), - (double) f7, (double) f9 ); - par1Tessellator.addVertexWithUV( (double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10), - (double) f7, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10), - (double) f6, (double) f8 ); - par1Tessellator.addVertexWithUV( (double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10), - (double) f6, (double) f9 ); + 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 ); + par1Tessellator.addVertexWithUV( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, + f6, f8 ); + par1Tessellator.addVertexWithUV( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, + f6, f9 ); } } diff --git a/src/main/java/appeng/client/render/items/PaintBallRender.java b/src/main/java/appeng/client/render/items/PaintBallRender.java index e9a0a7e92..b9ff81361 100644 --- a/src/main/java/appeng/client/render/items/PaintBallRender.java +++ b/src/main/java/appeng/client/render/items/PaintBallRender.java @@ -34,10 +34,10 @@ public class PaintBallRender implements IItemRenderer if ( item.getItemDamage() >= 20 ) par2Icon = ExtraItemTextures.ItemPaintBallShimmer.getIcon(); - float f4 = ((IIcon) par2Icon).getMinU(); - float f5 = ((IIcon) par2Icon).getMaxU(); - float f6 = ((IIcon) par2Icon).getMinV(); - float f7 = ((IIcon) par2Icon).getMaxV(); + float f4 = par2Icon.getMinU(); + float f5 = par2Icon.getMaxU(); + float f6 = par2Icon.getMinV(); + float f7 = par2Icon.getMaxV(); float f12 = 0.0625F; ItemPaintBall ipb = (ItemPaintBall) item.getItem(); @@ -70,10 +70,10 @@ public class PaintBallRender implements IItemRenderer tessellator.startDrawingQuads(); tessellator.setNormal( 0.0F, 1.0F, 0.0F ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 1, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 1, 1, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 1, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 1, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 1, 1, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 1, 0, f4, f6 ); tessellator.draw(); } else @@ -82,7 +82,7 @@ public class PaintBallRender implements IItemRenderer GL11.glTranslatef( 0.0F, 0.0F, 0.0F ); else GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); - ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, ((IIcon) par2Icon).getIconWidth(), ((IIcon) par2Icon).getIconHeight(), f12 ); + ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); GL11.glColor4f( 1, 1, 1, 1.0F ); diff --git a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java index af80997fc..1444f574f 100644 --- a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java +++ b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java @@ -34,10 +34,10 @@ public class ToolBiometricCardRender implements IItemRenderer { IIcon par2Icon = item.getIconIndex(); - float f4 = ((IIcon) par2Icon).getMinU(); - float f5 = ((IIcon) par2Icon).getMaxU(); - float f6 = ((IIcon) par2Icon).getMinV(); - float f7 = ((IIcon) par2Icon).getMaxV(); + float f4 = par2Icon.getMinU(); + float f5 = par2Icon.getMaxU(); + float f6 = par2Icon.getMinV(); + float f7 = par2Icon.getMaxV(); float f12 = 0.0625F; Tessellator tessellator = Tessellator.instance; @@ -54,16 +54,16 @@ public class ToolBiometricCardRender implements IItemRenderer tessellator.startDrawingQuads(); tessellator.setNormal( 0.0F, 1.0F, 0.0F ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 1, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 1, 1, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 1, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 1, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 1, 1, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 1, 0, f4, f6 ); tessellator.draw(); } else { GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); - ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, ((IIcon) par2Icon).getIconWidth(), ((IIcon) par2Icon).getIconHeight(), f12 ); + ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); GL11.glColor4f( 1, 1, 1, 1.0F ); @@ -113,10 +113,10 @@ public class ToolBiometricCardRender implements IItemRenderer tessellator.setColorOpaque_F( ((col.blackVariant >> 16) & 0xff) * scale, ((col.blackVariant >> 8) & 0xff) * scale, (col.blackVariant & 0xff) * scale ); - tessellator.addVertexWithUV( x, y, z, (double) u, (double) v ); - tessellator.addVertexWithUV( x + 1, y, z, (double) u, (double) v ); - tessellator.addVertexWithUV( x + 1, y + 1, z, (double) u, (double) v ); - tessellator.addVertexWithUV( x, y + 1, z, (double) u, (double) v ); + tessellator.addVertexWithUV( x, y, z, u, v ); + tessellator.addVertexWithUV( x + 1, y, z, u, v ); + tessellator.addVertexWithUV( x + 1, y + 1, z, u, v ); + tessellator.addVertexWithUV( x, y + 1, z, u, v ); } } tessellator.draw(); diff --git a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java index 8dbe09a2d..a9a6c65c6 100644 --- a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java +++ b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java @@ -32,10 +32,10 @@ public class ToolColorApplicatorRender implements IItemRenderer { IIcon par2Icon = item.getIconIndex(); - float f4 = ((IIcon) par2Icon).getMinU(); - float f5 = ((IIcon) par2Icon).getMaxU(); - float f6 = ((IIcon) par2Icon).getMinV(); - float f7 = ((IIcon) par2Icon).getMaxV(); + float f4 = par2Icon.getMinU(); + float f5 = par2Icon.getMaxU(); + float f6 = par2Icon.getMinV(); + float f7 = par2Icon.getMaxV(); float f12 = 0.0625F; Tessellator tessellator = Tessellator.instance; @@ -52,10 +52,10 @@ public class ToolColorApplicatorRender implements IItemRenderer tessellator.startDrawingQuads(); tessellator.setNormal( 0.0F, 1.0F, 0.0F ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 1, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 1, 1, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 1, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 1, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 1, 1, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 1, 0, f4, f6 ); tessellator.draw(); } else @@ -66,7 +66,7 @@ public class ToolColorApplicatorRender implements IItemRenderer GL11.glTranslatef( 0.0F, 0.0F, 0.0F ); else GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); - ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, ((IIcon) par2Icon).getIconWidth(), ((IIcon) par2Icon).getIconHeight(), f12 ); + ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); GL11.glColor4f( 1, 1, 1, 1.0F ); @@ -92,38 +92,38 @@ public class ToolColorApplicatorRender implements IItemRenderer { tessellator.startDrawingQuads(); - f4 = ((IIcon) dark).getMinU(); - f5 = ((IIcon) dark).getMaxU(); - f6 = ((IIcon) dark).getMinV(); - f7 = ((IIcon) dark).getMaxV(); + f4 = dark.getMinU(); + f5 = dark.getMaxU(); + f6 = dark.getMinV(); + f7 = dark.getMaxV(); tessellator.setColorOpaque_I( col.blackVariant ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 16, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 16, 16, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 16, 0, f4, f6 ); - f4 = ((IIcon) light).getMinU(); - f5 = ((IIcon) light).getMaxU(); - f6 = ((IIcon) light).getMinV(); - f7 = ((IIcon) light).getMaxV(); + f4 = light.getMinU(); + f5 = light.getMaxU(); + f6 = light.getMinV(); + f7 = light.getMaxV(); tessellator.setColorOpaque_I( col.whiteVariant ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 16, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 16, 16, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 16, 0, f4, f6 ); - f4 = ((IIcon) med).getMinU(); - f5 = ((IIcon) med).getMaxU(); - f6 = ((IIcon) med).getMinV(); - f7 = ((IIcon) med).getMaxV(); + f4 = med.getMinU(); + f5 = med.getMaxU(); + f6 = med.getMinV(); + f7 = med.getMaxV(); tessellator.setColorOpaque_I( col.mediumVariant ); - tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 ); - tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 ); - tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 ); - tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 ); + tessellator.addVertexWithUV( 0, 0, 0, f4, f7 ); + tessellator.addVertexWithUV( 16, 0, 0, f5, f7 ); + tessellator.addVertexWithUV( 16, 16, 0, f5, f6 ); + tessellator.addVertexWithUV( 0, 16, 0, f4, f6 ); tessellator.draw(); } diff --git a/src/main/java/appeng/client/texture/CableBusTextures.java b/src/main/java/appeng/client/texture/CableBusTextures.java index 9e137c668..6cdeafb2f 100644 --- a/src/main/java/appeng/client/texture/CableBusTextures.java +++ b/src/main/java/appeng/client/texture/CableBusTextures.java @@ -27,7 +27,7 @@ public enum CableBusTextures PartPatternTerm_Bright("PartPatternTerm_Bright"), PartPatternTerm_Colored("PartPatternTerm_Colored"), PartPatternTerm_Dark("PartPatternTerm_Dark"), - PartConvMonitor_Bright("PartConvMonitor_Bright"), PartConvMonitor_Colored("PartConvMonitor_Colored"), PartConvMonitor_Dark("PartConvMonitor_Dark"), + PartConversionMonitor_Bright("PartConversionMonitor_Bright"), PartConversionMonitor_Colored("PartConversionMonitor_Colored"), PartConversionMonitor_Dark("PartConversionMonitor_Dark"), PartInterfaceTerm_Bright("PartInterfaceTerm_Bright"), PartInterfaceTerm_Colored("PartInterfaceTerm_Colored"), PartInterfaceTerm_Dark( "PartInterfaceTerm_Dark"), diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index 5ab81d2f1..bc7ad3368 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -41,7 +41,7 @@ import appeng.api.storage.data.IAEItemStack; import appeng.client.me.InternalSlotME; import appeng.client.me.SlotME; import appeng.container.guisync.GuiSync; -import appeng.container.guisync.SyncDat; +import appeng.container.guisync.SyncData; import appeng.container.slot.SlotInaccessible; import appeng.core.AELog; import appeng.core.sync.network.NetworkHandler; @@ -72,7 +72,7 @@ public abstract class AEBaseContainer extends Container int ticksSinceCheck = 900; IAEItemStack clientRequestedTargetItem = null; - List dataChunks = new LinkedList(); + List dataChunks = new LinkedList(); public void postPartial(PacketPartialItem packetPartialItem) { @@ -129,7 +129,7 @@ public abstract class AEBaseContainer extends Container CompressedStreamTools.writeCompressed( item, stream ); int maxChunkSize = 30000; - List miniPackets = new LinkedList(); + List miniPackets = new LinkedList(); byte[] data = stream.toByteArray(); @@ -216,7 +216,7 @@ public abstract class AEBaseContainer extends Container public ContainerOpenContext openContext; protected IMEInventoryHandler cellInv; - protected HashSet locked = new HashSet(); + protected HashSet locked = new HashSet(); protected IEnergySource powerSrc; public void lockPlayerInventorySlot(int idx) @@ -276,6 +276,7 @@ public abstract class AEBaseContainer extends Container return null; } + @Override public boolean canDragIntoSlot(Slot s) { return ((AppEngSlot) s).isDraggable; @@ -359,28 +360,32 @@ public abstract class AEBaseContainer extends Container tis = shiftStoreItem( tis ); // target slots in the container... - for (int x = 0; x < this.inventorySlots.size(); x++) + for (Object inventorySlot : this.inventorySlots) { - AppEngSlot cs = (AppEngSlot) this.inventorySlots.get( x ); + AppEngSlot cs = (AppEngSlot) inventorySlot; if ( !(cs.isPlayerSide()) && !(cs instanceof SlotFake) && !(cs instanceof SlotCraftingMatrix) ) { if ( cs.isItemValid( tis ) ) + { selectedSlots.add( cs ); + } } } } else { // target slots in the container... - for (int x = 0; x < this.inventorySlots.size(); x++) + for (Object inventorySlot : this.inventorySlots) { - AppEngSlot cs = (AppEngSlot) this.inventorySlots.get( x ); + AppEngSlot cs = (AppEngSlot) inventorySlot; if ( (cs.isPlayerSide()) && !(cs instanceof SlotFake) && !(cs instanceof SlotCraftingMatrix) ) { if ( cs.isItemValid( tis ) ) + { selectedSlots.add( cs ); + } } } } @@ -393,18 +398,20 @@ public abstract class AEBaseContainer extends Container if ( tis != null ) { // target slots in the container... - for (int x = 0; x < this.inventorySlots.size(); x++) + for (Object inventorySlot : this.inventorySlots) { - AppEngSlot cs = (AppEngSlot) this.inventorySlots.get( x ); + AppEngSlot cs = (AppEngSlot) inventorySlot; ItemStack dest = cs.getStack(); if ( !(cs.isPlayerSide()) && cs instanceof SlotFake ) { if ( Platform.isSameItemPrecise( dest, tis ) ) + { return null; + } else if ( dest == null ) { - cs.putStack( tis != null ? tis.copy() : null ); + cs.putStack( tis.copy() ); cs.onSlotChanged(); updateSlot( cs ); return null; @@ -422,13 +429,13 @@ public abstract class AEBaseContainer extends Container if ( d instanceof SlotDisabled || d instanceof SlotME ) continue; - if ( d.isItemValid( tis ) && tis != null ) + if ( d.isItemValid( tis ) ) { if ( d.getHasStack() ) { ItemStack t = d.getStack(); - if ( tis != null && Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis)) + if ( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis)) { int maxSize = t.getMaxStackSize(); if ( maxSize > d.getSlotStackLimit() ) @@ -468,13 +475,13 @@ public abstract class AEBaseContainer extends Container if ( d instanceof SlotDisabled || d instanceof SlotME ) continue; - if ( d.isItemValid( tis ) && tis != null ) + if ( d.isItemValid( tis ) ) { if ( d.getHasStack() ) { ItemStack t = d.getStack(); - if ( tis != null && Platform.isSameItemPrecise( t, tis ) ) + if ( Platform.isSameItemPrecise( t, tis ) ) { int maxSize = t.getMaxStackSize(); if ( d.getSlotStackLimit() < maxSize ) @@ -553,7 +560,7 @@ public abstract class AEBaseContainer extends Container detectAndSendChanges(); } - HashMap syncData = new HashMap(); + HashMap syncData = new HashMap(); @Override public void detectAndSendChanges() @@ -562,11 +569,11 @@ public abstract class AEBaseContainer extends Container if ( Platform.isServer() ) { - for (int i = 0; i < this.crafters.size(); ++i) + for (Object crafter : this.crafters) { - ICrafting icrafting = (ICrafting) this.crafters.get( i ); + ICrafting icrafting = (ICrafting) crafter; - for (SyncDat sd : syncData.values()) + for (SyncData sd : syncData.values()) sd.tick( icrafting ); } } @@ -574,21 +581,20 @@ public abstract class AEBaseContainer extends Container super.detectAndSendChanges(); } + @Override final public void updateProgressBar(int idx, int value) { if ( syncData.containsKey( idx ) ) { syncData.get( idx ).update( (long) value ); - return; } - } final public void updateFullProgressBar(int idx, long value) { if ( syncData.containsKey( idx ) ) { - syncData.get( idx ).update( (long) value ); + syncData.get( idx ).update( value ); return; } @@ -600,7 +606,6 @@ public abstract class AEBaseContainer extends Container if ( syncData.containsKey( idx ) ) { syncData.get( idx ).update( value ); - return; } } @@ -610,11 +615,11 @@ public abstract class AEBaseContainer extends Container { if ( f.isAnnotationPresent( GuiSync.class ) ) { - GuiSync anno = f.getAnnotation( GuiSync.class ); - if ( syncData.containsKey( anno.value() ) ) - AELog.warning( "Channel already in use: " + anno.value() + " for " + f.getName() ); + GuiSync annotation = f.getAnnotation( GuiSync.class ); + if ( syncData.containsKey( annotation.value() ) ) + AELog.warning( "Channel already in use: " + annotation.value() + " for " + f.getName() ); else - syncData.put( anno.value(), new SyncDat( this, f, anno ) ); + syncData.put( annotation.value(), new SyncData( this, f, annotation ) ); } } } @@ -718,7 +723,7 @@ public abstract class AEBaseContainer extends Container switch (action) { - case PICKUP_OR_SETDOWN: + case PICKUP_OR_SET_DOWN: if ( hand == null ) s.putStack( null ); @@ -736,7 +741,7 @@ public abstract class AEBaseContainer extends Container } break; - case SPLIT_OR_PLACESINGLE: + case SPLIT_OR_PLACE_SINGLE: ItemStack is = s.getStack(); if ( is != null ) @@ -772,7 +777,7 @@ public abstract class AEBaseContainer extends Container if ( action == InventoryAction.MOVE_REGION ) { - List from = new LinkedList(); + List from = new LinkedList(); for (Object j : inventorySlots) { @@ -815,7 +820,7 @@ public abstract class AEBaseContainer extends Container adp.addItems( ais.getItemStack() ); } break; - case ROLLDOWN: + case ROLL_DOWN: if ( powerSrc == null || cellInv == null ) return; @@ -842,7 +847,7 @@ public abstract class AEBaseContainer extends Container } break; - case ROLLUP: + case ROLL_UP: case PICKUP_SINGLE: if ( powerSrc == null || cellInv == null ) return; @@ -850,13 +855,13 @@ public abstract class AEBaseContainer extends Container if ( slotItem != null ) { int liftQty = 1; - ItemStack isgg = player.inventory.getItemStack(); + ItemStack item = player.inventory.getItemStack(); - if ( isgg != null ) + if ( item != null ) { - if ( isgg.stackSize >= isgg.getMaxStackSize() ) + if ( item.stackSize >= item.getMaxStackSize() ) liftQty = 0; - if ( !Platform.isSameItemPrecise( slotItem.getItemStack(), isgg ) ) + if ( !Platform.isSameItemPrecise( slotItem.getItemStack(), item ) ) liftQty = 0; } @@ -878,7 +883,7 @@ public abstract class AEBaseContainer extends Container } } break; - case PICKUP_OR_SETDOWN: + case PICKUP_OR_SET_DOWN: if ( powerSrc == null || cellInv == null ) return; @@ -908,7 +913,7 @@ public abstract class AEBaseContainer extends Container } break; - case SPLIT_OR_PLACESINGLE: + case SPLIT_OR_PLACE_SINGLE: if ( powerSrc == null || cellInv == null ) return; diff --git a/src/main/java/appeng/container/ContainerNull.java b/src/main/java/appeng/container/ContainerNull.java index 0788e722d..677a391bb 100644 --- a/src/main/java/appeng/container/ContainerNull.java +++ b/src/main/java/appeng/container/ContainerNull.java @@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; /* - * Totaly useless container that does nothing. + * Totally useless container that does nothing. */ public class ContainerNull extends Container { diff --git a/src/main/java/appeng/container/guisync/SyncDat.java b/src/main/java/appeng/container/guisync/SyncData.java similarity index 89% rename from src/main/java/appeng/container/guisync/SyncDat.java rename to src/main/java/appeng/container/guisync/SyncData.java index d06eb3e01..81494f70d 100644 --- a/src/main/java/appeng/container/guisync/SyncDat.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -12,7 +12,7 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketProgressBar; import appeng.core.sync.packets.PacketValueConfig; -public class SyncDat +public class SyncData { private Object clientVersion; @@ -22,11 +22,11 @@ public class SyncDat private int channel; - public SyncDat(AEBaseContainer container, Field field, GuiSync anno) { + public SyncData(AEBaseContainer container, Field field, GuiSync annotation) { clientVersion = null; this.source = container; this.field = field; - channel = anno.value(); + channel = annotation.value(); } public int getChannel() @@ -39,9 +39,7 @@ public class SyncDat try { Object val = field.get( source ); - if ( val == clientVersion ) - return; - else if ( val != null && clientVersion == null ) + if ( val != null && clientVersion == null ) send( c, val ); else if ( !val.equals( clientVersion ) ) send( c, val ); @@ -118,15 +116,15 @@ public class SyncDat if ( field.getType().equals( int.class ) ) field.set( source, (int) val ); else if ( field.getType().equals( long.class ) ) - field.set( source, (long) val ); + field.set( source, val ); else if ( field.getType().equals( boolean.class ) ) field.set( source, val == 1 ); else if ( field.getType().equals( Integer.class ) ) - field.set( source, (Integer) (int) val ); + field.set( source, (int) val ); else if ( field.getType().equals( Long.class ) ) - field.set( source, (Long) val ); + field.set( source, val ); else if ( field.getType().equals( Boolean.class ) ) - field.set( source, (Boolean) (val == 1) ); + field.set( source, val == 1 ); } source.onUpdate( field.getName(), oldValue, field.get( source ) ); diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index 4eef53973..6a0c002f3 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -149,7 +149,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { return getCellUpgradeInventory().isItemValidForSlot( i, itemstack ); } - }; + } IInventory UpgradeInventoryWrapper; @@ -195,10 +195,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable int y = 29; int offset = 0; - IInventory cell = myte.getInventoryByName( "cell" ); + IInventory cell = upgradeable.getInventoryByName( "cell" ); addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, invPlayer ) ); - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); UpgradeInventoryWrapper = new Upgrades();// Platform.isServer() ? new Upgrades() : new AppEngInternalInventory( // null, 3 * 8 ); @@ -242,9 +242,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable ItemStack is = workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if ( Platform.isServer() ) { - for (int i = 0; i < this.crafters.size(); ++i) + for (Object crafter : this.crafters) { - ICrafting icrafting = (ICrafting) this.crafters.get( i ); + ICrafting icrafting = (ICrafting) crafter; if ( prevStack != is ) { @@ -262,7 +262,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } this.copyMode = getCopyMode(); - this.fzMode = (FuzzyMode) getFuzzyMode(); + this.fzMode = getFuzzyMode(); } prevStack = is; @@ -271,7 +271,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void clear() { - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); for (int x = 0; x < inv.getSizeInventory(); x++) inv.setInventorySlotContents( x, null ); detectAndSendChanges(); @@ -279,10 +279,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void partition() { - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); IMEInventory cellInv = AEApi.instance().registries().cell() - .getCellInventory( myte.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); + .getCellInventory( upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); Iterator i = new NullIterator(); if ( cellInv != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index 7f44fac14..0c48d1df0 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -8,15 +8,15 @@ import appeng.tile.storage.TileChest; public class ContainerChest extends AEBaseContainer { - TileChest myte; + TileChest chest; - public ContainerChest(InventoryPlayer ip, TileChest te) { - super( ip, te, null ); - myte = te; + public ContainerChest(InventoryPlayer ip, TileChest chest) { + super( ip, chest, null ); + this.chest = chest; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, myte, 1, 80, 37, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index b90e768b7..39b58bf66 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -5,25 +5,26 @@ import appeng.api.config.CondenserOutput; import appeng.api.config.Settings; import appeng.container.AEBaseContainer; import appeng.container.guisync.GuiSync; +import appeng.container.interfaces.IProgressProvider; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.misc.TileCondenser; import appeng.util.Platform; -public class ContainerCondenser extends AEBaseContainer +public class ContainerCondenser extends AEBaseContainer implements IProgressProvider { - TileCondenser myte; + TileCondenser condenser; - public ContainerCondenser(InventoryPlayer ip, TileCondenser te) { - super( ip, te, null ); - myte = te; + public ContainerCondenser(InventoryPlayer ip, TileCondenser condenser) { + super( ip, condenser, null ); + this.condenser = condenser; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, te, 0, 51, 52, ip ) ); - addSlotToContainer( new SlotOutput( te, 1, 105, 52, -1 ) ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, te.getInternalInventory(), 2, 101, 26, ip )).setStackLimit( 1 ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, condenser, 0, 51, 52, ip ) ); + addSlotToContainer( new SlotOutput( condenser, 1, 105, 52, -1 ) ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, condenser.getInternalInventory(), 2, 101, 26, ip )).setStackLimit( 1 ) ); - bindPlayerInventory( ip, 0, 197 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); } @Override @@ -31,13 +32,13 @@ public class ContainerCondenser extends AEBaseContainer { if ( Platform.isServer() ) { - double maxStorage = this.myte.getStorage(); - double requiredEnergy = this.myte.getRequiredPower(); + double maxStorage = this.condenser.getStorage(); + double requiredEnergy = this.condenser.getRequiredPower(); int maxDisplay = requiredEnergy == 0 ? (int) maxStorage : (int) Math.min( requiredEnergy, maxStorage ); - this.requiredEnergy = (int) maxDisplay; - this.storedPower = (int) this.myte.storedPower; - this.output = (CondenserOutput) this.myte.getConfigManager().getSetting( Settings.CONDENSER_OUTPUT ); + this.requiredEnergy = maxDisplay; + this.storedPower = (int) this.condenser.storedPower; + this.output = (CondenserOutput) this.condenser.getConfigManager().getSetting( Settings.CONDENSER_OUTPUT ); } super.detectAndSendChanges(); @@ -52,4 +53,16 @@ public class ContainerCondenser extends AEBaseContainer @GuiSync(2) public CondenserOutput output = CondenserOutput.TRASH; + @Override + public int getCurrentProgress() + { + return (int) storedPower; + } + + @Override + public int getMaxProgress() + { + return (int) requiredEnergy; + } + } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index d989695ca..3300696b7 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -76,7 +76,7 @@ public class ContainerCraftConfirm extends AEBaseContainer protected long cpuIdx = Long.MIN_VALUE; - public ArrayList cpus = new ArrayList(); + public ArrayList cpus = new ArrayList(); public ContainerCraftConfirm(InventoryPlayer ip, ITerminalHost te) { super( ip, te ); diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index 3db93e63d..8290dc336 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -80,7 +80,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH if ( c instanceof CraftingCPUCluster ) { - cpuName = ((CraftingCPUCluster) c).getName(); + cpuName = c.getName(); monitor = (CraftingCPUCluster) c; if ( monitor != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java index 6ae030b5f..eac154a82 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java @@ -23,7 +23,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU @GuiSync(7) public String myName = ""; - public ArrayList cpus = new ArrayList(); + public ArrayList cpus = new ArrayList(); private void sendCPUs() { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index 912774660..204d78719 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -28,6 +28,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE /** * Callback for when the crafting matrix is changed. */ + @Override public void onCraftMatrixChanged(IInventory par1IInventory) { ContainerNull cn = new ContainerNull(); diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index 046f8e3e9..71219f10c 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -8,19 +8,19 @@ import appeng.tile.storage.TileDrive; public class ContainerDrive extends AEBaseContainer { - TileDrive myte; + TileDrive drive; - public ContainerDrive(InventoryPlayer ip, TileDrive te) { - super( ip, te, null ); - myte = te; + public ContainerDrive(InventoryPlayer ip, TileDrive drive) { + super( ip, drive, null ); + this.drive = drive; for (int y = 0; y < 5; y++) for (int x = 0; x < 2; x++) { - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, te, x + y * 2, 71 + x * 18, 14 + y * 18, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive, x + y * 2, 71 + x * 18, 14 + y * 18, invPlayer ) ); } - bindPlayerInventory( ip, 0, 199 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 199 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index 5b364c2f6..f9cbf637a 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -43,7 +43,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable @Override public boolean isSlotEnabled(int idx) { - int upgrades = myte.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } @@ -54,7 +54,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable int xo = 8; int yo = 23 + 6; - IInventory config = myte.getInventoryByName( "config" ); + IInventory config = upgradeable.getInventoryByName( "config" ); for (int y = 0; y < 7; y++) { for (int x = 0; x < 9; x++) @@ -66,7 +66,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable } } - IInventory upgrades = myte.getInventoryByName( "upgrades" ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); @@ -81,7 +81,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable if ( Platform.isServer() ) { - this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); } standardDetectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index b7f6bb902..ea78c3dff 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -10,23 +10,23 @@ import appeng.tile.grindstone.TileGrinder; public class ContainerGrinder extends AEBaseContainer { - TileGrinder myte; + TileGrinder grinder; - public ContainerGrinder(InventoryPlayer ip, TileGrinder te) { - super( ip, te, null ); - myte = te; + public ContainerGrinder(InventoryPlayer ip, TileGrinder grinder) { + super( ip, grinder, null ); + this.grinder = grinder; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, te, 0, 12, 17, invPlayer ) ); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, te, 1, 12 + 18, 17, invPlayer ) ); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, te, 2, 12 + 36, 17, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, invPlayer ) ); - addSlotToContainer( new SlotInaccessible( te, 6, 80, 40 ) ); + addSlotToContainer( new SlotInaccessible( grinder, 6, 80, 40 ) ); - addSlotToContainer( new SlotOutput( te, 3, 112, 63, 2 * 16 + 15 ) ); - addSlotToContainer( new SlotOutput( te, 4, 112 + 18, 63, 2 * 16 + 15 ) ); - addSlotToContainer( new SlotOutput( te, 5, 112 + 36, 63, 2 * 16 + 15 ) ); + addSlotToContainer( new SlotOutput( grinder, 3, 112, 63, 2 * 16 + 15 ) ); + addSlotToContainer( new SlotOutput( grinder, 4, 112 + 18, 63, 2 * 16 + 15 ) ); + addSlotToContainer( new SlotOutput( grinder, 5, 112 + 36, 63, 2 * 16 + 15 ) ); - bindPlayerInventory( ip, 0, 176 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 176 - /* height of player inventory */82 ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index 1511fb8a3..5bd28f77a 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -49,22 +49,22 @@ public class ContainerIOPort extends ContainerUpgradeable @Override protected void setupConfig() { - int offx = 19; - int offy = 17; + int offX = 19; + int offY = 17; - IInventory cells = myte.getInventoryByName( "cells" ); + IInventory cells = upgradeable.getInventoryByName( "cells" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 2; x++) - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offx + x * 18, offy + y * 18, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, invPlayer ) ); - offx = 122; - offy = 17; + offX = 122; + offY = 17; for (int y = 0; y < 3; y++) for (int x = 0; x < 2; x++) - addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offx + x * 18, offy + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) ); + addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) ); - IInventory upgrades = myte.getInventoryByName( "upgrades" ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); @@ -77,9 +77,9 @@ public class ContainerIOPort extends ContainerUpgradeable if ( Platform.isServer() ) { - this.opMode = (OperationMode) myte.getConfigManager().getSetting( Settings.OPERATION_MODE ); - this.fMode = (FullnessMode) this.myte.getConfigManager().getSetting( Settings.FULLNESS_MODE ); - this.rsMode = (RedstoneMode) this.myte.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); + this.opMode = (OperationMode) upgradeable.getConfigManager().getSetting( Settings.OPERATION_MODE ); + this.fMode = (FullnessMode) this.upgradeable.getConfigManager().getSetting( Settings.FULLNESS_MODE ); + this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); } standardDetectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index afd6958d5..c73596900 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -5,6 +5,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import appeng.api.AEApi; import appeng.container.guisync.GuiSync; +import appeng.container.interfaces.IProgressProvider; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; import appeng.recipes.handlers.Inscribe; @@ -12,7 +13,7 @@ import appeng.recipes.handlers.Inscribe.InscriberRecipe; import appeng.tile.misc.TileInscriber; import appeng.util.Platform; -public class ContainerInscriber extends ContainerUpgradeable +public class ContainerInscriber extends ContainerUpgradeable implements IProgressProvider { TileInscriber ti; @@ -38,7 +39,7 @@ public class ContainerInscriber extends ContainerUpgradeable addSlotToContainer( new SlotOutput( ti, 3, 113, 40, -1 ) ); - bindPlayerInventory( ip, 0, getHeight() - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, getHeight() - /* height of player inventory */82 ); } @@ -69,6 +70,7 @@ public class ContainerInscriber extends ContainerUpgradeable setupUpgrades(); } + @Override public boolean isValidForSlot(Slot s, ItemStack is) { ItemStack PlateA = ti.getStackInSlot( 0 ); @@ -156,4 +158,16 @@ public class ContainerInscriber extends ContainerUpgradeable this.processingTime = ti.processingTime; } } + + @Override + public int getCurrentProgress() + { + return processingTime; + } + + @Override + public int getMaxProgress() + { + return maxProcessingTime; + } } diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index d9094570d..c8bc7ad5d 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -51,12 +51,14 @@ public class ContainerInterface extends ContainerUpgradeable setupUpgrades(); } + @Override protected void loadSettingsFromHost(IConfigManager cm) { this.bMode = (YesNo) cm.getSetting( Settings.BLOCK ); this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL ); } + @Override public int availableUpgrades() { return 1; diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index 9b1c78698..dce1cee54 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -59,10 +59,10 @@ public class ContainerInterfaceTerminal extends AEBaseContainer IInventory server; public long sortBy; - }; + } - Map diList = new HashMap(); - Map byId = new HashMap(); + Map diList = new HashMap(); + Map byId = new HashMap(); IGrid g; public ContainerInterfaceTerminal(InventoryPlayer ip, PartMonitor anchor) { @@ -71,7 +71,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer if ( Platform.isServer() ) g = anchor.getActionableNode().getGrid(); - bindPlayerInventory( ip, 0, 222 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 222 - /* height of player inventory */82 ); } NBTTagCompound data = new NBTTagCompound(); @@ -89,7 +89,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer return itemstack != null && itemstack.getItem() instanceof ItemEncodedPattern; } - }; + } @Override public void doAction(EntityPlayerMP player, InventoryAction action, int slot, long id) @@ -109,7 +109,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer switch (action) { - case PICKUP_OR_SETDOWN: + case PICKUP_OR_SET_DOWN: if ( hasItemInHand ) { @@ -142,7 +142,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer } break; - case SPLIT_OR_PLACESINGLE: + case SPLIT_OR_PLACE_SINGLE: if ( hasItemInHand ) { @@ -345,12 +345,12 @@ public class ContainerInterfaceTerminal extends AEBaseContainer private void addItems(NBTTagCompound data, InvTracker inv, int offset, int length) { String name = "=" + Long.toString( inv.which, Character.MAX_RADIX ); - NBTTagCompound invv = data.getCompoundTag( name ); + NBTTagCompound tag = data.getCompoundTag( name ); - if ( invv.hasNoTags() ) + if ( tag.hasNoTags() ) { - invv.setLong( "sortBy", inv.sortBy ); - invv.setString( "un", inv.unlocalizedName ); + tag.setLong( "sortBy", inv.sortBy ); + tag.setString( "un", inv.unlocalizedName ); } for (int x = 0; x < length; x++) @@ -365,9 +365,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer if ( is != null ) is.writeToNBT( itemNBT ); - invv.setTag( Integer.toString( x + offset ), itemNBT ); + tag.setTag( Integer.toString( x + offset ), itemNBT ); } - data.setTag( name, invv ); + data.setTag( name, tag ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index 2269c58d1..ba8801d46 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -63,7 +63,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable int x = 80 + 44; int y = 40; - IInventory upgrades = myte.getInventoryByName( "upgrades" ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); if ( availableUpgrades() > 0 ) addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); if ( availableUpgrades() > 1 ) @@ -73,7 +73,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable if ( availableUpgrades() > 3 ) addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); } @@ -94,15 +94,16 @@ public class ContainerLevelEmitter extends ContainerUpgradeable if ( Platform.isServer() ) { this.EmitterValue = lvlEmitter.getReportingValue(); - this.cmType = (YesNo) this.myte.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ); - this.lvType = (LevelType) this.myte.getConfigManager().getSetting( Settings.LEVEL_TYPE ); - this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE ); - this.rsMode = (RedstoneMode) this.myte.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ); + this.cmType = (YesNo) this.upgradeable.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ); + this.lvType = (LevelType) this.upgradeable.getConfigManager().getSetting( Settings.LEVEL_TYPE ); + this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ); } standardDetectAndSendChanges(); } + @Override public void onUpdate(String field, Object oldValue, Object newValue) { if ( field.equals( "EmitterValue" ) ) diff --git a/src/main/java/appeng/container/implementations/ContainerMAC.java b/src/main/java/appeng/container/implementations/ContainerMAC.java index 65565c71b..782f14801 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -9,6 +9,7 @@ import appeng.api.config.SecurityPermissions; import appeng.api.config.Settings; import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.container.guisync.GuiSync; +import appeng.container.interfaces.IProgressProvider; import appeng.container.slot.SlotMACPattern; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; @@ -16,16 +17,19 @@ import appeng.items.misc.ItemEncodedPattern; import appeng.tile.crafting.TileMolecularAssembler; import appeng.util.Platform; -public class ContainerMAC extends ContainerUpgradeable +public class ContainerMAC extends ContainerUpgradeable implements IProgressProvider { TileMolecularAssembler tma; + private static final int MAX_CRAFT_PROGRESS = 100; - public ContainerMAC(InventoryPlayer ip, TileMolecularAssembler te) { + public ContainerMAC(InventoryPlayer ip, TileMolecularAssembler te) + { super( ip, te ); tma = te; } + @Override public int availableUpgrades() { return 5; @@ -48,7 +52,7 @@ public class ContainerMAC extends ContainerUpgradeable public boolean isValidItemForSlot(int slotIndex, ItemStack i) { - IInventory mac = myte.getInventoryByName( "mac" ); + IInventory mac = upgradeable.getInventoryByName( "mac" ); ItemStack is = mac.getStackInSlot( 10 ); if ( is == null ) @@ -69,33 +73,38 @@ public class ContainerMAC extends ContainerUpgradeable @Override protected void setupConfig() { - int offx = 29; - int offy = 30; + int offX = 29; + int offY = 30; - IInventory mac = myte.getInventoryByName( "mac" ); + IInventory mac = upgradeable.getInventoryByName( "mac" ); for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) { - SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offx + x * 18, offy + y * 18 ); + SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); addSlotToContainer( s ); } - offx = 126; - offy = 16; + offX = 126; + offY = 16; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offx, offy, invPlayer ) ); - addSlotToContainer( new SlotOutput( mac, 9, offx, offy + 32, -1 ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offX, offY, invPlayer ) ); + addSlotToContainer( new SlotOutput( mac, 9, offX, offY + 32, -1 ) ); - offx = 122; - offy = 17; + offX = 122; + offY = 17; - IInventory upgrades = myte.getInventoryByName( "upgrades" ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )).setNotDraggable() ); - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, invPlayer )).setNotDraggable() ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )) + .setNotDraggable() ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1, invPlayer )) + .setNotDraggable() ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )) + .setNotDraggable() ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, invPlayer )) + .setNotDraggable() ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, invPlayer )) + .setNotDraggable() ); } @Override @@ -105,7 +114,7 @@ public class ContainerMAC extends ContainerUpgradeable if ( Platform.isServer() ) { - this.rsMode = (RedstoneMode) this.myte.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); + this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ); } craftProgress = this.tma.getCraftingProgress(); @@ -113,4 +122,16 @@ public class ContainerMAC extends ContainerUpgradeable standardDetectAndSendChanges(); } + @Override + public int getCurrentProgress() + { + return craftProgress; + } + + @Override + public int getMaxProgress() + { + return MAX_CRAFT_PROGRESS; + } + } diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index c27dd00d2..26fa72c46 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -121,7 +121,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { for (int y = 0; y < 5; y++) { - cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEWCELL, ((IViewCellStorage) monitorable).getViewCellStorage(), y, 206, y * 18 + 8, + cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEW_CELL, ((IViewCellStorage) monitorable).getViewCellStorage(), y, 206, y * 18 + 8, invPlayer ); cellView[y].allowEdit = canAccessViewCells; addSlotToContainer( cellView[y] ); @@ -152,11 +152,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa if ( sideLocal != sideRemote ) { clientCM.putSetting( set, sideLocal ); - for (int j = 0; j < this.crafters.size(); ++j) + for (Object crafter : this.crafters) { try { - NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) this.crafters.get( j ) ); + NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter ); } catch (IOException e) { diff --git a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java index 2b8535006..7451b26bb 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java +++ b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java @@ -5,7 +5,6 @@ import net.minecraft.item.ItemStack; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.implementations.guiobjects.IPortableCell; -import appeng.api.storage.ITerminalHost; import appeng.util.Platform; public class ContainerMEPortableCell extends ContainerMEMonitorable @@ -15,7 +14,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable IPortableCell civ; public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell monitorable) { - super( ip, (ITerminalHost) monitorable, false ); + super( ip, monitorable, false ); lockPlayerInventorySlot( ip.currentItem ); civ = monitorable; bindPlayerInventory( ip, 0, 0 ); @@ -50,7 +49,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable ticks++; if ( ticks > 10 ) { - civ.extractAEPower( powerMultiplier * (double) ticks, Actionable.MODULATE, PowerMultiplier.CONFIG ); + civ.extractAEPower( powerMultiplier * ticks, Actionable.MODULATE, PowerMultiplier.CONFIG ); ticks = 0; } super.detectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 537b7e9a9..5301d4786 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -27,7 +27,7 @@ public class ContainerNetworkTool extends AEBaseContainer for (int x = 0; x < 3; x++) addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te, y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, invPlayer )) ); - bindPlayerInventory( ip, 0, 166 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } public void toggleFacadeMode() diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index 1f51eb2ac..c6538eab8 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -178,7 +178,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA ItemStack[] in = getInputs(); ItemStack[] out = getOutputs(); - // if theres no input, this would be silly. + // if there is no input, this would be silly. if ( in == null || out == null ) return; @@ -259,12 +259,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } else { - List list = new ArrayList( 3 ); + List list = new ArrayList( 3 ); boolean hasValue = false; - for (int x = 0; x < outputSlots.length; x++) + for (OptionalSlotFake outputSlot : outputSlots) { - ItemStack out = outputSlots[x].getStack(); + ItemStack out = outputSlot.getStack(); if ( out != null && out.stackSize > 0 ) { list.add( out ); @@ -346,16 +346,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA ItemStack is = r.getCraftingResult( ic ); - if ( r != null && inv != null ) + for (int x = 0; x < ic.getSizeInventory(); x++) { - for (int x = 0; x < ic.getSizeInventory(); x++) + if ( ic.getStackInSlot( x ) != null ) { - if ( ic.getStackInSlot( x ) != null ) - { - ItemStack pulled = Platform.extractItemsByRecipe( powerSrc, mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, - Actionable.MODULATE, ItemViewCell.createFilter( getViewCells() ) ); - real.setInventorySlotContents( x, pulled ); - } + ItemStack pulled = Platform.extractItemsByRecipe( powerSrc, mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, + Actionable.MODULATE, ItemViewCell.createFilter( getViewCells() ) ); + real.setInventorySlotContents( x, pulled ); } } @@ -398,9 +395,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { if ( s == patternSlotOUT && Platform.isServer() ) { - for (int i = 0; i < this.crafters.size(); ++i) + for (Object crafter : this.crafters) { - ICrafting icrafting = (ICrafting) this.crafters.get( i ); + ICrafting icrafting = (ICrafting) crafter; for (Object g : inventorySlots) { diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index 7174c646e..12be8b0e7 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -8,13 +8,13 @@ import appeng.tile.qnb.TileQuantumBridge; public class ContainerQNB extends AEBaseContainer { - TileQuantumBridge myte; + TileQuantumBridge quantumBridge; - public ContainerQNB(InventoryPlayer ip, TileQuantumBridge te) { - super( ip, te, null ); - myte = te; + public ContainerQNB(InventoryPlayer ip, TileQuantumBridge quantumBridge) { + super( ip, quantumBridge, null ); + this.quantumBridge = quantumBridge; - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, te, 0, 80, 37, invPlayer )).setStackLimit( 1 ) ); + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge, 0, 80, 37, invPlayer )).setStackLimit( 1 ) ); bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index 557cb9ad1..a5c6ca203 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -41,7 +41,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn lockPlayerInventorySlot( ip.currentItem ); - bindPlayerInventory( ip, 0, 184 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index 53378f719..056aef586 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -39,7 +39,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE addSlotToContainer( configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, securityBox.configSlot, 0, 37, -33, ip ) ); - addSlotToContainer( wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODEABLE_ITEM, wirelessEncoder, 0, 212, 10, ip ) ); + addSlotToContainer( wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, wirelessEncoder, 0, 212, 10, ip ) ); addSlotToContainer( wirelessOut = new SlotOutput( wirelessEncoder, 1, 212, 68, -1 ) ); bindPlayerInventory( ip, 0, 0 ); @@ -117,28 +117,28 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE if ( wirelessIn.getHasStack() ) { ItemStack term = wirelessIn.getStack().copy(); - INetworkEncodable netEncodeable = null; + INetworkEncodable networkEncodable = null; if ( term.getItem() instanceof INetworkEncodable ) - netEncodeable = (INetworkEncodable) term.getItem(); + networkEncodable = (INetworkEncodable) term.getItem(); IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term ); if ( wTermHandler != null ) - netEncodeable = wTermHandler; + networkEncodable = wTermHandler; - if ( netEncodeable != null ) + if ( networkEncodable != null ) { - netEncodeable.setEncryptionKey( term, "" + securityBox.securityKey, "" ); + networkEncodable.setEncryptionKey( term, "" + securityBox.securityKey, "" ); wirelessIn.putStack( null ); wirelessOut.putStack( term ); // update the two slots in question... - for (int i = 0; i < this.crafters.size(); ++i) + for (Object crafter : this.crafters) { - ICrafting icrafting = (ICrafting) this.crafters.get( i ); - ((EntityPlayerMP) icrafting).sendSlotContents( this, wirelessIn.slotNumber, wirelessIn.getStack() ); - ((EntityPlayerMP) icrafting).sendSlotContents( this, wirelessOut.slotNumber, wirelessOut.getStack() ); + ICrafting icrafting = (ICrafting) crafter; + icrafting.sendSlotContents( this, wirelessIn.slotNumber, wirelessIn.getStack() ); + icrafting.sendSlotContents( this, wirelessOut.slotNumber, wirelessOut.getStack() ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index 3b4f9e9a0..555090346 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -11,29 +11,29 @@ import appeng.tile.storage.TileSkyChest; public class ContainerSkyChest extends AEBaseContainer { - TileSkyChest myte; + TileSkyChest chest; - public ContainerSkyChest(InventoryPlayer ip, TileSkyChest te) { - super( ip, te, null ); - myte = te; + public ContainerSkyChest(InventoryPlayer ip, TileSkyChest chest) { + super( ip, chest, null ); + this.chest = chest; for (int y = 0; y < 4; y++) { for (int x = 0; x < 9; x++) { - addSlotToContainer( new SlotNormal( myte, y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); + addSlotToContainer( new SlotNormal( this.chest, y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); } } - myte.openInventory(); + this.chest.openInventory(); - bindPlayerInventory( ip, 0, 195 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 195 - /* height of player inventory */82 ); } @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed( par1EntityPlayer ); - myte.closeInventory(); + chest.closeInventory(); } } diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index 3ea8e6c8e..8e0a7592d 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -16,7 +16,7 @@ import appeng.util.Platform; public class ContainerSpatialIOPort extends AEBaseContainer { - TileSpatialIOPort myte; + TileSpatialIOPort spatialIOPort; IGrid network; @@ -31,17 +31,17 @@ public class ContainerSpatialIOPort extends AEBaseContainer int delay = 40; - public ContainerSpatialIOPort(InventoryPlayer ip, TileSpatialIOPort te) { - super( ip, te, null ); - myte = te; + public ContainerSpatialIOPort(InventoryPlayer ip, TileSpatialIOPort spatialIOPort) { + super( ip, spatialIOPort, null ); + this.spatialIOPort = spatialIOPort; if ( Platform.isServer() ) - network = te.getGridNode( ForgeDirection.UNKNOWN ).getGrid(); + network = spatialIOPort.getGridNode( ForgeDirection.UNKNOWN ).getGrid(); - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, te, 0, 52, 48, invPlayer ) ); - addSlotToContainer( new SlotOutput( te, 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort, 0, 52, 48, invPlayer ) ); + addSlotToContainer( new SlotOutput( spatialIOPort, 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) ); - bindPlayerInventory( ip, 0, 197 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index 3c3cca2e6..8b60bfbc4 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -60,7 +60,7 @@ public class ContainerStorageBus extends ContainerUpgradeable @Override public boolean isSlotEnabled(int idx) { - int upgrades = myte.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } @@ -71,7 +71,7 @@ public class ContainerStorageBus extends ContainerUpgradeable int xo = 8; int yo = 23 + 6; - IInventory config = myte.getInventoryByName( "config" ); + IInventory config = upgradeable.getInventoryByName( "config" ); for (int y = 0; y < 7; y++) { for (int x = 0; x < 9; x++) @@ -83,7 +83,7 @@ public class ContainerStorageBus extends ContainerUpgradeable } } - IInventory upgrades = myte.getInventoryByName( "upgrades" ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1, invPlayer )).setNotDraggable() ); addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, invPlayer )).setNotDraggable() ); @@ -98,9 +98,9 @@ public class ContainerStorageBus extends ContainerUpgradeable if ( Platform.isServer() ) { - this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE ); - this.rwMode = (AccessRestriction) this.myte.getConfigManager().getSetting( Settings.ACCESS ); - this.storageFilter = (StorageFilter) this.myte.getConfigManager().getSetting( Settings.STORAGE_FILTER ); + this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.rwMode = (AccessRestriction) this.upgradeable.getConfigManager().getSetting( Settings.ACCESS ); + this.storageFilter = (StorageFilter) this.upgradeable.getConfigManager().getSetting( Settings.STORAGE_FILTER ); } standardDetectAndSendChanges(); @@ -108,7 +108,7 @@ public class ContainerStorageBus extends ContainerUpgradeable public void clear() { - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); for (int x = 0; x < inv.getSizeInventory(); x++) inv.setInventorySlotContents( x, null ); detectAndSendChanges(); @@ -116,7 +116,7 @@ public class ContainerStorageBus extends ContainerUpgradeable public void partition() { - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); IMEInventory cellInv = storageBus.getInternalHandler(); diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index c2898a4e9..c59d2b969 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -29,35 +29,35 @@ import appeng.util.Platform; public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSlotHost { - IUpgradeableHost myte; + IUpgradeableHost upgradeable; - int tbslot; - NetworkToolViewer tbinv; + int tbSlot; + NetworkToolViewer tbInventory; public ContainerUpgradeable(InventoryPlayer ip, IUpgradeableHost te) { super( ip, (TileEntity) (te instanceof TileEntity ? te : null), (IPart) (te instanceof IPart ? te : null) ); - myte = te; + upgradeable = te; World w = null; - int xCoor = 0, yCoor = 0, zCoor = 0; + int xCoord = 0, yCoord = 0, zCoord = 0; if ( te instanceof TileEntity ) { TileEntity myTile = (TileEntity) te; w = myTile.getWorldObj(); - xCoor = myTile.xCoord; - yCoor = myTile.yCoord; - zCoor = myTile.zCoord; + xCoord = myTile.xCoord; + yCoord = myTile.yCoord; + zCoord = myTile.zCoord; } if ( te instanceof IPart ) { - IUpgradeableHost myTile = (IUpgradeableHost) te; + IUpgradeableHost myTile = te; TileEntity mk = myTile.getTile(); w = mk.getWorldObj(); - xCoor = mk.xCoord; - yCoor = mk.yCoord; - zCoor = mk.zCoord; + xCoord = mk.xCoord; + yCoord = mk.yCoord; + zCoord = mk.zCoord; } IInventory pi = getPlayerInv(); @@ -67,8 +67,8 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if ( pii != null && pii.getItem() instanceof ToolNetworkTool ) { lockPlayerInventorySlot( x ); - tbslot = x; - tbinv = (NetworkToolViewer) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoor, yCoor, zCoor ); + tbSlot = x; + tbInventory = (NetworkToolViewer) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoord, yCoord, zCoord ); break; } } @@ -77,18 +77,18 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { for (int v = 0; v < 3; v++) for (int u = 0; u < 3; u++) - addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, tbinv, u + v * 3, 186 + u * 18, getHeight() - 82 + v * 18, + addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, tbInventory, u + v * 3, 186 + u * 18, getHeight() - 82 + v * 18, invPlayer )).setPlayerSide() ); } setupConfig(); - bindPlayerInventory( ip, 0, getHeight() - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, getHeight() - /* height of player inventory */82 ); } protected void setupUpgrades() { - IInventory upgrades = myte.getInventoryByName( "upgrades" ); + IInventory upgrades = upgradeable.getInventoryByName( "upgrades" ); if ( availableUpgrades() > 0 ) addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0, invPlayer )).setNotDraggable() ); if ( availableUpgrades() > 1 ) @@ -105,7 +105,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl int y = 40; setupUpgrades(); - IInventory inv = myte.getInventoryByName( "config" ); + IInventory inv = upgradeable.getInventoryByName( "config" ); addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); if ( supportCapacity() ) @@ -150,14 +150,14 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { if ( hasToolbox() ) { - ItemStack currentItem = getPlayerInv().getStackInSlot( tbslot ); + ItemStack currentItem = getPlayerInv().getStackInSlot( tbSlot ); - if ( currentItem != tbinv.getItemStack() ) + if ( currentItem != tbInventory.getItemStack() ) { if ( currentItem != null ) { - if ( Platform.isSameItem( tbinv.getItemStack(), currentItem ) ) - getPlayerInv().setInventorySlotContents( tbslot, tbinv.getItemStack() ); + if ( Platform.isSameItem( tbInventory.getItemStack(), currentItem ) ) + getPlayerInv().setInventorySlotContents( tbSlot, tbInventory.getItemStack() ); else isContainerValid = false; } @@ -174,7 +174,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if ( Platform.isServer() ) { - IConfigManager cm = this.myte.getConfigManager(); + IConfigManager cm = this.upgradeable.getConfigManager(); loadSettingsFromHost( cm ); } @@ -186,7 +186,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { OptionalSlotFake fs = (OptionalSlotFake) o; if ( !fs.isEnabled() && fs.getDisplayStack() != null ) - ((OptionalSlotFake) fs).clearStack(); + fs.clearStack(); } } @@ -197,7 +197,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { this.fzMode = (FuzzyMode) cm.getSetting( Settings.FUZZY_MODE ); this.rsMode = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED ); - if ( myte instanceof PartExportBus ) + if ( upgradeable instanceof PartExportBus ) this.cMode = (YesNo) cm.getSetting( Settings.CRAFT_ONLY ); } @@ -208,13 +208,13 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl public boolean hasToolbox() { - return tbinv != null; + return tbInventory != null; } @Override public boolean isSlotEnabled(int idx) { - int upgrades = myte.getInstalledUpgrades( Upgrades.CAPACITY ); + int upgrades = upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); if ( idx == 1 && upgrades > 0 ) return true; diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index e01139266..ad59803e2 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -3,22 +3,24 @@ package appeng.container.implementations; import net.minecraft.entity.player.InventoryPlayer; import appeng.container.AEBaseContainer; import appeng.container.guisync.GuiSync; +import appeng.container.interfaces.IProgressProvider; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.misc.TileVibrationChamber; import appeng.util.Platform; -public class ContainerVibrationChamber extends AEBaseContainer +public class ContainerVibrationChamber extends AEBaseContainer implements IProgressProvider { - TileVibrationChamber myte; + TileVibrationChamber vibrationChamber; + private static final int MAX_BURN_TIME = 200; - public ContainerVibrationChamber(InventoryPlayer ip, TileVibrationChamber te) { - super( ip, te, null ); - myte = te; + public ContainerVibrationChamber(InventoryPlayer ip, TileVibrationChamber vibrationChamber) { + super( ip, vibrationChamber, null ); + this.vibrationChamber = vibrationChamber; - addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, te, 0, 80, 37, invPlayer ) ); + addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber, 0, 80, 37, invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } public int aePerTick = 5; @@ -34,11 +36,23 @@ public class ContainerVibrationChamber extends AEBaseContainer { if ( Platform.isServer() ) { - this.burnProgress = (int) (this.myte.maxBurnTime <= 0 ? 0 : 12 * this.myte.burnTime / this.myte.maxBurnTime); - this.burnSpeed = this.myte.burnSpeed; + this.burnProgress = (int) (this.vibrationChamber.maxBurnTime <= 0 ? 0 : 12 * this.vibrationChamber.burnTime / this.vibrationChamber.maxBurnTime); + this.burnSpeed = this.vibrationChamber.burnSpeed; } super.detectAndSendChanges(); } + @Override + public int getCurrentProgress() + { + return burnProgress > 0 ? burnSpeed : 0; + } + + @Override + public int getMaxProgress() + { + return MAX_BURN_TIME; + } + } diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index 84f2d0c23..b6ac68823 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -10,7 +10,7 @@ import appeng.tile.networking.TileWireless; public class ContainerWireless extends AEBaseContainer { - TileWireless myte; + TileWireless wirelessTerminal; @GuiSync(1) public long range = 0; @@ -22,11 +22,11 @@ public class ContainerWireless extends AEBaseContainer public ContainerWireless(InventoryPlayer ip, TileWireless te) { super( ip, te, null ); - myte = te; + wirelessTerminal = te; - addSlotToContainer( boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, myte, 0, 80, 47, invPlayer ) ); + addSlotToContainer( boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, wirelessTerminal, 0, 80, 47, invPlayer ) ); - bindPlayerInventory( ip, 0, 166 - /* height of playerinventory */82 ); + bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java index c1390dce4..6aa7c88a4 100644 --- a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java @@ -9,11 +9,11 @@ import appeng.util.Platform; public class ContainerWirelessTerm extends ContainerMEPortableCell { - WirelessTerminalGuiObject wtgo; + WirelessTerminalGuiObject wirelessTerminalGUIObject; - public ContainerWirelessTerm(InventoryPlayer ip, WirelessTerminalGuiObject monitorable) { - super( ip, monitorable ); - wtgo = monitorable; + public ContainerWirelessTerm(InventoryPlayer ip, WirelessTerminalGuiObject wirelessTerminalGUIObject) { + super( ip, wirelessTerminalGUIObject ); + this.wirelessTerminalGUIObject = wirelessTerminalGUIObject; } @Override @@ -21,7 +21,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell { super.detectAndSendChanges(); - if ( !wtgo.rangeCheck() ) + if ( !wirelessTerminalGUIObject.rangeCheck() ) { if ( Platform.isServer() && isContainerValid ) getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() ); @@ -30,7 +30,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell } else { - powerMultiplier = AEConfig.instance.wireless_getDrainRate( wtgo.getRange() ); + powerMultiplier = AEConfig.instance.wireless_getDrainRate( wirelessTerminalGUIObject.getRange() ); } } } diff --git a/src/main/java/appeng/container/interfaces/IProgressProvider.java b/src/main/java/appeng/container/interfaces/IProgressProvider.java new file mode 100644 index 000000000..ae8218166 --- /dev/null +++ b/src/main/java/appeng/container/interfaces/IProgressProvider.java @@ -0,0 +1,32 @@ +package appeng.container.interfaces; + +import appeng.client.gui.widgets.GuiProgressBar; + +/** + * This interface provides the data for anything simulating a progress. + * + * Its main use is in combination with the {@link GuiProgressBar}, which ensures to scale it to a percentage of 0 to + * 100. + * + */ +public interface IProgressProvider +{ + + /** + * The current value of the progress. It should cover a range from 0 to the max progress + * + * @return An int representing the current progress + */ + int getCurrentProgress(); + + /** + * The max value the progress. + * + * It is not limited to a value of 100 and can be scaled to fit the current needs. For example scaled down to + * decrease or scaled up to increase the precision. + * + * @return An int representing the max progress + */ + int getMaxProgress(); + +} diff --git a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java index 3af67db75..1347b046e 100644 --- a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java +++ b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java @@ -37,6 +37,7 @@ public class AppEngCraftingSlot extends AppEngSlot /** * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ + @Override public boolean isItemValid(ItemStack par1ItemStack) { return false; @@ -46,6 +47,7 @@ public class AppEngCraftingSlot extends AppEngSlot * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new * stack. */ + @Override public ItemStack decrStackSize(int par1) { if ( this.getHasStack() ) @@ -60,6 +62,7 @@ public class AppEngCraftingSlot extends AppEngSlot * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an * internal count then calls onCrafting(item). */ + @Override protected void onCrafting(ItemStack par1ItemStack, int par2) { this.amountCrafted += par2; @@ -69,6 +72,7 @@ public class AppEngCraftingSlot extends AppEngSlot /** * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. */ + @Override protected void onCrafting(ItemStack par1ItemStack) { par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted ); @@ -125,6 +129,7 @@ public class AppEngCraftingSlot extends AppEngSlot } } + @Override public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, craftMatrix ); diff --git a/src/main/java/appeng/container/slot/AppEngSlot.java b/src/main/java/appeng/container/slot/AppEngSlot.java index e5120dffe..5ab024dcf 100644 --- a/src/main/java/appeng/container/slot/AppEngSlot.java +++ b/src/main/java/appeng/container/slot/AppEngSlot.java @@ -13,7 +13,7 @@ public class AppEngSlot extends Slot public enum hasCalculatedValidness { NotAvailable, Valid, Invalid - }; + } public boolean isDraggable = true; public boolean isPlayerSide = false; diff --git a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java index ca324befb..bf345ea2d 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java @@ -9,9 +9,9 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput final int groupNum; IOptionalSlotHost host; - public OptionalSlotRestrictedInput(PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotnum, int x, int y, int grpNum, + public OptionalSlotRestrictedInput(PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum, InventoryPlayer invPlayer) { - super( valid, i, slotnum, x, y, invPlayer ); + super( valid, i, slotIndex, x, y, invPlayer ); this.groupNum = grpNum; this.host = host; } diff --git a/src/main/java/appeng/container/slot/SlotCraftingTerm.java b/src/main/java/appeng/container/slot/SlotCraftingTerm.java index 15efa3e9b..9285fa797 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingTerm.java +++ b/src/main/java/appeng/container/slot/SlotCraftingTerm.java @@ -112,7 +112,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot is = r.getCraftingResult( ic ); - if ( r != null && inv != null ) + if ( inv != null ) { for (int x = 0; x < pattern.getSizeInventory(); x++) { @@ -149,7 +149,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot public void postCraft(EntityPlayer p, IMEMonitor inv, ItemStack set[], ItemStack result) { - List drops = new ArrayList(); + List drops = new ArrayList(); // add one of each item to the items on the board... if ( Platform.isServer() ) @@ -219,7 +219,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot ItemStack extra = ia.addItems( craftItem( who, rs, inv, all ) ); if ( extra != null ) { - List drops = new ArrayList(); + List drops = new ArrayList(); drops.add( extra ); Platform.spawnDrops( who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops ); return; diff --git a/src/main/java/appeng/container/slot/SlotPatternTerm.java b/src/main/java/appeng/container/slot/SlotPatternTerm.java index 83cb9c01d..fd8635e88 100644 --- a/src/main/java/appeng/container/slot/SlotPatternTerm.java +++ b/src/main/java/appeng/container/slot/SlotPatternTerm.java @@ -20,12 +20,12 @@ public class SlotPatternTerm extends SlotCraftingTerm IOptionalSlotHost host; public SlotPatternTerm(EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, - IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int grpnum, IContainerCraftingPacket c) + IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int groupNumber, IContainerCraftingPacket c) { super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c ); host = h; - groupNum = grpnum; + groupNum = groupNumber; } diff --git a/src/main/java/appeng/container/slot/SlotPlayerInv.java b/src/main/java/appeng/container/slot/SlotPlayerInv.java index 9159d2c86..8cf4b5099 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerInv.java +++ b/src/main/java/appeng/container/slot/SlotPlayerInv.java @@ -9,7 +9,7 @@ public class SlotPlayerInv extends AppEngSlot public SlotPlayerInv(IInventory par1iInventory, int par2, int par3, int par4) { super( par1iInventory, par2, par3, par4 ); - ; + isPlayerSide = true; } } diff --git a/src/main/java/appeng/container/slot/SlotRestrictedInput.java b/src/main/java/appeng/container/slot/SlotRestrictedInput.java index 84dbd611e..2813a61e1 100644 --- a/src/main/java/appeng/container/slot/SlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/SlotRestrictedInput.java @@ -30,13 +30,13 @@ public class SlotRestrictedInput extends AppEngSlot { STORAGE_CELLS(15), ORE(1 * 16 + 15), STORAGE_COMPONENT(3 * 16 + 15), - ENCODEABLE_ITEM(4 * 16 + 15), TRASH(5 * 16 + 15), VALID_ENCODED_PATTERN_W_OUTPUT(7 * 16 + 15), ENCODED_PATTERN_W_OUTPUT(7 * 16 + 15), + ENCODABLE_ITEM(4 * 16 + 15), TRASH(5 * 16 + 15), VALID_ENCODED_PATTERN_W_OUTPUT(7 * 16 + 15), ENCODED_PATTERN_W_OUTPUT(7 * 16 + 15), ENCODED_CRAFTING_PATTERN(7 * 16 + 15), ENCODED_PATTERN(7 * 16 + 15), PATTERN(8 * 16 + 15), BLANK_PATTERN(8 * 16 + 15), POWERED_TOOL(9 * 16 + 15), RANGE_BOOSTER(6 * 16 + 15), QE_SINGULARITY(10 * 16 + 15), SPATIAL_STORAGE_CELLS(11 * 16 + 15), - FUEL(12 * 16 + 15), UPGRADES(13 * 16 + 15), WORKBENCH_CELL(15), BIOMETRIC_CARD(14 * 16 + 15), VIEWCELL(4 * 16 + 14), + FUEL(12 * 16 + 15), UPGRADES(13 * 16 + 15), WORKBENCH_CELL(15), BIOMETRIC_CARD(14 * 16 + 15), VIEW_CELL(4 * 16 + 14), INSCRIBER_PLATE(2 * 16 + 14), INSCRIBER_INPUT(3 * 16 + 14), METAL_INGOTS(3 * 16 + 14); @@ -45,7 +45,7 @@ public class SlotRestrictedInput extends AppEngSlot private PlacableItemType(int o) { IIcon = o; } - }; + } @Override public int getSlotStackLimit() @@ -85,8 +85,8 @@ public class SlotRestrictedInput extends AppEngSlot return this; } - public SlotRestrictedInput(PlacableItemType valid, IInventory i, int slotnum, int x, int y, InventoryPlayer p) { - super( i, slotnum, x, y ); + public SlotRestrictedInput(PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p) { + super( i, slotIndex, x, y ); which = valid; IIcon = valid.IIcon; this.p = p; @@ -179,7 +179,7 @@ public class SlotRestrictedInput extends AppEngSlot return isMetalIngot( i ); - case VIEWCELL: + case VIEW_CELL: return AEApi.instance().items().itemViewCell.sameAsStack( i ); case ORE: return appeng.api.AEApi.instance().registries().grinder().getRecipeForInput( i ) != null; @@ -196,7 +196,7 @@ public class SlotRestrictedInput extends AppEngSlot case STORAGE_CELLS: return AEApi.instance().registries().cell().isCellHandled( i ); case WORKBENCH_CELL: - return i != null && i.getItem() instanceof ICellWorkbenchItem && ((ICellWorkbenchItem) i.getItem()).isEditable( i ); + return i.getItem() instanceof ICellWorkbenchItem && ((ICellWorkbenchItem) i.getItem()).isEditable( i ); case STORAGE_COMPONENT: boolean isComp = i.getItem() instanceof IStorageComponent && ((IStorageComponent) i.getItem()).isStorageComponent( i ); return isComp; @@ -206,7 +206,7 @@ public class SlotRestrictedInput extends AppEngSlot if ( i.getItem() instanceof IStorageComponent && ((IStorageComponent) i.getItem()).isStorageComponent( i ) ) return false; return true; - case ENCODEABLE_ITEM: + case ENCODABLE_ITEM: return i.getItem() instanceof INetworkEncodable || AEApi.instance().registries().wireless().isWirelessTerminal( i ); case BIOMETRIC_CARD: return i.getItem() instanceof IBiometricCard; diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index b7f207cf1..89e4bb8b8 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -96,7 +96,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon return prop; } - public double spatialPowerScaler = 1.35; + public double spatialPowerExponent = 1.35; public double spatialPowerMultiplier = 1250.0; public String grinderOres[] = { @@ -117,12 +117,12 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon public int[] priorityByStacks = new int[] { 1, 10, 100, 1000 }; public int[] levelByStacks = new int[] { 1, 10, 100, 1000 }; - public int wireless_battery = 1600000; - public int manipulator_battery = 200000; - public int mattercannon_battery = 200000; - public int portablecell_battery = 20000; - public int colorapplicator_battery = 20000; - public int staff_battery = 8000; + public int wirelessTerminalBattery = 1600000; + public int entropyManipulatorBattery = 200000; + public int matterCannonBattery = 200000; + public int portableCellBattery = 20000; + public int colorApplicatorBattery = 20000; + public int chargedStaffBattery = 8000; public boolean disableColoredCableRecipesInNEI = true; @@ -257,20 +257,20 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon formationPlaneEntityLimit = get( "automation", "formationPlaneEntityLimit", formationPlaneEntityLimit ).getInt( formationPlaneEntityLimit ); - wireless_battery = get( "battery", "wireless", wireless_battery ).getInt( wireless_battery ); - staff_battery = get( "battery", "staff", staff_battery ).getInt( staff_battery ); - manipulator_battery = get( "battery", "manipulator", manipulator_battery ).getInt( manipulator_battery ); - portablecell_battery = get( "battery", "portablecell", portablecell_battery ).getInt( portablecell_battery ); - colorapplicator_battery = get( "battery", "colorapplicator", colorapplicator_battery ).getInt( colorapplicator_battery ); - mattercannon_battery = get( "battery", "mattercannon", mattercannon_battery ).getInt( mattercannon_battery ); + wirelessTerminalBattery = get( "battery", "wirelessTerminal", wirelessTerminalBattery ).getInt( wirelessTerminalBattery ); + chargedStaffBattery = get( "battery", "chargedStaff", chargedStaffBattery ).getInt( chargedStaffBattery ); + entropyManipulatorBattery = get( "battery", "entropyManipulator", entropyManipulatorBattery ).getInt( entropyManipulatorBattery ); + portableCellBattery = get( "battery", "portableCell", portableCellBattery ).getInt( portableCellBattery ); + colorApplicatorBattery = get( "battery", "colorApplicator", colorApplicatorBattery ).getInt( colorApplicatorBattery ); + matterCannonBattery = get( "battery", "matterCannon", matterCannonBattery ).getInt( matterCannonBattery ); clientSync(); for (AEFeature feature : AEFeature.values()) { - if ( feature.isVisible() ) + if ( feature.isVisible ) { - if ( get( "Features." + feature.getCategory(), feature.name(), feature.defaultValue() ).getBoolean( feature.defaultValue() ) ) + if ( get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) ) featureFlags.add( feature ); } else @@ -280,7 +280,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); if ( imb != null ) { - List version = Arrays.asList( new String[] { "59.0.0", "59.0.1", "59.0.2" } ); + List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); if ( version.contains( imb.getVersion() ) ) featureFlags.remove( AEFeature.AlphaPass ); } @@ -304,12 +304,12 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID ); storageProviderID = get( "spatialio", "storageProviderID", storageProviderID ).getInt( storageProviderID ); spatialPowerMultiplier = get( "spatialio", "spatialPowerMultiplier", spatialPowerMultiplier ).getDouble( spatialPowerMultiplier ); - spatialPowerScaler = get( "spatialio", "spatialPowerScaler", spatialPowerScaler ).getDouble( spatialPowerScaler ); + spatialPowerExponent = get( "spatialio", "spatialPowerExponent", spatialPowerExponent ).getDouble( spatialPowerExponent ); } if ( isFeatureEnabled( AEFeature.CraftingCPU ) ) { - craftingCalculationTimePerTick = get( "craftingcpu", "craftingCalculationTimePerTick", craftingCalculationTimePerTick ).getInt( + craftingCalculationTimePerTick = get( "craftingCPU", "craftingCalculationTimePerTick", craftingCalculationTimePerTick ).getInt( craftingCalculationTimePerTick ); } diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index 38276f8fb..17866c03f 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -53,7 +53,7 @@ public class AppEng public final static String modid = "appliedenergistics2"; public final static String name = "Applied Energistics 2"; - HashMap IMCHandlers = new HashMap(); + HashMap IMCHandlers = new HashMap(); public static AppEng instance; @@ -156,10 +156,10 @@ public class AppEng AELog.info( "PostInit" ); Registration.instance.PostInit( event ); - IntegrationRegistry.instance.postinit(); + IntegrationRegistry.instance.postInit(); FMLCommonHandler.instance().registerCrashCallable( new CrashEnhancement( CrashInfo.INTEGRATION ) ); - CommonHelper.proxy.postinit(); + CommonHelper.proxy.postInit(); AEConfig.instance.save(); NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler ); diff --git a/src/main/java/appeng/core/CommonHelper.java b/src/main/java/appeng/core/CommonHelper.java index bad7301b3..efd5a571a 100644 --- a/src/main/java/appeng/core/CommonHelper.java +++ b/src/main/java/appeng/core/CommonHelper.java @@ -37,7 +37,7 @@ public abstract class CommonHelper public abstract void doRenderItem(ItemStack itemstack, World w); - public abstract void postinit(); + public abstract void postInit(); public abstract CableRenderMode getRenderMode(); diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index 9aadddc40..153afab47 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -9,7 +9,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import appeng.api.AEApi; @@ -78,7 +77,6 @@ import appeng.block.storage.BlockDrive; import appeng.block.storage.BlockIOPort; import appeng.block.storage.BlockSkyChest; import appeng.core.features.AEFeature; -import appeng.core.features.AEFeatureHandler; import appeng.core.features.ColoredItemDefinition; import appeng.core.features.DamagedItemDefinition; import appeng.core.features.IAEFeature; @@ -229,7 +227,7 @@ public class Registration Parts parts = appeng.core.Api.instance.parts(); Blocks blocks = appeng.core.Api.instance.blocks(); - AEItemDefinition materialItem = (AEFeatureHandler) addFeature( ItemMultiMaterial.class ); + AEItemDefinition materialItem = addFeature( ItemMultiMaterial.class ); Class materialClass = materials.getClass(); for (MaterialType mat : MaterialType.values()) @@ -255,7 +253,7 @@ public class Registration } } - AEItemDefinition partItem = (AEFeatureHandler) addFeature( ItemMultiPart.class ); + AEItemDefinition partItem = addFeature( ItemMultiPart.class ); Class partClass = parts.getClass(); for (PartType type : PartType.values()) @@ -403,17 +401,17 @@ public class Registration items.itemFacade = addFeature( ItemFacade.class ); items.itemCrystalSeed = addFeature( ItemCrystalSeed.class ); - ColoredItemDefinition pbreg, pbregl; - items.itemPaintBall = pbreg = new ColoredItemDefinition(); - items.itemLumenPaintBall = pbregl = new ColoredItemDefinition(); + ColoredItemDefinition paintBall, lumenPaintBall; + items.itemPaintBall = paintBall = new ColoredItemDefinition(); + items.itemLumenPaintBall = lumenPaintBall = new ColoredItemDefinition(); AEItemDefinition pb = addFeature( ItemPaintBall.class ); for (AEColor c : AEColor.values()) { if ( c != AEColor.Transparent ) { - pbreg.add( c, new ItemStackSrc( pb.item(), c.ordinal() ) ); - pbregl.add( c, new ItemStackSrc( pb.item(), 20 + c.ordinal() ) ); + paintBall.add( c, new ItemStackSrc( pb.item(), c.ordinal() ) ); + lumenPaintBall.add( c, new ItemStackSrc( pb.item(), 20 + c.ordinal() ) ); } } @@ -519,7 +517,7 @@ public class Registration public void Init(FMLInitializationEvent event) { // Perform ore camouflage! - ItemMultiMaterial.instance.unduplicate(); + ItemMultiMaterial.instance.makeUnique(); if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) ) recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" ); @@ -591,7 +589,7 @@ public class Registration // default settings.. ((P2PTunnelRegistry) AEApi.instance().registries().p2pTunnel()).configure(); - // add to localizaiton.. + // add to localization.. PlayerMessages.values(); GuiText.values(); diff --git a/src/main/java/appeng/core/WorldSettings.java b/src/main/java/appeng/core/WorldSettings.java index 90cbb7e62..d83a77a8d 100644 --- a/src/main/java/appeng/core/WorldSettings.java +++ b/src/main/java/appeng/core/WorldSettings.java @@ -224,7 +224,7 @@ public class WorldSettings extends Configuration instance = null; } - List storageCellDims = new ArrayList(); + List storageCellDims = new ArrayList(); HashMap idToUUID; public void addStorageCellDim(int newDim) @@ -297,7 +297,7 @@ public class WorldSettings extends Configuration { try { - manager.scheduleOutboundPacket( (new PacketNewStorageDimension( newDim )).getProxy(), new GenericFutureListener[0] ); + manager.scheduleOutboundPacket( (new PacketNewStorageDimension( newDim )).getProxy() ); } catch (IOException e) { @@ -317,7 +317,7 @@ public class WorldSettings extends Configuration save(); } - private WeakHashMap> loadedStorage = new WeakHashMap(); + private WeakHashMap> loadedStorage = new WeakHashMap>(); public WorldCoord getStoredSize(int dim) { diff --git a/src/main/java/appeng/core/api/ApiPart.java b/src/main/java/appeng/core/api/ApiPart.java index 1eb275cf8..21939d2e4 100644 --- a/src/main/java/appeng/core/api/ApiPart.java +++ b/src/main/java/appeng/core/api/ApiPart.java @@ -44,12 +44,12 @@ public class ApiPart implements IPartHelper int classNum = 1; - HashMap TileImplementations = new HashMap(); - HashMap readerCache = new HashMap(); - HashMap interfaces2Layer = new HashMap(); - HashMap roots = new HashMap(); + HashMap TileImplementations = new HashMap(); + HashMap readerCache = new HashMap(); + HashMap interfaces2Layer = new HashMap(); + HashMap roots = new HashMap(); - List desc = new LinkedList(); + List desc = new LinkedList(); public void initFMPSupport() { @@ -81,7 +81,7 @@ public class ApiPart implements IPartHelper Object[] argsA = new Object[] { Name, Name, b }; b = (byte[]) runTransformersMethod.invoke( loader, argsA ); - Object[] args = new Object[] { Name, b, new Integer( 0 ), new Integer( b.length ) }; + Object[] args = new Object[] { Name, b, 0, b.length }; clazz = (Class) defineClassMethod.invoke( loader, args ); } finally @@ -247,26 +247,26 @@ public class ApiPart implements IPartHelper // n.accept( cw ); // n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) ); - byte[] barray = cw.toByteArray(); - int size = barray.length; - Class nclass = loadClass( n.name.replace( "/", "." ), barray ); + byte[] byteArray = cw.toByteArray(); + int size = byteArray.length; + Class clazz = loadClass( n.name.replace( "/", "." ), byteArray ); try { - Object fish = nclass.newInstance(); + Object fish = clazz.newInstance(); Class rootC = Class.forName( root ); - boolean bads = false; + boolean hasError = false; if ( !rootC.isInstance( fish ) ) { - bads = true; + hasError = true; AELog.severe( "Error, Expected layer to implement " + root + " did not." ); } if ( fish instanceof LayerBase ) { - bads = true; + hasError = true; AELog.severe( "Error, Expected layer to NOT implement LayerBase but it DID." ); } @@ -274,18 +274,18 @@ public class ApiPart implements IPartHelper { if ( !(fish instanceof TileCableBus) ) { - bads = true; + hasError = true; AELog.severe( "Error, Expected layer to implement TileCableBus did not." ); } if ( !(fish instanceof TileEntity) ) { - bads = true; + hasError = true; AELog.severe( "Error, Expected layer to implement TileEntity did not." ); } } - if ( !bads ) + if ( !hasError ) { AELog.info( "Layer: " + n.name + " loaded successfully - " + size + " bytes" ); } @@ -297,8 +297,8 @@ public class ApiPart implements IPartHelper AELog.error( t ); } - roots.put( fullPath, nclass ); - return nclass; + roots.put( fullPath, clazz ); + return clazz; } private void processNode(AbstractInsnNode next, String nePar) diff --git a/src/main/java/appeng/core/api/ApiStorage.java b/src/main/java/appeng/core/api/ApiStorage.java index f1854ebbb..ca6e86340 100644 --- a/src/main/java/appeng/core/api/ApiStorage.java +++ b/src/main/java/appeng/core/api/ApiStorage.java @@ -40,13 +40,13 @@ public class ApiStorage implements IStorageHelper @Override public IItemList createItemList() { - return new ItemList( IAEItemStack.class ); + return new ItemList( IAEItemStack.class ); } @Override public IItemList createFluidList() { - return new ItemList( IAEFluidStack.class ); + return new ItemList( IAEFluidStack.class ); } @Override diff --git a/src/main/java/appeng/core/features/AEFeature.java b/src/main/java/appeng/core/features/AEFeature.java index 0c0bf5418..b9e9946f8 100644 --- a/src/main/java/appeng/core/features/AEFeature.java +++ b/src/main/java/appeng/core/features/AEFeature.java @@ -56,33 +56,19 @@ public enum AEFeature ChunkLoggerTrace("Commands", false), LogSecurityAudits("Misc", false), Achievements("Misc"); - String Category; - boolean visible = true; - boolean defValue = true; + public final String category; + public final boolean isVisible; + public final boolean defaultValue; private AEFeature(String cat) { - Category = cat; - visible = !this.name().equals( "Core" ); + this.category = cat; + this.isVisible = !this.name().equals( "Core" ); + this.defaultValue = true; } - private AEFeature(String cat, boolean defv) { - this( cat ); - defValue = defv; + private AEFeature(String cat, boolean defaultValue) { + this.category = cat; + this.isVisible = !this.name().equals( "Core" ); + this.defaultValue = defaultValue; } - - public String getCategory() - { - return Category; - } - - public Boolean defaultValue() - { - return defValue; - } - - public Boolean isVisible() - { - return visible; - } - } diff --git a/src/main/java/appeng/core/features/AEFeatureHandler.java b/src/main/java/appeng/core/features/AEFeatureHandler.java index 22088423f..87bb1fe49 100644 --- a/src/main/java/appeng/core/features/AEFeatureHandler.java +++ b/src/main/java/appeng/core/features/AEFeatureHandler.java @@ -21,32 +21,32 @@ import cpw.mods.fml.common.registry.GameRegistry; public class AEFeatureHandler implements AEItemDefinition { - private final EnumSet myFeatures; + private final EnumSet features; - private final String subname; - private IAEFeature obj; + private final String subName; + private IAEFeature feature; private Item ItemData; private Block BlockData; - public AEFeatureHandler(EnumSet featureSet, IAEFeature _obj, String _subname) { - myFeatures = featureSet; - obj = _obj; - subname = _subname; + public AEFeatureHandler(EnumSet features, IAEFeature feature, String subName) { + this.features = features; + this.feature = feature; + this.subName = subName; } public void register() { if ( isFeatureAvailable() ) { - if ( obj instanceof Item ) - initItem( (Item) obj ); - if ( obj instanceof Block ) - initBlock( (Block) obj ); + if ( feature instanceof Item ) + initItem( (Item) feature ); + if ( feature instanceof Block ) + initBlock( (Block) feature ); } } - public static String getName(Class o, String subname) + public static String getName(Class o, String subName) { String name = o.getSimpleName(); @@ -55,19 +55,19 @@ public class AEFeatureHandler implements AEItemDefinition else if ( name.startsWith( "ItemMultiMaterial" ) ) name = name.replace( "ItemMultiMaterial", "ItemMaterial" ); - if ( subname != null ) + if ( subName != null ) { // simple hack to allow me to do get nice names for these without // mode code outside of AEBaseItem - if ( subname.startsWith( "P2PTunnel" ) ) + if ( subName.startsWith( "P2PTunnel" ) ) return "ItemPart.P2PTunnel"; - if ( subname.equals( "CertusQuartzTools" ) ) + if ( subName.equals( "CertusQuartzTools" ) ) return name.replace( "Quartz", "CertusQuartz" ); - if ( subname.equals( "NetherQuartzTools" ) ) + if ( subName.equals( "NetherQuartzTools" ) ) return name.replace( "Quartz", "NetherQuartz" ); - name += "." + subname; + name += "." + subName; } return name; @@ -77,7 +77,7 @@ public class AEFeatureHandler implements AEItemDefinition { ItemData = i; - String name = getName( i.getClass(), subname ); + String name = getName( i.getClass(), subName ); i.setTextureName( "appliedenergistics2:" + name ); i.setUnlocalizedName( /* "item." */"appliedenergistics2." + name ); @@ -98,7 +98,7 @@ public class AEFeatureHandler implements AEItemDefinition { BlockData = b; - String name = getName( b.getClass(), subname ); + String name = getName( b.getClass(), subName ); b.setCreativeTab( CreativeTab.instance ); b.setBlockName( /* "tile." */"appliedenergistics2." + name ); b.setBlockTextureName( "appliedenergistics2:" + name ); @@ -118,14 +118,14 @@ public class AEFeatureHandler implements AEItemDefinition public EnumSet getFeatures() { - return myFeatures.clone(); + return features.clone(); } public boolean isFeatureAvailable() { boolean enabled = true; - for (AEFeature f : myFeatures) + for (AEFeature f : features) enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); return enabled; diff --git a/src/main/java/appeng/core/features/registries/CellRegistry.java b/src/main/java/appeng/core/features/registries/CellRegistry.java index 74d6af862..d790208e8 100644 --- a/src/main/java/appeng/core/features/registries/CellRegistry.java +++ b/src/main/java/appeng/core/features/registries/CellRegistry.java @@ -16,7 +16,7 @@ public class CellRegistry implements ICellRegistry List handlers; public CellRegistry() { - handlers = new ArrayList(); + handlers = new ArrayList(); } @Override diff --git a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java index c776291fc..8cba75c9b 100644 --- a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java +++ b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java @@ -18,7 +18,7 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry final ExternalIInv lastHandler = new ExternalIInv(); public ExternalStorageRegistry() { - Handlers = new ArrayList(); + Handlers = new ArrayList(); } @Override diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index d74233ea6..4c70fe617 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -11,7 +11,7 @@ import appeng.core.AELog; public class GridCacheRegistry implements IGridCacheRegistry { - final private HashMap, Class> caches = new HashMap(); + final private HashMap, Class> caches = new HashMap, Class>(); @Override public void registerGridCache(Class iface, Class implementation) @@ -25,7 +25,7 @@ public class GridCacheRegistry implements IGridCacheRegistry @Override public HashMap, IGridCache> createCacheInstance(IGrid g) { - HashMap, IGridCache> map = new HashMap(); + HashMap, IGridCache> map = new HashMap, IGridCache>(); for (Class iface : caches.keySet()) { diff --git a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java index aca8ea9a8..cbeb345a2 100644 --- a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java +++ b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java @@ -31,7 +31,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener } public GrinderRecipeManager() { - RecipeList = new ArrayList(); + RecipeList = new ArrayList(); addOre( "Coal", new ItemStack( Items.coal ) ); addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) ); diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index ee99632f9..39b39a68a 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -32,7 +32,7 @@ public class LocatableRegistry implements ILocatableRegistry } public LocatableRegistry() { - set = new HashMap(); + set = new HashMap(); MinecraftForge.EVENT_BUS.register( this ); } diff --git a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java index 1bb5916fd..b36197db7 100644 --- a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java +++ b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java @@ -15,7 +15,7 @@ import appeng.spatial.DefaultSpatialHandler; public class MovableTileRegistry implements IMovableRegistry { - private HashSet blacklisted = new HashSet(); + private HashSet blacklisted = new HashSet(); private HashMap, IMovableHandler> Valid = new HashMap, IMovableHandler>(); private LinkedList> test = new LinkedList>(); @@ -137,6 +137,7 @@ public class MovableTileRegistry implements IMovableRegistry blacklisted.add( blk ); } + @Override public boolean isBlacklisted(Block blk) { return blacklisted.contains( blk ); diff --git a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java index 84a4bfb17..0a9ed1303 100644 --- a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java +++ b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java @@ -18,7 +18,7 @@ import cpw.mods.fml.common.registry.GameRegistry; public class P2PTunnelRegistry implements IP2PTunnelRegistry { - HashMap Tunnels = new HashMap(); + HashMap Tunnels = new HashMap(); public ItemStack getModItem(String modID, String Name, int meta) { diff --git a/src/main/java/appeng/core/features/registries/RegistryContainer.java b/src/main/java/appeng/core/features/registries/RegistryContainer.java index 7b38a91c4..f1c6e32a5 100644 --- a/src/main/java/appeng/core/features/registries/RegistryContainer.java +++ b/src/main/java/appeng/core/features/registries/RegistryContainer.java @@ -28,7 +28,7 @@ public class RegistryContainer implements IRegistryContainer private P2PTunnelRegistry P2PRegistry = new P2PTunnelRegistry(); private MovableTileRegistry MovableReg = new MovableTileRegistry(); private MatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry(); - private PlayerRegistry playerreg = new PlayerRegistry(); + private PlayerRegistry playerRegistry = new PlayerRegistry(); private IRecipeHandlerRegistry recipeReg = new RecipeHandlerRegistry(); @Override @@ -94,7 +94,7 @@ public class RegistryContainer implements IRegistryContainer @Override public IPlayerRegistry players() { - return playerreg; + return playerRegistry; } @Override diff --git a/src/main/java/appeng/core/features/registries/WirelessRegistry.java b/src/main/java/appeng/core/features/registries/WirelessRegistry.java index ff8af8790..1248f36f3 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRegistry.java +++ b/src/main/java/appeng/core/features/registries/WirelessRegistry.java @@ -19,7 +19,7 @@ public class WirelessRegistry implements IWirelessTermRegistry List handlers; public WirelessRegistry() { - handlers = new ArrayList(); + handlers = new ArrayList(); } @Override diff --git a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java index 53820a58b..e5d8ef67d 100644 --- a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java +++ b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java @@ -12,10 +12,10 @@ public class WorldGenRegistry implements IWorldGen private class TypeSet { - HashSet> badProviders = new HashSet(); - HashSet badDimensions = new HashSet(); + HashSet> badProviders = new HashSet>(); + HashSet badDimensions = new HashSet(); - }; + } TypeSet[] types; @@ -60,12 +60,12 @@ public class WorldGenRegistry implements IWorldGen } @Override - public void disableWorldGenForDimension(WorldGenType type, int dimid) + public void disableWorldGenForDimension(WorldGenType type, int dimensionID) { if ( type == null ) throw new IllegalArgumentException( "Bad Type Passed" ); - types[type.ordinal()].badDimensions.add( dimid ); + types[type.ordinal()].badDimensions.add( dimensionID ); } } diff --git a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java index 85776666d..020aba700 100644 --- a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java +++ b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java @@ -22,7 +22,7 @@ public class ExternalIInv implements IExternalStorageHandler @Override public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src) { - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( (IInventory) te, d ); + InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d ); if ( channel == StorageChannel.ITEMS && ad != null ) return new MEMonitorIInventory( ad ); diff --git a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java index 31f50c1bf..c19fee840 100644 --- a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java +++ b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java @@ -124,7 +124,7 @@ public class PlayerStatsRegistration /** * register */ - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); for (Achievements a : Achievements.values()) { diff --git a/src/main/java/appeng/core/stats/Stats.java b/src/main/java/appeng/core/stats/Stats.java index 29aee9728..cb119a3b0 100644 --- a/src/main/java/appeng/core/stats/Stats.java +++ b/src/main/java/appeng/core/stats/Stats.java @@ -22,7 +22,7 @@ public enum Stats { if ( stat == null ) { - stat = new StatBasic( "stat.ae2." + name(), new ChatComponentTranslation( "stat.ae2." + name(), new Object[0] ) ); + stat = new StatBasic( "stat.ae2." + name(), new ChatComponentTranslation( "stat.ae2." + name() ) ); stat.registerStat(); } diff --git a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java index 1386c0ae2..dc3b78e85 100644 --- a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java +++ b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java @@ -51,13 +51,13 @@ public class AppEngPacketHandlerBase PACKET_MULTIPART(PacketMultiPart.class), - PACKET_PARTPLACEMENT(PacketPartPlacement.class), + PACKET_PART_PLACEMENT(PacketPartPlacement.class), PACKET_LIGHTNING(PacketLightning.class), - PACKET_MATTERCANNON(PacketMatterCannon.class), + PACKET_MATTER_CANNON(PacketMatterCannon.class), - PACKET_MOCKEXPLOSION(PacketMockExplosion.class), + PACKET_MOCK_EXPLOSION(PacketMockExplosion.class), PACKET_VALUE_CONFIG(PacketValueConfig.class), @@ -127,6 +127,6 @@ public class AppEngPacketHandlerBase return AppEngPacketHandlerBase.reverseLookup.get( c ); } - }; + } } diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index 041e5b737..615e8e98e 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -128,7 +128,7 @@ public enum GuiBridge implements IGuiHandler GUI_DRIVE(ContainerDrive.class, TileDrive.class, WORLD, SecurityPermissions.BUILD), - GUI_VIBRATIONCHAMBER(ContainerVibrationChamber.class, TileVibrationChamber.class, WORLD, null), + GUI_VIBRATION_CHAMBER(ContainerVibrationChamber.class, TileVibrationChamber.class, WORLD, null), GUI_CONDENSER(ContainerCondenser.class, TileCondenser.class, WORLD, null), @@ -140,7 +140,7 @@ public enum GuiBridge implements IGuiHandler GUI_STORAGEBUS(ContainerStorageBus.class, PartStorageBus.class, WORLD, SecurityPermissions.BUILD), - GUI_FPLANE(ContainerFormationPlane.class, PartFormationPlane.class, WORLD, SecurityPermissions.BUILD), + GUI_FORMATION_PLANE(ContainerFormationPlane.class, PartFormationPlane.class, WORLD, SecurityPermissions.BUILD), GUI_PRIORITY(ContainerPriority.class, IPriorityHost.class, WORLD, SecurityPermissions.BUILD), @@ -151,13 +151,13 @@ public enum GuiBridge implements IGuiHandler GUI_PATTERN_TERMINAL(ContainerPatternTerm.class, PartPatternTerminal.class, WORLD, SecurityPermissions.CRAFT), // extends (Container/Gui) + Bus - GUI_LEVELEMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class, WORLD, SecurityPermissions.BUILD), + GUI_LEVEL_EMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class, WORLD, SecurityPermissions.BUILD), - GUI_SPATIALIOPORT(ContainerSpatialIOPort.class, TileSpatialIOPort.class, WORLD, SecurityPermissions.BUILD), + GUI_SPATIAL_IO_PORT(ContainerSpatialIOPort.class, TileSpatialIOPort.class, WORLD, SecurityPermissions.BUILD), GUI_INSCRIBER(ContainerInscriber.class, TileInscriber.class, WORLD, null), - GUI_CELLWORKBENCH(ContainerCellWorkbench.class, TileCellWorkbench.class, WORLD, null), + GUI_CELL_WORKBENCH(ContainerCellWorkbench.class, TileCellWorkbench.class, WORLD, null), GUI_MAC(ContainerMAC.class, TileMolecularAssembler.class, WORLD, null), @@ -335,9 +335,9 @@ public enum GuiBridge implements IGuiHandler { ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 ); GuiBridge ID = values()[ID_ORDINAL >> 4]; - boolean istem = ((ID_ORDINAL >> 3) & 1) == 1; + boolean stem = ((ID_ORDINAL >> 3) & 1) == 1; - if ( ID.type.isItem() && istem ) + if ( ID.type.isItem() && stem ) { ItemStack it = player.inventory.getCurrentItem(); Object myItem = getGuiObject( it, player, w, x, y, z ); @@ -387,9 +387,9 @@ public enum GuiBridge implements IGuiHandler { ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 ); GuiBridge ID = values()[ID_ORDINAL >> 4]; - boolean istem = ((ID_ORDINAL >> 3) & 1) == 1; + boolean stem = ((ID_ORDINAL >> 3) & 1) == 1; - if ( ID.type.isItem() && istem ) + if ( ID.type.isItem() && stem ) { ItemStack it = player.inventory.getCurrentItem(); Object myItem = getGuiObject( it, player, w, x, y, z ); diff --git a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java index 0b855b023..b628292f3 100644 --- a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java @@ -23,7 +23,7 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp { packetType = stream.readInt(); AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); - pack.serverPacketData( manager, pack, (EntityPlayer) player ); + pack.serverPacketData( manager, pack, player ); } catch (InstantiationException e) { diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index 15e5546a7..82ac827f7 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -49,12 +49,14 @@ public class PacketCompressedNBT extends AppEngPacket if ( stream.readableBytes() <= 0 ) return -1; - return (int) stream.readByte() & 0xff; + return stream.readByte() & 0xff; } } ); - in = CompressedStreamTools.read( new DataInputStream( gzReader ) ); + DataInputStream inStream = new DataInputStream( gzReader ); + in = CompressedStreamTools.read( inStream ); + inStream.close(); } @Override diff --git a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java index 4f416b917..010b1e9c6 100644 --- a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java +++ b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java @@ -31,10 +31,10 @@ public class PacketConfigButton extends AppEngPacket public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player) { EntityPlayerMP sender = (EntityPlayerMP) player; - AEBaseContainer aebc = (AEBaseContainer) sender.openContainer; - if ( aebc.getTarget() instanceof IConfigurableObject ) + AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; + if ( baseContainer.getTarget() instanceof IConfigurableObject ) { - IConfigManager cm = ((IConfigurableObject) aebc.getTarget()).getConfigManager(); + IConfigManager cm = ((IConfigurableObject) baseContainer.getTarget()).getConfigManager(); Enum newState = Platform.rotateEnum( cm.getSetting( option ), rotationDirection, option.getPossibleValues() ); cm.putSetting( option, newState ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java index 7281a4844..6a1be972d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java @@ -41,10 +41,10 @@ public class PacketCraftRequest extends AppEngPacket if ( player.openContainer instanceof ContainerCraftAmount ) { ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer; - Object targ = cca.getTarget(); - if ( targ instanceof IGridHost ) + Object target = cca.getTarget(); + if ( target instanceof IGridHost ) { - IGridHost gh = (IGridHost) targ; + IGridHost gh = (IGridHost) target; IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN ); if ( gn == null ) return; diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index ea0924757..146bef59d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -46,23 +46,23 @@ public class PacketInventoryAction extends AppEngPacket EntityPlayerMP sender = (EntityPlayerMP) player; if ( sender.openContainer instanceof AEBaseContainer ) { - AEBaseContainer aebc = (AEBaseContainer) sender.openContainer; - if ( action == InventoryAction.AUTOCRAFT ) + AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; + if ( action == InventoryAction.AUTO_CRAFT ) { - ContainerOpenContext context = aebc.openContext; + ContainerOpenContext context = baseContainer.openContext; if ( context != null ) { TileEntity te = context.getTile(); - Platform.openGUI( sender, te, aebc.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT ); + Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT ); if ( sender.openContainer instanceof ContainerCraftAmount ) { ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; - if ( aebc.getTargetStack() != null ) + if ( baseContainer.getTargetStack() != null ) { - cca.craftingItem.putStack( aebc.getTargetStack().getItemStack() ); - cca.whatToMake = aebc.getTargetStack(); + cca.craftingItem.putStack( baseContainer.getTargetStack().getItemStack() ); + cca.whatToMake = baseContainer.getTargetStack(); } cca.detectAndSendChanges(); @@ -71,7 +71,7 @@ public class PacketInventoryAction extends AppEngPacket } else { - aebc.doAction( sender, action, slot, id ); + baseContainer.doAction( sender, action, slot, id ); } } } diff --git a/src/main/java/appeng/core/sync/packets/PacketLightning.java b/src/main/java/appeng/core/sync/packets/PacketLightning.java index 4c2e27f3b..ae5f22ead 100644 --- a/src/main/java/appeng/core/sync/packets/PacketLightning.java +++ b/src/main/java/appeng/core/sync/packets/PacketLightning.java @@ -6,7 +6,6 @@ import io.netty.buffer.Unpooled; import java.io.IOException; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import appeng.client.ClientHelper; import appeng.client.render.effects.LightningFX; @@ -40,7 +39,7 @@ public class PacketLightning extends AppEngPacket if ( Platform.isClient() && AEConfig.instance.enableEffects ) { LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } catch (Exception err) diff --git a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java index c35f42d7b..0f638d297 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java @@ -47,7 +47,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket public PacketMEInventoryUpdate(final ByteBuf stream) throws IOException { data = null; compressFrame = null; - list = new LinkedList(); + list = new LinkedList(); ref = stream.readByte(); // int originalBytes = stream.readableBytes(); @@ -60,7 +60,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket if ( stream.readableBytes() <= 0 ) return -1; - return (int) stream.readByte() & 0xff; + return stream.readByte() & 0xff; } } ); @@ -76,7 +76,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket gzReader.close(); // int uncompressedBytes = uncompressed.readableBytes(); - // AELog.info( "Recv: " + originalBytes + " -> " + uncompressedBytes ); + // AELog.info( "Receiver: " + originalBytes + " -> " + uncompressedBytes ); while (uncompressed.readableBytes() > 0) list.add( AEItemStack.loadItemStackFromPacket( uncompressed ) ); diff --git a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java index 993994d85..fdb0f9556 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java +++ b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java @@ -6,7 +6,6 @@ import io.netty.buffer.Unpooled; import java.io.IOException; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.world.World; @@ -51,7 +50,7 @@ public class PacketMatterCannon extends AppEngPacket { MatterCannonFX fx = new MatterCannonFX( world, x + dx * a, y + dy * a, z + dz * a, Items.diamond ); - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } catch (Exception err) diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java index bf81588bb..9ded4cb71 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java @@ -108,8 +108,8 @@ public class PacketNEIRecipe extends AppEngPacket if ( is != null ) { - IMEMonitor stor = inv.getItemInventory(); - IItemList all = stor.getStorageList(); + IMEMonitor storage = inv.getItemInventory(); + IItemList all = storage.getStorageList(); IPartitionList filter = ItemViewCell.createFilter( cct.getViewCells() ); for (int x = 0; x < craftMatrix.getSizeInventory(); x++) @@ -120,15 +120,15 @@ public class PacketNEIRecipe extends AppEngPacket if ( currentItem != null ) { ic.setInventorySlotContents( x, currentItem ); - ItemStack newis = r.matches( ic, pmp.worldObj ) ? r.getCraftingResult( ic ) : null; + ItemStack newItemStack = r.matches( ic, pmp.worldObj ) ? r.getCraftingResult( ic ) : null; ic.setInventorySlotContents( x, PatternItem ); - if ( newis == null || !Platform.isSameItemPrecise( newis, is ) ) + if ( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) ) { IAEItemStack in = AEItemStack.create( currentItem ); if ( in != null ) { - IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, stor, in, + IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() ); if ( out != null ) craftMatrix.setInventorySlotContents( x, out.getItemStack() ); @@ -142,7 +142,7 @@ public class PacketNEIRecipe extends AppEngPacket if ( PatternItem != null && currentItem == null ) { - ItemStack whichItem = Platform.extractItemsByRecipe( energy, cct.getSource(), stor, player.worldObj, r, is, ic, + ItemStack whichItem = Platform.extractItemsByRecipe( energy, cct.getSource(), storage, player.worldObj, r, is, ic, PatternItem, x, all, realForFake, filter ); if ( whichItem == null ) @@ -155,7 +155,7 @@ public class PacketNEIRecipe extends AppEngPacket if ( filter == null || filter.isListed( request ) ) { request.setStackSize( 1 ); - IAEItemStack out = Platform.poweredExtraction( energy, stor, request, cct.getSource() ); + IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() ); if ( out != null ) { whichItem = out.getItemStack(); @@ -183,11 +183,11 @@ public class PacketNEIRecipe extends AppEngPacket ByteBuf data = Unpooled.buffer(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream datao = new DataOutputStream( bytes ); + DataOutputStream outputStream = new DataOutputStream( bytes ); data.writeInt( getPacketID() ); - CompressedStreamTools.writeCompressed( recipe, datao ); + CompressedStreamTools.writeCompressed( recipe, outputStream ); data.writeBytes( bytes.toByteArray() ); configureWrite( data ); diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index b26bea248..a2ad4d7be 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -51,8 +51,8 @@ public class PacketPatternSlot extends AppEngPacket EntityPlayerMP sender = (EntityPlayerMP) player; if ( sender.openContainer instanceof ContainerPatternTerm ) { - ContainerPatternTerm aebc = (ContainerPatternTerm) sender.openContainer; - aebc.craftOrGetItem( this ); + ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; + patternTerminal.craftOrGetItem( this ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java index 75d5d689c..6353ec0ee 100644 --- a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java +++ b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java @@ -8,7 +8,6 @@ import java.io.IOException; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.util.ResourceLocation; @@ -61,7 +60,7 @@ public class PacketTransitionEffect extends AppEngPacket fx.motionY = -0.1 * d.offsetY; fx.motionZ = -0.1 * d.offsetZ; - Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } if ( mode ) diff --git a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java index fb4ffba83..2d74eaad0 100644 --- a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java +++ b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java @@ -58,55 +58,46 @@ public class PacketValueConfig extends AppEngPacket ItemStack is = player.getHeldItem(); IMouseWheelItem si = (IMouseWheelItem) is.getItem(); si.onWheel( is, Value.equals( "WheelUp" ) ); - return; } else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus ) { ContainerCraftingStatus qk = (ContainerCraftingStatus) c; qk.cycleCpu( Value.equals( "Next" ) ); - return; } else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm ) { ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.cycleCpu( Value.equals( "Next" ) ); - return; } else if ( Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm ) { ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.startJob(); - return; } else if ( Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU ) { ContainerCraftingCPU qk = (ContainerCraftingCPU) c; qk.cancelCrafting(); - return; } else if ( Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife ) { ContainerQuartzKnife qk = (ContainerQuartzKnife) c; qk.setName( Value ); - return; } else if ( Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity ) { ContainerSecurity sc = (ContainerSecurity) c; sc.toggleSetting( Value, player ); - return; } else if ( Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority ) { ContainerPriority pc = (ContainerPriority) c; pc.setPriority( Integer.parseInt( Value ), player ); - return; } else if ( Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter ) { ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; lvc.setLevel( Long.parseLong( Value ), player ); - return; } else if ( Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm ) { @@ -213,7 +204,6 @@ public class PacketValueConfig extends AppEngPacket GuiScreen gs = Minecraft.getMinecraft().currentScreen; if ( gs instanceof GuiCraftingCPU ) ((GuiCraftingCPU) gs).clearItems(); - return; } else if ( c instanceof IConfigurableObject ) { diff --git a/src/main/java/appeng/crafting/CraftingJob.java b/src/main/java/appeng/crafting/CraftingJob.java index 28b8773d2..04d1b0b43 100644 --- a/src/main/java/appeng/crafting/CraftingJob.java +++ b/src/main/java/appeng/crafting/CraftingJob.java @@ -42,6 +42,7 @@ public class CraftingJob implements Runnable, ICraftingJob long bytes = 0; World world; + @Override public IAEItemStack getOutput() { return output; @@ -51,7 +52,7 @@ public class CraftingJob implements Runnable, ICraftingJob { world = wrapWorld( w ); storage = AEApi.instance().storage().createItemList(); - prophecies = new HashSet(); + prophecies = new HashSet(); original = null; availableCheck = null; } @@ -71,7 +72,7 @@ public class CraftingJob implements Runnable, ICraftingJob world = wrapWorld( w ); output = what.copy(); storage = AEApi.instance().storage().createItemList(); - prophecies = new HashSet(); + prophecies = new HashSet(); this.actionSrc = actionSrc; this.callback = callback; @@ -93,6 +94,7 @@ public class CraftingJob implements Runnable, ICraftingJob return new CraftingTreeNode( cc, this, what, null, -1, 0 ); } + @Override public long getByteTotal() { return bytes; @@ -127,9 +129,9 @@ public class CraftingJob implements Runnable, ICraftingJob public long perOp = 0; public long times = 0; - }; + } - HashMap opsAndMultiplier = new HashMap(); + HashMap opsAndMultiplier = new HashMap(); @Override public void run() @@ -139,15 +141,15 @@ public class CraftingJob implements Runnable, ICraftingJob try { TickHandler.instance.registerCraftingSimulation( world, this ); - handlepausing(); + handlePausing(); Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory meci = new MECraftingInventory( original, true, false, true ); - meci.ignore( output ); + MECraftingInventory craftingInventory = new MECraftingInventory( original, true, false, true ); + craftingInventory.ignore( output ); availableCheck = new MECraftingInventory( original, false, false, false ); - tree.request( meci, output.getStackSize(), actionSrc ); + tree.request( craftingInventory, output.getStackSize(), actionSrc ); tree.dive( this ); for (String s : opsAndMultiplier.keySet()) @@ -158,7 +160,7 @@ public class CraftingJob implements Runnable, ICraftingJob AELog.crafting( "------------- " + getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); // if ( mode == Actionable.MODULATE ) - // meci.moveItemsToStorage( storage ); + // craftingInventory.moveItemsToStorage( storage ); } catch (CraftBranchFailure e) { @@ -167,13 +169,13 @@ public class CraftingJob implements Runnable, ICraftingJob try { Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory meci = new MECraftingInventory( original, true, false, true ); - meci.ignore( output ); + MECraftingInventory craftingInventory = new MECraftingInventory( original, true, false, true ); + craftingInventory.ignore( output ); availableCheck = new MECraftingInventory( original, false, false, false ); tree.setSimulate(); - tree.request( meci, output.getStackSize(), actionSrc ); + tree.request( craftingInventory, output.getStackSize(), actionSrc ); tree.dive( this ); for (String s : opsAndMultiplier.keySet()) @@ -237,6 +239,7 @@ public class CraftingJob implements Runnable, ICraftingJob } } + @Override public boolean isSimulation() { return simulate; @@ -300,7 +303,7 @@ public class CraftingJob implements Runnable, ICraftingJob private int incTime = Integer.MAX_VALUE; - public void handlepausing() throws InterruptedException + public void handlePausing() throws InterruptedException { if ( incTime++ > 100 ) { diff --git a/src/main/java/appeng/crafting/CraftingTreeNode.java b/src/main/java/appeng/crafting/CraftingTreeNode.java index 864c92316..31b46e5c2 100644 --- a/src/main/java/appeng/crafting/CraftingTreeNode.java +++ b/src/main/java/appeng/crafting/CraftingTreeNode.java @@ -30,7 +30,7 @@ public class CraftingTreeNode private IAEItemStack what; // what are the crafting patterns for this? - private ArrayList nodes = new ArrayList(); + private ArrayList nodes = new ArrayList(); boolean canEmit = false; boolean cannotUse = false; @@ -93,9 +93,9 @@ public class CraftingTreeNode public IAEItemStack request(MECraftingInventory inv, long l, BaseActionSource src) throws CraftBranchFailure, InterruptedException { - job.handlepausing(); + job.handlePausing(); - List thingsUsed = new LinkedList(); + List thingsUsed = new LinkedList(); what.setStackSize( l ); if ( slot >= 0 && parent != null && parent.details.isCraftable() ) diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index 52c89a95e..2499ad926 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -31,12 +31,12 @@ public class CraftingTreeProcess long crafts = 0; boolean containerItems; boolean limitQty; - boolean fullsimulation; + boolean fullSimulation; private long bytes = 0; final private int depth; - Map nodes = new HashMap(); + Map nodes = new HashMap(); public boolean possible = true; public CraftingTreeProcess(ICraftingGrid cc, CraftingJob job, ICraftingPatternDetails details, CraftingTreeNode craftingTreeNode, int depth, World world) { @@ -61,7 +61,7 @@ public class CraftingTreeProcess { ItemStack g = ic.getStackInSlot( x ); if ( g != null && g.stackSize > 1 ) - fullsimulation = true; + fullSimulation = true; } for ( IAEItemStack part : details.getCondensedInputs() ) @@ -100,8 +100,8 @@ public class CraftingTreeProcess { for (int x = 0; x < list.length; x++) { - IAEItemStack ppart = list[x]; - if ( part != null && part.equals( ppart ) ) + IAEItemStack comparePart = list[x]; + if ( part != null && part.equals( comparePart ) ) { // use the first slot... nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); @@ -142,7 +142,7 @@ public class CraftingTreeProcess long getTimes(long remaining, long stackSize) { - if ( limitQty || fullsimulation ) + if ( limitQty || fullSimulation ) return 1; return (remaining / stackSize) + (remaining % stackSize != 0 ? 1 : 0); } @@ -175,9 +175,9 @@ public class CraftingTreeProcess public void request(MECraftingInventory inv, long i, BaseActionSource src) throws CraftBranchFailure, InterruptedException { - job.handlepausing(); + job.handlePausing(); - if ( fullsimulation ) + if ( fullSimulation ) { InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 1acbb0556..546a3981b 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -46,20 +46,20 @@ public class CraftingWatcher implements ICraftingWatcher interestIterator.remove(); } - }; + } CraftingGridCache gsc; - ICraftingWatcherHost myObject; - HashSet myInterests = new HashSet(); + ICraftingWatcherHost host; + HashSet myInterests = new HashSet(); public CraftingWatcher(CraftingGridCache cache, ICraftingWatcherHost host) { gsc = cache; - myObject = host; + this.host = host; } public ICraftingWatcherHost getHost() { - return myObject; + return host; } @Override diff --git a/src/main/java/appeng/debug/TileItemGen.java b/src/main/java/appeng/debug/TileItemGen.java index 8e0c0664b..f5dc6ff39 100644 --- a/src/main/java/appeng/debug/TileItemGen.java +++ b/src/main/java/appeng/debug/TileItemGen.java @@ -14,7 +14,7 @@ import appeng.tile.AEBaseTile; public class TileItemGen extends AEBaseTile implements IInventory { - public static Queue possibleItems = new LinkedList(); + public static Queue possibleItems = new LinkedList(); public TileItemGen() { if ( possibleItems.isEmpty() ) diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index 77ec1e8fd..02874865d 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -39,10 +39,10 @@ public class ToolDebugCard extends AEBaseItem public String timeMeasurement(long nanos) { - long ms = (long) (nanos / 100000); + long ms = nanos / 100000; if ( nanos <= 100000 ) return nanos + "ns"; - return (((float) ms) / 10.0f) + "ms"; + return (ms / 10.0f) + "ms"; } @Override @@ -84,7 +84,7 @@ public class ToolDebugCard extends AEBaseItem { int length = 0; - HashSet next = new HashSet(); + HashSet next = new HashSet(); next.add( node ); int maxLength = 10000; @@ -92,7 +92,7 @@ public class ToolDebugCard extends AEBaseItem outer: while ( ! next.isEmpty() ) { HashSet current = next; - next = new HashSet(); + next = new HashSet(); for ( IGridNode n : current ) { @@ -117,7 +117,7 @@ public class ToolDebugCard extends AEBaseItem outputMsg( player, "Freq: " + ((PartP2PTunnel) center.getMachine()).freq ); } - TickManagerCache tmc = (TickManagerCache) g.getCache( ITickManager.class ); + TickManagerCache tmc = g.getCache( ITickManager.class ); for (Class c : g.getMachineClasses()) { int o = 0; @@ -168,7 +168,7 @@ public class ToolDebugCard extends AEBaseItem if ( te instanceof IGridHost ) { - IGridNode node = (IGridNode) ((IGridHost) te).getGridNode( ForgeDirection.getOrientation( side ) ); + IGridNode node = ((IGridHost) te).getGridNode( ForgeDirection.getOrientation( side ) ); if ( node != null && node.getGrid() != null ) { IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class ); diff --git a/src/main/java/appeng/debug/ToolEraser.java b/src/main/java/appeng/debug/ToolEraser.java index 9dcdda791..8820e50de 100644 --- a/src/main/java/appeng/debug/ToolEraser.java +++ b/src/main/java/appeng/debug/ToolEraser.java @@ -34,14 +34,14 @@ public class ToolEraser extends AEBaseItem int meta = world.getBlockMetadata( x, y, z ); int blocks = 0; - List next = new LinkedList(); + List next = new LinkedList(); next.add( new WorldCoord( x, y, z ) ); while (blocks < 90000 && !next.isEmpty()) { List c = next; - next = new LinkedList(); + next = new LinkedList(); for (WorldCoord wc : c) { diff --git a/src/main/java/appeng/entity/EntityChargedQuartz.java b/src/main/java/appeng/entity/EntityChargedQuartz.java index 550804f11..32277ecec 100644 --- a/src/main/java/appeng/entity/EntityChargedQuartz.java +++ b/src/main/java/appeng/entity/EntityChargedQuartz.java @@ -62,7 +62,7 @@ final public class EntityChargedQuartz extends EntityItem } else transformTime = 0; - }; + } public boolean transform() { @@ -106,7 +106,7 @@ final public class EntityChargedQuartz extends EntityItem if ( netherQuartz.getEntityItem().stackSize <= 0 ) netherQuartz.setDead(); - List i = new ArrayList(); + List i = new ArrayList(); i.add( AEApi.instance().materials().materialFluixCrystal.stack( 1 ) ); ItemStack Output = AEApi.instance().materials().materialFluixCrystal.stack( 2 ); diff --git a/src/main/java/appeng/entity/EntityFloatingItem.java b/src/main/java/appeng/entity/EntityFloatingItem.java index 705f42849..afc0435fa 100644 --- a/src/main/java/appeng/entity/EntityFloatingItem.java +++ b/src/main/java/appeng/entity/EntityFloatingItem.java @@ -24,6 +24,7 @@ final public class EntityFloatingItem extends EntityItem // public boolean isEntityAlive() + @Override public void onUpdate() { if ( !isDead && parent.isDead ) diff --git a/src/main/java/appeng/entity/EntityGrowingCrystal.java b/src/main/java/appeng/entity/EntityGrowingCrystal.java index e80c65a61..1761d3a25 100644 --- a/src/main/java/appeng/entity/EntityGrowingCrystal.java +++ b/src/main/java/appeng/entity/EntityGrowingCrystal.java @@ -23,7 +23,7 @@ final public class EntityGrowingCrystal extends EntityItem public float getProgress() { - return (float) progress_1000 / 1000.0f; + return progress_1000 / 1000.0f; } public EntityGrowingCrystal(World w) { @@ -101,7 +101,6 @@ final public class EntityGrowingCrystal extends EntityItem progress_1000 = 0; CommonHelper.proxy.spawnEffect( EffectType.Vibrant, worldObj, posX, posY + 0.2, posZ, null ); } - return; } else { @@ -121,28 +120,28 @@ final public class EntityGrowingCrystal extends EntityItem int qty = 0; - if ( isAccel( x + 1, y, z ) ) + if ( isAccelerated( x + 1, y, z ) ) qty += per + qty * mul; - if ( isAccel( x, y + 1, z ) ) + if ( isAccelerated( x, y + 1, z ) ) qty += per + qty * mul; - if ( isAccel( x, y, z + 1 ) ) + if ( isAccelerated( x, y, z + 1 ) ) qty += per + qty * mul; - if ( isAccel( x - 1, y, z ) ) + if ( isAccelerated( x - 1, y, z ) ) qty += per + qty * mul; - if ( isAccel( x, y - 1, z ) ) + if ( isAccelerated( x, y - 1, z ) ) qty += per + qty * mul; - if ( isAccel( x, y, z - 1 ) ) + if ( isAccelerated( x, y, z - 1 ) ) qty += per + qty * mul; return qty; } - private boolean isAccel(int x, int y, int z) + private boolean isAccelerated(int x, int y, int z) { TileEntity te = worldObj.getTileEntity( x, y, z ); if ( te instanceof ICrystalGrowthAccelerator ) diff --git a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java index 8fecfe5cd..0b8d93f98 100644 --- a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java @@ -30,8 +30,8 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit this.setSize( 0.35F, 0.35F ); } - public EntityTinyTNTPrimed(World w, double x, double y, double z, EntityLivingBase ignitor) { - super( w, x, y, z, ignitor ); + public EntityTinyTNTPrimed(World w, double x, double y, double z, EntityLivingBase igniter) { + super( w, x, y, z, igniter ); this.setSize( 0.55F, 0.55F ); this.yOffset = this.height / 2.0F; } diff --git a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java index b83325ea9..52a67112d 100644 --- a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java @@ -30,9 +30,9 @@ public class RenderTinyTNTPrimed extends Render GL11.glTranslatef( (float) x, (float) y - 0.25f, (float) z ); float f2; - if ( (float) tnt.fuse - life + 1.0F < 10.0F ) + if ( tnt.fuse - life + 1.0F < 10.0F ) { - f2 = 1.0F - ((float) tnt.fuse - life + 1.0F) / 10.0F; + f2 = 1.0F - (tnt.fuse - life + 1.0F) / 10.0F; if ( f2 < 0.0F ) { @@ -51,7 +51,7 @@ public class RenderTinyTNTPrimed extends Render } GL11.glScalef( 0.5f, 0.5f, 0.5f ); - f2 = (1.0F - ((float) tnt.fuse - life + 1.0F) / 100.0F) * 0.8F; + f2 = (1.0F - (tnt.fuse - life + 1.0F) / 100.0F) * 0.8F; this.bindEntityTexture( tnt ); this.blockRenderer.renderBlockAsItem( Blocks.tnt, 0, tnt.getBrightness( life ) ); diff --git a/src/main/java/appeng/facade/FacadeContainer.java b/src/main/java/appeng/facade/FacadeContainer.java index 58c6dc42c..89bdb4597 100644 --- a/src/main/java/appeng/facade/FacadeContainer.java +++ b/src/main/java/appeng/facade/FacadeContainer.java @@ -29,6 +29,7 @@ public class FacadeContainer implements IFacadeContainer storage = cbs; } + @Override public void writeToStream(ByteBuf out) throws IOException { int facadeSides = 0; @@ -52,6 +53,7 @@ public class FacadeContainer implements IFacadeContainer } } + @Override public boolean readFromStream(ByteBuf out) throws IOException { int facadeSides = out.readByte(); @@ -79,7 +81,7 @@ public class FacadeContainer implements IFacadeContainer else if ( !isBC ) { ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item(); - ItemStack facade = ifa.createFromInts( ids ); + ItemStack facade = ifa.createFromIDs( ids ); if ( facade != null ) { changed = changed || storage.getFacade( x ) == null; @@ -97,6 +99,7 @@ public class FacadeContainer implements IFacadeContainer return changed; } + @Override public void readFromNBT(NBTTagCompound c) { for (int x = 0; x < facades; x++) @@ -126,6 +129,7 @@ public class FacadeContainer implements IFacadeContainer } } + @Override public void writeToNBT(NBTTagCompound c) { for (int x = 0; x < facades; x++) @@ -170,6 +174,7 @@ public class FacadeContainer implements IFacadeContainer return storage.getFacade( s.ordinal() ); } + @Override public boolean isEmpty() { for (int x = 0; x < facades; x++) @@ -178,20 +183,21 @@ public class FacadeContainer implements IFacadeContainer return true; } + @Override public void rotateLeft() { - IFacadePart newfacades[] = new FacadePart[6]; + IFacadePart newFacades[] = new FacadePart[6]; - newfacades[ForgeDirection.UP.ordinal()] = storage.getFacade( ForgeDirection.UP.ordinal() ); - newfacades[ForgeDirection.DOWN.ordinal()] = storage.getFacade( ForgeDirection.DOWN.ordinal() ); + newFacades[ForgeDirection.UP.ordinal()] = storage.getFacade( ForgeDirection.UP.ordinal() ); + newFacades[ForgeDirection.DOWN.ordinal()] = storage.getFacade( ForgeDirection.DOWN.ordinal() ); - newfacades[ForgeDirection.EAST.ordinal()] = storage.getFacade( ForgeDirection.NORTH.ordinal() ); - newfacades[ForgeDirection.SOUTH.ordinal()] = storage.getFacade( ForgeDirection.EAST.ordinal() ); + newFacades[ForgeDirection.EAST.ordinal()] = storage.getFacade( ForgeDirection.NORTH.ordinal() ); + newFacades[ForgeDirection.SOUTH.ordinal()] = storage.getFacade( ForgeDirection.EAST.ordinal() ); - newfacades[ForgeDirection.WEST.ordinal()] = storage.getFacade( ForgeDirection.SOUTH.ordinal() ); - newfacades[ForgeDirection.NORTH.ordinal()] = storage.getFacade( ForgeDirection.WEST.ordinal() ); + newFacades[ForgeDirection.WEST.ordinal()] = storage.getFacade( ForgeDirection.SOUTH.ordinal() ); + newFacades[ForgeDirection.NORTH.ordinal()] = storage.getFacade( ForgeDirection.WEST.ordinal() ); for (int x = 0; x < facades; x++) - storage.setFacade( x, newfacades[x] ); + storage.setFacade( x, newFacades[x] ); } } diff --git a/src/main/java/appeng/facade/FacadePart.java b/src/main/java/appeng/facade/FacadePart.java index c0dbca5a4..4921b0723 100644 --- a/src/main/java/appeng/facade/FacadePart.java +++ b/src/main/java/appeng/facade/FacadePart.java @@ -311,8 +311,6 @@ public class FacadePart implements IFacadePart, IBoxProvider instance.renderForPass( 0 ); instance.setTexture( null ); Tessellator.instance.setColorOpaque_F( 1, 1, 1 ); - - return; } } } @@ -321,8 +319,6 @@ public class FacadePart implements IFacadePart, IBoxProvider AELog.error( t ); } - - return; } } @@ -485,8 +481,6 @@ public class FacadePart implements IFacadePart, IBoxProvider instance.renderInventoryBox( renderer ); instance.setTexture( null ); - - return; } } } @@ -494,8 +488,6 @@ public class FacadePart implements IFacadePart, IBoxProvider { } - - return; } } diff --git a/src/main/java/appeng/fmp/CableBusPart.java b/src/main/java/appeng/fmp/CableBusPart.java index 1b0d9b5ac..40ab069eb 100644 --- a/src/main/java/appeng/fmp/CableBusPart.java +++ b/src/main/java/appeng/fmp/CableBusPart.java @@ -154,8 +154,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { if ( len > 0 ) { - ByteBuf bybuff = Unpooled.wrappedBuffer( data ); - cb.readFromStream( bybuff ); + ByteBuf byteBuffer = Unpooled.wrappedBuffer( data ); + cb.readFromStream( byteBuffer ); } } catch (IOException e) @@ -169,7 +169,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { AxisAlignedBB b = null; - for (AxisAlignedBB bx : cb.getSelectedBoundingBoxsFromPool( false, true, null, true )) + for (AxisAlignedBB bx : cb.getSelectedBoundingBoxesFromPool( false, true, null, true )) { if ( b == null ) b = bx; @@ -243,7 +243,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { canUpdate = false; cb.removeFromWorld(); - }; + } @Override public boolean canConnectRedstone(int side) @@ -314,7 +314,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds { if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) ) { - List boxes = new ArrayList(); + List boxes = new ArrayList(); IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); fp.getBoxes( bch, null ); for (AxisAlignedBB bb : boxes) @@ -341,7 +341,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds IPart bp = bi.createPartFromItemStack( is ); if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) ) { - List boxes = new ArrayList(); + List boxes = new ArrayList(); IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); bp.getBoxes( bch ); for (AxisAlignedBB bb : boxes) @@ -403,16 +403,16 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds } @Override - public boolean occlusionTest(TMultiPart npart) + public boolean occlusionTest(TMultiPart part) { - return NormalOcclusionTest.apply( this, npart ); + return NormalOcclusionTest.apply( this, part ); } @Override public Iterable getCollisionBoxes() { - LinkedList l = new LinkedList(); - for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( false, true, null, false )) + LinkedList l = new LinkedList(); + for (AxisAlignedBB b : cb.getSelectedBoundingBoxesFromPool( false, true, null, false )) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -423,7 +423,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public Iterable getSubParts() { - LinkedList l = new LinkedList(); + LinkedList l = new LinkedList(); for (Cuboid6 c : getCollisionBoxes()) { l.add( new IndexedCuboid6( 0, c ) ); @@ -434,8 +434,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds @Override public Iterable getOcclusionBoxes() { - LinkedList l = new LinkedList(); - for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( true, disableFacadeOcclusion.get() == null, null, true )) + LinkedList l = new LinkedList(); + for (AxisAlignedBB b : cb.getSelectedBoundingBoxesFromPool( true, disableFacadeOcclusion.get() == null, null, true )) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -543,7 +543,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds ForgeDirection dir = ForgeDirection.getOrientation( side ); if ( cable != null && cable.isConnected( dir ) ) { - List boxes = new ArrayList(); + List boxes = new ArrayList(); BusCollisionHelper bch = new BusCollisionHelper( boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true ); diff --git a/src/main/java/appeng/fmp/FMPPlacementHelper.java b/src/main/java/appeng/fmp/FMPPlacementHelper.java index 6e3d26b31..3e32bfdbb 100644 --- a/src/main/java/appeng/fmp/FMPPlacementHelper.java +++ b/src/main/java/appeng/fmp/FMPPlacementHelper.java @@ -41,7 +41,7 @@ public class FMPPlacementHelper implements IPartHost } - }; + } final private static CableBusStorage nullStorage = new NullStorage(); diff --git a/src/main/java/appeng/helpers/AEGlassMaterial.java b/src/main/java/appeng/helpers/AEGlassMaterial.java index 8129f6986..448da8582 100644 --- a/src/main/java/appeng/helpers/AEGlassMaterial.java +++ b/src/main/java/appeng/helpers/AEGlassMaterial.java @@ -10,6 +10,7 @@ public class AEGlassMaterial extends Material super( p_i2116_1_ ); } + @Override public boolean isOpaque() { return false; diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index 4c4d8e999..fe553dc87 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -58,7 +58,7 @@ import appeng.core.settings.TickRates; import appeng.me.GridAccessException; import appeng.me.helpers.AENetworkProxy; import appeng.me.storage.MEMonitorIInventory; -import appeng.me.storage.MEMonitorPassthu; +import appeng.me.storage.MEMonitorPassThrough; import appeng.me.storage.NullInventory; import appeng.parts.automation.UpgradeInventory; import appeng.tile.inventory.AppEngInternalAEInventory; @@ -169,7 +169,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt if ( details != null ) { if ( craftingList == null ) - craftingList = new LinkedList(); + craftingList = new LinkedList(); craftingList.add( details ); } @@ -182,7 +182,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return; if ( waitingToSend == null ) - waitingToSend = new LinkedList(); + waitingToSend = new LinkedList(); waitingToSend.add( is ); @@ -196,8 +196,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt } } - public DualityInterface(AENetworkProxy prox, IInterfaceHost ih) { - gridProxy = prox; + public DualityInterface(AENetworkProxy networkProxy, IInterfaceHost ih) { + gridProxy = networkProxy; gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); upgrades = new UpgradeInventory( gridProxy.getMachineRepresentation(), this, 1 ); @@ -250,7 +250,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt } } - notifyNeightbors(); + notifyNeighbors(); } public void writeToNBT(NBTTagCompound data) @@ -364,7 +364,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return; } } - else if ( Stored != null ) // dispose! + else // Stored != null; dispose! { IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); requireWork[slot] = work.setStackSize( -work.getStackSize() ); @@ -405,7 +405,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return super.extractItems( request, type, src ); } - }; + } private boolean usePlan(int x, IAEItemStack itemStack) { @@ -513,8 +513,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return patterns; } - MEMonitorPassthu items = new MEMonitorPassthu( new NullInventory(), StorageChannel.ITEMS ); - MEMonitorPassthu fluids = new MEMonitorPassthu( new NullInventory(), StorageChannel.FLUIDS ); + MEMonitorPassThrough items = new MEMonitorPassThrough( new NullInventory(), StorageChannel.ITEMS ); + MEMonitorPassThrough fluids = new MEMonitorPassThrough( new NullInventory(), StorageChannel.FLUIDS ); public void gridChanged() { @@ -525,11 +525,11 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt } catch (GridAccessException gae) { - items.setInternal( new NullInventory() ); - fluids.setInternal( new NullInventory() ); + items.setInternal( new NullInventory() ); + fluids.setInternal( new NullInventory() ); } - notifyNeightbors(); + notifyNeighbors(); } public AECableType getCableConnectionType(ForgeDirection dir) @@ -690,6 +690,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return (IPart) (iHost instanceof IPart ? iHost : null); } + @Override public appeng.api.util.IConfigManager getConfigManager() { return cm; @@ -936,7 +937,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt drops.add( is ); } - public void notifyNeightbors() + public void notifyNeighbors() { if ( gridProxy.isActive() ) { @@ -996,7 +997,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt craftingTracker.jobStateChange( link ); } - static final Set badBlocks = new HashSet(); + static final Set badBlocks = new HashSet(); public String getTermName() { @@ -1009,7 +1010,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt EnumSet possibleDirections = iHost.getTargets(); for (ForgeDirection s : possibleDirections) { - Vec3 from = Vec3.createVectorHelper( (double) tile.xCoord + 0.5, (double) tile.yCoord + 0.5, (double) tile.zCoord + 0.5 ); + Vec3 from = Vec3.createVectorHelper( tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5 ); from = from.addVector( s.offsetX * 0.501, s.offsetY * 0.501, s.offsetZ * 0.501 ); Vec3 to = from.addVector( s.offsetX, s.offsetY, s.offsetZ ); diff --git a/src/main/java/appeng/helpers/InventoryAction.java b/src/main/java/appeng/helpers/InventoryAction.java index 26e689e08..09a1f82b5 100644 --- a/src/main/java/appeng/helpers/InventoryAction.java +++ b/src/main/java/appeng/helpers/InventoryAction.java @@ -3,11 +3,11 @@ package appeng.helpers; public enum InventoryAction { // standard vanilla mechanics. - PICKUP_OR_SETDOWN, SPLIT_OR_PLACESINGLE, CREATIVE_DUPLICATE, SHIFT_CLICK, + PICKUP_OR_SET_DOWN, SPLIT_OR_PLACE_SINGLE, CREATIVE_DUPLICATE, SHIFT_CLICK, // crafting term CRAFT_STACK, CRAFT_ITEM, CRAFT_SHIFT, // extra... - MOVE_REGION, PICKUP_SINGLE, UPDATE_HAND, ROLLUP, ROLLDOWN, AUTOCRAFT, PLACE_SINGLE + MOVE_REGION, PICKUP_SINGLE, UPDATE_HAND, ROLL_UP, ROLL_DOWN, AUTO_CRAFT, PLACE_SINGLE } diff --git a/src/main/java/appeng/helpers/MeteoritePlacer.java b/src/main/java/appeng/helpers/MeteoritePlacer.java index 65a5c1b4c..d6f101bfc 100644 --- a/src/main/java/appeng/helpers/MeteoritePlacer.java +++ b/src/main/java/appeng/helpers/MeteoritePlacer.java @@ -30,7 +30,7 @@ public class MeteoritePlacer private class Fallout { - public int adjustCrator() + public int adjustCrater() { return 0; } @@ -65,7 +65,7 @@ public class MeteoritePlacer put( w, x, y, z, Platform.air ); } - }; + } private class FalloutCopy extends Fallout { @@ -83,6 +83,7 @@ public class MeteoritePlacer } + @Override public void getRandomFall(IMeteoriteWorld w, int x, int y, int z) { double a = Math.random(); @@ -92,6 +93,7 @@ public class MeteoritePlacer getOther( w, x, y, z, a ); } + @Override public void getRandomInset(IMeteoriteWorld w, int x, int y, int z) { double a = Math.random(); @@ -102,7 +104,7 @@ public class MeteoritePlacer else getOther( w, x, y, z, a - 0.1 ); } - }; + } private class FalloutSand extends FalloutCopy { @@ -111,18 +113,20 @@ public class MeteoritePlacer super( w, x, y, z ); } - public int adjustCrator() + @Override + public int adjustCrater() { return 2; } + @Override public void getOther(IMeteoriteWorld w, int x, int y, int z, double a) { if ( a > 0.66 ) put( w, x, y, z, Blocks.glass ); } - }; + } private class FalloutSnow extends FalloutCopy { @@ -131,11 +135,13 @@ public class MeteoritePlacer super( w, x, y, z ); } - public int adjustCrator() + @Override + public int adjustCrater() { return 2; } + @Override public void getOther(IMeteoriteWorld w, int x, int y, int z, double a) { if ( a > 0.7 ) @@ -144,7 +150,7 @@ public class MeteoritePlacer put( w, x, y, z, Blocks.ice ); } - }; + } public interface IMeteoriteWorld { @@ -175,7 +181,7 @@ public class MeteoritePlacer void done(); - }; + } static public class StandardWorld implements IMeteoriteWorld { @@ -369,11 +375,11 @@ public class MeteoritePlacer { return Math.min( in, (cz + 1) << 4 ); } - }; + } int minBLocks = 200; - HashSet validSpawn = new HashSet(); - HashSet invalidSpawn = new HashSet(); + HashSet validSpawn = new HashSet(); + HashSet invalidSpawn = new HashSet(); Fallout type = new Fallout(); @@ -381,10 +387,10 @@ public class MeteoritePlacer Block skychest; double real_sizeOfMeteorite = (Math.random() * 6.0) + 2; - double real_crator = real_sizeOfMeteorite * 2 + 5; + double realCrater = real_sizeOfMeteorite * 2 + 5; double sizeOfMeteorite = real_sizeOfMeteorite * real_sizeOfMeteorite; - double crator = real_crator * real_crator; + double crater = realCrater * realCrater; public MeteoritePlacer() { @@ -431,9 +437,9 @@ public class MeteoritePlacer int z = settings.getInteger( "z" ); real_sizeOfMeteorite = settings.getDouble( "real_sizeOfMeteorite" ); - real_crator = settings.getDouble( "real_crator" ); + realCrater = settings.getDouble( "realCrater" ); sizeOfMeteorite = settings.getDouble( "sizeOfMeteorite" ); - crator = settings.getDouble( "crator" ); + crater = settings.getDouble( "crater" ); Block blk = Block.getBlockById( settings.getInteger( "blk" ) ); @@ -448,7 +454,7 @@ public class MeteoritePlacer // creator if ( skyMode > 10 ) - placeCrator( w, x, y, z ); + placeCrater( w, x, y, z ); placeMeteorite( w, x, y, z ); @@ -486,9 +492,9 @@ public class MeteoritePlacer settings.setInteger( "blk", Block.getIdFromBlock( blk ) ); settings.setDouble( "real_sizeOfMeteorite", real_sizeOfMeteorite ); - settings.setDouble( "real_crator", real_crator ); + settings.setDouble( "realCrater", realCrater ); settings.setDouble( "sizeOfMeteorite", sizeOfMeteorite ); - settings.setDouble( "crator", crator ); + settings.setDouble( "crater", crater ); settings.setBoolean( "lava", Math.random() > 0.9 ); @@ -547,7 +553,7 @@ public class MeteoritePlacer // creator if ( skyMode > 10 ) - placeCrator( w, x, y, z ); + placeCrater( w, x, y, z ); placeMeteorite( w, x, y, z ); @@ -564,7 +570,7 @@ public class MeteoritePlacer return false; } - private void placeCrator(IMeteoriteWorld w, int x, int y, int z) + private void placeCrater(IMeteoriteWorld w, int x, int y, int z) { boolean lava = settings.getBoolean( "lava" ); @@ -583,7 +589,7 @@ public class MeteoritePlacer { double dx = i - x; double dz = k - z; - double h = y - real_sizeOfMeteorite + 1 + type.adjustCrator(); + double h = y - real_sizeOfMeteorite + 1 + type.adjustCrater(); double distanceFrom = dx * dx + dz * dz; @@ -610,15 +616,15 @@ public class MeteoritePlacer private void placeMeteorite(IMeteoriteWorld w, int x, int y, int z) { - int Xmeteor_l = w.minX( x - 8 ); - int Xmeteor_h = w.maxX( x + 8 ); - int Zmeteor_l = w.minZ( z - 8 ); - int Zmeteor_h = w.maxZ( z + 8 ); + int meteorXLength = w.minX( x - 8 ); + int meteorXHeight = w.maxX( x + 8 ); + int meteorZLength = w.minZ( z - 8 ); + int meteorZHeight = w.maxZ( z + 8 ); - // spawn metor - for (int i = Xmeteor_l; i < Xmeteor_h; i++) + // spawn meteor + for (int i = meteorXLength; i < meteorXHeight; i++) for (int j = y - 8; j < y + 8; j++) - for (int k = Zmeteor_l; k < Zmeteor_h; k++) + for (int k = meteorZLength; k < meteorZHeight; k++) { double dx = i - x; double dy = j - y; @@ -694,7 +700,7 @@ public class MeteoritePlacer ap.addItems( AEApi.instance().blocks().blockSkyStone.stack( (int) (Math.random() * 12) + 1 ) ); break; case 1: - List possibles = new LinkedList(); + List possibles = new LinkedList(); possibles.addAll( OreDictionary.getOres( "nuggetIron" ) ); possibles.addAll( OreDictionary.getOres( "nuggetCopper" ) ); possibles.addAll( OreDictionary.getOres( "nuggetTin" ) ); @@ -724,13 +730,13 @@ public class MeteoritePlacer { double randomShit = 0; - int Xmeteor_l = w.minX( x - 30 ); - int Xmeteor_h = w.maxX( x + 30 ); - int Zmeteor_l = w.minZ( z - 30 ); - int Zmeteor_h = w.maxZ( z + 30 ); + int meteorXLength = w.minX( x - 30 ); + int meteorXHeight = w.maxX( x + 30 ); + int meteorZLength = w.minZ( z - 30 ); + int meteorZHeight = w.maxZ( z + 30 ); - for (int i = Xmeteor_l; i < Xmeteor_h; i++) - for (int k = Zmeteor_l; k < Zmeteor_h; k++) + for (int i = meteorXLength; i < meteorXHeight; i++) + for (int k = meteorZLength; k < meteorZHeight; k++) for (int j = y - 9; j < y + 30; j++) { Block blk = w.getBlock( i, j, k ); @@ -749,7 +755,7 @@ public class MeteoritePlacer w.setBlock( i, j, k, blk_b, meta_b, 3 ); w.setBlock( i, j + 1, k, blk ); } - else if ( randomShit < 100 * crator ) + else if ( randomShit < 100 * crater ) { double dx = i - x; double dy = j - y; @@ -759,8 +765,8 @@ public class MeteoritePlacer Block xf = w.getBlock( i, j - 1, k ); if ( !xf.isReplaceable( w.getWorld(), i, j - 1, k ) ) { - double extrRange = Math.random() * 0.6; - double height = crator * (extrRange + 0.2) - Math.abs( dist - crator * 1.7 ); + double extraRange = Math.random() * 0.6; + double height = crater * (extraRange + 0.2) - Math.abs( dist - crater * 1.7 ); if ( xf != blk && height > 0 && Math.random() > 0.6 ) { @@ -782,7 +788,7 @@ public class MeteoritePlacer double dy = j - y; double dz = k - z; - if ( dx * dx + dy * dy + dz * dz < crator * 1.6 ) + if ( dx * dx + dy * dy + dz * dz < crater * 1.6 ) { type.getRandomInset( w, i, j, k ); } diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index 48f6748ba..96be0c406 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -62,20 +62,18 @@ public class MultiCraftingTracker { if ( ais != null && d.simulateAdd( ais.getItemStack() ) == null ) { - Future cjob = getJob( x ); + Future craftingJob = getJob( x ); if ( getLink( x ) != null ) { return false; } - else if ( cjob != null ) + else if ( craftingJob != null ) { ICraftingJob job = null; try { - if ( cjob.isDone() ) - job = cjob.get(); - else if ( cjob.isCancelled() ) - job = null; + if ( craftingJob.isDone() ) + job = craftingJob.get(); if ( job != null ) { @@ -152,10 +150,12 @@ public class MultiCraftingTracker jobs[slot] = l; boolean hasStuff = false; - for (int x = 0; x < jobs.length; x++) + for (Future job : jobs) { - if ( jobs[x] != null ) + if ( job != null ) + { hasStuff = true; + } } if ( hasStuff == false ) diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index d0f46de48..b68a5b4fc 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -25,7 +25,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable failCache = new HashSet(); - HashSet passCache = new HashSet(); + HashSet failCache = new HashSet(); + HashSet passCache = new HashSet(); private void markItemAs(int slotIndex, ItemStack i, TestStatus b) { @@ -110,7 +112,8 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable in = new ArrayList(); - List out = new ArrayList(); + List in = new ArrayList(); + List out = new ArrayList(); for (int x = 0; x < inTag.tagCount(); x++) { @@ -191,10 +194,10 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> 4) & 0x0f) / 15.0f; + return ((pos >> 4) & 0x0f) / 15.0f; } public int getSeed() diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index 0338c326c..ca8372c51 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -126,9 +126,9 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost if ( dc.getWorld() == myPlayer.worldObj ) { - double offX = (double) dc.x - myPlayer.posX; - double offY = (double) dc.y - myPlayer.posY; - double offZ = (double) dc.z - myPlayer.posZ; + double offX = dc.x - myPlayer.posX; + double offY = dc.y - myPlayer.posY; + double offZ = dc.z - myPlayer.posZ; double r = offX * offX + offY * offY + offZ * offZ; if ( r < rangeLimit && sqRange > r ) diff --git a/src/main/java/appeng/hooks/AETrading.java b/src/main/java/appeng/hooks/AETrading.java index f06f46ec9..df255916e 100644 --- a/src/main/java/appeng/hooks/AETrading.java +++ b/src/main/java/appeng/hooks/AETrading.java @@ -69,7 +69,6 @@ public class AETrading implements IVillageTradeHandler ItemStack reverseFrom = To.copy(); reverseFrom.stackSize = (int) (reverseFrom.stackSize * (rand.nextFloat() * 3.0f + 1.0f)); - reverseTo.stackSize = reverseTo.stackSize; addToList( list, reverseFrom, reverseTo ); } diff --git a/src/main/java/appeng/hooks/CompassManager.java b/src/main/java/appeng/hooks/CompassManager.java index 9afd890c0..a4b0f5bb6 100644 --- a/src/main/java/appeng/hooks/CompassManager.java +++ b/src/main/java/appeng/hooks/CompassManager.java @@ -13,7 +13,7 @@ public class CompassManager public static CompassManager instance = new CompassManager(); - class CompassReq + class CompassRequest { final int hash; @@ -21,7 +21,7 @@ public class CompassManager final long attunement; final int cx, cdy, cz; - public CompassReq(long attunement, int x, int y, int z) { + public CompassRequest(long attunement, int x, int y, int z) { this.attunement = attunement; cx = x >> 4; cdy = y >> 5; @@ -38,25 +38,29 @@ public class CompassManager @Override public boolean equals(Object obj) { - CompassReq b = (CompassReq) obj; - return attunement == b.attunement && cx == b.cx && cdy == b.cdy && cz == b.cz; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + CompassRequest other = (CompassRequest) obj; + return attunement == other.attunement && cx == other.cx && cdy == other.cdy && cz == other.cz; } } - HashMap reqs = new HashMap(); + HashMap requests = new HashMap(); - public void postResult(long attunement, int x, int y, int z, CompassResult res) + public void postResult(long attunement, int x, int y, int z, CompassResult result) { - CompassReq r = new CompassReq( attunement, x, y, z ); - reqs.put( r, res ); + CompassRequest r = new CompassRequest( attunement, x, y, z ); + requests.put( r, result ); } public CompassResult getCompassDirection(long attunement, int x, int y, int z) { long now = System.currentTimeMillis(); - Iterator i = reqs.values().iterator(); + Iterator i = requests.values().iterator(); while (i.hasNext()) { CompassResult res = i.next(); @@ -65,13 +69,13 @@ public class CompassManager i.remove(); } - CompassReq r = new CompassReq( attunement, x, y, z ); - CompassResult res = reqs.get( r ); + CompassRequest r = new CompassRequest( attunement, x, y, z ); + CompassResult res = requests.get( r ); if ( res == null ) { res = new CompassResult( false, true, 0 ); - reqs.put( r, res ); + requests.put( r, res ); requestUpdate( r ); } else if ( now - res.time > 1000 * 3 ) @@ -86,7 +90,7 @@ public class CompassManager return res; } - private void requestUpdate(CompassReq r) + private void requestUpdate(CompassRequest r) { try diff --git a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java index 80172afaf..7e582fc89 100644 --- a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java +++ b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java @@ -20,9 +20,9 @@ final public class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem int i = dispenser.getXInt() + enumfacing.getFrontOffsetX(); int j = dispenser.getYInt() + enumfacing.getFrontOffsetY(); int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); - EntityTinyTNTPrimed entitytntprimed = new EntityTinyTNTPrimed( world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), - (double) ((float) k + 0.5F), (EntityLiving) null ); - world.spawnEntityInWorld( entitytntprimed ); + EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F, + k + 0.5F, null ); + world.spawnEntityInWorld( primedTinyTNTEntity ); --dispensedItem.stackSize; return dispensedItem; } diff --git a/src/main/java/appeng/hooks/IBlockTool.java b/src/main/java/appeng/hooks/IBlockTool.java index ee707ae02..9b80dd023 100644 --- a/src/main/java/appeng/hooks/IBlockTool.java +++ b/src/main/java/appeng/hooks/IBlockTool.java @@ -7,6 +7,6 @@ import net.minecraft.world.World; public interface IBlockTool { - boolean onItemUse(ItemStack dispensedItem, EntityPlayer player, World w, int x, int y, int z, int ordinal, float hitx, float hity, float hitz); + boolean onItemUse(ItemStack dispensedItem, EntityPlayer player, World w, int x, int y, int z, int ordinal, float hitX, float hitY, float hitZ); } diff --git a/src/main/java/appeng/hooks/MeteoriteWorldGen.java b/src/main/java/appeng/hooks/MeteoriteWorldGen.java index 6fe679568..bb430acf7 100644 --- a/src/main/java/appeng/hooks/MeteoriteWorldGen.java +++ b/src/main/java/appeng/hooks/MeteoriteWorldGen.java @@ -33,7 +33,7 @@ final public class MeteoriteWorldGen implements IWorldGenerator distance = Double.MAX_VALUE; } - }; + } @Override public void generate(Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) diff --git a/src/main/java/appeng/hooks/QuartzWorldGen.java b/src/main/java/appeng/hooks/QuartzWorldGen.java index f13b1c7b7..ac6452ff1 100644 --- a/src/main/java/appeng/hooks/QuartzWorldGen.java +++ b/src/main/java/appeng/hooks/QuartzWorldGen.java @@ -30,24 +30,24 @@ final public class QuartzWorldGen implements IWorldGenerator } else oreNormal = oreCharged = null; - }; + } @Override public void generate(Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - int sealevel = w.provider.getAverageGroundLevel() + 1; + int seaLevel = w.provider.getAverageGroundLevel() + 1; - if ( sealevel < 20 ) + if ( seaLevel < 20 ) { int x = (chunkX << 4) + 8; int z = (chunkZ << 4) + 8; - sealevel = w.getHeightValue( x, z ); + seaLevel = w.getHeightValue( x, z ); } if ( oreNormal == null || oreCharged == null ) return; - double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * sealevel / 64; + double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier ); for (int x = 0; x < (r.nextBoolean() ? scale * 2 : scale) / 2; ++x) @@ -58,7 +58,7 @@ final public class QuartzWorldGen implements IWorldGenerator if ( WorldGenRegistry.instance.isWorldGenEnabled( isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w ) ) { int cx = chunkX * 16 + r.nextInt( 22 ); - int cy = r.nextInt( 40 * sealevel / 64 ) + r.nextInt( 22 * sealevel / 64 ) + 12 * sealevel / 64; + int cy = r.nextInt( 40 * seaLevel / 64 ) + r.nextInt( 22 * seaLevel / 64 ) + 12 * seaLevel / 64; int cz = chunkZ * 16 + r.nextInt( 22 ); whichOre.generate( w, r, cx, cy, cz ); } diff --git a/src/main/java/appeng/hooks/TickHandler.java b/src/main/java/appeng/hooks/TickHandler.java index fe453de76..83f5e25ea 100644 --- a/src/main/java/appeng/hooks/TickHandler.java +++ b/src/main/java/appeng/hooks/TickHandler.java @@ -43,17 +43,17 @@ public class TickHandler class HandlerRep { - public Queue tiles = new LinkedList(); + public Queue tiles = new LinkedList(); public Collection networks = new NetworkList(); public void clear() { - tiles = new LinkedList(); + tiles = new LinkedList(); networks = new NetworkList(); } - }; + } final public static TickHandler instance = new TickHandler(); @@ -81,10 +81,10 @@ public class TickHandler ticksLeft = ticks; } - }; + } - final private HashMap cliPlayerColors = new HashMap(); - final private HashMap srvPlayerColors = new HashMap(); + final private HashMap cliPlayerColors = new HashMap(); + final private HashMap srvPlayerColors = new HashMap(); public HashMap getPlayerColors() { @@ -159,7 +159,7 @@ public class TickHandler { if ( Platform.isServer() ) // for no there is no reason to care about this on the client... { - LinkedList toDestroy = new LinkedList(); + LinkedList toDestroy = new LinkedList(); for (Grid g : getRepo().networks) { diff --git a/src/main/java/appeng/integration/IntegrationNode.java b/src/main/java/appeng/integration/IntegrationNode.java index 5f728dd34..776475be9 100644 --- a/src/main/java/appeng/integration/IntegrationNode.java +++ b/src/main/java/appeng/integration/IntegrationNode.java @@ -10,8 +10,8 @@ import cpw.mods.fml.common.Loader; public class IntegrationNode { - IntegrationStage state = IntegrationStage.PREINIT; - IntegrationStage failedStage = IntegrationStage.PREINIT; + IntegrationStage state = IntegrationStage.PRE_INIT; + IntegrationStage failedStage = IntegrationStage.PRE_INIT; Throwable exception = null; String displayName; @@ -23,11 +23,11 @@ public class IntegrationNode Object instance; IIntegrationModule mod = null; - public IntegrationNode(String dspname, String _modID, IntegrationType sName, String n) { - displayName = dspname; - shortName = sName; - modID = _modID; - name = n; + public IntegrationNode(String displayName, String modID, IntegrationType shortName, String name) { + this.displayName = displayName; + this.shortName = shortName; + this.modID = modID; + this.name = name; } @Override @@ -47,7 +47,7 @@ public class IntegrationNode { switch (stage) { - case PREINIT: + case PRE_INIT: boolean enabled = modID == null || Loader.isModLoaded( modID ); @@ -77,10 +77,10 @@ public class IntegrationNode break; case INIT: mod.Init(); - state = IntegrationStage.POSTINIT; + state = IntegrationStage.POST_INIT; break; - case POSTINIT: + case POST_INIT: mod.PostInit(); state = IntegrationStage.READY; @@ -98,7 +98,7 @@ public class IntegrationNode } } - if ( stage == IntegrationStage.POSTINIT ) + if ( stage == IntegrationStage.POST_INIT ) { if ( state == IntegrationStage.FAILED ) { @@ -115,8 +115,8 @@ public class IntegrationNode public boolean isActive() { - if ( state == IntegrationStage.PREINIT ) - Call( IntegrationStage.PREINIT ); + if ( state == IntegrationStage.PRE_INIT ) + Call( IntegrationStage.PRE_INIT ); return state != IntegrationStage.FAILED; } diff --git a/src/main/java/appeng/integration/IntegrationRegistry.java b/src/main/java/appeng/integration/IntegrationRegistry.java index 9d4593178..b21f3c44c 100644 --- a/src/main/java/appeng/integration/IntegrationRegistry.java +++ b/src/main/java/appeng/integration/IntegrationRegistry.java @@ -29,16 +29,16 @@ public class IntegrationRegistry public void init() { for (IntegrationNode node : modules) - node.Call( IntegrationStage.PREINIT ); + node.Call( IntegrationStage.PRE_INIT ); for (IntegrationNode node : modules) node.Call( IntegrationStage.INIT ); } - public void postinit() + public void postInit() { for (IntegrationNode node : modules) - node.Call( IntegrationStage.POSTINIT ); + node.Call( IntegrationStage.POST_INIT ); } public String getStatus() diff --git a/src/main/java/appeng/integration/IntegrationStage.java b/src/main/java/appeng/integration/IntegrationStage.java index 24b0ece0e..ea11e1631 100644 --- a/src/main/java/appeng/integration/IntegrationStage.java +++ b/src/main/java/appeng/integration/IntegrationStage.java @@ -3,7 +3,7 @@ package appeng.integration; public enum IntegrationStage { - PREINIT, INIT, POSTINIT, + PRE_INIT, INIT, POST_INIT, FAILED, READY diff --git a/src/main/java/appeng/integration/abstraction/INEI.java b/src/main/java/appeng/integration/abstraction/INEI.java index 1c69dcebb..5fa2c7dd0 100644 --- a/src/main/java/appeng/integration/abstraction/INEI.java +++ b/src/main/java/appeng/integration/abstraction/INEI.java @@ -8,6 +8,6 @@ public interface INEI void drawSlot(Slot s); - RenderItem setItemRender(RenderItem aeri2); + RenderItem setItemRender(RenderItem renderItem); } diff --git a/src/main/java/appeng/integration/abstraction/helpers/BaseMJperdition.java b/src/main/java/appeng/integration/abstraction/helpers/BaseMJPerdition.java similarity index 93% rename from src/main/java/appeng/integration/abstraction/helpers/BaseMJperdition.java rename to src/main/java/appeng/integration/abstraction/helpers/BaseMJPerdition.java index c56ff065c..9f457925e 100644 --- a/src/main/java/appeng/integration/abstraction/helpers/BaseMJperdition.java +++ b/src/main/java/appeng/integration/abstraction/helpers/BaseMJPerdition.java @@ -4,9 +4,8 @@ import net.minecraft.nbt.NBTTagCompound; import appeng.transformer.annotations.integration.Method; import buildcraft.api.power.PowerHandler.PowerReceiver; -public abstract class BaseMJperdition +public abstract class BaseMJPerdition { - @Method(iname = "MJ5") public abstract PowerReceiver getPowerReceiver(); @@ -21,5 +20,4 @@ public abstract class BaseMJperdition public abstract void readFromNBT(NBTTagCompound tag); public abstract void Tick(); - } diff --git a/src/main/java/appeng/integration/modules/BC.java b/src/main/java/appeng/integration/modules/BC.java index 31f17d862..51c6e48ef 100644 --- a/src/main/java/appeng/integration/modules/BC.java +++ b/src/main/java/appeng/integration/modules/BC.java @@ -237,14 +237,14 @@ public class BC extends BaseModule implements IBC { SchematicRegistry.declareBlueprintSupport( AppEng.modid ); - Blocks blks = AEApi.instance().blocks(); - Block cable = blks.blockMultiPart.block(); - for (Field f : blks.getClass().getFields()) + Blocks blocks = AEApi.instance().blocks(); + Block cable = blocks.blockMultiPart.block(); + for (Field f : blocks.getClass().getFields()) { AEItemDefinition def; try { - def = (AEItemDefinition) f.get( blks ); + def = (AEItemDefinition) f.get( blocks ); if ( def != null ) { Block myBlock = def.block(); diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java index e5cd279ba..8323bfa59 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java @@ -17,7 +17,7 @@ public class AEGenericSchematicTile extends SchematicTile public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) { TileEntity tile = context.world().getTileEntity( x, y, z ); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); if ( tile instanceof AEBaseTile ) { AEBaseTile tcb = (AEBaseTile) tile; diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index 4eb78b6cb..e259ff820 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -337,22 +337,22 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul { if ( recipe instanceof ShapelessRecipe ) { - List items = (List) ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" ); - return getCraftingShapelessRecipe( items, ((ShapelessRecipe) recipe).getRecipeOutput() ); + List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" ); + return getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); } else if ( recipe instanceof ShapedRecipe ) { - int width = (Integer) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); - int height = (Integer) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); - Object[] items = (Object[]) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); + int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); + int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); + Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); if ( allowSmallGrid && width < 3 && height < 3 ) { - return getSmallShapedRecipe( width, height, items, ((ShapedRecipe) recipe).getRecipeOutput() ); + return getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } else { - return getCraftingShapedRecipe( width, height, items, ((ShapedRecipe) recipe).getRecipeOutput() ); + return getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } } diff --git a/src/main/java/appeng/integration/modules/DSU.java b/src/main/java/appeng/integration/modules/DSU.java index 83002ef13..b76d9a3ee 100644 --- a/src/main/java/appeng/integration/modules/DSU.java +++ b/src/main/java/appeng/integration/modules/DSU.java @@ -1,12 +1,12 @@ package appeng.integration.modules; +import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit; import net.minecraft.tileentity.TileEntity; import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; import appeng.api.AEApi; import appeng.api.storage.IMEInventory; import appeng.integration.BaseModule; import appeng.integration.abstraction.IDSU; -import appeng.integration.modules.helpers.MFRDSU; import appeng.integration.modules.helpers.MFRDSUHandler; public class DSU extends BaseModule implements IDSU @@ -17,7 +17,7 @@ public class DSU extends BaseModule implements IDSU @Override public IMEInventory getDSU(TileEntity te) { - return new MFRDSU( te ); + return new MinefactoryReloadedDeepStorageUnit( te ); } @Override diff --git a/src/main/java/appeng/integration/modules/FMP.java b/src/main/java/appeng/integration/modules/FMP.java index 264cc904e..d9304e56c 100644 --- a/src/main/java/appeng/integration/modules/FMP.java +++ b/src/main/java/appeng/integration/modules/FMP.java @@ -39,7 +39,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF { for (PartRegistry pr : PartRegistry.values()) { - if ( pr.getName() == name ) + if ( pr.getName().equals( name ) ) return pr.construct( 0 ); } diff --git a/src/main/java/appeng/integration/modules/FZ.java b/src/main/java/appeng/integration/modules/FZ.java index 3fe524911..ba71e4d5a 100644 --- a/src/main/java/appeng/integration/modules/FZ.java +++ b/src/main/java/appeng/integration/modules/FZ.java @@ -160,6 +160,7 @@ public class FZ implements IFZ, IIntegrationModule AEApi.instance().registries().externalStorage().addExternalStorageInterface( new FactorizationHandler() ); } + @Override public void grinderRecipe(ItemStack in, ItemStack out) { try diff --git a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java index 400f5e310..68cb31a1a 100644 --- a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java +++ b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java @@ -88,7 +88,7 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock catch (Throwable e) { canConvertTiles = false; - return null; // nevermind.. + return null; } TileEntity tx = w.getTileEntity( x, y, z ); diff --git a/src/main/java/appeng/integration/modules/MJ6.java b/src/main/java/appeng/integration/modules/MJ6.java index 83534c764..b34a596b4 100644 --- a/src/main/java/appeng/integration/modules/MJ6.java +++ b/src/main/java/appeng/integration/modules/MJ6.java @@ -40,8 +40,8 @@ public class MJ6 extends BaseModule implements IMJ6 { if ( te instanceof IPowerReceptor ) { - final IPowerReceptor recp = (IPowerReceptor) te; - final PowerReceiver ph = recp.getPowerReceiver( side ); + final IPowerReceptor receptor = (IPowerReceptor) te; + final PowerReceiver ph = receptor.getPowerReceiver( side ); if ( ph == null ) return null; diff --git a/src/main/java/appeng/integration/modules/NEI.java b/src/main/java/appeng/integration/modules/NEI.java index 80898676d..58e121079 100644 --- a/src/main/java/appeng/integration/modules/NEI.java +++ b/src/main/java/appeng/integration/modules/NEI.java @@ -114,12 +114,12 @@ public class NEI extends BaseModule implements IIntegrationModule, INEI, IContai } @Override - public RenderItem setItemRender(RenderItem aeri2) + public RenderItem setItemRender(RenderItem renderItem) { try { RenderItem ri = GuiContainerManager.drawItems; - GuiContainerManager.drawItems = aeri2; + GuiContainerManager.drawItems = renderItem; return ri; } catch (Throwable t) @@ -135,12 +135,12 @@ public class NEI extends BaseModule implements IIntegrationModule, INEI, IContai } @Override - public List handleItemTooltip(GuiContainer guiScreen, ItemStack stack, int mousex, int mousey, List currenttip) + public List handleItemTooltip(GuiContainer guiScreen, ItemStack stack, int mouseX, int mouseY, List currentToolTip) { if ( guiScreen instanceof AEBaseMEGui ) - return ((AEBaseMEGui) guiScreen).handleItemTooltip( stack, mousex, mousey, currenttip ); + return ((AEBaseMEGui) guiScreen).handleItemTooltip( stack, mouseX, mouseY, currentToolTip ); - return currenttip; + return currentToolTip; } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java index 002961750..490fc08b5 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java @@ -29,11 +29,13 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler { + @Override public void loadTransferRects() { - this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) ); + this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting" ) ); } + @Override public Class getGuiClass() { return GuiCrafting.class; @@ -42,7 +44,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler @Override public String getRecipeName() { - return NEIClientUtils.translate( "recipe.shaped", new Object[0] ); + return NEIClientUtils.translate( "recipe.shaped" ); } @Override @@ -50,16 +52,16 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler { if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapedRecipeHandler.class) ) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapedRecipe) ) + if ( (recipe instanceof ShapedRecipe) ) { - if ( ((ShapedRecipe) irecipe).isEnabled() ) + if ( ((ShapedRecipe) recipe).isEnabled() ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe ); - recipe.computeVisuals(); - arecipes.add( recipe ); + CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); + cachedRecipe.computeVisuals(); + arecipes.add( cachedRecipe ); } } } @@ -70,50 +72,54 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadCraftingRecipes(ItemStack result) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapedRecipe) ) + if ( (recipe instanceof ShapedRecipe) ) { - if ( ((ShapedRecipe) irecipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) ) + if ( ((ShapedRecipe) recipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe ); - recipe.computeVisuals(); - arecipes.add( recipe ); + CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); + cachedRecipe.computeVisuals(); + arecipes.add( cachedRecipe ); } } } } + @Override public void loadUsageRecipes(ItemStack ingredient) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapedRecipe) ) + if ( (recipe instanceof ShapedRecipe) ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe ); + CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); - if ( ((ShapedRecipe) irecipe).isEnabled() && recipe.contains( recipe.ingredients, ingredient.getItem() ) ) + if ( ((ShapedRecipe) recipe).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) { - recipe.computeVisuals(); - if ( recipe.contains( recipe.ingredients, ingredient ) ) + cachedRecipe.computeVisuals(); + if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) ) { - recipe.setIngredientPermutation( recipe.ingredients, ingredient ); - arecipes.add( recipe ); + cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient ); + arecipes.add( cachedRecipe ); } } } } } + @Override public String getGuiTexture() { return "textures/gui/container/crafting_table.png"; } + @Override public String getOverlayIdentifier() { return "crafting"; @@ -165,10 +171,10 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler public ArrayList ingredients; public PositionedStack result; - public CachedShapedRecipe(ShapedRecipe irecipe) { - result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 ); + public CachedShapedRecipe(ShapedRecipe recipe) { + result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); ingredients = new ArrayList(); - setIngredients( irecipe.getWidth(), irecipe.getHeight(), irecipe.getIngredients() ); + setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() ); } public void setIngredients(int width, int height, Object[] items) diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java index 2d4f35373..a105483eb 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java @@ -29,11 +29,13 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler { + @Override public void loadTransferRects() { - this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) ); + this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting" ) ); } + @Override public Class getGuiClass() { return GuiCrafting.class; @@ -42,7 +44,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler @Override public String getRecipeName() { - return NEIClientUtils.translate( "recipe.shapeless", new Object[0] ); + return NEIClientUtils.translate( "recipe.shapeless" ); } @Override @@ -50,16 +52,16 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler { if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapelessRecipeHandler.class) ) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapelessRecipe) ) + if ( (recipe instanceof ShapelessRecipe) ) { - if ( ((ShapelessRecipe) irecipe).isEnabled() ) + if ( ((ShapelessRecipe) recipe).isEnabled() ) { - CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe ); - recipe.computeVisuals(); - this.arecipes.add( recipe ); + CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); + cachedRecipe.computeVisuals(); + this.arecipes.add( cachedRecipe ); } } } @@ -70,50 +72,54 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadCraftingRecipes(ItemStack result) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapelessRecipe) ) + if ( (recipe instanceof ShapelessRecipe) ) { - if ( ((ShapelessRecipe) irecipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) ) + if ( ((ShapelessRecipe) recipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) ) { - CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe ); - recipe.computeVisuals(); - arecipes.add( recipe ); + CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); + cachedRecipe.computeVisuals(); + arecipes.add( cachedRecipe ); } } } } + @Override public void loadUsageRecipes(ItemStack ingredient) { - List allrecipes = CraftingManager.getInstance().getRecipeList(); - for (IRecipe irecipe : allrecipes) + List recipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe recipe : recipes) { - if ( (irecipe instanceof ShapelessRecipe) ) + if ( (recipe instanceof ShapelessRecipe) ) { - CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe ); + CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); - if ( ((ShapelessRecipe) irecipe).isEnabled() && recipe.contains( recipe.ingredients, ingredient.getItem() ) ) + if ( ((ShapelessRecipe) recipe).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) { - recipe.computeVisuals(); - if ( recipe.contains( recipe.ingredients, ingredient ) ) + cachedRecipe.computeVisuals(); + if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) ) { - recipe.setIngredientPermutation( recipe.ingredients, ingredient ); - this.arecipes.add( recipe ); + cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient ); + this.arecipes.add( cachedRecipe ); } } } } } + @Override public String getGuiTexture() { return "textures/gui/container/crafting_table.png"; } + @Override public String getOverlayIdentifier() { return "crafting"; @@ -165,10 +171,10 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler public ArrayList ingredients; public PositionedStack result; - public CachedShapelessRecipe(ShapelessRecipe irecipe) { - result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 ); + public CachedShapelessRecipe(ShapelessRecipe recipe) { + result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); ingredients = new ArrayList(); - setIngredients( irecipe.getInput().toArray() ); + setIngredients( recipe.getInput().toArray() ); } public void setIngredients(Object[] items) diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java index 166f7bb70..72fe4703f 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java @@ -24,12 +24,12 @@ public class NEICraftingHandler implements IOverlayHandler public NEICraftingHandler(int x, int y) { - offsetx = x; - offsety = y; + offsetX = x; + offsetY = y; } - int offsetx; - int offsety; + int offsetX; + int offsetY; @Override public void overlayRecipe(GuiContainer gui, IRecipeHandler recipe, int recipeIndex, boolean shift) @@ -55,40 +55,43 @@ public class NEICraftingHandler implements IOverlayHandler if ( gui instanceof GuiCraftingTerm || gui instanceof GuiPatternTerm ) { - for (int i = 0; i < ingredients.size(); i++)// identify slots + for (PositionedStack positionedStack : ingredients) { - PositionedStack pstack = ingredients.get( i ); - int col = (pstack.relx - 25) / 18; - int row = (pstack.rely - 6) / 18; - if ( pstack.items != null && pstack.items.length > 0 ) + int col = (positionedStack.relx - 25) / 18; + int row = (positionedStack.rely - 6) / 18; + if ( positionedStack.items != null && positionedStack.items.length > 0 ) { for (Slot slot : (List) gui.inventorySlots.inventorySlots) { if ( slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix ) { - Slot ctSlot = (Slot) slot; + Slot ctSlot = slot; if ( ctSlot.getSlotIndex() == col + row * 3 ) { - NBTTagList ilist = new NBTTagList(); - List list = new LinkedList(); + NBTTagList tags = new NBTTagList(); + List list = new LinkedList(); // prefer pure crystals. - for (int x = 0; x < pstack.items.length; x++) + for (int x = 0; x < positionedStack.items.length; x++) { - if ( Platform.isRecipePrioritized( pstack.items[x] ) ) - list.add( 0, pstack.items[x] ); + if ( Platform.isRecipePrioritized( positionedStack.items[x] ) ) + { + list.add( 0, positionedStack.items[x] ); + } else - list.add( pstack.items[x] ); + { + list.add( positionedStack.items[x] ); + } } for (ItemStack is : list) { - NBTTagCompound inbt = new NBTTagCompound(); - is.writeToNBT( inbt ); - ilist.appendTag( inbt ); + NBTTagCompound tag = new NBTTagCompound(); + is.writeToNBT( tag ); + tags.appendTag( tag ); } - recipe.setTag( "#" + ctSlot.getSlotIndex(), ilist ); + recipe.setTag( "#" + ctSlot.getSlotIndex(), tags ); break; } } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java index a06d60014..e1c0c19cd 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java @@ -25,11 +25,13 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler final ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item(); final ItemStack cable_anchor = AEApi.instance().parts().partCableAnchor.stack( 1 ); + @Override public void loadTransferRects() { - this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) ); + this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting" ) ); } + @Override public Class getGuiClass() { return GuiCrafting.class; @@ -61,6 +63,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadCraftingRecipes(ItemStack result) { if ( result.getItem() == ifa ) @@ -71,6 +74,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadUsageRecipes(ItemStack ingredient) { List facades = ifa.getFacades(); @@ -90,11 +94,13 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } } + @Override public String getGuiTexture() { return "textures/gui/container/crafting_table.png"; } + @Override public String getOverlayIdentifier() { return "crafting"; diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java index 0e9a646e4..a284e7b14 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java @@ -29,6 +29,7 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class NEIGrinderRecipeHandler extends TemplateRecipeHandler { + @Override public void drawBackground(int recipe) { GL11.glColor4f( 1, 1, 1, 1 ); @@ -45,12 +46,12 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler CachedRecipe cr = this.arecipes.get( recipe ); if ( cr instanceof CachedGrindStoneRecipe ) { - CachedGrindStoneRecipe cgsr = (CachedGrindStoneRecipe) cr; - if ( cgsr.hasOptional ) + CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr; + if ( cachedRecipe.hasOptional ) { FontRenderer fr = Minecraft.getMinecraft().fontRenderer; - int width = fr.getStringWidth( cgsr.Chance ); - fr.drawString( cgsr.Chance, (168 - width) / 2, 5, 0 ); + int width = fr.getStringWidth( cachedRecipe.Chance ); + fr.drawString( cachedRecipe.Chance, (168 - width) / 2, 5, 0 ); } else { @@ -62,11 +63,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadTransferRects() { - this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "grindstone", new Object[0] ) ); + this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "grindstone" ) ); } + @Override public Class getGuiClass() { return GuiGrinder.class; @@ -83,14 +86,11 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler { if ( (outputId.equals( "grindstone" )) && (getClass() == NEIGrinderRecipeHandler.class) ) { - for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes()) + for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { - CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe ); - if ( recipe != null ) - { - recipe.computeVisuals(); - this.arecipes.add( recipe ); - } + CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); + cachedRecipe.computeVisuals(); + this.arecipes.add( cachedRecipe ); } } else @@ -99,37 +99,40 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadCraftingRecipes(ItemStack result) { - for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes()) + for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { - if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getOutput(), result ) ) + if ( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) ) { - CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe ); - recipe.computeVisuals(); - this.arecipes.add( recipe ); + CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); + cachedRecipe.computeVisuals(); + this.arecipes.add( cachedRecipe ); } } } + @Override public void loadUsageRecipes(ItemStack ingredient) { - for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes()) + for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { - CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe ); + CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); - if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) ) + if ( (cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() )) ) { - recipe.computeVisuals(); - if ( recipe.contains( recipe.ingredients, ingredient ) ) + cachedRecipe.computeVisuals(); + if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) ) { - recipe.setIngredientPermutation( recipe.ingredients, ingredient ); - this.arecipes.add( recipe ); + cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient ); + this.arecipes.add( cachedRecipe ); } } } } + @Override public String getGuiTexture() { ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" ); @@ -137,6 +140,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler return f; } + @Override public String getOverlayIdentifier() { return "grindstone"; @@ -169,19 +173,19 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler boolean hasOptional = false; public String Chance; - public CachedGrindStoneRecipe(IGrinderEntry irecipe) { - result = new PositionedStack( irecipe.getOutput(), -30 + 107, 47 ); + public CachedGrindStoneRecipe(IGrinderEntry recipe) { + result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 ); ingredients = new ArrayList(); - if ( irecipe.getOptionalOutput() != null ) + if ( recipe.getOptionalOutput() != null ) { hasOptional = true; - Chance = ((int) (irecipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal(); - ingredients.add( new PositionedStack( irecipe.getOptionalOutput(), -30 + 107 + 18, 47 ) ); + Chance = ((int) (recipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal(); + ingredients.add( new PositionedStack( recipe.getOptionalOutput(), -30 + 107 + 18, 47 ) ); } - if ( irecipe.getInput() != null ) - ingredients.add( new PositionedStack( irecipe.getInput(), 45, 24 ) ); + if ( recipe.getInput() != null ) + ingredients.add( new PositionedStack( recipe.getInput(), 45, 24 ) ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java index 586a19ee1..af7ad9a4b 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java @@ -27,6 +27,7 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class NEIInscriberRecipeHandler extends TemplateRecipeHandler { + @Override public void drawBackground(int recipe) { GL11.glColor4f( 1, 1, 1, 1 ); @@ -34,11 +35,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler drawTexturedModalRect( 0, 0, 5, 11, 166, 75 ); } + @Override public void loadTransferRects() { - this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "inscriber", new Object[0] ) ); + this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "inscriber" ) ); } + @Override public Class getGuiClass() { return GuiInscriber.class; @@ -55,14 +58,11 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler { if ( (outputId.equals( "inscriber" )) && (getClass() == NEIInscriberRecipeHandler.class) ) { - for (InscriberRecipe irecipe : Inscribe.recipes) + for (InscriberRecipe recipe : Inscribe.recipes) { - CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe ); - if ( recipe != null ) - { - recipe.computeVisuals(); - this.arecipes.add( recipe ); - } + CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); + cachedRecipe.computeVisuals(); + this.arecipes.add( cachedRecipe ); } } else @@ -71,37 +71,40 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } } + @Override public void loadCraftingRecipes(ItemStack result) { - for (InscriberRecipe irecipe : Inscribe.recipes) + for (InscriberRecipe recipe : Inscribe.recipes) { - if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.output, result ) ) + if ( NEIServerUtils.areStacksSameTypeCrafting( recipe.output, result ) ) { - CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe ); - recipe.computeVisuals(); - this.arecipes.add( recipe ); + CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); + cachedRecipe.computeVisuals(); + this.arecipes.add( cachedRecipe ); } } } + @Override public void loadUsageRecipes(ItemStack ingredient) { - for (InscriberRecipe irecipe : Inscribe.recipes) + for (InscriberRecipe recipe : Inscribe.recipes) { - CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe ); + CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); - if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) ) + if ( (cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() )) ) { - recipe.computeVisuals(); - if ( recipe.contains( recipe.ingredients, ingredient ) ) + cachedRecipe.computeVisuals(); + if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) ) { - recipe.setIngredientPermutation( recipe.ingredients, ingredient ); - this.arecipes.add( recipe ); + cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient ); + this.arecipes.add( cachedRecipe ); } } } } + @Override public String getGuiTexture() { ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/inscriber.png" ); @@ -109,6 +112,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler return f; } + @Override public String getOverlayIdentifier() { return "inscriber"; @@ -138,18 +142,18 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler public ArrayList ingredients; public PositionedStack result; - public CachedInscriberRecipe(InscriberRecipe irecipe) { - result = new PositionedStack( irecipe.output, 108, 29 ); + public CachedInscriberRecipe(InscriberRecipe recipe) { + result = new PositionedStack( recipe.output, 108, 29 ); ingredients = new ArrayList(); - if ( irecipe.plateA != null ) - ingredients.add( new PositionedStack( irecipe.plateA, 40, 5 ) ); + if ( recipe.plateA != null ) + ingredients.add( new PositionedStack( recipe.plateA, 40, 5 ) ); - if ( irecipe.imprintable != null ) - ingredients.add( new PositionedStack( irecipe.imprintable, 40 + 18, 28 ) ); + if ( recipe.imprintable != null ) + ingredients.add( new PositionedStack( recipe.imprintable, 40 + 18, 28 ) ); - if ( irecipe.plateB != null ) - ingredients.add( new PositionedStack( irecipe.plateB, 40, 51 ) ); + if ( recipe.plateB != null ) + ingredients.add( new PositionedStack( recipe.plateB, 40, 51 ) ); } @Override diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java index b60069d36..0e758006c 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java @@ -30,8 +30,8 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler { HashMap details = new HashMap(); - List offsets = new LinkedList(); - List outputs = new LinkedList(); + List offsets = new LinkedList(); + List outputs = new LinkedList(); ItemStack target; @@ -87,6 +87,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler return offsets.size(); } + @Override public void drawBackground(int recipe) { GL11.glColor4f( 1, 1, 1, 1 );// nothing. @@ -106,13 +107,13 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } @Override - public List getIngredientStacks(int recipe) + public List getIngredientStacks(int recipeIndex) { return new ArrayList(); } @Override - public List getOtherStacks(int recipetype) + public List getOtherStacks(int recipeIndex) { return new ArrayList(); } @@ -154,15 +155,15 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } @Override - public List handleTooltip(GuiRecipe gui, List currenttip, int recipe) + public List handleTooltip(GuiRecipe gui, List currentToolTip, int recipe) { - return currenttip; + return currentToolTip; } @Override - public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currenttip, int recipe) + public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currentToolTip, int recipe) { - return currenttip; + return currentToolTip; } @Override diff --git a/src/main/java/appeng/integration/modules/RB.java b/src/main/java/appeng/integration/modules/RB.java index 122d200d0..3a7058628 100644 --- a/src/main/java/appeng/integration/modules/RB.java +++ b/src/main/java/appeng/integration/modules/RB.java @@ -42,7 +42,7 @@ public class RB extends BaseModule implements IRB internal.setOrientation( Forward, Up ); } - }; + } public static RB instance; diff --git a/src/main/java/appeng/integration/modules/Waila.java b/src/main/java/appeng/integration/modules/Waila.java index 440495b05..1b30a55ca 100644 --- a/src/main/java/appeng/integration/modules/Waila.java +++ b/src/main/java/appeng/integration/modules/Waila.java @@ -75,7 +75,7 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr } @Override - public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) + public List getWailaBody(ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { TileEntity te = accessor.getTileEntity(); MovingObjectPosition mop = accessor.getPosition(); @@ -90,11 +90,11 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { } - return getBody( itemStack, currenttip, accessor.getPlayer(), nbt, te, mop ); + return getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); } @Override - public List getWailaBody(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) + public List getWailaBody(ItemStack itemStack, List currentToolTip, IWailaFMPAccessor accessor, IWailaConfigHandler config) { TileEntity te = accessor.getTileEntity(); MovingObjectPosition mop = accessor.getPosition(); @@ -109,10 +109,10 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { } - return getBody( itemStack, currenttip, accessor.getPlayer(), nbt, te, mop ); + return getBody( itemStack, currentToolTip, accessor.getPlayer(), nbt, te, mop ); } - public List getBody(ItemStack itemStack, List currenttip, EntityPlayer player, NBTTagCompound nbt, TileEntity te, MovingObjectPosition mop) + public List getBody(ItemStack itemStack, List currentToolTip, EntityPlayer player, NBTTagCompound nbt, TileEntity te, MovingObjectPosition mop) { Object ThingOfInterest = te; @@ -143,7 +143,7 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr if ( ic != null && ic.hasKey( "usedChannels" ) ) { int channels = ic.getByte( "usedChannels" ); - currenttip.add( channels + " " + GuiText.Of.getLocal() + " " + (ThingOfInterest instanceof PartDenseCable ? 32 : 8) + " " + currentToolTip.add( channels + " " + GuiText.Of.getLocal() + " " + (ThingOfInterest instanceof PartDenseCable ? 32 : 8) + " " + WailaText.Channels.getLocal() ); } } @@ -156,7 +156,7 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { TileEnergyCell tec = (TileEnergyCell) ThingOfInterest; long power = (long) (100 * c.getDouble( "internalCurrentPower" )); - currenttip.add( WailaText.Contains + ": " + Platform.formatPowerLong( power, false ) + " / " + currentToolTip.add( WailaText.Contains + ": " + Platform.formatPowerLong( power, false ) + " / " + Platform.formatPowerLong( (long) (100 * tec.getAEMaxPower()), false ) ); } } @@ -175,19 +175,19 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr if ( stack instanceof IAEItemStack ) { IAEItemStack ais = (IAEItemStack) stack; - currenttip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() ); + currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() ); } if ( stack instanceof IAEFluidStack ) { IAEFluidStack ais = (IAEFluidStack) stack; - currenttip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) ); + currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) ); } if ( isLocked ) - currenttip.add( WailaText.Locked.getLocal() ); + currentToolTip.add( WailaText.Locked.getLocal() ); else - currenttip.add( WailaText.Unlocked.getLocal() ); + currentToolTip.add( WailaText.Unlocked.getLocal() ); } if ( ThingOfInterest instanceof TileCharger ) @@ -197,8 +197,8 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr ItemStack is = inv.getStackInSlot( 0 ); if ( is != null ) { - currenttip.add( WailaText.Contains + ": " + is.getDisplayName() ); - is.getItem().addInformation( is, player, currenttip, true ); + currentToolTip.add( WailaText.Contains + ": " + is.getDisplayName() ); + is.getItem().addInformation( is, player, currentToolTip, true ); } } @@ -206,40 +206,38 @@ public class Waila extends BaseModule implements IWailaDataProvider, IWailaFMPPr { IPowerChannelState pbs = (IPowerChannelState) ThingOfInterest; if ( pbs.isActive() && pbs.isPowered() ) - currenttip.add( WailaText.DeviceOnline.getLocal() ); + currentToolTip.add( WailaText.DeviceOnline.getLocal() ); else if ( pbs.isPowered() ) - currenttip.add( WailaText.DeviceMissingChannel.getLocal() ); + currentToolTip.add( WailaText.DeviceMissingChannel.getLocal() ); else - currenttip.add( WailaText.DeviceOffline.getLocal() ); + currentToolTip.add( WailaText.DeviceOffline.getLocal() ); } - return currenttip; + return currentToolTip; } @Override - public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) + public List getWailaHead(ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - - return currenttip; + return currentToolTip; } @Override - public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) + public List getWailaTail(ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - - return currenttip; + return currentToolTip; } @Override - public List getWailaHead(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) + public List getWailaHead(ItemStack itemStack, List currentToolTip, IWailaFMPAccessor accessor, IWailaConfigHandler config) { - return currenttip; + return currentToolTip; } @Override - public List getWailaTail(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) + public List getWailaTail(ItemStack itemStack, List currentToolTip, IWailaFMPAccessor accessor, IWailaConfigHandler config) { - return currenttip; + return currentToolTip; } } diff --git a/src/main/java/appeng/integration/modules/helpers/MJPerdition.java b/src/main/java/appeng/integration/modules/helpers/MJPerdition.java index a527bcb28..5a4479fc7 100644 --- a/src/main/java/appeng/integration/modules/helpers/MJPerdition.java +++ b/src/main/java/appeng/integration/modules/helpers/MJPerdition.java @@ -1,13 +1,13 @@ package appeng.integration.modules.helpers; +import appeng.integration.abstraction.helpers.BaseMJPerdition; import net.minecraft.nbt.NBTTagCompound; -import appeng.integration.abstraction.helpers.BaseMJperdition; import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.PowerHandler; import buildcraft.api.power.PowerHandler.PowerReceiver; import buildcraft.api.power.PowerHandler.Type; -public class MJPerdition extends BaseMJperdition +public class MJPerdition extends BaseMJPerdition { final protected PowerHandler bcPowerHandler; diff --git a/src/main/java/appeng/integration/modules/helpers/MFRDSU.java b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java similarity index 94% rename from src/main/java/appeng/integration/modules/helpers/MFRDSU.java rename to src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java index e019edd7d..90c2f3a98 100644 --- a/src/main/java/appeng/integration/modules/helpers/MFRDSU.java +++ b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java @@ -11,13 +11,13 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.util.item.AEItemStack; -public class MFRDSU implements IMEInventory +public class MinefactoryReloadedDeepStorageUnit implements IMEInventory { IDeepStorageUnit dsu; TileEntity te; - public MFRDSU(TileEntity ta) { + public MinefactoryReloadedDeepStorageUnit(TileEntity ta) { te = ta; dsu = (IDeepStorageUnit) ta; } diff --git a/src/main/java/appeng/items/AEBaseItem.java b/src/main/java/appeng/items/AEBaseItem.java index b018b8396..3bc62e8b0 100644 --- a/src/main/java/appeng/items/AEBaseItem.java +++ b/src/main/java/appeng/items/AEBaseItem.java @@ -11,14 +11,14 @@ import appeng.core.features.IAEFeature; public class AEBaseItem extends Item implements IAEFeature { - String FeatureFullname; - String FeatureSubname; + String featureFullName; + String featureSubName; AEFeatureHandler feature; @Override public String toString() { - return FeatureFullname; + return featureFullName; } @Override @@ -29,7 +29,7 @@ public class AEBaseItem extends Item implements IAEFeature public void setFeature(EnumSet f) { - feature = new AEFeatureHandler( f, this, FeatureSubname ); + feature = new AEFeatureHandler( f, this, featureSubName ); } public AEBaseItem(Class c) { @@ -37,9 +37,9 @@ public class AEBaseItem extends Item implements IAEFeature canRepair = false; } - public AEBaseItem(Class c, String subname) { - FeatureSubname = subname; - FeatureFullname = AEFeatureHandler.getName( c, subname ); + public AEBaseItem(Class c, String subName) { + featureSubName = subName; + featureFullName = AEFeatureHandler.getName( c, subName ); } @Override diff --git a/src/main/java/appeng/items/contents/NetworkToolViewer.java b/src/main/java/appeng/items/contents/NetworkToolViewer.java index dd09f1f0c..d0e1b1e46 100644 --- a/src/main/java/appeng/items/contents/NetworkToolViewer.java +++ b/src/main/java/appeng/items/contents/NetworkToolViewer.java @@ -19,7 +19,7 @@ public class NetworkToolViewer implements INetworkTool this.is = is; gh = gHost; inv = new AppEngInternalInventory( null, 9 ); - if ( is.hasTagCompound() ) // prevent crash when opening network status creen. + if ( is.hasTagCompound() ) // prevent crash when opening network status screen. inv.readFromNBT( Platform.openNbtData( is ), "inv" ); } diff --git a/src/main/java/appeng/items/contents/PortableCellViewer.java b/src/main/java/appeng/items/contents/PortableCellViewer.java index 17928cea8..8145f395c 100644 --- a/src/main/java/appeng/items/contents/PortableCellViewer.java +++ b/src/main/java/appeng/items/contents/PortableCellViewer.java @@ -32,6 +32,7 @@ public class PortableCellViewer extends MEMonitorHandler implement target = is; } + @Override public ItemStack getItemStack() { return target; diff --git a/src/main/java/appeng/items/materials/ItemMultiMaterial.java b/src/main/java/appeng/items/materials/ItemMultiMaterial.java index a47b75d5b..5e3d42ddb 100644 --- a/src/main/java/appeng/items/materials/ItemMultiMaterial.java +++ b/src/main/java/appeng/items/materials/ItemMultiMaterial.java @@ -49,7 +49,7 @@ import com.google.common.collect.ImmutableSet; public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, IUpgradeModule { - HashMap dmgToMaterial = new HashMap(); + HashMap dmgToMaterial = new HashMap(); public static ItemMultiMaterial instance; @@ -92,9 +92,9 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, } @Override - public void addInformation(ItemStack is, EntityPlayer player, List details, boolean moar) + public void addInformation(ItemStack is, EntityPlayer player, List details, boolean displayAdditionalInformation) { - super.addInformation( is, player, details, moar ); + super.addInformation( is, player, details, displayAdditionalInformation ); MaterialType mt = getTypeByStack( is ); if ( mt == null ) @@ -109,7 +109,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, Upgrades u = getType( is ); if ( u != null ) { - List textList = new LinkedList(); + List textList = new LinkedList(); for (Entry j : u.getSupported().entrySet()) { String name = null; @@ -168,7 +168,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, throw new RuntimeException( "Cannot create the same material twice..." ); } - public void unduplicate() + public void makeUnique() { for (MaterialType mt : ImmutableSet.copyOf( dmgToMaterial.values() )) { diff --git a/src/main/java/appeng/items/misc/ItemCrystalSeed.java b/src/main/java/appeng/items/misc/ItemCrystalSeed.java index abf2e6429..39dba30ad 100644 --- a/src/main/java/appeng/items/misc/ItemCrystalSeed.java +++ b/src/main/java/appeng/items/misc/ItemCrystalSeed.java @@ -63,7 +63,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal { NBTTagCompound comp = Platform.openNbtData( is ); comp.setInteger( "progress", newDamage ); - is.setItemDamage( (int) (is.getItemDamage() / LEVEL_OFFSET) * LEVEL_OFFSET ); + is.setItemDamage( is.getItemDamage() / LEVEL_OFFSET * LEVEL_OFFSET ); } public ItemCrystalSeed() { @@ -221,8 +221,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal egc.motionY = location.motionY; egc.motionZ = location.motionZ; - if ( location instanceof EntityItem && egc instanceof EntityItem ) - ((EntityItem) egc).delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup; + if ( location instanceof EntityItem ) + egc.delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup; return egc; } diff --git a/src/main/java/appeng/items/misc/ItemEncodedPattern.java b/src/main/java/appeng/items/misc/ItemEncodedPattern.java index 3fd8c91c3..c9898a162 100644 --- a/src/main/java/appeng/items/misc/ItemEncodedPattern.java +++ b/src/main/java/appeng/items/misc/ItemEncodedPattern.java @@ -89,22 +89,26 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt String with = GuiText.With.getLocal() + ": "; boolean first = true; - for (int x = 0; x < out.length; x++) + for (IAEItemStack anOut : out) { - if ( out[x] == null ) + if ( anOut == null ) + { continue; + } - l.add( (first ? label : and) + out[x].getStackSize() + " " + Platform.getItemDisplayName( out[x] ) ); + l.add( (first ? label : and) + anOut.getStackSize() + " " + Platform.getItemDisplayName( anOut ) ); first = false; } first = true; - for (int x = 0; x < in.length; x++) + for (IAEItemStack anIn : in) { - if ( in[x] == null ) + if ( anIn == null ) + { continue; + } - l.add( (first ? with : and) + in[x].getStackSize() + " " + Platform.getItemDisplayName( in[x] ) ); + l.add( (first ? with : and) + anIn.getStackSize() + " " + Platform.getItemDisplayName( anIn ) ); first = false; } } diff --git a/src/main/java/appeng/items/parts/ItemFacade.java b/src/main/java/appeng/items/parts/ItemFacade.java index f1e5de6c9..d3f44ecc0 100644 --- a/src/main/java/appeng/items/parts/ItemFacade.java +++ b/src/main/java/appeng/items/parts/ItemFacade.java @@ -88,7 +88,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte list.addAll( subTypes ); } - public ItemStack createFromInts(int[] ids) + public ItemStack createFromIDs(int[] ids) { ItemStack is = new ItemStack( AEApi.instance().items().itemFacade.item() ); NBTTagCompound data = new NBTTagCompound(); @@ -110,7 +110,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte { if ( subTypes == null ) { - subTypes = new ArrayList(); + subTypes = new ArrayList(); for (Object blk : Block.blockRegistry) { Block b = (Block) blk; @@ -118,7 +118,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte { Item item = Item.getItemFromBlock( b ); - List tmpList = new ArrayList(); + List tmpList = new ArrayList(); b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList ); for (ItemStack l : tmpList) { diff --git a/src/main/java/appeng/items/parts/ItemMultiPart.java b/src/main/java/appeng/items/parts/ItemMultiPart.java index ff59731c6..0b26c3385 100644 --- a/src/main/java/appeng/items/parts/ItemMultiPart.java +++ b/src/main/java/appeng/items/parts/ItemMultiPart.java @@ -41,9 +41,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @SideOnly(Side.CLIENT) IIcon ico; - }; + } - HashMap dmgToPart = new HashMap(); + HashMap dmgToPart = new HashMap(); public static ItemMultiPart instance; @@ -142,10 +142,10 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @Override public String getUnlocalizedName(ItemStack is) { - return "item.appliedenergistics2." + getname( is ); + return "item.appliedenergistics2." + getName( is ); } - public String getname(ItemStack is) + public String getName(ItemStack is) { return AEFeatureHandler.getName( ItemMultiPart.class, getTypeByStack( is ).name() ); } @@ -173,7 +173,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup { for (Entry part : dmgToPart.entrySet()) { - String tex = "appliedenergistics2:" + getname( new ItemStack( this, 1, part.getKey() ) ); + String tex = "appliedenergistics2:" + getName( new ItemStack( this, 1, part.getKey() ) ); part.getValue().ico = par1IconRegister.registerIcon( tex ); } } @@ -209,7 +209,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup @Override public void getSubItems(Item number, CreativeTabs tab, List cList) { - List> types = new ArrayList( dmgToPart.entrySet() ); + List> types = new ArrayList>( dmgToPart.entrySet() ); Collections.sort( types, new Comparator>() { @Override @@ -266,7 +266,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup return null; } - public ItemStack getStackFromTypeAndVarient(PartType mt, int variant) + public ItemStack getStackFromTypeAndVariant(PartType mt, int variant) { return new ItemStack( this, 1, mt.baseDamage + variant ); } diff --git a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java index d02471e70..082613f72 100644 --- a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java @@ -111,7 +111,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II } @Override - public int BytePerType(ItemStack iscellItem) + public int BytePerType(ItemStack cell) { return 8; } @@ -197,15 +197,15 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II if ( Platform.isClient() ) return false; - InventoryPlayer pinv = player.inventory; + InventoryPlayer playerInventory = player.inventory; IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); - if ( inv != null && pinv.getCurrentItem() == stack ) + if ( inv != null && playerInventory.getCurrentItem() == stack ) { InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); IItemList list = inv.getAvailableItems( StorageChannel.ITEMS.createList() ); if ( list.isEmpty() && ia != null ) { - pinv.setInventorySlotContents( pinv.currentItem, null ); + playerInventory.setInventorySlotContents( playerInventory.currentItem, null ); ItemStack extraB = ia.addItems( component.stack( 1 ) ); ItemStack extraA = ia.addItems( AEApi.instance().materials().materialEmptyStorageCell.stack( 1 ) ); diff --git a/src/main/java/appeng/items/tools/ToolMemoryCard.java b/src/main/java/appeng/items/tools/ToolMemoryCard.java index c8924f5a0..09c0ba821 100644 --- a/src/main/java/appeng/items/tools/ToolMemoryCard.java +++ b/src/main/java/appeng/items/tools/ToolMemoryCard.java @@ -75,7 +75,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard { NBTTagCompound c = Platform.openNbtData( is ); String name = c.getString( "Config" ); - return name == null || name == "" ? GuiText.Blank.getUnlocalized() : name; + return name == null || name.equals( "" ) ? GuiText.Blank.getUnlocalized() : name; } @Override diff --git a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java index 761b98f6c..2cfdf6f8b 100644 --- a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java +++ b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java @@ -19,7 +19,7 @@ public class ToolChargedStaff extends AEBasePoweredItem public ToolChargedStaff() { super( ToolChargedStaff.class, null ); setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.staff_battery; + maxStoredPower = AEConfig.instance.chargedStaffBattery; } @Override diff --git a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java index 8f710f674..299553bfb 100644 --- a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java +++ b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java @@ -58,7 +58,7 @@ import appeng.util.item.AEItemStack; public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem { - final static HashMap oreToColor = new HashMap(); + final static HashMap oreToColor = new HashMap(); static { @@ -71,12 +71,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe oreToColor.put( OreDictionary.getOreID( "dye" + col.name() ), col ); } - }; + } public ToolColorApplicator() { super( ToolColorApplicator.class, null ); setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.colorapplicator_battery; + maxStoredPower = AEConfig.instance.colorApplicatorBattery; if ( Platform.isClient() ) MinecraftForgeClient.registerItemRenderer( this, new ToolColorApplicatorRender() ); } @@ -157,6 +157,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe Collections.sort( list, new Comparator() { + @Override public int compare(IAEItemStack a, IAEItemStack b) { return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() ); @@ -207,7 +208,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public boolean onItemUse(ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitx, float hity, float hitz) + 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; @@ -232,14 +233,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if ( paintBall != null && paintBall.getItem() instanceof ItemSnowball ) { - ForgeDirection oside = ForgeDirection.getOrientation( side ); + ForgeDirection orientation = ForgeDirection.getOrientation( side ); TileEntity te = w.getTileEntity( x, y, z ); // clean cables. if ( te instanceof IColorableTile ) { if ( getAECurrentPower( is ) > powerPerUse && ((IColorableTile) te).getColor() != AEColor.Transparent ) { - if ( ((IColorableTile) te).recolourBlock( oside, AEColor.Transparent, p ) ) + if ( ((IColorableTile) te).recolourBlock( orientation, AEColor.Transparent, p ) ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); extractAEPower( is, powerPerUse ); @@ -249,13 +250,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } // clean paint balls.. - Block testBlk = w.getBlock( x + oside.offsetX, y + oside.offsetY, z + oside.offsetZ ); - TileEntity painted = w.getTileEntity( x + oside.offsetX, y + oside.offsetY, z + oside.offsetZ ); + Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); + TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); if ( getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); extractAEPower( is, powerPerUse ); - ((TilePaint) painted).cleanSide( oside.getOpposite() ); + ((TilePaint) painted).cleanSide( orientation.getOpposite() ); return true; } } @@ -390,7 +391,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public int BytePerType(ItemStack iscellItem) + public int BytePerType(ItemStack cell) { return 8; } diff --git a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java index bfecffedb..3ca189413 100644 --- a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java +++ b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java @@ -54,10 +54,15 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT @Override public boolean equals(Object obj) { - return blk == ((Combo) obj).blk && meta == ((Combo) obj).meta; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + Combo other = (Combo) obj; + return blk == other.blk && meta == other.meta; } - }; + } static private Hashtable heatUp; static private Hashtable coolDown; @@ -137,7 +142,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT public ToolEntropyManipulator() { super( ToolEntropyManipulator.class, null ); setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.manipulator_battery; + maxStoredPower = AEConfig.instance.entropyManipulatorBattery; coolDown = new Hashtable(); coolDown.put( new Combo( Blocks.stone, 0 ), new InWorldToolOperationResult( new ItemStack( Blocks.cobblestone ) ) ); @@ -146,7 +151,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT coolDown.put( new Combo( Blocks.flowing_lava, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.obsidian ) ) ); coolDown.put( new Combo( Blocks.grass, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.dirt ) ) ); - List snowBalls = new ArrayList(); + List snowBalls = new ArrayList(); snowBalls.add( new ItemStack( Items.snowball ) ); coolDown.put( new Combo( Blocks.flowing_water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( null, snowBalls ) ); coolDown.put( new Combo( Blocks.water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.ice ) ) ); @@ -261,7 +266,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if ( result.getItem() instanceof ItemBlock ) { - if ( Block.getBlockFromItem( (ItemBlock) result.getItem() ) == Blk && result.getItem().getDamage( result ) == Metadata ) + if ( Block.getBlockFromItem( result.getItem() ) == Blk && result.getItem().getDamage( result ) == Metadata ) { canFurnaceable = false; } @@ -280,7 +285,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { extractAEPower( item, 1600 ); InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); - w.playSoundEffect( (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); + w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); if ( or.BlockItem == null ) { @@ -311,7 +316,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if ( w.isAirBlock( x, y, z ) ) { extractAEPower( item, 1600 ); - w.playSoundEffect( (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); + w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); w.setBlock( x, y, z, Blocks.fire ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index 8b0756d9b..0b5a0e600 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -61,7 +61,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell public ToolMassCannon() { super( ToolMassCannon.class, null ); setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.mattercannon_battery; + maxStoredPower = AEConfig.instance.matterCannonBattery; } @Override @@ -104,10 +104,10 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell if ( inv != null ) { IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); - IAEStack aeammo = itemList.getFirstItem(); - if ( aeammo instanceof IAEItemStack ) + IAEStack aeAmmo = itemList.getFirstItem(); + if ( aeAmmo instanceof IAEItemStack ) { - shots = Math.min( shots, (int) aeammo.getStackSize() ); + shots = Math.min( shots, (int) aeAmmo.getStackSize() ); for (int sh = 0; sh < shots; sh++) { extractAEPower( item, 1600 ); @@ -115,22 +115,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell if ( Platform.isClient() ) return item; - aeammo.setStackSize( 1 ); - ItemStack ammo = ((IAEItemStack) aeammo).getItemStack(); + aeAmmo.setStackSize( 1 ); + ItemStack ammo = ((IAEItemStack) aeAmmo).getItemStack(); if ( ammo == null ) return item; ammo.stackSize = 1; - aeammo = inv.extractItems( aeammo, Actionable.MODULATE, new PlayerSource( p, null ) ); - if ( aeammo == null ) + aeAmmo = inv.extractItems( aeAmmo, Actionable.MODULATE, new PlayerSource( p, null ) ); + if ( aeAmmo == null ) return item; float f = 1.0F; float f1 = p.prevRotationPitch + (p.rotationPitch - p.prevRotationPitch) * f; float f2 = p.prevRotationYaw + (p.rotationYaw - p.prevRotationYaw) * f; - double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double) f; - double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double) f + 1.62D - (double) p.yOffset; - double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double) f; + double d0 = p.prevPosX + (p.posX - p.prevPosX) * f; + double d1 = p.prevPosY + (p.posY - p.prevPosY) * f + 1.62D - p.yOffset; + double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * f; Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); @@ -140,14 +140,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell float f8 = f3 * f5; double d3 = 32.0D; - Vec3 vec31 = vec3.addVector( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 ); - Vec3 direction = Vec3.createVectorHelper( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 ); + Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); + Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 ); direction.normalize(); float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f; if ( penetration <= 0 ) { - ItemStack type = ((IAEItemStack) aeammo).getItemStack(); + ItemStack type = ((IAEItemStack) aeAmmo).getItemStack(); if ( type.getItem() instanceof ItemPaintBall ) { shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 ); @@ -196,12 +196,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; float f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand( (double) f1, (double) f1, (double) f1 ); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept( vec3, vec31 ); - if ( movingobjectposition1 != null ) + AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + + if ( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingobjectposition1.hitVec ); + double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if ( nd < closest ) { @@ -215,8 +216,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, false ); - Vec3 Srec = Vec3.createVectorHelper( d0, d1, d2 ); - if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( Srec ) > closest ) + Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); + if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { pos = new MovingObjectPosition( entity ); } @@ -228,7 +229,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell try { CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, - (float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( Srec ) + 1) ) ); + (float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1) ) ); } catch (Exception err) @@ -255,7 +256,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell sh.setFleeceColor( col.ordinal() ); } - pos.entityHit.attackEntityFrom( DamageSource.causePlayerDamage( p ), (float) 0 ); + pos.entityHit.attackEntityFrom( DamageSource.causePlayerDamage( p ), 0 ); NetworkHandler.instance.sendToAll( marker.getPacket() ); } else if ( pos.typeOfHit == MovingObjectType.BLOCK ) @@ -321,12 +322,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; float f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand( (double) f1, (double) f1, (double) f1 ); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept( vec3, vec31 ); - if ( movingobjectposition1 != null ) + AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + + if ( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingobjectposition1.hitVec ); + double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if ( nd < closest ) { @@ -338,9 +340,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } } - Vec3 Srec = Vec3.createVectorHelper( d0, d1, d2 ); + Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, true ); - if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( Srec ) > closest ) + if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { pos = new MovingObjectPosition( entity ); } @@ -352,7 +354,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell try { CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, - (float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( Srec ) + 1) ) ); + (float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1) ) ); } catch (Exception err) @@ -372,7 +374,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { EntityLivingBase el = (EntityLivingBase) pos.entityHit; penetration -= dmg; - el.knockBack( p, 0, (double) -direction.xCoord, (double) -direction.zCoord ); + el.knockBack( p, 0, -direction.xCoord, -direction.zCoord ); // el.knockBack( p, 0, vec3.xCoord, // vec3.zCoord ); el.attackEntityFrom( dmgSrc, dmg ); @@ -480,7 +482,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public int BytePerType(ItemStack iscellItem) + public int BytePerType(ItemStack cell) { return 8; } diff --git a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java index b2d6da42b..a0cc81adc 100644 --- a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java +++ b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java @@ -37,7 +37,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, public ToolPortableCell() { super( ToolPortableCell.class, null ); setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.portablecell_battery; + maxStoredPower = AEConfig.instance.portableCellBattery; } @Override @@ -49,7 +49,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, @Override public boolean onItemUse(ItemStack item, EntityPlayer player, World w, int x, int y, int z, int side, - float hitx, float hity, float hitz) + float hitX, float hitY, float hitZ) { onItemRightClick( item, w, player ); return true; @@ -80,7 +80,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public int BytePerType(ItemStack iscellItem) + public int BytePerType(ItemStack cell) { return 8; } diff --git a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java index 37f08b588..157402690 100644 --- a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java +++ b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java @@ -29,7 +29,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless public ToolWirelessTerminal() { super( ToolWirelessTerminal.class, null ); setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) ); - maxStoredPower = AEConfig.instance.wireless_battery; + maxStoredPower = AEConfig.instance.wirelessTerminalBattery; } @Override @@ -41,7 +41,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless @Override public boolean onItemUse(ItemStack item, EntityPlayer player, World w, int x, int y, int z, int side, - float hitx, float hity, float hitz) + float hitX, float hitY, float hitZ) { onItemRightClick( item, w, player ); return true; @@ -59,7 +59,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless { String encKey = tag.getString( "encryptionKey" ); - if ( encKey == null || encKey == "" ) + if ( encKey == null || encKey.equals( "" ) ) l.add( GuiText.Unlinked.getLocal() ); else l.add( GuiText.Linked.getLocal() ); diff --git a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java index b2ed3b6cf..b29478a60 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java @@ -3,8 +3,8 @@ package appeng.items.tools.powered.powersink; public class AEBasePoweredItem extends RedstoneFlux { - public AEBasePoweredItem(Class c, String subname) { - super( c, subname ); + public AEBasePoweredItem(Class c, String subName) { + super( c, subName ); setMaxStackSize( 1 ); } } diff --git a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java index 0cbd17810..6b9c85a16 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java @@ -21,12 +21,12 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage private enum batteryOperation { STORAGE, INJECT, EXTRACT - }; + } public double maxStoredPower = 200000; - public AERootPoweredItem(Class c, String subname) { - super( c, subname ); + public AERootPoweredItem(Class c, String subName) { + super( c, subName ); setMaxDamage( 32 ); hasSubtypes = false; } diff --git a/src/main/java/appeng/items/tools/powered/powersink/IC2.java b/src/main/java/appeng/items/tools/powered/powersink/IC2.java index f43760f1a..a6187e625 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/IC2.java +++ b/src/main/java/appeng/items/tools/powered/powersink/IC2.java @@ -15,8 +15,8 @@ import appeng.transformer.annotations.integration.Method; public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem { - public IC2(Class c, String subname) { - super( c, subname ); + public IC2(Class c, String subName) { + super( c, subName ); } @Override diff --git a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java index b371c2587..6d63740cb 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java @@ -9,8 +9,8 @@ import cofh.api.energy.IEnergyContainerItem; public class RedstoneFlux extends IC2 implements IEnergyContainerItem { - public RedstoneFlux(Class c, String subname) { - super( c, subname ); + public RedstoneFlux(Class c, String subName) { + super( c, subName ); } @Override diff --git a/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java b/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java index ff2ce9d19..7e9149987 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java +++ b/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java @@ -5,7 +5,7 @@ package appeng.items.tools.powered.powersink; public class UniversalElectricity extends ThermalExpansion implements IItemElectric { * - * public UniversalElectricity(Class c, String subname) { super( c, subname ); } + * public UniversalElectricity(Class c, String subName) { super( c, subName ); } * * @Override public float recharge(ItemStack is, float energy, boolean * doRecharge) { return (float) (energy - injectExternalPower( PowerUnits.KJ, diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java index 5b6bdc336..2f9ff1879 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java @@ -21,6 +21,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature return feature; } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java index 7f476dfb5..7900c306e 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java @@ -26,6 +26,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem setMaxStackSize( 1 ); } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); @@ -59,7 +60,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public boolean onItemUse(ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitx, float hity, float hitz) + public boolean onItemUse(ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitX, float hitY, float hitZ) { if ( Platform.isServer() ) Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE ); diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java index cf057a489..8b419f225 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java @@ -21,6 +21,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature return feature; } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java index e7afe6604..33a82d70f 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java @@ -21,6 +21,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature return feature; } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java index 47788b85a..5f22805b0 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java @@ -21,6 +21,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature return feature; } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java index 551392791..871f18f2e 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java @@ -21,6 +21,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature return feature; } + @Override public boolean getIsRepairable(ItemStack a, ItemStack b) { return Platform.canRepair( type, a, b ); diff --git a/src/main/java/appeng/me/GridConnection.java b/src/main/java/appeng/me/GridConnection.java index 796df1a99..63f151dd7 100644 --- a/src/main/java/appeng/me/GridConnection.java +++ b/src/main/java/appeng/me/GridConnection.java @@ -95,7 +95,7 @@ public class GridConnection implements IGridConnection, IPathItem private boolean isNetworkABetter(GridNode a, GridNode b) { - return ((Grid) a.myGrid).isImportant > ((Grid) b.myGrid).isImportant || a.myGrid.size() > b.myGrid.size(); + return a.myGrid.isImportant > b.myGrid.isImportant || a.myGrid.size() > b.myGrid.size(); } @Override @@ -156,7 +156,7 @@ public class GridConnection implements IGridConnection, IPathItem @Override public IReadOnlyCollection getPossibleOptions() { - return new ReadOnlyCollection( Arrays.asList( new IPathItem[] { (IPathItem) a(), (IPathItem) b() } ) ); + return new ReadOnlyCollection( Arrays.asList( (IPathItem) a(), (IPathItem) b() ) ); } @Override diff --git a/src/main/java/appeng/me/GridNode.java b/src/main/java/appeng/me/GridNode.java index 816f6278a..a129e945d 100644 --- a/src/main/java/appeng/me/GridNode.java +++ b/src/main/java/appeng/me/GridNode.java @@ -39,7 +39,7 @@ public class GridNode implements IGridNode, IPathItem final static private MENetworkChannelsChanged event = new MENetworkChannelsChanged(); final static private int channelCount[] = new int[] { 0, 8, 32 }; - final List Connections = new LinkedList(); + final List Connections = new LinkedList(); GridStorage myStorage = null; IGridBlock gridProxy; @@ -167,14 +167,14 @@ public class GridNode implements IGridNode, IPathItem { Object tracker = new Object(); - LinkedList nextRun = new LinkedList(); + LinkedList nextRun = new LinkedList(); nextRun.add( this ); visitorIterationNumber = tracker; if ( g instanceof IGridConnectionVisitor ) { - LinkedList nextConn = new LinkedList(); + LinkedList nextConn = new LinkedList(); IGridConnectionVisitor gcv = (IGridConnectionVisitor) g; while (!nextRun.isEmpty()) @@ -183,7 +183,7 @@ public class GridNode implements IGridNode, IPathItem gcv.visitConnection( nextConn.poll() ); LinkedList thisRun = nextRun; - nextRun = new LinkedList(); + nextRun = new LinkedList(); for (GridNode n : thisRun) n.visitorConnection( tracker, g, nextRun, nextConn ); @@ -194,7 +194,7 @@ public class GridNode implements IGridNode, IPathItem while (!nextRun.isEmpty()) { LinkedList thisRun = nextRun; - nextRun = new LinkedList(); + nextRun = new LinkedList(); for (GridNode n : thisRun) n.visitorNode( tracker, g, nextRun ); @@ -277,7 +277,7 @@ public class GridNode implements IGridNode, IPathItem if ( con != null ) { - IGridNode os = (IGridNode) con.getOtherSide( this ); + IGridNode os = con.getOtherSide( this ); if ( os == node ) { // if this connection is no longer valid, destroy it. @@ -401,11 +401,11 @@ public class GridNode implements IGridNode, IPathItem return new ReadOnlyCollection( Connections ); } - public boolean hasConnection(IGridNode otherside) + public boolean hasConnection(IGridNode otherSide) { for (IGridConnection gc : Connections) { - if ( gc.a() == otherside || gc.b() == otherside ) + if ( gc.a() == otherSide || gc.b() == otherSide ) return true; } return false; diff --git a/src/main/java/appeng/me/GridSplitDetector.java b/src/main/java/appeng/me/GridSplitDetector.java index 523d464f6..222e80c26 100644 --- a/src/main/java/appeng/me/GridSplitDetector.java +++ b/src/main/java/appeng/me/GridSplitDetector.java @@ -21,4 +21,4 @@ class GridSplitDetector implements IGridVisitor return !pivotFound; } -}; +} diff --git a/src/main/java/appeng/me/GridStorage.java b/src/main/java/appeng/me/GridStorage.java index e64e3d508..789034a73 100644 --- a/src/main/java/appeng/me/GridStorage.java +++ b/src/main/java/appeng/me/GridStorage.java @@ -22,7 +22,7 @@ public class GridStorage implements IGridStorage final NBTTagCompound data; public boolean isDirty = false; - private WeakHashMap divlist = new WeakHashMap(); + private WeakHashMap divided = new WeakHashMap(); final GridStorageSearch mySearchEntry; // keep myself in the list until I'm // lost... @@ -52,8 +52,8 @@ public class GridStorage implements IGridStorage try { - byte[] dbata = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); - myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( dbata ) ); + byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); + myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( byteData ) ); } catch (Throwable t) { @@ -125,12 +125,12 @@ public class GridStorage implements IGridStorage public void addDivided(GridStorage gs) { - divlist.put( gs, true ); + divided.put( gs, true ); } public boolean hasDivided(GridStorage myStorage) { - return divlist.containsKey( myStorage ); + return divided.containsKey( myStorage ); } public void remove() diff --git a/src/main/java/appeng/me/GridStorageSearch.java b/src/main/java/appeng/me/GridStorageSearch.java index 6f2770ea3..db8028cfa 100644 --- a/src/main/java/appeng/me/GridStorageSearch.java +++ b/src/main/java/appeng/me/GridStorageSearch.java @@ -22,10 +22,11 @@ public class GridStorageSearch { if ( obj == null ) return false; + if ( getClass() != obj.getClass() ) + return false; - GridStorageSearch b = (GridStorageSearch) obj; - - if ( id == b.id ) + GridStorageSearch other = (GridStorageSearch) obj; + if ( id == other.id ) return true; return false; diff --git a/src/main/java/appeng/me/NetworkEventBus.java b/src/main/java/appeng/me/NetworkEventBus.java index 476818ff5..b73d2404e 100644 --- a/src/main/java/appeng/me/NetworkEventBus.java +++ b/src/main/java/appeng/me/NetworkEventBus.java @@ -19,7 +19,7 @@ public class NetworkEventBus private static final long serialVersionUID = -3079021487019171205L; - }; + } class EventMethod { @@ -52,12 +52,12 @@ public class NetworkEventBus if ( e.isCanceled() ) throw new NetworkEventDone(); } - }; + } class MENetworkEventInfo { - private ArrayList methods = new ArrayList(); + private ArrayList methods = new ArrayList(); public void Add(Class Event, Class ObjClass, Method ObjMethod) { @@ -69,10 +69,10 @@ public class NetworkEventBus for (EventMethod em : methods) em.invoke( obj, e ); } - }; + } - private static Set readClasses = new HashSet(); - private static Hashtable, Hashtable> events = new Hashtable(); + private static Set readClasses = new HashSet(); + private static Hashtable, Hashtable> events = new Hashtable, Hashtable>(); public void readClass(Class listAs, Class c) { @@ -95,7 +95,7 @@ public class NetworkEventBus Hashtable classEvents = events.get( types[0] ); if ( classEvents == null ) - events.put( types[0], classEvents = new Hashtable() ); + events.put( types[0], classEvents = new Hashtable() ); MENetworkEventInfo thisEvent = classEvents.get( listAs ); if ( thisEvent == null ) diff --git a/src/main/java/appeng/me/NetworkList.java b/src/main/java/appeng/me/NetworkList.java index a2336afb4..849ec0e3a 100644 --- a/src/main/java/appeng/me/NetworkList.java +++ b/src/main/java/appeng/me/NetworkList.java @@ -8,7 +8,7 @@ import java.util.List; public class NetworkList implements Collection { - private List networks = new LinkedList(); + private List networks = new LinkedList(); @Override public boolean add(Grid e) diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index a6863c71e..f813c1d38 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -68,8 +68,8 @@ import com.google.common.collect.SetMultimap; public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler { - HashSet cpuClusters = new HashSet(); - HashSet providers = new HashSet(); + HashSet cpuClusters = new HashSet(); + HashSet providers = new HashSet(); private HashMap watchers = new HashMap(); @@ -77,14 +77,14 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper IStorageGrid sg; IEnergyGrid eg; - HashMap> craftingMethods = new HashMap(); - HashMap> craftableItems = new HashMap(); - HashSet emitableItems = new HashSet(); - HashMap links = new HashMap(); + HashMap> craftingMethods = new HashMap>(); + HashMap> craftableItems = new HashMap>(); + HashSet emitableItems = new HashSet(); + HashMap links = new HashMap(); boolean updateList = false; - final private SetMultimap interests = HashMultimap.create(); - final public GenericInterestManager interestManager = new GenericInterestManager( interests ); + final private SetMultimap interests = HashMultimap.create(); + final public GenericInterestManager interestManager = new GenericInterestManager( interests ); class ActiveCpuIterator implements Iterator { @@ -128,7 +128,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper // no.. } - }; + } @Override public ImmutableSet getCpus() @@ -209,12 +209,12 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if ( machine instanceof ICraftingRequester ) { - Iterator nex = links.values().iterator(); - while (nex.hasNext()) + for (CraftingLinkNexus n : links.values()) { - CraftingLinkNexus n = nex.next(); if ( n.isMachine( machine ) ) + { n.removeNode(); + } } } @@ -233,7 +233,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if ( machine instanceof ICraftingWatcherHost ) { ICraftingWatcherHost swh = (ICraftingWatcherHost) machine; - CraftingWatcher iw = new CraftingWatcher( this, (ICraftingWatcherHost) swh ); + CraftingWatcher iw = new CraftingWatcher( this, swh ); watchers.put( gridNode, iw ); swh.updateWatcher( iw ); } @@ -262,13 +262,13 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper for (IGridNode cst : grid.getMachines( TileCraftingStorageTile.class )) { TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); - CraftingCPUCluster clust = (CraftingCPUCluster) tile.getCluster(); - if ( clust != null ) + CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); + if ( cluster != null ) { - cpuClusters.add( clust ); + cpuClusters.add( cluster ); - if ( clust.myLastLink != null ) - addLink( (CraftingLink) clust.myLastLink ); + if ( cluster.myLastLink != null ) + addLink( (CraftingLink) cluster.myLastLink ); } } } @@ -301,7 +301,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper // erase list. craftingMethods.clear(); - craftableItems = new HashMap(); + craftableItems = new HashMap>(); emitableItems.clear(); // update the stuff that was in the list... @@ -311,7 +311,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper for (ICraftingProvider cp : providers) cp.provideCrafting( this ); - HashMap> tmpCraft = new HashMap(); + HashMap> tmpCraft = new HashMap>(); // new craftables! for (ICraftingPatternDetails details : craftingMethods.keySet()) @@ -420,7 +420,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper public boolean canAccept(IAEStack input) { for (CraftingCPUCluster cpu : cpuClusters) - if ( cpu.canAccept( (IAEItemStack) input ) ) + if ( cpu.canAccept( input ) ) return true; return false; @@ -433,10 +433,10 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if ( job.isSimulation() ) return null; - CraftingCPUCluster cpuClust = null; + CraftingCPUCluster cpuCluster = null; if ( target instanceof CraftingCPUCluster ) - cpuClust = (CraftingCPUCluster) target; + cpuCluster = (CraftingCPUCluster) target; if ( target == null ) { @@ -471,12 +471,12 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } ); if ( !validCpusClusters.isEmpty() ) - cpuClust = validCpusClusters.get( 0 ); + cpuCluster = validCpusClusters.get( 0 ); } - if ( cpuClust != null ) + if ( cpuCluster != null ) { - return cpuClust.submitJob( grid, job, src, requestingMachine ); + return cpuCluster.submitJob( grid, job, src, requestingMachine ); } return null; diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index 69839567e..5e3616437 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -71,30 +71,30 @@ public class EnergyGridCache implements IEnergyGrid double extra = 0; IAEPowerStorage lastProvider; - final Set providers = new LinkedHashSet(); + final Set providers = new LinkedHashSet(); - IAEPowerStorage lastRequestor; - final Set requesters = new LinkedHashSet(); + IAEPowerStorage lastRequester; + final Set requesters = new LinkedHashSet(); final public TreeSet interests = new TreeSet(); final private HashMap watchers = new HashMap(); - final private Set localSeen = new HashSet(); + final private Set localSeen = new HashSet(); private double buffer() { return providers.isEmpty() ? 1000.0 : 0.0; } - private IAEPowerStorage getFirstRequestor() + private IAEPowerStorage getFirstRequester() { - if ( lastRequestor == null ) + if ( lastRequester == null ) { Iterator i = requesters.iterator(); - lastRequestor = i.hasNext() ? i.next() : null; + lastRequester = i.hasNext() ? i.next() : null; } - return lastRequestor; + return lastRequester; } private IAEPowerStorage getFirstProvider() @@ -108,7 +108,7 @@ public class EnergyGridCache implements IEnergyGrid return lastProvider; } - final Multiset gproviders = HashMultiset.create(); + final Multiset energyGridProviders = HashMultiset.create(); final IGrid myGrid; PathGridCache pgc; @@ -167,6 +167,7 @@ public class EnergyGridCache implements IEnergyGrid return getEnergyDemand( maxRequired, localSeen ); } + @Override public double getEnergyDemand(double maxRequired, Set seen) { if ( !seen.add( this ) ) @@ -182,7 +183,7 @@ public class EnergyGridCache implements IEnergyGrid required += Math.max( 0.0, node.getAEMaxPower() - node.getAECurrentPower() ); } - Iterator ix = gproviders.iterator(); + Iterator ix = energyGridProviders.iterator(); while (required < maxRequired && ix.hasNext()) { IEnergyGridProvider node = ix.next(); @@ -199,6 +200,7 @@ public class EnergyGridCache implements IEnergyGrid return injectAEPower( amt, mode, localSeen ); } + @Override public double injectAEPower(double amt, Actionable mode, Set seen) { if ( !seen.add( this ) ) @@ -216,7 +218,7 @@ public class EnergyGridCache implements IEnergyGrid amt = node.injectAEPower( amt, Actionable.SIMULATE ); } - Iterator i = gproviders.iterator(); + Iterator i = energyGridProviders.iterator(); while (amt > 0 && i.hasNext()) amt = i.next().injectAEPower( amt, mode, seen ); } @@ -227,17 +229,17 @@ public class EnergyGridCache implements IEnergyGrid while (amt > 0 && !requesters.isEmpty()) { - IAEPowerStorage node = getFirstRequestor(); + IAEPowerStorage node = getFirstRequester(); amt = node.injectAEPower( amt, Actionable.MODULATE ); if ( amt > 0 ) { requesters.remove( node ); - lastRequestor = null; + lastRequester = null; } } - Iterator i = gproviders.iterator(); + Iterator i = energyGridProviders.iterator(); while (amt > 0 && i.hasNext()) { IEnergyGridProvider what = i.next(); @@ -267,13 +269,13 @@ public class EnergyGridCache implements IEnergyGrid public void addNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) - gproviders.add( (IEnergyGridProvider) machine ); + energyGridProviders.add( (IEnergyGridProvider) machine ); // idle draw... - GridNode gnode = (GridNode) node; - IGridBlock gb = gnode.getGridBlock(); - gnode.previousDraw = gb.getIdlePowerUsage(); - drainPerTick += gnode.previousDraw; + GridNode gridNode = (GridNode) node; + IGridBlock gb = gridNode.getGridBlock(); + gridNode.previousDraw = gb.getIdlePowerUsage(); + drainPerTick += gridNode.previousDraw; // power storage if ( machine instanceof IAEPowerStorage ) @@ -303,7 +305,7 @@ public class EnergyGridCache implements IEnergyGrid if ( machine instanceof IEnergyWatcherHost ) { IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; - EnergyWatcher iw = new EnergyWatcher( this, (IEnergyWatcherHost) swh ); + EnergyWatcher iw = new EnergyWatcher( this, swh ); watchers.put( node, iw ); swh.updateWatcher( iw ); } @@ -315,11 +317,11 @@ public class EnergyGridCache implements IEnergyGrid public void removeNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) - gproviders.remove( machine ); + energyGridProviders.remove( machine ); // idle draw. - GridNode gnode = (GridNode) node; - drainPerTick -= gnode.previousDraw; + GridNode gridNode = (GridNode) node; + drainPerTick -= gridNode.previousDraw; // power storage. if ( machine instanceof IAEPowerStorage ) @@ -336,8 +338,8 @@ public class EnergyGridCache implements IEnergyGrid if ( lastProvider == machine ) lastProvider = null; - if ( lastRequestor == machine ) - lastRequestor = null; + if ( lastRequester == machine ) + lastRequester = null; providers.remove( machine ); requesters.remove( machine ); @@ -464,7 +466,7 @@ public class EnergyGridCache implements IEnergyGrid if ( extractedPower < amt ) { - Iterator i = gproviders.iterator(); + Iterator i = energyGridProviders.iterator(); while (extractedPower < amt && i.hasNext()) extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); } @@ -489,7 +491,7 @@ public class EnergyGridCache implements IEnergyGrid if ( extractedPower < amt ) { - Iterator i = gproviders.iterator(); + Iterator i = energyGridProviders.iterator(); while (extractedPower < amt && i.hasNext()) extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); } diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 1c03e47e1..7ffb6bf58 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -39,10 +39,10 @@ public class GridStorageCache implements IStorageGrid { final private SetMultimap interests = HashMultimap.create(); - final public GenericInterestManager interestManager = new GenericInterestManager( interests ); + final public GenericInterestManager interestManager = new GenericInterestManager( interests ); - final HashSet activeCellProviders = new HashSet(); - final HashSet inactiveCellProviders = new HashSet(); + final HashSet activeCellProviders = new HashSet(); + final HashSet inactiveCellProviders = new HashSet(); final public IGrid myGrid; private NetworkInventoryHandler myItemNetwork; @@ -90,12 +90,12 @@ public class GridStorageCache implements IStorageGrid postChangesToNetwork( channel, up_or_down, list, src ); } - }; + } private class CellChangeTracker { - List data = new LinkedList(); + List data = new LinkedList(); public void postChanges(StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc) { @@ -107,7 +107,7 @@ public class GridStorageCache implements IStorageGrid for (CellChangeTrackerRecord rec : data) rec.applyChanges(); } - }; + } @Override public void registerCellProvider(ICellProvider provider) @@ -249,7 +249,7 @@ public class GridStorageCache implements IStorageGrid if ( machine instanceof IStackWatcherHost ) { IStackWatcherHost swh = (IStackWatcherHost) machine; - ItemWatcher iw = new ItemWatcher( this, (IStackWatcherHost) swh ); + ItemWatcher iw = new ItemWatcher( this, swh ); watchers.put( node, iw ); swh.updateWatcher( iw ); } @@ -286,10 +286,10 @@ public class GridStorageCache implements IStorageGrid switch (chan) { case FLUIDS: - fluidMonitor.postChange( up_or_down > 0, (IItemList) availableItems, src ); + fluidMonitor.postChange( up_or_down > 0, availableItems, src ); break; case ITEMS: - itemMonitor.postChange( up_or_down > 0, (IItemList) availableItems, src ); + itemMonitor.postChange( up_or_down > 0, availableItems, src ); break; default: } diff --git a/src/main/java/appeng/me/cache/NetworkMonitor.java b/src/main/java/appeng/me/cache/NetworkMonitor.java index 522714d2d..8e2c5bb7f 100644 --- a/src/main/java/appeng/me/cache/NetworkMonitor.java +++ b/src/main/java/appeng/me/cache/NetworkMonitor.java @@ -31,10 +31,10 @@ public class NetworkMonitor> extends MEMonitorHandler while (i.hasNext()) { Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver recv = o.getKey(); + IMEMonitorHandlerReceiver receiver = o.getKey(); - if ( recv.isValid( o.getValue() ) ) - recv.onListUpdate(); + if ( receiver.isValid( o.getValue() ) ) + receiver.onListUpdate(); else i.remove(); } diff --git a/src/main/java/appeng/me/cache/P2PCache.java b/src/main/java/appeng/me/cache/P2PCache.java index e884f030f..d94824f33 100644 --- a/src/main/java/appeng/me/cache/P2PCache.java +++ b/src/main/java/appeng/me/cache/P2PCache.java @@ -22,7 +22,7 @@ import com.google.common.collect.Multimap; public class P2PCache implements IGridCache { - final private HashMap inputs = new HashMap(); + final private HashMap inputs = new HashMap(); final private Multimap outputs = LinkedHashMultimap.create(); final private TunnelCollection NullColl = new TunnelCollection( null, null ); @@ -33,7 +33,7 @@ public class P2PCache implements IGridCache } @MENetworkEventSubscribe - public void bootComplete(MENetworkBootingStatusChange bootstat) + public void bootComplete(MENetworkBootingStatusChange bootStatus) { ITickManager tm = myGrid.getCache( ITickManager.class ); for (PartP2PTunnel me : inputs.values()) diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index c5501babb..8cfed617d 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -43,7 +43,7 @@ public class PathGridCache implements IPathingGrid boolean updateNetwork = true; boolean booting = false; - final LinkedList active = new LinkedList(); + final LinkedList active = new LinkedList(); ControllerState controllerState = ControllerState.NO_CONTROLLER; @@ -53,13 +53,13 @@ public class PathGridCache implements IPathingGrid public int channelsInUse = 0; int lastChannels = 0; - final Set controllers = new HashSet(); - final Set requireChannels = new HashSet(); - final Set blockDense = new HashSet(); + final Set controllers = new HashSet(); + final Set requireChannels = new HashSet(); + final Set blockDense = new HashSet(); final IGrid myGrid; - private HashSet semiOpen = new HashSet(); - private HashSet closedList = new HashSet(); + private HashSet semiOpen = new HashSet(); + private HashSet closedList = new HashSet(); public int channelsByBlocks = 0; public double channelPowerUsage = 0.0; @@ -94,7 +94,7 @@ public class PathGridCache implements IPathingGrid int nodes = myGrid.getNodes().size(); ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); channelsByBlocks = nodes * used; - channelPowerUsage = (double) channelsByBlocks / 128.0; + channelPowerUsage = channelsByBlocks / 128.0; myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); } @@ -110,7 +110,7 @@ public class PathGridCache implements IPathingGrid ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); channelsByBlocks = nodes * used; - channelPowerUsage = (double) channelsByBlocks / 128.0; + channelPowerUsage = channelsByBlocks / 128.0; myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) ); } @@ -177,7 +177,7 @@ public class PathGridCache implements IPathingGrid achievementPost(); booting = false; - channelPowerUsage = (double) channelsByBlocks / 128.0; + channelPowerUsage = channelsByBlocks / 128.0; myGrid.postEvent( new MENetworkBootingStatusChange() ); } } diff --git a/src/main/java/appeng/me/cache/SecurityCache.java b/src/main/java/appeng/me/cache/SecurityCache.java index fa3af5ca4..0aad933fd 100644 --- a/src/main/java/appeng/me/cache/SecurityCache.java +++ b/src/main/java/appeng/me/cache/SecurityCache.java @@ -22,7 +22,7 @@ import appeng.me.GridNode; public class SecurityCache implements IGridCache, ISecurityGrid { - final private List securityProvider = new ArrayList(); + final private List securityProvider = new ArrayList(); final private HashMap> playerPerms = new HashMap>(); public SecurityCache(IGrid g) { @@ -101,7 +101,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid { if ( machine instanceof ISecurityProvider ) { - securityProvider.remove( (ISecurityProvider) machine ); + securityProvider.remove( machine ); updateSecurityKey(); } } diff --git a/src/main/java/appeng/me/cache/SpatialPylonCache.java b/src/main/java/appeng/me/cache/SpatialPylonCache.java index cac5ab50d..2ed3946bc 100644 --- a/src/main/java/appeng/me/cache/SpatialPylonCache.java +++ b/src/main/java/appeng/me/cache/SpatialPylonCache.java @@ -29,8 +29,8 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache DimensionalCoord captureMax; boolean isValid = false; - List ioPorts = new LinkedList(); - HashMap clusters = new HashMap(); + List ioPorts = new LinkedList(); + HashMap clusters = new HashMap(); boolean needsUpdate = false; @@ -80,8 +80,8 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache double minPower = 0; double maxPower = 0; - clusters = new HashMap(); - ioPorts = new LinkedList(); + clusters = new HashMap(); + ioPorts = new LinkedList(); for (IGridNode gm : grid.getMachines( TileSpatialIOPort.class )) { @@ -167,7 +167,7 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache efficiency = 0.0; minPower = (double) reqX * (double) reqY * reqZ * AEConfig.instance.spatialPowerMultiplier; - maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerScaler ); + maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerExponent ); } double affective_efficiency = Math.pow( efficiency, 0.25 ); diff --git a/src/main/java/appeng/me/cache/helpers/Connections.java b/src/main/java/appeng/me/cache/helpers/Connections.java index 62baa52ef..03fbe38ce 100644 --- a/src/main/java/appeng/me/cache/helpers/Connections.java +++ b/src/main/java/appeng/me/cache/helpers/Connections.java @@ -10,7 +10,7 @@ public class Connections implements Callable { final private PartP2PTunnelME me; - final public HashMap connections = new HashMap(); + final public HashMap connections = new HashMap(); public boolean create = false; public boolean destroy = false; @@ -39,4 +39,4 @@ public class Connections implements Callable destroy = false; } -}; +} diff --git a/src/main/java/appeng/me/cache/helpers/TickTracker.java b/src/main/java/appeng/me/cache/helpers/TickTracker.java index 1fb377935..2cecd3fec 100644 --- a/src/main/java/appeng/me/cache/helpers/TickTracker.java +++ b/src/main/java/appeng/me/cache/helpers/TickTracker.java @@ -73,4 +73,4 @@ public class TickTracker implements Comparable if ( dc != null ) crashreportcategory.addCrashSection( "Location", dc ); } -}; +} diff --git a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java index 05921caaa..ad2af703c 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java @@ -10,24 +10,24 @@ public class TunnelCollection implements Iterable { final Class clz; - Collection tunnelsource; + Collection tunnelSources; public TunnelCollection(Collection src, Class c) { - tunnelsource = src; + tunnelSources = src; clz = c; } @Override public Iterator iterator() { - if ( tunnelsource == null ) - return new NullIterator(); - return new TunnelIterator( tunnelsource, clz ); + if ( tunnelSources == null ) + return new NullIterator(); + return new TunnelIterator( tunnelSources, clz ); } public void setSource(Collection c) { - tunnelsource = c; + tunnelSources = c; } public boolean isEmpty() diff --git a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java index a4ec4676d..e752ec3fc 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java @@ -22,8 +22,8 @@ public class TunnelIterator implements Iterator } } - public TunnelIterator(Collection tunnelsource, Class clz) { - wrapped = tunnelsource.iterator(); + public TunnelIterator(Collection tunnelSources, Class clz) { + wrapped = tunnelSources.iterator(); targetType = clz; findNext(); } diff --git a/src/main/java/appeng/me/cluster/MBCalculator.java b/src/main/java/appeng/me/cluster/MBCalculator.java index f3bd6a721..d3cc27beb 100644 --- a/src/main/java/appeng/me/cluster/MBCalculator.java +++ b/src/main/java/appeng/me/cluster/MBCalculator.java @@ -35,7 +35,7 @@ public abstract class MBCalculator public abstract IAECluster createCluster(World w, WorldCoord min, WorldCoord max); /** - * configure the mutli-block tiles, most of the important stuff is in here. + * configure the multi-block tiles, most of the important stuff is in here. * * @param c updated cluster * @param w in world @@ -110,15 +110,15 @@ public abstract class MBCalculator } boolean updateGrid = false; - IAECluster clust = target.getCluster(); - if ( clust == null ) + IAECluster cluster = target.getCluster(); + if ( cluster == null ) { updateTiles( c, w, min, max ); updateGrid = true; } else - c = clust; + c = cluster; c.updateStatus( updateGrid ); return; @@ -135,43 +135,43 @@ public abstract class MBCalculator public abstract boolean verifyInternalStructure(World worldObj, WorldCoord min, WorldCoord max); - public boolean verifyUnownedRegionInner(World w, int minx, int miny, int minz, int maxx, int maxy, int maxz, ForgeDirection side) + public boolean verifyUnownedRegionInner(World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ForgeDirection side) { switch (side) { case WEST: - minx -= 1; - maxx = minx; + minX -= 1; + maxX = minX; break; case EAST: - maxx += 1; - minx = maxx; + maxX += 1; + minX = maxX; break; case DOWN: - miny -= 1; - maxy = miny; + minY -= 1; + maxY = minY; break; case NORTH: - maxz += 1; - minz = maxz; + maxZ += 1; + minZ = maxZ; break; case SOUTH: - minz -= 1; - maxz = minz; + minZ -= 1; + maxZ = minZ; break; case UP: - maxy += 1; - miny = maxy; + maxY += 1; + minY = maxY; break; case UNKNOWN: return false; } - for (int x = minx; x <= maxx; x++) + for (int x = minX; x <= maxX; x++) { - for (int y = miny; y <= maxy; y++) + for (int y = minY; y <= maxY; y++) { - for (int z = minz; z <= maxz; z++) + for (int z = minZ; z <= maxZ; z++) { TileEntity te = w.getTileEntity( x, y, z ); if ( isValidTile( te ) ) diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index e03e328e7..a93060d6b 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -1,11 +1,7 @@ package appeng.me.cluster.implementations; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Set; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -67,7 +63,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU long value; - }; + } /** * crafting job info @@ -83,7 +79,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU IItemList waitingFor = AEApi.instance().storage().createItemList(); // instance sate - final private LinkedList tiles = new LinkedList(); + final private LinkedList tiles = new LinkedList(); final private LinkedList storage = new LinkedList(); final private LinkedList status = new LinkedList(); @@ -118,9 +114,9 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU while (i.hasNext()) { Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver recv = o.getKey(); - if ( recv.isValid( o.getValue() ) ) - recv.postChange( null, single, src ); + IMEMonitorHandlerReceiver receiver = o.getKey(); + if ( receiver.isValid( o.getValue() ) ) + receiver.postChange( null, single, src ); else i.remove(); } @@ -290,9 +286,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( sg.interestManager.containsKey( diff ) ) { Set list = sg.interestManager.get( diff ); + if ( !list.isEmpty() ) { for (CraftingWatcher iw : list) + iw.getHost().onRequestChange( sg, diff ); } } @@ -313,7 +311,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( finalOutput.equals( what ) ) { if ( myLastLink != null ) - return ((CraftingLink) myLastLink).injectItems( (IAEItemStack) what.copy(), type ); + return ((CraftingLink) myLastLink).injectItems( what.copy(), type ); return what; // ignore it. } @@ -331,7 +329,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU { if ( myLastLink != null ) { - leftOver.add( ((CraftingLink) myLastLink).injectItems( (IAEItemStack) used.copy(), type ) ); + leftOver.add( ((CraftingLink) myLastLink).injectItems( used.copy(), type ) ); return leftOver; } @@ -391,7 +389,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( myLastLink != null ) { - what.add( ((CraftingLink) myLastLink).injectItems( (IAEItemStack) insert.copy(), type ) ); + what.add( ((CraftingLink) myLastLink).injectItems( insert.copy(), type ) ); return what; } @@ -552,21 +550,21 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU { do { - didsomething = false; + somethingChanged = false; executeCrafting( eg, cc ); } - while (didsomething && remainingOperations > 0); + while (somethingChanged && remainingOperations > 0); } usedOps[2] = usedOps[1]; usedOps[1] = usedOps[0]; usedOps[0] = started - remainingOperations; - if ( remainingOperations > 0 && didsomething == false ) + if ( remainingOperations > 0 && somethingChanged == false ) waiting = true; } private int remainingOperations; - private boolean didsomething; + private boolean somethingChanged; private void executeCrafting(IEnergyGrid eg, CraftingGridCache cc) { @@ -597,10 +595,12 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU IAEItemStack[] input = details.getInputs(); double sum = 0; - for (int x = 0; x < input.length; x++) + for (IAEItemStack anInput : input) { - if ( input[x] != null ) - sum += input[x].getStackSize(); + if ( anInput != null ) + { + sum += anInput.getStackSize(); + } } // power... @@ -677,7 +677,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( m.pushPattern( details, ic ) ) { - didsomething = true; + somethingChanged = true; remainingOperations--; for (IAEItemStack out : details.getCondensedOutputs()) @@ -802,7 +802,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( requestingMachine == null ) return myLastLink; - ICraftingLink whatLink = new CraftingLink( generateLinkData( craftID, requestingMachine == null, true ), requestingMachine ); + ICraftingLink whatLink = new CraftingLink( generateLinkData( craftID, false, true ), requestingMachine ); submitLink( myLastLink ); submitLink( whatLink ); diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java index baa0597b6..8284c025d 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java @@ -61,7 +61,7 @@ public class QuantumCalculator extends MBCalculator num++; if ( num == 5 ) { - flags = (byte) (num); + flags = num; c.setCenter( te ); } else @@ -69,7 +69,7 @@ public class QuantumCalculator extends MBCalculator if ( num == 1 || num == 3 || num == 7 || num == 9 ) flags = (byte) (tqb.corner | num); else - flags = (byte) (num); + flags = num; c.Ring[ringNum++] = te; } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 0f4859d7c..c1a2aae53 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -62,7 +62,7 @@ public class QuantumCluster implements ILocatable, IAECluster public boolean canUseNode(long qe) { QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().findLocatableBySerial( qe ); - if ( qc != null && qc.center instanceof TileQuantumBridge ) + if ( qc != null ) { World theWorld = qc.getCenter().getWorldObj(); if ( !qc.isDestroyed ) @@ -133,7 +133,7 @@ public class QuantumCluster implements ILocatable, IAECluster if ( myOtherSide instanceof QuantumCluster ) { - QuantumCluster sideA = (QuantumCluster) this; + QuantumCluster sideA = this; QuantumCluster sideB = (QuantumCluster) myOtherSide; if ( sideA.isActive() && sideB.isActive() ) diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java index 4339e1f45..687ae07b7 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java @@ -15,7 +15,7 @@ public class SpatialPylonCluster implements IAECluster public enum Axis { X, Y, Z, UNFORMED - }; + } final public DimensionalCoord min; final public DimensionalCoord max; @@ -23,7 +23,7 @@ public class SpatialPylonCluster implements IAECluster public Axis currentAxis = Axis.UNFORMED; - final List line = new ArrayList(); + final List line = new ArrayList(); public boolean isValid; public boolean hasPower; public boolean hasChannel; diff --git a/src/main/java/appeng/me/energy/EnergyWatcher.java b/src/main/java/appeng/me/energy/EnergyWatcher.java index 56aadd27a..068fc7782 100644 --- a/src/main/java/appeng/me/energy/EnergyWatcher.java +++ b/src/main/java/appeng/me/energy/EnergyWatcher.java @@ -46,11 +46,11 @@ public class EnergyWatcher implements IEnergyWatcher interestIterator.remove(); } - }; + } EnergyGridCache gsc; IEnergyWatcherHost myObject; - HashSet myInterests = new HashSet(); + HashSet myInterests = new HashSet(); public void post(EnergyGridCache energyGridCache) { diff --git a/src/main/java/appeng/me/helpers/GenericInterestManager.java b/src/main/java/appeng/me/helpers/GenericInterestManager.java index 3cefd70e8..37dd217cc 100644 --- a/src/main/java/appeng/me/helpers/GenericInterestManager.java +++ b/src/main/java/appeng/me/helpers/GenericInterestManager.java @@ -22,7 +22,7 @@ public class GenericInterestManager stack = myStack; iw = watcher; } - }; + } private final SetMultimap container; private LinkedList transactions = null; @@ -35,7 +35,7 @@ public class GenericInterestManager public void enableTransactions() { if ( transDepth == 0 ) - transactions = new LinkedList(); + transactions = new LinkedList(); transDepth++; } diff --git a/src/main/java/appeng/me/pathfinding/PathSegment.java b/src/main/java/appeng/me/pathfinding/PathSegment.java index 0f514ea02..31629dd0d 100644 --- a/src/main/java/appeng/me/pathfinding/PathSegment.java +++ b/src/main/java/appeng/me/pathfinding/PathSegment.java @@ -21,27 +21,27 @@ public class PathSegment private static final long serialVersionUID = 810456465120286110L; - }; + } PathGridCache pgc; - public PathSegment(PathGridCache myPGC, List open, Set semiopen, Set closed) + public PathSegment(PathGridCache myPGC, List open, Set semiOpen, Set closed) { this.open = open; - this.semiopen = semiopen; + this.semiOpen = semiOpen; this.closed = closed; pgc = myPGC; isDead = false; } List open; - Set semiopen; + Set semiOpen; Set closed; public boolean step() { List oldOpen = open; - open = new LinkedList(); + open = new LinkedList(); for (IPathItem i : oldOpen) { @@ -56,7 +56,7 @@ public class PathSegment if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { // close the semi open. - if ( !semiopen.contains( pi ) ) + if ( !semiOpen.contains( pi ) ) { boolean worked = false; @@ -72,14 +72,14 @@ public class PathSegment { IGridNode otherNodes = oni.next(); if ( otherNodes != pi ) - semiopen.add( (IPathItem) otherNodes ); + semiOpen.add( (IPathItem) otherNodes ); } } } else { pi.incrementChannelCount( 1 ); // give a channel. - semiopen.remove( pi ); + semiOpen.remove( pi ); } } diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index 770342a36..2e0808e74 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -31,14 +31,14 @@ public class CellInventory implements ICellInventory static final String ITEM_TYPE_TAG = "it"; static final String ITEM_COUNT_TAG = "ic"; static final String ITEM_SLOT = "#"; - static final String ITEM_SLOTCOUNT = "@"; + static final String ITEM_SLOT_COUNT = "@"; static final String ITEM_PRE_FORMATTED_COUNT = "PF"; static final String ITEM_PRE_FORMATTED_SLOT = "PF#"; static final String ITEM_PRE_FORMATTED_NAME = "PN"; static final String ITEM_PRE_FORMATTED_FUZZY = "FP"; static protected String[] ITEM_SLOT_ARR; - static protected String[] ITEM_SLOTCOUNT_ARR; + static protected String[] ITEM_SLOT_COUNT_ARR; final protected NBTTagCompound tagCompound; protected int MAX_ITEM_TYPES = 63; @@ -70,7 +70,7 @@ public class CellInventory implements ICellInventory ItemStack t = ItemStack.loadItemStackFromNBT( tagCompound.getCompoundTag( ITEM_SLOT_ARR[x] ) ); if ( t != null ) { - t.stackSize = tagCompound.getInteger( ITEM_SLOTCOUNT_ARR[x] ); + t.stackSize = tagCompound.getInteger( ITEM_SLOT_COUNT_ARR[x] ); if ( t.stackSize > 0 ) { @@ -89,15 +89,15 @@ public class CellInventory implements ICellInventory // add new pretty stuff... int x = 0; - Iterator i = cellItems.iterator(); - while (i.hasNext()) + for (IAEItemStack v : cellItems) { - IAEItemStack v = i.next(); itemCount += v.getStackSize(); NBTBase c = tagCompound.getTag( ITEM_SLOT_ARR[x] ); if ( c instanceof NBTTagCompound ) + { v.writeToNBT( (NBTTagCompound) c ); + } else { NBTTagCompound g = new NBTTagCompound(); @@ -106,17 +106,17 @@ public class CellInventory implements ICellInventory } /* - * NBTBase tagSlotCount = tagCompound.getTag( ITEM_SLOTCOUNT_ARR[x] ); if ( tagSlotCount instanceof + * NBTBase tagSlotCount = tagCompound.getTag( ITEM_SLOT_COUNT_ARR[x] ); if ( tagSlotCount instanceof * NBTTagInt ) ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else */ - tagCompound.setInteger( ITEM_SLOTCOUNT_ARR[x], (int) v.getStackSize() ); + tagCompound.setInteger( ITEM_SLOT_COUNT_ARR[x], (int) v.getStackSize() ); x++; } // NBTBase tagType = tagCompound.getTag( ITEM_TYPE_TAG ); // NBTBase tagCount = tagCompound.getTag( ITEM_COUNT_TAG ); - short oldStoreditems = storedItems; + short oldStoredItems = storedItems; /* * if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size(); @@ -130,10 +130,10 @@ public class CellInventory implements ICellInventory tagCompound.setInteger( ITEM_COUNT_TAG, storedItemCount = itemCount ); // clean any old crusty stuff... - for (; x < oldStoreditems && x < MAX_ITEM_TYPES; x++) + for (; x < oldStoredItems && x < MAX_ITEM_TYPES; x++) { tagCompound.removeTag( ITEM_SLOT_ARR[x] ); - tagCompound.removeTag( ITEM_SLOTCOUNT_ARR[x] ); + tagCompound.removeTag( ITEM_SLOT_COUNT_ARR[x] ); } if ( container != null ) @@ -144,12 +144,12 @@ public class CellInventory implements ICellInventory if ( ITEM_SLOT_ARR == null ) { ITEM_SLOT_ARR = new String[MAX_ITEM_TYPES]; - ITEM_SLOTCOUNT_ARR = new String[MAX_ITEM_TYPES]; + ITEM_SLOT_COUNT_ARR = new String[MAX_ITEM_TYPES]; for (int x = 0; x < MAX_ITEM_TYPES; x++) { ITEM_SLOT_ARR[x] = ITEM_SLOT + x; - ITEM_SLOTCOUNT_ARR[x] = ITEM_SLOTCOUNT + x; + ITEM_SLOT_COUNT_ARR[x] = ITEM_SLOT_COUNT + x; } } @@ -335,7 +335,7 @@ public class CellInventory implements ICellInventory return 8 - div; } - private static HashSet blackList = new HashSet(); + private static HashSet blackList = new HashSet(); public static void addBasicBlackList(int itemID, int Meta) { @@ -349,9 +349,9 @@ public class CellInventory implements ICellInventory return blackList.contains( (input.getItemDamage() << Platform.DEF_OFFSET) | Item.getIdFromItem( input.getItem() ) ); } - private boolean isEmpty(IMEInventory meinv) + private boolean isEmpty(IMEInventory meInventory) { - return meinv.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty(); + return meInventory.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty(); } @Override @@ -369,8 +369,8 @@ public class CellInventory implements ICellInventory if ( CellInventory.isStorageCell( sharedItemStack ) ) { - IMEInventory meinv = getCell( sharedItemStack, null ); - if ( meinv != null && !isEmpty( meinv ) ) + IMEInventory meInventory = getCell( sharedItemStack, null ); + if ( meInventory != null && !isEmpty( meInventory ) ) return input; } diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index e5f35a098..8c9e96c8f 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -32,8 +32,8 @@ public class CellInventoryHandler extends MEInventoryHandler imple { Object o = this.internal; - if ( o instanceof MEPassthru ) - o = ((MEPassthru) o).getInternal(); + if ( o instanceof MEPassThrough ) + o = ((MEPassThrough) o).getInternal(); return (ICellInventory) (o instanceof ICellInventory ? o : null); } @@ -94,11 +94,13 @@ public class CellInventoryHandler extends MEInventoryHandler imple } } + @Override public boolean isPreformatted() { return ! myPartitionList.isEmpty(); } + @Override public boolean isFuzzy() { return myPartitionList instanceof FuzzyPriorityList; diff --git a/src/main/java/appeng/me/storage/ItemWatcher.java b/src/main/java/appeng/me/storage/ItemWatcher.java index 0b65b7993..fab396b9b 100644 --- a/src/main/java/appeng/me/storage/ItemWatcher.java +++ b/src/main/java/appeng/me/storage/ItemWatcher.java @@ -46,11 +46,11 @@ public class ItemWatcher implements IStackWatcher interestIterator.remove(); } - }; + } GridStorageCache gsc; IStackWatcherHost myObject; - HashSet myInterests = new HashSet(); + HashSet myInterests = new HashSet(); public ItemWatcher(GridStorageCache cache, IStackWatcherHost host) { gsc = cache; diff --git a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java index 194e90941..f1561e402 100644 --- a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java +++ b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java @@ -184,7 +184,7 @@ public class MEIInventoryWrapper implements IMEInventory } @Override - public IItemList getAvailableItems(IItemList out) + public IItemList getAvailableItems(IItemList out) { for (int x = 0; x < target.getSizeInventory(); x++) { diff --git a/src/main/java/appeng/me/storage/MEInventoryHandler.java b/src/main/java/appeng/me/storage/MEInventoryHandler.java index 8bc33a730..0cf66a944 100644 --- a/src/main/java/appeng/me/storage/MEInventoryHandler.java +++ b/src/main/java/appeng/me/storage/MEInventoryHandler.java @@ -31,7 +31,7 @@ public class MEInventoryHandler> implements IMEInventoryHa if ( i instanceof IMEInventoryHandler ) internal = (IMEInventoryHandler) i; else - internal = new MEPassthru( i, channel ); + internal = new MEPassThrough( i, channel ); monitor = internal instanceof IMEMonitor ? (IMEMonitor) internal : null; } diff --git a/src/main/java/appeng/me/storage/MEMonitorIInventory.java b/src/main/java/appeng/me/storage/MEMonitorIInventory.java index c6ec818ca..c30179b3a 100644 --- a/src/main/java/appeng/me/storage/MEMonitorIInventory.java +++ b/src/main/java/appeng/me/storage/MEMonitorIInventory.java @@ -46,13 +46,13 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit final ItemStack itemStack; final IAEItemStack aeStack; - }; + } final InventoryAdaptor adaptor; final TreeMap memory; final IItemList list = AEApi.instance().storage().createItemList(); - final HashMap, Object> listeners = new HashMap(); + final HashMap, Object> listeners = new HashMap, Object>(); public BaseActionSource mySource; public StorageFilter mode = StorageFilter.EXTRACTABLE_ONLY; @@ -72,7 +72,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit public MEMonitorIInventory(InventoryAdaptor adaptor) { this.adaptor = adaptor; - memory = new TreeMap(); + memory = new TreeMap(); } @Override @@ -176,7 +176,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit CachedItemStack old = memory.get( is.slot ); high = Math.max( high, is.slot ); - ItemStack newIS = is == null || is.isExtractable == false && mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); + ItemStack newIS = is.isExtractable == false && mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); ItemStack oldIS = old == null ? null : old.itemStack; if ( isDifferent( newIS, oldIS ) ) @@ -190,7 +190,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit changes.add( old.aeStack ); } - if ( cis != null && cis.aeStack != null ) + if ( cis.aeStack != null ) { changes.add( cis.aeStack ); list.add( cis.aeStack ); @@ -198,7 +198,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit changed = true; } - else if ( is != null ) + else { int newSize = (newIS == null ? 0 : newIS.stackSize); int diff = newSize - (oldIS == null ? 0 : oldIS.stackSize); diff --git a/src/main/java/appeng/me/storage/MEMonitorPassthu.java b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java similarity index 84% rename from src/main/java/appeng/me/storage/MEMonitorPassthu.java rename to src/main/java/appeng/me/storage/MEMonitorPassThrough.java index 366149071..83993953d 100644 --- a/src/main/java/appeng/me/storage/MEMonitorPassthu.java +++ b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java @@ -15,15 +15,15 @@ import appeng.api.storage.data.IItemList; import appeng.util.Platform; import appeng.util.inv.ItemListIgnoreCrafting; -public class MEMonitorPassthu> extends MEPassthru implements IMEMonitor, IMEMonitorHandlerReceiver +public class MEMonitorPassThrough> extends MEPassThrough implements IMEMonitor, IMEMonitorHandlerReceiver { - HashMap, Object> listeners = new HashMap(); + HashMap, Object> listeners = new HashMap, Object>(); IMEMonitor monitor; public BaseActionSource changeSource; - public MEMonitorPassthu(IMEInventory i, StorageChannel channel) { + public MEMonitorPassThrough(IMEInventory i, StorageChannel channel) { super( i, channel ); if ( i instanceof IMEMonitor ) monitor = (IMEMonitor) i; @@ -96,9 +96,9 @@ public class MEMonitorPassthu> extends MEPassthru imple while (i.hasNext()) { Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver recv = e.getKey(); - if ( recv.isValid( e.getValue() ) ) - recv.postChange( this, change, source ); + IMEMonitorHandlerReceiver receiver = e.getKey(); + if ( receiver.isValid( e.getValue() ) ) + receiver.postChange( this, change, source ); else i.remove(); } @@ -111,9 +111,9 @@ public class MEMonitorPassthu> extends MEPassthru imple while (i.hasNext()) { Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver recv = e.getKey(); - if ( recv.isValid( e.getValue() ) ) - recv.onListUpdate(); + IMEMonitorHandlerReceiver receiver = e.getKey(); + if ( receiver.isValid( e.getValue() ) ) + receiver.onListUpdate(); else i.remove(); } diff --git a/src/main/java/appeng/me/storage/MEPassthru.java b/src/main/java/appeng/me/storage/MEPassThrough.java similarity index 91% rename from src/main/java/appeng/me/storage/MEPassthru.java rename to src/main/java/appeng/me/storage/MEPassThrough.java index 1763c8165..c95dfcecd 100644 --- a/src/main/java/appeng/me/storage/MEPassthru.java +++ b/src/main/java/appeng/me/storage/MEPassThrough.java @@ -9,7 +9,7 @@ import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; -public class MEPassthru> implements IMEInventoryHandler +public class MEPassThrough> implements IMEInventoryHandler { private IMEInventory internal; @@ -20,7 +20,7 @@ public class MEPassthru> implements IMEInventoryHandler return internal; } - public MEPassthru(IMEInventory i, StorageChannel channel) { + public MEPassThrough(IMEInventory i, StorageChannel channel) { this.channel = channel; setInternal( i ); } diff --git a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java index 9f7cfca4b..b8f87af7c 100644 --- a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java +++ b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java @@ -26,7 +26,7 @@ import appeng.util.ItemSorters; public class NetworkInventoryHandler> implements IMEInventoryHandler { - private final static Comparator prioritySorter = new Comparator() { + private final static Comparator prioritySorter = new Comparator() { @Override public int compare(Integer o1, Integer o2) @@ -45,7 +45,7 @@ public class NetworkInventoryHandler> implements IMEInvent public NetworkInventoryHandler(StorageChannel chan, SecurityCache security) { myChannel = chan; this.security = security; - priorityInventory = new TreeMap( prioritySorter ); // TreeMultimap.create( prioritySorter, hashSorter ); + priorityInventory = new TreeMap>>( prioritySorter ); // TreeMultimap.create( prioritySorter, hashSorter ); } public void addNewStorage(IMEInventoryHandler h) @@ -53,7 +53,7 @@ public class NetworkInventoryHandler> implements IMEInvent int priority = h.getPriority(); List> list = priorityInventory.get( priority ); if ( list == null ) - priorityInventory.put( priority, list = new ArrayList() ); + priorityInventory.put( priority, list = new ArrayList>() ); list.add( h ); } @@ -155,12 +155,8 @@ public class NetworkInventoryHandler> implements IMEInvent return input; } - Iterator>> i = priorityInventory.values().iterator();// asMap().entrySet().iterator(); - - while (i.hasNext()) + for (List> invList : priorityInventory.values()) { - List> invList = i.next(); - Iterator> ii = invList.iterator(); while (ii.hasNext() && input != null) { @@ -168,7 +164,9 @@ public class NetworkInventoryHandler> implements IMEInvent if ( inv.validForPass( 1 ) && inv.canAccept( input ) && (inv.isPrioritized( input ) || inv.extractItems( input, Actionable.SIMULATE, src ) != null) ) + { input = inv.injectItems( input, type, src ); + } } ii = invList.iterator(); @@ -176,7 +174,9 @@ public class NetworkInventoryHandler> implements IMEInvent { IMEInventoryHandler inv = ii.next(); if ( inv.validForPass( 2 ) && inv.canAccept( input ) )// ignore crafting on the second pass. + { input = inv.injectItems( input, type, src ); + } } } diff --git a/src/main/java/appeng/me/storage/VoidFluidInventory.java b/src/main/java/appeng/me/storage/VoidFluidInventory.java index 23c0912ec..9d3e25c0e 100644 --- a/src/main/java/appeng/me/storage/VoidFluidInventory.java +++ b/src/main/java/appeng/me/storage/VoidFluidInventory.java @@ -22,7 +22,7 @@ public class VoidFluidInventory implements IMEInventoryHandler public IAEFluidStack injectItems(IAEFluidStack input, Actionable mode, BaseActionSource src) { if ( input != null ) - target.addPower( (double) input.getStackSize() / 1000.0 ); + target.addPower( input.getStackSize() / 1000.0 ); return null; } diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index 1381bda35..15e3d15f9 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -299,9 +299,9 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea */ public void uploadSettings(SettingsFrom from, NBTTagCompound compound) { - if ( compound != null && this instanceof IConfigurableObject ) + if ( compound != null ) { - IConfigManager cm = ((IConfigurableObject) this).getConfigManager(); + IConfigManager cm = this.getConfigManager(); if ( cm != null ) cm.readFromNBT( compound ); } @@ -312,17 +312,14 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea pHost.setPriority( compound.getInteger( "priority" ) ); } - if ( this instanceof ISegmentedInventory ) + IInventory inv = this.getInventoryByName( "config" ); + if ( inv != null && inv instanceof AppEngInternalAEInventory ) { - IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" ); - if ( inv != null && inv instanceof AppEngInternalAEInventory ) - { - AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; - AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); - tmp.readFromNBT( compound, "config" ); - for (int x = 0; x < tmp.getSizeInventory(); x++) - target.setInventorySlotContents( x, tmp.getStackInSlot( x ) ); - } + AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; + AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); + tmp.readFromNBT( compound, "config" ); + for (int x = 0; x < tmp.getSizeInventory(); x++) + target.setInventorySlotContents( x, tmp.getStackInSlot( x ) ); } } @@ -336,12 +333,9 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea { NBTTagCompound output = new NBTTagCompound(); - if ( this instanceof IConfigurableObject ) - { - IConfigManager cm = this.getConfigManager(); - if ( cm != null ) - cm.writeToNBT( output ); - } + IConfigManager cm = this.getConfigManager(); + if ( cm != null ) + cm.writeToNBT( output ); if ( this instanceof IPriorityHost ) { @@ -349,13 +343,10 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea output.setInteger( "priority", pHost.getPriority() ); } - if ( this instanceof ISegmentedInventory ) + IInventory inv = this.getInventoryByName( "config" ); + if ( inv != null && inv instanceof AppEngInternalAEInventory ) { - IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" ); - if ( inv != null && inv instanceof AppEngInternalAEInventory ) - { - ((AppEngInternalAEInventory) inv).writeToNBT( output, "config" ); - } + ((AppEngInternalAEInventory) inv).writeToNBT( output, "config" ); } return output.hasNoTags() ? null : output; @@ -372,7 +363,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea if ( memCardIS != null && useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) { - IMemoryCard memc = (IMemoryCard) memCardIS.getItem(); + IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); ItemStack is = getItemStack( PartItemStack.Network ); @@ -387,21 +378,21 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea NBTTagCompound data = downloadSettings( SettingsFrom.MEMORY_CARD ); if ( data != null ) { - memc.setMemoryCardContents( memCardIS, name, data ); - memc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED ); + memoryCard.setMemoryCardContents( memCardIS, name, data ); + memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED ); } } else { - String storedName = memc.getSettingsName( memCardIS ); - NBTTagCompound data = memc.getData( memCardIS ); + String storedName = memoryCard.getSettingsName( memCardIS ); + NBTTagCompound data = memoryCard.getData( memCardIS ); if ( name.equals( storedName ) ) { uploadSettings( SettingsFrom.MEMORY_CARD, data ); - memc.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); + memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED ); } else - memc.notifyUser( player, MemoryCardMessages.INVALID_MACHINE ); + memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE ); } return true; } @@ -453,7 +444,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea { if ( is.stackSize > 0 ) { - List items = new ArrayList(); + List items = new ArrayList(); items.add( is.copy() ); host.removePart( side, false ); Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items ); diff --git a/src/main/java/appeng/parts/CableBusContainer.java b/src/main/java/appeng/parts/CableBusContainer.java index 06c690ce7..1b5a4b28d 100644 --- a/src/main/java/appeng/parts/CableBusContainer.java +++ b/src/main/java/appeng/parts/CableBusContainer.java @@ -247,11 +247,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if ( sbp != null ) { IGridNode sn = sbp.getGridNode(); - if ( sn != null && cn != null ) + if ( sn != null ) { try { - new GridConnection( (IGridNode) cn, (IGridNode) sn, ForgeDirection.UNKNOWN ); + new GridConnection( cn, sn, ForgeDirection.UNKNOWN ); } catch (FailedConnection e) { @@ -296,7 +296,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { try { - new GridConnection( (IGridNode) cn, (IGridNode) sn, ForgeDirection.UNKNOWN ); + new GridConnection( cn, sn, ForgeDirection.UNKNOWN ); } catch (FailedConnection e) { @@ -321,7 +321,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return null; } - private static final ThreadLocal isLoading = new ThreadLocal(); + private static final ThreadLocal isLoading = new ThreadLocal(); public static boolean isLoading() { @@ -403,6 +403,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I partChanged(); } + @Override public boolean canConnectRedstone(EnumSet enumSet) { for (ForgeDirection dir : enumSet) @@ -431,7 +432,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return null; } - public Iterable getSelectedBoundingBoxsFromPool(boolean ignoreCableConnections, boolean includeFacades, Entity e, boolean visual) + public Iterable getSelectedBoundingBoxesFromPool(boolean ignoreCableConnections, boolean includeFacades, Entity e, boolean visual) { List boxes = new LinkedList(); @@ -463,6 +464,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return boxes; } + @Override public void onEntityCollision(Entity entity) { for (ForgeDirection s : ForgeDirection.values()) @@ -473,6 +475,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } + @Override public boolean isEmpty() { IFacadeContainer fc = getFacadeContainer(); @@ -492,6 +495,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return true; } + @Override public void onNeighborChanged() { hasRedstone = YesNo.UNDECIDED; @@ -510,6 +514,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO; } + @Override public boolean isSolidOnSide(ForgeDirection side) { if ( side == null || side == ForgeDirection.UNKNOWN ) @@ -525,12 +530,14 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return part != null && part.isSolid(); } + @Override public int isProvidingWeakPower(ForgeDirection side) { IPart part = getPart( side ); return part != null ? part.isProvidingWeakPower() : 0; } + @Override public int isProvidingStrongPower(ForgeDirection side) { IPart part = getPart( side ); @@ -574,8 +581,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I data.writeShort( Item.getIdFromItem( is.getItem() ) ); data.writeShort( is.getItemDamage() ); - if ( p != null ) - p.writeToStream( data ); + p.writeToStream( data ); } } @@ -814,6 +820,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return tcb.isBlocked( side ); } + @Override public int getLightValue() { int light = 0; @@ -843,6 +850,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return false; } + @Override public boolean activate(EntityPlayer player, Vec3 pos) { SelectedPart p = selectPart( pos ); @@ -908,7 +916,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if ( getCenter() == null ) { - List facades = new LinkedList(); + List facades = new LinkedList(); IFacadeContainer fc = getFacadeContainer(); for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) @@ -921,7 +929,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - if ( facades != null && !facades.isEmpty() ) + if ( !facades.isEmpty() ) { TileEntity te = tcb.getTile(); Platform.spawnDrops( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, facades ); @@ -937,6 +945,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I tcb.markForSave(); } + @Override public void randomDisplayTick(World world, int x, int y, int z, Random r) { for (ForgeDirection side : ForgeDirection.values()) @@ -958,6 +967,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return hasRedstone == YesNo.YES; } + @Override public boolean isLadder(EntityLivingBase entity) { for (ForgeDirection side : ForgeDirection.values()) diff --git a/src/main/java/appeng/parts/PartPlacement.java b/src/main/java/appeng/parts/PartPlacement.java index b954d2dd5..f699f83c5 100644 --- a/src/main/java/appeng/parts/PartPlacement.java +++ b/src/main/java/appeng/parts/PartPlacement.java @@ -64,7 +64,7 @@ public class PartPlacement Minecraft mc = Minecraft.getMinecraft(); float f = 1.0F; - double d0 = (double) mc.playerController.getBlockReachDistance(); + double d0 = mc.playerController.getBlockReachDistance(); Vec3 vec3 = mc.renderViewEntity.getPosition( f ); if ( mop != null && mop.hitVec.distanceTo( vec3 ) < d0 ) @@ -113,7 +113,7 @@ public class PartPlacement public enum PlaceType { PLACE_ITEM, INTERACT_FIRST_PASS, INTERACT_SECOND_PASS - }; + } public static boolean place(ItemStack held, int x, int y, int z, int face, EntityPlayer player, World world, PlaceType pass, int depth) { @@ -142,7 +142,7 @@ public class PartPlacement MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); if ( mop != null ) { - List is = new LinkedList(); + List is = new LinkedList(); SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) ); if ( sp.part != null ) @@ -162,7 +162,7 @@ public class PartPlacement if ( host.isEmpty() ) host.cleanup(); - if ( is != null && !is.isEmpty() ) + if ( !is.isEmpty() ) { Platform.spawnDrops( world, x, y, z, is ); } diff --git a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java index cd3a0d3a8..c9bd0df76 100644 --- a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java @@ -170,7 +170,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab } boolean breaking = false; - LinkedList Buffer = new LinkedList(); + LinkedList Buffer = new LinkedList(); BaseActionSource mySrc = new MachineSource( this ); @Override @@ -216,6 +216,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab drops.add( is.getItemStack() ); } + @Override @MENetworkEventSubscribe public void chanRender(MENetworkChannelsChanged c) { @@ -223,6 +224,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab getHost().markForUpdate(); } + @Override @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { @@ -245,8 +247,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab Block blk = w.getBlock( x, y, z ); - IStorageGrid storage = (IStorageGrid) proxy.getStorage(); - IEnergyGrid energy = (IEnergyGrid) proxy.getEnergy(); + IStorageGrid storage = proxy.getStorage(); + IEnergyGrid energy = proxy.getEnergy(); Material mat = blk.getMaterial(); boolean ignore = mat == Material.air || mat == Material.lava || mat == Material.water || mat.isLiquid() || blk == Blocks.bedrock @@ -254,7 +256,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab if ( !ignore ) { - if ( !w.isAirBlock( x, y, z ) && w.blockExists( x, y, z ) && blk != null && w.canMineBlock( Platform.getPlayer( w ), x, y, z ) ) + if ( !w.isAirBlock( x, y, z ) && w.blockExists( x, y, z ) && w.canMineBlock( Platform.getPlayer( w ), x, y, z ) ) { float hardness = blk.getBlockHardness( w, x, y, z ); if ( hardness >= 0.0 ) @@ -428,8 +430,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab { try { - IStorageGrid storage = (IStorageGrid) proxy.getStorage(); - IEnergyGrid energy = (IEnergyGrid) proxy.getEnergy(); + IStorageGrid storage = proxy.getStorage(); + IEnergyGrid energy = proxy.getEnergy(); while (!Buffer.isEmpty()) { diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index e4108fbef..3c6fe7fc5 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -303,6 +303,7 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable, I return doBusWork(); } + @Override public RedstoneMode getRSMode() { return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED ); diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index f668c3821..ccc1bc0e0 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -83,13 +83,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_FPLANE ); + Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_FORMATION_PLANE ); return true; } return false; } + @Override protected int getUpgradeSlots() { return 5; @@ -104,6 +105,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine return super.getInventoryByName( name ); } + @Override @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { @@ -117,7 +119,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @MENetworkEventSubscribe - public void updateChannels(MENetworkChannelsChanged chann) + public void updateChannels(MENetworkChannelsChanged changedChannels) { boolean currentActive = proxy.isActive(); if ( wasActive != currentActive ) @@ -247,11 +249,11 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { if ( proxy.isActive() && channel == StorageChannel.ITEMS ) { - List Handler = new ArrayList( 1 ); + List Handler = new ArrayList( 1 ); Handler.add( myHandler ); return Handler; } - return new ArrayList(); + return new ArrayList(); } @Override @@ -278,6 +280,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine updateHandler(); } + @Override public void upgradesChanged() { updateHandler(); @@ -322,6 +325,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine data.setInteger( "priority", priority ); } + @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); @@ -459,9 +463,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine is.stackSize = (int) maxStorage; EntityItem ei = new EntityItem( w, // w - ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + (double) x, // spawn - ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + (double) y, // spawn - ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + (double) z, // spawn + ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + x, // spawn + ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + y, // spawn + ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + z, // spawn is.copy() ); Entity result = ei; diff --git a/src/main/java/appeng/parts/automation/PartImportBus.java b/src/main/java/appeng/parts/automation/PartImportBus.java index ee1163d9d..bf2a6ec4d 100644 --- a/src/main/java/appeng/parts/automation/PartImportBus.java +++ b/src/main/java/appeng/parts/automation/PartImportBus.java @@ -147,6 +147,7 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I private int itemToSend; // used in tickingRequest private boolean worked; // used in tickingRequest + @Override TickRateModulation doBusWork() { if ( !proxy.isActive() ) @@ -265,6 +266,7 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I return false; } + @Override public RedstoneMode getRSMode() { return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED ); diff --git a/src/main/java/appeng/parts/automation/PartLevelEmitter.java b/src/main/java/appeng/parts/automation/PartLevelEmitter.java index 31d9563a0..41154fdee 100644 --- a/src/main/java/appeng/parts/automation/PartLevelEmitter.java +++ b/src/main/java/appeng/parts/automation/PartLevelEmitter.java @@ -100,6 +100,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH updateState(); } + @Override public void upgradesChanged() { configureWatchers(); @@ -127,6 +128,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } } + @Override public void writeToNBT(NBTTagCompound data) { super.writeToNBT( data ); @@ -136,6 +138,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH config.writeToNBT( data, "config" ); } + @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); @@ -270,7 +273,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if ( Platform.isClient() ) return true; - Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_LEVELEMITTER ); + Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_LEVEL_EMITTER ); return true; } @@ -363,17 +366,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH // rh.renderInventoryBox( renderer ); } - double cenx; - double ceny; - double cenz; + double centerX; + double centerY; + double centerZ; public void addVertexWithUV(double x, double y, double z, double u, double v) { Tessellator var12 = Tessellator.instance; - x -= cenx; - y -= ceny; - z -= cenz; + x -= centerX; + y -= centerY; + z -= centerZ; if ( side == ForgeDirection.DOWN ) { @@ -411,9 +414,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH y = m; } - x += cenx;// + orientation.offsetX * 0.4; - y += ceny;// + orientation.offsetY * 0.4; - z += cenz;// + orientation.offsetZ * 0.4; + x += centerX;// + orientation.offsetX * 0.4; + y += centerY;// + orientation.offsetY * 0.4; + z += centerZ;// + orientation.offsetZ * 0.4; var12.addVertexWithUV( x, y, z, u, v ); } @@ -425,9 +428,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { ForgeDirection d = side; - double d0 = (double) ((float) d.offsetX * 0.45F) + (double) (r.nextFloat() - 0.5F) * 0.2D; - double d1 = (double) ((float) d.offsetY * 0.45F) + (double) (r.nextFloat() - 0.5F) * 0.2D; - double d2 = (double) ((float) d.offsetZ * 0.45F) + (double) (r.nextFloat() - 0.5F) * 0.2D; + double d0 = d.offsetX * 0.45F + (r.nextFloat() - 0.5F) * 0.2D; + double d1 = d.offsetY * 0.45F + (r.nextFloat() - 0.5F) * 0.2D; + double d2 = d.offsetZ * 0.45F + (r.nextFloat() - 0.5F) * 0.2D; world.spawnParticle( "reddust", 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D ); } @@ -439,12 +442,12 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH IIcon offTexture = is.getIconIndex(); IIcon IIcon = (isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture); // - cenx = baseX + 0.5; - ceny = baseY + 0.5; - cenz = baseZ + 0.5; + centerX = baseX + 0.5; + centerY = baseY + 0.5; + centerZ = baseZ + 0.5; baseY += 7.0 / 16.0; - ; + double par10 = 0; // double par11 = 0; double Zero = 0; @@ -466,20 +469,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH * float var16 = (float)var14 / 256.0F; float var17 = ((float)var14 + 15.99F) / 256.0F; float var18 = * (float)var15 / 256.0F; float var19 = ((float)var15 + 15.99F) / 256.0F; */ - double var20b = (double) offTexture.getInterpolatedU( 7.0D ); - double var24b = (double) offTexture.getInterpolatedU( 9.0D ); + double var20b = offTexture.getInterpolatedU( 7.0D ); + double var24b = offTexture.getInterpolatedU( 9.0D ); - double var20 = (double) IIcon.getInterpolatedU( 7.0D ); - double var24 = (double) IIcon.getInterpolatedU( 9.0D ); - double var22 = (double) IIcon.getInterpolatedV( 6.0D + (isOn ? 0 : 1.0D) ); - double var26 = (double) IIcon.getInterpolatedV( 8.0D + (isOn ? 0 : 1.0D) ); - double var28 = (double) IIcon.getInterpolatedU( 7.0D ); - double var30 = (double) IIcon.getInterpolatedV( 13.0D ); - double var32 = (double) IIcon.getInterpolatedU( 9.0D ); - double var34 = (double) IIcon.getInterpolatedV( 15.0D ); + double var20 = IIcon.getInterpolatedU( 7.0D ); + double var24 = IIcon.getInterpolatedU( 9.0D ); + double var22 = IIcon.getInterpolatedV( 6.0D + (isOn ? 0 : 1.0D) ); + double var26 = IIcon.getInterpolatedV( 8.0D + (isOn ? 0 : 1.0D) ); + double var28 = IIcon.getInterpolatedU( 7.0D ); + double var30 = IIcon.getInterpolatedV( 13.0D ); + double var32 = IIcon.getInterpolatedU( 9.0D ); + double var34 = IIcon.getInterpolatedV( 15.0D ); - double var22b = (double) IIcon.getInterpolatedV( 9.0D ); - double var26b = (double) IIcon.getInterpolatedV( 11.0D ); + double var22b = IIcon.getInterpolatedV( 9.0D ); + double var26b = IIcon.getInterpolatedV( 11.0D ); baseX += 0.5D; baseZ += 0.5D; @@ -520,28 +523,28 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH this.addVertexWithUV( baseX - var44 + Zero, baseY, baseZ + var44 + par10, var28, var34 ); this.addVertexWithUV( baseX - var44 + Zero, baseY, baseZ - var44 + par10, var28, var30 ); - this.addVertexWithUV( baseX - var44, baseY + 1.0D, var40, (double) var16, (double) var18 ); - this.addVertexWithUV( baseX - var44 + Zero, baseY + 0.0D, var40 + par10, (double) var16, (double) var19 ); - this.addVertexWithUV( baseX - var44 + Zero, baseY + 0.0D, var42 + par10, (double) var17, (double) var19 ); - this.addVertexWithUV( baseX - var44, baseY + 1.0D, var42, (double) var17, (double) var18 ); + this.addVertexWithUV( baseX - var44, baseY + 1.0D, var40, var16, var18 ); + this.addVertexWithUV( baseX - var44 + Zero, baseY + 0.0D, var40 + par10, var16, var19 ); + this.addVertexWithUV( baseX - var44 + Zero, baseY + 0.0D, var42 + par10, var17, var19 ); + this.addVertexWithUV( baseX - var44, baseY + 1.0D, var42, var17, var18 ); - this.addVertexWithUV( baseX + var44, baseY + 1.0D, var42, (double) var16, (double) var18 ); - this.addVertexWithUV( baseX + Zero + var44, baseY + 0.0D, var42 + par10, (double) var16, (double) var19 ); - this.addVertexWithUV( baseX + Zero + var44, baseY + 0.0D, var40 + par10, (double) var17, (double) var19 ); - this.addVertexWithUV( baseX + var44, baseY + 1.0D, var40, (double) var17, (double) var18 ); + this.addVertexWithUV( baseX + var44, baseY + 1.0D, var42, var16, var18 ); + this.addVertexWithUV( baseX + Zero + var44, baseY + 0.0D, var42 + par10, var16, var19 ); + this.addVertexWithUV( baseX + Zero + var44, baseY + 0.0D, var40 + par10, var17, var19 ); + this.addVertexWithUV( baseX + var44, baseY + 1.0D, var40, var17, var18 ); - this.addVertexWithUV( var36, baseY + 1.0D, baseZ + var44, (double) var16, (double) var18 ); - this.addVertexWithUV( var36 + Zero, baseY + 0.0D, baseZ + var44 + par10, (double) var16, (double) var19 ); - this.addVertexWithUV( var38 + Zero, baseY + 0.0D, baseZ + var44 + par10, (double) var17, (double) var19 ); - this.addVertexWithUV( var38, baseY + 1.0D, baseZ + var44, (double) var17, (double) var18 ); + this.addVertexWithUV( var36, baseY + 1.0D, baseZ + var44, var16, var18 ); + this.addVertexWithUV( var36 + Zero, baseY + 0.0D, baseZ + var44 + par10, var16, var19 ); + this.addVertexWithUV( var38 + Zero, baseY + 0.0D, baseZ + var44 + par10, var17, var19 ); + this.addVertexWithUV( var38, baseY + 1.0D, baseZ + var44, var17, var18 ); - this.addVertexWithUV( var38, baseY + 1.0D, baseZ - var44, (double) var16, (double) var18 ); - this.addVertexWithUV( var38 + Zero, baseY + 0.0D, baseZ - var44 + par10, (double) var16, (double) var19 ); - this.addVertexWithUV( var36 + Zero, baseY + 0.0D, baseZ - var44 + par10, (double) var17, (double) var19 ); - this.addVertexWithUV( var36, baseY + 1.0D, baseZ - var44, (double) var17, (double) var18 ); + this.addVertexWithUV( var38, baseY + 1.0D, baseZ - var44, var16, var18 ); + this.addVertexWithUV( var38 + Zero, baseY + 0.0D, baseZ - var44 + par10, var16, var19 ); + this.addVertexWithUV( var36 + Zero, baseY + 0.0D, baseZ - var44 + par10, var17, var19 ); + this.addVertexWithUV( var36, baseY + 1.0D, baseZ - var44, var17, var18 ); } - boolean status = false;; + boolean status = false; private boolean isLevelEmitterOn() { diff --git a/src/main/java/appeng/parts/automation/PartSharedItemBus.java b/src/main/java/appeng/parts/automation/PartSharedItemBus.java index e4db68ad2..121a8840e 100644 --- a/src/main/java/appeng/parts/automation/PartSharedItemBus.java +++ b/src/main/java/appeng/parts/automation/PartSharedItemBus.java @@ -44,12 +44,14 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid return Math.min( 1 + getInstalledUpgrades( Upgrades.CAPACITY ) * 4, config.getSizeInventory() ); } + @Override public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra) { super.writeToNBT( extra ); config.writeToNBT( extra, "config" ); } + @Override public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra) { super.readFromNBT( extra ); diff --git a/src/main/java/appeng/parts/automation/PartUpgradeable.java b/src/main/java/appeng/parts/automation/PartUpgradeable.java index 7c2376cc8..4a10ad7a1 100644 --- a/src/main/java/appeng/parts/automation/PartUpgradeable.java +++ b/src/main/java/appeng/parts/automation/PartUpgradeable.java @@ -45,6 +45,7 @@ public class PartUpgradeable extends PartBasicState implements ISegmentedInvento drops.add( is ); } + @Override public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra) { super.writeToNBT( extra ); @@ -52,6 +53,7 @@ public class PartUpgradeable extends PartBasicState implements ISegmentedInvento upgrades.writeToNBT( extra, "upgrades" ); } + @Override public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra) { super.readFromNBT( extra ); diff --git a/src/main/java/appeng/parts/automation/UpgradeInventory.java b/src/main/java/appeng/parts/automation/UpgradeInventory.java index cf077f207..e96fc8f7a 100644 --- a/src/main/java/appeng/parts/automation/UpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/UpgradeInventory.java @@ -16,7 +16,7 @@ import appeng.util.Platform; public class UpgradeInventory extends AppEngInternalInventory implements IAEAppEngInventory { - private final Object itemorblock; + private final Object itemOrBlock; private final IAEAppEngInventory parent; private boolean cached = false; @@ -31,7 +31,7 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE super( null, s ); te = this; parent = _te; - itemorblock = itemOrBlock; + this.itemOrBlock = itemOrBlock; } @Override @@ -40,12 +40,6 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE return true; } - @Override - public void setInventorySlotContents(int slot, ItemStack newItemStack) - { - super.setInventorySlotContents( slot, newItemStack ); - } - @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { @@ -68,17 +62,17 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE Integer max = null; for (ItemStack is : u.getSupported().keySet()) { - if ( is.getItem() == itemorblock ) + if ( is.getItem() == itemOrBlock ) { max = u.getSupported().get( is ); break; } - else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == itemorblock ) + else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == itemOrBlock ) { max = u.getSupported().get( is ); break; } - else if ( itemorblock instanceof ItemStack && Platform.isSameItem( (ItemStack) itemorblock, is ) ) + else if ( itemOrBlock instanceof ItemStack && Platform.isSameItem( (ItemStack) itemOrBlock, is ) ) { max = u.getSupported().get( is ); break; diff --git a/src/main/java/appeng/parts/layers/InvLayerData.java b/src/main/java/appeng/parts/layers/InvLayerData.java index aca4db676..40837a30b 100644 --- a/src/main/java/appeng/parts/layers/InvLayerData.java +++ b/src/main/java/appeng/parts/layers/InvLayerData.java @@ -14,12 +14,12 @@ public class InvLayerData // cache of inventory state. final private int sides[][]; - final private List invs; + final private List inventories; final private List slots; public InvLayerData(int a[][], List b, List c) { sides = a; - invs = b; + inventories = b; slots = c; } @@ -34,10 +34,10 @@ public class InvLayerData return slots != null && slot >= 0 && slot < slots.size(); } - public ItemStack decrStackSize(int slot, int amount) + public ItemStack decreaseStackSize(int slot, int amount) { if ( isSlotValid( slot ) ) - return slots.get( slot ).decrStackSize( amount ); + return slots.get( slot ).decreaseStackSize( amount ); return null; } @@ -90,9 +90,9 @@ public class InvLayerData public void markDirty() { - if ( invs != null ) + if ( inventories != null ) { - for (IInventory inv : invs) + for (IInventory inv : inventories) inv.markDirty(); } } diff --git a/src/main/java/appeng/parts/layers/InvSot.java b/src/main/java/appeng/parts/layers/InvSot.java index 493492c77..dc90d52d1 100644 --- a/src/main/java/appeng/parts/layers/InvSot.java +++ b/src/main/java/appeng/parts/layers/InvSot.java @@ -14,7 +14,7 @@ public class InvSot index = slot; } - public ItemStack decrStackSize(int j) + public ItemStack decreaseStackSize(int j) { return partInv.decrStackSize( index, j ); } diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySink.java b/src/main/java/appeng/parts/layers/LayerIEnergySink.java index 213b35e8e..d40e4248a 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySink.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySink.java @@ -44,7 +44,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink return !te.isInvalid() && te.getWorldObj().blockExists( te.xCoord, te.yCoord, te.zCoord ); } - final private void addToENet() + private void addToENet() { if ( getEnergySinkWorld() == null ) return; @@ -59,7 +59,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink } } - final private void removeFromENet() + private void removeFromENet() { if ( getEnergySinkWorld() == null ) return; @@ -71,7 +71,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink } } - final private boolean interestedInIC2() + private boolean interestedInIC2() { if ( !((IPartHost) this).isInWorld() ) return false; @@ -85,7 +85,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink interested++; } } - return interested == 1;// if more then one tile is interested we need to abandonship... + return interested == 1;// if more then one tile is interested we need to abandon... } @Override diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySource.java b/src/main/java/appeng/parts/layers/LayerIEnergySource.java index a110e89bb..9e0f82af1 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySource.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySource.java @@ -43,7 +43,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource return !te.isInvalid(); } - final private void addToENet() + private void addToENet() { if ( getEnergySourceWorld() == null ) return; @@ -58,7 +58,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource } } - final private void removeFromENet() + private void removeFromENet() { if ( getEnergySourceWorld() == null ) return; @@ -70,7 +70,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource } } - final private boolean interestedInIC2() + private boolean interestedInIC2() { if ( !((IPartHost) this).isInWorld() ) return false; @@ -84,7 +84,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource interested++; } } - return interested == 1;// if more then one tile is interested we need to abandonship... + return interested == 1;// if more then one tile is interested we need to abandon... } @Override diff --git a/src/main/java/appeng/parts/layers/LayerISidedInventory.java b/src/main/java/appeng/parts/layers/LayerISidedInventory.java index 805747a5b..750d0d9e8 100644 --- a/src/main/java/appeng/parts/layers/LayerISidedInventory.java +++ b/src/main/java/appeng/parts/layers/LayerISidedInventory.java @@ -39,10 +39,10 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory { // cache of inventory state. int sideData[][] = null; - List invs = null; + List inventories = null; List slots = null; - invs = new ArrayList(); + inventories = new ArrayList(); int slotCount = 0; for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) @@ -52,15 +52,13 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory { ISidedInventory part = (ISidedInventory) bp; slotCount += part.getSizeInventory(); - invs.add( part ); + inventories.add( part ); } } - if ( invs.isEmpty() || slotCount == 0 ) + if ( inventories.isEmpty() || slotCount == 0 ) { - invs = null; - sideData = null; - slots = null; + inventories = null; } else { @@ -69,7 +67,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory int offsetForLayer = 0; int offsetForPart = 0; - for (ISidedInventory sides : invs) + for (ISidedInventory sides : inventories) { offsetForPart = 0; slotCount = sides.getSizeInventory(); @@ -94,7 +92,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory if ( sideData == null || slots == null ) invLayer = null; else - invLayer = new InvLayerData( sideData, invs, slots ); + invLayer = new InvLayerData( sideData, inventories, slots ); // make sure inventory is updated before we call FMP. super.notifyNeighbors(); @@ -106,7 +104,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory if ( invLayer == null ) return null; - return invLayer.decrStackSize( slot, amount ); + return invLayer.decreaseStackSize( slot, amount ); } @Override diff --git a/src/main/java/appeng/parts/misc/PartInterface.java b/src/main/java/appeng/parts/misc/PartInterface.java index 58e8db7e0..8c396a221 100644 --- a/src/main/java/appeng/parts/misc/PartInterface.java +++ b/src/main/java/appeng/parts/misc/PartInterface.java @@ -72,13 +72,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg @MENetworkEventSubscribe public void stateChange(MENetworkChannelsChanged c) { - duality.notifyNeightbors(); + duality.notifyNeighbors(); } @MENetworkEventSubscribe public void stateChange(MENetworkPowerStatusChange c) { - duality.notifyNeightbors(); + duality.notifyNeighbors(); } @Override @@ -173,7 +173,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg @Override public TileEntity getTileEntity() { - return (TileEntity) super.getHost().getTile(); + return super.getHost().getTile(); } @Override diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index a83df64b2..8878a40e6 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -91,6 +91,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC int handlerHash = 0; boolean wasActive = false; + @Override @MENetworkEventSubscribe public void powerRender(MENetworkPowerStatusChange c) { @@ -98,7 +99,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @MENetworkEventSubscribe - public void updateChannels(MENetworkChannelsChanged chann) + public void updateChannels(MENetworkChannelsChanged changedChannels) { updateStatus(); } @@ -136,6 +137,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return false; } + @Override protected int getUpgradeSlots() { return 5; @@ -340,21 +342,21 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC private void checkInterfaceVsStorageBus(TileEntity target, ForgeDirection side) { - IInterfaceHost achiv = null; + IInterfaceHost achievement = null; if ( target instanceof IInterfaceHost ) - achiv = (IInterfaceHost) target; + achievement = (IInterfaceHost) target; if ( target instanceof IPartHost ) { Object part = ((IPartHost) target).getPart( side ); if ( part instanceof IInterfaceHost ) - achiv = (IInterfaceHost) part; + achievement = (IInterfaceHost) part; } - if ( achiv != null ) + if ( achievement != null ) { - Platform.addStat( achiv.getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement() ); + Platform.addStat( achievement.getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement() ); Platform.addStat( getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement() ); } } @@ -446,12 +448,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC data.setInteger( "priority", priority ); } + @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT( data ); Config.readFromNBT( data, "config" ); priority = data.getInteger( "priority" ); - }; + } @Override public List getCellArray(StorageChannel channel) @@ -460,7 +463,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { IMEInventoryHandler out = proxy.isActive() ? getInternalHandler() : null; if ( out != null ) - return Arrays.asList( new IMEInventoryHandler[] { out } ); + return Arrays.asList( out ); } return Arrays.asList( new IMEInventoryHandler[] {} ); } diff --git a/src/main/java/appeng/parts/misc/PartToggleBus.java b/src/main/java/appeng/parts/misc/PartToggleBus.java index 666f60e0e..056a36761 100644 --- a/src/main/java/appeng/parts/misc/PartToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartToggleBus.java @@ -236,7 +236,7 @@ public class PartToggleBus extends PartBasicState { if ( is.stackSize > 0 ) { - List items = new ArrayList(); + List items = new ArrayList(); items.add( is.copy() ); host.removePart( side, false ); Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items ); diff --git a/src/main/java/appeng/parts/networking/PartCable.java b/src/main/java/appeng/parts/networking/PartCable.java index b72b62583..878f349b4 100644 --- a/src/main/java/appeng/parts/networking/PartCable.java +++ b/src/main/java/appeng/parts/networking/PartCable.java @@ -213,6 +213,7 @@ public class PartCable extends AEBasePart implements IPartCable return AECableType.GLASS; } + @Override public AENetworkProxy getProxy() { return proxy; @@ -312,7 +313,7 @@ public class PartCable extends AEBasePart implements IPartCable EnumSet myC = connections.clone(); boolean wasPowered = powered; powered = false; - boolean chchanged = false; + boolean channelsChanged = false; for (ForgeDirection d : ForgeDirection.values()) { @@ -321,7 +322,7 @@ public class PartCable extends AEBasePart implements IPartCable int ch = (sideOut >> (d.ordinal() * 4)) & 0xF; if ( ch != channelsOnSide[d.ordinal()] ) { - chchanged = true; + channelsChanged = true; channelsOnSide[d.ordinal()] = ch; } } @@ -342,7 +343,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - return !myC.equals( connections ) || wasPowered != powered || chchanged; + return !myC.equals( connections ) || wasPowered != powered || channelsChanged; } @Override @@ -450,15 +451,15 @@ public class PartCable extends AEBasePart implements IPartCable public void renderGlassConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, ForgeDirection of) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null; + IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); - if ( gh != null && ccph != null && gh.getCableConnectionType( of ) == AECableType.GLASS && ccph.getColor() != AEColor.Transparent - && ccph.getPart( of.getOpposite() ) == null ) - rh.setTexture( getTexture( ccph.getColor() ) ); - else if ( ccph == null && gh != null && gh.getCableConnectionType( of ) != AECableType.GLASS ) + if ( gh != null && partHost != null && gh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getColor() != AEColor.Transparent + && partHost.getPart( of.getOpposite() ) == null ) + rh.setTexture( getTexture( partHost.getColor() ) ); + else if ( partHost == null && gh != null && gh.getCableConnectionType( of ) != AECableType.GLASS ) { rh.setTexture( getCoveredTexture( getCableColor() ) ); switch (of) @@ -562,15 +563,15 @@ public class PartCable extends AEBasePart implements IPartCable public void renderCoveredConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null; + IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; boolean isSmart = false; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); - if ( ghh != null && ccph != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && ccph.getPart( of.getOpposite() ) == null - && ccph.getColor() != AEColor.Transparent ) - rh.setTexture( getGlassTexture( ccph.getColor() ) ); - else if ( ccph == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) + if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null + && partHost.getColor() != AEColor.Transparent ) + rh.setTexture( getGlassTexture( partHost.getColor() ) ); + else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { rh.setTexture( getCoveredTexture( getCableColor() ) ); switch (of) @@ -601,10 +602,10 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( getTexture( getCableColor() ) ); } - else if ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == AECableType.COVERED && ccph.getColor() != AEColor.Transparent - && ccph.getPart( of.getOpposite() ) == null ) - rh.setTexture( getCoveredTexture( ccph.getColor() ) ); - else if ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == AECableType.SMART && ccph.getPart( of.getOpposite() ) == null ) + else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.COVERED && partHost.getColor() != AEColor.Transparent + && partHost.getPart( of.getOpposite() ) == null ) + rh.setTexture( getCoveredTexture( partHost.getColor() ) ); + else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.SMART && partHost.getPart( of.getOpposite() ) == null ) { isSmart = true; rh.setTexture( getSmartTexture( getCableColor() ) ); @@ -642,8 +643,8 @@ public class PartCable extends AEBasePart implements IPartCable if ( isSmart ) { setSmartConnectionRotations( of, renderer ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -654,11 +655,11 @@ public class PartCable extends AEBasePart implements IPartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( defa, defa, defa, defa, defa, defa ); + rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( defb, defb, defb, defb, defb, defb ); + rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -668,23 +669,23 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly(Side.CLIENT) - public void renderSmartConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of) + public void renderSmartConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null; + IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; boolean isGlass = false; AEColor myColor = getCableColor(); rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); - if ( ghh != null && ccph != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && ccph.getPart( of.getOpposite() ) == null - && ccph.getColor() != AEColor.Transparent ) + if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null + && partHost.getColor() != AEColor.Transparent ) { isGlass = true; - rh.setTexture( getGlassTexture( myColor = ccph.getColor() ) ); + rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) ); } - else if ( ccph == null && ghh != null && ghh.getCableConnectionType( of.getOpposite() ) != AECableType.GLASS ) + else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of.getOpposite() ) != AECableType.GLASS ) { rh.setTexture( getSmartTexture( myColor ) ); switch (of) @@ -715,8 +716,8 @@ public class PartCable extends AEBasePart implements IPartCable if ( true ) { setSmartConnectionRotations( of, renderer ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -727,11 +728,11 @@ public class PartCable extends AEBasePart implements IPartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); - rh.setTexture( defa, defa, defa, defa, defa, defa ); + rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); - rh.setTexture( defb, defb, defb, defb, defb, defb ); + rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -740,9 +741,9 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( getTexture( getCableColor() ) ); } - else if ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && ccph.getColor() != AEColor.Transparent - && ccph.getPart( of.getOpposite() ) == null ) - rh.setTexture( getSmartTexture( myColor = ccph.getColor() ) ); + else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent + && partHost.getPart( of.getOpposite() ) == null ) + rh.setTexture( getSmartTexture( myColor = partHost.getColor() ) ); else rh.setTexture( getSmartTexture( getCableColor() ) ); @@ -777,16 +778,16 @@ public class PartCable extends AEBasePart implements IPartCable { setSmartConnectionRotations( of, renderer ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); - rh.setTexture( defa, defa, defa, defa, defa, defa ); + rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); - rh.setTexture( defb, defb, defb, defb, defb, defb ); + rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -867,9 +868,9 @@ public class PartCable extends AEBasePart implements IPartCable else if ( connections.contains( dir ) ) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ ); - IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null; + IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; - if ( ccph == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS ) + if ( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS ) requireDetailed = true; } } diff --git a/src/main/java/appeng/parts/networking/PartCableCovered.java b/src/main/java/appeng/parts/networking/PartCableCovered.java index 36f461d8c..80678aec2 100644 --- a/src/main/java/appeng/parts/networking/PartCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartCableCovered.java @@ -109,19 +109,19 @@ public class PartCableCovered extends PartCable GL11.glTranslated( -0.0, -0.0, 0.3 ); rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); - float offu = 0; - float offv = 9; + float offU = 0; + float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); + OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { rh.renderInventoryFace( main, side, renderer ); } - offu = 9; - offv = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); + offU = 9; + offV = 0; + main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { diff --git a/src/main/java/appeng/parts/networking/PartCableSmart.java b/src/main/java/appeng/parts/networking/PartCableSmart.java index 517ed49e5..0eca86abc 100644 --- a/src/main/java/appeng/parts/networking/PartCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartCableSmart.java @@ -70,12 +70,12 @@ public class PartCableSmart extends PartCable { GL11.glTranslated( -0.0, -0.0, 0.3 ); - float offu = 0; - float offv = 9; + float offU = 0; + float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); - OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offu, offv ); - OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offu, offv ); + OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); + OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { @@ -85,11 +85,11 @@ public class PartCableSmart extends PartCable rh.renderInventoryFace( ch2, side, renderer ); } - offu = 9; - offv = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offu, offv ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offu, offv ); + offU = 9; + offV = 0; + main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); + ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { @@ -207,8 +207,8 @@ public class PartCableSmart extends PartCable rh.renderBlock( x, y, z, renderer ); setSmartConnectionRotations( of, renderer ); - IIcon defa = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); - IIcon defb = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { @@ -219,11 +219,11 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( defa, defa, defa, defa, defa, defa ); + rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( defb, defb, defb, defb, defb, defb ); + rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -237,7 +237,7 @@ public class PartCableSmart extends PartCable { for (ForgeDirection of : connections) { - renderSmartConection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); } rh.setTexture( getCoveredTexture( getCableColor() ) ); @@ -258,11 +258,11 @@ public class PartCableSmart extends PartCable IIcon def = getTexture( getCableColor() ); IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon offa = new OffsetIcon( defa, 0, -12 ); + IIcon firstTaughtIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); - IIcon offb = new OffsetIcon( defb, 0, -12 ); + IIcon secondTaughtIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); switch (selectedSide) { @@ -280,11 +280,11 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( defa, defa, offa, offa, offa, offa ); + rh.setTexture( firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( defb, defb, offb, offb, offb, offb ); + rh.setTexture( secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case EAST: @@ -306,21 +306,21 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - FlippableIcon fpA = new FlippableIcon( defa ); - FlippableIcon fpB = new FlippableIcon( defb ); + FlippableIcon fpA = new FlippableIcon( firstTaughtIcon ); + FlippableIcon fpB = new FlippableIcon( secondTaughtIcon ); - fpA = new FlippableIcon( defa ); - fpB = new FlippableIcon( defb ); + fpA = new FlippableIcon( firstTaughtIcon ); + fpB = new FlippableIcon( secondTaughtIcon ); fpA.setFlip( true, false ); fpB.setFlip( true, false ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( offa, offa, offa, offa, defa, fpA ); + rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( offb, offb, offb, offb, defb, fpB ); + rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, fpB ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case NORTH: @@ -337,11 +337,11 @@ public class PartCableSmart extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( offa, offa, defa, defa, offa, offa ); + rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( offb, offb, defb, defb, offb, offb ); + rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; default: diff --git a/src/main/java/appeng/parts/networking/PartDenseCable.java b/src/main/java/appeng/parts/networking/PartDenseCable.java index 0116a747f..6e61431d5 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCable.java +++ b/src/main/java/appeng/parts/networking/PartDenseCable.java @@ -85,12 +85,12 @@ public class PartDenseCable extends PartCable GL11.glTranslated( -0.0, -0.0, 0.3 ); rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f ); - float offu = 0; - float offv = 9; + float offU = 0; + float offV = 9; - OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); - OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offu, offv ); - OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offu, offv ); + OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); + OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN )) { @@ -99,11 +99,11 @@ public class PartDenseCable extends PartCable rh.renderInventoryFace( ch2, side, renderer ); } - offu = 9; - offv = 0; - main = new OffsetIcon( getTexture( getCableColor() ), offu, offv ); - ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offu, offv ); - ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offu, offv ); + offU = 9; + offV = 0; + main = new OffsetIcon( getTexture( getCableColor() ), offU, offV ); + ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV ); + ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV ); for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST )) { @@ -227,22 +227,22 @@ public class PartDenseCable extends PartCable public void renderDenseConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of) { TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null; + IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; boolean isGlass = false; AEColor myColor = getCableColor(); /* - * ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && ccph.getPart( - * of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = ccph.getColor() ) ); - * } else if ( ccph == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { + * ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart( + * of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) ); + * } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { * rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 ); * break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4 * ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16, * 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y, * z, renderer ); * - * if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon defa = new TaughtIcon( getChannelTex( - * channels, false ).getIcon(), -0.2f ); IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), + * if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon firstIcon = new TaughtIcon( getChannelTex( + * channels, false ).getIcon(), -0.2f ); IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), * -0.2f ); * * if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock) @@ -250,11 +250,11 @@ public class PartDenseCable extends PartCable * false, true ); } * * Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.instance.setColorOpaque_I( - * myColor.mediumVariant ); rh.setTexture( defa, defa, defa, defa, defa, defa ); renderAllFaces( (AEBaseBlock) + * myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) * rh.getBlock(), x, y, z, renderer ); * - * Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( defb, defb, defb, defb, defb, - * defb ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); + * Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, + * secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); * * renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = * renderer.uvRotateTop = renderer.uvRotateWest = 0; } @@ -263,9 +263,9 @@ public class PartDenseCable extends PartCable */ rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) ); - if ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && ccph.getColor() != AEColor.Transparent - && ccph.getPart( of.getOpposite() ) == null ) - rh.setTexture( getTexture( myColor = ccph.getColor() ) ); + if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent + && partHost.getPart( of.getOpposite() ) == null ) + rh.setTexture( getTexture( myColor = partHost.getColor() ) ); else rh.setTexture( getTexture( getCableColor() ) ); @@ -300,16 +300,16 @@ public class PartDenseCable extends PartCable { setSmartConnectionRotations( of, renderer ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); - rh.setTexture( defa, defa, defa, defa, defa, defa ); + rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); - rh.setTexture( defb, defb, defb, defb, defb, defb ); + rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -339,7 +339,7 @@ public class PartDenseCable extends PartCable if ( isDense( of ) ) renderDenseConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); else if ( isSmart( of ) ) - renderSmartConection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); + renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); else renderCoveredConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of ); } @@ -362,11 +362,11 @@ public class PartDenseCable extends PartCable IIcon def = getTexture( getCableColor() ); IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon offa = new OffsetIcon( defa, 0, -12 ); + IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); + IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 ); - IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); - IIcon offb = new OffsetIcon( defb, 0, -12 ); + IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); + IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 ); switch (selectedSide) { @@ -384,11 +384,11 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( defa, defa, offa, offa, offa, offa ); + rh.setTexture( firstIcon, firstIcon, firstOffset, firstOffset, firstOffset, firstOffset ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( defb, defb, offb, offb, offb, offb ); + rh.setTexture( secondIcon, secondIcon, secondOffset, secondOffset, secondOffset, secondOffset ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case EAST: @@ -410,21 +410,18 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - FlippableIcon fpA = new FlippableIcon( defa ); - FlippableIcon fpB = new FlippableIcon( defb ); - - fpA = new FlippableIcon( defa ); - fpB = new FlippableIcon( defb ); + FlippableIcon fpA = new FlippableIcon( firstIcon ); + FlippableIcon fpB = new FlippableIcon( secondIcon ); fpA.setFlip( true, false ); fpB.setFlip( true, false ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( offa, offa, offa, offa, defa, fpA ); + rh.setTexture( firstOffset, firstOffset, firstOffset, firstOffset, firstIcon, fpA ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( offb, offb, offb, offb, defb, fpB ); + rh.setTexture( secondOffset, secondOffset, secondOffset, secondOffset, secondIcon, fpB ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; case NORTH: @@ -441,11 +438,11 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant ); - rh.setTexture( offa, offa, defa, defa, offa, offa ); + rh.setTexture( firstOffset, firstOffset, firstIcon, firstIcon, firstOffset, firstOffset ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant ); - rh.setTexture( offb, offb, defb, defb, offb, offb ); + rh.setTexture( secondOffset, secondOffset, secondIcon, secondIcon, secondOffset, secondOffset ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer ); break; default: diff --git a/src/main/java/appeng/parts/p2p/PartP2PBCPower.java b/src/main/java/appeng/parts/p2p/PartP2PBCPower.java index c62b01e66..dab9202b4 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PBCPower.java +++ b/src/main/java/appeng/parts/p2p/PartP2PBCPower.java @@ -1,5 +1,6 @@ package appeng.parts.p2p; +import appeng.integration.abstraction.helpers.BaseMJPerdition; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -18,7 +19,6 @@ import appeng.core.settings.TickRates; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IMJ5; import appeng.integration.abstraction.IMJ6; -import appeng.integration.abstraction.helpers.BaseMJperdition; import appeng.me.GridAccessException; import appeng.me.cache.helpers.TunnelCollection; import appeng.transformer.annotations.integration.Interface; @@ -40,8 +40,9 @@ import cpw.mods.fml.relauncher.SideOnly; public class PartP2PBCPower extends PartP2PTunnel implements IPowerReceptor, ISidedBatteryProvider, IBatteryObject, IGridTickable { - BaseMJperdition pp; + BaseMJPerdition pp; + @Override public TunnelType getTunnelType() { return TunnelType.BC_POWER; @@ -55,7 +56,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( AppEng.instance.isIntegrationEnabled( IntegrationType.MJ5 ) ) { - pp = (BaseMJperdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this ); + pp = (BaseMJPerdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this ); if ( pp != null ) pp.configure( 1, 380, 1.0f / 5.0f, 1000 ); } @@ -75,18 +76,18 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( !output && proxy.isActive() ) { float totalRequiredPower = 0.0f; - TunnelCollection tunnelset; + TunnelCollection tunnels; try { - tunnelset = getOutputs(); + tunnels = getOutputs(); } catch (GridAccessException e) { return TickRateModulation.IDLE; } - for (PartP2PBCPower o : tunnelset) + for (PartP2PBCPower o : tunnels) { IPowerReceptor target = o.getPowerTarget(); if ( target != null ) @@ -94,14 +95,14 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo PowerReceiver tp = target.getPowerReceiver( side.getOpposite() ); if ( tp != null ) { - double howmuch = tp.powerRequest(); + double request = tp.powerRequest(); - if ( howmuch > tp.getMaxEnergyReceived() ) - howmuch = tp.getMaxEnergyReceived(); + if ( request > tp.getMaxEnergyReceived() ) + request = tp.getMaxEnergyReceived(); - if ( howmuch > 0.01 && howmuch > tp.getMinEnergyReceived() ) + if ( request > 0.01 && request > tp.getMinEnergyReceived() ) { - totalRequiredPower += howmuch; + totalRequiredPower += request; } } } @@ -114,7 +115,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo if ( currentTotal < 0.01 ) return TickRateModulation.SLOWER; - for (PartP2PBCPower o : tunnelset) + for (PartP2PBCPower o : tunnels) { IPowerReceptor target = o.getPowerTarget(); if ( target != null ) @@ -122,14 +123,14 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo PowerReceiver tp = target.getPowerReceiver( side.getOpposite() ); if ( tp != null ) { - double howmuch = tp.powerRequest(); + double request = tp.powerRequest(); - if ( howmuch > tp.getMaxEnergyReceived() ) - howmuch = tp.getMaxEnergyReceived(); + if ( request > tp.getMaxEnergyReceived() ) + request = tp.getMaxEnergyReceived(); - if ( howmuch > 0.01 && howmuch > tp.getMinEnergyReceived() ) + if ( request > 0.01 && request > tp.getMinEnergyReceived() ) { - double toPull = currentTotal * (howmuch / totalRequiredPower); + double toPull = currentTotal * (request / totalRequiredPower); double pulled = pp.useEnergy( 0, toPull, true ); QueueTunnelDrain( PowerUnits.MJ, pulled ); @@ -148,7 +149,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo public float getPowerDrainPerTick() { return 0.5f; - }; + } @Method(iname = "MJ6") private IBatteryObject getTargetBattery() @@ -193,6 +194,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo pp.readFromNBT( tag ); } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -204,7 +206,7 @@ public class PartP2PBCPower extends PartP2PTunnel implements IPo public PowerReceiver getPowerReceiver(ForgeDirection side) { if ( side.equals( side ) ) - return ((BaseMJperdition) pp).getPowerReceiver(); + return pp.getPowerReceiver(); return null; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java index bc07d1018..36931dd8a 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java @@ -25,6 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class PartP2PIC2Power extends PartP2PTunnel implements ic2.api.energy.tile.IEnergySink, ic2.api.energy.tile.IEnergySource { + @Override public TunnelType getTunnelType() { return TunnelType.IC2_POWER; @@ -65,6 +66,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i OutputVoltageB = tag.getDouble( "OutputVoltageB" ); } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -126,7 +128,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i public float getPowerDrainPerTick() { return 0.5f; - }; + } @Override public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) @@ -144,7 +146,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if ( outs.isEmpty() ) return amount; - LinkedList Options = new LinkedList(); + LinkedList Options = new LinkedList(); for (PartP2PIC2Power o : outs) { if ( o.OutputEnergyA <= 0.01 ) @@ -167,7 +169,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if ( Options.isEmpty() ) return amount; - PartP2PIC2Power x = (PartP2PIC2Power) Platform.pickRandom( Options ); + PartP2PIC2Power x = Platform.pickRandom( Options ); if ( x != null && x.OutputEnergyA <= 0.001 ) { diff --git a/src/main/java/appeng/parts/p2p/PartP2PItems.java b/src/main/java/appeng/parts/p2p/PartP2PItems.java index fc67d4e76..feaf7aaae 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PItems.java +++ b/src/main/java/appeng/parts/p2p/PartP2PItems.java @@ -43,6 +43,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class PartP2PItems extends PartP2PTunnel implements IPipeConnection, IInventory, ISidedInventory, IGridTickable { + @Override public TunnelType getTunnelType() { return TunnelType.ITEM; @@ -244,6 +245,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -326,7 +328,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo public float getPowerDrainPerTick() { return 2.0f; - }; + } @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) diff --git a/src/main/java/appeng/parts/p2p/PartP2PLight.java b/src/main/java/appeng/parts/p2p/PartP2PLight.java index e6cf72cb4..9303d2a1b 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLight.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLight.java @@ -29,6 +29,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi super( is ); } + @Override public TunnelType getTunnelType() { return TunnelType.LIGHT; @@ -142,6 +143,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi data.writeInt( output ? lastValue : 0 ); } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { diff --git a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java index 192506657..482cf1475 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java @@ -7,7 +7,6 @@ import java.util.Stack; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; @@ -26,6 +25,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl private final static FluidTankInfo[] activeTank = new FluidTankInfo[] { new FluidTankInfo( null, 10000 ) }; private final static FluidTankInfo[] inactiveTank = new FluidTankInfo[] { new FluidTankInfo( null, 0 ) }; + @Override public TunnelType getTunnelType() { return TunnelType.FLUID; @@ -63,22 +63,11 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl public float getPowerDrainPerTick() { return 2.0f; - }; + } private int tmpUsed; @Override - public void writeToNBT(NBTTagCompound tag) - { - super.writeToNBT( tag ); - } - - @Override - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT( tag ); - } - @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -93,10 +82,10 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl { for (PartP2PLiquids l : getOutputs()) { - IFluidHandler targ = l.getTarget(); - if ( targ != null ) + IFluidHandler handler = l.getTarget(); + if ( handler != null ) { - if ( targ.canFill( l.side.getOpposite(), input ) ) + if ( handler.canFill( l.side.getOpposite(), input ) ) outs.add( l ); } } @@ -119,7 +108,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl if ( in != null ) in.onTunnelNetworkChange(); } - }; + } @Override public void onTunnelNetworkChange() diff --git a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java index 2c5d5766a..73c24ce51 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java @@ -30,6 +30,7 @@ public class PartP2PRFPower extends PartP2PTunnel implements cof boolean cachedTarget = false; IEnergyHandler outputTarget; + @Override public TunnelType getTunnelType() { return TunnelType.RF_POWER; @@ -61,6 +62,7 @@ public class PartP2PRFPower extends PartP2PTunnel implements cof cachedTarget = false; } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -114,9 +116,9 @@ public class PartP2PRFPower extends PartP2PTunnel implements cof { if ( Platform.getRandomInt() % 2 > 0 ) { - int recv = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); - maxReceive -= recv; - total += recv; + int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); + maxReceive -= receiver; + total += receiver; if ( maxReceive <= 0 ) break; @@ -127,9 +129,9 @@ public class PartP2PRFPower extends PartP2PTunnel implements cof { for (PartP2PRFPower t : getOutputs()) { - int recv = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); - maxReceive -= recv; - total += recv; + int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); + maxReceive -= receiver; + total += receiver; if ( maxReceive <= 0 ) break; diff --git a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java index 38dd3bb39..b355da541 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java @@ -20,6 +20,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class PartP2PRedstone extends PartP2PTunnel { + @Override public TunnelType getTunnelType() { return TunnelType.REDSTONE; @@ -79,7 +80,7 @@ public class PartP2PRedstone extends PartP2PTunnel { PartP2PRedstone in = getInput(); if ( in != null ) - putInput( ((PartP2PRedstone) in).power ); + putInput( in.power ); } } @@ -137,6 +138,7 @@ public class PartP2PRedstone extends PartP2PTunnel power = tag.getInteger( "power" ); } + @Override @SideOnly(Side.CLIENT) public IIcon getTypeTexture() { @@ -146,7 +148,7 @@ public class PartP2PRedstone extends PartP2PTunnel public float getPowerDrainPerTick() { return 0.5f; - }; + } @Override public void onNeighborChanged() diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java index 97f9ac2b1..b70ee509c 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java @@ -118,7 +118,7 @@ public class PartP2PTunnel extends PartBasicState } mc.notifyUser( player, MemoryCardMessages.INVALID_MACHINE ); } - else if ( tt != null ) // attune-ment + else if ( tt != null ) // attunement { ItemStack newType = null; @@ -244,6 +244,7 @@ public class PartP2PTunnel extends PartBasicState { } + @Override public ItemStack getItemStack(PartItemStack type) { if ( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick ) @@ -268,12 +269,12 @@ public class PartP2PTunnel extends PartBasicState if ( freq == 0 ) return null; - PartP2PTunnel tunn; + PartP2PTunnel tunnel; try { - tunn = proxy.getP2P().getInput( freq ); - if ( getClass().isInstance( tunn ) ) - return (T) tunn; + tunnel = proxy.getP2P().getInput( freq ); + if ( getClass().isInstance( tunnel ) ) + return (T) tunnel; } catch (GridAccessException e) { diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java index 0e312bbd0..c84611ce7 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java @@ -30,6 +30,7 @@ import appeng.me.helpers.AENetworkProxy; public class PartP2PTunnelME extends PartP2PTunnel implements IGridTickable { + @Override public TunnelType getTunnelType() { return TunnelType.ME; diff --git a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java index e5fafea01..602ff59d7 100644 --- a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java @@ -3,6 +3,7 @@ package appeng.parts.reporting; import java.util.Arrays; import java.util.List; +import com.google.common.collect.Lists; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -23,10 +24,10 @@ public class PartConversionMonitor extends PartStorageMonitor public PartConversionMonitor(ItemStack is) { super( PartConversionMonitor.class, is ); - frontBright = CableBusTextures.PartConvMonitor_Bright; - frontColored = CableBusTextures.PartConvMonitor_Colored; - frontDark = CableBusTextures.PartConvMonitor_Dark; - // frontSolid = CableBusTextures.PartConvMonitor_Solid; + frontBright = CableBusTextures.PartConversionMonitor_Bright; + frontColored = CableBusTextures.PartConversionMonitor_Colored; + frontDark = CableBusTextures.PartConversionMonitor_Dark; + // frontSolid = CableBusTextures.PartConversionMonitor_Solid; } @Override @@ -89,6 +90,7 @@ public class PartConversionMonitor extends PartStorageMonitor return true; } + @Override protected void extractItem(EntityPlayer player) { IAEItemStack input = (IAEItemStack) getDisplayed(); @@ -114,7 +116,7 @@ public class PartConversionMonitor extends PartStorageMonitor if ( newItems != null ) { TileEntity te = tile; - List list = Arrays.asList( new ItemStack[] { newItems } ); + List list = Arrays.asList( newItems ); Platform.spawnDrops( player.worldObj, te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ, list ); } diff --git a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java index 5bc51d941..03a47a7c4 100644 --- a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java @@ -2,8 +2,6 @@ package appeng.parts.reporting; import java.util.List; -import appeng.api.networking.security.ISecurityGrid; -import appeng.util.Platform; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -13,8 +11,6 @@ import appeng.core.sync.GuiBridge; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; public class PartCraftingTerminal extends PartTerminal implements IAEAppEngInventory { @@ -53,6 +49,7 @@ public class PartCraftingTerminal extends PartTerminal implements IAEAppEngInven // frontSolid = CableBusTextures.PartCraftingTerm_Solid; } + @Override public GuiBridge getGui( EntityPlayer p ) { int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ; diff --git a/src/main/java/appeng/parts/reporting/PartMonitor.java b/src/main/java/appeng/parts/reporting/PartMonitor.java index 6a1b4da12..a099e91a5 100644 --- a/src/main/java/appeng/parts/reporting/PartMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartMonitor.java @@ -51,7 +51,7 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann { super.onPlacement( player, held, side ); - byte rotation = (byte) (MathHelper.floor_double( (double) ((player.rotationYaw * 4F) / 360F) + 2.5D ) & 3); + byte rotation = (byte) (MathHelper.floor_double( (player.rotationYaw * 4F) / 360F + 2.5D ) & 3); if ( side == ForgeDirection.UP ) spin = rotation; else if ( side == ForgeDirection.DOWN ) @@ -63,7 +63,7 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann { super.writeToNBT( data ); data.setFloat( "opacity", opacity ); - data.setByte( "spin", (byte) spin ); + data.setByte( "spin", spin ); } @Override @@ -137,7 +137,6 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann { super.writeToStream( data ); clientFlags = spin & 3; - ; try { diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java index 394017bb7..29f861c47 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java @@ -59,6 +59,7 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent frontDark = CableBusTextures.PartPatternTerm_Dark; } + @Override public GuiBridge getGui( EntityPlayer p ) { int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ; @@ -105,14 +106,14 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent for (int x = 0; x < crafting.getSizeInventory() && x < details.getInputs().length; x++) { - IAEItemStack aeis = details.getInputs()[x]; - crafting.setInventorySlotContents( x, aeis == null ? null : aeis.getItemStack() ); + IAEItemStack item = details.getInputs()[x]; + crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); } for (int x = 0; x < output.getSizeInventory() && x < details.getOutputs().length; x++) { - IAEItemStack aeis = details.getOutputs()[x]; - output.setInventorySlotContents( x, aeis == null ? null : aeis.getItemStack() ); + IAEItemStack item = details.getOutputs()[x]; + output.setInventorySlotContents( x, item == null ? null : item.getItemStack() ); } } } diff --git a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java index 3091d0c5d..f6b940630 100644 --- a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java @@ -216,14 +216,14 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit { GL11.glScalef( 1.0f, -1.0f, 1.0f ); GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f ); - GL11.glRotatef( (float) spin * 90.0F, 0, 0, 1 ); + GL11.glRotatef( 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( (float) spin * -90.0F, 0, 0, 1 ); + GL11.glRotatef( spin * -90.0F, 0, 0, 1 ); } if ( d == ForgeDirection.EAST ) diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index 2221f54eb..75f713ad7 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -38,6 +38,7 @@ public class GroupIngredient implements IIngredient return gi; } + @Override public int getDamageValue() { return OreDictionary.WILDCARD_VALUE; @@ -64,7 +65,7 @@ public class GroupIngredient implements IIngredient if ( isInside ) return new ItemStack[0]; - List out = new LinkedList(); + List out = new LinkedList(); isInside = true; try { @@ -94,6 +95,7 @@ public class GroupIngredient implements IIngredient return out.toArray( new ItemStack[out.size()] ); } + @Override public String getNameSpace() { return ""; diff --git a/src/main/java/appeng/recipes/IngredientSet.java b/src/main/java/appeng/recipes/IngredientSet.java index 4a888eeeb..bda49571c 100644 --- a/src/main/java/appeng/recipes/IngredientSet.java +++ b/src/main/java/appeng/recipes/IngredientSet.java @@ -25,6 +25,7 @@ public class IngredientSet implements IIngredient boolean isInside = false; + @Override public int getDamageValue() { return OreDictionary.WILDCARD_VALUE; @@ -51,7 +52,7 @@ public class IngredientSet implements IIngredient if ( isInside ) return new ItemStack[0]; - List out = new LinkedList(); + List out = new LinkedList(); out.addAll( items ); if ( out.size() == 0 ) @@ -63,6 +64,7 @@ public class IngredientSet implements IIngredient return out.toArray( new ItemStack[out.size()] ); } + @Override public String getNameSpace() { return ""; diff --git a/src/main/java/appeng/recipes/RecipeData.java b/src/main/java/appeng/recipes/RecipeData.java index adb59caf4..cfc90fdd1 100644 --- a/src/main/java/appeng/recipes/RecipeData.java +++ b/src/main/java/appeng/recipes/RecipeData.java @@ -20,6 +20,6 @@ public class RecipeData public boolean exceptions = true; public boolean erroronmissing = true; - public Set knownItem = new HashSet(); + public Set knownItem = new HashSet(); } diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index 5529e5f7f..145f0d6ed 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -216,7 +216,7 @@ public class RecipeHandler implements IRecipeHandler { return getName( is ); } - catch (RecipeError notappicable) + catch (RecipeError ignored) { } } diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index 2ec0192bf..68e181bee 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -18,7 +18,7 @@ public class DisassembleRecipe implements IRecipe private Materials mats = AEApi.instance().materials(); private Items items = AEApi.instance().items(); - private Blocks blks = AEApi.instance().blocks(); + private Blocks blocks = AEApi.instance().blocks(); private ItemStack getOutput(InventoryCrafting inv, boolean createFacade) { @@ -59,16 +59,16 @@ public class DisassembleRecipe implements IRecipe if ( items.itemEncodedPattern.sameAsStack( is ) ) hasCell = mats.materialBlankPattern.stack( 1 ); - if ( blks.blockCraftingStorage1k.sameAsStack( is ) ) + if ( blocks.blockCraftingStorage1k.sameAsStack( is ) ) hasCell = mats.materialCell1kPart.stack( 1 ); - if ( blks.blockCraftingStorage4k.sameAsStack( is ) ) + if ( blocks.blockCraftingStorage4k.sameAsStack( is ) ) hasCell = mats.materialCell4kPart.stack( 1 ); - if ( blks.blockCraftingStorage16k.sameAsStack( is ) ) + if ( blocks.blockCraftingStorage16k.sameAsStack( is ) ) hasCell = mats.materialCell16kPart.stack( 1 ); - if ( blks.blockCraftingStorage64k.sameAsStack( is ) ) + if ( blocks.blockCraftingStorage64k.sameAsStack( is ) ) hasCell = mats.materialCell64kPart.stack( 1 ); if ( hasCell == null ) diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index a1c46f2da..7ab274244 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -79,13 +79,12 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable if ( slot != null ) { boolean inRecipe = false; - Iterator req = required.iterator(); - while (req.hasNext()) + for (Object aRequired : required) { boolean match = false; - Object next = req.next(); + Object next = aRequired; if ( next instanceof IIngredient ) { diff --git a/src/main/java/appeng/recipes/handlers/Inscribe.java b/src/main/java/appeng/recipes/handlers/Inscribe.java index baad6ca44..76d42008d 100644 --- a/src/main/java/appeng/recipes/handlers/Inscribe.java +++ b/src/main/java/appeng/recipes/handlers/Inscribe.java @@ -35,13 +35,13 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer final public ItemStack plateB; final public ItemStack output; - }; + } public boolean usePlates = false; - public static HashSet plates = new HashSet(); - public static HashSet inputs = new HashSet(); - public static LinkedList recipes = new LinkedList(); + public static HashSet plates = new HashSet(); + public static HashSet inputs = new HashSet(); + public static LinkedList recipes = new LinkedList(); IIngredient imprintable; diff --git a/src/main/java/appeng/recipes/handlers/Shaped.java b/src/main/java/appeng/recipes/handlers/Shaped.java index c4c2dd3be..9cbd8828d 100644 --- a/src/main/java/appeng/recipes/handlers/Shaped.java +++ b/src/main/java/appeng/recipes/handlers/Shaped.java @@ -35,9 +35,13 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer cols = input.get( 0 ).size(); if ( cols <= 3 && cols >= 1 ) { - for (int x = 0; x < input.size(); x++) - if ( input.get( x ).size() != cols ) + for (List anInput : input) + { + if ( anInput.size() != cols ) + { throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." ); + } + } inputs = input; this.output = output.get( 0 ).get( 0 ); diff --git a/src/main/java/appeng/recipes/handlers/Shapeless.java b/src/main/java/appeng/recipes/handlers/Shapeless.java index 5f41c8083..4e3eea58e 100644 --- a/src/main/java/appeng/recipes/handlers/Shapeless.java +++ b/src/main/java/appeng/recipes/handlers/Shapeless.java @@ -61,18 +61,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer @Override public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError { - for ( int y = 0; y < inputs.size(); y++ ) + for (IIngredient i : inputs) { - IIngredient i = inputs.get(y); - if ( !i.isAir() ) + if ( !i.isAir() ) + { + for (ItemStack r : i.getItemStackSet()) { - for ( ItemStack r : i.getItemStackSet() ) + if ( Platform.isSameItemPrecise( r, reqOutput ) ) { - if ( Platform.isSameItemPrecise( r, reqOutput) ) - return false; + return false; } } } + } return Platform.isSameItemPrecise( output.getItemStack(),reqOutput ); } diff --git a/src/main/java/appeng/server/Commands.java b/src/main/java/appeng/server/Commands.java index fdb4fc98a..550c96202 100644 --- a/src/main/java/appeng/server/Commands.java +++ b/src/main/java/appeng/server/Commands.java @@ -5,7 +5,7 @@ import appeng.server.subcommands.Supporters; public enum Commands { - chunklogger(4, new ChunkLogger()), supporters(0, new Supporters()); + Chunklogger(4, new ChunkLogger()), supporters(0, new Supporters()); public final int level; public final ISubCommand command; diff --git a/src/main/java/appeng/server/ServerHelper.java b/src/main/java/appeng/server/ServerHelper.java index 7b4db7bc3..b7ae28f06 100644 --- a/src/main/java/appeng/server/ServerHelper.java +++ b/src/main/java/appeng/server/ServerHelper.java @@ -42,7 +42,7 @@ public class ServerHelper extends CommonHelper return server.getConfigurationManager().playerEntityList; } - return new ArrayList(); + return new ArrayList(); } @Override @@ -76,7 +76,7 @@ public class ServerHelper extends CommonHelper } @Override - public void postinit() + public void postInit() { } diff --git a/src/main/java/appeng/services/CompassService.java b/src/main/java/appeng/services/CompassService.java index 578702913..c9c143994 100644 --- a/src/main/java/appeng/services/CompassService.java +++ b/src/main/java/appeng/services/CompassService.java @@ -50,7 +50,7 @@ public class CompassService implements ThreadFactory cleanUp(); } - }; + } private class CMDirectionRequest implements Runnable { @@ -89,61 +89,61 @@ public class CompassService implements ThreadFactory // spiral outward... for (int offset = 1; offset < maxRange; offset++) { - int minx = cx - offset; - int minz = cz - offset; - int maxx = cx + offset; - int maxz = cz + offset; + int minX = cx - offset; + int minZ = cz - offset; + int maxX = cx + offset; + int maxZ = cz + offset; int closest = Integer.MAX_VALUE; int chosen_x = cx; int chosen_z = cz; - for (int z = minz; z <= maxz; z++) + for (int z = minZ; z <= maxZ; z++) { - if ( cr.hasBeacon( minx, z ) ) + if ( cr.hasBeacon( minX, z ) ) { - int closeness = dist( cx, cz, minx, z ); + int closeness = dist( cx, cz, minX, z ); if ( closeness < closest ) { closest = closeness; - chosen_x = minx; + chosen_x = minX; chosen_z = z; } } - if ( cr.hasBeacon( maxx, z ) ) + if ( cr.hasBeacon( maxX, z ) ) { - int closeness = dist( cx, cz, maxx, z ); + int closeness = dist( cx, cz, maxX, z ); if ( closeness < closest ) { closest = closeness; - chosen_x = maxx; + chosen_x = maxX; chosen_z = z; } } } - for (int x = minx + 1; x < maxx; x++) + for (int x = minX + 1; x < maxX; x++) { - if ( cr.hasBeacon( x, minz ) ) + if ( cr.hasBeacon( x, minZ ) ) { - int closeness = dist( cx, cz, x, minz ); + int closeness = dist( cx, cz, x, minZ ); if ( closeness < closest ) { closest = closeness; chosen_x = x; - chosen_z = minz; + chosen_z = minZ; } } - if ( cr.hasBeacon( x, maxz ) ) + if ( cr.hasBeacon( x, maxZ ) ) { - int closeness = dist( cx, cz, x, maxz ); + int closeness = dist( cx, cz, x, maxZ ); if ( closeness < closest ) { closest = closeness; chosen_x = x; - chosen_z = maxz; + chosen_z = maxZ; } } } @@ -165,7 +165,7 @@ public class CompassService implements ThreadFactory if ( jobSize() < 2 ) cleanUp(); } - }; + } public Future getCompassDirection(DimensionalCoord coord, int maxRange, ICompassCallback cc) { @@ -234,7 +234,7 @@ public class CompassService implements ThreadFactory return executor.submit( new CMUpdatePost( w, cx, cz, cdy, false ) ); } - HashMap worldSet = new HashMap(); + HashMap worldSet = new HashMap(); ExecutorService executor; final File rootFolder; diff --git a/src/main/java/appeng/services/helpers/CompassReader.java b/src/main/java/appeng/services/helpers/CompassReader.java index ac8d5aaf1..3b3467e1e 100644 --- a/src/main/java/appeng/services/helpers/CompassReader.java +++ b/src/main/java/appeng/services/helpers/CompassReader.java @@ -8,7 +8,7 @@ import net.minecraft.world.World; public class CompassReader { - HashMap regions = new HashMap(); + HashMap regions = new HashMap(); final int id; final File rootFolder; diff --git a/src/main/java/appeng/services/helpers/CompassRegion.java b/src/main/java/appeng/services/helpers/CompassRegion.java index 2b9eb068a..dbc6a9580 100644 --- a/src/main/java/appeng/services/helpers/CompassRegion.java +++ b/src/main/java/appeng/services/helpers/CompassRegion.java @@ -117,7 +117,7 @@ public class CompassRegion // raf.seek( cx + cz * 0x400 ); // return raf.readByte(); } - catch (IndexOutOfBoundsException outofBounds) + catch (IndexOutOfBoundsException outOfBounds) { return 0; } diff --git a/src/main/java/appeng/spatial/CachedPlane.java b/src/main/java/appeng/spatial/CachedPlane.java index df1a6415d..e9634d051 100644 --- a/src/main/java/appeng/spatial/CachedPlane.java +++ b/src/main/java/appeng/spatial/CachedPlane.java @@ -35,14 +35,14 @@ public class CachedPlane private ExtendedBlockStorage[] storage; - public Column(Chunk _c, int _x, int _z, int cy, int y_clen) { + public Column(Chunk _c, int _x, int _z, int cy, int chunkHeight) { x = _x; z = _z; c = _c; storage = c.getBlockStorageArray(); // make sure storage exists before hand... - for (int ay = 0; ay < y_clen; ay++) + for (int ay = 0; ay < chunkHeight; ay++) { int by = (ay + cy); ExtendedBlockStorage extendedblockstorage = storage[by]; @@ -56,11 +56,11 @@ public class CachedPlane if ( blk[0] == matrixFrame ) blk[0] = Platform.air; - ExtendedBlockStorage extendedblockstorage = storage[y >> 4]; - extendedblockstorage.func_150818_a( x, y & 15, z, (Block) blk[0] ); - // extendedblockstorage.setExtBlockID( x, y & 15, z, blk[0] ); - extendedblockstorage.setExtBlockMetadata( x, y & 15, z, (Integer) blk[1] ); - extendedblockstorage.setExtBlocklightValue( x, y & 15, z, (Integer) blk[2] ); + ExtendedBlockStorage extendedBlockStorage = storage[y >> 4]; + extendedBlockStorage.func_150818_a( x, y & 15, z, (Block) blk[0] ); + // extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] ); + extendedBlockStorage.setExtBlockMetadata( x, y & 15, z, (Integer) blk[1] ); + extendedBlockStorage.setExtBlocklightValue( x, y & 15, z, (Integer) blk[2] ); } public Object[] getDetails(int y) @@ -72,7 +72,7 @@ public class CachedPlane return ch; } - public boolean dontSkip(int y) + public boolean doNotSkip(int y) { ExtendedBlockStorage extendedblockstorage = storage[y >> 4]; if ( reg.isBlacklisted( extendedblockstorage.getBlockByExtId( x, y & 15, z ) ) ) @@ -88,7 +88,7 @@ public class CachedPlane skipThese.add( yCoord ); } - }; + } int verticalBits; @@ -116,24 +116,24 @@ public class CachedPlane LinkedList updates = new LinkedList(); - public CachedPlane(World w, int minx, int miny, int minz, int maxx, int maxy, int maxz) { + public CachedPlane(World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { world = w; - x_size = maxx - minx + 1; - y_size = maxy - miny + 1; - z_size = maxz - minz + 1; + x_size = maxX - minX + 1; + y_size = maxY - minY + 1; + z_size = maxZ - minZ + 1; - x_offset = minx; - y_offset = miny; - z_offset = minz; + x_offset = minX; + y_offset = minY; + z_offset = minZ; - int minCX = minx >> 4; - int minCY = miny >> 4; - int minCZ = minz >> 4; - int maxCX = maxx >> 4; - int maxCY = maxy >> 4; - int maxCZ = maxz >> 4; + int minCX = minX >> 4; + int minCY = minY >> 4; + int minCZ = minZ >> 4; + int maxCX = maxX >> 4; + int maxCY = maxY >> 4; + int maxCZ = maxZ >> 4; cx_size = maxCX - minCX + 1; int cy_size = maxCY - minCY + 1; @@ -151,7 +151,7 @@ public class CachedPlane for (int x = 0; x < x_size; x++) for (int z = 0; z < z_size; z++) { - myColumns[x][z] = new Column( w.getChunkFromChunkCoords( (minx + x) >> 4, (minz + z) >> 4 ), (minx + x) & 0xF, (minz + z) & 0xF, minCY, cy_size ); + myColumns[x][z] = new Column( w.getChunkFromChunkCoords( (minX + x) >> 4, (minZ + z) >> 4 ), (minX + x) & 0xF, (minZ + z) & 0xF, minCY, cy_size ); } IMovableRegistry mr = AEApi.instance().registries().movable(); @@ -159,7 +159,7 @@ public class CachedPlane for (int cx = 0; cx < cx_size; cx++) for (int cz = 0; cz < cz_size; cz++) { - LinkedList> rwarTiles = new LinkedList(); + LinkedList> rwarTiles = new LinkedList>(); LinkedList deadTiles = new LinkedList(); Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); @@ -170,7 +170,7 @@ public class CachedPlane { ChunkPosition cp = tx.getKey(); TileEntity te = tx.getValue(); - if ( te.xCoord >= minx && te.xCoord <= maxx && te.yCoord >= miny && te.yCoord <= maxy && te.zCoord >= minz && te.zCoord <= maxz ) + if ( te.xCoord >= minX && te.xCoord <= maxX && te.yCoord >= minY && te.yCoord <= maxY && te.zCoord >= minZ && te.zCoord <= maxZ ) { if ( mr.askToMove( te ) ) { @@ -179,10 +179,10 @@ public class CachedPlane } else { - Object[] details = myColumns[te.xCoord - minx][te.zCoord - minz].getDetails( te.yCoord ); + Object[] details = myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord ); Block blk = (Block) details[0]; - // don't skip air, juset let the code replace it... + // don't skip air, just let the code replace it... if ( blk != null && blk.isAir( c.worldObj, te.xCoord, te.yCoord, te.zCoord ) && blk.isReplaceable( c.worldObj, te.xCoord, te.yCoord, te.zCoord ) ) { @@ -190,7 +190,7 @@ public class CachedPlane c.worldObj.notifyBlocksOfNeighborChange( te.xCoord, te.yCoord, te.zCoord, Platform.air ); } else - myColumns[te.xCoord - minx][te.zCoord - minz].setSkip( te.yCoord ); + myColumns[te.xCoord - minX][te.zCoord - minZ].setSkip( te.yCoord ); } } } @@ -206,12 +206,12 @@ public class CachedPlane { for (Object o : list) { - NextTickListEntry ntle = (NextTickListEntry) o; - if ( ntle.xCoord >= minx && ntle.xCoord <= maxx && ntle.yCoord >= miny && ntle.yCoord <= maxy && ntle.zCoord >= minz - && ntle.zCoord <= maxz ) + NextTickListEntry entry = (NextTickListEntry) o; + if ( entry.xCoord >= minX && entry.xCoord <= maxX && entry.yCoord >= minY && entry.yCoord <= maxY && entry.zCoord >= minZ + && entry.zCoord <= maxZ ) { - NextTickListEntry newEntry = new NextTickListEntry( ntle.xCoord, ntle.yCoord, ntle.zCoord, ntle.func_151351_a() ); - newEntry.scheduledTime = ntle.scheduledTime - k; + NextTickListEntry newEntry = new NextTickListEntry( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() ); + newEntry.scheduledTime = entry.scheduledTime - k; ticks.add( newEntry ); } } @@ -260,7 +260,7 @@ public class CachedPlane int src_y = y + y_offset; int dst_y = y + dst.y_offset; - if ( a.dontSkip( src_y ) && b.dontSkip( dst_y ) ) + if ( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) ) { Object[] aD = a.getDetails( src_y ); Object[] bD = b.getDetails( dst_y ); @@ -292,14 +292,14 @@ public class CachedPlane addTile( te.xCoord - dst.x_offset, te.yCoord - dst.y_offset, te.zCoord - dst.z_offset, te, dst, mr ); } - for (NextTickListEntry ntle : ticks) + for (NextTickListEntry entry : ticks) { - dst.addTick( ntle.xCoord - x_offset, ntle.yCoord - y_offset, ntle.zCoord - z_offset, ntle ); + dst.addTick( entry.xCoord - x_offset, entry.yCoord - y_offset, entry.zCoord - z_offset, entry ); } - for (NextTickListEntry ntle : dst.ticks) + for (NextTickListEntry entry : dst.ticks) { - addTick( ntle.xCoord - dst.x_offset, ntle.yCoord - dst.y_offset, ntle.zCoord - dst.z_offset, ntle ); + addTick( entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry ); } startTime = System.nanoTime(); @@ -319,9 +319,9 @@ public class CachedPlane updates.add( new WorldCoord( src_x + d.offsetX, src_y + d.offsetY, src_z + d.offsetZ ) ); } - private void addTick(int x, int y, int z, NextTickListEntry ntle) + private void addTick(int x, int y, int z, NextTickListEntry entry) { - world.scheduleBlockUpdate( x + x_offset, y + y_offset, z + z_offset, ntle.func_151351_a(), (int) ntle.scheduledTime ); + world.scheduleBlockUpdate( x + x_offset, y + y_offset, z + z_offset, entry.func_151351_a(), (int) entry.scheduledTime ); } private void addTile(int x, int y, int z, TileEntity te, CachedPlane alternateDest, IMovableRegistry mr) @@ -330,7 +330,7 @@ public class CachedPlane { Column c = myColumns[x][z]; - if ( c.dontSkip( y + y_offset ) || alternateDest == null ) + if ( c.doNotSkip( y + y_offset ) || alternateDest == null ) { IMovableHandler handler = getHandler( te ); diff --git a/src/main/java/appeng/spatial/StorageChunkProvider.java b/src/main/java/appeng/spatial/StorageChunkProvider.java index deb19df42..aad950796 100644 --- a/src/main/java/appeng/spatial/StorageChunkProvider.java +++ b/src/main/java/appeng/spatial/StorageChunkProvider.java @@ -15,15 +15,15 @@ import appeng.core.AEConfig; public class StorageChunkProvider extends ChunkProviderGenerate implements IChunkProvider { - final static Block[] ablock; + final static Block[] blocks; static { - ablock = new Block[255 * 256]; + blocks = new Block[255 * 256]; Block matrixFrame = AEApi.instance().blocks().blockMatrixFrame.block(); - for (int x = 0; x < ablock.length; x++) - ablock[x] = matrixFrame; + for (int x = 0; x < blocks.length; x++) + blocks[x] = matrixFrame; } @@ -43,13 +43,13 @@ public class StorageChunkProvider extends ChunkProviderGenerate implements IChun @Override public Chunk provideChunk(int x, int z) { - Chunk chunk = new Chunk( w, ablock, x, z ); + Chunk chunk = new Chunk( w, blocks, x, z ); - byte[] abyte = chunk.getBiomeArray(); + byte[] biomes = chunk.getBiomeArray(); AEConfig config = AEConfig.instance; - for (int k = 0; k < abyte.length; ++k) - abyte[k] = (byte) config.storageBiomeID; + for (int k = 0; k < biomes.length; ++k) + biomes[k] = (byte) config.storageBiomeID; if ( !chunk.isTerrainPopulated ) { diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index 925aafe0d..1f0abe006 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -46,7 +46,7 @@ public class StorageHelper Block blk = dst.getBlock( x, y, z ); blk.onNeighborBlockChange( dst, x, y, z, Platform.air ); } - }; + } class WrapInMatrixFrame implements ISpatialVisitor { @@ -66,7 +66,7 @@ public class StorageHelper { dst.setBlock( x, y, z, blkID, Meta, 3 ); } - }; + } class TelDestination { @@ -89,7 +89,7 @@ public class StorageHelper final int xOff; final int yOff; final int zOff; - }; + } class METeleporter extends Teleporter { @@ -126,7 +126,7 @@ public class StorageHelper } - }; + } Method onEntityRemoved; @@ -241,27 +241,27 @@ public class StorageHelper return entity; } - public void transverseEdges(int minx, int miny, int minz, int maxx, int maxy, int maxz, ISpatialVisitor obj) + public void transverseEdges(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ISpatialVisitor visitor) { - for (int y = miny; y < maxy; y++) - for (int z = minz; z < maxz; z++) + for (int y = minY; y < maxY; y++) + for (int z = minZ; z < maxZ; z++) { - obj.visit( minx, y, z ); - obj.visit( maxx, y, z ); + visitor.visit( minX, y, z ); + visitor.visit( maxX, y, z ); } - for (int x = minx; x < maxx; x++) - for (int z = minz; z < maxz; z++) + for (int x = minX; x < maxX; x++) + for (int z = minZ; z < maxZ; z++) { - obj.visit( x, miny, z ); - obj.visit( x, maxy, z ); + visitor.visit( x, minY, z ); + visitor.visit( x, maxY, z ); } - for (int x = minx; x < maxx; x++) - for (int y = miny; y < maxy; y++) + for (int x = minX; x < maxX; x++) + for (int y = minY; y < maxY; y++) { - obj.visit( x, y, minz ); - obj.visit( x, y, maxz ); + visitor.visit( x, y, minZ ); + visitor.visit( x, y, maxZ ); } } diff --git a/src/main/java/appeng/spatial/StorageWorldProvider.java b/src/main/java/appeng/spatial/StorageWorldProvider.java index 31721e280..8078974b1 100644 --- a/src/main/java/appeng/spatial/StorageWorldProvider.java +++ b/src/main/java/appeng/spatial/StorageWorldProvider.java @@ -38,11 +38,12 @@ public class StorageWorldProvider extends WorldProvider super.worldChunkMgr = new WorldChunkManagerHell( Registration.instance.storageBiome, 0.0F ); } - @SideOnly(Side.CLIENT) - public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) - { - return null; - } + @Override + @SideOnly(Side.CLIENT) + public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) + { + return null; + } @Override public float getStarBrightness(float par1) diff --git a/src/main/java/appeng/tile/AEBaseInvTile.java b/src/main/java/appeng/tile/AEBaseInvTile.java index a84b65ba9..ef40ce37c 100644 --- a/src/main/java/appeng/tile/AEBaseInvTile.java +++ b/src/main/java/appeng/tile/AEBaseInvTile.java @@ -92,8 +92,8 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor @Override public boolean isUseableByPlayer(EntityPlayer p) { - return this.worldObj.getTileEntity( this.xCoord, this.yCoord, this.zCoord ) != this ? false : p.getDistanceSq( (double) this.xCoord + 0.5D, - (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D ) <= 32.0D; + return this.worldObj.getTileEntity( this.xCoord, this.yCoord, this.zCoord ) != this ? false : p.getDistanceSq( this.xCoord + 0.5D, + this.yCoord + 0.5D, this.zCoord + 0.5D ) <= 32.0D; } @Override diff --git a/src/main/java/appeng/tile/AEBaseTile.java b/src/main/java/appeng/tile/AEBaseTile.java index ad05835a1..6aa7e30f0 100644 --- a/src/main/java/appeng/tile/AEBaseTile.java +++ b/src/main/java/appeng/tile/AEBaseTile.java @@ -40,12 +40,12 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, { static private final HashMap>> handlers = new HashMap>>(); - static private final HashMap myItem = new HashMap(); + static private final HashMap myItem = new HashMap(); private ForgeDirection forward = ForgeDirection.UNKNOWN; private ForgeDirection up = ForgeDirection.UNKNOWN; - public static ThreadLocal> dropNoItems = new ThreadLocal(); + public static ThreadLocal> dropNoItems = new ThreadLocal>(); public void disableDrops() { @@ -122,7 +122,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, List list = handlerSet.get( value ); if ( list == null ) - handlerSet.put( value, list = new ArrayList() ); + handlerSet.put( value, list = new ArrayList() ); list.add( new AETileEventHandler( m, value ) ); } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java index c428d9d34..ca2ca83bf 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java @@ -72,11 +72,13 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora data.setByte( "paintedColor", (byte) paintedColor.ordinal() ); } + @Override public boolean isAccelerator() { return false; } + @Override public boolean isStatus() { return true; @@ -93,7 +95,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora { if ( is.getStackSize() != dspPlay.getStackSize() ) { - dspPlay = is == null ? null : is.copy(); + dspPlay = is.copy(); markForUpdate(); } } @@ -110,6 +112,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora return getJobProgress() != null; } + @Override public AEColor getColor() { return paintedColor; diff --git a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java index f4ef9c0fa..8029c92a6 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java @@ -25,16 +25,19 @@ public class TileCraftingStorageTile extends TileCraftingTile return super.getItemFromTile( obj ); } + @Override public boolean isAccelerator() { return false; } + @Override public boolean isStorage() { return true; } + @Override public int getStorageBytes() { if ( worldObj == null || notLoaded() ) diff --git a/src/main/java/appeng/tile/crafting/TileCraftingTile.java b/src/main/java/appeng/tile/crafting/TileCraftingTile.java index 39c75709d..90cee289e 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingTile.java @@ -36,7 +36,7 @@ import appeng.util.Platform; public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IPowerChannelState { - CraftingCPUCluster clust; + CraftingCPUCluster cluster; final CraftingCPUCalculator calc = new CraftingCPUCalculator( this ); public ISimplifiedBundle lightCache; @@ -62,10 +62,10 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP public void updateStatus(CraftingCPUCluster c) { - if ( clust != null && clust != c ) - clust.breakCluster(); + if ( cluster != null && cluster != c ) + cluster.breakCluster(); - clust = c; + cluster = c; updateMeta( true ); } @@ -74,19 +74,20 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP calc.calculateMultiblock( worldObj, getLocation() ); } + @Override public void setName(String name) { super.setName( name ); - if ( clust != null ) - clust.updateName(); + if ( cluster != null ) + cluster.updateName(); } @TileEvent(TileEventType.WORLD_NBT_WRITE) public void writeToNBT_TileCraftingTile(NBTTagCompound data) { data.setBoolean( "core", isCoreBlock ); - if ( isCoreBlock && clust != null ) - clust.writeToNBT( data ); + if ( isCoreBlock && cluster != null ) + cluster.writeToNBT( data ); } @TileEvent(TileEventType.WORLD_NBT_READ) @@ -95,8 +96,8 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP isCoreBlock = data.getBoolean( "core" ); if ( isCoreBlock ) { - if ( clust != null ) - clust.readFromNBT( data ); + if ( cluster != null ) + cluster.readFromNBT( data ); else previousState = (NBTTagCompound) data.copy(); } @@ -125,9 +126,9 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP @Override public void disconnect(boolean update) { - if ( clust != null ) + if ( cluster != null ) { - clust.destroy(); + cluster.destroy(); if ( update ) updateMeta( true ); } @@ -157,10 +158,10 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP power = gridProxy.isActive(); int current = worldObj.getBlockMetadata( xCoord, yCoord, zCoord ); - int newmeta = (current & 3) | (formed ? 8 : 0) | (power ? 4 : 0); + int newMeta = (current & 3) | (formed ? 8 : 0) | (power ? 4 : 0); - if ( current != newmeta ) - worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, newmeta, 2 ); + if ( current != newMeta ) + worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, newMeta, 2 ); if ( updateFormed ) { @@ -174,7 +175,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP @Override public IAECluster getCluster() { - return clust; + return cluster; } @Override @@ -195,7 +196,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP { if ( Platform.isClient() ) return (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 8) == 8; - return clust != null; + return cluster != null; } public boolean isAccelerator() @@ -230,14 +231,14 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP public void breakCluster() { - if ( clust != null ) + if ( cluster != null ) { - clust.cancel(); - IMEInventory inv = clust.getInventory(); + cluster.cancel(); + IMEInventory inv = cluster.getInventory(); LinkedList places = new LinkedList(); - Iterator i = clust.getTiles(); + Iterator i = cluster.getTiles(); while (i.hasNext()) { IGridHost h = i.next(); @@ -269,7 +270,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP ais.setStackSize( ais.getItemStack().getMaxStackSize() ); while (true) { - IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, clust.getActionSource() ); + IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, cluster.getActionSource() ); if ( g == null ) break; @@ -281,7 +282,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } - clust.destroy(); + cluster.destroy(); } } } diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index 485524da8..f07890f07 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -77,6 +77,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn private boolean reboot = true; public ISimplifiedBundle lightCache; + @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table, ForgeDirection where) { if ( myPattern == null ) @@ -197,9 +198,9 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn ItemStack pattern = myPlan.getPattern(); if ( pattern != null ) { - NBTTagCompound pdata = new NBTTagCompound(); - pattern.writeToNBT( pdata ); - data.setTag( "myPlan", pdata ); + NBTTagCompound compound = new NBTTagCompound(); + pattern.writeToNBT( compound ); + data.setTag( "myPlan", compound ); data.setInteger( "pushDirection", pushDirection.ordinal() ); } } diff --git a/src/main/java/appeng/tile/grindstone/TileCrank.java b/src/main/java/appeng/tile/grindstone/TileCrank.java index 51f83f6cd..7bda6b869 100644 --- a/src/main/java/appeng/tile/grindstone/TileCrank.java +++ b/src/main/java/appeng/tile/grindstone/TileCrank.java @@ -122,7 +122,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; return Arrays - .asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) } ); + .asList( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } @Override @@ -131,8 +131,8 @@ public class TileCrank extends AEBaseTile implements ICustomCollision double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; - out.add( AxisAlignedBB.getBoundingBox( xOff + (double) 0.15, yOff + (double) 0.15, zOff + (double) 0.15,// ahh - xOff + (double) 0.85, yOff + (double) 0.85, zOff + (double) 0.85 ) ); + out.add( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15,// ahh + xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } @Override diff --git a/src/main/java/appeng/tile/grindstone/TileGrinder.java b/src/main/java/appeng/tile/grindstone/TileGrinder.java index a47a1c034..0c78db6f2 100644 --- a/src/main/java/appeng/tile/grindstone/TileGrinder.java +++ b/src/main/java/appeng/tile/grindstone/TileGrinder.java @@ -45,7 +45,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable wc.add( getForward(), 1 ); - List out = new ArrayList(); + List out = new ArrayList(); out.add( notAdded ); Platform.spawnDrops( worldObj, wc.x, wc.y, wc.z, out ); diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java index 337025e09..d2659f35a 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java @@ -75,7 +75,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable aeiterator() + public Iterator getNewAEIterator() { return new AEInvIterator( this ); } diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java index 8eb075ce5..91ad150c4 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java @@ -22,7 +22,7 @@ public class AppEngInternalInventory implements IInventory, Iterable public boolean enableClientEvents = false; protected ItemStack inv[]; - public IMEInventory getIMEI() + public IMEInventory getMEInventory() { return new MEIInventoryWrapper( this, null ); } @@ -76,7 +76,7 @@ public class AppEngInternalInventory implements IInventory, Iterable if ( te != null && eventsEnabled() ) { - te.onChangeInventory( this, slot, InvOperation.decrStackSize, ns, null ); + te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null ); } markDirty(); diff --git a/src/main/java/appeng/tile/inventory/InvOperation.java b/src/main/java/appeng/tile/inventory/InvOperation.java index d417f1535..297dbe258 100644 --- a/src/main/java/appeng/tile/inventory/InvOperation.java +++ b/src/main/java/appeng/tile/inventory/InvOperation.java @@ -2,6 +2,6 @@ package appeng.tile.inventory; public enum InvOperation { - decrStackSize, setInventorySlotContents, markDirty + decreaseStackSize, setInventorySlotContents, markDirty } diff --git a/src/main/java/appeng/tile/misc/TileCellWorkbench.java b/src/main/java/appeng/tile/misc/TileCellWorkbench.java index 954f7aab5..8e3e63ed5 100644 --- a/src/main/java/appeng/tile/misc/TileCellWorkbench.java +++ b/src/main/java/appeng/tile/misc/TileCellWorkbench.java @@ -37,15 +37,15 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if ( cacheUpgrades == null ) { - ICellWorkbenchItem cwbi = getCell(); - if ( cwbi == null ) + ICellWorkbenchItem cell = getCell(); + if ( cell == null ) return null; - ItemStack is = cell.getStackInSlot( 0 ); + ItemStack is = this.cell.getStackInSlot( 0 ); if ( is == null ) return null; - IInventory inv = cwbi.getUpgradesInventory( is ); + IInventory inv = cell.getUpgradesInventory( is ); if ( inv == null ) return null; @@ -58,15 +58,15 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if ( cacheConfig == null ) { - ICellWorkbenchItem cwbi = getCell(); - if ( cwbi == null ) + ICellWorkbenchItem cell = getCell(); + if ( cell == null ) return null; - ItemStack is = cell.getStackInSlot( 0 ); + ItemStack is = this.cell.getStackInSlot( 0 ); if ( is == null ) return null; - IInventory inv = cwbi.getConfigInventory( is ); + IInventory inv = cell.getConfigInventory( is ); if ( inv == null ) return null; diff --git a/src/main/java/appeng/tile/misc/TileCharger.java b/src/main/java/appeng/tile/misc/TileCharger.java index a01523751..9ba993f01 100644 --- a/src/main/java/appeng/tile/misc/TileCharger.java +++ b/src/main/java/appeng/tile/misc/TileCharger.java @@ -229,7 +229,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } else { - List drops = new ArrayList(); + List drops = new ArrayList(); drops.add( myItem ); setInventorySlotContents( 0, null ); Platform.spawnDrops( worldObj, xCoord + getForward().offsetX, yCoord + getForward().offsetY, zCoord + getForward().offsetZ, drops ); diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index 7286a2a3c..c50da4ab5 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -55,13 +55,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS @MENetworkEventSubscribe public void stateChange(MENetworkChannelsChanged c) { - duality.notifyNeightbors(); + duality.notifyNeighbors(); } @MENetworkEventSubscribe public void stateChange(MENetworkPowerStatusChange c) { - duality.notifyNeightbors(); + duality.notifyNeighbors(); } public void setSide(ForgeDirection axis) diff --git a/src/main/java/appeng/tile/misc/TilePaint.java b/src/main/java/appeng/tile/misc/TilePaint.java index a79cddf56..623a48294 100644 --- a/src/main/java/appeng/tile/misc/TilePaint.java +++ b/src/main/java/appeng/tile/misc/TilePaint.java @@ -1,5 +1,6 @@ package appeng.tile.misc; +import appeng.helpers.Splotch; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -16,7 +17,6 @@ import net.minecraft.util.Vec3; import net.minecraft.world.EnumSkyBlock; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.util.AEColor; -import appeng.helpers.Splot; import appeng.items.misc.ItemPaintBall; import appeng.tile.AEBaseTile; import appeng.tile.TileEvent; @@ -30,7 +30,7 @@ public class TilePaint extends AEBaseTile static final int LIGHT_PER_DOT = 12; int isLit = 0; - ArrayList dots = null; + ArrayList dots = null; void writeBuffer(ByteBuf out) { @@ -42,7 +42,7 @@ public class TilePaint extends AEBaseTile out.writeByte( dots.size() ); - for (Splot s : dots) + for (Splotch s : dots) s.writeToStream( out ); } @@ -59,10 +59,10 @@ public class TilePaint extends AEBaseTile dots = new ArrayList( howMany ); for (int x = 0; x < howMany; x++) - dots.add( new Splot( in ) ); + dots.add( new Splotch( in ) ); isLit = 0; - for (Splot s : dots) + for (Splotch s : dots) { if ( s.lumen ) { @@ -119,7 +119,7 @@ public class TilePaint extends AEBaseTile private void updateData() { isLit = 0; - for (Splot s : dots) + for (Splotch s : dots) { if ( s.lumen ) { @@ -154,10 +154,10 @@ public class TilePaint extends AEBaseTile private void removeSide(ForgeDirection side) { - Iterator i = dots.iterator(); + Iterator i = dots.iterator(); while (i.hasNext()) { - Splot s = i.next(); + Splotch s = i.next(); if ( s.side == side ) i.remove(); } @@ -182,12 +182,12 @@ public class TilePaint extends AEBaseTile boolean lit = ipb.isLumen( type ); if ( dots == null ) - dots = new ArrayList(); + dots = new ArrayList(); if ( dots.size() > 20 ) dots.remove( 0 ); - dots.add( new Splot( col, lit, side, hitVec ) ); + dots.add( new Splotch( col, lit, side, hitVec ) ); if ( lit ) isLit += LIGHT_PER_DOT; @@ -206,7 +206,7 @@ public class TilePaint extends AEBaseTile worldObj.updateLightByType( EnumSkyBlock.Block, xCoord, yCoord, zCoord ); } - public Collection getDots() + public Collection getDots() { if ( dots == null ) return ImmutableList.of(); diff --git a/src/main/java/appeng/tile/misc/TileSecurity.java b/src/main/java/appeng/tile/misc/TileSecurity.java index fc25a7a79..816f08619 100644 --- a/src/main/java/appeng/tile/misc/TileSecurity.java +++ b/src/main/java/appeng/tile/misc/TileSecurity.java @@ -197,6 +197,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } } + @Override public void readPermissions(HashMap> playerPerms) { IPlayerRegistry pr = AEApi.instance().registries().players(); @@ -229,6 +230,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp markForUpdate(); } + @Override public boolean isSecurityEnabled() { return isActive && gridProxy.isActive(); @@ -248,6 +250,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING ); } + @Override public int getOwner() { return gridProxy.getNode().getPlayerID(); @@ -311,6 +314,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp return securityKey; } + @Override public AEColor getColor() { return paintedColor; diff --git a/src/main/java/appeng/tile/misc/TileVibrationChamber.java b/src/main/java/appeng/tile/misc/TileVibrationChamber.java index 65aba8281..9dae5bf10 100644 --- a/src/main/java/appeng/tile/misc/TileVibrationChamber.java +++ b/src/main/java/appeng/tile/misc/TileVibrationChamber.java @@ -160,9 +160,9 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } burnSpeed = Math.max( 20, Math.min( burnSpeed, 200 ) ); - double dialiation = burnSpeed / 100.0; + double dilation = burnSpeed / 100.0; - double timePassed = (double) TicksSinceLastCall * dialiation; + double timePassed = TicksSinceLastCall * dilation; burnTime -= timePassed; if ( burnTime < 0 ) { diff --git a/src/main/java/appeng/tile/networking/TileCableBus.java b/src/main/java/appeng/tile/networking/TileCableBus.java index 64b0c0cc7..1a82cfd60 100644 --- a/src/main/java/appeng/tile/networking/TileCableBus.java +++ b/src/main/java/appeng/tile/networking/TileCableBus.java @@ -162,6 +162,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl cb.getDrops( drops ); } + @Override public void getNoDrops(World w, int x, int y, int z, ArrayList drops) { cb.getNoDrops( drops ); @@ -212,7 +213,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean visual) { - return cb.getSelectedBoundingBoxsFromPool( false, true, e, visual ); + return cb.getSelectedBoundingBoxesFromPool( false, true, e, visual ); } @Override diff --git a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java index c35b29368..3ac9a839f 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java +++ b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java @@ -43,7 +43,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } catch (GridAccessException e) { - // null net, probably bads. + // null net, probably bad. } } diff --git a/src/main/java/appeng/tile/networking/TileEnergyCell.java b/src/main/java/appeng/tile/networking/TileEnergyCell.java index ebd259ee9..be0e88102 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileEnergyCell.java @@ -34,16 +34,16 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage if ( notLoaded() ) return; - byte leel = (byte) (8.0 * (internalCurrentPower / internalMaxPower)); + byte boundMetadata = (byte) (8.0 * (internalCurrentPower / internalMaxPower)); - if ( leel > 7 ) - leel = 7; - if ( leel < 0 ) - leel = 0; + if ( boundMetadata > 7 ) + boundMetadata = 7; + if ( boundMetadata < 0 ) + boundMetadata = 0; - if ( currentMeta != leel ) + if ( currentMeta != boundMetadata ) { - currentMeta = leel; + currentMeta = boundMetadata; worldObj.setBlockMetadataWithNotify( xCoord, yCoord, zCoord, currentMeta, 2 ); } } @@ -102,7 +102,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage return 0; } - final private double extractAEPower(double amt, Actionable mode) + private double extractAEPower(double amt, Actionable mode) { if ( mode == Actionable.SIMULATE ) { diff --git a/src/main/java/appeng/tile/powersink/IC2.java b/src/main/java/appeng/tile/powersink/IC2.java index aa22c212a..c50573ce5 100644 --- a/src/main/java/appeng/tile/powersink/IC2.java +++ b/src/main/java/appeng/tile/powersink/IC2.java @@ -76,7 +76,7 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink addToENet(); } - final private void addToENet() + private void addToENet() { if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) { @@ -89,7 +89,7 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink } } - final private void removeFromENet() + private void removeFromENet() { if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) ) { diff --git a/src/main/java/appeng/tile/powersink/MinecraftJoules5.java b/src/main/java/appeng/tile/powersink/MinecraftJoules5.java index b24f33c95..13aa43cd8 100644 --- a/src/main/java/appeng/tile/powersink/MinecraftJoules5.java +++ b/src/main/java/appeng/tile/powersink/MinecraftJoules5.java @@ -1,12 +1,12 @@ package appeng.tile.powersink; +import appeng.integration.abstraction.helpers.BaseMJPerdition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.config.PowerUnits; import appeng.core.AppEng; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IMJ5; -import appeng.integration.abstraction.helpers.BaseMJperdition; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; import appeng.transformer.annotations.integration.Interface; @@ -20,7 +20,7 @@ import buildcraft.api.power.PowerHandler.PowerReceiver; public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPowerReceptor { - BaseMJperdition bcPowerWrapper; + BaseMJPerdition bcPowerWrapper; @Method(iname = "MJ5") @TileEvent(TileEventType.TICK) @@ -40,7 +40,7 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow IMJ5 mjIntegration = (IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 ); if ( mjIntegration != null ) { - bcPowerWrapper = (BaseMJperdition) mjIntegration.createPerdition( this ); + bcPowerWrapper = (BaseMJPerdition) mjIntegration.createPerdition( this ); if ( bcPowerWrapper != null ) bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 ); } diff --git a/src/main/java/appeng/tile/powersink/RedstoneFlux.java b/src/main/java/appeng/tile/powersink/RedstoneFlux.java index 962e9ce5e..943b9c377 100644 --- a/src/main/java/appeng/tile/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/tile/powersink/RedstoneFlux.java @@ -45,6 +45,7 @@ public abstract class RedstoneFlux extends RotaryCraft implements IEnergyHandler return 0; } + @Override final public boolean canConnectEnergy(ForgeDirection from) { return internalCanAcceptPower && getPowerSides().contains( from ); diff --git a/src/main/java/appeng/tile/powersink/RotaryCraft.java b/src/main/java/appeng/tile/powersink/RotaryCraft.java index ef54b34c4..8b1001525 100644 --- a/src/main/java/appeng/tile/powersink/RotaryCraft.java +++ b/src/main/java/appeng/tile/powersink/RotaryCraft.java @@ -63,16 +63,19 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver } + @Override final public int getMachineX() { return xCoord; } + @Override final public int getMachineY() { return yCoord; } + @Override final public int getMachineZ() { return zCoord; diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index c95cd18c0..b1cdf7250 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -43,9 +43,9 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock final byte powered = 64; private QuantumCalculator calc = new QuantumCalculator( this ); - byte xdex = -1; + byte constructed = -1; - QuantumCluster clust; + QuantumCluster cluster; public boolean bridgePowered; private boolean updateStatus = false; @@ -56,8 +56,8 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock if ( updateStatus ) { updateStatus = false; - if ( clust != null ) - clust.updateStatus( true ); + if ( cluster != null ) + cluster.updateStatus( true ); markForUpdate(); } } @@ -65,12 +65,12 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @TileEvent(TileEventType.NETWORK_WRITE) public void writeToStream_TileQuantumBridge(ByteBuf data) throws IOException { - int out = xdex; + int out = constructed; - if ( getStackInSlot( 0 ) != null && xdex != -1 ) + if ( getStackInSlot( 0 ) != null && constructed != -1 ) out = out | hasSingularity; - if ( gridProxy.isActive() && xdex != -1 ) + if ( gridProxy.isActive() && constructed != -1 ) out = out | powered; data.writeByte( (byte) out ); @@ -79,10 +79,10 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @TileEvent(TileEventType.NETWORK_READ) public boolean readFromStream_TileQuantumBridge(ByteBuf data) throws IOException { - int oldValue = xdex; - xdex = data.readByte(); - bridgePowered = (xdex | powered) == powered; - return xdex != oldValue; + int oldValue = constructed; + constructed = data.readByte(); + bridgePowered = (constructed | powered) == powered; + return constructed != oldValue; } public TileQuantumBridge() { @@ -92,6 +92,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock inv.setMaxStackSize( 1 ); } + @Override public IInventory getInternalInventory() { return inv; @@ -106,8 +107,8 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @Override public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) { - if ( clust != null ) - clust.updateStatus( true ); + if ( cluster != null ) + cluster.updateStatus( true ); } @Override @@ -121,15 +122,15 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @Override public void disconnect(boolean affectWorld) { - if ( clust != null ) + if ( cluster != null ) { if ( !affectWorld ) - clust.updateStatus = false; + cluster.updateStatus = false; - clust.destroy(); + cluster.destroy(); } - clust = null; + cluster = null; if ( affectWorld ) gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); @@ -138,7 +139,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock @Override public IAECluster getCluster() { - return clust; + return cluster; } @Override @@ -171,13 +172,13 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public void updateStatus(QuantumCluster c, byte flags, boolean affectWorld) { - clust = c; + cluster = c; if ( affectWorld ) { - if ( xdex != flags ) + if ( constructed != flags ) { - xdex = flags; + constructed = flags; markForUpdate(); } @@ -209,13 +210,13 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isCorner() { - return (xdex & corner) == corner && xdex != -1; + return (constructed & corner) == corner && constructed != -1; } public boolean isPowered() { if ( Platform.isClient() ) - return (xdex & powered) == powered && xdex != -1; + return (constructed & powered) == powered && constructed != -1; try { @@ -231,7 +232,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isFormed() { - return xdex != -1; + return constructed != -1; } @Override @@ -267,15 +268,15 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean hasQES() { - if ( xdex == -1 ) + if ( constructed == -1 ) return false; - return (xdex & hasSingularity) == hasSingularity; + return (constructed & hasSingularity) == hasSingularity; } public void breakCluster() { - if ( clust != null ) - clust.destroy(); + if ( cluster != null ) + cluster.destroy(); } } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index e2479d1ab..08bbb0344 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -96,7 +96,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable ItemSpatialStorageCell sc = (ItemSpatialStorageCell) cell.getItem(); - SpatialPylonCache spc = (SpatialPylonCache) gi.getCache( ISpatialCache.class ); + SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); if ( spc.hasRegion() && spc.isValidRegion() ) { double req = spc.requiredPower(); diff --git a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java index a7ba19f8d..9fd9181cd 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java @@ -23,8 +23,8 @@ import appeng.tile.grid.AENetworkTile; public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock { - public final int DISPLAY_ENDMIN = 0x01; - public final int DISPLAY_ENDMAX = 0x02; + public final int DISPLAY_END_MIN = 0x01; + public final int DISPLAY_END_MAX = 0x02; public final int DISPLAY_MIDDLE = 0x01 + 0x02; public final int DISPLAY_X = 0x04; public final int DISPLAY_Y = 0x08; @@ -32,11 +32,11 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public final int MB_STATUS = 0x01 + 0x02 + 0x04 + 0x08; public final int DISPLAY_ENABLED = 0x10; - public final int DISPLAY_POWEREDENABLED = 0x20; + public final int DISPLAY_POWERED_ENABLED = 0x20; public final int NET_STATUS = 0x10 + 0x20; int displayBits = 0; - SpatialPylonCluster clust; + SpatialPylonCluster cluster; final SpatialPylonCalculator calc = new SpatialPylonCalculator( this ); boolean didHaveLight = false; @@ -95,7 +95,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public int getLightValue() { - if ( (displayBits & DISPLAY_POWEREDENABLED) == DISPLAY_POWEREDENABLED ) + if ( (displayBits & DISPLAY_POWERED_ENABLED) == DISPLAY_POWERED_ENABLED ) { return 8; } @@ -136,7 +136,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @Override public SpatialPylonCluster getCluster() { - return clust; + return cluster; } public void recalculateDisplay() @@ -145,16 +145,16 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock displayBits = 0; - if ( clust != null ) + if ( cluster != null ) { - if ( clust.min.equals( getLocation() ) ) - displayBits = DISPLAY_ENDMIN; - else if ( clust.max.equals( getLocation() ) ) - displayBits = DISPLAY_ENDMAX; + if ( cluster.min.equals( getLocation() ) ) + displayBits = DISPLAY_END_MIN; + else if ( cluster.max.equals( getLocation() ) ) + displayBits = DISPLAY_END_MAX; else displayBits = DISPLAY_MIDDLE; - switch (clust.currentAxis) + switch (cluster.currentAxis) { case X: displayBits |= DISPLAY_X; @@ -173,9 +173,9 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock try { if ( gridProxy.getEnergy().isNetworkPowered() ) - displayBits |= DISPLAY_POWEREDENABLED; + displayBits |= DISPLAY_POWERED_ENABLED; - if ( clust.isValid && gridProxy.isActive() ) + if ( cluster.isValid && gridProxy.isActive() ) displayBits |= DISPLAY_ENABLED; } catch (GridAccessException e) @@ -191,7 +191,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public void updateStatus(SpatialPylonCluster c) { - clust = c; + cluster = c; gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) ); recalculateDisplay(); } @@ -199,9 +199,9 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @Override public void disconnect(boolean b) { - if ( clust != null ) + if ( cluster != null ) { - clust.destroy(); + cluster.destroy(); updateStatus( null ); } } diff --git a/src/main/java/appeng/tile/storage/TileChest.java b/src/main/java/appeng/tile/storage/TileChest.java index 69e5a26fe..635fbd395 100644 --- a/src/main/java/appeng/tile/storage/TileChest.java +++ b/src/main/java/appeng/tile/storage/TileChest.java @@ -75,7 +75,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan static final int sides[] = new int[] { 0 }; static final int front[] = new int[] { 1 }; - static final int noslots[] = new int[] {}; + static final int noSlots[] = new int[] {}; AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 ); BaseActionSource mySrc = new MachineSource( this ); @@ -264,19 +264,19 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan boolean isCached = false; private ICellHandler cellHandler; - private MEMonitorHandler icell; - private MEMonitorHandler fcell; + private MEMonitorHandler itemCell; + private MEMonitorHandler fluidCell; @Override public IMEMonitor getItemInventory() { - return icell; + return itemCell; } @Override public IMEMonitor getFluidInventory() { - return fcell; + return fluidCell; } class ChestNetNotifier> implements IMEMonitorHandlerReceiver @@ -312,9 +312,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan public boolean isValid(Object verificationToken) { if ( chan == StorageChannel.ITEMS ) - return verificationToken == icell; + return verificationToken == itemCell; if ( chan == StorageChannel.FLUIDS ) - return verificationToken == fcell; + return verificationToken == fluidCell; return false; } @@ -324,7 +324,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan // not used here } - }; + } class ChestMonitorHandler extends MEMonitorHandler { @@ -389,8 +389,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return null; return super.extractItems(request, mode, src); } - - }; + } private MEMonitorHandler wrap(IMEInventoryHandler h) { @@ -410,8 +409,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if ( !isCached ) { - icell = null; - fcell = null; + itemCell = null; + fluidCell = null; ItemStack is = inv.getStackInSlot( 1 ); if ( is != null ) @@ -432,8 +431,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan gridProxy.setIdlePowerUsage( power ); - icell = wrap( itemCell ); - fcell = wrap( fluidCell ); + this.itemCell = wrap( itemCell ); + this.fluidCell = wrap( fluidCell ); } } } @@ -441,13 +440,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan switch (channel) { case FLUIDS: - if ( fcell == null ) + if ( fluidCell == null ) throw noHandler; - return fcell; + return fluidCell; case ITEMS: - if ( icell == null ) + if ( itemCell == null ) throw noHandler; - return icell; + return itemCell; default: } @@ -465,8 +464,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if ( slot == 1 ) { - icell = null; - fcell = null; + itemCell = null; + fluidCell = null; isCached = false; // recalculate the storage cell. try @@ -567,7 +566,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan // nope! } } - return noslots; + return noSlots; } @Override @@ -577,14 +576,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - return Arrays.asList( new IMEInventoryHandler[] { getHandler( channel ) } ); + return Arrays.asList( getHandler( channel ) ); } catch (ChestNoHandler e) { // :P } } - return new ArrayList(); + return new ArrayList(); } @Override @@ -636,7 +635,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan try { IMEInventoryHandler handler = getHandler( StorageChannel.ITEMS ); - if ( ch != null && handler instanceof ChestMonitorHandler ) + if ( handler instanceof ChestMonitorHandler ) return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() ); } catch (ChestNoHandler e) @@ -646,7 +645,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan try { IMEInventoryHandler handler = getHandler( StorageChannel.FLUIDS ); - if ( ch != null && handler instanceof ChestMonitorHandler ) + if ( handler instanceof ChestMonitorHandler ) return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() ); } catch (ChestNoHandler e) @@ -795,8 +794,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { priority = newValue; - icell = null; - fcell = null; + itemCell = null; + fluidCell = null; isCached = false; // recalculate the storage cell. try @@ -857,6 +856,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return false; } + @Override public AEColor getColor() { return paintedColor; diff --git a/src/main/java/appeng/tile/storage/TileDrive.java b/src/main/java/appeng/tile/storage/TileDrive.java index 549bc5c47..d5cd9d4d5 100644 --- a/src/main/java/appeng/tile/storage/TileDrive.java +++ b/src/main/java/appeng/tile/storage/TileDrive.java @@ -48,8 +48,8 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior boolean isCached = false; ICellHandler handlersBySlot[] = new ICellHandler[10]; DriveWatcher invBySlot[] = new DriveWatcher[10]; - List items = new LinkedList(); - List fluids = new LinkedList(); + List items = new LinkedList(); + List fluids = new LinkedList(); BaseActionSource mySrc; long lastStateChange = 0; @@ -61,8 +61,8 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { int oldState = 0; - boolean currentActive; - if ( currentActive = gridProxy.isActive() ) + boolean currentActive = gridProxy.isActive(); + if ( currentActive ) state |= 0x80000000; else state &= ~0x80000000; @@ -357,6 +357,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } } + @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { return itemstack != null && AEApi.instance().registries().cell().isCellHandled( itemstack ); diff --git a/src/main/java/appeng/transformer/AppEngCore.java b/src/main/java/appeng/transformer/AppEngCore.java index a112f199f..4c9d7bbe2 100644 --- a/src/main/java/appeng/transformer/AppEngCore.java +++ b/src/main/java/appeng/transformer/AppEngCore.java @@ -95,6 +95,7 @@ public class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin return getVersion(); } + @Override public ModMetadata getMetadata() { return md; diff --git a/src/main/java/appeng/transformer/asm/ASMIntegration.java b/src/main/java/appeng/transformer/asm/ASMIntegration.java index b5bef2678..e26336e75 100644 --- a/src/main/java/appeng/transformer/asm/ASMIntegration.java +++ b/src/main/java/appeng/transformer/asm/ASMIntegration.java @@ -127,9 +127,9 @@ public class ASMIntegration implements IClassTransformer return changed; } - private boolean hasAnnotation(AnnotationNode ann, Class anno) + private boolean hasAnnotation(AnnotationNode ann, Class annotation) { - return ann.desc.equals( Type.getDescriptor( anno ) ); + return ann.desc.equals( Type.getDescriptor( annotation ) ); } private boolean stripMethod(ClassNode classNode, MethodNode mn, Iterator i, Class class1, AnnotationNode an) diff --git a/src/main/java/appeng/transformer/asm/ASMTweaker.java b/src/main/java/appeng/transformer/asm/ASMTweaker.java index 8d7862a79..58d833493 100644 --- a/src/main/java/appeng/transformer/asm/ASMTweaker.java +++ b/src/main/java/appeng/transformer/asm/ASMTweaker.java @@ -33,7 +33,7 @@ public class ASMTweaker implements IClassTransformer final String name, desc; - }; + } Multimap privateToPublicMethods = HashMultimap.create(); @@ -69,7 +69,7 @@ public class ASMTweaker implements IClassTransformer makePublic( classNode, Set ); } - // CALL VIRUAL! + // CALL VIRTUAL! if ( transformedName.equals( "net.minecraft.client.gui.inventory.GuiContainer" ) ) { for (MethodNode mn : classNode.methods) @@ -79,6 +79,8 @@ public class ASMTweaker implements IClassTransformer MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, new String[0] ); newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 0 ) ); newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 1 ) ); + //newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc, false ) ); + // TODO: Update for newer forge newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc ) ); newNode.instructions.add( new InsnNode( Opcodes.RETURN ) ); log( newNode.name + newNode.desc + " - New Method" ); @@ -101,6 +103,8 @@ public class ASMTweaker implements IClassTransformer if ( n.name.equals( "func_146977_a" ) || (n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" )) ) { log( n.name + n.desc + " - Invoke Virtual" ); + //mn.instructions.insertBefore( n, new MethodInsnNode( Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc, false ) ); + // TODO: Update for newer forge mn.instructions.insertBefore( n, new MethodInsnNode( Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc ) ); mn.instructions.remove( in ); break; diff --git a/src/main/java/appeng/util/ConfigManager.java b/src/main/java/appeng/util/ConfigManager.java index 5b8d2c20c..fb95f3190 100644 --- a/src/main/java/appeng/util/ConfigManager.java +++ b/src/main/java/appeng/util/ConfigManager.java @@ -10,7 +10,7 @@ import appeng.core.AELog; public class ConfigManager implements IConfigManager { - HashMap Settings = new HashMap(); + HashMap Settings = new HashMap(); IConfigManagerHost target; public ConfigManager(IConfigManagerHost tile) { diff --git a/src/main/java/appeng/util/InventoryAdaptor.java b/src/main/java/appeng/util/InventoryAdaptor.java index 607d1f5b4..ac5d0126b 100644 --- a/src/main/java/appeng/util/InventoryAdaptor.java +++ b/src/main/java/appeng/util/InventoryAdaptor.java @@ -55,7 +55,7 @@ public abstract class InventoryAdaptor implements Iterable } else if ( te instanceof ArrayList ) { - return new AdaptorList( (ArrayList) te ); + return new AdaptorList( (ArrayList) te ); } else if ( bs != null && bs.isStorageCrate( te ) ) { @@ -63,7 +63,7 @@ public abstract class InventoryAdaptor implements Iterable } else if ( te instanceof TileEntityChest ) { - return new AdaptorIInventory( (IInventory) Platform.GetChestInv( te ) ); + return new AdaptorIInventory( Platform.GetChestInv( te ) ); } else if ( isSpecialInventory( te ) ) { diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index cc76c550a..20af0c5d3 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -47,7 +47,6 @@ import net.minecraft.stats.Achievement; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; @@ -399,17 +398,19 @@ public class Platform if ( cA.size() != cB.size() ) return false; - Iterator i = cA.iterator(); - while (i.hasNext()) + for (String name : cA) { - String name = i.next(); NBTBase tag = ctA.getTag( name ); NBTBase aTag = ctB.getTag( name ); if ( aTag == null ) + { return false; + } if ( !NBTEqualityTest( tag, aTag ) ) + { return false; + } } return true; @@ -446,7 +447,7 @@ public class Platform return ((NBTTagLong) A).func_150291_c() == ((NBTTagLong) B).func_150291_c(); case 8: // else if ( A instanceof NBTTagString ) - return ((NBTTagString) A).func_150285_a_() == ((NBTTagString) B).func_150285_a_() + return ((NBTTagString) A).func_150285_a_().equals( ((NBTTagString) B).func_150285_a_() ) || ((NBTTagString) A).func_150285_a_().equals( ((NBTTagString) B).func_150285_a_() ); case 6: // else if ( A instanceof NBTTagDouble ) @@ -500,7 +501,7 @@ public class Platform AELog.error( t ); } - return new ArrayList(); + return new ArrayList(); } /* @@ -521,10 +522,8 @@ public class Platform Set cA = ctA.func_150296_c(); - Iterator i = cA.iterator(); - while (i.hasNext()) + for (String name : cA) { - String name = i.next(); hash += name.hashCode() ^ NBTOrderlessHash( ctA.getTag( name ) ); } @@ -576,10 +575,8 @@ public class Platform CraftingManager cm = CraftingManager.getInstance(); List rl = cm.getRecipeList(); - for (int x = 0; x < rl.size(); ++x) + for (IRecipe r : rl) { - IRecipe r = rl.get( x ); - if ( r.matches( par1InventoryCrafting, par2World ) ) { return r; @@ -857,7 +854,7 @@ public class Platform if ( willAdd == null ) return false; IAETagCompound tag = willAdd.getTagCompound(); - if ( tag != null && ((AESharedNBT) tag).getSpecialComparison() != null ) + if ( tag != null && tag.getSpecialComparison() != null ) return true; return false; } @@ -1208,14 +1205,14 @@ public class Platform return a.isItemEqual( b ); } - public static LookDirection getPlayerRay(EntityPlayer player, float eyeoffset) + public static LookDirection getPlayerRay(EntityPlayer player, float eyeOffset) { float f = 1.0F; float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; - double d1 = eyeoffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * f; + double d1 = eyeOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f; Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); @@ -1230,7 +1227,7 @@ public class Platform { d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); } - Vec3 vec31 = vec3.addVector( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 ); + Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); return new LookDirection( vec3, vec31 ); } @@ -1241,9 +1238,9 @@ public class Platform float f = 1.0F; float f1 = p.prevRotationPitch + (p.rotationPitch - p.prevRotationPitch) * f; float f2 = p.prevRotationYaw + (p.rotationYaw - p.prevRotationYaw) * f; - double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double) f; - double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double) f + 1.62D - (double) p.yOffset; - double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double) f; + double d0 = p.prevPosX + (p.posX - p.prevPosX) * f; + double d1 = p.prevPosY + (p.posY - p.prevPosY) * f + 1.62D - p.yOffset; + double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * f; Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); @@ -1253,7 +1250,7 @@ public class Platform float f8 = f3 * f5; double d3 = 32.0D; - Vec3 vec31 = vec3.addVector( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 ); + Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); 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 ), @@ -1279,12 +1276,12 @@ public class Platform continue; f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand( (double) f1, (double) f1, (double) f1 ); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept( vec3, vec31 ); + AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); - if ( movingobjectposition1 != null ) + if ( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingobjectposition1.hitVec ); + double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if ( nd < closest ) { @@ -1298,15 +1295,15 @@ public class Platform } MovingObjectPosition pos = null; - Vec3 Srec = null; + Vec3 vec = null; if ( hitBlocks ) { - Srec = Vec3.createVectorHelper( d0, d1, d2 ); + vec = Vec3.createVectorHelper( d0, d1, d2 ); pos = w.rayTraceBlocks( vec3, vec31, true ); } - if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( Srec ) > closest ) + if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { pos = new MovingObjectPosition( entity ); } @@ -1443,10 +1440,10 @@ public class Platform gs.postAlterationOfStoredItems( StorageChannel.ITEMS, itemChanges, src ); } - static public > void postListChanges(IItemList before, IItemList after, IMEMonitorHandlerReceiver meMonitorPassthu, + static public > void postListChanges(IItemList before, IItemList after, IMEMonitorHandlerReceiver meMonitorPassthrough, BaseActionSource source) { - LinkedList changes = new LinkedList(); + LinkedList changes = new LinkedList(); for (T is : before) is.setStackSize( -is.getStackSize() ); @@ -1463,7 +1460,7 @@ public class Platform } if ( !changes.isEmpty() ) - meMonitorPassthu.postChange( null, changes, source ); + meMonitorPassthrough.postChange( null, changes, source ); } public static int generateTileHash(TileEntity target) @@ -1477,16 +1474,16 @@ public class Platform return 0; else if ( target instanceof TileEntityChest ) { - TileEntityChest targ = (TileEntityChest) target; - targ.checkForAdjacentChests(); - if ( targ.adjacentChestZNeg != null ) - hash ^= targ.adjacentChestZNeg.hashCode(); - else if ( targ.adjacentChestZPos != null ) - hash ^= targ.adjacentChestZPos.hashCode(); - else if ( targ.adjacentChestXPos != null ) - hash ^= targ.adjacentChestXPos.hashCode(); - else if ( targ.adjacentChestXNeg != null ) - hash ^= targ.adjacentChestXNeg.hashCode(); + TileEntityChest chest = (TileEntityChest) target; + chest.checkForAdjacentChests(); + if ( chest.adjacentChestZNeg != null ) + hash ^= chest.adjacentChestZNeg.hashCode(); + else if ( chest.adjacentChestZPos != null ) + hash ^= chest.adjacentChestZPos.hashCode(); + else if ( chest.adjacentChestXPos != null ) + hash ^= chest.adjacentChestXPos.hashCode(); + else if ( chest.adjacentChestXNeg != null ) + hash ^= chest.adjacentChestXNeg.hashCode(); } else if ( target instanceof IInventory ) { @@ -1549,7 +1546,7 @@ public class Platform if ( grid == null ) return false; - IEnergyGrid eg = (IEnergyGrid) grid.getCache( IEnergyGrid.class ); + IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); return eg.isNetworkPowered(); } @@ -1558,7 +1555,7 @@ public class Platform if ( grid == null ) return false; - ISecurityGrid gs = (ISecurityGrid) grid.getCache( ISecurityGrid.class ); + ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); if ( gs == null ) return false; @@ -1604,9 +1601,9 @@ public class Platform break; } - player.posX = (float) tile.xCoord + 0.5; - player.posY = (float) tile.yCoord + 0.5; - player.posZ = (float) tile.zCoord + 0.5; + player.posX = tile.xCoord + 0.5; + player.posY = tile.yCoord + 0.5; + player.posZ = tile.zCoord + 0.5; player.rotationPitch = player.prevCameraPitch = player.cameraPitch = pitch; player.rotationYaw = player.prevCameraYaw = player.cameraYaw = yaw; @@ -1640,7 +1637,7 @@ public class Platform } public static ItemStack extractItemsByRecipe(IEnergySource energySrc, BaseActionSource mySrc, IMEMonitor src, World w, IRecipe r, - ItemStack output, InventoryCrafting ci, ItemStack providedTemplate, int slot, IItemList aitems, Actionable realForFake, + ItemStack output, InventoryCrafting ci, ItemStack providedTemplate, int slot, IItemList items, Actionable realForFake, IPartitionList filter) { if ( energySrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.9 ) @@ -1668,9 +1665,9 @@ public class Platform boolean checkFuzzy = ae_req.isOre() || providedTemplate.getItemDamage() == OreDictionary.WILDCARD_VALUE || providedTemplate.hasTagCompound() || providedTemplate.isItemStackDamageable(); - if ( aitems != null && checkFuzzy ) + if ( items != null && checkFuzzy ) { - for (IAEItemStack x : aitems) + for (IAEItemStack x : items) { ItemStack sh = x.getItemStack(); if ( (Platform.isSameItemType( providedTemplate, sh ) || ae_req.sameOre( x )) && !Platform.isSameItem( sh, output ) ) @@ -1764,7 +1761,7 @@ public class Platform return is; } - private static Class Playerinstance; + private static Class playerInstance; private static Method getOrCreateChunkWatcher; private static Method sendToAllPlayersWatchingChunk; @@ -1783,19 +1780,19 @@ public class Platform if ( getOrCreateChunkWatcher != null ) { - Object playerinstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); - if ( playerinstance != null ) + Object playerInstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); + if ( playerInstance != null ) { - Playerinstance = playerinstance.getClass(); + Platform.playerInstance = playerInstance.getClass(); if ( sendToAllPlayersWatchingChunk == null ) { - sendToAllPlayersWatchingChunk = ReflectionHelper.findMethod( Playerinstance, playerinstance, new String[] { + sendToAllPlayersWatchingChunk = ReflectionHelper.findMethod( Platform.playerInstance, playerInstance, new String[] { "sendToAllPlayersWatchingChunk", "func_151251_a" }, Packet.class ); } if ( sendToAllPlayersWatchingChunk != null ) - sendToAllPlayersWatchingChunk.invoke( playerinstance, new S21PacketChunkData( c, false, verticalBits ) ); + sendToAllPlayersWatchingChunk.invoke( playerInstance, new S21PacketChunkData( c, false, verticalBits ) ); } } diff --git a/src/main/java/appeng/util/ReadOnlyCollection.java b/src/main/java/appeng/util/ReadOnlyCollection.java index 2410147ef..c0ee46248 100644 --- a/src/main/java/appeng/util/ReadOnlyCollection.java +++ b/src/main/java/appeng/util/ReadOnlyCollection.java @@ -15,7 +15,7 @@ public class ReadOnlyCollection implements IReadOnlyCollection } @Override - public Iterator iterator() + public Iterator iterator() { return c.iterator(); } diff --git a/src/main/java/appeng/util/SortedList.java b/src/main/java/appeng/util/SortedList.java deleted file mode 100644 index 52778043e..000000000 --- a/src/main/java/appeng/util/SortedList.java +++ /dev/null @@ -1,195 +0,0 @@ -package appeng.util; - -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; - -public class SortedList implements Iterable, List, Cloneable { - - private boolean sorted = true; - private final Comparator comp; - private final LinkedList storage = new LinkedList(); - - private void makeSorted() { - if (!sorted) { - sorted = true; - Collections.sort(storage, comp); - } - } - - public SortedList(Comparator comp) { - this.comp = comp; - } - - @Override - public boolean add(T input) { - sorted = false; - return storage.add(input); - } - - @Override - public boolean addAll(Collection input) { - if (!input.isEmpty()) - sorted = false; - return storage.addAll(input); - } - - @Override - public void clear() { - sorted = true; - storage.clear(); - } - - @Override - public boolean contains(Object input) { - return storage.contains(input); - } - - @Override - public boolean containsAll(Collection input) { - return storage.containsAll(input); - } - - @Override - public boolean isEmpty() { - return isEmpty(); - } - - @Override - public Iterator iterator() { - makeSorted(); - return storage.iterator(); - } - - public Iterator reverseIterator() { - makeSorted(); - final ListIterator listIterator = listIterator(size()); - - return new Iterator() { - - public boolean hasNext() { - return listIterator.hasPrevious(); - } - - public T next() { - return listIterator.previous(); - } - - public void remove() { - listIterator.remove(); - } - - }; - } - - @Override - public boolean remove(Object input) { - return storage.remove(input); - } - - @Override - public boolean removeAll(Collection input) { - return storage.removeAll(input); - } - - @Override - public boolean retainAll(Collection input) { - return storage.retainAll(input); - } - - @Override - public int size() { - return storage.size(); - } - - @Override - public Object[] toArray() { - return storage.toArray(); - } - - @Override - public X[] toArray(X[] input) { - return storage.toArray(input); - } - - public Comparator comparator() { - return comp; - } - - public T first() { - makeSorted(); - return storage.peekFirst(); - } - - public T last() { - makeSorted(); - return storage.peekLast(); - } - - @Override - public void add(int index, T element) { - makeSorted(); - sorted = false; - add(index, element); - } - - @Override - public boolean addAll(int index, Collection c) { - sorted = false; - return addAll(index, c); - } - - @Override - public T get(int index) { - makeSorted(); - return get(index); - } - - @Override - public int indexOf(Object o) { - makeSorted(); - return indexOf(o); - } - - @Override - public int lastIndexOf(Object o) { - makeSorted(); - return lastIndexOf(o); - } - - @Override - public ListIterator listIterator() { - makeSorted(); - return listIterator(); - } - - @Override - public ListIterator listIterator(int index) { - makeSorted(); - return listIterator(index); - } - - @Override - public T remove(int index) { - makeSorted(); - return remove(index); - } - - @Override - public T set(int index, T element) { - makeSorted(); - sorted = false; - return set(index, element); - } - - @Override - public List subList(int fromIndex, int toIndex) { - makeSorted(); - return storage.subList(fromIndex, toIndex); - } - -} diff --git a/src/main/java/appeng/util/inv/AdaptorBCPipe.java b/src/main/java/appeng/util/inv/AdaptorBCPipe.java index 5d7ed8249..8672c8fbb 100644 --- a/src/main/java/appeng/util/inv/AdaptorBCPipe.java +++ b/src/main/java/appeng/util/inv/AdaptorBCPipe.java @@ -90,7 +90,7 @@ public class AdaptorBCPipe extends InventoryAdaptor @Override public Iterator iterator() { - return new NullIterator(); + return new NullIterator(); } } diff --git a/src/main/java/appeng/util/inv/AdaptorIInventory.java b/src/main/java/appeng/util/inv/AdaptorIInventory.java index d23a20eee..005b48f48 100644 --- a/src/main/java/appeng/util/inv/AdaptorIInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorIInventory.java @@ -39,7 +39,7 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) + public ItemStack removeSimilarItems(int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { int s = i.getSizeInventory(); for (int x = 0; x < s; x++) @@ -47,17 +47,17 @@ public class AdaptorIInventory extends InventoryAdaptor ItemStack is = i.getStackInSlot( x ); if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) ) { - int lhow_many = how_many; - if ( lhow_many > is.stackSize ) - lhow_many = is.stackSize; + int newAmount = amount; + if ( newAmount > is.stackSize ) + newAmount = is.stackSize; if ( destination != null && !destination.canInsert( is ) ) - lhow_many = 0; + newAmount = 0; ItemStack rv = null; - if ( lhow_many > 0 ) + if ( newAmount > 0 ) { rv = is.copy(); - rv.stackSize = lhow_many; + rv.stackSize = newAmount; if ( is.stackSize == rv.stackSize ) { @@ -84,7 +84,7 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) + public ItemStack simulateSimilarRemove(int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination) { int s = i.getSizeInventory(); for (int x = 0; x < s; x++) @@ -93,16 +93,16 @@ public class AdaptorIInventory extends InventoryAdaptor if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) ) { - int lhow_many = how_many; - if ( lhow_many > is.stackSize ) - lhow_many = is.stackSize; + int boundAmount = amount; + if ( boundAmount > is.stackSize ) + boundAmount = is.stackSize; if ( destination != null && !destination.canInsert( is ) ) - lhow_many = 0; + boundAmount = 0; - if ( lhow_many > 0 ) + if ( boundAmount > 0 ) { ItemStack rv = is.copy(); - rv.stackSize = lhow_many; + rv.stackSize = boundAmount; return rv; } } @@ -111,38 +111,38 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination) + public ItemStack removeItems(int amount, ItemStack filter, IInventoryDestination destination) { int s = i.getSizeInventory(); ItemStack rv = null; - for (int x = 0; x < s && how_many > 0; x++) + for (int x = 0; x < s && amount > 0; x++) { ItemStack is = i.getStackInSlot( x ); if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || Platform.isSameItemPrecise( is, filter )) ) { - int lhow_many = how_many; - if ( lhow_many > is.stackSize ) - lhow_many = is.stackSize; + int boundAmounts = amount; + if ( boundAmounts > is.stackSize ) + boundAmounts = is.stackSize; if ( destination != null && !destination.canInsert( is ) ) - lhow_many = 0; + boundAmounts = 0; - if ( lhow_many > 0 ) + if ( boundAmounts > 0 ) { if ( rv == null ) { rv = is.copy(); filter = rv; - rv.stackSize = lhow_many; - how_many -= lhow_many; + rv.stackSize = boundAmounts; + amount -= boundAmounts; } else { - rv.stackSize += lhow_many; - how_many -= lhow_many; + rv.stackSize += boundAmounts; + amount -= boundAmounts; } - if ( is.stackSize == lhow_many ) + if ( is.stackSize == boundAmounts ) { i.setInventorySlotContents( x, null ); i.markDirty(); @@ -150,7 +150,7 @@ public class AdaptorIInventory extends InventoryAdaptor else { ItemStack po = is.copy(); - po.stackSize -= lhow_many; + po.stackSize -= boundAmounts; i.setInventorySlotContents( x, po ); i.markDirty(); } @@ -165,34 +165,34 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination) + public ItemStack simulateRemove(int amount, ItemStack filter, IInventoryDestination destination) { int s = i.getSizeInventory(); ItemStack rv = null; - for (int x = 0; x < s && how_many > 0; x++) + for (int x = 0; x < s && amount > 0; x++) { ItemStack is = i.getStackInSlot( x ); if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || Platform.isSameItemPrecise( is, filter )) ) { - int lhow_many = how_many; - if ( lhow_many > is.stackSize ) - lhow_many = is.stackSize; + int boundAmount = amount; + if ( boundAmount > is.stackSize ) + boundAmount = is.stackSize; if ( destination != null && !destination.canInsert( is ) ) - lhow_many = 0; + boundAmount = 0; - if ( lhow_many > 0 ) + if ( boundAmount > 0 ) { if ( rv == null ) { rv = is.copy(); - rv.stackSize = lhow_many; - how_many -= lhow_many; + rv.stackSize = boundAmount; + amount -= boundAmount; } else { - rv.stackSize += lhow_many; - how_many -= lhow_many; + rv.stackSize += boundAmount; + amount -= boundAmount; } } } @@ -356,7 +356,7 @@ public class AdaptorIInventory extends InventoryAdaptor // nothing! } - }; + } @Override public Iterator iterator() diff --git a/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java b/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java index d09b0b502..9bc3f0b3e 100644 --- a/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorISpecialInventory.java @@ -89,10 +89,13 @@ public class AdaptorISpecialInventory extends InventoryAdaptor if ( slots == null ) return false; - int s = slots.length; - for (int x = 0; x < s; x++) - if ( i.getStackInSlot( slots[x] ) != null ) + for (int slot : slots) + { + if ( i.getStackInSlot( slot ) != null ) + { return true; + } + } return false; } diff --git a/src/main/java/appeng/util/inv/AdaptorList.java b/src/main/java/appeng/util/inv/AdaptorList.java index 0f6f1664b..2561dfc20 100644 --- a/src/main/java/appeng/util/inv/AdaptorList.java +++ b/src/main/java/appeng/util/inv/AdaptorList.java @@ -52,16 +52,18 @@ public class AdaptorList extends InventoryAdaptor @Override public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination dest) { - int s = i.size(); - for (int x = 0; x < s; x++) + for (ItemStack is : i) { - ItemStack is = i.get( x ); if ( is != null && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) ) { if ( how_many > is.stackSize ) + { how_many = is.stackSize; + } if ( dest != null && !dest.canInsert( is ) ) + { how_many = 0; + } if ( how_many > 0 ) { @@ -109,16 +111,18 @@ public class AdaptorList extends InventoryAdaptor @Override public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination dest) { - int s = i.size(); - for (int x = 0; x < s; x++) + for (ItemStack is : i) { - ItemStack is = i.get( x ); if ( is != null && (filter == null || Platform.isSameItemPrecise( is, filter )) ) { if ( how_many > is.stackSize ) + { how_many = is.stackSize; + } if ( dest != null && !dest.canInsert( is ) ) + { how_many = 0; + } if ( how_many > 0 ) { @@ -142,10 +146,8 @@ public class AdaptorList extends InventoryAdaptor ItemStack left = A.copy(); - int s = i.size(); - for (int x = 0; x < s; x++) + for (ItemStack is : i) { - ItemStack is = i.get( x ); if ( Platform.isSameItem( is, left ) ) { is.stackSize += left.stackSize; @@ -166,13 +168,12 @@ public class AdaptorList extends InventoryAdaptor @Override public boolean containsItems() { - - int s = i.size(); - for (int x = 0; x < s; x++) + for (ItemStack is : i) { - ItemStack is = i.get( x ); if ( is != null ) + { return true; + } } return false; } diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java index 547a7e27a..e3039c0fc 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java @@ -180,6 +180,6 @@ public class AdaptorPlayerHand extends InventoryAdaptor @Override public Iterator iterator() { - return new NullIterator(); + return new NullIterator(); } } diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index e319aa1b1..22410234d 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -10,31 +10,31 @@ public class ItemSlot public int slot; // one or the other.. - private IAEItemStack aeitemstack; + private IAEItemStack aeItemStack; private ItemStack itemStack; public boolean isExtractable; public void setItemStack(ItemStack is) { - aeitemstack = null; + aeItemStack = null; itemStack = is; } public void setAEItemStack(IAEItemStack is) { - aeitemstack = is; + aeItemStack = is; itemStack = null; } public ItemStack getItemStack() { - return itemStack == null ? (aeitemstack == null ? null : (itemStack = aeitemstack.getItemStack())) : itemStack; + return itemStack == null ? (aeItemStack == null ? null : (itemStack = aeItemStack.getItemStack())) : itemStack; } public IAEItemStack getAEItemStack() { - return aeitemstack == null ? (itemStack == null ? null : (aeitemstack = AEItemStack.create( itemStack ))) : aeitemstack; + return aeItemStack == null ? (itemStack == null ? null : (aeItemStack = AEItemStack.create( itemStack ))) : aeItemStack; } } diff --git a/src/main/java/appeng/util/inv/WrapperChainedInventory.java b/src/main/java/appeng/util/inv/WrapperChainedInventory.java index c7b016bfd..7acc256f2 100644 --- a/src/main/java/appeng/util/inv/WrapperChainedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperChainedInventory.java @@ -19,26 +19,26 @@ public class WrapperChainedInventory implements IInventory int offset; int size; IInventory i; - }; + } int fullSize = 0; private List l; private HashMap offsets; - public WrapperChainedInventory(IInventory... ilist) { - setInventory( ilist ); + public WrapperChainedInventory(IInventory... inventories) { + setInventory( inventories ); } - public WrapperChainedInventory(List ilist) { - setInventory( ilist ); + public WrapperChainedInventory(List inventories) { + setInventory( inventories ); } public void cycleOrder() { if ( l.size() > 1 ) { - List newOrder = new ArrayList( l.size() ); + List newOrder = new ArrayList( l.size() ); newOrder.add( l.get( l.size() - 1 ) ); for (int x = 0; x < l.size() - 1; x++) newOrder.add( l.get( x ) ); diff --git a/src/main/java/appeng/util/inv/WrapperInvSlot.java b/src/main/java/appeng/util/inv/WrapperInvSlot.java index 3b712e1d7..89d3d63b5 100644 --- a/src/main/java/appeng/util/inv/WrapperInvSlot.java +++ b/src/main/java/appeng/util/inv/WrapperInvSlot.java @@ -95,7 +95,7 @@ public class WrapperInvSlot { return isItemValid( itemstack ) && inv.isItemValidForSlot( slot, itemstack ); } - }; + } private IInventory inv; diff --git a/src/main/java/appeng/util/inv/WrapperInventoryRange.java b/src/main/java/appeng/util/inv/WrapperInventoryRange.java index 4a8b83255..99d99003e 100644 --- a/src/main/java/appeng/util/inv/WrapperInventoryRange.java +++ b/src/main/java/appeng/util/inv/WrapperInventoryRange.java @@ -16,11 +16,13 @@ public class WrapperInventoryRange implements IInventory if ( s.length > 0 ) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < s.length; i++) + for (int value : s) { if ( sb.length() > 0 ) + { sb.append( separator ); - sb.append( s[i] ); + } + sb.append( value ); } return sb.toString(); } diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index 7826c72bc..5c1cf7793 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -157,7 +157,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu * if ( FluidName != null && FluidName instanceof NBTTagString ) ((NBTTagString) FluidName).data = (String) * this.fluid.getName(); else */ - i.setString( "FluidName", (String) this.fluid.getName() ); + i.setString( "FluidName", this.fluid.getName() ); /* * if ( Count != null && Count instanceof NBTTagByte ) ((NBTTagByte) Count).data = (byte) 0; else @@ -191,12 +191,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); if ( itemstack == null ) return null; - AEFluidStack aeis = AEFluidStack.create( itemstack ); - // aeis.priority = i.getInteger( "Priority" ); - aeis.stackSize = i.getLong( "Cnt" ); - aeis.setCountRequestable( i.getLong( "Req" ) ); - aeis.setCraftable( i.getBoolean( "Craft" ) ); - return aeis; + AEFluidStack fluid = AEFluidStack.create( itemstack ); + // fluid.priority = i.getInteger( "Priority" ); + fluid.stackSize = i.getLong( "Cnt" ); + fluid.setCountRequestable( i.getLong( "Req" ) ); + fluid.setCraftable( i.getBoolean( "Craft" ) ); + return fluid; } @Override @@ -282,12 +282,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu if ( fluidStack == null ) return null; - AEFluidStack aeis = AEFluidStack.create( fluidStack ); - // aeis.priority = (int) priority; - aeis.stackSize = stackSize; - aeis.setCountRequestable( countRequestable ); - aeis.setCraftable( isCraftable ); - return aeis; + AEFluidStack fluid = AEFluidStack.create( fluidStack ); + // fluid.priority = (int) priority; + fluid.stackSize = stackSize; + fluid.setCountRequestable( countRequestable ); + fluid.setCraftable( isCraftable ); + return fluid; } @Override diff --git a/src/main/java/appeng/util/item/AEItemDef.java b/src/main/java/appeng/util/item/AEItemDef.java index 6d32bfb66..d9031c903 100644 --- a/src/main/java/appeng/util/item/AEItemDef.java +++ b/src/main/java/appeng/util/item/AEItemDef.java @@ -5,7 +5,6 @@ import java.util.List; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import appeng.util.Platform; import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; import cpw.mods.fml.relauncher.Side; @@ -22,7 +21,7 @@ public class AEItemDef public Item item; public int damageValue; - public int dspDamage; + public int displayDamage; public int maxDamage; public AESharedNBT tagCompound; @@ -51,7 +50,7 @@ public class AEItemDef AEItemDef t = new AEItemDef( item ); t.def = def; t.damageValue = damageValue; - t.dspDamage = dspDamage; + t.displayDamage = displayDamage; t.maxDamage = maxDamage; t.tagCompound = tagCompound; t.isOre = isOre; @@ -61,8 +60,12 @@ public class AEItemDef @Override public boolean equals(Object obj) { - AEItemDef def = (AEItemDef) obj; - return def.damageValue == damageValue && def.item == item && tagCompound == def.tagCompound; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + AEItemDef other = (AEItemDef) obj; + return other.damageValue == damageValue && other.item == item && tagCompound == other.tagCompound; } public int getDamageValueHack(ItemStack is) @@ -81,7 +84,7 @@ public class AEItemDef return true; if ( tagCompound != null && otherStack.hasTagCompound() ) - return Platform.NBTEqualityTest( (NBTBase) tagCompound, otherStack.getTagCompound() ); + return Platform.NBTEqualityTest( tagCompound, otherStack.getTagCompound() ); return true; } diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index cbf90ad5f..e244fe0dd 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -69,16 +69,16 @@ public final class AEItemStack extends AEStack implements IAEItemS */ /* - * Super Hacky. + * Super hackery. * * is.itemID = appeng.api.Materials.matQuartz.itemID; damageValue = is.getItemDamage(); is.itemID = itemID; */ /* - * Kinda Hacky + * Kinda hackery */ def.damageValue = def.getDamageValueHack( is ); - def.dspDamage = is.getItemDamageForDisplay(); + def.displayDamage = is.getItemDamageForDisplay(); def.maxDamage = is.getMaxDamage(); NBTTagCompound tagCompound = is.getTagCompound(); @@ -121,7 +121,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( is.getItem() == def.item && is.getItemDamage() == this.def.damageValue ) { - NBTTagCompound ta = (NBTTagCompound) def.tagCompound; + NBTTagCompound ta = def.tagCompound; NBTTagCompound tb = is.getTagCompound(); if ( ta == tb ) return true; @@ -203,7 +203,7 @@ public final class AEItemStack extends AEStack implements IAEItemS i.setShort( "Damage", (short) this.def.damageValue ); if ( def.tagCompound != null ) - i.setTag( "tag", (NBTTagCompound) def.tagCompound ); + i.setTag( "tag", def.tagCompound ); else i.removeTag( "tag" ); @@ -218,12 +218,12 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( itemstack == null ) return null; - AEItemStack aeis = AEItemStack.create( itemstack ); - // aeis.priority = i.getInteger( "Priority" ); - aeis.stackSize = i.getLong( "Cnt" ); - aeis.setCountRequestable( i.getLong( "Req" ) ); - aeis.setCraftable( i.getBoolean( "Craft" ) ); - return aeis; + AEItemStack item = AEItemStack.create( itemstack ); + // item.priority = i.getInteger( "Priority" ); + item.stackSize = i.getLong( "Cnt" ); + item.setCountRequestable( i.getLong( "Req" ) ); + item.setCraftable( i.getBoolean( "Craft" ) ); + return item; } @Override @@ -242,10 +242,10 @@ public final class AEItemStack extends AEStack implements IAEItemS public int compareTo(AEItemStack b) { int id = compare( def.item.hashCode(), b.def.item.hashCode() ); - int dv = compare( def.damageValue, b.def.damageValue ); - int dspv = compare( def.dspDamage, b.def.dspDamage ); + int damageValue = compare( def.damageValue, b.def.damageValue ); + int displayDamage = compare( def.displayDamage, b.def.displayDamage ); // AELog.info( "NBT: " + nbt ); - return id == 0 ? (dv == 0 ? (dspv == 0 ? compareNBT( b.def ) : dspv) : dv) : id; + return id == 0 ? (damageValue == 0 ? (displayDamage == 0 ? compareNBT( b.def ) : displayDamage) : damageValue) : id; } private int compareNBT(AEItemDef b) @@ -370,12 +370,12 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( itemstack == null ) return null; - AEItemStack aeis = AEItemStack.create( itemstack ); - // aeis.priority = (int) priority; - aeis.stackSize = stackSize; - aeis.setCountRequestable( countRequestable ); - aeis.setCraftable( isCraftable ); - return aeis; + AEItemStack item = AEItemStack.create( itemstack ); + // item.priority = (int) priority; + item.stackSize = stackSize; + item.setCountRequestable( countRequestable ); + item.setCraftable( isCraftable ); + return item; } @Override @@ -508,7 +508,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( ignoreMeta ) { - newDef.dspDamage = newDef.damageValue = 0; + newDef.displayDamage = newDef.damageValue = 0; newDef.reHash(); return bottom; } @@ -517,23 +517,23 @@ public final class AEItemStack extends AEStack implements IAEItemS { if ( fuzzy == FuzzyMode.IGNORE_ALL ) { - newDef.dspDamage = 0; + newDef.displayDamage = 0; } else if ( fuzzy == FuzzyMode.PERCENT_99 ) { if ( def.damageValue == 0 ) - newDef.dspDamage = 0; + newDef.displayDamage = 0; else - newDef.dspDamage = 1; + newDef.displayDamage = 1; } else { int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage ); - newDef.dspDamage = breakpoint <= def.dspDamage ? breakpoint : 0; + newDef.displayDamage = breakpoint <= def.displayDamage ? breakpoint : 0; } - newDef.damageValue = newDef.dspDamage; + newDef.damageValue = newDef.displayDamage; } newDef.tagCompound = AEItemDef.lowTag; @@ -548,7 +548,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if ( ignoreMeta ) { - newDef.dspDamage = newDef.damageValue = Integer.MAX_VALUE; + newDef.displayDamage = newDef.damageValue = Integer.MAX_VALUE; newDef.reHash(); return top; } @@ -557,22 +557,22 @@ public final class AEItemStack extends AEStack implements IAEItemS { if ( fuzzy == FuzzyMode.IGNORE_ALL ) { - newDef.dspDamage = def.maxDamage + 1; + newDef.displayDamage = def.maxDamage + 1; } else if ( fuzzy == FuzzyMode.PERCENT_99 ) { if ( def.damageValue == 0 ) - newDef.dspDamage = 0; + newDef.displayDamage = 0; else - newDef.dspDamage = def.maxDamage + 1; + newDef.displayDamage = def.maxDamage + 1; } else { int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage ); - newDef.dspDamage = def.dspDamage < breakpoint ? breakpoint - 1 : def.maxDamage + 1; + newDef.displayDamage = def.displayDamage < breakpoint ? breakpoint - 1 : def.maxDamage + 1; } - newDef.damageValue = newDef.dspDamage; + newDef.damageValue = newDef.displayDamage; } newDef.tagCompound = AEItemDef.highTag; diff --git a/src/main/java/appeng/util/item/AESharedNBT.java b/src/main/java/appeng/util/item/AESharedNBT.java index 144f13837..a2f72241c 100644 --- a/src/main/java/appeng/util/item/AESharedNBT.java +++ b/src/main/java/appeng/util/item/AESharedNBT.java @@ -58,11 +58,9 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound AESharedNBT x = new AESharedNBT( itemID, damageValue ); // c.getTags() - Iterator var2 = c.func_150296_c().iterator(); - - while (var2.hasNext()) + for (Object o : c.func_150296_c()) { - String name = (String) var2.next(); + String name = (String) o; x.setTag( name, c.getTag( name ).copy() ); } @@ -83,9 +81,9 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return super.equals( par1Obj ); } - public boolean matches(Item itemid2, int meta2, int orderlessHash) + public boolean matches(Item item, int meta, int orderlessHash) { - return itemid2 == item && meta == meta2 && hash == orderlessHash; + return item == this.item && this.meta == meta && hash == orderlessHash; } public boolean comparePreciseWithRegistry(AESharedNBT tagCompound) @@ -122,7 +120,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound /* * Shared Tag Compound Cache. */ - private static WeakHashMap> sharedTagCompounds = new WeakHashMap(); + private static WeakHashMap> sharedTagCompounds = new WeakHashMap>(); /* * Debug purposes. @@ -148,7 +146,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound if ( tagCompound.hasNoTags() ) return null; - Item itemid = s.getItem(); + Item item = s.getItem(); int meta = -1; if ( s.getItem() != null && s.isItemStackDamageable() && s.getHasSubtypes() ) meta = s.getItemDamage(); @@ -156,7 +154,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound if ( isShared( tagCompound ) ) return tagCompound; - SharedSearchObject sso = new SharedSearchObject( itemid, meta, tagCompound ); + SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound ); WeakReference c = sharedTagCompounds.get( sso ); if ( c != null ) @@ -167,7 +165,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound // as its already certain to exist.. } - AESharedNBT clone = AESharedNBT.createFromCompound( itemid, meta, tagCompound ); + AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound ); sso.compound = (NBTTagCompound) sso.compound.copy(); // prevent // modification // of data based diff --git a/src/main/java/appeng/util/item/AEStack.java b/src/main/java/appeng/util/item/AEStack.java index ee26520a3..dde555bcd 100644 --- a/src/main/java/appeng/util/item/AEStack.java +++ b/src/main/java/appeng/util/item/AEStack.java @@ -95,11 +95,11 @@ public abstract class AEStack implements IAEStack implements IAEStack implements IItemList { - private final TreeMap records = new TreeMap(); + private final TreeMap records = new TreeMap(); private final Class clz; // private int currentPriority = Integer.MIN_VALUE; @@ -26,7 +22,8 @@ public final class ItemList implements IItemList cla) { + public ItemList(Class cla) + { clz = cla; } @@ -119,7 +116,7 @@ public final class ItemList implements IItemList implements IItemList i = this.iterator(); - while (i.hasNext()) - return i.next(); + for (StackType stackType : this) + { + return stackType; + } return null; } @@ -154,9 +152,9 @@ public final class ItemList implements IItemList iterator() { - return new MeaningfulIterator( records.values().iterator() ); + return new MeaningfulIterator( records.values().iterator() ); } @Override @@ -197,11 +195,19 @@ public final class ItemList implements IItemList findFuzzy(StackType filter, FuzzyMode fuzzy) { if ( checkStackType( filter ) ) - return new ArrayList(); + return new ArrayList(); if ( filter instanceof IAEFluidStack ) - return filter.equals( this ) ? (List) Arrays.asList( new IAEFluidStack[] { (IAEFluidStack) filter } ) : (List) Arrays - .asList( new IAEFluidStack[] {} ); + { + List result = Lists.newArrayList(); + + if ( filter.equals( this ) ) + { + result.add( filter ); + } + + return result; + } AEItemStack ais = (AEItemStack) filter; if ( ais.isOre() ) @@ -214,7 +220,7 @@ public final class ItemList implements IItemList output = new LinkedList(); + Collection output = new LinkedList(); for (IAEItemStack is : or.getAEEquivalents()) output.addAll( findFuzzyDamage( (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) ); diff --git a/src/main/java/appeng/util/item/OreHelper.java b/src/main/java/appeng/util/item/OreHelper.java index 673c76f6e..b8d0ce2de 100644 --- a/src/main/java/appeng/util/item/OreHelper.java +++ b/src/main/java/appeng/util/item/OreHelper.java @@ -16,7 +16,8 @@ public class OreHelper class ItemRef { - ItemRef(ItemStack stack) { + ItemRef(ItemStack stack) + { ref = stack.getItem(); if ( stack.getItem().isDamageable() ) @@ -32,10 +33,14 @@ public class OreHelper int hash; @Override - public boolean equals(Object o) + public boolean equals(Object obj) { - ItemRef obj = (ItemRef) o; - return damage == obj.damage && ref == obj.ref; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + ItemRef other = (ItemRef) obj; + return damage == other.damage && ref == other.ref; } @Override @@ -44,16 +49,16 @@ public class OreHelper return hash; } - }; + } class OreResult { public OreReference oreValue = null; - }; + } - HashMap references = new HashMap(); + HashMap references = new HashMap(); public OreReference isOre(ItemStack ItemStack) { @@ -101,14 +106,14 @@ public class OreHelper public boolean sameOre(AEItemStack aeItemStack, IAEItemStack is) { OreReference a = aeItemStack.def.isOre; - OreReference b = ((AEItemStack) aeItemStack).def.isOre; - - if ( a == b ) - return true; + OreReference b = aeItemStack.def.isOre; if ( a == null || b == null ) return false; + if ( a == b ) + return true; + Collection bOres = b.getOres(); for (Integer ore : a.getOres()) { diff --git a/src/main/java/appeng/util/item/OreReference.java b/src/main/java/appeng/util/item/OreReference.java index b3609bd7f..6ece2e0bf 100644 --- a/src/main/java/appeng/util/item/OreReference.java +++ b/src/main/java/appeng/util/item/OreReference.java @@ -12,8 +12,8 @@ import appeng.api.storage.data.IAEItemStack; public class OreReference { - private LinkedList otherOptions = new LinkedList(); - private ArrayList aeotherOptions = null; + private LinkedList otherOptions = new LinkedList(); + private ArrayList aeOtherOptions = null; private HashSet ores = new HashSet(); public Collection getEquivalents() @@ -23,17 +23,17 @@ public class OreReference public List getAEEquivalents() { - if ( aeotherOptions == null ) + if ( aeOtherOptions == null ) { - aeotherOptions = new ArrayList( otherOptions.size() ); + aeOtherOptions = new ArrayList( otherOptions.size() ); // SUMMON AE STACKS! for (ItemStack is : otherOptions) if ( is.getItem() != null ) - aeotherOptions.add( AEItemStack.create( is ) ); + aeOtherOptions.add( AEItemStack.create( is ) ); } - return aeotherOptions; + return aeOtherOptions; } public Collection getOres() diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index 82caca1ab..59b7acffa 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -23,10 +23,12 @@ public class SharedSearchObject { if ( obj == null ) return false; - SharedSearchObject b = (SharedSearchObject) obj; - if ( def == b.def && hash == b.hash ) + if ( getClass() != obj.getClass() ) + return false; + SharedSearchObject other = (SharedSearchObject) obj; + if ( def == other.def && hash == other.hash ) { - return Platform.NBTEqualityTest( compound, b.compound ); + return Platform.NBTEqualityTest( compound, other.compound ); } return false; } diff --git a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java index 67bdd79e4..942106d1f 100644 --- a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java @@ -10,6 +10,7 @@ public class DefaultPriorityList> implements IPartitionLis final static List nullList = new ArrayList(); + @Override public boolean isListed(T input) { return false; @@ -24,7 +25,7 @@ public class DefaultPriorityList> implements IPartitionLis @Override public Iterable getItems() { - return (Iterable) nullList; + return nullList; } } diff --git a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java index 967d1f7d5..49915cfc4 100644 --- a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java @@ -17,6 +17,7 @@ public class FuzzyPriorityList> implements IPartitionList< this.mode = mode; } + @Override public boolean isListed(T input) { Collection out = list.findFuzzy( input, mode ); diff --git a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java index f6a452fdb..c5881198c 100644 --- a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java @@ -8,8 +8,8 @@ import appeng.api.storage.data.IAEStack; public class MergedPriorityList> implements IPartitionList { - final List> positive = new ArrayList(); - final List> negative = new ArrayList(); + final List> positive = new ArrayList>(); + final List> negative = new ArrayList>(); public void addNewList(IPartitionList list, boolean isWhitelist) { @@ -19,6 +19,7 @@ public class MergedPriorityList> implements IPartitionList negative.add( list ); } + @Override public boolean isListed(T input) { for (IPartitionList l : negative) diff --git a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java index 102ee012e..603eca01d 100644 --- a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java +++ b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java @@ -12,6 +12,7 @@ public class PrecisePriorityList> implements IPartitionLis list = in; } + @Override public boolean isListed(T input) { return list.findPrecise( input ) != null; diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Bright.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Bright.png similarity index 100% rename from src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Bright.png rename to src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Bright.png diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Colored.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Colored.png similarity index 100% rename from src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Colored.png rename to src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Colored.png diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Dark.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Dark.png similarity index 100% rename from src/main/resources/assets/appliedenergistics2/textures/blocks/PartConvMonitor_Dark.png rename to src/main/resources/assets/appliedenergistics2/textures/blocks/PartConversionMonitor_Dark.png