From 410d2f1e0da6fc23a54fcf2286cad73024634f45 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Fri, 25 Sep 2015 23:10:56 +0200 Subject: [PATCH] final variables and parameters seeing some methods it does actually help to enforce the parameters --- src/api/java/appeng/api/AEApi.java | 6 +- .../appeng/api/config/AccessRestriction.java | 12 +- src/api/java/appeng/api/config/FuzzyMode.java | 4 +- .../appeng/api/config/PowerMultiplier.java | 4 +- .../java/appeng/api/config/PowerUnits.java | 4 +- src/api/java/appeng/api/config/Settings.java | 2 +- src/api/java/appeng/api/config/Upgrades.java | 10 +- .../api/events/LocatableEventAnnounce.java | 2 +- .../api/exceptions/AppEngException.java | 2 +- .../exceptions/CoreInaccessibleException.java | 2 +- .../api/exceptions/MissingDefinition.java | 2 +- .../exceptions/MissingIngredientError.java | 2 +- .../api/exceptions/ModNotInstalled.java | 2 +- .../appeng/api/exceptions/RecipeError.java | 2 +- .../api/exceptions/RegistrationError.java | 2 +- .../api/implementations/TransitionResult.java | 2 +- .../events/MENetworkChannelChanged.java | 2 +- .../events/MENetworkCraftingCpuChange.java | 2 +- .../MENetworkCraftingPatternChange.java | 2 +- .../api/networking/events/MENetworkEvent.java | 2 +- .../events/MENetworkPowerIdleChange.java | 2 +- .../events/MENetworkPowerStorage.java | 2 +- .../events/MENetworkSpatialEvent.java | 2 +- .../events/MENetworkStorageEvent.java | 2 +- .../networking/security/MachineSource.java | 2 +- .../api/networking/security/PlayerSource.java | 2 +- .../networking/ticking/TickingRequest.java | 2 +- .../appeng/api/parts/CableRenderMode.java | 2 +- src/api/java/appeng/api/parts/LayerBase.java | 2 +- .../java/appeng/api/parts/SelectedPart.java | 4 +- .../appeng/api/recipes/ResolverResult.java | 4 +- .../appeng/api/recipes/ResolverResultSet.java | 2 +- .../appeng/api/storage/MEMonitorHandler.java | 34 +- .../appeng/api/storage/StorageChannel.java | 2 +- src/api/java/appeng/api/util/AEColor.java | 4 +- .../appeng/api/util/DimensionalCoord.java | 12 +- src/api/java/appeng/api/util/WorldCoord.java | 34 +- src/main/java/appeng/block/AEBaseBlock.java | 94 ++-- .../java/appeng/block/AEBaseItemBlock.java | 18 +- .../block/AEBaseItemBlockChargeable.java | 24 +- .../appeng/block/AEBaseItemBlockSlab.java | 2 +- .../java/appeng/block/AEBaseSlabBlock.java | 16 +- .../java/appeng/block/AEBaseStairBlock.java | 2 +- .../java/appeng/block/AEBaseTileBlock.java | 38 +- .../java/appeng/block/AEDecorativeBlock.java | 4 +- .../block/crafting/BlockCraftingMonitor.java | 6 +- .../block/crafting/BlockCraftingStorage.java | 6 +- .../block/crafting/BlockCraftingUnit.java | 32 +- .../crafting/BlockMolecularAssembler.java | 6 +- .../block/crafting/ItemCraftingStorage.java | 8 +- .../appeng/block/grindstone/BlockCrank.java | 30 +- .../appeng/block/grindstone/BlockGrinder.java | 4 +- .../appeng/block/misc/BlockCellWorkbench.java | 4 +- .../java/appeng/block/misc/BlockCharger.java | 32 +- .../appeng/block/misc/BlockCondenser.java | 4 +- .../appeng/block/misc/BlockInscriber.java | 4 +- .../appeng/block/misc/BlockInterface.java | 6 +- .../appeng/block/misc/BlockLightDetector.java | 34 +- .../java/appeng/block/misc/BlockPaint.java | 24 +- .../misc/BlockQuartzGrowthAccelerator.java | 16 +- .../appeng/block/misc/BlockQuartzTorch.java | 38 +- .../java/appeng/block/misc/BlockSecurity.java | 4 +- .../appeng/block/misc/BlockSkyCompass.java | 30 +- .../java/appeng/block/misc/BlockTinyTNT.java | 28 +- .../block/misc/BlockVibrationChamber.java | 30 +- .../block/networking/BlockCableBus.java | 130 +++--- .../block/networking/BlockController.java | 4 +- .../networking/BlockDenseEnergyCell.java | 2 +- .../block/networking/BlockEnergyCell.java | 8 +- .../block/networking/BlockWireless.java | 16 +- .../appeng/block/qnb/BlockQuantumBase.java | 12 +- .../block/qnb/BlockQuantumLinkChamber.java | 16 +- .../appeng/block/qnb/BlockQuantumRing.java | 8 +- .../appeng/block/solids/BlockQuartzGlass.java | 4 +- .../appeng/block/solids/BlockQuartzLamp.java | 10 +- .../appeng/block/solids/BlockSkyStone.java | 22 +- .../java/appeng/block/solids/OreQuartz.java | 24 +- .../appeng/block/solids/OreQuartzCharged.java | 12 +- .../block/spatial/BlockMatrixFrame.java | 14 +- .../block/spatial/BlockSpatialIOPort.java | 8 +- .../block/spatial/BlockSpatialPylon.java | 8 +- .../block/stair/ChiseledQuartzStairBlock.java | 2 +- .../appeng/block/stair/FluixStairBlock.java | 2 +- .../block/stair/QuartzPillarStairBlock.java | 2 +- .../appeng/block/stair/QuartzStairBlock.java | 2 +- .../block/stair/SkyStoneBlockStairBlock.java | 2 +- .../block/stair/SkyStoneBrickStairBlock.java | 2 +- .../stair/SkyStoneSmallBrickStairBlock.java | 2 +- .../block/stair/SkyStoneStairBlock.java | 2 +- .../java/appeng/block/storage/BlockChest.java | 8 +- .../java/appeng/block/storage/BlockDrive.java | 4 +- .../appeng/block/storage/BlockIOPort.java | 8 +- .../appeng/block/storage/BlockSkyChest.java | 30 +- src/main/java/appeng/client/ClientHelper.java | 112 ++--- .../java/appeng/client/gui/AEBaseGui.java | 182 ++++---- .../java/appeng/client/gui/AEBaseMEGui.java | 26 +- src/main/java/appeng/client/gui/GuiNull.java | 6 +- .../appeng/client/gui/config/AEConfigGui.java | 10 +- .../client/gui/config/AEConfigGuiFactory.java | 4 +- .../gui/implementations/GuiCellWorkbench.java | 18 +- .../client/gui/implementations/GuiChest.java | 8 +- .../gui/implementations/GuiCondenser.java | 10 +- .../gui/implementations/GuiCraftAmount.java | 44 +- .../gui/implementations/GuiCraftConfirm.java | 116 ++--- .../gui/implementations/GuiCraftingCPU.java | 68 +-- .../implementations/GuiCraftingStatus.java | 24 +- .../gui/implementations/GuiCraftingTerm.java | 12 +- .../client/gui/implementations/GuiDrive.java | 8 +- .../implementations/GuiFormationPlane.java | 8 +- .../gui/implementations/GuiGrinder.java | 6 +- .../client/gui/implementations/GuiIOPort.java | 14 +- .../gui/implementations/GuiInscriber.java | 6 +- .../gui/implementations/GuiInterface.java | 8 +- .../implementations/GuiInterfaceTerminal.java | 68 +-- .../gui/implementations/GuiLevelEmitter.java | 34 +- .../client/gui/implementations/GuiMAC.java | 6 +- .../gui/implementations/GuiMEMonitorable.java | 52 +-- .../implementations/GuiMEPortableCell.java | 2 +- .../gui/implementations/GuiNetworkStatus.java | 64 +-- .../gui/implementations/GuiNetworkTool.java | 10 +- .../gui/implementations/GuiPatternTerm.java | 10 +- .../gui/implementations/GuiPriority.java | 44 +- .../client/gui/implementations/GuiQNB.java | 6 +- .../gui/implementations/GuiQuartzKnife.java | 12 +- .../gui/implementations/GuiSecurity.java | 12 +- .../gui/implementations/GuiSkyChest.java | 6 +- .../gui/implementations/GuiSpatialIOPort.java | 10 +- .../gui/implementations/GuiStorageBus.java | 10 +- .../gui/implementations/GuiUpgradeable.java | 12 +- .../implementations/GuiVibrationChamber.java | 12 +- .../gui/implementations/GuiWireless.java | 20 +- .../gui/implementations/GuiWirelessTerm.java | 2 +- .../client/gui/widgets/GuiImgButton.java | 34 +- .../client/gui/widgets/GuiNumberBox.java | 8 +- .../client/gui/widgets/GuiProgressBar.java | 16 +- .../client/gui/widgets/GuiScrollbar.java | 16 +- .../client/gui/widgets/GuiTabButton.java | 12 +- .../client/gui/widgets/GuiToggleButton.java | 14 +- .../client/gui/widgets/MEGuiTextField.java | 6 +- .../appeng/client/me/ClientDCInternalInv.java | 6 +- .../java/appeng/client/me/InternalSlotME.java | 2 +- src/main/java/appeng/client/me/ItemRepo.java | 46 +- .../appeng/client/me/SlotDisconnected.java | 20 +- src/main/java/appeng/client/me/SlotME.java | 14 +- .../client/render/AppEngRenderItem.java | 38 +- .../appeng/client/render/BaseBlockRender.java | 91 ++-- .../appeng/client/render/BlockRenderInfo.java | 10 +- .../appeng/client/render/BusRenderHelper.java | 94 ++-- .../appeng/client/render/BusRenderer.java | 18 +- .../client/render/CableRenderHelper.java | 54 +-- .../appeng/client/render/ItemRenderer.java | 6 +- .../client/render/RenderBlocksWorkaround.java | 200 ++++---- .../client/render/SpatialSkyRender.java | 52 +-- .../appeng/client/render/TESRWrapper.java | 10 +- .../appeng/client/render/WorldRender.java | 18 +- .../render/blocks/RenderBlockAssembler.java | 30 +- .../render/blocks/RenderBlockCharger.java | 8 +- .../render/blocks/RenderBlockController.java | 20 +- .../render/blocks/RenderBlockCraftingCPU.java | 60 +-- .../blocks/RenderBlockCraftingCPUMonitor.java | 22 +- .../render/blocks/RenderBlockCrank.java | 6 +- .../render/blocks/RenderBlockEnergyCube.java | 14 +- .../render/blocks/RenderBlockInscriber.java | 10 +- .../render/blocks/RenderBlockInterface.java | 10 +- .../render/blocks/RenderBlockPaint.java | 24 +- .../blocks/RenderBlockQuartzAccelerator.java | 10 +- .../render/blocks/RenderBlockSkyChest.java | 6 +- .../render/blocks/RenderBlockSkyCompass.java | 32 +- .../render/blocks/RenderBlockWireless.java | 40 +- .../client/render/blocks/RenderDrive.java | 24 +- .../client/render/blocks/RenderMEChest.java | 22 +- .../client/render/blocks/RenderNull.java | 4 +- .../client/render/blocks/RenderQNB.java | 38 +- .../render/blocks/RenderQuartzGlass.java | 28 +- .../client/render/blocks/RenderQuartzOre.java | 4 +- .../render/blocks/RenderQuartzTorch.java | 58 +-- .../render/blocks/RenderSpatialPylon.java | 22 +- .../client/render/blocks/RenderTinyTNT.java | 6 +- .../render/blocks/RendererCableBus.java | 8 +- .../render/blocks/RendererSecurity.java | 10 +- .../client/render/effects/AssemblerFX.java | 10 +- .../client/render/effects/ChargedOreFX.java | 4 +- .../client/render/effects/CraftingFx.java | 24 +- .../client/render/effects/EnergyFx.java | 30 +- .../client/render/effects/LightningArcFX.java | 12 +- .../client/render/effects/LightningFX.java | 38 +- .../client/render/effects/MatterCannonFX.java | 24 +- .../client/render/effects/VibrantFX.java | 6 +- .../items/ItemEncodedPatternRenderer.java | 16 +- .../client/render/items/PaintBallRender.java | 34 +- .../render/items/ToolBiometricCardRender.java | 32 +- .../items/ToolColorApplicatorRender.java | 20 +- .../client/render/model/ModelCompass.java | 4 +- .../client/texture/CableBusTextures.java | 6 +- .../client/texture/ExtraBlockTextures.java | 6 +- .../client/texture/ExtraItemTextures.java | 6 +- .../appeng/client/texture/FlippableIcon.java | 10 +- .../java/appeng/client/texture/FullIcon.java | 6 +- .../appeng/client/texture/MissingIcon.java | 6 +- .../appeng/client/texture/OffsetIcon.java | 10 +- .../appeng/client/texture/TaughtIcon.java | 6 +- .../client/texture/TmpFlippableIcon.java | 2 +- .../appeng/container/AEBaseContainer.java | 198 ++++---- .../java/appeng/container/ContainerNull.java | 2 +- .../container/ContainerOpenContext.java | 4 +- .../appeng/container/guisync/SyncData.java | 38 +- .../ContainerCellWorkbench.java | 69 ++- .../implementations/ContainerChest.java | 2 +- .../implementations/ContainerCondenser.java | 6 +- .../implementations/ContainerCraftAmount.java | 4 +- .../ContainerCraftConfirm.java | 54 +-- .../implementations/ContainerCraftingCPU.java | 36 +- .../ContainerCraftingStatus.java | 18 +- .../ContainerCraftingTerm.java | 14 +- .../implementations/ContainerDrive.java | 2 +- .../ContainerFormationPlane.java | 14 +- .../implementations/ContainerGrinder.java | 2 +- .../implementations/ContainerIOPort.java | 6 +- .../implementations/ContainerInscriber.java | 20 +- .../implementations/ContainerInterface.java | 4 +- .../ContainerInterfaceTerminal.java | 94 ++-- .../ContainerLevelEmitter.java | 18 +- .../implementations/ContainerMAC.java | 20 +- .../ContainerMEMonitorable.java | 66 +-- .../ContainerMEPortableCell.java | 6 +- .../ContainerNetworkStatus.java | 32 +- .../implementations/ContainerNetworkTool.java | 8 +- .../implementations/ContainerPatternTerm.java | 100 ++-- .../implementations/ContainerPriority.java | 8 +- .../implementations/ContainerQNB.java | 2 +- .../implementations/ContainerQuartzKnife.java | 30 +- .../implementations/ContainerSecurity.java | 30 +- .../implementations/ContainerSkyChest.java | 4 +- .../ContainerSpatialIOPort.java | 6 +- .../implementations/ContainerStorageBus.java | 24 +- .../implementations/ContainerUpgradeable.java | 32 +- .../ContainerVibrationChamber.java | 2 +- .../implementations/ContainerWireless.java | 4 +- .../ContainerWirelessTerm.java | 2 +- .../implementations/CraftingCPURecord.java | 6 +- .../container/slot/AppEngCraftingSlot.java | 16 +- .../appeng/container/slot/AppEngSlot.java | 8 +- .../java/appeng/container/slot/NullSlot.java | 14 +- .../container/slot/OptionalSlotFake.java | 2 +- .../slot/OptionalSlotFakeTypeOnly.java | 2 +- .../container/slot/OptionalSlotNormal.java | 2 +- .../slot/OptionalSlotRestrictedInput.java | 2 +- .../container/slot/QuartzKnifeOutput.java | 2 +- .../container/slot/SlotCraftingMatrix.java | 8 +- .../container/slot/SlotCraftingTerm.java | 44 +- .../appeng/container/slot/SlotDisabled.java | 6 +- .../java/appeng/container/slot/SlotFake.java | 10 +- .../container/slot/SlotFakeBlacklist.java | 2 +- .../slot/SlotFakeCraftingMatrix.java | 2 +- .../container/slot/SlotFakeTypeOnly.java | 2 +- .../container/slot/SlotInaccessible.java | 8 +- .../container/slot/SlotInaccessibleHD.java | 2 +- .../appeng/container/slot/SlotMACPattern.java | 4 +- .../appeng/container/slot/SlotNormal.java | 2 +- .../appeng/container/slot/SlotOutput.java | 4 +- .../container/slot/SlotPatternOutputs.java | 2 +- .../container/slot/SlotPatternTerm.java | 4 +- .../container/slot/SlotPlayerHotBar.java | 2 +- .../appeng/container/slot/SlotPlayerInv.java | 2 +- .../container/slot/SlotRestrictedInput.java | 32 +- src/main/java/appeng/core/AEConfig.java | 94 ++-- src/main/java/appeng/core/AELog.java | 18 +- src/main/java/appeng/core/Api.java | 4 +- src/main/java/appeng/core/ApiDefinitions.java | 2 +- src/main/java/appeng/core/AppEng.java | 22 +- src/main/java/appeng/core/CreativeTab.java | 6 +- src/main/java/appeng/core/FacadeConfig.java | 14 +- .../appeng/core/FeatureHandlerRegistry.java | 2 +- .../java/appeng/core/FeatureRegistry.java | 2 +- src/main/java/appeng/core/IMCHandler.java | 8 +- src/main/java/appeng/core/RecipeLoader.java | 6 +- src/main/java/appeng/core/Registration.java | 48 +- src/main/java/appeng/core/api/ApiPart.java | 92 ++-- src/main/java/appeng/core/api/ApiStorage.java | 14 +- .../core/api/definitions/ApiBlocks.java | 2 +- .../appeng/core/api/definitions/ApiItems.java | 2 +- .../core/api/definitions/ApiMaterials.java | 2 +- .../appeng/core/api/definitions/ApiParts.java | 2 +- .../definitions/DefinitionConstructor.java | 18 +- .../core/api/imc/IMCBlackListSpatial.java | 6 +- .../java/appeng/core/api/imc/IMCGrinder.java | 20 +- .../appeng/core/api/imc/IMCMatterCannon.java | 10 +- .../appeng/core/api/imc/IMCP2PAttunement.java | 8 +- .../java/appeng/core/api/imc/IMCSpatial.java | 6 +- .../core/crash/BaseCrashEnhancement.java | 2 +- .../core/crash/ModCrashEnhancement.java | 2 +- .../core/features/AEBlockFeatureHandler.java | 4 +- .../features/AECableBusFeatureHandler.java | 4 +- .../java/appeng/core/features/AEFeature.java | 4 +- .../features/AETileBlockFeatureHandler.java | 4 +- .../appeng/core/features/ActivityState.java | 2 +- .../appeng/core/features/BlockDefinition.java | 26 +- .../appeng/core/features/BlockStackSrc.java | 4 +- .../core/features/ColoredItemDefinition.java | 22 +- .../core/features/DamagedItemDefinition.java | 14 +- .../core/features/DefinitionConverter.java | 26 +- .../core/features/FeatureNameExtractor.java | 2 +- .../core/features/FeaturedActiveChecker.java | 4 +- .../appeng/core/features/ItemDefinition.java | 12 +- .../core/features/ItemFeatureHandler.java | 2 +- .../appeng/core/features/ItemStackSrc.java | 4 +- .../core/features/MaterialStackSrc.java | 4 +- .../appeng/core/features/NameResolver.java | 4 +- .../features/SlabBlockFeatureHandler.java | 2 +- .../features/StairBlockFeatureHandler.java | 4 +- .../appeng/core/features/TileDefinition.java | 4 +- .../features/WrappedDamageItemDefinition.java | 10 +- .../features/registries/CellRegistry.java | 14 +- .../registries/ExternalStorageRegistry.java | 6 +- .../registries/GridCacheRegistry.java | 18 +- .../registries/GrinderRecipeManager.java | 46 +- .../registries/InscriberRegistry.java | 14 +- .../registries/LocatableRegistry.java | 6 +- .../registries/MatterCannonAmmoRegistry.java | 10 +- .../registries/MovableTileRegistry.java | 28 +- .../registries/P2PTunnelRegistry.java | 16 +- .../features/registries/PlayerRegistry.java | 6 +- .../registries/RecipeHandlerRegistry.java | 16 +- .../registries/SpecialComparisonRegistry.java | 8 +- .../registries/WirelessRangeResult.java | 2 +- .../features/registries/WirelessRegistry.java | 12 +- .../features/registries/WorldGenRegistry.java | 16 +- .../entries/AppEngGrinderRecipe.java | 16 +- .../registries/entries/BasicCellHandler.java | 14 +- .../entries/CreativeCellHandler.java | 10 +- .../registries/entries/ExternalIInv.java | 6 +- .../entries/InscriberInscribeRecipe.java | 2 +- .../registries/entries/InscriberRecipe.java | 6 +- .../core/localization/ButtonToolTips.java | 2 +- .../appeng/core/localization/GuiText.java | 2 +- .../appeng/core/localization/WailaText.java | 2 +- .../java/appeng/core/settings/TickRates.java | 4 +- .../stats/AchievementCraftingHandler.java | 6 +- .../core/stats/AchievementPickupHandler.java | 8 +- .../java/appeng/core/stats/Achievements.java | 10 +- .../core/stats/PlayerDifferentiator.java | 2 +- .../core/stats/PlayerStatsRegistration.java | 12 +- src/main/java/appeng/core/stats/Stats.java | 2 +- .../java/appeng/core/sync/AppEngPacket.java | 8 +- .../core/sync/AppEngPacketHandlerBase.java | 12 +- src/main/java/appeng/core/sync/GuiBridge.java | 105 +++-- .../network/AppEngClientPacketHandler.java | 16 +- .../network/AppEngServerPacketHandler.java | 16 +- .../core/sync/network/NetworkHandler.java | 26 +- .../packets/PacketAssemblerAnimation.java | 14 +- .../appeng/core/sync/packets/PacketClick.java | 16 +- .../sync/packets/PacketCompassRequest.java | 12 +- .../sync/packets/PacketCompassResponse.java | 8 +- .../sync/packets/PacketCompressedNBT.java | 12 +- .../core/sync/packets/PacketConfigButton.java | 14 +- .../core/sync/packets/PacketCraftRequest.java | 28 +- .../sync/packets/PacketInventoryAction.java | 26 +- .../core/sync/packets/PacketLightning.java | 12 +- .../sync/packets/PacketMEInventoryUpdate.java | 22 +- .../core/sync/packets/PacketMatterCannon.java | 18 +- .../sync/packets/PacketMockExplosion.java | 10 +- .../core/sync/packets/PacketMultiPart.java | 10 +- .../core/sync/packets/PacketNEIRecipe.java | 66 +-- .../packets/PacketNewStorageDimension.java | 10 +- .../sync/packets/PacketPaintedEntity.java | 10 +- .../sync/packets/PacketPartPlacement.java | 10 +- .../core/sync/packets/PacketPartialItem.java | 10 +- .../core/sync/packets/PacketPatternSlot.java | 18 +- .../core/sync/packets/PacketProgressBar.java | 14 +- .../core/sync/packets/PacketSwapSlots.java | 8 +- .../core/sync/packets/PacketSwitchGuis.java | 18 +- .../sync/packets/PacketTransitionEffect.java | 14 +- .../core/sync/packets/PacketValueConfig.java | 64 +-- .../appeng/core/worlddata/DimensionData.java | 18 +- .../core/worlddata/MeteorDataNameEncoder.java | 4 +- .../appeng/core/worlddata/PlayerData.java | 4 +- .../appeng/core/worlddata/PlayerMapping.java | 6 +- .../worlddata/PlayerMappingsInitializer.java | 4 +- .../java/appeng/core/worlddata/SpawnData.java | 38 +- .../appeng/core/worlddata/StorageData.java | 38 +- .../java/appeng/core/worlddata/WorldData.java | 4 +- .../appeng/crafting/CraftBranchFailure.java | 2 +- .../crafting/CraftingCalculationFailure.java | 2 +- .../java/appeng/crafting/CraftingJob.java | 60 +-- .../java/appeng/crafting/CraftingLink.java | 10 +- .../appeng/crafting/CraftingLinkNexus.java | 14 +- .../appeng/crafting/CraftingTreeNode.java | 72 +-- .../appeng/crafting/CraftingTreeProcess.java | 82 ++-- .../java/appeng/crafting/CraftingWatcher.java | 28 +- .../appeng/crafting/MECraftingInventory.java | 44 +- .../java/appeng/debug/BlockChunkloader.java | 4 +- .../java/appeng/debug/BlockCubeGenerator.java | 6 +- src/main/java/appeng/debug/BlockItemGen.java | 2 +- .../java/appeng/debug/BlockPhantomNode.java | 6 +- .../java/appeng/debug/TileChunkLoader.java | 6 +- .../java/appeng/debug/TileCubeGenerator.java | 12 +- src/main/java/appeng/debug/TileItemGen.java | 24 +- .../java/appeng/debug/TilePhantomNode.java | 2 +- src/main/java/appeng/debug/ToolDebugCard.java | 48 +- src/main/java/appeng/debug/ToolEraser.java | 18 +- .../appeng/debug/ToolMeteoritePlacer.java | 8 +- .../java/appeng/debug/ToolReplicatorCard.java | 66 +-- .../java/appeng/entity/AEBaseEntityItem.java | 6 +- .../appeng/entity/EntityChargedQuartz.java | 24 +- .../appeng/entity/EntityFloatingItem.java | 4 +- .../appeng/entity/EntityGrowingCrystal.java | 32 +- src/main/java/appeng/entity/EntityIds.java | 2 +- .../java/appeng/entity/EntitySingularity.java | 24 +- .../appeng/entity/EntityTinyTNTPrimed.java | 18 +- .../appeng/entity/RenderFloatingItem.java | 4 +- .../appeng/entity/RenderTinyTNTPrimed.java | 8 +- .../java/appeng/facade/FacadeContainer.java | 48 +- src/main/java/appeng/facade/FacadePart.java | 88 ++-- src/main/java/appeng/fmp/CableBusPart.java | 140 +++--- src/main/java/appeng/fmp/FMPEvent.java | 22 +- .../java/appeng/fmp/FMPPlacementHelper.java | 40 +- src/main/java/appeng/fmp/PartRegistry.java | 10 +- src/main/java/appeng/fmp/QuartzTorchPart.java | 20 +- .../java/appeng/helpers/AEGlassMaterial.java | 2 +- .../java/appeng/helpers/DualityInterface.java | 220 ++++----- .../java/appeng/helpers/LocationRotation.java | 6 +- .../java/appeng/helpers/MetaRotation.java | 4 +- .../appeng/helpers/MultiCraftingTracker.java | 32 +- .../appeng/helpers/NonNullArrayIterator.java | 2 +- .../java/appeng/helpers/NullRotation.java | 2 +- .../java/appeng/helpers/PatternHelper.java | 64 +-- .../appeng/helpers/PlayerSecurityWrapper.java | 4 +- src/main/java/appeng/helpers/Splotch.java | 20 +- .../helpers/WirelessTerminalGuiObject.java | 48 +- src/main/java/appeng/hooks/AETrading.java | 26 +- .../java/appeng/hooks/CompassManager.java | 24 +- src/main/java/appeng/hooks/CompassResult.java | 2 +- .../hooks/DispenserBehaviorTinyTNT.java | 14 +- .../java/appeng/hooks/DispenserBlockTool.java | 16 +- .../appeng/hooks/DispenserMatterCannon.java | 14 +- src/main/java/appeng/hooks/TickHandler.java | 58 +-- .../appeng/integration/IntegrationHelper.java | 2 +- .../appeng/integration/IntegrationNode.java | 10 +- .../integration/IntegrationRegistry.java | 18 +- .../appeng/integration/IntegrationType.java | 2 +- .../BCHelpers/AECableSchematicTile.java | 18 +- .../BCHelpers/AEGenericSchematicTile.java | 16 +- .../BCHelpers/AERotatableBlockSchematic.java | 4 +- .../modules/BCHelpers/BCPipeHandler.java | 4 +- .../modules/BCHelpers/BCPipeInventory.java | 8 +- .../integration/modules/BetterStorage.java | 4 +- .../modules/BuildCraftBuilder.java | 8 +- .../integration/modules/BuildCraftCore.java | 6 +- .../modules/BuildCraftTransport.java | 36 +- .../appeng/integration/modules/CLApi.java | 10 +- .../integration/modules/CraftGuide.java | 38 +- .../java/appeng/integration/modules/DSU.java | 4 +- .../java/appeng/integration/modules/FMP.java | 52 +-- .../java/appeng/integration/modules/FZ.java | 50 +- .../java/appeng/integration/modules/IC2.java | 10 +- .../modules/ImmibisMicroblocks.java | 10 +- .../appeng/integration/modules/InvTweaks.java | 2 +- .../appeng/integration/modules/Mekanism.java | 6 +- .../java/appeng/integration/modules/NEI.java | 36 +- .../NEIHelpers/NEIAEShapedRecipeHandler.java | 58 +-- .../NEIAEShapelessRecipeHandler.java | 58 +-- .../NEIHelpers/NEICraftingHandler.java | 34 +- .../NEIHelpers/NEIFacadeRecipeHandler.java | 52 +-- .../NEIHelpers/NEIGrinderRecipeHandler.java | 46 +- .../NEIHelpers/NEIInscriberRecipeHandler.java | 36 +- .../NEIHelpers/NEIWorldCraftingHandler.java | 42 +- .../TerminalCraftingSlotFinder.java | 4 +- .../integration/modules/PneumaticCraft.java | 2 +- .../java/appeng/integration/modules/RC.java | 4 +- .../java/appeng/integration/modules/RF.java | 2 +- .../appeng/integration/modules/Waila.java | 2 +- .../integration/modules/helpers/BSCrate.java | 16 +- .../modules/helpers/BSCrateHandler.java | 4 +- .../helpers/BSCrateStorageAdaptor.java | 34 +- .../modules/helpers/FMPPacketEvent.java | 2 +- .../modules/helpers/FactorizationBarrel.java | 26 +- .../modules/helpers/FactorizationHandler.java | 4 +- .../modules/helpers/MFRDSUHandler.java | 4 +- .../MinefactoryReloadedDeepStorageUnit.java | 16 +- .../modules/helpers/NullRFHandler.java | 8 +- .../modules/waila/BaseWailaDataProvider.java | 10 +- .../modules/waila/PartWailaDataProvider.java | 20 +- .../modules/waila/TileWailaDataProvider.java | 18 +- .../waila/part/BasePartWailaDataProvider.java | 10 +- .../waila/part/ChannelWailaDataProvider.java | 6 +- .../modules/waila/part/PartAccessor.java | 2 +- .../part/PartStackWailaDataProvider.java | 2 +- .../part/PowerStateWailaDataProvider.java | 4 +- .../part/StorageMonitorWailaDataProvider.java | 6 +- .../modules/waila/part/Tracer.java | 18 +- .../waila/tile/ChargerWailaDataProvider.java | 2 +- .../CraftingMonitorWailaDataProvider.java | 2 +- .../tile/PowerStateWailaDataProvider.java | 2 +- .../tile/PowerStorageWailaDataProvider.java | 6 +- src/main/java/appeng/items/AEBaseItem.java | 14 +- .../appeng/items/contents/CellConfig.java | 2 +- .../appeng/items/contents/CellUpgrades.java | 2 +- .../items/contents/NetworkToolViewer.java | 14 +- .../items/contents/PortableCellViewer.java | 8 +- .../appeng/items/contents/QuartzKnifeObj.java | 2 +- .../items/materials/ItemMultiMaterial.java | 108 ++--- .../appeng/items/materials/MaterialType.java | 12 +- .../appeng/items/misc/ItemCrystalSeed.java | 56 +-- .../appeng/items/misc/ItemEncodedPattern.java | 40 +- .../java/appeng/items/misc/ItemPaintBall.java | 16 +- .../java/appeng/items/parts/ItemFacade.java | 78 ++-- .../appeng/items/parts/ItemMultiPart.java | 68 +-- .../java/appeng/items/parts/PartType.java | 4 +- .../items/storage/ItemBasicStorageCell.java | 64 +-- .../storage/ItemCreativeStorageCell.java | 10 +- .../items/storage/ItemSpatialStorageCell.java | 60 +-- .../appeng/items/storage/ItemViewCell.java | 36 +- .../appeng/items/tools/ToolBiometricCard.java | 50 +- .../appeng/items/tools/ToolMemoryCard.java | 34 +- .../appeng/items/tools/ToolNetworkTool.java | 38 +- .../items/tools/powered/ToolChargedStaff.java | 8 +- .../tools/powered/ToolColorApplicator.java | 116 ++--- .../tools/powered/ToolEntropyManipulator.java | 46 +- .../items/tools/powered/ToolMassCannon.java | 154 +++--- .../items/tools/powered/ToolPortableCell.java | 38 +- .../tools/powered/ToolWirelessTerminal.java | 26 +- .../powered/powersink/AEBasePoweredItem.java | 2 +- .../powered/powersink/AERootPoweredItem.java | 42 +- .../items/tools/powered/powersink/IC2.java | 32 +- .../tools/powered/powersink/RedstoneFlux.java | 10 +- .../items/tools/quartz/ToolQuartzAxe.java | 4 +- .../tools/quartz/ToolQuartzCuttingKnife.java | 16 +- .../items/tools/quartz/ToolQuartzHoe.java | 4 +- .../items/tools/quartz/ToolQuartzPickaxe.java | 4 +- .../items/tools/quartz/ToolQuartzSpade.java | 4 +- .../items/tools/quartz/ToolQuartzSword.java | 4 +- .../items/tools/quartz/ToolQuartzWrench.java | 16 +- src/main/java/appeng/me/Grid.java | 68 +-- src/main/java/appeng/me/GridConnection.java | 30 +- src/main/java/appeng/me/GridException.java | 2 +- src/main/java/appeng/me/GridNode.java | 132 +++--- .../java/appeng/me/GridNodeCollection.java | 14 +- src/main/java/appeng/me/GridNodeIterator.java | 2 +- src/main/java/appeng/me/GridPropagator.java | 6 +- .../java/appeng/me/GridSplitDetector.java | 4 +- src/main/java/appeng/me/GridStorage.java | 20 +- .../java/appeng/me/GridStorageSearch.java | 6 +- src/main/java/appeng/me/MachineSet.java | 2 +- src/main/java/appeng/me/NetworkEventBus.java | 44 +- src/main/java/appeng/me/NetworkList.java | 18 +- .../appeng/me/cache/CraftingGridCache.java | 118 ++--- .../java/appeng/me/cache/EnergyGridCache.java | 124 ++--- .../appeng/me/cache/GridStorageCache.java | 70 +-- .../java/appeng/me/cache/NetworkMonitor.java | 20 +- src/main/java/appeng/me/cache/P2PCache.java | 44 +- .../java/appeng/me/cache/PathGridCache.java | 74 +-- .../java/appeng/me/cache/SecurityCache.java | 24 +- .../appeng/me/cache/SpatialPylonCache.java | 42 +- .../appeng/me/cache/TickManagerCache.java | 42 +- .../me/cache/helpers/ConnectionWrapper.java | 2 +- .../appeng/me/cache/helpers/Connections.java | 4 +- .../appeng/me/cache/helpers/TickTracker.java | 16 +- .../me/cache/helpers/TunnelCollection.java | 6 +- .../me/cache/helpers/TunnelConnection.java | 2 +- .../me/cache/helpers/TunnelIterator.java | 4 +- .../java/appeng/me/cluster/MBCalculator.java | 24 +- .../CraftingCPUCalculator.java | 26 +- .../implementations/CraftingCPUCluster.java | 104 ++--- .../implementations/QuantumCalculator.java | 28 +- .../implementations/QuantumCluster.java | 45 +- .../SpatialPylonCalculator.java | 18 +- .../implementations/SpatialPylonCluster.java | 8 +- .../appeng/me/energy/EnergyThreshold.java | 4 +- .../java/appeng/me/energy/EnergyWatcher.java | 34 +- .../appeng/me/helpers/AENetworkProxy.java | 60 +-- .../me/helpers/AENetworkProxyMultiblock.java | 2 +- .../appeng/me/helpers/ChannelPowerSrc.java | 4 +- .../me/helpers/GenericInterestManager.java | 16 +- .../me/pathfinding/AdHocChannelUpdater.java | 10 +- .../pathfinding/ControllerChannelUpdater.java | 8 +- .../me/pathfinding/ControllerValidator.java | 8 +- .../appeng/me/pathfinding/PathSegment.java | 20 +- .../appeng/me/storage/AEExternalHandler.java | 12 +- .../java/appeng/me/storage/CellInventory.java | 80 ++-- .../me/storage/CellInventoryHandler.java | 18 +- .../me/storage/CreativeCellInventory.java | 28 +- .../java/appeng/me/storage/DriveWatcher.java | 16 +- .../java/appeng/me/storage/ItemWatcher.java | 28 +- .../me/storage/MEIInventoryWrapper.java | 22 +- .../appeng/me/storage/MEInventoryHandler.java | 22 +- .../me/storage/MEMonitorIInventory.java | 64 +-- .../me/storage/MEMonitorPassThrough.java | 32 +- .../java/appeng/me/storage/MEPassThrough.java | 16 +- .../me/storage/NetworkInventoryHandler.java | 64 +-- .../java/appeng/me/storage/NullInventory.java | 12 +- .../appeng/me/storage/SecurityInventory.java | 34 +- .../appeng/me/storage/VoidFluidInventory.java | 14 +- .../appeng/me/storage/VoidItemInventory.java | 14 +- src/main/java/appeng/parts/AEBasePart.java | 94 ++-- .../java/appeng/parts/BusCollisionHelper.java | 4 +- .../java/appeng/parts/CableBusContainer.java | 276 +++++------ .../java/appeng/parts/CableBusStorage.java | 24 +- .../appeng/parts/NullCableBusContainer.java | 20 +- .../java/appeng/parts/PartBasicState.java | 26 +- src/main/java/appeng/parts/PartPlacement.java | 74 +-- .../automation/BlockUpgradeInventory.java | 6 +- .../DefinitionUpgradeInventory.java | 6 +- .../automation/PartAnnihilationPlane.java | 44 +- .../parts/automation/PartExportBus.java | 42 +- .../parts/automation/PartFormationPlane.java | 122 ++--- .../PartIdentityAnnihilationPlane.java | 12 +- .../parts/automation/PartImportBus.java | 24 +- .../parts/automation/PartLevelEmitter.java | 168 +++---- .../parts/automation/PartSharedItemBus.java | 12 +- .../parts/automation/PartUpgradeable.java | 18 +- .../automation/StackUpgradeInventory.java | 6 +- .../parts/automation/UpgradeInventory.java | 18 +- .../appeng/parts/layers/InvLayerData.java | 20 +- src/main/java/appeng/parts/layers/InvSot.java | 12 +- .../parts/layers/LayerIEnergyHandler.java | 20 +- .../appeng/parts/layers/LayerIEnergySink.java | 22 +- .../parts/layers/LayerIEnergySource.java | 26 +- .../parts/layers/LayerIFluidHandler.java | 24 +- .../parts/layers/LayerIPipeConnection.java | 4 +- .../parts/layers/LayerISidedInventory.java | 30 +- .../layers/LayerITileStorageMonitorable.java | 4 +- .../appeng/parts/layers/LayerPressure.java | 4 +- .../parts/layers/LayerSidedEnvironment.java | 4 +- .../appeng/parts/misc/PartCableAnchor.java | 40 +- .../java/appeng/parts/misc/PartInterface.java | 62 +-- .../parts/misc/PartInvertedToggleBus.java | 2 +- .../appeng/parts/misc/PartStorageBus.java | 90 ++-- .../java/appeng/parts/misc/PartToggleBus.java | 30 +- .../appeng/parts/networking/PartCable.java | 154 +++--- .../parts/networking/PartCableCovered.java | 42 +- .../parts/networking/PartCableGlass.java | 2 +- .../parts/networking/PartCableSmart.java | 64 +-- .../parts/networking/PartDenseCable.java | 88 ++-- .../parts/networking/PartQuartzFiber.java | 50 +- .../appeng/parts/p2p/PartP2PIC2Power.java | 34 +- .../java/appeng/parts/p2p/PartP2PItems.java | 62 +-- .../java/appeng/parts/p2p/PartP2PLight.java | 36 +- .../java/appeng/parts/p2p/PartP2PLiquids.java | 48 +- .../parts/p2p/PartP2POpenComputers.java | 30 +- .../appeng/parts/p2p/PartP2PPressure.java | 12 +- .../java/appeng/parts/p2p/PartP2PRFPower.java | 44 +- .../appeng/parts/p2p/PartP2PRedstone.java | 40 +- .../java/appeng/parts/p2p/PartP2PTunnel.java | 100 ++-- .../appeng/parts/p2p/PartP2PTunnelME.java | 40 +- .../parts/reporting/AbstractPartDisplay.java | 6 +- .../parts/reporting/AbstractPartMonitor.java | 26 +- .../parts/reporting/AbstractPartPanel.java | 6 +- .../reporting/AbstractPartReporting.java | 24 +- .../parts/reporting/AbstractPartTerminal.java | 16 +- .../reporting/PartConversionMonitor.java | 6 +- .../parts/reporting/PartCraftingTerminal.java | 12 +- .../appeng/parts/reporting/PartDarkPanel.java | 2 +- .../reporting/PartInterfaceTerminal.java | 4 +- .../appeng/parts/reporting/PartPanel.java | 2 +- .../parts/reporting/PartPatternTerminal.java | 16 +- .../parts/reporting/PartSemiDarkPanel.java | 2 +- .../parts/reporting/PartStorageMonitor.java | 2 +- .../appeng/parts/reporting/PartTerminal.java | 2 +- .../java/appeng/recipes/AEItemResolver.java | 24 +- .../java/appeng/recipes/GroupIngredient.java | 14 +- src/main/java/appeng/recipes/Ingredient.java | 24 +- .../java/appeng/recipes/IngredientSet.java | 6 +- .../appeng/recipes/MissedIngredientSet.java | 2 +- .../java/appeng/recipes/RecipeHandler.java | 136 +++--- .../recipes/game/DisassembleRecipe.java | 24 +- .../appeng/recipes/game/FacadeRecipe.java | 10 +- .../appeng/recipes/game/ShapedRecipe.java | 54 +-- .../appeng/recipes/game/ShapelessRecipe.java | 30 +- .../java/appeng/recipes/handlers/Crusher.java | 14 +- .../java/appeng/recipes/handlers/Grind.java | 10 +- .../java/appeng/recipes/handlers/GrindFZ.java | 14 +- .../appeng/recipes/handlers/HCCrusher.java | 20 +- .../appeng/recipes/handlers/Inscribe.java | 2 +- .../recipes/handlers/InscriberProcess.java | 6 +- .../appeng/recipes/handlers/Macerator.java | 14 +- .../appeng/recipes/handlers/MekCrusher.java | 14 +- .../recipes/handlers/MekEnrichment.java | 14 +- .../recipes/handlers/OreRegistration.java | 8 +- .../java/appeng/recipes/handlers/Press.java | 2 +- .../appeng/recipes/handlers/Pulverizer.java | 12 +- .../java/appeng/recipes/handlers/Shaped.java | 22 +- .../appeng/recipes/handlers/Shapeless.java | 22 +- .../java/appeng/recipes/handlers/Smelt.java | 10 +- .../appeng/recipes/loader/ConfigLoader.java | 4 +- .../java/appeng/recipes/loader/JarLoader.java | 4 +- .../recipes/loader/RecipeResourceCopier.java | 12 +- .../recipes/ores/OreDictionaryHandler.java | 16 +- src/main/java/appeng/server/AECommand.java | 20 +- src/main/java/appeng/server/Commands.java | 2 +- src/main/java/appeng/server/ServerHelper.java | 30 +- .../server/subcommands/ChunkLogger.java | 10 +- .../appeng/server/subcommands/Supporters.java | 6 +- .../java/appeng/services/CompassService.java | 18 +- .../java/appeng/services/VersionChecker.java | 8 +- .../services/compass/CompassException.java | 2 +- .../services/compass/CompassReader.java | 10 +- .../services/compass/CompassRegion.java | 20 +- .../appeng/services/version/BaseVersion.java | 6 +- .../services/version/DefaultVersion.java | 4 +- .../services/version/DoNotCheckVersion.java | 2 +- .../services/version/MissingVersion.java | 2 +- .../services/version/ModVersionFetcher.java | 2 +- .../version/VersionCheckerConfig.java | 2 +- .../services/version/VersionParser.java | 14 +- .../github/DefaultFormattedRelease.java | 2 +- .../version/github/ReleaseFetcher.java | 10 +- .../java/appeng/spatial/BiomeGenStorage.java | 2 +- src/main/java/appeng/spatial/CachedPlane.java | 118 ++--- .../appeng/spatial/DefaultSpatialHandler.java | 6 +- .../appeng/spatial/StorageChunkProvider.java | 16 +- .../java/appeng/spatial/StorageHelper.java | 72 +-- .../appeng/spatial/StorageWorldProvider.java | 18 +- src/main/java/appeng/tile/AEBaseInvTile.java | 40 +- src/main/java/appeng/tile/AEBaseTile.java | 102 ++-- .../crafting/TileCraftingMonitorTile.java | 16 +- .../crafting/TileCraftingStorageTile.java | 8 +- .../tile/crafting/TileCraftingTile.java | 44 +- .../tile/crafting/TileMolecularAssembler.java | 90 ++-- .../tile/events/AETileEventHandler.java | 42 +- .../appeng/tile/grid/AENetworkInvTile.java | 6 +- .../appeng/tile/grid/AENetworkPowerTile.java | 8 +- .../java/appeng/tile/grid/AENetworkTile.java | 8 +- .../appeng/tile/grindstone/TileCrank.java | 30 +- .../appeng/tile/grindstone/TileGrinder.java | 32 +- .../inventory/AppEngInternalAEInventory.java | 42 +- .../inventory/AppEngInternalInventory.java | 42 +- .../tile/inventory/AppEngNullInventory.java | 14 +- .../appeng/tile/misc/TileCellWorkbench.java | 30 +- .../java/appeng/tile/misc/TileCharger.java | 50 +- .../java/appeng/tile/misc/TileCondenser.java | 54 +-- .../java/appeng/tile/misc/TileInscriber.java | 90 ++-- .../java/appeng/tile/misc/TileInterface.java | 42 +- .../appeng/tile/misc/TileLightDetector.java | 2 +- src/main/java/appeng/tile/misc/TilePaint.java | 46 +- .../misc/TileQuartzGrowthAccelerator.java | 16 +- .../java/appeng/tile/misc/TileSecurity.java | 54 +-- .../tile/misc/TileVibrationChamber.java | 40 +- .../appeng/tile/networking/TileCableBus.java | 56 +-- .../tile/networking/TileCableBusTESR.java | 4 +- .../tile/networking/TileController.java | 30 +- .../networking/TileCreativeEnergyCell.java | 6 +- .../tile/networking/TileEnergyAcceptor.java | 24 +- .../tile/networking/TileEnergyCell.java | 24 +- .../appeng/tile/networking/TileWireless.java | 26 +- .../tile/powersink/AERootPoweredTile.java | 26 +- src/main/java/appeng/tile/powersink/IC2.java | 12 +- .../java/appeng/tile/powersink/MekJoules.java | 12 +- .../appeng/tile/powersink/RedstoneFlux.java | 8 +- .../appeng/tile/powersink/RotaryCraft.java | 16 +- .../appeng/tile/qnb/TileQuantumBridge.java | 32 +- .../tile/spatial/TileSpatialIOPort.java | 44 +- .../appeng/tile/spatial/TileSpatialPylon.java | 20 +- .../java/appeng/tile/storage/TileChest.java | 197 ++++---- .../java/appeng/tile/storage/TileDrive.java | 63 ++- .../java/appeng/tile/storage/TileIOPort.java | 84 ++-- .../appeng/tile/storage/TileSkyChest.java | 10 +- .../java/appeng/transformer/AppEngCore.java | 6 +- .../appeng/transformer/MissingCoreMod.java | 10 +- .../transformer/asm/ASMIntegration.java | 36 +- .../appeng/transformer/asm/ASMTweaker.java | 32 +- src/main/java/appeng/util/BlockUpdate.java | 4 +- .../java/appeng/util/ClassInstantiation.java | 24 +- src/main/java/appeng/util/ConfigManager.java | 26 +- .../util/InWorldToolOperationResult.java | 12 +- .../java/appeng/util/InventoryAdaptor.java | 10 +- src/main/java/appeng/util/ItemSorters.java | 22 +- src/main/java/appeng/util/LookDirection.java | 2 +- src/main/java/appeng/util/Platform.java | 438 +++++++++--------- .../java/appeng/util/ReadOnlyCollection.java | 4 +- .../appeng/util/ReadableNumberConverter.java | 4 +- src/main/java/appeng/util/UUIDMatcher.java | 2 +- .../java/appeng/util/inv/AdaptorBCPipe.java | 14 +- .../appeng/util/inv/AdaptorIInventory.java | 60 +-- .../java/appeng/util/inv/AdaptorList.java | 40 +- .../appeng/util/inv/AdaptorPlayerHand.java | 38 +- .../util/inv/AdaptorPlayerInventory.java | 14 +- src/main/java/appeng/util/inv/IMEAdaptor.java | 32 +- .../appeng/util/inv/IMEAdaptorIterator.java | 4 +- .../util/inv/IMEInventoryDestination.java | 6 +- .../util/inv/ItemListIgnoreCrafting.java | 12 +- src/main/java/appeng/util/inv/ItemSlot.java | 4 +- .../java/appeng/util/inv/WrapperBCPipe.java | 14 +- .../util/inv/WrapperChainedInventory.java | 48 +- .../java/appeng/util/inv/WrapperInvSlot.java | 20 +- .../util/inv/WrapperInventoryRange.java | 22 +- .../util/inv/WrapperMCISidedInventory.java | 8 +- .../java/appeng/util/inv/WrapperTEPipe.java | 14 +- .../java/appeng/util/item/AEFluidStack.java | 80 ++-- src/main/java/appeng/util/item/AEItemDef.java | 14 +- .../java/appeng/util/item/AEItemStack.java | 140 +++--- .../java/appeng/util/item/AESharedNBT.java | 36 +- src/main/java/appeng/util/item/AEStack.java | 24 +- src/main/java/appeng/util/item/FluidList.java | 20 +- src/main/java/appeng/util/item/ItemList.java | 26 +- .../java/appeng/util/item/ItemModList.java | 10 +- .../util/item/MeaningfulFluidIterator.java | 2 +- .../util/item/MeaningfulItemIterator.java | 2 +- src/main/java/appeng/util/item/OreHelper.java | 42 +- .../java/appeng/util/item/OreReference.java | 4 +- .../appeng/util/item/SharedSearchObject.java | 6 +- .../appeng/util/iterators/AEInvIterator.java | 2 +- .../util/iterators/ChainedIterator.java | 4 +- .../appeng/util/iterators/InvIterator.java | 4 +- .../util/iterators/ProxyNodeIterator.java | 4 +- .../util/iterators/StackToSlotIterator.java | 2 +- .../util/prioitylist/DefaultPriorityList.java | 2 +- .../util/prioitylist/FuzzyPriorityList.java | 6 +- .../util/prioitylist/MergedPriorityList.java | 8 +- .../util/prioitylist/PrecisePriorityList.java | 4 +- .../java/appeng/worldgen/MeteoritePlacer.java | 124 ++--- .../appeng/worldgen/MeteoriteWorldGen.java | 34 +- .../java/appeng/worldgen/QuartzWorldGen.java | 20 +- .../appeng/worldgen/meteorite/ChunkOnly.java | 20 +- .../appeng/worldgen/meteorite/Fallout.java | 12 +- .../worldgen/meteorite/FalloutCopy.java | 12 +- .../worldgen/meteorite/FalloutSand.java | 4 +- .../worldgen/meteorite/FalloutSnow.java | 4 +- .../meteorite/MeteoriteBlockPutter.java | 6 +- .../worldgen/meteorite/StandardWorld.java | 24 +- 819 files changed, 9390 insertions(+), 9396 deletions(-) diff --git a/src/api/java/appeng/api/AEApi.java b/src/api/java/appeng/api/AEApi.java index 6185d79a..baa06a57 100644 --- a/src/api/java/appeng/api/AEApi.java +++ b/src/api/java/appeng/api/AEApi.java @@ -51,15 +51,15 @@ public enum AEApi HELD_API = (IAppEngApi) apiField.get( apiClass ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." ); } - catch( NoSuchFieldException e ) + catch( final NoSuchFieldException e ) { throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." ); } diff --git a/src/api/java/appeng/api/config/AccessRestriction.java b/src/api/java/appeng/api/config/AccessRestriction.java index 9b7e4bf3..6788d744 100644 --- a/src/api/java/appeng/api/config/AccessRestriction.java +++ b/src/api/java/appeng/api/config/AccessRestriction.java @@ -30,22 +30,22 @@ public enum AccessRestriction private final int permissionBit; - AccessRestriction( int v ) + AccessRestriction( final int v ) { this.permissionBit = v; } - public boolean hasPermission( AccessRestriction ar ) + public boolean hasPermission( final AccessRestriction ar ) { return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit; } - public AccessRestriction restrictPermissions( AccessRestriction ar ) + public AccessRestriction restrictPermissions( final AccessRestriction ar ) { return this.getPermByBit( this.permissionBit & ar.permissionBit ); } - private AccessRestriction getPermByBit( int bit ) + private AccessRestriction getPermByBit( final int bit ) { switch( bit ) { @@ -61,12 +61,12 @@ public enum AccessRestriction } } - public AccessRestriction addPermissions( AccessRestriction ar ) + public AccessRestriction addPermissions( final AccessRestriction ar ) { return this.getPermByBit( this.permissionBit | ar.permissionBit ); } - public AccessRestriction removePermissions( AccessRestriction ar ) + public AccessRestriction removePermissions( final AccessRestriction ar ) { return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) ); } diff --git a/src/api/java/appeng/api/config/FuzzyMode.java b/src/api/java/appeng/api/config/FuzzyMode.java index c5f91e12..665dd551 100644 --- a/src/api/java/appeng/api/config/FuzzyMode.java +++ b/src/api/java/appeng/api/config/FuzzyMode.java @@ -32,13 +32,13 @@ public enum FuzzyMode public final float breakPoint; public final float percentage; - FuzzyMode( float p ) + FuzzyMode( final float p ) { this.percentage = p; this.breakPoint = p / 100.0f; } - public int calculateBreakPoint( int maxDamage ) + public int calculateBreakPoint( final int maxDamage ) { return (int) ( ( this.percentage * maxDamage ) / 100.0f ); } diff --git a/src/api/java/appeng/api/config/PowerMultiplier.java b/src/api/java/appeng/api/config/PowerMultiplier.java index a2029f8c..dd50e79e 100644 --- a/src/api/java/appeng/api/config/PowerMultiplier.java +++ b/src/api/java/appeng/api/config/PowerMultiplier.java @@ -33,12 +33,12 @@ public enum PowerMultiplier */ public double multiplier = 1.0; - public double multiply( double in ) + public double multiply( final double in ) { return in * this.multiplier; } - public double divide( double in ) + public double divide( final double in ) { return in / this.multiplier; } diff --git a/src/api/java/appeng/api/config/PowerUnits.java b/src/api/java/appeng/api/config/PowerUnits.java index c1a46be8..10345d42 100644 --- a/src/api/java/appeng/api/config/PowerUnits.java +++ b/src/api/java/appeng/api/config/PowerUnits.java @@ -41,7 +41,7 @@ public enum PowerUnits */ public double conversionRatio = 1.0; - PowerUnits( String un ) + PowerUnits( final String un ) { this.unlocalizedName = un; } @@ -58,7 +58,7 @@ public enum PowerUnits * * @return value converted to target units, from this units. */ - public double convertTo( PowerUnits target, double value ) + public double convertTo( final PowerUnits target, final double value ) { return ( value * this.conversionRatio ) / target.conversionRatio; } diff --git a/src/api/java/appeng/api/config/Settings.java b/src/api/java/appeng/api/config/Settings.java index b199c023..57135435 100644 --- a/src/api/java/appeng/api/config/Settings.java +++ b/src/api/java/appeng/api/config/Settings.java @@ -60,7 +60,7 @@ public enum Settings private final EnumSet> values; - Settings( @Nonnull EnumSet> possibleOptions ) + Settings( @Nonnull final EnumSet> possibleOptions ) { if( possibleOptions.isEmpty() ) { diff --git a/src/api/java/appeng/api/config/Upgrades.java b/src/api/java/appeng/api/config/Upgrades.java index 07c679b6..995f2b6f 100644 --- a/src/api/java/appeng/api/config/Upgrades.java +++ b/src/api/java/appeng/api/config/Upgrades.java @@ -59,7 +59,7 @@ public enum Upgrades @Deprecated private final Map supportedMax = new HashMap(); - Upgrades( int tier ) + Upgrades( final int tier ) { this.tier = tier; } @@ -78,10 +78,10 @@ public enum Upgrades * @param item machine in which this upgrade can be installed * @param maxSupported amount how many upgrades can be installed */ - public void registerItem( IItemDefinition item, int maxSupported ) + public void registerItem( final IItemDefinition item, final int maxSupported ) { final Optional maybeStack = item.maybeStack( 1 ); - for( ItemStack stack : maybeStack.asSet() ) + for( final ItemStack stack : maybeStack.asSet() ) { this.registerItem( stack, maxSupported ); } @@ -93,7 +93,7 @@ public enum Upgrades * @param stack machine in which this upgrade can be installed * @param maxSupported amount how many upgrades can be installed */ - public void registerItem( ItemStack stack, int maxSupported ) + public void registerItem( final ItemStack stack, final int maxSupported ) { if( stack != null ) { @@ -110,7 +110,7 @@ public enum Upgrades * @deprecated use {@link Upgrades#registerItem(IItemDefinition, int)} */ @Deprecated - public void registerItem( AEItemDefinition item, int maxSupported ) + public void registerItem( final AEItemDefinition item, final int maxSupported ) { if( item != null ) { diff --git a/src/api/java/appeng/api/events/LocatableEventAnnounce.java b/src/api/java/appeng/api/events/LocatableEventAnnounce.java index ee4a8c73..bea4a56d 100644 --- a/src/api/java/appeng/api/events/LocatableEventAnnounce.java +++ b/src/api/java/appeng/api/events/LocatableEventAnnounce.java @@ -40,7 +40,7 @@ public class LocatableEventAnnounce extends Event public final ILocatable target; public final LocatableEvent change; - public LocatableEventAnnounce( ILocatable o, LocatableEvent ev ) + public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev ) { this.target = o; this.change = ev; diff --git a/src/api/java/appeng/api/exceptions/AppEngException.java b/src/api/java/appeng/api/exceptions/AppEngException.java index 9734437f..478cfd77 100644 --- a/src/api/java/appeng/api/exceptions/AppEngException.java +++ b/src/api/java/appeng/api/exceptions/AppEngException.java @@ -29,7 +29,7 @@ public class AppEngException extends Exception private static final long serialVersionUID = -9051434206368465494L; - public AppEngException( String t ) + public AppEngException( final String t ) { super( t ); } diff --git a/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java b/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java index a952bdc1..88a5725f 100644 --- a/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java +++ b/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java @@ -3,7 +3,7 @@ package appeng.api.exceptions; public class CoreInaccessibleException extends RuntimeException { - public CoreInaccessibleException( String message ) + public CoreInaccessibleException( final String message ) { super( message ); } diff --git a/src/api/java/appeng/api/exceptions/MissingDefinition.java b/src/api/java/appeng/api/exceptions/MissingDefinition.java index 09e05373..f920a9e9 100644 --- a/src/api/java/appeng/api/exceptions/MissingDefinition.java +++ b/src/api/java/appeng/api/exceptions/MissingDefinition.java @@ -3,7 +3,7 @@ package appeng.api.exceptions; public class MissingDefinition extends RuntimeException { - public MissingDefinition( String message ) + public MissingDefinition( final String message ) { super( message ); } diff --git a/src/api/java/appeng/api/exceptions/MissingIngredientError.java b/src/api/java/appeng/api/exceptions/MissingIngredientError.java index 842747a0..81fe40d3 100644 --- a/src/api/java/appeng/api/exceptions/MissingIngredientError.java +++ b/src/api/java/appeng/api/exceptions/MissingIngredientError.java @@ -29,7 +29,7 @@ public class MissingIngredientError extends Exception private static final long serialVersionUID = -998858343831371697L; - public MissingIngredientError( String n ) + public MissingIngredientError( final String n ) { super( n ); } diff --git a/src/api/java/appeng/api/exceptions/ModNotInstalled.java b/src/api/java/appeng/api/exceptions/ModNotInstalled.java index 6f7bfa9b..a3c5eb05 100644 --- a/src/api/java/appeng/api/exceptions/ModNotInstalled.java +++ b/src/api/java/appeng/api/exceptions/ModNotInstalled.java @@ -29,7 +29,7 @@ public class ModNotInstalled extends Exception private static final long serialVersionUID = -9052435206368425494L; - public ModNotInstalled( String t ) + public ModNotInstalled( final String t ) { super( t ); } diff --git a/src/api/java/appeng/api/exceptions/RecipeError.java b/src/api/java/appeng/api/exceptions/RecipeError.java index 1973f348..d4d6f90a 100644 --- a/src/api/java/appeng/api/exceptions/RecipeError.java +++ b/src/api/java/appeng/api/exceptions/RecipeError.java @@ -29,7 +29,7 @@ public class RecipeError extends Exception private static final long serialVersionUID = -6602870588617670262L; - public RecipeError( String n ) + public RecipeError( final String n ) { super( n ); } diff --git a/src/api/java/appeng/api/exceptions/RegistrationError.java b/src/api/java/appeng/api/exceptions/RegistrationError.java index f3d2bdd0..205df3e9 100644 --- a/src/api/java/appeng/api/exceptions/RegistrationError.java +++ b/src/api/java/appeng/api/exceptions/RegistrationError.java @@ -29,7 +29,7 @@ public class RegistrationError extends Exception private static final long serialVersionUID = -6602870588617670263L; - public RegistrationError( String n ) + public RegistrationError( final String n ) { super( n ); } diff --git a/src/api/java/appeng/api/implementations/TransitionResult.java b/src/api/java/appeng/api/implementations/TransitionResult.java index e9896874..9eec763e 100644 --- a/src/api/java/appeng/api/implementations/TransitionResult.java +++ b/src/api/java/appeng/api/implementations/TransitionResult.java @@ -33,7 +33,7 @@ public class TransitionResult public final boolean success; public final double energyUsage; - public TransitionResult( boolean _success, double power ) + public TransitionResult( final boolean _success, final double power ) { this.success = _success; this.energyUsage = power; diff --git a/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java b/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java index 1ddee58d..b8663114 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java +++ b/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java @@ -36,7 +36,7 @@ public class MENetworkChannelChanged extends MENetworkEvent public final IGridNode node; - public MENetworkChannelChanged( IGridNode n ) + public MENetworkChannelChanged( final IGridNode n ) { this.node = n; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java b/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java index 34a95c64..4a92e28c 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java @@ -32,7 +32,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent public final IGridNode node; - public MENetworkCraftingCpuChange( IGridNode n ) + public MENetworkCraftingCpuChange( final IGridNode n ) { this.node = n; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java b/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java index 8e064265..77b6a2e3 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java @@ -34,7 +34,7 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent public final ICraftingProvider provider; public final IGridNode node; - public MENetworkCraftingPatternChange( ICraftingProvider p, IGridNode n ) + public MENetworkCraftingPatternChange( final ICraftingProvider p, final IGridNode n ) { this.provider = p; this.node = n; diff --git a/src/api/java/appeng/api/networking/events/MENetworkEvent.java b/src/api/java/appeng/api/networking/events/MENetworkEvent.java index 638f6332..4c50e59d 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkEvent.java @@ -71,7 +71,7 @@ public class MENetworkEvent * * @param v current number of visitors */ - public void setVisitedObjects( int v ) + public void setVisitedObjects( final int v ) { this.visited = v; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java b/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java index 5af71e2c..a9000064 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java @@ -39,7 +39,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent public final IGridNode node; - public MENetworkPowerIdleChange( IGridNode nodeThatChanged ) + public MENetworkPowerIdleChange( final IGridNode nodeThatChanged ) { this.node = nodeThatChanged; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java b/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java index 932a05bf..0afde8d8 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java +++ b/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java @@ -42,7 +42,7 @@ public class MENetworkPowerStorage extends MENetworkEvent public final IAEPowerStorage storage; public final PowerEventType type; - public MENetworkPowerStorage( IAEPowerStorage t, PowerEventType y ) + public MENetworkPowerStorage( final IAEPowerStorage t, final PowerEventType y ) { this.storage = t; this.type = y; diff --git a/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java b/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java index 82a2a7ba..ea666a12 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java @@ -39,7 +39,7 @@ public class MENetworkSpatialEvent extends MENetworkEvent * @param SpatialIO ( INSTANCE of the SpatialIO block ) * @param EnergyUsage ( the amount of energy that the SpatialIO uses) */ - public MENetworkSpatialEvent( IGridHost SpatialIO, double EnergyUsage ) + public MENetworkSpatialEvent( final IGridHost SpatialIO, final double EnergyUsage ) { this.host = SpatialIO; this.spatialEnergyUsage = EnergyUsage; diff --git a/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java b/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java index e83fa826..60f159c5 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java @@ -42,7 +42,7 @@ public class MENetworkStorageEvent extends MENetworkEvent public final IMEMonitor monitor; public final StorageChannel channel; - public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan ) + public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan ) { this.monitor = o; this.channel = chan; diff --git a/src/api/java/appeng/api/networking/security/MachineSource.java b/src/api/java/appeng/api/networking/security/MachineSource.java index a01b5474..40a46536 100644 --- a/src/api/java/appeng/api/networking/security/MachineSource.java +++ b/src/api/java/appeng/api/networking/security/MachineSource.java @@ -29,7 +29,7 @@ public class MachineSource extends BaseActionSource public final IActionHost via; - public MachineSource( IActionHost v ) + public MachineSource( final IActionHost v ) { this.via = v; } diff --git a/src/api/java/appeng/api/networking/security/PlayerSource.java b/src/api/java/appeng/api/networking/security/PlayerSource.java index 49442bc1..fc6cb37e 100644 --- a/src/api/java/appeng/api/networking/security/PlayerSource.java +++ b/src/api/java/appeng/api/networking/security/PlayerSource.java @@ -33,7 +33,7 @@ public class PlayerSource extends BaseActionSource public final EntityPlayer player; public final IActionHost via; - public PlayerSource( EntityPlayer p, IActionHost v ) + public PlayerSource( final EntityPlayer p, final IActionHost v ) { this.player = p; this.via = v; diff --git a/src/api/java/appeng/api/networking/ticking/TickingRequest.java b/src/api/java/appeng/api/networking/ticking/TickingRequest.java index 6a94f252..d14cab92 100644 --- a/src/api/java/appeng/api/networking/ticking/TickingRequest.java +++ b/src/api/java/appeng/api/networking/ticking/TickingRequest.java @@ -60,7 +60,7 @@ public class TickingRequest */ public final boolean canBeAlerted; - public TickingRequest( int min, int max, boolean sleep, boolean alertable ) + public TickingRequest( final int min, final int max, final boolean sleep, final boolean alertable ) { this.minTickRate = min; this.maxTickRate = max; diff --git a/src/api/java/appeng/api/parts/CableRenderMode.java b/src/api/java/appeng/api/parts/CableRenderMode.java index abe5e707..d9e80bfc 100644 --- a/src/api/java/appeng/api/parts/CableRenderMode.java +++ b/src/api/java/appeng/api/parts/CableRenderMode.java @@ -33,7 +33,7 @@ public enum CableRenderMode public final boolean transparentFacades; public final boolean opaqueFacades; - CableRenderMode( boolean hideFacades ) + CableRenderMode( final boolean hideFacades ) { this.transparentFacades = hideFacades; this.opaqueFacades = !hideFacades; diff --git a/src/api/java/appeng/api/parts/LayerBase.java b/src/api/java/appeng/api/parts/LayerBase.java index 91ca0f00..07347a35 100644 --- a/src/api/java/appeng/api/parts/LayerBase.java +++ b/src/api/java/appeng/api/parts/LayerBase.java @@ -46,7 +46,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost * * @return the part for the requested side. */ - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { return null; // place holder. } diff --git a/src/api/java/appeng/api/parts/SelectedPart.java b/src/api/java/appeng/api/parts/SelectedPart.java index c5ec7f2f..bc308db3 100644 --- a/src/api/java/appeng/api/parts/SelectedPart.java +++ b/src/api/java/appeng/api/parts/SelectedPart.java @@ -55,14 +55,14 @@ public class SelectedPart this.side = ForgeDirection.UNKNOWN; } - public SelectedPart( IPart part, ForgeDirection side ) + public SelectedPart( final IPart part, final ForgeDirection side ) { this.part = part; this.facade = null; this.side = side; } - public SelectedPart( IFacadePart facade, ForgeDirection side ) + public SelectedPart( final IFacadePart facade, final ForgeDirection side ) { this.part = null; this.facade = facade; diff --git a/src/api/java/appeng/api/recipes/ResolverResult.java b/src/api/java/appeng/api/recipes/ResolverResult.java index 879efab5..51405576 100644 --- a/src/api/java/appeng/api/recipes/ResolverResult.java +++ b/src/api/java/appeng/api/recipes/ResolverResult.java @@ -34,14 +34,14 @@ public class ResolverResult public final int damageValue; public final NBTTagCompound compound; - public ResolverResult( String name, int damage ) + public ResolverResult( final String name, final int damage ) { this.itemName = name; this.damageValue = damage; this.compound = null; } - public ResolverResult( String name, int damage, NBTTagCompound data ) + public ResolverResult( final String name, final int damage, final NBTTagCompound data ) { this.itemName = name; this.damageValue = damage; diff --git a/src/api/java/appeng/api/recipes/ResolverResultSet.java b/src/api/java/appeng/api/recipes/ResolverResultSet.java index 884b0f10..7705d830 100644 --- a/src/api/java/appeng/api/recipes/ResolverResultSet.java +++ b/src/api/java/appeng/api/recipes/ResolverResultSet.java @@ -36,7 +36,7 @@ public class ResolverResultSet public final String name; public final List results; - public ResolverResultSet( String myName, ItemStack... set ) + public ResolverResultSet( final String myName, final ItemStack... set ) { this.results = Arrays.asList( set ); this.name = myName; diff --git a/src/api/java/appeng/api/storage/MEMonitorHandler.java b/src/api/java/appeng/api/storage/MEMonitorHandler.java index fb14960a..1fd8d70b 100644 --- a/src/api/java/appeng/api/storage/MEMonitorHandler.java +++ b/src/api/java/appeng/api/storage/MEMonitorHandler.java @@ -52,32 +52,32 @@ public class MEMonitorHandler implements IMEMonitor< protected boolean hasChanged = true; - public MEMonitorHandler( IMEInventoryHandler t ) + public MEMonitorHandler( final IMEInventoryHandler t ) { this.internalHandler = t; this.cachedList = (IItemList) t.getChannel().createList(); } - public MEMonitorHandler( IMEInventoryHandler t, StorageChannel chan ) + public MEMonitorHandler( final IMEInventoryHandler t, final StorageChannel chan ) { this.internalHandler = t; this.cachedList = (IItemList) chan.createList(); } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @Override - public StackType injectItems( StackType input, Actionable mode, BaseActionSource src ) + public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -91,9 +91,9 @@ public class MEMonitorHandler implements IMEMonitor< return this.internalHandler; } - private StackType monitorDifference( IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src ) + private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src ) { - StackType diff = (StackType) original.copy(); + final StackType diff = (StackType) original.copy(); if( extraction ) { @@ -112,19 +112,19 @@ public class MEMonitorHandler implements IMEMonitor< return leftOvers; } - protected void postChangesToListeners( Iterable changes, BaseActionSource src ) + protected void postChangesToListeners( final Iterable changes, final BaseActionSource src ) { this.notifyListenersOfChange( changes, src ); } - protected void notifyListenersOfChange( Iterable diff, BaseActionSource src ) + protected void notifyListenersOfChange( final Iterable diff, final BaseActionSource src ) { this.hasChanged = true;// need to update the cache. - Iterator, Object>> i = this.getListeners(); + final Iterator, Object>> i = this.getListeners(); while( i.hasNext() ) { - Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver receiver = o.getKey(); + final Entry, Object> o = i.next(); + final IMEMonitorHandlerReceiver receiver = o.getKey(); if( receiver.isValid( o.getValue() ) ) { receiver.postChange( this, diff, src ); @@ -142,7 +142,7 @@ public class MEMonitorHandler implements IMEMonitor< } @Override - public StackType extractItems( StackType request, Actionable mode, BaseActionSource src ) + public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -175,17 +175,17 @@ public class MEMonitorHandler implements IMEMonitor< } @Override - public boolean isPrioritized( StackType input ) + public boolean isPrioritized( final StackType input ) { return this.getHandler().isPrioritized( input ); } @Override - public boolean canAccept( StackType input ) + public boolean canAccept( final StackType input ) { return this.getHandler().canAccept( input ); } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return this.getHandler().getAvailableItems( out ); } @@ -203,7 +203,7 @@ public class MEMonitorHandler implements IMEMonitor< } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return this.getHandler().validForPass( i ); } diff --git a/src/api/java/appeng/api/storage/StorageChannel.java b/src/api/java/appeng/api/storage/StorageChannel.java index e0bd3789..2e57310f 100644 --- a/src/api/java/appeng/api/storage/StorageChannel.java +++ b/src/api/java/appeng/api/storage/StorageChannel.java @@ -45,7 +45,7 @@ public enum StorageChannel public final Class type; - StorageChannel( Class t ) + StorageChannel( final Class t ) { this.type = t; } diff --git a/src/api/java/appeng/api/util/AEColor.java b/src/api/java/appeng/api/util/AEColor.java index 61c7f9c8..ee13cc79 100644 --- a/src/api/java/appeng/api/util/AEColor.java +++ b/src/api/java/appeng/api/util/AEColor.java @@ -94,7 +94,7 @@ public enum AEColor */ public final int whiteVariant; - AEColor( String unlocalizedName, int blackHex, int medHex, int whiteHex ) + AEColor( final String unlocalizedName, final int blackHex, final int medHex, final int whiteHex ) { this.unlocalizedName = unlocalizedName; this.blackVariant = blackHex; @@ -105,7 +105,7 @@ public enum AEColor /** * Logic to see which colors match each other.. special handle for Transparent */ - public boolean matches( AEColor color ) + public boolean matches( final AEColor color ) { return this == Transparent || color == Transparent || this == color; } diff --git a/src/api/java/appeng/api/util/DimensionalCoord.java b/src/api/java/appeng/api/util/DimensionalCoord.java index eb448360..8099a773 100644 --- a/src/api/java/appeng/api/util/DimensionalCoord.java +++ b/src/api/java/appeng/api/util/DimensionalCoord.java @@ -37,21 +37,21 @@ public class DimensionalCoord extends WorldCoord private final World w; private final int dimId; - public DimensionalCoord( DimensionalCoord s ) + public DimensionalCoord( final DimensionalCoord s ) { super( s.x, s.y, s.z ); this.w = s.w; this.dimId = s.dimId; } - public DimensionalCoord( TileEntity s ) + public DimensionalCoord( final TileEntity s ) { super( s ); this.w = s.getWorldObj(); this.dimId = this.w.provider.dimensionId; } - public DimensionalCoord( World _w, int _x, int _y, int _z ) + public DimensionalCoord( final World _w, final int _x, final int _y, final int _z ) { super( _x, _y, _z ); this.w = _w; @@ -71,12 +71,12 @@ public class DimensionalCoord extends WorldCoord } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj ); } - public boolean isEqual( DimensionalCoord c ) + public boolean isEqual( final DimensionalCoord c ) { return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w; } @@ -87,7 +87,7 @@ public class DimensionalCoord extends WorldCoord return "dimension=" + this.dimId + ", " + super.toString(); } - public boolean isInWorld( World world ) + public boolean isInWorld( final World world ) { return this.w == world; } diff --git a/src/api/java/appeng/api/util/WorldCoord.java b/src/api/java/appeng/api/util/WorldCoord.java index d020e15d..2e09d1dd 100644 --- a/src/api/java/appeng/api/util/WorldCoord.java +++ b/src/api/java/appeng/api/util/WorldCoord.java @@ -39,19 +39,19 @@ public class WorldCoord public int y; public int z; - public WorldCoord( TileEntity s ) + public WorldCoord( final TileEntity s ) { this( s.xCoord, s.yCoord, s.zCoord ); } - public WorldCoord( int _x, int _y, int _z ) + public WorldCoord( final int _x, final int _y, final int _z ) { this.x = _x; this.y = _y; this.z = _z; } - public WorldCoord subtract( ForgeDirection direction, int length ) + public WorldCoord subtract( final ForgeDirection direction, final int length ) { this.x -= direction.offsetX * length; this.y -= direction.offsetY * length; @@ -59,7 +59,7 @@ public class WorldCoord return this; } - public WorldCoord add( int _x, int _y, int _z ) + public WorldCoord add( final int _x, final int _y, final int _z ) { this.x += _x; this.y += _y; @@ -67,7 +67,7 @@ public class WorldCoord return this; } - public WorldCoord subtract( int _x, int _y, int _z ) + public WorldCoord subtract( final int _x, final int _y, final int _z ) { this.x -= _x; this.y -= _y; @@ -75,7 +75,7 @@ public class WorldCoord return this; } - public WorldCoord multiple( int _x, int _y, int _z ) + public WorldCoord multiple( final int _x, final int _y, final int _z ) { this.x *= _x; this.y *= _y; @@ -83,7 +83,7 @@ public class WorldCoord return this; } - public WorldCoord divide( int _x, int _y, int _z ) + public WorldCoord divide( final int _x, final int _y, final int _z ) { this.x /= _x; this.y /= _y; @@ -94,15 +94,15 @@ public class WorldCoord /** * Will Return NULL if it's at some diagonal! */ - public ForgeDirection directionTo( WorldCoord loc ) + public ForgeDirection directionTo( final WorldCoord loc ) { - int ox = this.x - loc.x; - int oy = this.y - loc.y; - int oz = this.z - loc.z; + final int ox = this.x - loc.x; + final int oy = this.y - loc.y; + final int oz = this.z - loc.z; - int xlen = Math.abs( ox ); - int ylen = Math.abs( oy ); - int zlen = Math.abs( oz ); + final int xlen = Math.abs( ox ); + final int ylen = Math.abs( oy ); + final int zlen = Math.abs( oz ); if( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) ) { @@ -137,12 +137,12 @@ public class WorldCoord return null; } - public boolean isEqual( WorldCoord c ) + public boolean isEqual( final WorldCoord c ) { return this.x == c.x && this.y == c.y && this.z == c.z; } - public WorldCoord add( ForgeDirection direction, int length ) + public WorldCoord add( final ForgeDirection direction, final int length ) { this.x += direction.offsetX * length; this.y += direction.offsetY * length; @@ -162,7 +162,7 @@ public class WorldCoord } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { return obj instanceof WorldCoord && this.isEqual( (WorldCoord) obj ); } diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index ff066b01..3b9d2958 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -77,7 +77,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @SideOnly( Side.CLIENT ) BlockRenderInfo renderInfo; - protected AEBaseBlock( Material mat ) + protected AEBaseBlock( final Material mat ) { this( mat, Optional.absent() ); this.setLightOpacity( 255 ); @@ -86,7 +86,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature this.setHarvestLevel( "pickaxe", 0 ); } - protected AEBaseBlock( Material mat, Optional subName ) + protected AEBaseBlock( final Material mat, final Optional subName ) { super( mat ); @@ -139,11 +139,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return this.renderInfo; } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e ); } @@ -155,12 +155,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return BaseBlockRender.class; } - public IIcon unmappedGetIcon( IBlockAccess w, int x, int y, int z, int s ) + public IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s ) { return super.getIcon( w, x, y, z, s ); } - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); @@ -172,7 +172,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return this.handler; } - protected final void setHandler( IFeatureHandler handler ) + protected final void setHandler( final IFeatureHandler handler ) { this.handler = handler; } @@ -202,19 +202,19 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @Override - public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) + public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s ) { return this.getIcon( this.mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) ); } @Override @SideOnly( Side.CLIENT ) - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) ); } - protected ICustomCollision getCustomCollision( World w, int x, int y, int z ) + protected ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z ) { if( this instanceof ICustomCollision ) { @@ -226,15 +226,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override @SuppressWarnings( "unchecked" ) // NOTE: WAS FINAL, changed for Immibis - public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollisionBoxesToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); if( collisionHandler != null && bb != null ) { - List tmp = new ArrayList(); + final List tmp = new ArrayList(); collisionHandler.addCollidingBlockToList( w, x, y, z, bb, tmp, e ); - for( AxisAlignedBB b : tmp ) + for( final AxisAlignedBB b : tmp ) { b.minX += x; b.minY += y; @@ -256,7 +256,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override @SideOnly( Side.CLIENT ) - public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z ) + public final AxisAlignedBB getSelectedBoundingBoxFromPool( final World w, final int x, final int y, final int z ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); @@ -272,11 +272,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature double lastDist = 0; - for( AxisAlignedBB bb : bbs ) + for( final AxisAlignedBB bb : bbs ) { this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ ); - MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b ); + final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b ); this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); @@ -305,7 +305,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d ); - for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) ) + for( final AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) ) { final double minX = Math.min( b.minX, bx.minX ); final double minY = Math.min( b.minY, bx.minY ); @@ -332,7 +332,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @Override - public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b ) + public MovingObjectPosition collisionRayTrace( final World w, final int x, final int y, final int z, final Vec3 a, final Vec3 b ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); @@ -343,21 +343,21 @@ public abstract class AEBaseBlock extends Block implements IAEFeature double lastDist = 0; - for( AxisAlignedBB bb : bbs ) + for( final AxisAlignedBB bb : bbs ) { this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ ); - MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b ); + final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b ); this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); if( r != null ) { - double xLen = ( a.xCoord - r.hitVec.xCoord ); - double yLen = ( a.yCoord - r.hitVec.yCoord ); - double zLen = ( a.zCoord - r.hitVec.zCoord ); + final double xLen = ( a.xCoord - r.hitVec.xCoord ); + final double yLen = ( a.yCoord - r.hitVec.yCoord ); + final double zLen = ( a.zCoord - r.hitVec.zCoord ); - double thisDist = xLen * xLen + yLen * yLen + zLen * zLen; + final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen; if( br == null || lastDist > thisDist ) { lastDist = thisDist; @@ -378,7 +378,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return super.collisionRayTrace( w, x, y, z, a, b ); } - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { return false; } @@ -386,7 +386,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override @SideOnly( Side.CLIENT ) @SuppressWarnings( "unchecked" ) - public final void getSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { this.getCheckedSubBlocks( item, tabs, itemStacks ); } @@ -398,14 +398,14 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @Override - public int getComparatorInputOverride( World w, int x, int y, int z, int s ) + public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s ) { return 0; } @Override @SideOnly( Side.CLIENT ) - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { final BlockRenderInfo info = this.getRendererInstance(); final FlippableIcon topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null ); @@ -422,12 +422,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @Override - public final boolean isNormalCube( IBlockAccess world, int x, int y, int z ) + public final boolean isNormalCube( final IBlockAccess world, final int x, final int y, final int z ) { return this.isFullSize; } - public IOrientable getOrientable( IBlockAccess w, int x, int y, int z ) + public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z ) { if( this instanceof IOrientableBlock ) { @@ -437,7 +437,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @Override - public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis ) + public final boolean rotateBlock( final World w, final int x, final int y, final int z, final ForgeDirection axis ) { final IOrientable rotatable = this.getOrientable( w, x, y, z ); @@ -475,24 +475,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return false; } - protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis ) + protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis ) { } - public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) + public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up ) { return true; } @Override - public ForgeDirection[] getValidRotations( World w, int x, int y, int z ) + public ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z ) { return new ForgeDirection[0]; } @SideOnly( Side.CLIENT ) - private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute ) + private FlippableIcon optionalIcon( final IIconRegister ir, final String name, IIcon substitute ) { // if the input is an flippable IIcon find the original. while( substitute instanceof FlippableIcon ) @@ -507,13 +507,13 @@ public abstract class AEBaseBlock extends Block implements IAEFeature ResourceLocation resLoc = new ResourceLocation( name ); resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) ); - IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); + final IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); if( res != null ) { return new FlippableIcon( ir.registerIcon( name ) ); } } - catch( Throwable e ) + catch( final Throwable e ) { return new FlippableIcon( substitute ); } @@ -523,12 +523,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getSubBlocks( item, tabs, itemStacks ); } - int mapRotation( IBlockAccess w, int x, int y, int z, int s ) + int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s ) { final IOrientable ori = this.getOrientable( w, x, y, z ); @@ -540,7 +540,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return s; } - public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir ) + public ForgeDirection mapRotation( final IOrientable ori, final ForgeDirection dir ) { // case DOWN: return bottomIcon; // case UP: return blockIcon; @@ -557,12 +557,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return dir; } - int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; - int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; - int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; + final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; + final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; + final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; ForgeDirection west = ForgeDirection.UNKNOWN; - for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS ) { if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z ) { @@ -601,17 +601,17 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @SideOnly( Side.CLIENT ) - public void setRenderStateByMeta( int itemDamage ) + public void setRenderStateByMeta( final int itemDamage ) { } - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return this.getUnlocalizedName(); } - public void addInformation( ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips ) + public void addInformation( final ItemStack is, final EntityPlayer player, final List lines, final boolean advancedItemTooltips ) { } diff --git a/src/main/java/appeng/block/AEBaseItemBlock.java b/src/main/java/appeng/block/AEBaseItemBlock.java index 1099b5da..f276cbfc 100644 --- a/src/main/java/appeng/block/AEBaseItemBlock.java +++ b/src/main/java/appeng/block/AEBaseItemBlock.java @@ -49,7 +49,7 @@ public class AEBaseItemBlock extends ItemBlock private final AEBaseBlock blockType; - public AEBaseItemBlock( Block id ) + public AEBaseItemBlock( final Block id ) { super( id ); this.blockType = (AEBaseBlock) id; @@ -62,7 +62,7 @@ public class AEBaseItemBlock extends ItemBlock } @Override - public int getMetadata( int dmg ) + public int getMetadata( final int dmg ) { if( this.hasSubtypes ) { @@ -74,31 +74,31 @@ public class AEBaseItemBlock extends ItemBlock @Override @SideOnly( Side.CLIENT ) @SuppressWarnings( "unchecked" ) - public final void addInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips ) + public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips ) { this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips ); } @SideOnly( Side.CLIENT ) - public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedToolTips ) + public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedToolTips ) { this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips ); } @Override - public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 ) + public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 ) { return false; } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return this.blockType.getUnlocalizedName( is ); } @Override - public boolean placeBlockAt( ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata ) + public boolean placeBlockAt( final ItemStack stack, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata ) { ForgeDirection up = ForgeDirection.UNKNOWN; ForgeDirection forward = ForgeDirection.UNKNOWN; @@ -133,7 +133,7 @@ public class AEBaseItemBlock extends ItemBlock { up = ForgeDirection.UP; - byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 ); + final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 ); switch( rotation ) { @@ -186,7 +186,7 @@ public class AEBaseItemBlock extends ItemBlock { if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) ) { - AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z ); + final AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z ); ori = tile; if( tile == null ) diff --git a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java index 62cae693..7a9d6765 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java +++ b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java @@ -42,18 +42,18 @@ import appeng.util.Platform; public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage { - public AEBaseItemBlockChargeable( Block id ) + public AEBaseItemBlockChargeable( final Block id ) { super( id ); } @Override @SideOnly( Side.CLIENT ) - public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips ) + public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips ) { final NBTTagCompound tag = itemStack.getTagCompound(); double internalCurrentPower = 0; - double internalMaxPower = this.getMaxEnergyCapacity(); + final double internalMaxPower = this.getMaxEnergyCapacity(); if( tag != null ) { @@ -69,7 +69,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte { final Block blockID = Block.getBlockFromItem( this ); final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell(); - for( Block block : energyCell.maybeBlock().asSet() ) + for( final Block block : energyCell.maybeBlock().asSet() ) { if( blockID == block ) { @@ -85,10 +85,10 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte } @Override - public double injectAEPower( ItemStack is, double amt ) + public double injectAEPower( final ItemStack is, double amt ) { double internalCurrentPower = this.getInternal( is ); - double internalMaxPower = this.getMaxEnergyCapacity(); + final double internalMaxPower = this.getMaxEnergyCapacity(); internalCurrentPower += amt; if( internalCurrentPower > internalMaxPower ) { @@ -102,20 +102,20 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte return 0; } - private double getInternal( ItemStack is ) + private double getInternal( final ItemStack is ) { final NBTTagCompound nbt = Platform.openNbtData( is ); return nbt.getDouble( "internalCurrentPower" ); } - private void setInternal( ItemStack is, double amt ) + private void setInternal( final ItemStack is, final double amt ) { final NBTTagCompound nbt = Platform.openNbtData( is ); nbt.setDouble( "internalCurrentPower", amt ); } @Override - public double extractAEPower( ItemStack is, double amt ) + public double extractAEPower( final ItemStack is, double amt ) { double internalCurrentPower = this.getInternal( is ); if( internalCurrentPower > amt ) @@ -131,19 +131,19 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte } @Override - public double getAEMaxPower( ItemStack is ) + public double getAEMaxPower( final ItemStack is ) { return this.getMaxEnergyCapacity(); } @Override - public double getAECurrentPower( ItemStack is ) + public double getAECurrentPower( final ItemStack is ) { return this.getInternal( is ); } @Override - public AccessRestriction getPowerFlow( ItemStack is ) + public AccessRestriction getPowerFlow( final ItemStack is ) { return AccessRestriction.WRITE; } diff --git a/src/main/java/appeng/block/AEBaseItemBlockSlab.java b/src/main/java/appeng/block/AEBaseItemBlockSlab.java index 2be3b662..c284591f 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockSlab.java +++ b/src/main/java/appeng/block/AEBaseItemBlockSlab.java @@ -9,7 +9,7 @@ import net.minecraft.item.ItemSlab; public class AEBaseItemBlockSlab extends ItemSlab { - public AEBaseItemBlockSlab( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab ) + public AEBaseItemBlockSlab( final Block block, final AEBaseSlabBlock singleSlab, final AEBaseSlabBlock doubleSlab, final Boolean isDoubleSlab ) { super( block, singleSlab, doubleSlab, isDoubleSlab ); } diff --git a/src/main/java/appeng/block/AEBaseSlabBlock.java b/src/main/java/appeng/block/AEBaseSlabBlock.java index 89196c81..d450bb09 100644 --- a/src/main/java/appeng/block/AEBaseSlabBlock.java +++ b/src/main/java/appeng/block/AEBaseSlabBlock.java @@ -45,7 +45,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature private AEBaseSlabBlock doubleSlabs; private final String name; - public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet features, boolean isDoubleSlab, String name ) + public AEBaseSlabBlock( final AEBaseBlock block, final int meta, final EnumSet features, final boolean isDoubleSlab, final String name ) { super( isDoubleSlab, block.getMaterial() ); this.block = block; @@ -63,7 +63,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null; } - public AEBaseSlabBlock setSlabs( AEBaseSlabBlock slabs ) + public AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs ) { this.slabs = slabs; return this; @@ -92,30 +92,30 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature } @Override - public IIcon getIcon( int dir, int meta ) + public IIcon getIcon( final int dir, final int meta ) { return this.block.getIcon( dir, this.meta ); } @Override - public String func_150002_b( int p_150002_1_ ) + public String func_150002_b( final int p_150002_1_ ) { return this.getUnlocalizedName(); } @Override - public void registerBlockIcons( IIconRegister reg ) + public void registerBlockIcons( final IIconRegister reg ) { } @Override - public Item getItemDropped( int meta, Random rand, int fortune ) + public Item getItemDropped( final int meta, final Random rand, final int fortune ) { return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this ); } @Override - public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z ) + public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z ) { AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z ); @@ -128,7 +128,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature block = this.slabs; } - int meta = world.getBlockMetadata( x, y, z ) & 7; + final int meta = world.getBlockMetadata( x, y, z ) & 7; return new ItemStack( block, 1, meta ); } diff --git a/src/main/java/appeng/block/AEBaseStairBlock.java b/src/main/java/appeng/block/AEBaseStairBlock.java index 9d02c890..d4ed839a 100644 --- a/src/main/java/appeng/block/AEBaseStairBlock.java +++ b/src/main/java/appeng/block/AEBaseStairBlock.java @@ -36,7 +36,7 @@ public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature { private final IFeatureHandler features; - protected AEBaseStairBlock( Block block, int meta, EnumSet features ) + protected AEBaseStairBlock( final Block block, final int meta, final EnumSet features ) { super( block, meta ); diff --git a/src/main/java/appeng/block/AEBaseTileBlock.java b/src/main/java/appeng/block/AEBaseTileBlock.java index 5e4db3c6..ae4ee1c5 100644 --- a/src/main/java/appeng/block/AEBaseTileBlock.java +++ b/src/main/java/appeng/block/AEBaseTileBlock.java @@ -68,24 +68,24 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Nonnull private Class tileEntityType; - public AEBaseTileBlock( Material mat ) + public AEBaseTileBlock( final Material mat ) { super( mat ); } - protected AEBaseTileBlock( Material mat, Optional subName ) + protected AEBaseTileBlock( final Material mat, final Optional subName ) { super( mat, subName ); } @Override - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); } - protected void setTileEntity( Class c ) + protected void setTileEntity( final Class c ) { this.tileEntityType = c; this.isInventory = IInventory.class.isAssignableFrom( c ); @@ -93,7 +93,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } // update Block value. - private void setTileProvider( boolean b ) + private void setTileProvider( final boolean b ) { ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" ); } @@ -109,7 +109,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Nullable - public T getTileEntity( IBlockAccess w, int x, int y, int z ) + public T getTileEntity( final IBlockAccess w, final int x, final int y, final int z ) { if( !this.hasBlockTileEntity() ) { @@ -126,7 +126,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public final TileEntity createNewTileEntity( World var1, int var2 ) + public final TileEntity createNewTileEntity( final World var1, final int var2 ) { if( this.hasBlockTileEntity() ) { @@ -134,11 +134,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, { return this.tileEntityType.newInstance(); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e ); } @@ -148,7 +148,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public void breakBlock( World w, int x, int y, int z, Block a, int b ) + public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b ) { final AEBaseTile te = this.getTileEntity( w, x, y, z ); if( te != null ) @@ -172,7 +172,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public final ForgeDirection[] getValidRotations( World w, int x, int y, int z ) + public final ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z ) { final AEBaseTile obj = this.getTileEntity( w, x, y, z ); if( obj != null && obj.canBeRotated() ) @@ -184,7 +184,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour ) + public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour ) { final TileEntity te = this.getTileEntity( world, x, y, z ); @@ -206,7 +206,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public int getComparatorInputOverride( World w, int x, int y, int z, int s ) + public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s ) { final TileEntity te = this.getTileEntity( w, x, y, z ); if( te instanceof IInventory ) @@ -217,7 +217,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public boolean onBlockEventReceived( World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_ ) + public boolean onBlockEventReceived( final World p_149696_1_, final int p_149696_2_, final int p_149696_3_, final int p_149696_4_, final int p_149696_5_, final int p_149696_6_ ) { super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ ); final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ ); @@ -225,7 +225,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is ) + public void onBlockPlacedBy( final World w, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack is ) { if( is.hasDisplayName() ) { @@ -238,7 +238,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public final boolean onBlockActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player != null ) { @@ -264,7 +264,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } final ItemStack op = new ItemStack( this ); - for( ItemStack ol : drops ) + for( final ItemStack ol : drops ) { if( Platform.isSameItemType( ol, op ) ) { @@ -328,13 +328,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public IOrientable getOrientable( IBlockAccess w, int x, int y, int z ) + public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z ) { return this.getTileEntity( w, x, y, z ); } @Override - public ICustomCollision getCustomCollision( World w, int x, int y, int z ) + public ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z ) { final AEBaseTile te = this.getTileEntity( w, x, y, z ); if( te instanceof ICustomCollision ) diff --git a/src/main/java/appeng/block/AEDecorativeBlock.java b/src/main/java/appeng/block/AEDecorativeBlock.java index 702a0db8..08d68287 100644 --- a/src/main/java/appeng/block/AEDecorativeBlock.java +++ b/src/main/java/appeng/block/AEDecorativeBlock.java @@ -26,7 +26,7 @@ import net.minecraft.world.IBlockAccess; public class AEDecorativeBlock extends AEBaseBlock { - public AEDecorativeBlock( Material mat ) + public AEDecorativeBlock( final Material mat ) { super( mat ); } @@ -38,7 +38,7 @@ public class AEDecorativeBlock extends AEBaseBlock } @Override - public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) + public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s ) { return super.unmappedGetIcon( w, x, y, z, s ); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java index 5417a0d0..e4a9e787 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java @@ -52,11 +52,11 @@ public class BlockCraftingMonitor extends BlockCraftingUnit } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { if( direction != ForgeDirection.SOUTH.ordinal() ) { - for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() ) + for( final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() ) { return craftingUnitBlock.getIcon( direction, metadata ); } @@ -74,7 +74,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java index 66922f8e..01d5e17d 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java @@ -47,7 +47,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { switch( metadata & ( ~4 ) ) { @@ -75,7 +75,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); itemStacks.add( new ItemStack( this, 1, 1 ) ); @@ -84,7 +84,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { diff --git a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java index 66910556..6dfdf6fe 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java @@ -65,7 +65,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { switch( metadata ) { @@ -82,9 +82,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { - TileCraftingTile tg = this.getTileEntity( w, x, y, z ); + final TileCraftingTile tg = this.getTileEntity( w, x, y, z ); if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() ) { if( Platform.isClient() ) @@ -101,24 +101,24 @@ public class BlockCraftingUnit extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); itemStacks.add( new ItemStack( this, 1, 1 ) ); } @Override - public void setRenderStateByMeta( int itemDamage ) + public void setRenderStateByMeta( final int itemDamage ) { - IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage ); - IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage ); + final IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage ); + final IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage ); this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other ); } @Override - public void breakBlock( World w, int x, int y, int z, Block a, int b ) + public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b ) { - TileCraftingTile cp = this.getTileEntity( w, x, y, z ); + final TileCraftingTile cp = this.getTileEntity( w, x, y, z ); if( cp != null ) { cp.breakCluster(); @@ -128,7 +128,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { @@ -138,15 +138,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock return this.getItemUnlocalizedName( is ); } - protected String getItemUnlocalizedName( ItemStack is ) + protected String getItemUnlocalizedName( final ItemStack is ) { return super.getUnlocalizedName( is ); } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block junk ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk ) { - TileCraftingTile cp = this.getTileEntity( w, x, y, z ); + final TileCraftingTile cp = this.getTileEntity( w, x, y, z ); if( cp != null ) { cp.updateMultiBlock(); @@ -154,15 +154,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public int damageDropped( int meta ) + public int damageDropped( final int meta ) { return meta & 3; } @Override - public int getDamageValue( World w, int x, int y, int z ) + public int getDamageValue( final World w, final int x, final int y, final int z ) { - int meta = w.getBlockMetadata( x, y, z ); + final int meta = w.getBlockMetadata( x, y, z ); return this.damageDropped( meta ); } } diff --git a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java index d1bc7c35..864754d4 100644 --- a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java +++ b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java @@ -60,7 +60,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock } @Override - public boolean canRenderInPass( int pass ) + public boolean canRenderInPass( final int pass ) { booleanAlphaPass = pass == 1; return pass == 0 || pass == 1; @@ -74,9 +74,9 @@ public class BlockMolecularAssembler extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { - TileMolecularAssembler tg = this.getTileEntity( w, x, y, z ); + final TileMolecularAssembler tg = this.getTileEntity( w, x, y, z ); if( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC ); diff --git a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java index 86369f11..28a34d90 100644 --- a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java @@ -31,15 +31,15 @@ import appeng.core.features.AEFeature; public class ItemCraftingStorage extends AEBaseItemBlock { - public ItemCraftingStorage( Block id ) + public ItemCraftingStorage( final Block id ) { super( id ); } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { - for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() ) { return stack; } @@ -48,7 +48,7 @@ public class ItemCraftingStorage extends AEBaseItemBlock } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting ); } diff --git a/src/main/java/appeng/block/grindstone/BlockCrank.java b/src/main/java/appeng/block/grindstone/BlockCrank.java index 6ddc1089..490f5ad4 100644 --- a/src/main/java/appeng/block/grindstone/BlockCrank.java +++ b/src/main/java/appeng/block/grindstone/BlockCrank.java @@ -62,7 +62,7 @@ public class BlockCrank extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player instanceof FakePlayer || player == null ) { @@ -70,7 +70,7 @@ public class BlockCrank extends AEBaseTileBlock return true; } - AEBaseTile tile = this.getTileEntity( w, x, y, z ); + final AEBaseTile tile = this.getTileEntity( w, x, y, z ); if( tile instanceof TileCrank ) { if( ( (TileCrank) tile ).power() ) @@ -82,19 +82,19 @@ public class BlockCrank extends AEBaseTileBlock return true; } - private void dropCrank( World world, int x, int y, int z ) + private void dropCrank( final World world, final int x, final int y, final int z ) { world.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true ); world.markBlockForUpdate( x, y, z ); } @Override - public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack ) + public void onBlockPlacedBy( final World world, final int x, final int y, final int z, final EntityLivingBase placer, final ItemStack itemStack ) { - AEBaseTile tile = this.getTileEntity( world, x, y, z ); + final AEBaseTile tile = this.getTileEntity( world, x, y, z ); if( tile != null ) { - ForgeDirection mnt = this.findCrankable( world, x, y, z ); + final ForgeDirection mnt = this.findCrankable( world, x, y, z ); ForgeDirection forward = ForgeDirection.UP; if( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN ) { @@ -109,15 +109,15 @@ public class BlockCrank extends AEBaseTileBlock } @Override - public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) + public boolean isValidOrientation( final World world, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up ) { - TileEntity te = world.getTileEntity( x, y, z ); + final TileEntity te = world.getTileEntity( x, y, z ); return !( te instanceof TileCrank ) || this.isCrankable( world, x, y, z, up.getOpposite() ); } - private ForgeDirection findCrankable( World world, int x, int y, int z ) + private ForgeDirection findCrankable( final World world, final int x, final int y, final int z ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { if( this.isCrankable( world, x, y, z, dir ) ) { @@ -127,17 +127,17 @@ public class BlockCrank extends AEBaseTileBlock return ForgeDirection.UNKNOWN; } - private boolean isCrankable( World world, int x, int y, int z, ForgeDirection offset ) + private boolean isCrankable( final World world, final int x, final int y, final int z, final ForgeDirection offset ) { - TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ ); + final TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ ); return te instanceof ICrankable && ( (ICrankable) te ).canCrankAttach( offset.getOpposite() ); } @Override - public void onNeighborBlockChange( World world, int x, int y, int z, Block block ) + public void onNeighborBlockChange( final World world, final int x, final int y, final int z, final Block block ) { - AEBaseTile tile = this.getTileEntity( world, x, y, z ); + final AEBaseTile tile = this.getTileEntity( world, x, y, z ); if( tile != null ) { if( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) ) @@ -152,7 +152,7 @@ public class BlockCrank extends AEBaseTileBlock } @Override - public boolean canPlaceBlockAt( World world, int x, int y, int z ) + public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z ) { return this.findCrankable( world, x, y, z ) != ForgeDirection.UNKNOWN; } diff --git a/src/main/java/appeng/block/grindstone/BlockGrinder.java b/src/main/java/appeng/block/grindstone/BlockGrinder.java index bf57093e..1bf855bb 100644 --- a/src/main/java/appeng/block/grindstone/BlockGrinder.java +++ b/src/main/java/appeng/block/grindstone/BlockGrinder.java @@ -46,9 +46,9 @@ public class BlockGrinder extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { - TileGrinder tg = this.getTileEntity( w, x, y, z ); + final TileGrinder tg = this.getTileEntity( w, x, y, z ); if( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER ); diff --git a/src/main/java/appeng/block/misc/BlockCellWorkbench.java b/src/main/java/appeng/block/misc/BlockCellWorkbench.java index 63c54c2b..5608fb9f 100644 --- a/src/main/java/appeng/block/misc/BlockCellWorkbench.java +++ b/src/main/java/appeng/block/misc/BlockCellWorkbench.java @@ -45,14 +45,14 @@ public class BlockCellWorkbench extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileCellWorkbench tg = this.getTileEntity( w, x, y, z ); + final TileCellWorkbench tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockCharger.java b/src/main/java/appeng/block/misc/BlockCharger.java index 47008485..ca75c4a1 100644 --- a/src/main/java/appeng/block/misc/BlockCharger.java +++ b/src/main/java/appeng/block/misc/BlockCharger.java @@ -69,7 +69,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player.isSneaking() ) { @@ -78,7 +78,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision if( Platform.isServer() ) { - TileCharger tc = this.getTileEntity( w, x, y, z ); + final TileCharger tc = this.getTileEntity( w, x, y, z ); if( tc != null ) { tc.activate( player ); @@ -90,7 +90,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -102,22 +102,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision return; } - AEBaseTile tile = this.getTileEntity( w, x, y, z ); + final AEBaseTile tile = this.getTileEntity( w, x, y, z ); if( tile instanceof TileCharger ) { - TileCharger tc = (TileCharger) tile; + final TileCharger tc = (TileCharger) tile; if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) ) { - double xOff = 0.0; - double yOff = 0.0; - double zOff = 0.0; + final double xOff = 0.0; + final double yOff = 0.0; + final double zOff = 0.0; for( int bolts = 0; bolts < 3; bolts++ ) { 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 ); + final 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( fx ); } } @@ -126,15 +126,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - TileCharger tile = this.getTileEntity( w, x, y, z ); + final TileCharger tile = this.getTileEntity( w, x, y, z ); if( tile != null ) { - double twoPixels = 2.0 / 16.0; - ForgeDirection up = tile.getUp(); - ForgeDirection forward = tile.getForward(); - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels ); + final double twoPixels = 2.0 / 16.0; + final ForgeDirection up = tile.getUp(); + final ForgeDirection forward = tile.getForward(); + final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels ); if( up.offsetX != 0 ) { @@ -182,7 +182,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); } diff --git a/src/main/java/appeng/block/misc/BlockCondenser.java b/src/main/java/appeng/block/misc/BlockCondenser.java index 338cd10e..7b2de915 100644 --- a/src/main/java/appeng/block/misc/BlockCondenser.java +++ b/src/main/java/appeng/block/misc/BlockCondenser.java @@ -45,7 +45,7 @@ public class BlockCondenser extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player.isSneaking() ) { @@ -54,7 +54,7 @@ public class BlockCondenser extends AEBaseTileBlock if( Platform.isServer() ) { - TileCondenser tc = this.getTileEntity( w, x, y, z ); + final TileCondenser tc = this.getTileEntity( w, x, y, z ); if( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CONDENSER ); diff --git a/src/main/java/appeng/block/misc/BlockInscriber.java b/src/main/java/appeng/block/misc/BlockInscriber.java index 9f53436e..53f0537f 100644 --- a/src/main/java/appeng/block/misc/BlockInscriber.java +++ b/src/main/java/appeng/block/misc/BlockInscriber.java @@ -55,14 +55,14 @@ public class BlockInscriber extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileInscriber tg = this.getTileEntity( w, x, y, z ); + final TileInscriber tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockInterface.java b/src/main/java/appeng/block/misc/BlockInterface.java index 4b7f3fa3..e6aaf701 100644 --- a/src/main/java/appeng/block/misc/BlockInterface.java +++ b/src/main/java/appeng/block/misc/BlockInterface.java @@ -54,14 +54,14 @@ public class BlockInterface extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileInterface tg = this.getTileEntity( w, x, y, z ); + final TileInterface tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) @@ -80,7 +80,7 @@ public class BlockInterface extends AEBaseTileBlock } @Override - protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis ) + protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis ) { if( rotatable instanceof TileInterface ) { diff --git a/src/main/java/appeng/block/misc/BlockLightDetector.java b/src/main/java/appeng/block/misc/BlockLightDetector.java index 6d26865e..70874874 100644 --- a/src/main/java/appeng/block/misc/BlockLightDetector.java +++ b/src/main/java/appeng/block/misc/BlockLightDetector.java @@ -61,7 +61,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side ) + public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side ) { if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() ) { @@ -72,11 +72,11 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public void onNeighborChange( IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ ) + public void onNeighborChange( final IBlockAccess world, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ ) { super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ ); - TileLightDetector tld = this.getTileEntity( world, x, y, z ); + final TileLightDetector tld = this.getTileEntity( world, x, y, z ); if( tld != null ) { tld.updateLight(); @@ -85,7 +85,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { // cancel out lightning } @@ -97,28 +97,28 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) + public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up ) { return this.canPlaceAt( w, x, y, z, up.getOpposite() ); } - private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir ) + private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir ) { return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false ); } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); - double xOff = -0.3 * up.offsetX; - double yOff = -0.3 * up.offsetY; - double zOff = -0.3 * up.offsetZ; + final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + final double xOff = -0.3 * up.offsetX; + final double yOff = -0.3 * up.offsetY; + final double zOff = -0.3 * up.offsetZ; return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) {/* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff @@ -127,16 +127,16 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block id ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id ) { - ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) ) { this.dropTorch( w, x, y, z ); } } - private void dropTorch( World w, int x, int y, int z ) + private void dropTorch( final World w, final int x, final int y, final int z ) { w.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true ); @@ -144,9 +144,9 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public boolean canPlaceBlockAt( World w, int x, int y, int z ) + public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { if( this.canPlaceAt( w, x, y, z, dir ) ) { diff --git a/src/main/java/appeng/block/misc/BlockPaint.java b/src/main/java/appeng/block/misc/BlockPaint.java index 5750e0a3..a9211c76 100644 --- a/src/main/java/appeng/block/misc/BlockPaint.java +++ b/src/main/java/appeng/block/misc/BlockPaint.java @@ -66,27 +66,27 @@ public class BlockPaint extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z ) + public AxisAlignedBB getCollisionBoundingBoxFromPool( final World world, final int x, final int y, final int z ) { return null; } @Override - public boolean canCollideCheck( int metadata, boolean isHoldingRightClick ) + public boolean canCollideCheck( final int metadata, final boolean isHoldingRightClick ) { return false; } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block junk ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk ) { - TilePaint tp = this.getTileEntity( w, x, y, z ); + final TilePaint tp = this.getTileEntity( w, x, y, z ); if( tp != null ) { @@ -95,19 +95,19 @@ public class BlockPaint extends AEBaseTileBlock } @Override - public Item getItemDropped( int meta, Random random, int fortune ) + public Item getItemDropped( final int meta, final Random random, final int fortune ) { return null; } @Override - public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune ) + public void dropBlockAsItemWithChance( final World world, final int x, final int y, final int z, final int meta, final float chance, final int fortune ) { } @Override - public void fillWithRain( World w, int x, int y, int z ) + public void fillWithRain( final World w, final int x, final int y, final int z ) { if( Platform.isServer() ) { @@ -116,9 +116,9 @@ public class BlockPaint extends AEBaseTileBlock } @Override - public int getLightValue( IBlockAccess w, int x, int y, int z ) + public int getLightValue( final IBlockAccess w, final int x, final int y, final int z ) { - TilePaint tp = this.getTileEntity( w, x, y, z ); + final TilePaint tp = this.getTileEntity( w, x, y, z ); if( tp != null ) { @@ -129,13 +129,13 @@ public class BlockPaint extends AEBaseTileBlock } @Override - public boolean isReplaceable( IBlockAccess world, int x, int y, int z ) + public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z ) { return true; } @Override - public boolean isAir( IBlockAccess world, int x, int y, int z ) + public boolean isAir( final IBlockAccess world, final int x, final int y, final int z ) { return true; } diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index f3c75c4d..7e01d777 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -62,23 +62,23 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { return; } - TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z ); + final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z ); if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = r.nextFloat() - 0.5F; - double d1 = r.nextFloat() - 0.5F; + final double d0 = r.nextFloat() - 0.5F; + final double d1 = r.nextFloat() - 0.5F; - ForgeDirection up = cga.getUp(); - ForgeDirection forward = cga.getForward(); - ForgeDirection west = Platform.crossProduct( forward, up ); + final ForgeDirection up = cga.getUp(); + final ForgeDirection forward = cga.getForward(); + final ForgeDirection west = Platform.crossProduct( forward, up ); double rx = 0.5 + x; double ry = 0.5 + y; @@ -134,7 +134,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr ry += dz * forward.offsetY; rz += dz * forward.offsetZ; - LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); + final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); 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 103b3766..8b8f6df3 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -69,28 +69,28 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I } @Override - public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) + public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up ) { return this.canPlaceAt( w, x, y, z, up.getOpposite() ); } - private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir ) + private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir ) { return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false ); } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); - double xOff = -0.3 * up.offsetX; - double yOff = -0.3 * up.offsetY; - double zOff = -0.3 * up.offsetZ; + final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + final double xOff = -0.3 * up.offsetX; + final double yOff = -0.3 * up.offsetY; + final double zOff = -0.3 * up.offsetZ; return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) {/* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff @@ -100,7 +100,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -112,15 +112,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I return; } - ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); - double xOff = -0.3 * up.offsetX; - double yOff = -0.3 * up.offsetY; - double zOff = -0.3 * up.offsetZ; + final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + final double xOff = -0.3 * up.offsetX; + final double yOff = -0.3 * up.offsetY; + final double zOff = -0.3 * up.offsetZ; for( int bolts = 0; bolts < 3; bolts++ ) { 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 ); + final 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( fx ); } @@ -128,16 +128,16 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block id ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id ) { - ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); + final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp(); if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) ) { this.dropTorch( w, x, y, z ); } } - private void dropTorch( World w, int x, int y, int z ) + private void dropTorch( final World w, final int x, final int y, final int z ) { w.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true ); @@ -145,9 +145,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I } @Override - public boolean canPlaceBlockAt( World w, int x, int y, int z ) + public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { if( this.canPlaceAt( w, x, y, z, dir ) ) { diff --git a/src/main/java/appeng/block/misc/BlockSecurity.java b/src/main/java/appeng/block/misc/BlockSecurity.java index 8915e43a..dceabff7 100644 --- a/src/main/java/appeng/block/misc/BlockSecurity.java +++ b/src/main/java/appeng/block/misc/BlockSecurity.java @@ -53,14 +53,14 @@ public class BlockSecurity extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileSecurity tg = this.getTileEntity( w, x, y, z ); + final TileSecurity tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isClient() ) diff --git a/src/main/java/appeng/block/misc/BlockSkyCompass.java b/src/main/java/appeng/block/misc/BlockSkyCompass.java index 4a075e32..535a0fd6 100644 --- a/src/main/java/appeng/block/misc/BlockSkyCompass.java +++ b/src/main/java/appeng/block/misc/BlockSkyCompass.java @@ -64,21 +64,21 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision @Override @SideOnly( Side.CLIENT ) - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { return Blocks.iron_block.getIcon( direction, metadata ); } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { // :P } @Override - public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up ) + public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up ) { - TileSkyCompass sc = this.getTileEntity( w, x, y, z ); + final TileSkyCompass sc = this.getTileEntity( w, x, y, z ); if( sc != null ) { return false; @@ -86,23 +86,23 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision return this.canPlaceAt( w, x, y, z, forward.getOpposite() ); } - private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir ) + private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir ) { return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false ); } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block id ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id ) { - TileSkyCompass sc = this.getTileEntity( w, x, y, z ); - ForgeDirection up = sc.getForward(); + final TileSkyCompass sc = this.getTileEntity( w, x, y, z ); + final ForgeDirection up = sc.getForward(); if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) ) { this.dropTorch( w, x, y, z ); } } - private void dropTorch( World w, int x, int y, int z ) + private void dropTorch( final World w, final int x, final int y, final int z ) { w.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true ); @@ -110,9 +110,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision } @Override - public boolean canPlaceBlockAt( World w, int x, int y, int z ) + public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { if( this.canPlaceAt( w, x, y, z, dir ) ) { @@ -123,12 +123,12 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - TileSkyCompass tile = this.getTileEntity( w, x, y, z ); + final TileSkyCompass tile = this.getTileEntity( w, x, y, z ); if( tile != null ) { - ForgeDirection forward = tile.getForward(); + final ForgeDirection forward = tile.getForward(); double minX = 0; double minY = 0; @@ -185,7 +185,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { } diff --git a/src/main/java/appeng/block/misc/BlockTinyTNT.java b/src/main/java/appeng/block/misc/BlockTinyTNT.java index d2bc3eb5..006d465a 100644 --- a/src/main/java/appeng/block/misc/BlockTinyTNT.java +++ b/src/main/java/appeng/block/misc/BlockTinyTNT.java @@ -83,13 +83,13 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { return new FullIcon( Blocks.tnt.getIcon( direction, metadata ) ); } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel ) { @@ -105,23 +105,23 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { // no images required. } - public void startFuse( World w, int x, int y, int z, EntityLivingBase igniter ) + public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter ) { if( !w.isRemote ) { - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter ); + final 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 ); } } @Override - public void onBlockAdded( World w, int x, int y, int z ) + public void onBlockAdded( final World w, final int x, final int y, final int z ) { super.onBlockAdded( w, x, y, z ); @@ -133,7 +133,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block id ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id ) { if( w.isBlockIndirectlyGettingPowered( x, y, z ) ) { @@ -143,22 +143,22 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public void onBlockDestroyedByExplosion( World w, int x, int y, int z, Explosion exp ) + public void onBlockDestroyedByExplosion( final World w, final int x, final int y, final int z, final Explosion exp ) { if( !w.isRemote ) { - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() ); + final 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 ); } } @Override - public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity entity ) + public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity entity ) { if( entity instanceof EntityArrow && !w.isRemote ) { - EntityArrow entityarrow = (EntityArrow) entity; + final EntityArrow entityarrow = (EntityArrow) entity; if( entityarrow.isBurning() ) { @@ -169,19 +169,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public boolean canDropFromExplosion( Explosion exp ) + public boolean canDropFromExplosion( final Explosion exp ) { return false; } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { return Collections.singletonList( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); } diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index 82b8c18f..c4b1c3d2 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -51,10 +51,10 @@ public final class BlockVibrationChamber extends AEBaseTileBlock } @Override - public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) + public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s ) { - IIcon ico = super.getIcon( w, x, y, z, s ); - TileVibrationChamber tvc = this.getTileEntity( w, x, y, z ); + final IIcon ico = super.getIcon( w, x, y, z, s ); + final TileVibrationChamber tvc = this.getTileEntity( w, x, y, z ); if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) ) { @@ -65,7 +65,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( player.isSneaking() ) { @@ -74,7 +74,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock if( Platform.isServer() ) { - TileVibrationChamber tc = this.getTileEntity( w, x, y, z ); + final TileVibrationChamber tc = this.getTileEntity( w, x, y, z ); if( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER ); @@ -86,36 +86,36 @@ public final class BlockVibrationChamber extends AEBaseTileBlock } @Override - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { return; } - AEBaseTile tile = this.getTileEntity( w, x, y, z ); + final AEBaseTile tile = this.getTileEntity( w, x, y, z ); if( tile instanceof TileVibrationChamber ) { - TileVibrationChamber tc = (TileVibrationChamber) tile; + final TileVibrationChamber tc = (TileVibrationChamber) tile; if( tc.isOn ) { float f1 = x + 0.5F; float f2 = y + 0.5F; float f3 = z + 0.5F; - ForgeDirection forward = tc.getForward(); - ForgeDirection up = tc.getUp(); + final ForgeDirection forward = tc.getForward(); + final ForgeDirection up = tc.getUp(); - int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; - int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; - int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; + final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; + final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; + final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; f1 += forward.offsetX * 0.6; f2 += forward.offsetY * 0.6; f3 += forward.offsetZ * 0.6; - float ox = r.nextFloat(); - float oy = r.nextFloat() * 0.2f; + final float ox = r.nextFloat(); + final float oy = r.nextFloat() * 0.2f; f1 += up.offsetX * ( -0.3 + oy ); f2 += up.offsetY * ( -0.3 + oy ); diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index 6268daa9..0d39a43e 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -102,19 +102,19 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r ); } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block meh ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block meh ) { this.cb( w, x, y, z ).onNeighborChanged(); } @Override - public Item getItemDropped( int i, Random r, int k ) + public Item getItemDropped( final int i, final Random r, final int k ) { return null; } @@ -130,13 +130,13 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public int colorMultiplier( IBlockAccess world, int x, int y, int z ) + public int colorMultiplier( final IBlockAccess world, final int x, final int y, final int z ) { return this.myColorMultiplier; } @Override - public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side ) + public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side ) { return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() ); } @@ -148,21 +148,21 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity e ) + public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity e ) { this.cb( w, x, y, z ).onEntityCollision( e ); } @Override - public int isProvidingStrongPower( IBlockAccess w, int x, int y, int z, int side ) + public int isProvidingStrongPower( final IBlockAccess w, final int x, final int y, final int z, final int side ) { return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() ); } @Override - public int getLightValue( IBlockAccess world, int x, int y, int z ) + public int getLightValue( final IBlockAccess world, final int x, final int y, final int z ) { - Block block = world.getBlock( x, y, z ); + final Block block = world.getBlock( x, y, z ); if( block != null && block != this ) { return block.getLightValue( world, x, y, z ); @@ -175,30 +175,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public boolean isLadder( IBlockAccess world, int x, int y, int z, EntityLivingBase entity ) + public boolean isLadder( final IBlockAccess world, final int x, final int y, final int z, final EntityLivingBase entity ) { return this.cb( world, x, y, z ).isLadder( entity ); } @Override - public boolean isSideSolid( IBlockAccess w, int x, int y, int z, ForgeDirection side ) + public boolean isSideSolid( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side ) { return this.cb( w, x, y, z ).isSolidOnSide( side ); } @Override - public boolean isReplaceable( IBlockAccess world, int x, int y, int z ) + public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z ) { return this.cb( world, x, y, z ).isEmpty(); } @SuppressWarnings( "deprecation" ) @Override - public boolean removedByPlayer( World world, EntityPlayer player, int x, int y, int z ) + public boolean removedByPlayer( final World world, final EntityPlayer player, final int x, final int y, final int z ) { if( player.capabilities.isCreativeMode ) { - AEBaseTile tile = this.getTileEntity( world, x, y, z ); + final AEBaseTile tile = this.getTileEntity( world, x, y, z ); if( tile != null ) { tile.disableDrops(); @@ -209,7 +209,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public boolean canConnectRedstone( IBlockAccess w, int x, int y, int z, int side ) + public boolean canConnectRedstone( final IBlockAccess w, final int x, final int y, final int z, final int side ) { switch( side ) { @@ -229,7 +229,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public boolean canRenderInPass( int pass ) + public boolean canRenderInPass( final int pass ) { BusRenderHelper.INSTANCE.setPass( pass ); @@ -242,10 +242,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player ) + public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player ) { - Vec3 v3 = target.hitVec.addVector( -x, -y, -z ); - SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 ); + final Vec3 v3 = target.hitVec.addVector( -x, -y, -z ); + final SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 ); if( sp.part != null ) { @@ -261,24 +261,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection @Override @SideOnly( Side.CLIENT ) - public boolean addHitEffects( World world, MovingObjectPosition target, EffectRenderer effectRenderer ) + public boolean addHitEffects( final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer ) { - Object object = this.cb( world, target.blockX, target.blockY, target.blockZ ); + final Object object = this.cb( world, target.blockX, target.blockY, target.blockZ ); if( object instanceof IPartHost ) { - IPartHost host = (IPartHost) object; + final IPartHost host = (IPartHost) object; - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { - IPart p = host.getPart( side ); - IIcon ico = this.getIcon( p ); + final IPart p = host.getPart( side ); + final IIcon ico = this.getIcon( p ); if( ico == null ) { continue; } - byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 ); + final byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 ); for( int i1 = 0; i1 < b0; ++i1 ) { @@ -286,14 +286,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection { for( int k1 = 0; k1 < b0; ++k1 ) { - double d0 = target.blockX + ( i1 + 0.5D ) / b0; - double d1 = target.blockY + ( j1 + 0.5D ) / b0; - double d2 = target.blockZ + ( k1 + 0.5D ) / b0; + final double d0 = target.blockX + ( i1 + 0.5D ) / b0; + final double d1 = target.blockY + ( j1 + 0.5D ) / b0; + final 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 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ ); + final double dd0 = target.hitVec.xCoord; + final double dd1 = target.hitVec.yCoord; + final double dd2 = target.hitVec.zCoord; + final 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 ); @@ -309,24 +309,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection @Override @SideOnly( Side.CLIENT ) - public boolean addDestroyEffects( World world, int x, int y, int z, int meta, EffectRenderer effectRenderer ) + public boolean addDestroyEffects( final World world, final int x, final int y, final int z, final int meta, final EffectRenderer effectRenderer ) { - Object object = this.cb( world, x, y, z ); + final Object object = this.cb( world, x, y, z ); if( object instanceof IPartHost ) { - IPartHost host = (IPartHost) object; + final IPartHost host = (IPartHost) object; - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { - IPart p = host.getPart( side ); - IIcon ico = this.getIcon( p ); + final IPart p = host.getPart( side ); + final IIcon ico = this.getIcon( p ); if( ico == null ) { continue; } - byte b0 = 3; + final byte b0 = 3; for( int i1 = 0; i1 < b0; ++i1 ) { @@ -334,10 +334,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection { for( int k1 = 0; k1 < b0; ++k1 ) { - 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 ); + final double d0 = x + ( i1 + 0.5D ) / b0; + final double d1 = y + ( j1 + 0.5D ) / b0; + final double d2 = z + ( k1 + 0.5D ) / b0; + final 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 ); @@ -352,7 +352,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ ) + public void onNeighborChange( final IBlockAccess w, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ ) { if( Platform.isServer() ) { @@ -360,7 +360,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } } - private IIcon getIcon( IPart p ) + private IIcon getIcon( final IPart p ) { if( p == null ) { @@ -369,18 +369,18 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection try { - IIcon ico = p.getBreakingTexture(); + final IIcon ico = p.getBreakingTexture(); if( ico != null ) { return ico; } } - catch( Throwable t ) + catch( final Throwable t ) { // nothing. } - ItemStack is = p.getItemStack( PartItemStack.Network ); + final ItemStack is = p.getItemStack( PartItemStack.Network ); if( is == null || is.getItem() == null ) { return null; @@ -389,9 +389,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection return is.getItem().getIcon( is, 0 ); } - private ICableBusContainer cb( IBlockAccess w, int x, int y, int z ) + private ICableBusContainer cb( final IBlockAccess w, final int x, final int y, final int z ) { - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); ICableBusContainer out = null; if( te instanceof TileCableBus ) @@ -413,15 +413,15 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s ) + public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s ) { return this.getIcon( s, 0 ); } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { - IIcon i = super.getIcon( direction, metadata ); + final IIcon i = super.getIcon( direction, metadata ); if( i != null ) { return i; @@ -431,30 +431,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { } @Override - public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour ) + public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour ) { return this.recolourBlock( world, x, y, z, side, colour, null ); } - public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who ) + public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour, final EntityPlayer who ) { try { return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } return false; @@ -462,15 +462,15 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override - public T getTileEntity( IBlockAccess w, int x, int y, int z ) + public T getTileEntity( final IBlockAccess w, final int x, final int y, final int z ) { - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( noTesrTile.isInstance( te ) ) { @@ -486,7 +486,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection } @Override - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); @@ -507,12 +507,12 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection @Override @Method( iname = IntegrationType.MFR ) - public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side ) + public RedNetConnectionType getConnectionType( final World world, final int x, final int y, final int z, final ForgeDirection side ) { return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None; } - public void setRenderColor( int color ) + public void setRenderColor( final int color ) { this.myColorMultiplier = color; } diff --git a/src/main/java/appeng/block/networking/BlockController.java b/src/main/java/appeng/block/networking/BlockController.java index 36c408ba..bfea1bf0 100644 --- a/src/main/java/appeng/block/networking/BlockController.java +++ b/src/main/java/appeng/block/networking/BlockController.java @@ -44,9 +44,9 @@ public class BlockController extends AEBaseTileBlock } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block neighborBlock ) { - TileController tc = this.getTileEntity( w, x, y, z ); + final TileController tc = this.getTileEntity( w, x, y, z ); if( tc != null ) { tc.onNeighborChange( false ); diff --git a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java index 746aa2bf..9a4d9b82 100644 --- a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java @@ -38,7 +38,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { switch( metadata ) { diff --git a/src/main/java/appeng/block/networking/BlockEnergyCell.java b/src/main/java/appeng/block/networking/BlockEnergyCell.java index 7eaabb70..7382d1c7 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockEnergyCell.java @@ -61,7 +61,7 @@ public class BlockEnergyCell extends AEBaseTileBlock } @Override - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { switch( metadata ) { @@ -87,12 +87,12 @@ public class BlockEnergyCell extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getCheckedSubBlocks( item, tabs, itemStacks ); - ItemStack charged = new ItemStack( this, 1 ); - NBTTagCompound tag = Platform.openNbtData( charged ); + final ItemStack charged = new ItemStack( this, 1 ); + final NBTTagCompound tag = Platform.openNbtData( charged ); tag.setDouble( "internalCurrentPower", this.getMaxPower() ); tag.setDouble( "internalMaxPower", this.getMaxPower() ); diff --git a/src/main/java/appeng/block/networking/BlockWireless.java b/src/main/java/appeng/block/networking/BlockWireless.java index 4482176f..2bc0b45b 100644 --- a/src/main/java/appeng/block/networking/BlockWireless.java +++ b/src/main/java/appeng/block/networking/BlockWireless.java @@ -60,14 +60,14 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileWireless tg = this.getTileEntity( w, x, y, z ); + final TileWireless tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) @@ -80,12 +80,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - TileWireless tile = this.getTileEntity( w, x, y, z ); + final TileWireless tile = this.getTileEntity( w, x, y, z ); if( tile != null ) { - ForgeDirection forward = tile.getForward(); + final ForgeDirection forward = tile.getForward(); double minX = 0; double minY = 0; @@ -142,12 +142,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { - TileWireless tile = this.getTileEntity( w, x, y, z ); + final TileWireless tile = this.getTileEntity( w, x, y, z ); if( tile != null ) { - ForgeDirection forward = tile.getForward(); + final ForgeDirection forward = tile.getForward(); double minX = 0; double minY = 0; diff --git a/src/main/java/appeng/block/qnb/BlockQuantumBase.java b/src/main/java/appeng/block/qnb/BlockQuantumBase.java index f4a431ba..8d08d14b 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumBase.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumBase.java @@ -35,11 +35,11 @@ import appeng.tile.qnb.TileQuantumBridge; public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision { - public BlockQuantumBase( Material mat ) + public BlockQuantumBase( final Material mat ) { super( mat ); this.setTileEntity( TileQuantumBridge.class ); - float shave = 2.0f / 16.0f; + final float shave = 2.0f / 16.0f; this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); this.setLightOpacity( 0 ); this.isFullSize = this.isOpaque = false; @@ -47,9 +47,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block pointlessNumber ) { - TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); + final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null ) { bridge.neighborUpdate(); @@ -57,9 +57,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto } @Override - public void breakBlock( World w, int x, int y, int z, Block a, int b ) + public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b ) { - TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); + final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null ) { bridge.breakCluster(); diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index 9e6b52b4..7e9e5d01 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -50,9 +50,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int bx, int by, int bz, Random r ) + public void randomDisplayTick( final World w, final int bx, final int by, final int bz, final Random r ) { - TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz ); + final TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz ); if( bridge != null ) { if( bridge.hasQES() ) @@ -66,14 +66,14 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileQuantumBridge tg = this.getTileEntity( w, x, y, z ); + final TileQuantumBridge tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) @@ -86,16 +86,16 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - double onePixel = 2.0 / 16.0; + final double onePixel = 2.0 / 16.0; return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { - double onePixel = 2.0 / 16.0; + final double onePixel = 2.0 / 16.0; out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } } diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index a85a7caa..09ad4107 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -39,10 +39,10 @@ public class BlockQuantumRing extends BlockQuantumBase } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { double onePixel = 2.0 / 16.0; - TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); + final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null && bridge.isCorner() ) { onePixel = 4.0 / 16.0; @@ -55,10 +55,10 @@ public class BlockQuantumRing extends BlockQuantumBase } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { double onePixel = 2.0 / 16.0; - TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); + final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); if( bridge != null && bridge.isCorner() ) { onePixel = 4.0 / 16.0; diff --git a/src/main/java/appeng/block/solids/BlockQuartzGlass.java b/src/main/java/appeng/block/solids/BlockQuartzGlass.java index c462ca1d..25417025 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzGlass.java +++ b/src/main/java/appeng/block/solids/BlockQuartzGlass.java @@ -52,9 +52,9 @@ public class BlockQuartzGlass extends AEBaseBlock } @Override - public boolean shouldSideBeRendered( IBlockAccess w, int x, int y, int z, int side ) + public boolean shouldSideBeRendered( final IBlockAccess w, final int x, final int y, final int z, final int side ) { - Material mat = w.getBlock( x, y, z ).getMaterial(); + final Material mat = w.getBlock( x, y, z ).getMaterial(); if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE ) { if( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() ) diff --git a/src/main/java/appeng/block/solids/BlockQuartzLamp.java b/src/main/java/appeng/block/solids/BlockQuartzLamp.java index 936d6251..41774e8c 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzLamp.java +++ b/src/main/java/appeng/block/solids/BlockQuartzLamp.java @@ -46,7 +46,7 @@ public class BlockQuartzLamp extends BlockQuartzGlass @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -55,11 +55,11 @@ public class BlockQuartzLamp extends BlockQuartzGlass if( CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = ( r.nextFloat() - 0.5F ) * 0.96D; - double d1 = ( r.nextFloat() - 0.5F ) * 0.96D; - double d2 = ( r.nextFloat() - 0.5F ) * 0.96D; + final double d0 = ( r.nextFloat() - 0.5F ) * 0.96D; + final double d1 = ( r.nextFloat() - 0.5F ) * 0.96D; + final 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 ); + final 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( fx ); } diff --git a/src/main/java/appeng/block/solids/BlockSkyStone.java b/src/main/java/appeng/block/solids/BlockSkyStone.java index da6d34c1..2bdf8213 100644 --- a/src/main/java/appeng/block/solids/BlockSkyStone.java +++ b/src/main/java/appeng/block/solids/BlockSkyStone.java @@ -78,11 +78,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @SubscribeEvent - public void breakFaster( PlayerEvent.BreakSpeed event ) + public void breakFaster( final PlayerEvent.BreakSpeed event ) { if( event.block == this && event.entityPlayer != null ) { - ItemStack is = event.entityPlayer.inventory.getCurrentItem(); + final ItemStack is = event.entityPlayer.inventory.getCurrentItem(); int level = -1; if( is != null && is.getItem() != null ) @@ -98,13 +98,13 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public int damageDropped( int meta ) + public int damageDropped( final int meta ) { return meta; } @Override - public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player ) + public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player ) { final ItemStack is = super.getPickBlock( target, world, x, y, z, player ); is.setItemDamage( world.getBlockMetadata( x, y, z ) ); @@ -113,7 +113,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public void onBlockAdded( World w, int x, int y, int z ) + public void onBlockAdded( final World w, final int x, final int y, final int z ) { super.onBlockAdded( w, x, y, z ); if( Platform.isServer() ) @@ -140,7 +140,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { @@ -162,7 +162,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock @Override @SideOnly( Side.CLIENT ) - public void registerBlockIcons( IIconRegister ir ) + public void registerBlockIcons( final IIconRegister ir ) { super.registerBlockIcons( ir ); this.block = ir.registerIcon( this.getTextureName() + ".Block" ); @@ -172,7 +172,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock @Override @SideOnly( Side.CLIENT ) - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { if( metadata == 1 ) { @@ -190,14 +190,14 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public void setRenderStateByMeta( int metadata ) + public void setRenderStateByMeta( final int metadata ) { this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) ); } @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getCheckedSubBlocks( item, tabs, itemStacks ); @@ -207,7 +207,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public void breakBlock( World w, int x, int y, int z, Block b, int metadata ) + public void breakBlock( final World w, final int x, final int y, final int z, final Block b, final int metadata ) { super.breakBlock( w, x, y, z, b, metadata ); if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/solids/OreQuartz.java b/src/main/java/appeng/block/solids/OreQuartz.java index 0b2405fd..910ec2f4 100644 --- a/src/main/java/appeng/block/solids/OreQuartz.java +++ b/src/main/java/appeng/block/solids/OreQuartz.java @@ -63,7 +63,7 @@ public class OreQuartz extends AEBaseBlock } @Override - public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 ) + public int getMixedBrightnessForBlock( final IBlockAccess par1iBlockAccess, final int par2, final int par3, final int par4 ) { int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 ); if( this.enhanceBrightness ) @@ -89,16 +89,16 @@ public class OreQuartz extends AEBaseBlock } @Override - public int quantityDropped( Random rand ) + public int quantityDropped( final Random rand ) { return 1 + rand.nextInt( 2 ); } @Nullable @Override - public Item getItemDropped( int id, Random rand, int meta ) + public Item getItemDropped( final int id, final Random rand, final int meta ) { - for( Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() ) + for( final Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() ) { return crystalItem; } @@ -107,22 +107,22 @@ 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( final World w, final int x, final int y, final int z, final int blockID, final float something, final int meta ) { super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta ); if( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) ) { - int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); + final int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); this.dropXpOnBlockBreak( w, x, y, z, xp ); } } @Override - public int damageDropped( int id ) + public int damageDropped( final int id ) { - for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() ) + for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() ) { return crystalStack.getItemDamage(); } @@ -131,7 +131,7 @@ public class OreQuartz extends AEBaseBlock } @Override - public int quantityDroppedWithBonus( int fortune, Random rand ) + public int quantityDroppedWithBonus( final int fortune, final Random rand ) { if( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) ) { @@ -150,17 +150,17 @@ public class OreQuartz extends AEBaseBlock } } - public void setBoostBrightnessLow( int boostBrightnessLow ) + public void setBoostBrightnessLow( final int boostBrightnessLow ) { this.boostBrightnessLow = boostBrightnessLow; } - public void setBoostBrightnessHigh( int boostBrightnessHigh ) + public void setBoostBrightnessHigh( final int boostBrightnessHigh ) { this.boostBrightnessHigh = boostBrightnessHigh; } - public void setEnhanceBrightness( boolean enhanceBrightness ) + public void setEnhanceBrightness( final boolean enhanceBrightness ) { this.enhanceBrightness = enhanceBrightness; } diff --git a/src/main/java/appeng/block/solids/OreQuartzCharged.java b/src/main/java/appeng/block/solids/OreQuartzCharged.java index 1b805e38..0019932c 100644 --- a/src/main/java/appeng/block/solids/OreQuartzCharged.java +++ b/src/main/java/appeng/block/solids/OreQuartzCharged.java @@ -49,9 +49,9 @@ public class OreQuartzCharged extends OreQuartz @Nullable @Override - public Item getItemDropped( int id, Random rand, int meta ) + public Item getItemDropped( final int id, final Random rand, final int meta ) { - for( Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() ) + for( final Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() ) { return charged; } @@ -60,9 +60,9 @@ public class OreQuartzCharged extends OreQuartz } @Override - public int damageDropped( int id ) + public int damageDropped( final int id ) { - for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() ) + for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() ) { return crystalStack.getItemDamage(); } @@ -72,7 +72,7 @@ public class OreQuartzCharged extends OreQuartz @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World w, int x, int y, int z, Random r ) + public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -110,7 +110,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 ); + final ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java index b3a1b6b1..6bbb565e 100644 --- a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java +++ b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java @@ -64,45 +64,45 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { } @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { return Arrays.asList( new AxisAlignedBB[] {} );// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) // } ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); } @Override - public boolean canPlaceBlockAt( World world, int x, int y, int z ) + public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z ) { return false; } @Override - public void onBlockExploded( World world, int x, int y, int z, Explosion explosion ) + public void onBlockExploded( final World world, final int x, final int y, final int z, final Explosion explosion ) { // Don't explode. } @Override - public boolean canEntityDestroy( IBlockAccess world, int x, int y, int z, Entity entity ) + public boolean canEntityDestroy( final IBlockAccess world, final int x, final int y, final int z, final Entity entity ) { return false; } diff --git a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java index 60f456e4..dba06c59 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java @@ -45,9 +45,9 @@ public class BlockSpatialIOPort extends AEBaseTileBlock } @Override - public final void onNeighborBlockChange( World w, int x, int y, int z, Block junk ) + public final void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk ) { - TileSpatialIOPort te = this.getTileEntity( w, x, y, z ); + final TileSpatialIOPort te = this.getTileEntity( w, x, y, z ); if( te != null ) { te.updateRedstoneState(); @@ -55,14 +55,14 @@ public class BlockSpatialIOPort extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileSpatialIOPort tg = this.getTileEntity( w, x, y, z ); + final TileSpatialIOPort tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java index c0b93ca3..4c1582aa 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java @@ -44,9 +44,9 @@ public class BlockSpatialPylon extends AEBaseTileBlock } @Override - public void onNeighborBlockChange( World w, int x, int y, int z, Block junk ) + public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk ) { - TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); + final TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); if( tsp != null ) { tsp.onNeighborBlockChange(); @@ -54,9 +54,9 @@ public class BlockSpatialPylon extends AEBaseTileBlock } @Override - public int getLightValue( IBlockAccess w, int x, int y, int z ) + public int getLightValue( final IBlockAccess w, final int x, final int y, final int z ) { - TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); + final TileSpatialPylon tsp = this.getTileEntity( w, x, y, z ); if( tsp != null ) { return tsp.getLightValue(); diff --git a/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java b/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java index 51dce1b9..1954bf55 100644 --- a/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java +++ b/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class ChiseledQuartzStairBlock extends AEBaseStairBlock { - public ChiseledQuartzStairBlock( Block block ) + public ChiseledQuartzStairBlock( final Block block ) { super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/FluixStairBlock.java b/src/main/java/appeng/block/stair/FluixStairBlock.java index 6d0d5083..15f3aad2 100644 --- a/src/main/java/appeng/block/stair/FluixStairBlock.java +++ b/src/main/java/appeng/block/stair/FluixStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class FluixStairBlock extends AEBaseStairBlock { - public FluixStairBlock( Block block ) + public FluixStairBlock( final Block block ) { super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java b/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java index 886229cf..9d998028 100644 --- a/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java +++ b/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class QuartzPillarStairBlock extends AEBaseStairBlock { - public QuartzPillarStairBlock( Block block ) + public QuartzPillarStairBlock( final Block block ) { super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/QuartzStairBlock.java b/src/main/java/appeng/block/stair/QuartzStairBlock.java index 32a3c287..df8ed6c1 100644 --- a/src/main/java/appeng/block/stair/QuartzStairBlock.java +++ b/src/main/java/appeng/block/stair/QuartzStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class QuartzStairBlock extends AEBaseStairBlock { - public QuartzStairBlock( Block block ) + public QuartzStairBlock( final Block block ) { super( block, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java index 06d0009a..56f208e7 100644 --- a/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class SkyStoneBlockStairBlock extends AEBaseStairBlock { - public SkyStoneBlockStairBlock( Block block, Integer meta ) + public SkyStoneBlockStairBlock( final Block block, final Integer meta ) { super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java index 7e87da11..a904cdc5 100644 --- a/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class SkyStoneBrickStairBlock extends AEBaseStairBlock { - public SkyStoneBrickStairBlock( Block block, Integer meta ) + public SkyStoneBrickStairBlock( final Block block, final Integer meta ) { super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java index cb803188..0987c689 100644 --- a/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class SkyStoneSmallBrickStairBlock extends AEBaseStairBlock { - public SkyStoneSmallBrickStairBlock( Block block, int meta ) + public SkyStoneSmallBrickStairBlock( final Block block, final int meta ) { super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/stair/SkyStoneStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneStairBlock.java index a389019f..7d7234a5 100644 --- a/src/main/java/appeng/block/stair/SkyStoneStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneStairBlock.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class SkyStoneStairBlock extends AEBaseStairBlock { - public SkyStoneStairBlock( Block block, Integer meta ) + public SkyStoneStairBlock( final Block block, final Integer meta ) { super( block, meta, EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); } diff --git a/src/main/java/appeng/block/storage/BlockChest.java b/src/main/java/appeng/block/storage/BlockChest.java index 065f7a7f..6a8e8846 100644 --- a/src/main/java/appeng/block/storage/BlockChest.java +++ b/src/main/java/appeng/block/storage/BlockChest.java @@ -56,9 +56,9 @@ public class BlockChest extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { - TileChest tg = this.getTileEntity( w, x, y, z ); + final TileChest tg = this.getTileEntity( w, x, y, z ); if( tg != null && !p.isSneaking() ) { if( Platform.isClient() ) @@ -72,10 +72,10 @@ public class BlockChest extends AEBaseTileBlock } else { - ItemStack cell = tg.getStackInSlot( 1 ); + final ItemStack cell = tg.getStackInSlot( 1 ); if( cell != null ) { - ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); tg.openGui( p, ch, cell, side ); } diff --git a/src/main/java/appeng/block/storage/BlockDrive.java b/src/main/java/appeng/block/storage/BlockDrive.java index 83ec375b..dce71d79 100644 --- a/src/main/java/appeng/block/storage/BlockDrive.java +++ b/src/main/java/appeng/block/storage/BlockDrive.java @@ -52,14 +52,14 @@ public class BlockDrive extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileDrive tg = this.getTileEntity( w, x, y, z ); + final TileDrive tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockIOPort.java b/src/main/java/appeng/block/storage/BlockIOPort.java index bb5fabdc..bbf78d59 100644 --- a/src/main/java/appeng/block/storage/BlockIOPort.java +++ b/src/main/java/appeng/block/storage/BlockIOPort.java @@ -45,9 +45,9 @@ public class BlockIOPort extends AEBaseTileBlock } @Override - public final void onNeighborBlockChange( World w, int x, int y, int z, Block junk ) + public final void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk ) { - TileIOPort te = this.getTileEntity( w, x, y, z ); + final TileIOPort te = this.getTileEntity( w, x, y, z ); if( te != null ) { te.updateRedstoneState(); @@ -55,14 +55,14 @@ public class BlockIOPort extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ ) { if( p.isSneaking() ) { return false; } - TileIOPort tg = this.getTileEntity( w, x, y, z ); + final TileIOPort tg = this.getTileEntity( w, x, y, z ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index 0845aa58..8fba6f70 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -68,13 +68,13 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision } @Override - public int damageDropped( int metadata ) + public int damageDropped( final int metadata ) { return metadata; } @Override - public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player ) + public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player ) { final ItemStack is = super.getPickBlock( target, world, x, y, z, player ); is.setItemDamage( world.getBlockMetadata( x, y, z ) ); @@ -90,9 +90,9 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision @Override @SideOnly( Side.CLIENT ) - public IIcon getIcon( int direction, int metadata ) + public IIcon getIcon( final int direction, final int metadata ) { - for( Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() ) + for( final Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() ) { return skyStoneBlock.getIcon( direction, metadata ); } @@ -101,7 +101,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { if( Platform.isServer() ) { @@ -112,13 +112,13 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { } @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getCheckedSubBlocks( item, tabs, itemStacks ); @@ -126,7 +126,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { @@ -137,9 +137,9 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - TileSkyChest sk = this.getTileEntity( w, x, y, z ); + final TileSkyChest sk = this.getTileEntity( w, x, y, z ); ForgeDirection o = ForgeDirection.UNKNOWN; if( sk != null ) @@ -147,16 +147,16 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision o = sk.getUp(); } - double offsetX = o.offsetX == 0 ? 0.06 : 0.0; - double offsetY = o.offsetY == 0 ? 0.06 : 0.0; - double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0; + final double offsetX = o.offsetX == 0 ? 0.06 : 0.0; + final double offsetY = o.offsetY == 0 ? 0.06 : 0.0; + final double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0; - double sc = 0.06; + final double sc = 0.06; return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { out.add( AxisAlignedBB.getBoundingBox( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) ); } diff --git a/src/main/java/appeng/client/ClientHelper.java b/src/main/java/appeng/client/ClientHelper.java index 14d0307e..752d4187 100644 --- a/src/main/java/appeng/client/ClientHelper.java +++ b/src/main/java/appeng/client/ClientHelper.java @@ -92,16 +92,16 @@ public class ClientHelper extends ServerHelper private static final RenderBlocks BLOCK_RENDERER = new RenderBlocks(); @SubscribeEvent - public void postPlayerRender( RenderLivingEvent.Pre p ) + public void postPlayerRender( final RenderLivingEvent.Pre p ) { - PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() ); + final PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() ); if( player != null ) { - AEColor col = player.myColor; + final AEColor col = player.myColor; - float r = 0xff & ( col.mediumVariant >> 16 ); - float g = 0xff & ( col.mediumVariant >> 8 ); - float b = 0xff & ( col.mediumVariant ); + final float r = 0xff & ( col.mediumVariant >> 16 ); + final float g = 0xff & ( col.mediumVariant >> 8 ); + final float b = 0xff & ( col.mediumVariant ); GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f ); } } @@ -126,9 +126,9 @@ public class ClientHelper extends ServerHelper } @Override - public void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk ) + public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk ) { - BaseBlockRender bbr = blk.getRendererInstance().rendererInstance; + final BaseBlockRender bbr = blk.getRendererInstance().rendererInstance; if( bbr.hasTESR() && tile != null ) { ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) ); @@ -140,7 +140,7 @@ public class ClientHelper extends ServerHelper { if( Platform.isClient() ) { - List o = new ArrayList(); + final List o = new ArrayList(); o.add( Minecraft.getMinecraft().thePlayer ); return o; } @@ -151,7 +151,7 @@ public class ClientHelper extends ServerHelper } @Override - public void spawnEffect( EffectType effect, World worldObj, double posX, double posY, double posZ, Object o ) + public void spawnEffect( final EffectType effect, final World worldObj, final double posX, final double posY, final double posZ, final Object o ) { if( AEConfig.instance.enableEffects ) { @@ -180,34 +180,34 @@ public class ClientHelper extends ServerHelper } } - private void spawnAssembler( World worldObj, double posX, double posY, double posZ, Object o ) + private void spawnAssembler( final World worldObj, final double posX, final double posY, final double posZ, final Object o ) { - PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; + final PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; - AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is ); + final AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnVibrant( World w, double x, double y, double z ) + private void spawnVibrant( final World w, final double x, final double y, final double z ) { if( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; - double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; - double d2 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final 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 ); + final VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - private void spawnCrafting( World w, double posX, double posY, double posZ ) + private void spawnCrafting( final World w, final double posX, final double posY, final double posZ ) { - float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond ); + final CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond ); fx.motionX = -x * 0.2; fx.motionY = -y * 0.2; @@ -216,13 +216,13 @@ public class ClientHelper extends ServerHelper Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnEnergy( World w, double posX, double posY, double posZ ) + private void spawnEnergy( final World w, final double posX, final double posY, final double posZ ) { - float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond ); + final EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond ); fx.motionX = -x * 0.1; fx.motionY = -y * 0.1; @@ -231,22 +231,22 @@ public class ClientHelper extends ServerHelper Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnLightning( World worldObj, double posX, double posY, double posZ ) + private void spawnLightning( final World worldObj, final double posX, final double posY, final double posZ ) { - LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnLightningArc( World worldObj, double posX, double posY, double posZ, Vec3 second ) + private void spawnLightningArc( final World worldObj, final double posX, final double posY, final double posZ, final Vec3 second ) { - LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } @Override - public boolean shouldAddParticles( Random r ) + public boolean shouldAddParticles( final Random r ) { - int setting = Minecraft.getMinecraft().gameSettings.particleSetting; + final int setting = Minecraft.getMinecraft().gameSettings.particleSetting; if( setting == 2 ) { return false; @@ -265,11 +265,11 @@ public class ClientHelper extends ServerHelper } @Override - public void doRenderItem( ItemStack itemstack, World w ) + public void doRenderItem( final ItemStack itemstack, final World w ) { if( itemstack != null ) { - EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack ); + final EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack ); entityitem.getEntityItem().stackSize = 1; // set all this stuff and then do shit? meh? @@ -290,7 +290,7 @@ public class ClientHelper extends ServerHelper GL11.glScalef( 1.0f, -1.0f, 0.005f ); // GL11.glScalef( 1.0f , -1.0f, 1.0f ); - Block block = Block.getBlockFromItem( itemstack.getItem() ); + final Block block = Block.getBlockFromItem( itemstack.getItem() ); if( ( itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( block.getRenderType() ) ) ) { GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f ); @@ -298,7 +298,7 @@ public class ClientHelper extends ServerHelper GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f ); } - IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY ); + final IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY ); if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) ) { if( customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D ) ) @@ -333,7 +333,7 @@ public class ClientHelper extends ServerHelper GL11.glScalef( 1.0f, 1.0f, 0.005f ); RenderItem.renderInFrame = false; - FontRenderer fr = Minecraft.getMinecraft().fontRenderer; + final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; if( !ForgeHooksClient.renderInventoryItem( BLOCK_RENDERER, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0 ) ) { ITEM_RENDERER.renderItemIntoGUI( fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false ); @@ -360,8 +360,8 @@ public class ClientHelper extends ServerHelper return super.getRenderMode(); } - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; + final Minecraft mc = Minecraft.getMinecraft(); + final EntityPlayer player = mc.thePlayer; return this.renderModeForPlayer( player ); } @@ -369,19 +369,19 @@ public class ClientHelper extends ServerHelper @Override public void triggerUpdates() { - Minecraft mc = Minecraft.getMinecraft(); + final Minecraft mc = Minecraft.getMinecraft(); if( mc == null || mc.thePlayer == null || mc.theWorld == null ) { return; } - EntityPlayer player = mc.thePlayer; + final EntityPlayer player = mc.thePlayer; - int x = (int) player.posX; - int y = (int) player.posY; - int z = (int) player.posZ; + final int x = (int) player.posX; + final int y = (int) player.posY; + final int z = (int) player.posZ; - int range = 16 * 16; + final int range = 16 * 16; mc.theWorld.markBlockRangeForRenderUpdate( x - range, y - range, z - range, x + range, y + range, z + range ); } @@ -393,16 +393,16 @@ public class ClientHelper extends ServerHelper } @SubscribeEvent - public void wheelEvent( MouseEvent me ) + public void wheelEvent( final MouseEvent me ) { if( me.isCanceled() || me.dwheel == 0 ) { return; } - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; - ItemStack is = player.getHeldItem(); + final Minecraft mc = Minecraft.getMinecraft(); + final EntityPlayer player = mc.thePlayer; + final ItemStack is = player.getHeldItem(); if( is != null && is.getItem() instanceof IMouseWheelItem && player.isSneaking() ) { @@ -411,7 +411,7 @@ public class ClientHelper extends ServerHelper NetworkHandler.instance.sendToServer( new PacketValueConfig( "Item", me.dwheel > 0 ? "WheelUp" : "WheelDown" ) ); me.setCanceled( true ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -419,11 +419,11 @@ public class ClientHelper extends ServerHelper } @SubscribeEvent - public void updateTextureSheet( TextureStitchEvent.Pre ev ) + public void updateTextureSheet( final TextureStitchEvent.Pre ev ) { if( ev.map.getTextureType() == 1 ) { - for( ExtraItemTextures et : ExtraItemTextures.values() ) + for( final ExtraItemTextures et : ExtraItemTextures.values() ) { et.registerIcon( ev.map ); } @@ -431,12 +431,12 @@ public class ClientHelper extends ServerHelper if( ev.map.getTextureType() == 0 ) { - for( ExtraBlockTextures et : ExtraBlockTextures.values() ) + for( final ExtraBlockTextures et : ExtraBlockTextures.values() ) { et.registerIcon( ev.map ); } - for( CableBusTextures cb : CableBusTextures.values() ) + for( final CableBusTextures cb : CableBusTextures.values() ) { cb.registerIcon( ev.map ); } diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index f8fe6a65..84ddb78f 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -96,28 +96,28 @@ public abstract class AEBaseGui extends GuiContainer boolean useNEI = false; private boolean subGui; - public AEBaseGui( Container container ) + public AEBaseGui( final Container container ) { super( container ); this.subGui = switchingGuis; switchingGuis = false; } - protected static String join( Collection toolTip, String delimiter ) + protected static String join( final Collection toolTip, final String delimiter ) { final Joiner joiner = Joiner.on( delimiter ); return joiner.join( toolTip ); } - protected int getQty( GuiButton btn ) + protected int getQty( final GuiButton btn ) { try { - DecimalFormat df = new DecimalFormat( "+#;-#" ); + final DecimalFormat df = new DecimalFormat( "+#;-#" ); return df.parse( btn.displayString ).intValue(); } - catch( ParseException e ) + catch( final ParseException e ) { return 0; } @@ -134,7 +134,7 @@ public abstract class AEBaseGui extends GuiContainer super.initGui(); final List slots = this.getInventorySlots(); - Iterator i = slots.iterator(); + final Iterator i = slots.iterator(); while( i.hasNext() ) { if( i.next() instanceof SlotME ) @@ -143,7 +143,7 @@ public abstract class AEBaseGui extends GuiContainer } } - for( InternalSlotME me : this.meSlots ) + for( final InternalSlotME me : this.meSlots ) { slots.add( new SlotME( me ) ); } @@ -156,22 +156,22 @@ public abstract class AEBaseGui extends GuiContainer } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { super.drawScreen( mouseX, mouseY, btn ); - boolean hasClicked = Mouse.isButtonDown( 0 ); + final boolean hasClicked = Mouse.isButtonDown( 0 ); if( hasClicked && this.myScrollBar != null ) { this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop ); } - for( Object c : this.buttonList ) + for( final Object c : this.buttonList ) { if( c instanceof ITooltip ) { - ITooltip tooltip = (ITooltip) c; - int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition; + final ITooltip tooltip = (ITooltip) c; + final int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition; int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition; if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() ) @@ -183,7 +183,7 @@ public abstract class AEBaseGui extends GuiContainer y = 15; } - String msg = tooltip.getMessage(); + final String msg = tooltip.getMessage(); if( msg != null ) { this.drawTooltip( x + 11, y + 4, 0, msg ); @@ -194,14 +194,14 @@ public abstract class AEBaseGui extends GuiContainer } } - public void drawTooltip( int par2, int par3, int forceWidth, String message ) + public void drawTooltip( final int par2, final int par3, final int forceWidth, final String message ) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glDisable( GL12.GL_RESCALE_NORMAL ); RenderHelper.disableStandardItemLighting(); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); - String[] var4 = message.split( "\n" ); + final String[] var4 = message.split( "\n" ); if( var4.length > 0 ) { @@ -240,14 +240,14 @@ public abstract class AEBaseGui extends GuiContainer this.zLevel = 300.0F; itemRender.zLevel = 300.0F; - int var10 = -267386864; + final int var10 = -267386864; this.drawGradientRect( var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10 ); this.drawGradientRect( var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10 ); this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10 ); this.drawGradientRect( var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10 ); this.drawGradientRect( var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10 ); - int var11 = 1347420415; - int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216; + final int var11 = 1347420415; + final int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216; this.drawGradientRect( var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12 ); this.drawGradientRect( var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12 ); this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11 ); @@ -283,10 +283,10 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected final void drawGuiContainerForegroundLayer( int x, int y ) + protected final void drawGuiContainerForegroundLayer( final int x, final int y ) { - int ox = this.guiLeft; // (width - xSize) / 2; - int oy = this.guiTop; // (height - ySize) / 2; + final int ox = this.guiLeft; // (width - xSize) / 2; + final int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); if( this.myScrollBar != null ) @@ -300,19 +300,19 @@ public abstract class AEBaseGui extends GuiContainer public abstract void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ); @Override - protected final void drawGuiContainerBackgroundLayer( float f, int x, int y ) + protected final void drawGuiContainerBackgroundLayer( final float f, final int x, final int y ) { - int ox = this.guiLeft; // (width - xSize) / 2; - int oy = this.guiTop; // (height - ySize) / 2; + final int ox = this.guiLeft; // (width - xSize) / 2; + final int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); this.drawBG( ox, oy, x, y ); final List slots = this.getInventorySlots(); - for( Slot slot : slots ) + for( final Slot slot : slots ) { if( slot instanceof OptionalSlotFake ) { - OptionalSlotFake fs = (OptionalSlotFake) slot; + final OptionalSlotFake fs = (OptionalSlotFake) slot; if( fs.renderDisabled() ) { if( fs.isEnabled() ) @@ -334,15 +334,15 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) { this.drag_click.clear(); if( btn == 1 ) { - for( Object o : this.buttonList ) + for( final Object o : this.buttonList ) { - GuiButton guibutton = (GuiButton) o; + final GuiButton guibutton = (GuiButton) o; if( guibutton.mousePressed( this.mc, xCoord, yCoord ) ) { super.mouseClicked( xCoord, yCoord, 0 ); @@ -355,19 +355,19 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void mouseClickMove( int x, int y, int c, long d ) + protected void mouseClickMove( final int x, final int y, final int c, final long d ) { - Slot slot = this.getSlot( x, y ); - ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + final Slot slot = this.getSlot( x, y ); + final ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); if( slot instanceof SlotFake && itemstack != null ) { this.drag_click.add( slot ); if( this.drag_click.size() > 1 ) { - for( Slot dr : this.drag_click ) + for( final Slot dr : this.drag_click ) { - PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -379,9 +379,9 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void handleMouseClick( Slot slot, int slotIdx, int ctrlDown, int key ) + protected void handleMouseClick( final Slot slot, final int slotIdx, final int ctrlDown, final int key ) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + final EntityPlayer player = Minecraft.getMinecraft().thePlayer; if( slot instanceof SlotFake ) { @@ -392,7 +392,7 @@ public abstract class AEBaseGui extends GuiContainer return; } - PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); NetworkHandler.instance.sendToServer( p ); return; @@ -409,7 +409,7 @@ public abstract class AEBaseGui extends GuiContainer { NetworkHandler.instance.sendToServer( ( (SlotPatternTerm) slot ).getRequest( key == 1 ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -431,7 +431,7 @@ public abstract class AEBaseGui extends GuiContainer action = ctrlDown == 1 ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM; } - PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); NetworkHandler.instance.sendToServer( p ); return; @@ -455,7 +455,7 @@ public abstract class AEBaseGui extends GuiContainer } ( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack ); - PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); NetworkHandler.instance.sendToServer( p ); return; } @@ -490,7 +490,7 @@ public abstract class AEBaseGui extends GuiContainer if( action != null ) { - PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id ); + final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id ); NetworkHandler.instance.sendToServer( p ); } @@ -528,7 +528,7 @@ public abstract class AEBaseGui extends GuiContainer } else if( player.capabilities.isCreativeMode ) { - IAEItemStack slotItem = ( (SlotME) slot ).getAEStack(); + final IAEItemStack slotItem = ( (SlotME) slot ).getAEStack(); if( slotItem != null ) { action = InventoryAction.CREATIVE_DUPLICATE; @@ -544,7 +544,7 @@ public abstract class AEBaseGui extends GuiContainer if( action != null ) { ( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack ); - PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); NetworkHandler.instance.sendToServer( p ); } @@ -574,7 +574,7 @@ public abstract class AEBaseGui extends GuiContainer // a replica of the weird broken vanilla feature. final List slots = this.getInventorySlots(); - for( Slot inventorySlot : slots ) + for( final Slot inventorySlot : slots ) { if( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, this.dbl_whichItem, true ) ) { @@ -590,15 +590,15 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected boolean checkHotbarKeys( int keyCode ) + protected boolean checkHotbarKeys( final int keyCode ) { - Slot theSlot; + final Slot theSlot; try { theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" ); } - catch( Throwable t ) + catch( final Throwable t ) { return false; } @@ -610,7 +610,7 @@ public abstract class AEBaseGui extends GuiContainer if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() ) { final List slots = this.getInventorySlots(); - for( Slot s : slots ) + for( final Slot s : slots ) { if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() ) { @@ -628,7 +628,7 @@ public abstract class AEBaseGui extends GuiContainer } else { - for( Slot s : slots ) + for( final Slot s : slots ) { if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() ) { @@ -651,10 +651,10 @@ public abstract class AEBaseGui extends GuiContainer this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI ) } - protected Slot getSlot( int mouseX, int mouseY ) + protected Slot getSlot( final int mouseX, final int mouseY ) { final List slots = this.getInventorySlots(); - for( Slot slot : slots ) + for( final Slot slot : slots ) { // isPointInRegion if( this.func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) ) @@ -673,11 +673,11 @@ public abstract class AEBaseGui extends GuiContainer { super.handleMouseInput(); - int i = Mouse.getEventDWheel(); + final int i = Mouse.getEventDWheel(); if( i != 0 && isShiftKeyDown() ) { - int x = Mouse.getEventX() * this.width / this.mc.displayWidth; - int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + final int x = Mouse.getEventX() * this.width / this.mc.displayWidth; + final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; this.mouseWheelEvent( x, y, i / Math.abs( i ) ); } else if( i != 0 && this.myScrollBar != null ) @@ -686,21 +686,21 @@ public abstract class AEBaseGui extends GuiContainer } } - protected void mouseWheelEvent( int x, int y, int wheel ) + protected void mouseWheelEvent( final int x, final int y, final int wheel ) { - Slot slot = this.getSlot( x, y ); + final Slot slot = this.getSlot( x, y ); if( slot instanceof SlotME ) { - IAEItemStack item = ( (SlotME) slot ).getAEStack(); + final IAEItemStack item = ( (SlotME) slot ).getAEStack(); if( item != null ) { ( (AEBaseContainer) this.inventorySlots ).setTargetStack( item ); - InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; - int times = Math.abs( wheel ); + final InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; + final int times = Math.abs( wheel ); final int inventorySize = this.getInventorySlots().size(); for( int h = 0; h < times; h++ ) { - PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -712,13 +712,13 @@ public abstract class AEBaseGui extends GuiContainer return true; } - public void bindTexture( String base, String file ) + public void bindTexture( final String base, final String file ) { - ResourceLocation loc = new ResourceLocation( base, "textures/" + file ); + final ResourceLocation loc = new ResourceLocation( base, "textures/" + file ); this.mc.getTextureManager().bindTexture( loc ); } - protected void drawItem( int x, int y, ItemStack is ) + protected void drawItem( final int x, final int y, final ItemStack is ) { this.zLevel = 100.0F; itemRender.zLevel = 100.0F; @@ -735,7 +735,7 @@ public abstract class AEBaseGui extends GuiContainer this.zLevel = 0.0F; } - protected String getGuiDisplayName( String in ) + protected String getGuiDisplayName( final String in ) { return this.hasCustomInventoryName() ? this.getInventoryName() : in; } @@ -754,16 +754,16 @@ public abstract class AEBaseGui extends GuiContainer return ( (AEBaseContainer) this.inventorySlots ).customName; } - public void a( Slot s ) + public void a( final Slot s ) { this.drawSlot( s ); } - public void drawSlot( Slot s ) + public void drawSlot( final Slot s ) { if( s instanceof SlotME ) { - RenderItem pIR = this.setItemRender( this.aeRenderItem ); + final RenderItem pIR = this.setItemRender( this.aeRenderItem ); try { this.zLevel = 100.0F; @@ -783,7 +783,7 @@ public abstract class AEBaseGui extends GuiContainer this.safeDrawSlot( s ); } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() ); } @@ -794,45 +794,45 @@ public abstract class AEBaseGui extends GuiContainer { try { - ItemStack is = s.getStack(); + final ItemStack is = s.getStack(); if( s instanceof AppEngSlot && ( ( (AppEngSlot) s ).renderIconWithItem() || is == null ) && ( ( (AppEngSlot) s ).shouldDisplay() ) ) { - AppEngSlot aes = (AppEngSlot) s; + final AppEngSlot aes = (AppEngSlot) s; if( aes.getIcon() >= 0 ) { this.bindTexture( "guis/states.png" ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; try { - int uv_y = (int) Math.floor( aes.getIcon() / 16 ); - int uv_x = aes.getIcon() - uv_y * 16; + final int uv_y = (int) Math.floor( aes.getIcon() / 16 ); + final int uv_x = aes.getIcon() - uv_y * 16; GL11.glEnable( GL11.GL_BLEND ); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glEnable( GL11.GL_TEXTURE_2D ); GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - float par1 = aes.xDisplayPosition; - float par2 = aes.yDisplayPosition; - float par3 = uv_x * 16; - float par4 = uv_y * 16; + final float par1 = aes.xDisplayPosition; + final float par2 = aes.yDisplayPosition; + final float par3 = uv_x * 16; + final float par4 = uv_y * 16; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ); - float f1 = 0.00390625F; - float f = 0.00390625F; - float par6 = 16; + final float f1 = 0.00390625F; + final float f = 0.00390625F; + final float par6 = 16; tessellator.addVertexWithUV( par1 + 0, par2 + par6, this.zLevel, ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ); - float par5 = 16; + final float par5 = 16; tessellator.addVertexWithUV( par1 + par5, par2 + par6, this.zLevel, ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ); tessellator.addVertexWithUV( par1 + par5, par2 + 0, this.zLevel, ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ); tessellator.addVertexWithUV( par1 + 0, par2 + 0, this.zLevel, ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ); tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, 1.0f ); tessellator.draw(); } - catch( Exception err ) + catch( final Exception err ) { } GL11.glPopAttrib(); @@ -850,7 +850,7 @@ public abstract class AEBaseGui extends GuiContainer { isValid = ( (SlotRestrictedInput) s ).isValid( is, this.mc.theWorld ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } @@ -884,7 +884,7 @@ public abstract class AEBaseGui extends GuiContainer return; } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() ); } @@ -893,7 +893,7 @@ public abstract class AEBaseGui extends GuiContainer this.safeDrawSlot( s ); } - private RenderItem setItemRender( RenderItem item ) + private RenderItem setItemRender( final RenderItem item ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) ) { @@ -901,7 +901,7 @@ public abstract class AEBaseGui extends GuiContainer } else { - RenderItem ri = itemRender; + final RenderItem ri = itemRender; itemRender = item; return ri; } @@ -912,24 +912,24 @@ public abstract class AEBaseGui extends GuiContainer return true; } - private void safeDrawSlot( Slot s ) + private void safeDrawSlot( final Slot s ) { try { GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s ); } - catch( Exception err ) + catch( final Exception err ) { } } - public void bindTexture( String file ) + public void bindTexture( final String file ) { - ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file ); + final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file ); this.mc.getTextureManager().bindTexture( loc ); } - public void func_146977_a( Slot s ) + public void func_146977_a( final Slot s ) { this.drawSlot( s ); } diff --git a/src/main/java/appeng/client/gui/AEBaseMEGui.java b/src/main/java/appeng/client/gui/AEBaseMEGui.java index 8b04675d..d192fd5d 100644 --- a/src/main/java/appeng/client/gui/AEBaseMEGui.java +++ b/src/main/java/appeng/client/gui/AEBaseMEGui.java @@ -36,28 +36,28 @@ import appeng.core.localization.ButtonToolTips; public abstract class AEBaseMEGui extends AEBaseGui { - public AEBaseMEGui( Container container ) + public AEBaseMEGui( final Container container ) { super( container ); } - public List handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List currentToolTip ) + public List handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip ) { if( stack != null ) { - Slot s = this.getSlot( mouseX, mouseY ); + final Slot s = this.getSlot( mouseX, mouseY ); if( s instanceof SlotME ) { - int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; + final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -97,28 +97,28 @@ public abstract class AEBaseMEGui extends AEBaseGui // Vanilla version... // protected void drawItemStackTooltip(ItemStack stack, int x, int y) @Override - protected void renderToolTip( ItemStack stack, int x, int y ) + protected void renderToolTip( final ItemStack stack, final int x, final int y ) { - Slot s = this.getSlot( x, y ); + final Slot s = this.getSlot( x, y ); if( s instanceof SlotME && stack != null ) { - int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; + final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } if( myStack != null ) { @SuppressWarnings( "unchecked" ) - List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) ) { @@ -134,7 +134,7 @@ public abstract class AEBaseMEGui extends AEBaseGui } else if( stack.stackSize > BigNumber ) { - List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); this.drawTooltip( x, y, 0, join( var4, "\n" ) ); return; diff --git a/src/main/java/appeng/client/gui/GuiNull.java b/src/main/java/appeng/client/gui/GuiNull.java index 743b3c33..e8ac394d 100644 --- a/src/main/java/appeng/client/gui/GuiNull.java +++ b/src/main/java/appeng/client/gui/GuiNull.java @@ -25,18 +25,18 @@ import net.minecraft.inventory.Container; public class GuiNull extends AEBaseGui { - public GuiNull( Container container ) + public GuiNull( final Container container ) { super( container ); } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { } diff --git a/src/main/java/appeng/client/gui/config/AEConfigGui.java b/src/main/java/appeng/client/gui/config/AEConfigGui.java index 34bf74f4..48f46715 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGui.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGui.java @@ -36,16 +36,16 @@ import appeng.core.AppEng; public class AEConfigGui extends GuiConfig { - public AEConfigGui( GuiScreen parent ) + public AEConfigGui( final GuiScreen parent ) { super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance.getFilePath() ) ); } private static List getConfigElements() { - List list = new ArrayList(); + final List list = new ArrayList(); - for( String cat : AEConfig.instance.getCategoryNames() ) + for( final String cat : AEConfig.instance.getCategoryNames() ) { if( cat.equals( "versionchecker" ) ) { @@ -57,14 +57,14 @@ public class AEConfigGui extends GuiConfig continue; } - ConfigCategory cc = AEConfig.instance.getCategory( cat ); + final ConfigCategory cc = AEConfig.instance.getCategory( cat ); if( cc.isChild() ) { continue; } - ConfigElement ce = new ConfigElement( cc ); + final ConfigElement ce = new ConfigElement( cc ); list.add( ce ); } diff --git a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java index a1c66930..620f2d7c 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java @@ -31,7 +31,7 @@ public class AEConfigGuiFactory implements IModGuiFactory { @Override - public void initialize( Minecraft minecraftInstance ) + public void initialize( final Minecraft minecraftInstance ) { } @@ -49,7 +49,7 @@ public class AEConfigGuiFactory implements IModGuiFactory } @Override - public RuntimeOptionGuiHandler getHandlerFor( RuntimeOptionCategoryElement element ) + public RuntimeOptionGuiHandler getHandlerFor( final RuntimeOptionCategoryElement element ) { return null; } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java index 0d984c79..a0243e3d 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java @@ -54,7 +54,7 @@ public class GuiCellWorkbench extends GuiUpgradeable GuiImgButton partition; GuiToggleButton copyMode; - public GuiCellWorkbench( InventoryPlayer inventoryPlayer, TileCellWorkbench te ) + public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te ) { super( new ContainerCellWorkbench( inventoryPlayer, te ) ); this.workbench = (ContainerCellWorkbench) this.inventorySlots; @@ -77,7 +77,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.handleButtonVisibility(); @@ -95,7 +95,7 @@ public class GuiCellWorkbench extends GuiUpgradeable 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 = this.workbench.availableUpgrades() - 8; + final int dx = this.workbench.availableUpgrades() - 8; this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if( dx == 8 ) { @@ -114,7 +114,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 = this.workbench.availableUpgrades() - 16; + final int dx = this.workbench.availableUpgrades() - 16; this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if( dx == 8 ) { @@ -138,10 +138,10 @@ public class GuiCellWorkbench extends GuiUpgradeable this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); boolean hasFuzzy = false; - IInventory inv = this.workbench.getCellUpgradeInventory(); + final IInventory inv = this.workbench.getCellUpgradeInventory(); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - ItemStack is = inv.getStackInSlot( x ); + final ItemStack is = inv.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY ) @@ -172,7 +172,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { try { @@ -190,7 +190,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } else if( btn == this.fuzzyMode ) { - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue(); fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() ); @@ -202,7 +202,7 @@ public class GuiCellWorkbench extends GuiUpgradeable super.actionPerformed( btn ); } } - catch( IOException ignored ) + catch( final IOException ignored ) { } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiChest.java b/src/main/java/appeng/client/gui/implementations/GuiChest.java index 75bb50bf..8c710ba5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiChest.java @@ -37,14 +37,14 @@ public class GuiChest extends AEBaseGui GuiTabButton priority; - public GuiChest( InventoryPlayer inventoryPlayer, TileChest te ) + public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te ) { super( new ContainerChest( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton par1GuiButton ) + protected void actionPerformed( final GuiButton par1GuiButton ) { super.actionPerformed( par1GuiButton ); @@ -63,14 +63,14 @@ public class GuiChest extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/chest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java index 7b157701..bda7aeae 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java @@ -43,7 +43,7 @@ public class GuiCondenser extends AEBaseGui GuiProgressBar pb; GuiImgButton mode; - public GuiCondenser( InventoryPlayer inventoryPlayer, TileCondenser te ) + public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te ) { super( new ContainerCondenser( inventoryPlayer, te ) ); this.cvc = (ContainerCondenser) this.inventorySlots; @@ -51,11 +51,11 @@ public class GuiCondenser extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( this.mode == btn ) { @@ -77,7 +77,7 @@ public class GuiCondenser extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -87,7 +87,7 @@ public class GuiCondenser extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/condenser.png" ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java index ce26a4f4..5e6ab0f5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java @@ -64,7 +64,7 @@ public class GuiCraftAmount extends AEBaseGui private GuiBridge originalGui; @Reflected - public GuiCraftAmount( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftAmount( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftAmount( inventoryPlayer, te ) ); } @@ -74,10 +74,10 @@ public class GuiCraftAmount extends AEBaseGui { super.initGui(); - int a = AEConfig.instance.craftItemsByStackAmounts( 0 ); - int b = AEConfig.instance.craftItemsByStackAmounts( 1 ); - int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); - int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); + final int a = AEConfig.instance.craftItemsByStackAmounts( 0 ); + final int b = AEConfig.instance.craftItemsByStackAmounts( 1 ); + final int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); + final int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) ); @@ -92,13 +92,13 @@ public class GuiCraftAmount extends AEBaseGui this.buttonList.add( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) ); ItemStack myIcon = null; - Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); + final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); if( target instanceof WirelessTerminalGuiObject ) { - for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) { myIcon = wirelessTerminalStack; } @@ -108,7 +108,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartTerminal ) { - for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -117,7 +117,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartCraftingTerminal ) { - for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -126,7 +126,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartPatternTerminal ) { - for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -148,13 +148,13 @@ public class GuiCraftAmount extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal(); @@ -166,7 +166,7 @@ public class GuiCraftAmount extends AEBaseGui Long.parseLong( this.amountToCraft.getText() ); this.next.enabled = this.amountToCraft.getText().length() > 0; } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { this.next.enabled = false; } @@ -175,7 +175,7 @@ public class GuiCraftAmount extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -206,13 +206,13 @@ public class GuiCraftAmount extends AEBaseGui out = "0"; } - long result = Long.parseLong( out ); + final long result = Long.parseLong( out ); if( result < 0 ) { this.amountToCraft.setText( "1" ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // :P } @@ -225,7 +225,7 @@ public class GuiCraftAmount extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -242,14 +242,14 @@ public class GuiCraftAmount extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.amountToCraft.setText( "1" ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -257,7 +257,7 @@ public class GuiCraftAmount extends AEBaseGui } } - private void addQty( int i ) + private void addQty( final int i ) { try { @@ -297,7 +297,7 @@ public class GuiCraftAmount extends AEBaseGui Integer.parseInt( out ); this.amountToCraft.setText( out ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // :P } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java index 530445fa..e5997213 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java @@ -74,7 +74,7 @@ public class GuiCraftConfirm extends AEBaseGui GuiButton selectCPU; int tooltip = -1; - public GuiCraftConfirm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftConfirm( inventoryPlayer, te ) ); this.xSize = 238; @@ -131,25 +131,25 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.updateCPUButtonText(); this.start.enabled = !( this.ccc.noCPU || this.isSimulation() ); this.selectCPU.enabled = !this.isSimulation(); - int gx = ( this.width - this.xSize ) / 2; - int gy = ( this.height - this.ySize ) / 2; + final int gx = ( this.width - this.xSize ) / 2; + final int gy = ( this.height - this.ySize ) / 2; this.tooltip = -1; - int offY = 23; + final int offY = 23; int y = 0; int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * offY; + final int minX = gx + 9 + x * 67; + final int minY = gy + 22 + y * offY; if( minX < mouseX && minX + 67 > mouseX ) { @@ -179,7 +179,7 @@ public class GuiCraftConfirm extends AEBaseGui { if( this.ccc.myName.length() > 0 ) { - String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); + final String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name; } else @@ -202,11 +202,11 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - long BytesUsed = this.ccc.bytesUsed; - String byteUsed = NumberFormat.getInstance().format( BytesUsed ); - String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal(); + final long BytesUsed = this.ccc.bytesUsed; + final String byteUsed = NumberFormat.getInstance().format( BytesUsed ); + final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal(); this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 ); String dsp = null; @@ -220,36 +220,36 @@ public class GuiCraftConfirm extends AEBaseGui dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A"; } - int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2; + final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2; this.fontRendererObj.drawString( dsp, offset, 165, 4210752 ); - int sectionLength = 67; + final int sectionLength = 67; int x = 0; int y = 0; - int xo = 9; - int yo = 22; - int viewStart = this.myScrollBar.getCurrentScroll() * 3; - int viewEnd = viewStart + 3 * this.rows; + final int xo = 9; + final int yo = 22; + final int viewStart = this.myScrollBar.getCurrentScroll() * 3; + final int viewEnd = viewStart + 3 * this.rows; String dspToolTip = ""; - List lineList = new LinkedList(); + final List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; - int offY = 23; + final int offY = 23; for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ ) { - IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); + final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); GL11.glScaled( 0.5, 0.5, 0.5 ); - IAEItemStack stored = this.storage.findPrecise( refStack ); - IAEItemStack pendingStack = this.pending.findPrecise( refStack ); - IAEItemStack missingStack = this.missing.findPrecise( refStack ); + final IAEItemStack stored = this.storage.findPrecise( refStack ); + final IAEItemStack pendingStack = this.pending.findPrecise( refStack ); + final IAEItemStack missingStack = this.missing.findPrecise( refStack ); int lines = 0; @@ -266,7 +266,7 @@ public class GuiCraftConfirm extends AEBaseGui lines++; } - int negY = ( ( lines - 1 ) * 5 ) / 2; + final int negY = ( ( lines - 1 ) * 5 ) / 2; int downY = 0; if( stored != null && stored.getStackSize() > 0 ) @@ -282,7 +282,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.FromStorage.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -307,7 +307,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.Missing.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -332,7 +332,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.ToCraft.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -342,10 +342,10 @@ public class GuiCraftConfirm extends AEBaseGui } GL11.glPopMatrix(); - int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19; - int posY = y * offY + yo; + final int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19; + final int posY = y * offY + yo; - ItemStack is = refStack.copy().getItemStack(); + final ItemStack is = refStack.copy().getItemStack(); if( this.tooltip == z - viewStart ) { @@ -364,8 +364,8 @@ public class GuiCraftConfirm extends AEBaseGui if( red ) { - int startX = x * ( 1 + sectionLength ) + xo; - int startY = posY - 4; + final int startX = x * ( 1 + sectionLength ) + xo; + final int startY = posY - 4; drawRect( startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000 ); } @@ -388,7 +388,7 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.setScrollBar(); this.bindTexture( "guis/craftingreport.png" ); @@ -397,41 +397,41 @@ public class GuiCraftConfirm extends AEBaseGui private void setScrollBar() { - int size = this.visual.size(); + final int size = this.visual.size(); this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 ); this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 ); } - public void postUpdate( List list, byte ref ) + public void postUpdate( final List list, final byte ref ) { switch( ref ) { case 0: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.storage, l ); } break; case 1: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.pending, l ); } break; case 2: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.missing, l ); } break; } - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { - long amt = this.getTotal( l ); + final long amt = this.getTotal( l ); if( amt <= 0 ) { @@ -439,7 +439,7 @@ public class GuiCraftConfirm extends AEBaseGui } else { - IAEItemStack is = this.findVisualStack( l ); + final IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } @@ -447,7 +447,7 @@ public class GuiCraftConfirm extends AEBaseGui this.setScrollBar(); } - private void handleInput( IItemList s, IAEItemStack l ) + private void handleInput( final IItemList s, final IAEItemStack l ) { IAEItemStack a = s.findPrecise( l ); @@ -473,11 +473,11 @@ public class GuiCraftConfirm extends AEBaseGui } } - private long getTotal( IAEItemStack is ) + private long getTotal( final IAEItemStack is ) { - IAEItemStack a = this.storage.findPrecise( is ); - IAEItemStack c = this.pending.findPrecise( is ); - IAEItemStack m = this.missing.findPrecise( is ); + final IAEItemStack a = this.storage.findPrecise( is ); + final IAEItemStack c = this.pending.findPrecise( is ); + final IAEItemStack m = this.missing.findPrecise( is ); long total = 0; @@ -499,12 +499,12 @@ public class GuiCraftConfirm extends AEBaseGui return total; } - private void deleteVisualStack( IAEItemStack l ) + private void deleteVisualStack( final IAEItemStack l ) { - Iterator i = this.visual.iterator(); + final Iterator i = this.visual.iterator(); while( i.hasNext() ) { - IAEItemStack o = i.next(); + final IAEItemStack o = i.next(); if( o.equals( l ) ) { i.remove(); @@ -513,9 +513,9 @@ public class GuiCraftConfirm extends AEBaseGui } } - private IAEItemStack findVisualStack( IAEItemStack l ) + private IAEItemStack findVisualStack( final IAEItemStack l ) { - for( IAEItemStack o : this.visual ) + for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { @@ -523,13 +523,13 @@ public class GuiCraftConfirm extends AEBaseGui } } - IAEItemStack stack = l.copy(); + final IAEItemStack stack = l.copy(); this.visual.add( stack ); return stack; } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -542,11 +542,11 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.selectCPU ) { @@ -554,7 +554,7 @@ public class GuiCraftConfirm extends AEBaseGui { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -571,7 +571,7 @@ public class GuiCraftConfirm extends AEBaseGui { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java index 09bd357f..824d5d4f 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java @@ -92,12 +92,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private GuiButton cancel; private int tooltip = -1; - public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te ) + public GuiCraftingCPU( final InventoryPlayer inventoryPlayer, final Object te ) { this( new ContainerCraftingCPU( inventoryPlayer, te ) ); } - protected GuiCraftingCPU( ContainerCraftingCPU container ) + protected GuiCraftingCPU( final ContainerCraftingCPU container ) { super( container ); this.craftingCpu = container; @@ -115,7 +115,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -125,7 +125,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource { NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -143,14 +143,14 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private void setScrollBar() { - int size = this.visual.size(); + final int size = this.visual.size(); this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT ); this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 ); } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.cancel.enabled = !this.visual.isEmpty(); @@ -164,8 +164,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * offY; + final int minX = gx + 9 + x * 67; + final int minY = gy + 22 + y * offY; if( minX < mouseX && minX + 67 > mouseX ) { @@ -189,7 +189,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ); @@ -208,16 +208,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource final int viewEnd = viewStart + 3 * 6; String dspToolTip = ""; - List lineList = new LinkedList(); + final List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; - int offY = 23; + final int offY = 23; final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE; for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ ) { - IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); + final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); @@ -248,19 +248,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) ) { - int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA; - int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2; - int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2; + final int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA; + final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2; + final int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2; drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor ); } - int negY = ( ( lines - 1 ) * 5 ) / 2; + final int negY = ( ( lines - 1 ) * 5 ) / 2; int downY = 0; if( stored != null && stored.getStackSize() > 0 ) { final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() ); - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR ); if( this.tooltip == z - viewStart ) @@ -300,10 +300,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } GL11.glPopMatrix(); - int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19; - int posY = y * offY + ITEMSTACK_TOP_OFFSET; + final int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19; + final int posY = y * offY + ITEMSTACK_TOP_OFFSET; - ItemStack is = refStack.copy().getItemStack(); + final ItemStack is = refStack.copy().getItemStack(); if( this.tooltip == z - viewStart ) { @@ -339,41 +339,41 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/craftingcpu.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } - public void postUpdate( List list, byte ref ) + public void postUpdate( final List list, final byte ref ) { switch( ref ) { case 0: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.storage, l ); } break; case 1: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.active, l ); } break; case 2: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.pending, l ); } break; } - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { - long amt = this.getTotal( l ); + final long amt = this.getTotal( l ); if( amt <= 0 ) { @@ -381,7 +381,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } else { - IAEItemStack is = this.findVisualStack( l ); + final IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } @@ -389,7 +389,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource this.setScrollBar(); } - private void handleInput( IItemList s, IAEItemStack l ) + private void handleInput( final IItemList s, final IAEItemStack l ) { IAEItemStack a = s.findPrecise( l ); @@ -415,7 +415,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } } - private long getTotal( IAEItemStack is ) + private long getTotal( final IAEItemStack is ) { final IAEItemStack a = this.storage.findPrecise( is ); final IAEItemStack b = this.active.findPrecise( is ); @@ -441,13 +441,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource return total; } - private void deleteVisualStack( IAEItemStack l ) + private void deleteVisualStack( final IAEItemStack l ) { final Iterator i = this.visual.iterator(); while( i.hasNext() ) { - IAEItemStack o = i.next(); + final IAEItemStack o = i.next(); if( o.equals( l ) ) { i.remove(); @@ -456,9 +456,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } } - private IAEItemStack findVisualStack( IAEItemStack l ) + private IAEItemStack findVisualStack( final IAEItemStack l ) { - for( IAEItemStack o : this.visual ) + for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java index 728fcf19..a2db7e8e 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java @@ -59,18 +59,18 @@ public class GuiCraftingStatus extends GuiCraftingCPU GuiBridge originalGui; ItemStack myIcon = null; - public GuiCraftingStatus( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftingStatus( inventoryPlayer, te ) ); this.status = (ContainerCraftingStatus) this.inventorySlots; - Object target = this.status.getTarget(); + final Object target = this.status.getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); if( target instanceof WirelessTerminalGuiObject ) { - for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = wirelessTerminalStack; } @@ -80,7 +80,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartTerminal ) { - for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -89,7 +89,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartCraftingTerminal ) { - for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -98,7 +98,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartPatternTerminal ) { - for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -107,11 +107,11 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.selectCPU ) { @@ -119,7 +119,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -148,7 +148,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.updateCPUButtonText(); super.drawScreen( mouseX, mouseY, btn ); @@ -162,7 +162,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU { if( this.status.myName.length() > 0 ) { - String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) ); + final String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) ); btnTextText = GuiText.CPUs.getLocal() + ": " + name; } else @@ -180,7 +180,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - protected String getGuiDisplayName( String in ) + protected String getGuiDisplayName( final String in ) { return in; // the cup name is on the button } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java index ab2f8f51..6d0b9413 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java @@ -41,22 +41,22 @@ public class GuiCraftingTerm extends GuiMEMonitorable GuiImgButton clearBtn; - public GuiCraftingTerm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) ); this.reservedSpace = 73; } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); if( this.clearBtn == btn ) { Slot s = null; - Container c = this.inventorySlots; - for( Object j : c.inventorySlots ) + final Container c = this.inventorySlots; + for( final Object j : c.inventorySlots ) { if( j instanceof SlotCraftingMatrix ) { @@ -66,7 +66,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable if( s != null ) { - PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -81,7 +81,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiDrive.java b/src/main/java/appeng/client/gui/implementations/GuiDrive.java index 3beeb59b..b50bb947 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiDrive.java +++ b/src/main/java/appeng/client/gui/implementations/GuiDrive.java @@ -37,14 +37,14 @@ public class GuiDrive extends AEBaseGui GuiTabButton priority; - public GuiDrive( InventoryPlayer inventoryPlayer, TileDrive te ) + public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te ) { super( new ContainerDrive( inventoryPlayer, te ) ); this.ySize = 199; } @Override - protected void actionPerformed( GuiButton par1GuiButton ) + protected void actionPerformed( final GuiButton par1GuiButton ) { super.actionPerformed( par1GuiButton ); @@ -63,14 +63,14 @@ public class GuiDrive extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/drive.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index 70e47062..347b7315 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -44,7 +44,7 @@ public class GuiFormationPlane extends GuiUpgradeable GuiTabButton priority; GuiImgButton placeMode; - public GuiFormationPlane( InventoryPlayer inventoryPlayer, PartFormationPlane te ) + public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te ) { super( new ContainerFormationPlane( inventoryPlayer, te ) ); this.ySize = 251; @@ -63,7 +63,7 @@ public class GuiFormationPlane extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -86,11 +86,11 @@ public class GuiFormationPlane extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.priority ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java index 2136dc88..e8c0a531 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java +++ b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java @@ -30,21 +30,21 @@ import appeng.tile.grindstone.TileGrinder; public class GuiGrinder extends AEBaseGui { - public GuiGrinder( InventoryPlayer inventoryPlayer, TileGrinder te ) + public GuiGrinder( final InventoryPlayer inventoryPlayer, final TileGrinder te ) { super( new ContainerGrinder( inventoryPlayer, te ) ); this.ySize = 176; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/grinder.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java index 3f7fe8bb..b0118adf 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java @@ -45,7 +45,7 @@ public class GuiIOPort extends GuiUpgradeable GuiImgButton fullMode; GuiImgButton operationMode; - public GuiIOPort( InventoryPlayer inventoryPlayer, TileIOPort te ) + public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te ) { super( new ContainerIOPort( inventoryPlayer, te ) ); this.ySize = 166; @@ -64,7 +64,7 @@ public class GuiIOPort extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -86,18 +86,18 @@ public class GuiIOPort extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); final IDefinitions definitions = AEApi.instance().definitions(); - for( ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() ) + for( final ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() ) { this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack ); } - for( ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() ) + for( final ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() ) { this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack ); } @@ -110,11 +110,11 @@ public class GuiIOPort extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.fullMode ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java index 5f636610..2d7e0a95 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java @@ -36,7 +36,7 @@ public class GuiInscriber extends AEBaseGui final ContainerInscriber cvc; GuiProgressBar pb; - public GuiInscriber( InventoryPlayer inventoryPlayer, TileInscriber te ) + public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te ) { super( new ContainerInscriber( inventoryPlayer, te ) ); this.cvc = (ContainerInscriber) this.inventorySlots; @@ -59,7 +59,7 @@ public class GuiInscriber extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" ); @@ -68,7 +68,7 @@ public class GuiInscriber extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/inscriber.png" ); this.pb.xPosition = 135 + this.guiLeft; diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterface.java b/src/main/java/appeng/client/gui/implementations/GuiInterface.java index d1273997..ebe200ef 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterface.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterface.java @@ -45,7 +45,7 @@ public class GuiInterface extends GuiUpgradeable GuiImgButton BlockMode; GuiToggleButton interfaceMode; - public GuiInterface( InventoryPlayer inventoryPlayer, IInterfaceHost te ) + public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te ) { super( new ContainerInterface( inventoryPlayer, te ) ); this.ySize = 211; @@ -65,7 +65,7 @@ public class GuiInterface extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( this.BlockMode != null ) { @@ -93,11 +93,11 @@ public class GuiInterface extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.priority ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java index fb1dc120..5cd660e9 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java @@ -67,7 +67,7 @@ public class GuiInterfaceTerminal extends AEBaseGui private boolean refreshList = false; private MEGuiTextField searchField; - public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartInterfaceTerminal te ) + public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te ) { super( new ContainerInterfaceTerminal( inventoryPlayer, te ) ); this.myScrollBar = new GuiScrollbar(); @@ -93,14 +93,14 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - int ex = this.myScrollBar.getCurrentScroll(); + final int ex = this.myScrollBar.getCurrentScroll(); - Iterator o = this.inventorySlots.inventorySlots.iterator(); + final Iterator o = this.inventorySlots.inventorySlots.iterator(); while( o.hasNext() ) { if( o.next() instanceof SlotDisconnected ) @@ -112,10 +112,10 @@ public class GuiInterfaceTerminal extends AEBaseGui int offset = 17; for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) { - Object lineObj = this.lines.get( ex + x ); + final Object lineObj = this.lines.get( ex + x ); if( lineObj instanceof ClientDCInternalInv ) { - ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; + final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; for( int z = 0; z < inv.inv.getSizeInventory(); z++ ) { this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) ); @@ -124,7 +124,7 @@ public class GuiInterfaceTerminal extends AEBaseGui else if( lineObj instanceof String ) { String name = (String) lineObj; - int rows = this.byName.get( name ).size(); + final int rows = this.byName.get( name ).size(); if( rows > 1 ) { name = name + " (" + rows + ')'; @@ -142,7 +142,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) { this.searchField.mouseClicked( xCoord, yCoord, btn ); @@ -156,23 +156,23 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/interfaceterminal.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); int offset = 17; - int ex = this.myScrollBar.getCurrentScroll(); + final int ex = this.myScrollBar.getCurrentScroll(); for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) { - Object lineObj = this.lines.get( ex + x ); + final Object lineObj = this.lines.get( ex + x ); if( lineObj instanceof ClientDCInternalInv ) { - ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; + final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; GL11.glColor4f( 1, 1, 1, 1 ); - int width = inv.inv.getSizeInventory() * 18; + final int width = inv.inv.getSizeInventory() * 18; this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 ); } offset += 18; @@ -185,7 +185,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -205,7 +205,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } } - public void postUpdate( NBTTagCompound in ) + public void postUpdate( final NBTTagCompound in ) { if( in.getBoolean( "clear" ) ) { @@ -213,27 +213,27 @@ public class GuiInterfaceTerminal extends AEBaseGui this.refreshList = true; } - for( Object oKey : in.func_150296_c() ) + for( final Object oKey : in.func_150296_c() ) { - String key = (String) oKey; + final String key = (String) oKey; if( key.startsWith( "=" ) ) { try { - long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); - NBTTagCompound invData = in.getCompoundTag( key ); - ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); + final long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); + final NBTTagCompound invData = in.getCompoundTag( key ); + final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); for( int x = 0; x < current.inv.getSizeInventory(); x++ ) { - String which = Integer.toString( x ); + final String which = Integer.toString( x ); if( invData.hasKey( which ) ) { current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) ); } } } - catch( NumberFormatException ignored ) + catch( final NumberFormatException ignored ) { } } @@ -262,7 +262,7 @@ public class GuiInterfaceTerminal extends AEBaseGui final Set cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase ); final boolean rebuild = cachedSearch.isEmpty(); - for( ClientDCInternalInv entry : this.byId.values() ) + for( final ClientDCInternalInv entry : this.byId.values() ) { // ignore inventory if not doing a full rebuild or cache already marks it as miss. if( !rebuild && !cachedSearch.contains( entry ) ) @@ -276,7 +276,7 @@ public class GuiInterfaceTerminal extends AEBaseGui // Search if the current inventory holds a pattern containing the search term. if( !found && !searchFilterLowerCase.isEmpty() ) { - for( ItemStack itemStack : entry.inv ) + for( final ItemStack itemStack : entry.inv ) { found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase ); if( found ) @@ -306,11 +306,11 @@ public class GuiInterfaceTerminal extends AEBaseGui this.lines.clear(); this.lines.ensureCapacity( this.getMaxRows() ); - for( String n : this.names ) + for( final String n : this.names ) { this.lines.add( n ); - ArrayList clientInventories = new ArrayList(); + final ArrayList clientInventories = new ArrayList(); clientInventories.addAll( this.byName.get( n ) ); Collections.sort( clientInventories ); @@ -320,14 +320,14 @@ public class GuiInterfaceTerminal extends AEBaseGui this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 ); } - private boolean itemStackMatchesSearchTerm( ItemStack itemStack, String searchTerm ) + private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm ) { if( itemStack == null ) { return false; } - NBTTagCompound encodedValue = itemStack.getTagCompound(); + final NBTTagCompound encodedValue = itemStack.getTagCompound(); if( encodedValue == null ) { @@ -336,15 +336,15 @@ public class GuiInterfaceTerminal extends AEBaseGui // Potential later use to filter by input // NBTTagList inTag = encodedValue.getTagList( "in", 10 ); - NBTTagList outTag = encodedValue.getTagList( "out", 10 ); + final NBTTagList outTag = encodedValue.getTagList( "out", 10 ); for( int i = 0; i < outTag.tagCount(); i++ ) { - ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) ); + final ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) ); if( parsedItemStack != null ) { - String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase(); + final String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase(); if( displayName.contains( searchTerm ) ) { return true; @@ -364,14 +364,14 @@ public class GuiInterfaceTerminal extends AEBaseGui * * @return a Set matching a superset of the search term */ - private Set getCacheForSearchTerm( String searchTerm ) + private Set getCacheForSearchTerm( final String searchTerm ) { if( !this.cachedSearches.containsKey( searchTerm ) ) { this.cachedSearches.put( searchTerm, new HashSet() ); } - Set cache = this.cachedSearches.get( searchTerm ); + final Set cache = this.cachedSearches.get( searchTerm ); if( cache.isEmpty() && searchTerm.length() > 1 ) { @@ -392,7 +392,7 @@ public class GuiInterfaceTerminal extends AEBaseGui return this.names.size() + this.byId.size(); } - private ClientDCInternalInv getById( long id, long sortBy, String string ) + private ClientDCInternalInv getById( final long id, final long sortBy, final String string ) { ClientDCInternalInv o = this.byId.get( id ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java index 5f2a5ff5..bb5bdd7a 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java @@ -61,7 +61,7 @@ public class GuiLevelEmitter extends GuiUpgradeable GuiImgButton levelMode; GuiImgButton craftingMode; - public GuiLevelEmitter( InventoryPlayer inventoryPlayer, PartLevelEmitter te ) + public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te ) { super( new ContainerLevelEmitter( inventoryPlayer, te ) ); } @@ -88,10 +88,10 @@ public class GuiLevelEmitter extends GuiUpgradeable this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); - int a = AEConfig.instance.levelByStackAmounts( 0 ); - int b = AEConfig.instance.levelByStackAmounts( 1 ); - int c = AEConfig.instance.levelByStackAmounts( 2 ); - int d = AEConfig.instance.levelByStackAmounts( 3 ); + final int a = AEConfig.instance.levelByStackAmounts( 0 ); + final int b = AEConfig.instance.levelByStackAmounts( 1 ); + final int c = AEConfig.instance.levelByStackAmounts( 2 ); + final int d = AEConfig.instance.levelByStackAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) ); @@ -110,9 +110,9 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; + final boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; // configure enabled status... this.level.setEnabled( notCraftingMode ); @@ -141,7 +141,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); this.level.drawTextBox(); @@ -167,11 +167,11 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.craftingMode ) { @@ -183,8 +183,8 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -192,7 +192,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } } - private void addQty( long i ) + private void addQty( final long i ) { try { @@ -226,19 +226,19 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.level.setText( "0" ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -267,7 +267,7 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiMAC.java b/src/main/java/appeng/client/gui/implementations/GuiMAC.java index ef259879..bbf733a1 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMAC.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMAC.java @@ -37,7 +37,7 @@ public class GuiMAC extends GuiUpgradeable final ContainerMAC container; GuiProgressBar pb; - public GuiMAC( InventoryPlayer inventoryPlayer, TileMolecularAssembler te ) + public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te ) { super( new ContainerMAC( inventoryPlayer, te ) ); this.ySize = 197; @@ -61,14 +61,14 @@ public class GuiMAC extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.setFullMsg( this.container.getCurrentProgress() + "%" ); super.drawFG( offsetX, offsetY, mouseX, mouseY ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.xPosition = 148 + this.guiLeft; this.pb.yPosition = 48 + this.guiTop; diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 7e406634..ebf99710 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -96,12 +96,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi GuiImgButton searchBoxSettings; GuiImgButton terminalStyleBox; - public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) ); } - public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c ) + public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerMEMonitorable c ) { super( c ); @@ -145,9 +145,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } } - public void postUpdate( List list ) + public void postUpdate( final List list ) { - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.repo.postUpdate( is ); } @@ -163,7 +163,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { if( btn == this.craftingStatusBtn ) { @@ -172,13 +172,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if( btn instanceof GuiImgButton ) { - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); - GuiImgButton iBtn = (GuiImgButton) btn; + final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { - Enum cv = iBtn.getCurrentValue(); - Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); + final Enum cv = iBtn.getCurrentValue(); + final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox ) { @@ -194,7 +194,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi { NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -224,13 +224,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi this.maxRows = this.getMaxRows(); this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 ); - boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ); + final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ); - int NEI = hasNEI ? 0 : 0; + final int NEI = hasNEI ? 0 : 0; int top = hasNEI ? 22 : 0; - int magicNumber = 114 + 1; - int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace; + final int magicNumber = 114 + 1; + final int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace; this.rows = (int) Math.floor( extraSpace / 18 ); if( this.rows > this.maxRows ) @@ -274,7 +274,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi this.ySize = magicNumber + this.rows * 18 + this.reservedSpace; // this.guiTop = top; - int unusedSpace = this.height - this.ySize; + final int unusedSpace = this.height - this.ySize; this.guiTop = (int) Math.floor( unusedSpace / ( unusedSpace < 0 ? 3.8f : 2.0f ) ); int offset = this.guiTop + 8; @@ -315,7 +315,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } // Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH ); - Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting ); if( this.isSubGui() ) @@ -329,7 +329,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi CraftingGridOffsetX = Integer.MAX_VALUE; CraftingGridOffsetY = Integer.MAX_VALUE; - for( Object s : this.inventorySlots.inventorySlots ) + for( final Object s : this.inventorySlots.inventorySlots ) { if( s instanceof AppEngSlot ) { @@ -341,7 +341,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix ) { - Slot g = (Slot) s; + final Slot g = (Slot) s; if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 ) { CraftingGridOffsetX = Math.min( CraftingGridOffsetX, g.xDisplayPosition ); @@ -355,16 +355,16 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) { - Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH ) { @@ -391,11 +391,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( this.getBackground() ); - int x_width = 197; + final int x_width = 197; this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 ); if( this.viewCell || ( this instanceof GuiSecurity ) ) @@ -451,13 +451,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE; } - protected void repositionSlot( AppEngSlot s ) + protected void repositionSlot( final AppEngSlot s ) { s.yDisplayPosition = s.defY + this.ySize - 78 - 5; } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -505,7 +505,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.SortByBox != null ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java index 263f66a5..b43afef9 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java @@ -28,7 +28,7 @@ import appeng.container.implementations.ContainerMEPortableCell; public class GuiMEPortableCell extends GuiMEMonitorable { - public GuiMEPortableCell( InventoryPlayer inventoryPlayer, IPortableCell te ) + public GuiMEPortableCell( final InventoryPlayer inventoryPlayer, final IPortableCell te ) { super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, te ) ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index a08db67a..1a986214 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -55,7 +55,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource GuiImgButton units; int tooltip = -1; - public GuiNetworkStatus( InventoryPlayer inventoryPlayer, INetworkTool te ) + public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te ) { super( new ContainerNetworkStatus( inventoryPlayer, te ) ); this.ySize = 153; @@ -66,11 +66,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -89,11 +89,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { - int gx = ( this.width - this.xSize ) / 2; - int gy = ( this.height - this.ySize ) / 2; + final int gx = ( this.width - this.xSize ) / 2; + final int gy = ( this.height - this.ySize ) / 2; this.tooltip = -1; @@ -101,8 +101,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 14 + x * 31; - int minY = gy + 41 + y * 18; + final int minX = gx + 14 + x * 31; + final int minY = gy + 41 + y * 18; if( minX < mouseX && minX + 28 > mouseX ) { @@ -126,9 +126,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; + final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 ); @@ -138,14 +138,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 ); this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 ); - int sectionLength = 30; + final int sectionLength = 30; int x = 0; int y = 0; - int xo = 12; - int yo = 42; - int viewStart = 0;// myScrollBar.getCurrentScroll() * 5; - int viewEnd = viewStart + 5 * 4; + final int xo = 12; + final int yo = 42; + final int viewStart = 0;// myScrollBar.getCurrentScroll() * 5; + final int viewEnd = viewStart + 5 * 4; String toolTip = ""; int toolPosX = 0; @@ -153,7 +153,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource for( int z = viewStart; z < Math.min( viewEnd, this.repo.size() ); z++ ) { - IAEItemStack refStack = this.repo.getReferenceItem( z ); + final IAEItemStack refStack = this.repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); @@ -165,12 +165,12 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource str = Long.toString( refStack.getStackSize() / 1000 ) + 'k'; } - int w = this.fontRendererObj.getStringWidth( str ); + final int w = this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2, 4210752 ); GL11.glPopMatrix(); - int posX = x * sectionLength + xo + sectionLength - 18; - int posY = y * 18 + yo; + final int posX = x * sectionLength + xo + sectionLength - 18; + final int posY = y * 18 + yo; if( this.tooltip == z - viewStart ) { @@ -207,17 +207,17 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/networkstatus.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } - public void postUpdate( List list ) + public void postUpdate( final List list ) { this.repo.clear(); - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.repo.postUpdate( is ); } @@ -228,27 +228,27 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource private void setScrollBar() { - int size = this.repo.size(); + final int size = this.repo.size(); this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 ); this.myScrollBar.setRange( 0, ( size + 4 ) / 5 - this.rows, 1 ); } // @Override - NEI - public List handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List currentToolTip ) + public List handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip ) { if( stack != null ) { - Slot s = this.getSlot( mouseX, mouseY ); + final Slot s = this.getSlot( mouseX, mouseY ); if( s instanceof SlotME ) { IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -265,25 +265,25 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } // Vanilla version... - protected void drawItemStackTooltip( ItemStack stack, int x, int y ) + protected void drawItemStackTooltip( final ItemStack stack, final int x, final int y ) { - Slot s = this.getSlot( x, y ); + final Slot s = this.getSlot( x, y ); if( s instanceof SlotME && stack != null ) { IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } if( myStack != null ) { - List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); while( currentToolTip.size() > 1 ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java index d3aa702c..4012e535 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java @@ -39,14 +39,14 @@ public class GuiNetworkTool extends AEBaseGui GuiToggleButton tFacades; - public GuiNetworkTool( InventoryPlayer inventoryPlayer, INetworkTool te ) + public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te ) { super( new ContainerNetworkTool( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -57,7 +57,7 @@ public class GuiNetworkTool extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -74,7 +74,7 @@ public class GuiNetworkTool extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( this.tFacades != null ) { @@ -86,7 +86,7 @@ public class GuiNetworkTool extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/toolbox.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java index 72b7efa5..db16bdfe 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java @@ -49,7 +49,7 @@ public class GuiPatternTerm extends GuiMEMonitorable GuiImgButton encodeBtn; GuiImgButton clearBtn; - public GuiPatternTerm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiPatternTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) ); this.container = (ContainerPatternTerm) this.inventorySlots; @@ -57,7 +57,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -79,7 +79,7 @@ public class GuiPatternTerm extends GuiMEMonitorable NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); } } - catch( IOException e ) + catch( final IOException e ) { // TODO Auto-generated catch block e.printStackTrace(); @@ -109,7 +109,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( !this.container.craftingMode ) { @@ -137,7 +137,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - protected void repositionSlot( AppEngSlot s ) + protected void repositionSlot( final AppEngSlot s ) { if( s.isPlayerSide() ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiPriority.java b/src/main/java/appeng/client/gui/implementations/GuiPriority.java index 1fd632e4..2c3df6c0 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPriority.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPriority.java @@ -67,7 +67,7 @@ public class GuiPriority extends AEBaseGui GuiBridge OriginalGui; - public GuiPriority( InventoryPlayer inventoryPlayer, IPriorityHost te ) + public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te ) { super( new ContainerPriority( inventoryPlayer, te ) ); } @@ -77,10 +77,10 @@ public class GuiPriority extends AEBaseGui { super.initGui(); - int a = AEConfig.instance.priorityByStacksAmounts( 0 ); - int b = AEConfig.instance.priorityByStacksAmounts( 1 ); - int c = AEConfig.instance.priorityByStacksAmounts( 2 ); - int d = AEConfig.instance.priorityByStacksAmounts( 3 ); + final int a = AEConfig.instance.priorityByStacksAmounts( 0 ); + final int b = AEConfig.instance.priorityByStacksAmounts( 1 ); + final int c = AEConfig.instance.priorityByStacksAmounts( 2 ); + final int d = AEConfig.instance.priorityByStacksAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) ); @@ -93,14 +93,14 @@ public class GuiPriority extends AEBaseGui this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) ); ItemStack myIcon = null; - Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); + final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); final IBlocks blocks = definitions.blocks(); if( target instanceof PartStorageBus ) { - for( ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() ) + for( final ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() ) { myIcon = storageBusStack; } @@ -109,7 +109,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof PartFormationPlane ) { - for( ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() ) + for( final ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() ) { myIcon = formationPlaneStack; } @@ -118,7 +118,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileDrive ) { - for( ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() ) + for( final ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() ) { myIcon = driveStack; } @@ -128,7 +128,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileChest ) { - for( ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() ) + for( final ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() ) { myIcon = chestStack; } @@ -138,7 +138,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileInterface ) { - for( ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() ) + for( final ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() ) { myIcon = interfaceStack; } @@ -148,7 +148,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof PartInterface ) { - for( ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() ) + for( final ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() ) { myIcon = interfaceStack; } @@ -170,13 +170,13 @@ public class GuiPriority extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/priority.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); @@ -185,7 +185,7 @@ public class GuiPriority extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -194,8 +194,8 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -203,7 +203,7 @@ public class GuiPriority extends AEBaseGui } } - private void addQty( int i ) + private void addQty( final int i ) { try { @@ -233,19 +233,19 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.priority.setText( "0" ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( !this.checkHotbarKeys( key ) ) { @@ -274,7 +274,7 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiQNB.java b/src/main/java/appeng/client/gui/implementations/GuiQNB.java index fdc65985..dff70c66 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQNB.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQNB.java @@ -30,21 +30,21 @@ import appeng.tile.qnb.TileQuantumBridge; public class GuiQNB extends AEBaseGui { - public GuiQNB( InventoryPlayer inventoryPlayer, TileQuantumBridge te ) + public GuiQNB( final InventoryPlayer inventoryPlayer, final TileQuantumBridge te ) { super( new ContainerQNB( inventoryPlayer, te ) ); this.ySize = 166; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/chest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java index 7641061a..defb9345 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java @@ -38,7 +38,7 @@ public class GuiQuartzKnife extends AEBaseGui GuiTextField name; - public GuiQuartzKnife( InventoryPlayer inventoryPlayer, QuartzKnifeObj te ) + public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te ) { super( new ContainerQuartzKnife( inventoryPlayer, te ) ); this.ySize = 184; @@ -58,14 +58,14 @@ public class GuiQuartzKnife extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/quartzknife.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); @@ -73,17 +73,17 @@ public class GuiQuartzKnife extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) + protected void keyTyped( final char character, final int key ) { if( this.name.textboxKeyTyped( character, key ) ) { try { - String Out = this.name.getText(); + final String Out = this.name.getText(); ( (ContainerQuartzKnife) this.inventorySlots ).setName( Out ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java index cd53849a..befa6b54 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java @@ -43,7 +43,7 @@ public class GuiSecurity extends GuiMEMonitorable GuiToggleButton build; GuiToggleButton security; - public GuiSecurity( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) ); this.customSortOrder = false; @@ -55,7 +55,7 @@ public class GuiSecurity extends GuiMEMonitorable } @Override - protected void actionPerformed( net.minecraft.client.gui.GuiButton btn ) + protected void actionPerformed( final net.minecraft.client.gui.GuiButton btn ) { super.actionPerformed( btn ); @@ -88,7 +88,7 @@ public class GuiSecurity extends GuiMEMonitorable { NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileSecurity.ToggleOption", toggleSetting.name() ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -100,7 +100,7 @@ public class GuiSecurity extends GuiMEMonitorable { super.initGui(); - int top = this.guiTop + this.ySize - 116; + final int top = this.guiTop + this.ySize - 116; this.buttonList.add( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT.getUnlocalizedName(), SecurityPermissions.INJECT.getUnlocalizedTip() ) ); this.buttonList.add( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT.getUnlocalizedName(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) ); @@ -113,7 +113,7 @@ public class GuiSecurity extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); @@ -122,7 +122,7 @@ public class GuiSecurity extends GuiMEMonitorable @Override protected String getBackground() { - ContainerSecurity cs = (ContainerSecurity) this.inventorySlots; + final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots; this.inject.setState( ( cs.security & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 ); this.extract.setState( ( cs.security & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java index 960cafe7..7de9aafa 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java @@ -32,21 +32,21 @@ import appeng.tile.storage.TileSkyChest; public class GuiSkyChest extends AEBaseGui { - public GuiSkyChest( InventoryPlayer inventoryPlayer, TileSkyChest te ) + public GuiSkyChest( final InventoryPlayer inventoryPlayer, final TileSkyChest te ) { super( new ContainerSkyChest( inventoryPlayer, te ) ); this.ySize = 195; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/skychest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java index 287a8958..ec0a4327 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java @@ -40,7 +40,7 @@ public class GuiSpatialIOPort extends AEBaseGui final ContainerSpatialIOPort container; GuiImgButton units; - public GuiSpatialIOPort( InventoryPlayer inventoryPlayer, TileSpatialIOPort te ) + public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te ) { super( new ContainerSpatialIOPort( inventoryPlayer, te ) ); this.ySize = 199; @@ -48,11 +48,11 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -71,7 +71,7 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 ); this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 ); @@ -83,7 +83,7 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/spatialio.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java index 78654e28..b276a0cb 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java @@ -53,7 +53,7 @@ public class GuiStorageBus extends GuiUpgradeable GuiImgButton partition; GuiImgButton clear; - public GuiStorageBus( InventoryPlayer inventoryPlayer, PartStorageBus te ) + public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te ) { super( new ContainerStorageBus( inventoryPlayer, te ) ); this.ySize = 251; @@ -78,7 +78,7 @@ public class GuiStorageBus extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -106,11 +106,11 @@ public class GuiStorageBus extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); try { @@ -135,7 +135,7 @@ public class GuiStorageBus extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java index e5dcad7d..510f9d69 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java @@ -52,12 +52,12 @@ public class GuiUpgradeable extends AEBaseGui GuiImgButton craftMode; GuiImgButton schedulingMode; - public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te ) + public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te ) { this( new ContainerUpgradeable( inventoryPlayer, te ) ); } - public GuiUpgradeable( ContainerUpgradeable te ) + public GuiUpgradeable( final ContainerUpgradeable te ) { super( te ); this.cvb = te; @@ -93,7 +93,7 @@ public class GuiUpgradeable extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -120,7 +120,7 @@ public class GuiUpgradeable extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.handleButtonVisibility(); @@ -172,11 +172,11 @@ public class GuiUpgradeable extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.redstoneMode ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java index 1b9d8ba4..b63c86ba 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java @@ -37,7 +37,7 @@ public class GuiVibrationChamber extends AEBaseGui final ContainerVibrationChamber cvc; GuiProgressBar pb; - public GuiVibrationChamber( InventoryPlayer inventoryPlayer, TileVibrationChamber te ) + public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te ) { super( new ContainerVibrationChamber( inventoryPlayer, te ) ); this.cvc = (ContainerVibrationChamber) this.inventorySlots; @@ -54,7 +54,7 @@ public class GuiVibrationChamber extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -63,17 +63,17 @@ public class GuiVibrationChamber extends AEBaseGui if( this.cvc.getCurrentProgress() > 0 ) { - int i1 = this.cvc.getCurrentProgress(); + final int i1 = this.cvc.getCurrentProgress(); this.bindTexture( "guis/vibchamber.png" ); GL11.glColor3f( 1, 1, 1 ); - int l = -15; - int k = 25; + final int l = -15; + final int k = 25; this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 ); } } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/vibchamber.png" ); this.pb.xPosition = 99 + this.guiLeft; diff --git a/src/main/java/appeng/client/gui/implementations/GuiWireless.java b/src/main/java/appeng/client/gui/implementations/GuiWireless.java index ded8dd26..f389a815 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWireless.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWireless.java @@ -39,18 +39,18 @@ public class GuiWireless extends AEBaseGui GuiImgButton units; - public GuiWireless( InventoryPlayer inventoryPlayer, TileWireless te ) + public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te ) { super( new ContainerWireless( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -69,27 +69,27 @@ public class GuiWireless extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - ContainerWireless cw = (ContainerWireless) this.inventorySlots; + final ContainerWireless cw = (ContainerWireless) this.inventorySlots; if( cw.range > 0 ) { - String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m"; - String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); + final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m"; + final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); - int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) ); - int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 ); + final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) ); + final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 ); this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); } } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/wireless.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java index c8c40a60..b994a32d 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java @@ -27,7 +27,7 @@ import appeng.api.implementations.guiobjects.IPortableCell; public class GuiWirelessTerm extends GuiMEPortableCell { - public GuiWirelessTerm( InventoryPlayer inventoryPlayer, IPortableCell te ) + public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te ) { super( inventoryPlayer, te ); this.maxRows = Integer.MAX_VALUE; diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index 9b15078f..45e9bd3d 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -62,7 +62,7 @@ public class GuiImgButton extends GuiButton implements ITooltip public String fillVar; private Enum currentValue; - public GuiImgButton( int x, int y, Enum idx, Enum val ) + public GuiImgButton( final int x, final int y, final Enum idx, final Enum val ) { super( 0, 0, 16, "" ); @@ -166,27 +166,27 @@ public class GuiImgButton extends GuiButton implements ITooltip } } - private void registerApp( int iconIndex, Settings setting, Enum val, ButtonToolTips title, Object hint ) + private void registerApp( final int iconIndex, final Settings setting, final Enum val, final ButtonToolTips title, final Object hint ) { - ButtonAppearance a = new ButtonAppearance(); + final ButtonAppearance a = new ButtonAppearance(); a.displayName = title.getUnlocalized(); a.displayValue = (String) ( hint instanceof String ? hint : ( (ButtonToolTips) hint ).getUnlocalized() ); a.index = iconIndex; appearances.put( new EnumPair( setting, val ), a ); } - public void setVisibility( boolean vis ) + public void setVisibility( final boolean vis ) { this.visible = vis; this.enabled = vis; } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { - int iconIndex = this.getIconIndex(); + final int iconIndex = this.getIconIndex(); if( this.halfSize ) { @@ -209,8 +209,8 @@ public class GuiImgButton extends GuiButton implements ITooltip par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( 0, 0, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( 0, 0, uv_x * 16, uv_y * 16, 16, 16 ); @@ -232,8 +232,8 @@ public class GuiImgButton extends GuiButton implements ITooltip par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 ); @@ -247,7 +247,7 @@ public class GuiImgButton extends GuiButton implements ITooltip { if( this.buttonSetting != null && this.currentValue != null ) { - ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); + final ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); if( app == null ) { return 256 - 1; @@ -275,7 +275,7 @@ public class GuiImgButton extends GuiButton implements ITooltip if( this.buttonSetting != null && this.currentValue != null ) { - ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); + final ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); if( buttonAppearance == null ) { return "No Such Message"; @@ -305,7 +305,7 @@ public class GuiImgButton extends GuiButton implements ITooltip } value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" ); - StringBuilder sb = new StringBuilder( value ); + final StringBuilder sb = new StringBuilder( value ); int i = sb.lastIndexOf( "\n" ); if( i <= 0 ) @@ -352,7 +352,7 @@ public class GuiImgButton extends GuiButton implements ITooltip return this.visible; } - public void set( Enum e ) + public void set( final Enum e ) { if( this.currentValue != e ) { @@ -366,7 +366,7 @@ public class GuiImgButton extends GuiButton implements ITooltip final Enum setting; final Enum value; - EnumPair( Enum a, Enum b ) + EnumPair( final Enum a, final Enum b ) { this.setting = a; this.value = b; @@ -379,7 +379,7 @@ public class GuiImgButton extends GuiButton implements ITooltip } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -389,7 +389,7 @@ public class GuiImgButton extends GuiButton implements ITooltip { return false; } - EnumPair other = (EnumPair) obj; + final EnumPair other = (EnumPair) obj; return other.setting == this.setting && other.value == this.value; } } diff --git a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java index 81448c41..95777025 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java +++ b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java @@ -28,16 +28,16 @@ public class GuiNumberBox extends GuiTextField final Class type; - public GuiNumberBox( FontRenderer fontRenderer, int x, int y, int width, int height, Class type ) + public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type ) { super( fontRenderer, x, y, width, height ); this.type = type; } @Override - public void writeText( String selectedText ) + public void writeText( final String selectedText ) { - String original = this.getText(); + final String original = this.getText(); super.writeText( selectedText ); try @@ -55,7 +55,7 @@ public class GuiNumberBox extends GuiTextField Double.parseDouble( this.getText() ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { this.setText( original ); } diff --git a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java index 544e9b95..a6425294 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java @@ -38,12 +38,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip private final String titleName; private String fullMsg; - public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir ) + public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir ) { this( source, texture, posX, posY, u, y, width, height, dir, null ); } - public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir, String title ) + public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir, final String title ) { super( posX, posY, width, "" ); this.source = source; @@ -59,22 +59,22 @@ public class GuiProgressBar extends GuiButton implements ITooltip } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { par1Minecraft.getTextureManager().bindTexture( this.texture ); - int max = this.source.getMaxProgress(); - int current = this.source.getCurrentProgress(); + final int max = this.source.getMaxProgress(); + final int current = this.source.getCurrentProgress(); if( this.layout == Direction.VERTICAL ) { - int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 ); + final int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 ); this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, this.fill_u, this.fill_v + diff, this.width, this.height - diff ); } else { - int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 ); + final int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, this.fill_u + diff, this.fill_v, this.width - diff, this.height ); } @@ -82,7 +82,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip } } - public void setFullMsg( String msg ) + public void setFullMsg( final String msg ) { this.fullMsg = msg; } diff --git a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java index 301b2a08..6de88922 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java @@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource private int minScroll = 0; private int currentScroll = 0; - public void draw( AEBaseGui g ) + public void draw( final AEBaseGui g ) { g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); @@ -48,7 +48,7 @@ public class GuiScrollbar implements IScrollSource } else { - int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange(); + final int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange(); g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 ); } } @@ -63,7 +63,7 @@ public class GuiScrollbar implements IScrollSource return this.displayX; } - public GuiScrollbar setLeft( int v ) + public GuiScrollbar setLeft( final int v ) { this.displayX = v; return this; @@ -74,7 +74,7 @@ public class GuiScrollbar implements IScrollSource return this.displayY; } - public GuiScrollbar setTop( int v ) + public GuiScrollbar setTop( final int v ) { this.displayY = v; return this; @@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource return this.width; } - public GuiScrollbar setWidth( int v ) + public GuiScrollbar setWidth( final int v ) { this.width = v; return this; @@ -96,13 +96,13 @@ public class GuiScrollbar implements IScrollSource return this.height; } - public GuiScrollbar setHeight( int v ) + public GuiScrollbar setHeight( final int v ) { this.height = v; return this; } - public void setRange( int min, int max, int pageSize ) + public void setRange( final int min, final int max, final int pageSize ) { this.minScroll = min; this.maxScroll = max; @@ -127,7 +127,7 @@ public class GuiScrollbar implements IScrollSource return this.currentScroll; } - public void click( AEBaseGui aeBaseGui, int x, int y ) + public void click( final AEBaseGui aeBaseGui, final int x, final int y ) { if( this.getRange() == 0 ) { diff --git a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java index 8d557856..8a50c8da 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java @@ -40,7 +40,7 @@ public class GuiTabButton extends GuiButton implements ITooltip private int myIcon = -1; private ItemStack myItem; - public GuiTabButton( int x, int y, int ico, String message, RenderItem ir ) + public GuiTabButton( final int x, final int y, final int ico, final String message, final RenderItem ir ) { super( 0, 0, 16, "" ); @@ -62,7 +62,7 @@ public class GuiTabButton extends GuiButton implements ITooltip * @param message mouse over message * @param ir renderer */ - public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir ) + public GuiTabButton( final int x, final int y, final ItemStack ico, final String message, final RenderItem ir ) { super( 0, 0, 16, "" ); this.xPosition = x; @@ -75,7 +75,7 @@ public class GuiTabButton extends GuiButton implements ITooltip } @Override - public void drawButton( Minecraft minecraft, int x, int y ) + public void drawButton( final Minecraft minecraft, final int x, final int y ) { if( this.visible ) { @@ -85,13 +85,13 @@ public class GuiTabButton extends GuiButton implements ITooltip int uv_x = ( this.hideEdge > 0 ? 11 : 13 ); - int offsetX = this.hideEdge > 0 ? 1 : 0; + final int offsetX = this.hideEdge > 0 ? 1 : 0; this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, 0, 25, 22 ); if( this.myIcon >= 0 ) { - int uv_y = (int) Math.floor( this.myIcon / 16 ); + final int uv_y = (int) Math.floor( this.myIcon / 16 ); uv_x = this.myIcon - uv_y * 16; this.drawTexturedModalRect( offsetX + this.xPosition + 3, this.yPosition + 3, uv_x * 16, uv_y * 16, 16, 16 ); @@ -107,7 +107,7 @@ public class GuiTabButton extends GuiButton implements ITooltip GL11.glEnable( GL11.GL_LIGHTING ); GL11.glEnable( GL12.GL_RESCALE_NORMAL ); RenderHelper.enableGUIStandardItemLighting(); - FontRenderer fontrenderer = minecraft.fontRenderer; + final FontRenderer fontrenderer = minecraft.fontRenderer; this.itemRenderer.renderItemAndEffectIntoGUI( fontrenderer, minecraft.renderEngine, this.myItem, offsetX + this.xPosition + 3, this.yPosition + 3 ); GL11.glDisable( GL11.GL_LIGHTING ); diff --git a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java index d6a1bd11..402e227b 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java @@ -41,7 +41,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip private boolean isActive; - public GuiToggleButton( int x, int y, int on, int off, String displayName, String displayHint ) + public GuiToggleButton( final int x, final int y, final int on, final int off, final String displayName, final String displayHint ) { super( 0, 0, 16, "" ); this.iconIdxOn = on; @@ -54,24 +54,24 @@ public class GuiToggleButton extends GuiButton implements ITooltip this.height = 16; } - public void setState( boolean isOn ) + public void setState( final boolean isOn ) { this.isActive = isOn; } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { - int iconIndex = this.getIconIndex(); + final int iconIndex = this.getIconIndex(); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 ); @@ -102,7 +102,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip } value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" ); - StringBuilder sb = new StringBuilder( value ); + final StringBuilder sb = new StringBuilder( value ); int i = sb.lastIndexOf( "\n" ); if( i <= 0 ) diff --git a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java index a0aeddf8..bff74fe4 100644 --- a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java +++ b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java @@ -50,7 +50,7 @@ public class MEGuiTextField extends GuiTextField * @param width absolute width * @param height absolute height */ - public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height ) + public MEGuiTextField( final FontRenderer fontRenderer, final int xPos, final int yPos, final int width, final int height ) { super( fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - fontRenderer.getCharWidth( '_' ), height - 2 * PADDING ); @@ -61,7 +61,7 @@ public class MEGuiTextField extends GuiTextField } @Override - public void mouseClicked( int xPos, int yPos, int button ) + public void mouseClicked( final int xPos, final int yPos, final int button ) { super.mouseClicked( xPos, yPos, button ); @@ -78,7 +78,7 @@ public class MEGuiTextField extends GuiTextField * * @return true if mouse position is within the text field area */ - public boolean isMouseIn( int xCoord, int yCoord ) + public boolean isMouseIn( final int xCoord, final int yCoord ) { final boolean withinXRange = this._xPos <= xCoord && xCoord < this._xPos + this._width; final boolean withinYRange = this._yPos <= yCoord && yCoord < this._yPos + this._height; diff --git a/src/main/java/appeng/client/me/ClientDCInternalInv.java b/src/main/java/appeng/client/me/ClientDCInternalInv.java index e01dc5eb..a34a0bdd 100644 --- a/src/main/java/appeng/client/me/ClientDCInternalInv.java +++ b/src/main/java/appeng/client/me/ClientDCInternalInv.java @@ -35,7 +35,7 @@ public class ClientDCInternalInv implements Comparable public final long id; public final long sortBy; - public ClientDCInternalInv( int size, long id, long sortBy, String unlocalizedName ) + public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName ) { this.inv = new AppEngInternalInventory( null, size ); this.unlocalizedName = unlocalizedName; @@ -45,7 +45,7 @@ public class ClientDCInternalInv implements Comparable public String getName() { - String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" ); + final String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" ); if( s.equals( this.unlocalizedName + ".name" ) ) { return StatCollector.translateToLocal( this.unlocalizedName ); @@ -54,7 +54,7 @@ public class ClientDCInternalInv implements Comparable } @Override - public int compareTo( @Nonnull ClientDCInternalInv o ) + public int compareTo( @Nonnull final ClientDCInternalInv o ) { return ItemSorters.compareLong( this.sortBy, o.sortBy ); } diff --git a/src/main/java/appeng/client/me/InternalSlotME.java b/src/main/java/appeng/client/me/InternalSlotME.java index 5c91b6c7..ec153edf 100644 --- a/src/main/java/appeng/client/me/InternalSlotME.java +++ b/src/main/java/appeng/client/me/InternalSlotME.java @@ -32,7 +32,7 @@ public class InternalSlotME public final int yPos; private final ItemRepo repo; - public InternalSlotME( ItemRepo def, int offset, int displayX, int displayY ) + public InternalSlotME( final ItemRepo def, final int offset, final int displayX, final int displayY ) { this.repo = def; this.offset = offset; diff --git a/src/main/java/appeng/client/me/ItemRepo.java b/src/main/java/appeng/client/me/ItemRepo.java index 20d74e50..7e539881 100644 --- a/src/main/java/appeng/client/me/ItemRepo.java +++ b/src/main/java/appeng/client/me/ItemRepo.java @@ -63,7 +63,7 @@ public class ItemRepo private String NEIWord = null; private boolean hasPower; - public ItemRepo( IScrollSource src, ISortSource sortSrc ) + public ItemRepo( final IScrollSource src, final ISortSource sortSrc ) { this.src = src; this.sortSrc = sortSrc; @@ -91,14 +91,14 @@ public class ItemRepo return this.dsp.get( idx ); } - void setSearch( String search ) + void setSearch( final String search ) { this.searchString = search == null ? "" : search; } - public void postUpdate( IAEItemStack is ) + public void postUpdate( final IAEItemStack is ) { - IAEItemStack st = this.list.findPrecise( is ); + final IAEItemStack st = this.list.findPrecise( is ); if( st != null ) { @@ -111,7 +111,7 @@ public class ItemRepo } } - public void setViewCell( ItemStack[] list ) + public void setViewCell( final ItemStack[] list ) { this.myPartitionList = ItemViewCell.createFilter( list ); this.updateView(); @@ -125,15 +125,15 @@ public class ItemRepo this.view.ensureCapacity( this.list.size() ); this.dsp.ensureCapacity( this.list.size() ); - Enum viewMode = this.sortSrc.getSortDisplay(); - Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum viewMode = this.sortSrc.getSortDisplay(); + final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if( searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH ) { this.updateNEI( this.searchString ); } this.innerSearch = this.searchString; - boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO; + final boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO; // boolean terminalSearchMods = Configuration.INSTANCE.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO; boolean searchMod = false; @@ -148,13 +148,13 @@ public class ItemRepo { m = Pattern.compile( this.innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE ); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { try { m = Pattern.compile( Pattern.quote( this.innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE ); } - catch( Throwable __ ) + catch( final Throwable __ ) { return; } @@ -187,7 +187,7 @@ public class ItemRepo continue; } - String dspName = searchMod ? Platform.getModId( is ) : Platform.getItemDisplayName( is ); + final String dspName = searchMod ? Platform.getModId( is ) : Platform.getItemDisplayName( is ); notDone = true; if( m.matcher( dspName.toLowerCase() ).find() ) @@ -198,7 +198,7 @@ public class ItemRepo if( terminalSearchToolTips && notDone ) { - for( Object lp : Platform.getTooltip( is ) ) + for( final Object lp : Platform.getTooltip( is ) ) { if( lp instanceof String && m.matcher( (CharSequence) lp ).find() ) { @@ -215,8 +215,8 @@ public class ItemRepo */ } - Enum SortBy = this.sortSrc.getSortBy(); - Enum SortDir = this.sortSrc.getSortDir(); + final Enum SortBy = this.sortSrc.getSortBy(); + final Enum SortDir = this.sortSrc.getSortDir(); ItemSorters.Direction = (appeng.api.config.SortDir) SortDir; ItemSorters.init(); @@ -238,31 +238,31 @@ public class ItemRepo Collections.sort( this.view, ItemSorters.CONFIG_BASED_SORT_BY_NAME ); } - for( IAEItemStack is : this.view ) + for( final IAEItemStack is : this.view ) { this.dsp.add( is.getItemStack() ); } } - private void updateNEI( String filter ) + private void updateNEI( final String filter ) { try { if( this.NEIWord == null || !this.NEIWord.equals( filter ) ) { - Class c = ReflectionHelper.getClass( this.getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); - Field fldSearchField = c.getField( "searchField" ); - Object searchField = fldSearchField.get( c ); + final Class c = ReflectionHelper.getClass( this.getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); + final Field fldSearchField = c.getField( "searchField" ); + final Object searchField = fldSearchField.get( c ); - Method a = searchField.getClass().getMethod( "setText", String.class ); - Method b = searchField.getClass().getMethod( "onTextChange", String.class ); + final Method a = searchField.getClass().getMethod( "setText", String.class ); + final Method b = searchField.getClass().getMethod( "onTextChange", String.class ); this.NEIWord = filter; a.invoke( searchField, filter ); b.invoke( searchField, "" ); } } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -283,7 +283,7 @@ public class ItemRepo return this.hasPower; } - public void setPower( boolean hasPower ) + public void setPower( final boolean hasPower ) { this.hasPower = hasPower; } diff --git a/src/main/java/appeng/client/me/SlotDisconnected.java b/src/main/java/appeng/client/me/SlotDisconnected.java index c0ecf570..ffbb11c2 100644 --- a/src/main/java/appeng/client/me/SlotDisconnected.java +++ b/src/main/java/appeng/client/me/SlotDisconnected.java @@ -33,26 +33,26 @@ public class SlotDisconnected extends AppEngSlot public final ClientDCInternalInv mySlot; - public SlotDisconnected( ClientDCInternalInv me, int which, int x, int y ) + public SlotDisconnected( final ClientDCInternalInv me, final int which, final int x, final int y ) { super( me.inv, which, x, y ); this.mySlot = me; } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @@ -62,11 +62,11 @@ public class SlotDisconnected extends AppEngSlot { if( Platform.isClient() ) { - ItemStack is = super.getStack(); + final ItemStack is = super.getStack(); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ItemStack out = iep.getOutput( is ); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ItemStack out = iep.getOutput( is ); if( out != null ) { return out; @@ -77,7 +77,7 @@ public class SlotDisconnected extends AppEngSlot } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @@ -94,13 +94,13 @@ public class SlotDisconnected extends AppEngSlot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isSlotInInventory( IInventory par1iInventory, int par2 ) + public boolean isSlotInInventory( final IInventory par1iInventory, final int par2 ) { return false; } diff --git a/src/main/java/appeng/client/me/SlotME.java b/src/main/java/appeng/client/me/SlotME.java index 1545c1e5..bff8d7f0 100644 --- a/src/main/java/appeng/client/me/SlotME.java +++ b/src/main/java/appeng/client/me/SlotME.java @@ -32,7 +32,7 @@ public class SlotME extends Slot public final InternalSlotME mySlot; - public SlotME( InternalSlotME me ) + public SlotME( final InternalSlotME me ) { super( null, 0, me.xPos, me.yPos ); this.mySlot = me; @@ -48,12 +48,12 @@ public class SlotME extends Slot } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -79,7 +79,7 @@ public class SlotME extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @@ -91,19 +91,19 @@ public class SlotME extends Slot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isSlotInInventory( IInventory par1iInventory, int par2 ) + public boolean isSlotInInventory( final IInventory par1iInventory, final int par2 ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index 25313be3..a827fcc2 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -49,30 +49,30 @@ public class AppEngRenderItem extends RenderItem public IAEItemStack aeStack; @Override - public void renderItemOverlayIntoGUI( FontRenderer fontRenderer, TextureManager textureManager, ItemStack is, int par4, int par5, String par6Str ) + public void renderItemOverlayIntoGUI( final FontRenderer fontRenderer, final TextureManager textureManager, final ItemStack is, final int par4, final int par5, final String par6Str ) { if( is != null ) { - float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; - float inverseScaleFactor = 1.0f / scaleFactor; - int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1; + final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; + final float inverseScaleFactor = 1.0f / scaleFactor; + final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1; - boolean unicodeFlag = fontRenderer.getUnicodeFlag(); + final boolean unicodeFlag = fontRenderer.getUnicodeFlag(); fontRenderer.setUnicodeFlag( false ); if( is.getItem().showDurabilityBar( is ) ) { - double health = is.getItem().getDurabilityForDisplay( is ); - int j1 = (int) Math.round( 13.0D - health * 13.0D ); - int k = (int) Math.round( 255.0D - health * 255.0D ); + final double health = is.getItem().getDurabilityForDisplay( is ); + final int j1 = (int) Math.round( 13.0D - health * 13.0D ); + final int k = (int) Math.round( 255.0D - health * 255.0D ); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glDisable( GL11.GL_TEXTURE_2D ); GL11.glDisable( GL11.GL_ALPHA_TEST ); GL11.glDisable( GL11.GL_BLEND ); - Tessellator tessellator = Tessellator.instance; - int l = 255 - k << 16 | k << 8; - int i1 = ( 255 - k ) / 4 << 16 | 16128; + final Tessellator tessellator = Tessellator.instance; + final int l = 255 - k << 16 | k << 8; + final int i1 = ( 255 - k ) / 4 << 16 | 16128; this.renderQuad( tessellator, par4 + 2, par5 + 13, 13, 2, 0 ); this.renderQuad( tessellator, par4 + 2, par5 + 13, 12, 1, i1 ); this.renderQuad( tessellator, par4 + 2, par5 + 13, j1, 1, l ); @@ -85,20 +85,20 @@ public class AppEngRenderItem extends RenderItem if( is.stackSize == 0 ) { - String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal(); + final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal(); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glPushMatrix(); GL11.glScaled( scaleFactor, scaleFactor, scaleFactor ); - int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor ); - int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); + final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor ); + final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); fontRenderer.drawStringWithShadow( craftLabelText, X, Y, 16777215 ); GL11.glPopMatrix(); GL11.glEnable( GL11.GL_LIGHTING ); GL11.glEnable( GL11.GL_DEPTH_TEST ); } - long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize; + final long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize; if( amount != 0 ) { final String stackSize = this.getToBeRenderedStackSize( amount ); @@ -107,8 +107,8 @@ public class AppEngRenderItem extends RenderItem GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glPushMatrix(); GL11.glScaled( scaleFactor, scaleFactor, scaleFactor ); - int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor ); - int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); + final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor ); + final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); fontRenderer.drawStringWithShadow( stackSize, X, Y, 16777215 ); GL11.glPopMatrix(); GL11.glEnable( GL11.GL_LIGHTING ); @@ -119,7 +119,7 @@ public class AppEngRenderItem extends RenderItem } } - private void renderQuad( Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6 ) + private void renderQuad( final Tessellator par1Tessellator, final int par2, final int par3, final int par4, final int par5, final int par6 ) { par1Tessellator.startDrawingQuads(); par1Tessellator.setColorOpaque_I( par6 ); @@ -130,7 +130,7 @@ public class AppEngRenderItem extends RenderItem par1Tessellator.draw(); } - private String getToBeRenderedStackSize( long originalSize ) + private String getToBeRenderedStackSize( final long originalSize ) { if( AEConfig.instance.useTerminalUseLargeFont() ) { diff --git a/src/main/java/appeng/client/render/BaseBlockRender.java b/src/main/java/appeng/client/render/BaseBlockRender.java index 35ec7ad9..023cc6e6 100644 --- a/src/main/java/appeng/client/render/BaseBlockRender.java +++ b/src/main/java/appeng/client/render/BaseBlockRender.java @@ -69,7 +69,7 @@ public class BaseBlockRender this( false, 20 ); } - public BaseBlockRender( boolean enableTESR, double renderDistance ) + public BaseBlockRender( final boolean enableTESR, final double renderDistance ) { this.hasTESR = enableTESR; this.renderDistance = renderDistance; @@ -258,7 +258,7 @@ public class BaseBlockRender return this.hasTESR; } - protected int adjustBrightness( int v, double d ) + protected int adjustBrightness( final int v, final double d ) { int r = 0xff & ( v >> 16 ); int g = 0xff & ( v >> 8 ); @@ -280,11 +280,11 @@ public class BaseBlockRender return this.renderDistance; } - public void renderInventory( B block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] data ) + public void renderInventory( final B block, final ItemStack item, final RenderBlocks renderer, final ItemRenderType type, final Object[] data ) { - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; - BlockRenderInfo info = block.getRendererInstance(); + final BlockRenderInfo info = block.getRendererInstance(); if( info.isValid() ) { if( block.hasSubtypes() ) @@ -312,7 +312,7 @@ public class BaseBlockRender renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } - public static int getOrientation( ForgeDirection in, ForgeDirection forward, ForgeDirection up ) + public static int getOrientation( final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up ) { if( in == null || in == ForgeDirection.UNKNOWN // 1 || forward == null || forward == ForgeDirection.UNKNOWN // 2 @@ -321,14 +321,14 @@ public class BaseBlockRender return 0; } - int a = in.ordinal(); - int b = forward.ordinal(); - int c = up.ordinal(); + final int a = in.ordinal(); + final int b = forward.ordinal(); + final int c = up.ordinal(); return ORIENTATION_MAP[a][b][c]; } - public void renderInvBlock( EnumSet sides, B block, ItemStack item, Tessellator tess, int color, RenderBlocks renderer ) + public void renderInvBlock( final EnumSet sides, final B block, final ItemStack item, final Tessellator tess, final int color, final RenderBlocks renderer ) { int meta = 0; if( block != null && block.hasSubtypes() && item != null ) @@ -391,9 +391,9 @@ public class BaseBlockRender } } - public IIcon firstNotNull( IIcon... s ) + public IIcon firstNotNull( final IIcon... s ) { - for( IIcon o : s ) + for( final IIcon o : s ) { if( o != null ) { @@ -403,25 +403,25 @@ public class BaseBlockRender return ExtraBlockTextures.getMissing(); } - public boolean renderInWorld( B block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final B block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { this.preRenderInWorld( block, world, x, y, z, renderer ); - boolean o = renderer.renderStandardBlock( block, x, y, z ); + final boolean o = renderer.renderStandardBlock( block, x, y, z ); this.postRenderInWorld( renderer ); return o; } - public void preRenderInWorld( B block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public void preRenderInWorld( final B block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { - BlockRenderInfo info = block.getRendererInstance(); - IOrientable te = this.getOrientable( block, world, x, y, z ); + final BlockRenderInfo info = block.getRendererInstance(); + final IOrientable te = this.getOrientable( block, world, x, y, z ); if( te != null ) { - ForgeDirection forward = te.getForward(); - ForgeDirection up = te.getUp(); + final ForgeDirection forward = te.getForward(); + final ForgeDirection up = te.getUp(); renderer.uvRotateBottom = info.getTexture( ForgeDirection.DOWN ).setFlip( getOrientation( ForgeDirection.DOWN, forward, up ) ); renderer.uvRotateTop = info.getTexture( ForgeDirection.UP ).setFlip( getOrientation( ForgeDirection.UP, forward, up ) ); @@ -434,29 +434,29 @@ public class BaseBlockRender } } - public void postRenderInWorld( RenderBlocks renderer ) + public void postRenderInWorld( final RenderBlocks renderer ) { renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @Nullable - public IOrientable getOrientable( B block, IBlockAccess w, int x, int y, int z ) + public IOrientable getOrientable( final B block, final IBlockAccess w, final int x, final int y, final int z ) { return block.getOrientable( w, x, y, z ); } - protected void setInvRenderBounds( RenderBlocks renderer, int i, int j, int k, int l, int m, int n ) + protected void setInvRenderBounds( final RenderBlocks renderer, final int i, final int j, final int k, final int l, final int m, final int n ) { renderer.setRenderBounds( i / 16.0, j / 16.0, k / 16.0, l / 16.0, m / 16.0, n / 16.0 ); } - protected void renderBlockBounds( RenderBlocks renderer, + protected void renderBlockBounds( final RenderBlocks renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, - ForgeDirection x, ForgeDirection y, ForgeDirection z ) + final ForgeDirection x, final ForgeDirection y, final ForgeDirection z ) { minX /= 16.0; minY /= 16.0; @@ -500,9 +500,9 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - protected void renderCutoutFace( B block, IIcon ico, int x, int y, int z, RenderBlocks renderer, ForgeDirection orientation, float edgeThickness ) + protected void renderCutoutFace( final B block, final IIcon ico, final int x, final int y, final int z, final RenderBlocks renderer, final ForgeDirection orientation, final float edgeThickness ) { - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; double offsetX = 0.0; double offsetY = 0.0; @@ -565,8 +565,8 @@ public class BaseBlockRender offsetY += y; offsetZ += z; - double layerBX = 0.0; - double layerAY = 0.0; + final double layerBX = 0.0; + final double layerAY = 0.0; this.renderFace( tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, @@ -593,7 +593,7 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - private void renderFace( Tessellator tess, double offsetX, double offsetY, double offsetZ, double ax, double ay, double az, double bx, double by, double bz, double ua, double ub, double va, double vb, IIcon ico, boolean flip ) + private void renderFace( final Tessellator tess, final double offsetX, final double offsetY, final double offsetZ, final double ax, final double ay, final double az, final double bx, final double by, final double bz, final double ua, final double ub, final double va, final double vb, final IIcon ico, final boolean flip ) { if( flip ) { @@ -612,7 +612,7 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - protected void renderFace( int x, int y, int z, B block, IIcon ico, RenderBlocks renderer, ForgeDirection orientation ) + protected void renderFace( final int x, final int y, final int z, final B block, final IIcon ico, final RenderBlocks renderer, final ForgeDirection orientation ) { switch( orientation ) { @@ -639,18 +639,18 @@ public class BaseBlockRender } } - public void selectFace( RenderBlocks renderer, ForgeDirection west, ForgeDirection up, ForgeDirection forward, int u1, int u2, int v1, int v2 ) + public void selectFace( final RenderBlocks renderer, final ForgeDirection west, final ForgeDirection up, final ForgeDirection forward, final int u1, final int u2, int v1, int v2 ) { v1 = 16 - v1; v2 = 16 - v2; - double minX = ( forward.offsetX > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetX, u1 ) + this.mapFaceUV( up.offsetX, v1 ); - double minY = ( forward.offsetY > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetY, u1 ) + this.mapFaceUV( up.offsetY, v1 ); - double minZ = ( forward.offsetZ > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetZ, u1 ) + this.mapFaceUV( up.offsetZ, v1 ); + final double minX = ( forward.offsetX > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetX, u1 ) + this.mapFaceUV( up.offsetX, v1 ); + final double minY = ( forward.offsetY > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetY, u1 ) + this.mapFaceUV( up.offsetY, v1 ); + final double minZ = ( forward.offsetZ > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetZ, u1 ) + this.mapFaceUV( up.offsetZ, v1 ); - double maxX = ( forward.offsetX > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetX, u2 ) + this.mapFaceUV( up.offsetX, v2 ); - double maxY = ( forward.offsetY > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetY, u2 ) + this.mapFaceUV( up.offsetY, v2 ); - double maxZ = ( forward.offsetZ > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetZ, u2 ) + this.mapFaceUV( up.offsetZ, v2 ); + final double maxX = ( forward.offsetX > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetX, u2 ) + this.mapFaceUV( up.offsetX, v2 ); + final double maxY = ( forward.offsetY > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetY, u2 ) + this.mapFaceUV( up.offsetY, v2 ); + final double maxZ = ( forward.offsetZ > 0 ? 1 : 0 ) + this.mapFaceUV( west.offsetZ, u2 ) + this.mapFaceUV( up.offsetZ, v2 ); renderer.renderMinX = Math.max( 0.0, Math.min( minX, maxX ) - ( forward.offsetX != 0 ? 0 : 0.001 ) ); renderer.renderMaxX = Math.min( 1.0, Math.max( minX, maxX ) + ( forward.offsetX != 0 ? 0 : 0.001 ) ); @@ -662,7 +662,7 @@ public class BaseBlockRender renderer.renderMaxZ = Math.min( 1.0, Math.max( minZ, maxZ ) + ( forward.offsetZ != 0 ? 0 : 0.001 ) ); } - private double mapFaceUV( int offset, int uv ) + private double mapFaceUV( final int offset, final int uv ) { if( offset == 0 ) { @@ -677,13 +677,12 @@ public class BaseBlockRender return ( 16.0 - uv ) / 16.0; } - public void renderTile( B block, T tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) + public void renderTile( final B block, final T tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer ) { - renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; - ForgeDirection up = ForgeDirection.UP; - ForgeDirection forward = ForgeDirection.SOUTH; + final ForgeDirection up = ForgeDirection.UP; + final ForgeDirection forward = ForgeDirection.SOUTH; this.applyTESRRotation( x, y, z, forward, up ); Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture ); @@ -714,7 +713,7 @@ public class BaseBlockRender renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; } - protected void applyTESRRotation( double x, double y, double z, ForgeDirection forward, ForgeDirection up ) + protected void applyTESRRotation( final double x, final double y, final double z, ForgeDirection forward, ForgeDirection up ) { if( forward != null && up != null ) { @@ -728,7 +727,7 @@ public class BaseBlockRender up = ForgeDirection.UP; } - ForgeDirection west = Platform.crossProduct( forward, up ); + final ForgeDirection west = Platform.crossProduct( forward, up ); this.rotMat.put( 0, west.offsetX ); this.rotMat.put( 1, west.offsetY ); @@ -759,11 +758,11 @@ public class BaseBlockRender } } - public void doRenderItem( ItemStack itemstack, TileEntity par1EntityItemFrame ) + public void doRenderItem( final ItemStack itemstack, final TileEntity par1EntityItemFrame ) { if( itemstack != null ) { - EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack ); + final EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack ); entityitem.getEntityItem().stackSize = 1; // set all this stuff and then do shit? meh? diff --git a/src/main/java/appeng/client/render/BlockRenderInfo.java b/src/main/java/appeng/client/render/BlockRenderInfo.java index 4c75509d..474303fd 100644 --- a/src/main/java/appeng/client/render/BlockRenderInfo.java +++ b/src/main/java/appeng/client/render/BlockRenderInfo.java @@ -44,12 +44,12 @@ public class BlockRenderInfo private FlippableIcon eastIcon = null; private FlippableIcon westIcon = null; - public BlockRenderInfo( BaseBlockRender inst ) + public BlockRenderInfo( final BaseBlockRender inst ) { this.rendererInstance = inst; } - public void updateIcons( FlippableIcon bottom, FlippableIcon top, FlippableIcon north, FlippableIcon south, FlippableIcon east, FlippableIcon west ) + public void updateIcons( final FlippableIcon bottom, final FlippableIcon top, final FlippableIcon north, final FlippableIcon south, final FlippableIcon east, final FlippableIcon west ) { this.topIcon = top; this.bottomIcon = bottom; @@ -59,7 +59,7 @@ public class BlockRenderInfo this.westIcon = west; } - public void setTemporaryRenderIcon( IIcon icon ) + public void setTemporaryRenderIcon( final IIcon icon ) { if( icon == null ) { @@ -77,7 +77,7 @@ public class BlockRenderInfo } } - public void setTemporaryRenderIcons( IIcon nTopIcon, IIcon nBottomIcon, IIcon nSouthIcon, IIcon nNorthIcon, IIcon nEastIcon, IIcon nWestIcon ) + public void setTemporaryRenderIcons( final IIcon nTopIcon, final IIcon nBottomIcon, final IIcon nSouthIcon, final IIcon nNorthIcon, final IIcon nEastIcon, final IIcon nWestIcon ) { this.tmpTopIcon.setOriginal( nTopIcon == null ? this.getTexture( ForgeDirection.UP ) : nTopIcon ); this.tmpBottomIcon.setOriginal( nBottomIcon == null ? this.getTexture( ForgeDirection.DOWN ) : nBottomIcon ); @@ -88,7 +88,7 @@ public class BlockRenderInfo this.useTmp = true; } - public FlippableIcon getTexture( ForgeDirection dir ) + public FlippableIcon getTexture( final ForgeDirection dir ) { if( this.useTmp ) { diff --git a/src/main/java/appeng/client/render/BusRenderHelper.java b/src/main/java/appeng/client/render/BusRenderHelper.java index 8e97dcb7..a7501f96 100644 --- a/src/main/java/appeng/client/render/BusRenderHelper.java +++ b/src/main/java/appeng/client/render/BusRenderHelper.java @@ -100,14 +100,14 @@ public final class BusRenderHelper implements IPartRenderHelper return this.itemsRendered; } - public void setPass( int pass ) + public void setPass( final int pass ) { this.renderingForPass = 0; this.currentPass = pass; this.itemsRendered = 0; } - public double getBound( ForgeDirection side ) + public double getBound( final ForgeDirection side ) { switch( side ) { @@ -129,16 +129,16 @@ public final class BusRenderHelper implements IPartRenderHelper } } - public void setRenderColor( int color ) + public void setRenderColor( final int color ) { - for( Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) + for( final Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) { final BlockCableBus cableBus = (BlockCableBus) block; cableBus.setRenderColor( color ); } } - public void setOrientation( ForgeDirection dx, ForgeDirection dy, ForgeDirection dz ) + public void setOrientation( final ForgeDirection dx, final ForgeDirection dy, final ForgeDirection dz ) { this.ax = dx == null ? ForgeDirection.EAST : dx; this.ay = dy == null ? ForgeDirection.UP : dy; @@ -150,7 +150,7 @@ public final class BusRenderHelper implements IPartRenderHelper return new double[] { this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ }; } - public void setBounds( double[] bounds ) + public void setBounds( final double[] bounds ) { if( bounds == null || bounds.length != 6 ) { @@ -178,13 +178,13 @@ public final class BusRenderHelper implements IPartRenderHelper private float maxY; private float maxZ; - public BoundBoxCalculator( BusRenderHelper helper ) + public BoundBoxCalculator( final BusRenderHelper helper ) { this.helper = helper; } @Override - public void addBox( double minX, double minY, double minZ, double maxX, double maxY, double maxZ ) + public void addBox( final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ ) { if( this.started ) { @@ -236,7 +236,7 @@ public final class BusRenderHelper implements IPartRenderHelper { @Nullable @Override - public AEBaseBlock apply( Block input ) + public AEBaseBlock apply( final Block input ) { if( input instanceof AEBaseBlock ) { @@ -248,7 +248,7 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void renderForPass( int pass ) + public void renderForPass( final int pass ) { this.renderingForPass = pass; } @@ -266,16 +266,16 @@ public final class BusRenderHelper implements IPartRenderHelper @Override public void normalRendering() { - RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer; + final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer; rbw.calculations = true; rbw.useTextures = true; rbw.enableAO = false; } @Override - public ISimplifiedBundle useSimplifiedRendering( int x, int y, int z, IBoxProvider p, ISimplifiedBundle sim ) + public ISimplifiedBundle useSimplifiedRendering( final int x, final int y, final int z, final IBoxProvider p, final ISimplifiedBundle sim ) { - RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer; + final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer; if( sim != null && this.maybeBlock.isPresent() && rbw.similarLighting( this.maybeBlock.get(), rbw.blockAccess, x, y, z, sim ) ) { @@ -288,7 +288,7 @@ public final class BusRenderHelper implements IPartRenderHelper } else { - boolean allFaces = rbw.renderAllFaces; + final boolean allFaces = rbw.renderAllFaces; rbw.renderAllFaces = true; rbw.calculations = true; rbw.faces.clear(); @@ -334,7 +334,7 @@ public final class BusRenderHelper implements IPartRenderHelper this.bbr.renderBlockBounds( rbw, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); - for( Block block : this.maybeBlock.asSet() ) + for( final Block block : this.maybeBlock.asSet() ) { rbw.renderStandardBlock( block, x, y, z ); } @@ -349,7 +349,7 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void setBounds( float minX, float minY, float minZ, float maxX, float maxY, float maxZ ) + public void setBounds( final float minX, final float minY, final float minZ, final float maxX, final float maxY, final float maxZ ) { this.minX = minX; this.minY = minY; @@ -360,24 +360,24 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void setInvColor( int newColor ) + public void setInvColor( final int newColor ) { this.color = newColor; } @Override - public void setTexture( IIcon ico ) + public void setTexture( final IIcon ico ) { - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { baseBlock.getRendererInstance().setTemporaryRenderIcon( ico ); } } @Override - public void setTexture( IIcon down, IIcon up, IIcon north, IIcon south, IIcon west, IIcon east ) + public void setTexture( final IIcon down, final IIcon up, final IIcon north, final IIcon south, final IIcon west, final IIcon east ) { - IIcon[] list = new IIcon[6]; + final IIcon[] list = new IIcon[6]; list[0] = down; list[1] = up; @@ -386,28 +386,28 @@ public final class BusRenderHelper implements IPartRenderHelper list[4] = west; list[5] = east; - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { baseBlock.getRendererInstance().setTemporaryRenderIcons( list[this.mapRotation( ForgeDirection.UP ).ordinal()], list[this.mapRotation( ForgeDirection.DOWN ).ordinal()], list[this.mapRotation( ForgeDirection.SOUTH ).ordinal()], list[this.mapRotation( ForgeDirection.NORTH ).ordinal()], list[this.mapRotation( ForgeDirection.EAST ).ordinal()], list[this.mapRotation( ForgeDirection.WEST ).ordinal()] ); } } - public ForgeDirection mapRotation( ForgeDirection dir ) + public ForgeDirection mapRotation( final ForgeDirection dir ) { - ForgeDirection forward = this.az; - ForgeDirection up = this.ay; + final ForgeDirection forward = this.az; + final ForgeDirection up = this.ay; if( forward == null || up == null ) { return dir; } - int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; - int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; - int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; + final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; + final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; + final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; ForgeDirection west = ForgeDirection.UNKNOWN; - for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS ) { if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z ) { @@ -446,43 +446,43 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void renderInventoryBox( RenderBlocks renderer ) + public void renderInventoryBox( final RenderBlocks renderer ) { renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { this.bbr.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), baseBlock, null, Tessellator.instance, this.color, renderer ); } } @Override - public void renderInventoryFace( IIcon icon, ForgeDirection face, RenderBlocks renderer ) + public void renderInventoryFace( final IIcon icon, final ForgeDirection face, final RenderBlocks renderer ) { renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); this.setTexture( icon ); - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { this.bbr.renderInvBlock( EnumSet.of( face ), baseBlock, null, Tessellator.instance, this.color, renderer ); } } @Override - public void renderBlock( int x, int y, int z, RenderBlocks renderer ) + public void renderBlock( final int x, final int y, final int z, final RenderBlocks renderer ) { if( !this.renderThis() ) { return; } - for( Block multiPart : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) + for( final Block multiPart : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) { final AEBaseBlock block = (AEBaseBlock) multiPart; - BlockRenderInfo info = block.getRendererInstance(); - ForgeDirection forward = BusRenderHelper.INSTANCE.az; - ForgeDirection up = BusRenderHelper.INSTANCE.ay; + final BlockRenderInfo info = block.getRendererInstance(); + final ForgeDirection forward = BusRenderHelper.INSTANCE.az; + final ForgeDirection up = BusRenderHelper.INSTANCE.ay; renderer.uvRotateBottom = info.getTexture( ForgeDirection.DOWN ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.DOWN, forward, up ) ); renderer.uvRotateTop = info.getTexture( ForgeDirection.UP ).setFlip( BaseBlockRender.getOrientation( ForgeDirection.UP, forward, up ) ); @@ -502,7 +502,7 @@ public final class BusRenderHelper implements IPartRenderHelper @Override public Block getBlock() { - for( Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) + for( final Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) { return block; } @@ -510,33 +510,33 @@ public final class BusRenderHelper implements IPartRenderHelper throw new MissingDefinition( "Tried to access the multi part block without it being defined." ); } - public void prepareBounds( RenderBlocks renderer ) + public void prepareBounds( final RenderBlocks renderer ) { this.bbr.renderBlockBounds( renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); } @Override - public void setFacesToRender( EnumSet faces ) + public void setFacesToRender( final EnumSet faces ) { BusRenderer.INSTANCE.renderer.renderFaces = faces; } @Override - public void renderBlockCurrentBounds( int x, int y, int z, RenderBlocks renderer ) + public void renderBlockCurrentBounds( final int x, final int y, final int z, final RenderBlocks renderer ) { if( !this.renderThis() ) { return; } - for( Block block : this.maybeBlock.asSet() ) + for( final Block block : this.maybeBlock.asSet() ) { renderer.renderStandardBlock( block, x, y, z ); } } @Override - public void renderFaceCutout( int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, RenderBlocks renderer ) + public void renderFaceCutout( final int x, final int y, final int z, final IIcon ico, ForgeDirection face, final float edgeThickness, final RenderBlocks renderer ) { if( !this.renderThis() ) { @@ -569,14 +569,14 @@ public final class BusRenderHelper implements IPartRenderHelper break; } - for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock block : this.maybeBaseBlock.asSet() ) { this.bbr.renderCutoutFace( block, ico, x, y, z, renderer, face, edgeThickness ); } } @Override - public void renderFace( int x, int y, int z, IIcon ico, ForgeDirection face, RenderBlocks renderer ) + public void renderFace( final int x, final int y, final int z, final IIcon ico, ForgeDirection face, final RenderBlocks renderer ) { if( !this.renderThis() ) { @@ -610,7 +610,7 @@ public final class BusRenderHelper implements IPartRenderHelper break; } - for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock block : this.maybeBaseBlock.asSet() ) { this.bbr.renderFace( x, y, z, block, ico, renderer, face ); } diff --git a/src/main/java/appeng/client/render/BusRenderer.java b/src/main/java/appeng/client/render/BusRenderer.java index 227533ef..a5165fd6 100644 --- a/src/main/java/appeng/client/render/BusRenderer.java +++ b/src/main/java/appeng/client/render/BusRenderer.java @@ -54,19 +54,19 @@ public class BusRenderer implements IItemRenderer public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround(); @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return true; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { if( item == null ) { @@ -130,8 +130,8 @@ public class BusRenderer implements IItemRenderer if( item.getItem() instanceof IFacadeItem ) { - IFacadeItem fi = (IFacadeItem) item.getItem(); - IFacadePart fp = fi.createPartFromItemStack( item, ForgeDirection.SOUTH ); + final IFacadeItem fi = (IFacadeItem) item.getItem(); + final IFacadePart fp = fi.createPartFromItemStack( item, ForgeDirection.SOUTH ); if( type == ItemRenderType.EQUIPPED_FIRST_PERSON ) { @@ -146,12 +146,12 @@ public class BusRenderer implements IItemRenderer } else { - IPart ip = this.getRenderer( item, (IPartItem) item.getItem() ); + final IPart ip = this.getRenderer( item, (IPartItem) item.getItem() ); if( ip != null ) { if( type == ItemRenderType.ENTITY ) { - int depth = ip.cableConnectionRenderTo(); + final int depth = ip.cableConnectionRenderTo(); GL11.glTranslatef( 0.0f, 0.0f, -0.04f * ( 8 - depth ) - 0.06f ); } @@ -166,9 +166,9 @@ public class BusRenderer implements IItemRenderer } @Nullable - public IPart getRenderer( ItemStack is, IPartItem c ) + public IPart getRenderer( final ItemStack is, final IPartItem c ) { - int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage(); + final int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage(); IPart part = RENDER_PART.get( id ); if( part == null ) diff --git a/src/main/java/appeng/client/render/CableRenderHelper.java b/src/main/java/appeng/client/render/CableRenderHelper.java index cd36efe3..5ea5bf9f 100644 --- a/src/main/java/appeng/client/render/CableRenderHelper.java +++ b/src/main/java/appeng/client/render/CableRenderHelper.java @@ -45,10 +45,10 @@ public class CableRenderHelper return INSTANCE; } - public void renderStatic( CableBusContainer cableBusContainer, IFacadeContainer iFacadeContainer ) + public void renderStatic( final CableBusContainer cableBusContainer, final IFacadeContainer iFacadeContainer ) { - TileEntity te = cableBusContainer.getTile(); - RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer; + final TileEntity te = cableBusContainer.getTile(); + final RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer; if( renderer.overrideBlockTexture != null ) { @@ -60,9 +60,9 @@ public class CableRenderHelper renderer.blockAccess = Minecraft.getMinecraft().theWorld; } - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { this.setSide( s ); @@ -84,24 +84,24 @@ public class CableRenderHelper /** * snag list of boxes... */ - List boxes = new ArrayList(); - for( ForgeDirection s : ForgeDirection.values() ) + final List boxes = new ArrayList(); + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { this.setSide( s ); - BusRenderHelper brh = BusRenderHelper.INSTANCE; - BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true ); + final BusRenderHelper brh = BusRenderHelper.INSTANCE; + final BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true ); part.getBoxes( bch ); } } boolean useThinFacades = false; - double min = 2.0 / 16.0; - double max = 14.0 / 16.0; + final double min = 2.0 / 16.0; + final double max = 14.0 / 16.0; - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { int o = 0; o += bb.maxX > max ? 1 : 0; @@ -117,15 +117,15 @@ public class CableRenderHelper } } - for( ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) { - IFacadePart fPart = iFacadeContainer.getFacade( s ); + final IFacadePart fPart = iFacadeContainer.getFacade( s ); if( fPart != null ) { fPart.setThinFacades( useThinFacades ); - AxisAlignedBB pb = fPart.getPrimaryBox(); + final AxisAlignedBB pb = fPart.getPrimaryBox(); AxisAlignedBB b = null; - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { if( bb.intersectsWith( pb ) ) { @@ -160,11 +160,11 @@ public class CableRenderHelper } } - private void setSide( ForgeDirection s ) + private void setSide( final ForgeDirection s ) { - ForgeDirection ax; - ForgeDirection ay; - ForgeDirection az; + final ForgeDirection ax; + final ForgeDirection ay; + final ForgeDirection az; switch( s ) { @@ -209,16 +209,16 @@ public class CableRenderHelper BusRenderHelper.INSTANCE.setOrientation( ax, ay, az ); } - public void renderDynamic( CableBusContainer cableBusContainer, double x, double y, double z ) + public void renderDynamic( final CableBusContainer cableBusContainer, final double x, final double y, final double z ) { - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { - ForgeDirection ax; - ForgeDirection ay; - ForgeDirection az; + final ForgeDirection ax; + final ForgeDirection ay; + final ForgeDirection az; switch( s ) { diff --git a/src/main/java/appeng/client/render/ItemRenderer.java b/src/main/java/appeng/client/render/ItemRenderer.java index 69590909..9ab42660 100644 --- a/src/main/java/appeng/client/render/ItemRenderer.java +++ b/src/main/java/appeng/client/render/ItemRenderer.java @@ -31,19 +31,19 @@ public class ItemRenderer implements IItemRenderer public static final ItemRenderer INSTANCE = new ItemRenderer(); @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return true; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); diff --git a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java index d18635b2..467ca2ad 100644 --- a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java +++ b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java @@ -62,7 +62,7 @@ public class RenderBlocksWorkaround extends RenderBlocks { this.fColor = Tessellator.class.getDeclaredField( "color" ); } - catch( Throwable t ) + catch( final Throwable t ) { this.fColor = Tessellator.class.getDeclaredField( "field_78402_m" ); } @@ -70,7 +70,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } return (Integer) this.fColor.get( Tessellator.instance ); } - catch( Throwable t ) + catch( final Throwable t ) { return 0; } @@ -86,7 +86,7 @@ public class RenderBlocksWorkaround extends RenderBlocks { this.fBrightness = Tessellator.class.getDeclaredField( "brightness" ); } - catch( Throwable t ) + catch( final Throwable t ) { this.fBrightness = Tessellator.class.getDeclaredField( "field_78401_l" ); } @@ -94,18 +94,18 @@ public class RenderBlocksWorkaround extends RenderBlocks } return (Integer) this.fBrightness.get( Tessellator.instance ); } - catch( Throwable t ) + catch( final Throwable t ) { return 0; } } - public void setTexture( IIcon ico ) + public void setTexture( final IIcon ico ) { this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico; } - public void setTexture( IIcon rYNeg, IIcon rYPos, IIcon rZNeg, IIcon rZPos, IIcon rXNeg, IIcon rXPos ) + public void setTexture( final IIcon rYNeg, final IIcon rYPos, final IIcon rZNeg, final IIcon rZPos, final IIcon rXNeg, final IIcon rXPos ) { this.lightState.rXPos = rXPos; this.lightState.rXNeg = rXNeg; @@ -115,7 +115,7 @@ public class RenderBlocksWorkaround extends RenderBlocks this.lightState.rZNeg = rZNeg; } - public boolean renderStandardBlockNoCalculations( Block b, int x, int y, int z ) + public boolean renderStandardBlockNoCalculations( final Block b, final int x, final int y, final int z ) { Tessellator.instance.setBrightness( this.lightState.bXPos ); this.restoreAO( this.lightState.aoXPos, this.lightState.foXPos ); @@ -144,7 +144,7 @@ public class RenderBlocksWorkaround extends RenderBlocks return true; } - private void restoreAO( int[] z, float[] c ) + private void restoreAO( final int[] z, final float[] c ) { this.brightnessBottomLeft = z[0]; this.brightnessBottomRight = z[1]; @@ -166,7 +166,7 @@ public class RenderBlocksWorkaround extends RenderBlocks this.colorBlueTopRight = c[11]; } - private void saveAO( int[] z, float[] c ) + private void saveAO( final int[] z, final float[] c ) { z[0] = this.brightnessBottomLeft; z[1] = this.brightnessBottomRight; @@ -189,7 +189,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public boolean renderStandardBlock( Block blk, int x, int y, int z ) + public boolean renderStandardBlock( final Block blk, final int x, final int y, final int z ) { try { @@ -201,12 +201,12 @@ public class RenderBlocksWorkaround extends RenderBlocks else { this.enableAO = this.lightState.isAO; - boolean out = this.renderStandardBlockNoCalculations( blk, x, y, z ); + final boolean out = this.renderStandardBlockNoCalculations( blk, x, y, z ); this.enableAO = false; return out; } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); // meh @@ -215,7 +215,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceYNeg( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceYNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.DOWN ) ) { @@ -226,18 +226,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); - double d11 = par2 + this.renderMinX; - double d12 = par2 + this.renderMaxX; - double d13 = par4 + this.renderMinY; - double d14 = par6 + this.renderMinZ; - double d15 = par6 + this.renderMaxZ; + final double d11 = par2 + this.renderMinX; + final double d12 = par2 + this.renderMaxX; + final double d13 = par4 + this.renderMinY; + final double d14 = par6 + this.renderMinZ; + final double d15 = par6 + this.renderMaxZ; if( this.enableAO ) { @@ -273,7 +273,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceYPos( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceYPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.UP ) ) { @@ -284,18 +284,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( this.renderMinZ * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( this.renderMaxZ * 16.0D ); - double d11 = par2 + this.renderMinX; - double d12 = par2 + this.renderMaxX; - double d13 = par4 + this.renderMaxY; - double d14 = par6 + this.renderMinZ; - double d15 = par6 + this.renderMaxZ; + final double d11 = par2 + this.renderMinX; + final double d12 = par2 + this.renderMaxX; + final double d13 = par4 + this.renderMaxY; + final double d14 = par6 + this.renderMinZ; + final double d15 = par6 + this.renderMaxZ; if( this.enableAO ) { @@ -331,7 +331,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceZNeg( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceZNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.NORTH ) ) { @@ -342,18 +342,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( 16.0D - this.renderMinX * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( 16.0D - this.renderMaxX * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); - double d11 = par2 + this.renderMinX; - double d12 = par2 + this.renderMaxX; - double d13 = par4 + this.renderMinY; - double d14 = par4 + this.renderMaxY; - double d15 = par6 + this.renderMinZ; + final double d11 = par2 + this.renderMinX; + final double d12 = par2 + this.renderMaxX; + final double d13 = par4 + this.renderMinY; + final double d14 = par4 + this.renderMaxY; + final double d15 = par6 + this.renderMinZ; if( this.enableAO ) { @@ -389,7 +389,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceZPos( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceZPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.SOUTH ) ) { @@ -400,18 +400,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( this.renderMinX * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( this.renderMaxX * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); - double d11 = par2 + this.renderMinX; - double d12 = par2 + this.renderMaxX; - double d13 = par4 + this.renderMinY; - double d14 = par4 + this.renderMaxY; - double d15 = par6 + this.renderMaxZ; + final double d11 = par2 + this.renderMinX; + final double d12 = par2 + this.renderMaxX; + final double d13 = par4 + this.renderMinY; + final double d14 = par4 + this.renderMaxY; + final double d15 = par6 + this.renderMaxZ; if( this.enableAO ) { @@ -447,7 +447,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceXNeg( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceXNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.WEST ) ) { @@ -458,18 +458,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( this.renderMinZ * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( this.renderMaxZ * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); - double d11 = par2 + this.renderMinX; - double d12 = par4 + this.renderMinY; - double d13 = par4 + this.renderMaxY; - double d14 = par6 + this.renderMinZ; - double d15 = par6 + this.renderMaxZ; + final double d11 = par2 + this.renderMinX; + final double d12 = par4 + this.renderMinY; + final double d13 = par4 + this.renderMaxY; + final double d14 = par6 + this.renderMinZ; + final double d15 = par6 + this.renderMaxZ; if( this.enableAO ) { @@ -505,7 +505,7 @@ public class RenderBlocksWorkaround extends RenderBlocks } @Override - public void renderFaceXPos( Block par1Block, double par2, double par4, double par6, IIcon par8Icon ) + public void renderFaceXPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon ) { if( this.faces.contains( ForgeDirection.EAST ) ) { @@ -516,18 +516,18 @@ public class RenderBlocksWorkaround extends RenderBlocks if( this.isFacade ) { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; - 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 ); + final double d3 = par8Icon.getInterpolatedU( 16.0D - this.renderMinZ * 16.0D ); + final double d4 = par8Icon.getInterpolatedU( 16.0D - this.renderMaxZ * 16.0D ); + final double d5 = par8Icon.getInterpolatedV( 16.0D - this.renderMaxY * 16.0D ); + final double d6 = par8Icon.getInterpolatedV( 16.0D - this.renderMinY * 16.0D ); - double d11 = par2 + this.renderMaxX; - double d12 = par4 + this.renderMinY; - double d13 = par4 + this.renderMaxY; - double d14 = par6 + this.renderMinZ; - double d15 = par6 + this.renderMaxZ; + final double d11 = par2 + this.renderMaxX; + final double d12 = par4 + this.renderMinY; + final double d13 = par4 + this.renderMaxY; + final double d14 = par6 + this.renderMinZ; + final double d15 = par6 + this.renderMaxZ; if( this.enableAO ) { @@ -562,41 +562,41 @@ public class RenderBlocksWorkaround extends RenderBlocks } } - private void partialLightingColoring( double u, double v ) + private void partialLightingColoring( final double u, final double v ) { - double rA = this.colorRedTopLeft * u + ( 1.0 - u ) * this.colorRedTopRight; - double rB = this.colorRedBottomLeft * u + ( 1.0 - u ) * this.colorRedBottomRight; - float r = (float) ( rA * v + rB * ( 1.0 - v ) ); + final double rA = this.colorRedTopLeft * u + ( 1.0 - u ) * this.colorRedTopRight; + final double rB = this.colorRedBottomLeft * u + ( 1.0 - u ) * this.colorRedBottomRight; + final float r = (float) ( rA * v + rB * ( 1.0 - v ) ); - double gA = this.colorGreenTopLeft * u + ( 1.0 - u ) * this.colorGreenTopRight; - double gB = this.colorGreenBottomLeft * u + ( 1.0 - u ) * this.colorGreenBottomRight; - float g = (float) ( gA * v + gB * ( 1.0 - v ) ); + final double gA = this.colorGreenTopLeft * u + ( 1.0 - u ) * this.colorGreenTopRight; + final double gB = this.colorGreenBottomLeft * u + ( 1.0 - u ) * this.colorGreenBottomRight; + final float g = (float) ( gA * v + gB * ( 1.0 - v ) ); - double bA = this.colorBlueTopLeft * u + ( 1.0 - u ) * this.colorBlueTopRight; - double bB = this.colorBlueBottomLeft * u + ( 1.0 - u ) * this.colorBlueBottomRight; - float b = (float) ( bA * v + bB * ( 1.0 - v ) ); + final double bA = this.colorBlueTopLeft * u + ( 1.0 - u ) * this.colorBlueTopRight; + final double bB = this.colorBlueBottomLeft * u + ( 1.0 - u ) * this.colorBlueBottomRight; + final float b = (float) ( bA * v + bB * ( 1.0 - v ) ); - double highA = ( this.brightnessTopLeft >> 16 & 255 ) * u + ( 1.0 - u ) * ( this.brightnessTopRight >> 16 & 255 ); - double highB = ( this.brightnessBottomLeft >> 16 & 255 ) * u + ( 1.0 - u ) * ( this.brightnessBottomRight >> 16 & 255 ); - int high = ( (int) ( highA * v + highB * ( 1.0 - v ) ) ) & 255; + final double highA = ( this.brightnessTopLeft >> 16 & 255 ) * u + ( 1.0 - u ) * ( this.brightnessTopRight >> 16 & 255 ); + final double highB = ( this.brightnessBottomLeft >> 16 & 255 ) * u + ( 1.0 - u ) * ( this.brightnessBottomRight >> 16 & 255 ); + final int high = ( (int) ( highA * v + highB * ( 1.0 - v ) ) ) & 255; - double lowA = ( ( this.brightnessTopLeft & 255 ) ) * u + ( 1.0 - u ) * ( ( this.brightnessTopRight & 255 ) ); - double lowB = ( ( this.brightnessBottomLeft & 255 ) ) * u + ( 1.0 - u ) * ( ( this.brightnessBottomRight & 255 ) ); - int low = ( (int) ( lowA * v + lowB * ( 1.0 - v ) ) ) & 255; + final double lowA = ( ( this.brightnessTopLeft & 255 ) ) * u + ( 1.0 - u ) * ( ( this.brightnessTopRight & 255 ) ); + final double lowB = ( ( this.brightnessBottomLeft & 255 ) ) * u + ( 1.0 - u ) * ( ( this.brightnessBottomRight & 255 ) ); + final int low = ( (int) ( lowA * v + lowB * ( 1.0 - v ) ) ) & 255; - int out = ( high << 16 ) | low; + final int out = ( high << 16 ) | low; Tessellator.instance.setColorRGBA_F( r, g, b, this.opacity ); Tessellator.instance.setBrightness( out ); } - public boolean similarLighting( Block blk, IBlockAccess w, int x, int y, int z, ISimplifiedBundle sim ) + public boolean similarLighting( final Block blk, final IBlockAccess w, final int x, final int y, final int z, final ISimplifiedBundle sim ) { - int lh = this.getLightingHash( blk, w, x, y, z ); + final int lh = this.getLightingHash( blk, w, x, y, z ); return ( (LightingCache) sim ).lightHash == lh; } - private int getLightingHash( Block blk, IBlockAccess w, int x, int y, int z ) + private int getLightingHash( final Block blk, final IBlockAccess w, final int x, final int y, final int z ) { int o = 0; @@ -616,7 +616,7 @@ public class RenderBlocksWorkaround extends RenderBlocks return Arrays.hashCode( this.lightHashTmp ); } - public void populate( ISimplifiedBundle sim ) + public void populate( final ISimplifiedBundle sim ) { this.lightState = new LightingCache( (LightingCache) sim ); } @@ -656,7 +656,7 @@ public class RenderBlocksWorkaround extends RenderBlocks public int bZNeg; public int lightHash; - public LightingCache( LightingCache secondCSrc ) + public LightingCache( final LightingCache secondCSrc ) { this.rXPos = secondCSrc.rXPos; this.rXNeg = secondCSrc.rXNeg; diff --git a/src/main/java/appeng/client/render/SpatialSkyRender.java b/src/main/java/appeng/client/render/SpatialSkyRender.java index 4550b8ac..f444d495 100644 --- a/src/main/java/appeng/client/render/SpatialSkyRender.java +++ b/src/main/java/appeng/client/render/SpatialSkyRender.java @@ -52,9 +52,9 @@ public class SpatialSkyRender extends IRenderHandler } @Override - public void render( float partialTicks, WorldClient world, Minecraft mc ) + public void render( final float partialTicks, final WorldClient world, final Minecraft mc ) { - long now = System.currentTimeMillis(); + final long now = System.currentTimeMillis(); if( now - this.cycle > 2000 ) { this.cycle = now; @@ -74,7 +74,7 @@ public class SpatialSkyRender extends IRenderHandler GL11.glDisable( GL11.GL_BLEND ); GL11.glDepthMask( false ); GL11.glColor4f( 0.0f, 0.0f, 0.0f, 1.0f ); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; for( int i = 0; i < 6; ++i ) { @@ -142,7 +142,7 @@ public class SpatialSkyRender extends IRenderHandler private void renderTwinkles() { - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); for( int i = 0; i < 50; ++i ) @@ -150,7 +150,7 @@ public class SpatialSkyRender extends IRenderHandler double iX = this.random.nextFloat() * 2.0F - 1.0F; double iY = this.random.nextFloat() * 2.0F - 1.0F; double iZ = this.random.nextFloat() * 2.0F - 1.0F; - double d3 = 0.05F + this.random.nextFloat() * 0.1F; + final double d3 = 0.05F + this.random.nextFloat() * 0.1F; double dist = iX * iX + iY * iY + iZ * iZ; if( dist < 1.0D && dist > 0.01D ) @@ -159,30 +159,30 @@ public class SpatialSkyRender extends IRenderHandler iX *= dist; iY *= dist; iZ *= dist; - double x = iX * 100.0D; - double y = iY * 100.0D; - double z = iZ * 100.0D; - double d8 = Math.atan2( iX, iZ ); - double d9 = Math.sin( d8 ); - double d10 = Math.cos( d8 ); - double d11 = Math.atan2( Math.sqrt( iX * iX + iZ * iZ ), iY ); - double d12 = Math.sin( d11 ); - double d13 = Math.cos( d11 ); - double d14 = this.random.nextDouble() * Math.PI * 2.0D; - double d15 = Math.sin( d14 ); - double d16 = Math.cos( d14 ); + final double x = iX * 100.0D; + final double y = iY * 100.0D; + final double z = iZ * 100.0D; + final double d8 = Math.atan2( iX, iZ ); + final double d9 = Math.sin( d8 ); + final double d10 = Math.cos( d8 ); + final double d11 = Math.atan2( Math.sqrt( iX * iX + iZ * iZ ), iY ); + final double d12 = Math.sin( d11 ); + final double d13 = Math.cos( d11 ); + final double d14 = this.random.nextDouble() * Math.PI * 2.0D; + final double d15 = Math.sin( d14 ); + final double d16 = Math.cos( d14 ); for( int j = 0; j < 4; ++j ) { - double d17 = 0.0D; - 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; - double d23 = d17 * d12 - d20 * d13; - double d24 = d23 * d9 - d21 * d10; - double d25 = d21 * d9 + d23 * d10; + final double d17 = 0.0D; + final double d18 = ( ( j & 2 ) - 1 ) * d3; + final double d19 = ( ( j + 1 & 2 ) - 1 ) * d3; + final double d20 = d18 * d16 - d19 * d15; + final double d21 = d19 * d16 + d18 * d15; + final double d22 = d20 * d12 + d17 * d13; + final double d23 = d17 * d12 - d20 * d13; + final double d24 = d23 * d9 - d21 * d10; + final double d25 = d21 * d9 + d23 * d10; tessellator.addVertex( x + d24, y + d22, z + d25 ); } } diff --git a/src/main/java/appeng/client/render/TESRWrapper.java b/src/main/java/appeng/client/render/TESRWrapper.java index 9c0280b9..4b1c7000 100644 --- a/src/main/java/appeng/client/render/TESRWrapper.java +++ b/src/main/java/appeng/client/render/TESRWrapper.java @@ -44,18 +44,18 @@ public class TESRWrapper extends TileEntitySpecialRenderer private final BaseBlockRender blkRender; private final double maxDistance; - public TESRWrapper( BaseBlockRender render ) + public TESRWrapper( final BaseBlockRender render ) { this.blkRender = render; this.maxDistance = this.blkRender.getTesrRenderDistance(); } @Override - public final void renderTileEntityAt( TileEntity te, double x, double y, double z, float f ) + public final void renderTileEntityAt( final TileEntity te, final double x, final double y, final double z, final float f ) { if( te instanceof AEBaseTile ) { - Block b = te.getBlockType(); + final Block b = te.getBlockType(); if( b instanceof AEBaseBlock && ( (AEBaseTile) te ).requiresTESR() ) { @@ -64,7 +64,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer return; } - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; try { @@ -75,7 +75,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer GL11.glPopMatrix(); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.severe( "Hi, Looks like there was a crash while rendering something..." ); t.printStackTrace(); diff --git a/src/main/java/appeng/client/render/WorldRender.java b/src/main/java/appeng/client/render/WorldRender.java index 26236c36..5300c139 100644 --- a/src/main/java/appeng/client/render/WorldRender.java +++ b/src/main/java/appeng/client/render/WorldRender.java @@ -50,27 +50,27 @@ public final class WorldRender implements ISimpleBlockRenderingHandler { } - void setRender( AEBaseBlock in, BaseBlockRender r ) + void setRender( final AEBaseBlock in, final BaseBlockRender r ) { this.blockRenders.put( in, r ); } @Override - public void renderInventoryBlock( Block block, int metadata, int modelID, RenderBlocks renderer ) + public void renderInventoryBlock( final Block block, final int metadata, final int modelID, final RenderBlocks renderer ) { // wtf is this for? } @Override - public boolean renderWorldBlock( IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer ) + public boolean renderWorldBlock( final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer ) { - AEBaseBlock blk = (AEBaseBlock) block; + final AEBaseBlock blk = (AEBaseBlock) block; renderer.setRenderBoundsFromBlock( block ); return this.getRender( blk ).renderInWorld( blk, world, x, y, z, renderer ); } @Override - public boolean shouldRender3DInInventory( int modelId ) + public boolean shouldRender3DInInventory( final int modelId ) { return true; } @@ -81,17 +81,17 @@ public final class WorldRender implements ISimpleBlockRenderingHandler return this.renderID; } - private BaseBlockRender getRender( AEBaseBlock block ) + private BaseBlockRender getRender( final AEBaseBlock block ) { return block.getRendererInstance().rendererInstance; } - public void renderItemBlock( ItemStack item, ItemRenderType type, Object[] data ) + public void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data ) { - Block blk = Block.getBlockFromItem( item.getItem() ); + final Block blk = Block.getBlockFromItem( item.getItem() ); if( blk instanceof AEBaseBlock ) { - AEBaseBlock block = (AEBaseBlock) blk; + final AEBaseBlock block = (AEBaseBlock) blk; this.renderer.setRenderBoundsFromBlock( block ); this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java index e94c9fa5..25d475e7 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java @@ -56,7 +56,7 @@ public class RenderBlockAssembler extends BaseBlockRender 0; - boolean isConflict = meta == 2; + final int meta = world.getBlockMetadata( x, y, z ); + final boolean hasPower = meta > 0; + final boolean isConflict = meta == 2; ExtraBlockTextures lights = null; @@ -123,7 +123,7 @@ public class RenderBlockController extends BaseBlockRender= 2 ) { - int v = ( Math.abs( x ) + Math.abs( y ) + Math.abs( z ) ) % 2; + final int v = ( Math.abs( x ) + Math.abs( y ) + Math.abs( z ) ) % 2; renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; if( v == 0 ) @@ -155,7 +155,7 @@ public class RenderBlockController extends BaseBlockRender= 0 ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index 32970982..5fe20d6c 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -44,7 +44,7 @@ import appeng.tile.crafting.TileCraftingTile; public class RenderBlockCraftingCPU extends BaseBlockRender { - protected RenderBlockCraftingCPU( boolean useTESR, int range ) + protected RenderBlockCraftingCPU( final boolean useTESR, final int range ) { super( useTESR, range ); } @@ -55,26 +55,26 @@ public class RenderBlockCraftingCPU 15.999 ) ) { - double width = 3.0 / 16.0; + final double width = 3.0 / 16.0; switch( a ) { case DOWN: @@ -352,7 +352,7 @@ public class RenderBlockCraftingCPU } @Override - public void renderInventory( BlockCrank blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockCrank blk, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { renderer.renderAllFaces = true; @@ -59,13 +59,13 @@ public class RenderBlockCrank extends BaseBlockRender } @Override - public boolean renderInWorld( BlockCrank imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final BlockCrank imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { return true; } @Override - public void renderTile( BlockCrank blk, TileCrank tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks ) + public void renderTile( final BlockCrank blk, final TileCrank tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderBlocks ) { if( tile.getUp() == null || tile.getUp() == ForgeDirection.UNKNOWN ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java index ac01a73d..ab159fd0 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java @@ -39,11 +39,11 @@ public class RenderBlockEnergyCube extends BaseBlockRender } @Override - public void renderInventory( BlockPaint block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockPaint block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { } @Override - public boolean renderInWorld( BlockPaint imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final BlockPaint imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { - TilePaint tp = imb.getTileEntity( world, x, y, z ); + final TilePaint tp = imb.getTileEntity( world, x, y, z ); boolean out = false; if( tp != null ) { // super.renderInWorld( imb, world, x, y, z, renderer ); - IIcon[] icoSet = { imb.getIcon( 0, 0 ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() }; + final IIcon[] icoSet = { imb.getIcon( 0, 0 ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() }; - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; - int brightness = imb.getMixedBrightnessForBlock( world, x, y, z ); + final int brightness = imb.getMixedBrightnessForBlock( world, x, y, z ); - EnumSet validSides = EnumSet.noneOf( ForgeDirection.class ); + final EnumSet validSides = EnumSet.noneOf( ForgeDirection.class ); - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { if( tp.isSideValid( side ) ) { @@ -76,8 +76,8 @@ public class RenderBlockPaint extends BaseBlockRender } double offsetConstant = 0.001; - int lumen = 14 << 20 | 14 << 4; - for( Splotch s : tp.getDots() ) + final int lumen = 14 << 20 | 14 << 4; + for( final Splotch s : tp.getDots() ) { if( !validSides.contains( s.side ) ) { @@ -98,7 +98,7 @@ public class RenderBlockPaint extends BaseBlockRender double offset = offsetConstant; offsetConstant += 0.001; - double buffer = 0.1; + final double buffer = 0.1; double pos_x = s.x(); double pos_y = s.y(); @@ -124,7 +124,7 @@ public class RenderBlockPaint extends BaseBlockRender pos_y += z; } - IIcon ico = icoSet[s.getSeed() % icoSet.length]; + final IIcon ico = icoSet[s.getSeed() % icoSet.length]; switch( s.side ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java index 30f55839..62f0ff65 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java @@ -39,20 +39,20 @@ public class RenderBlockQuartzAccelerator extends BaseBlockRender } @Override - public void renderInventory( BlockDrive block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockDrive block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { renderer.overrideBlockTexture = ExtraBlockTextures.getMissing(); this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer ); @@ -55,27 +55,27 @@ public class RenderDrive extends BaseBlockRender } @Override - public boolean renderInWorld( BlockDrive imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final BlockDrive imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { - TileDrive sp = imb.getTileEntity( world, x, y, z ); + final TileDrive sp = imb.getTileEntity( world, x, y, z ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); - ForgeDirection up = sp.getUp(); - ForgeDirection forward = sp.getForward(); - ForgeDirection west = Platform.crossProduct( forward, up ); + final ForgeDirection up = sp.getUp(); + final ForgeDirection forward = sp.getForward(); + final ForgeDirection west = Platform.crossProduct( forward, up ); - boolean result = super.renderInWorld( imb, world, x, y, z, renderer ); - Tessellator tess = Tessellator.instance; + final boolean result = super.renderInWorld( imb, world, x, y, z, renderer ); + final Tessellator tess = Tessellator.instance; - IIcon ico = ExtraBlockTextures.MEStorageCellTextures.getIcon(); + final IIcon ico = ExtraBlockTextures.MEStorageCellTextures.getIcon(); - int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 ); + final int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 ); for( int yy = 0; yy < 5; yy++ ) { for( int xx = 0; xx < 2; xx++ ) { - int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) ); + final int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) ); this.selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 ); int spin = 0; @@ -263,7 +263,7 @@ public class RenderDrive extends BaseBlockRender if( stat != 0 ) { - IIcon whiteIcon = ExtraBlockTextures.White.getIcon(); + final 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 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderMEChest.java b/src/main/java/appeng/client/render/blocks/RenderMEChest.java index b5c41eb4..d6f15250 100644 --- a/src/main/java/appeng/client/render/blocks/RenderMEChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderMEChest.java @@ -50,7 +50,7 @@ public class RenderMEChest extends BaseBlockRender } @Override - public void renderInventory( BlockChest block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockChest block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { Tessellator.instance.setBrightness( 0 ); renderer.overrideBlockTexture = ExtraBlockTextures.getMissing(); @@ -64,9 +64,9 @@ public class RenderMEChest extends BaseBlockRender } @Override - public boolean renderInWorld( BlockChest imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final BlockChest imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { - TileChest sp = imb.getTileEntity( world, x, y, z ); + final TileChest sp = imb.getTileEntity( world, x, y, z ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); if( sp == null ) @@ -74,14 +74,14 @@ public class RenderMEChest extends BaseBlockRender return false; } - ForgeDirection up = sp.getUp(); - ForgeDirection forward = sp.getForward(); - ForgeDirection west = Platform.crossProduct( forward, up ); + final ForgeDirection up = sp.getUp(); + final ForgeDirection forward = sp.getForward(); + final ForgeDirection west = Platform.crossProduct( forward, up ); this.preRenderInWorld( imb, world, x, y, z, renderer ); - int stat = sp.getCellStatus( 0 ); - boolean result = renderer.renderStandardBlock( imb, x, y, z ); + final int stat = sp.getCellStatus( 0 ); + final boolean result = renderer.renderStandardBlock( imb, x, y, z ); this.selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 ); @@ -95,8 +95,8 @@ public class RenderMEChest extends BaseBlockRender Tessellator.instance.setBrightness( b ); Tessellator.instance.setColorOpaque_I( 0xffffff ); - int offsetU = -4; - FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); + final int offsetU = -4; + final FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); if( forward == ForgeDirection.EAST && ( up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH ) ) { flippableIcon.setFlip( true, false ); @@ -162,7 +162,7 @@ public class RenderMEChest extends BaseBlockRender Tessellator.instance.setColorOpaque_I( 0xffffff ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); - ICellHandler ch = AEApi.instance().registries().cell().getHandler( sp.getStorageType() ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( sp.getStorageType() ); Tessellator.instance.setColorOpaque_I( sp.getColor().whiteVariant ); IIcon ico = ch == null ? null : ch.getTopTexture_Light(); diff --git a/src/main/java/appeng/client/render/blocks/RenderNull.java b/src/main/java/appeng/client/render/blocks/RenderNull.java index 507d786d..a8f86727 100644 --- a/src/main/java/appeng/client/render/blocks/RenderNull.java +++ b/src/main/java/appeng/client/render/blocks/RenderNull.java @@ -38,13 +38,13 @@ public class RenderNull extends BaseBlockRender } @Override - public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final AEBaseBlock block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { } @Override - public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final AEBaseBlock block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { return true; } diff --git a/src/main/java/appeng/client/render/blocks/RenderQNB.java b/src/main/java/appeng/client/render/blocks/RenderQNB.java index f793cdde..219e7635 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQNB.java +++ b/src/main/java/appeng/client/render/blocks/RenderQNB.java @@ -47,19 +47,19 @@ public class RenderQNB extends BaseBlockRender sides = tqb.getConnections(); + final EnumSet sides = tqb.getConnections(); - Item transGlassCable = parts.cableGlass().item( AEColor.Transparent ); + final Item transGlassCable = parts.cableGlass().item( AEColor.Transparent ); this.renderCableAt( 0.11D, world, x, y, z, block, renderer, transGlassCable.getIconIndex( parts.cableGlass().stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); - Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent ); + final Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent ); this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transCoveredCable.getIconIndex( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); } - float renderMin = 2.0f / 16.0f; - float renderMax = 14.0f / 16.0f; + final float renderMin = 2.0f / 16.0f; + final float renderMax = 14.0f / 16.0f; renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax ); renderer.renderStandardBlock( block, x, y, z ); } @@ -95,14 +95,14 @@ public class RenderQNB extends BaseBlockRender connections ) + private void renderCableAt( final double thickness, final IBlockAccess world, final int x, final int y, final int z, final BlockQuantumBase block, final RenderBlocks renderer, final IIcon texture, final double pull, final Collection connections ) { block.getRendererInstance().setTemporaryRenderIcon( texture ); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java index a4ae3d5e..f843c8e4 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java @@ -45,7 +45,7 @@ public class RenderQuartzGlass extends BaseBlockRender } @Override - public void renderInventory( OreQuartz blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final OreQuartz blk, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { super.renderInventory( blk, is, renderer, type, obj ); blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() ); @@ -48,7 +48,7 @@ public class RenderQuartzOre extends BaseBlockRender } @Override - public boolean renderInWorld( OreQuartz quartz, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final OreQuartz quartz, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { quartz.setEnhanceBrightness( true ); super.renderInWorld( quartz, world, x, y, z, renderer ); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java index 81c4c7af..7ce51183 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java @@ -45,24 +45,24 @@ public class RenderQuartzTorch extends BaseBlockRender } @Override - public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final AEBaseBlock blk, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; - float Point3 = 7.0f / 16.0f; - float Point12 = 9.0f / 16.0f; + final float Point3 = 7.0f / 16.0f; + final float Point12 = 9.0f / 16.0f; - float renderBottom = 5.0f / 16.0f; - float renderTop = 10.0f / 16.0f; + final float renderBottom = 5.0f / 16.0f; + final float renderTop = 10.0f / 16.0f; - float xOff = 0.0f; - float yOff = 0.0f; - float zOff = 0.0f; + final float xOff = 0.0f; + final float yOff = 0.0f; + final float zOff = 0.0f; renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); - float singlePixel = 1.0f / 16.0f; + final float singlePixel = 1.0f / 16.0f; renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); @@ -73,10 +73,10 @@ public class RenderQuartzTorch extends BaseBlockRender blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) ); renderer.renderAllFaces = true; - float top = 8.0f / 16.0f; - float bottom = 7.0f / 16.0f; - float Point13 = 10.0f / 16.0f; - float Point2 = 6.0f / 16.0f; + final float top = 8.0f / 16.0f; + final float bottom = 7.0f / 16.0f; + final float Point13 = 10.0f / 16.0f; + final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff ); this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer ); @@ -95,9 +95,9 @@ public class RenderQuartzTorch extends BaseBlockRender } @Override - public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final AEBaseBlock block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { - IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, x, y, z ); + final IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, x, y, z ); renderer.renderAllFaces = true; float zOff = 0.0f; @@ -105,21 +105,21 @@ public class RenderQuartzTorch extends BaseBlockRender float xOff = 0.0f; if( te != null ) { - ForgeDirection forward = te.getUp(); + final ForgeDirection forward = te.getUp(); xOff = forward.offsetX * -( 4.0f / 16.0f ); yOff = forward.offsetY * -( 4.0f / 16.0f ); zOff = forward.offsetZ * -( 4.0f / 16.0f ); } - float renderTop = 10.0f / 16.0f; - float renderBottom = 5.0f / 16.0f; - float Point12 = 9.0f / 16.0f; - float Point3 = 7.0f / 16.0f; + final float renderTop = 10.0f / 16.0f; + final float renderBottom = 5.0f / 16.0f; + final float Point12 = 9.0f / 16.0f; + final float Point3 = 7.0f / 16.0f; renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); super.renderInWorld( block, world, x, y, z, renderer ); - int r = ( x + y + z ) % 2; - float singlePixel = 1.0f / 16.0f; + final int r = ( x + y + z ) % 2; + final float singlePixel = 1.0f / 16.0f; if( r == 0 ) { renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); @@ -139,12 +139,12 @@ public class RenderQuartzTorch extends BaseBlockRender block.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) ); - float top = 8.0f / 16.0f; - float bottom = 7.0f / 16.0f; - float Point13 = 10.0f / 16.0f; - float Point2 = 6.0f / 16.0f; + final float top = 8.0f / 16.0f; + final float bottom = 7.0f / 16.0f; + final float Point13 = 10.0f / 16.0f; + final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff ); - boolean out = renderer.renderStandardBlock( block, x, y, z ); + final boolean out = renderer.renderStandardBlock( block, x, y, z ); renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff ); renderer.renderStandardBlock( block, x, y, z ); @@ -157,7 +157,7 @@ public class RenderQuartzTorch extends BaseBlockRender if( te != null ) { - ForgeDirection forward = te.getUp(); + final ForgeDirection forward = te.getUp(); switch( forward ) { case EAST: diff --git a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java index 4f2d0a68..c60c9272 100644 --- a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java +++ b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java @@ -43,7 +43,7 @@ public class RenderSpatialPylon extends BaseBlockRender } @Override - public void renderInventory( BlockTinyTNT block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockTinyTNT block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj ) { renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); super.renderInventory( block, is, renderer, type, obj ); } @Override - public boolean renderInWorld( BlockTinyTNT imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) + public boolean renderInWorld( final BlockTinyTNT imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer ) { renderer.renderAllFaces = true; renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); - boolean out = super.renderInWorld( imb, world, x, y, z, renderer ); + final boolean out = super.renderInWorld( imb, world, x, y, z, renderer ); renderer.renderAllFaces = false; return out; } diff --git a/src/main/java/appeng/client/render/blocks/RendererCableBus.java b/src/main/java/appeng/client/render/blocks/RendererCableBus.java index 5d1eaea4..581d2be3 100644 --- a/src/main/java/appeng/client/render/blocks/RendererCableBus.java +++ b/src/main/java/appeng/client/render/blocks/RendererCableBus.java @@ -42,15 +42,15 @@ public class RendererCableBus extends BaseBlockRender 4.0 ) diff --git a/src/main/java/appeng/client/render/effects/ChargedOreFX.java b/src/main/java/appeng/client/render/effects/ChargedOreFX.java index 905deeb7..11344aec 100644 --- a/src/main/java/appeng/client/render/effects/ChargedOreFX.java +++ b/src/main/java/appeng/client/render/effects/ChargedOreFX.java @@ -26,13 +26,13 @@ import net.minecraft.world.World; public class ChargedOreFX extends EntityReddustFX { - public ChargedOreFX( World w, double x, double y, double z, float r, float g, float b ) + public ChargedOreFX( final World w, final double x, final double y, final double z, final float r, final float g, final float b ) { super( w, x, y, z, 0.21f, 0.61f, 1.0f ); } @Override - public int getBrightnessForRender( float par1 ) + public int getBrightnessForRender( final float par1 ) { int j1 = super.getBrightnessForRender( par1 ); j1 = Math.max( j1 >> 20, j1 >> 4 ); diff --git a/src/main/java/appeng/client/render/effects/CraftingFx.java b/src/main/java/appeng/client/render/effects/CraftingFx.java index 88ccb5da..8c5f07e7 100644 --- a/src/main/java/appeng/client/render/effects/CraftingFx.java +++ b/src/main/java/appeng/client/render/effects/CraftingFx.java @@ -43,7 +43,7 @@ public class CraftingFx extends EntityBreakingFX private final int startBlkY; private final int startBlkZ; - public CraftingFx( World par1World, double par2, double par4, double par6, Item par8Item ) + public CraftingFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -69,26 +69,26 @@ public class CraftingFx extends EntityBreakingFX } @Override - public void renderParticle( Tessellator par1Tessellator, float partialTick, float x, float y, float z, float rx, float rz ) + public void renderParticle( final Tessellator par1Tessellator, final float partialTick, final float x, final float y, final float z, final float rx, final float rz ) { if( partialTick < 0 || partialTick > 1 ) { return; } - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float scale = 0.1F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float scale = 0.1F * this.particleScale; 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 ); - int blkX = MathHelper.floor_double( offX ); - int blkY = MathHelper.floor_double( offY ); - int blkZ = MathHelper.floor_double( offZ ); + final int blkX = MathHelper.floor_double( offX ); + final int blkY = MathHelper.floor_double( offY ); + final int blkZ = MathHelper.floor_double( offZ ); if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { offX -= interpPosX; @@ -96,7 +96,7 @@ public class CraftingFx extends EntityBreakingFX offZ -= interpPosZ; // AELog.info( "" + partialTick ); - float f14 = 1.0F; + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale, f7, f9 ); par1Tessellator.addVertexWithUV( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale, f7, f8 ); @@ -105,7 +105,7 @@ public class CraftingFx extends EntityBreakingFX } } - public void fromItem( ForgeDirection d ) + public void fromItem( final ForgeDirection d ) { this.posX += 0.2 * d.offsetX; this.posY += 0.2 * d.offsetY; diff --git a/src/main/java/appeng/client/render/effects/EnergyFx.java b/src/main/java/appeng/client/render/effects/EnergyFx.java index 1100de78..7e1cd583 100644 --- a/src/main/java/appeng/client/render/effects/EnergyFx.java +++ b/src/main/java/appeng/client/render/effects/EnergyFx.java @@ -43,7 +43,7 @@ public class EnergyFx extends EntityBreakingFX private final int startBlkY; private final int startBlkZ; - public EnergyFx( World par1World, double par2, double par4, double par6, Item par8Item ) + public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -68,25 +68,25 @@ public class EnergyFx extends EntityBreakingFX } @Override - public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7 ) + public void renderParticle( final Tessellator par1Tessellator, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7 ) { - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float f10 = 0.1F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float f10 = 0.1F * this.particleScale; - 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 ); + final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); + final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); + final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); - int blkX = MathHelper.floor_double( this.posX ); - int blkY = MathHelper.floor_double( this.posY ); - int blkZ = MathHelper.floor_double( this.posZ ); + final int blkX = MathHelper.floor_double( this.posX ); + final int blkY = MathHelper.floor_double( this.posY ); + final int blkZ = MathHelper.floor_double( this.posZ ); if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { - float f14 = 1.0F; + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8 ); @@ -95,7 +95,7 @@ public class EnergyFx extends EntityBreakingFX } } - public void fromItem( ForgeDirection d ) + public void fromItem( final ForgeDirection d ) { this.posX += 0.2 * d.offsetX; this.posY += 0.2 * d.offsetY; diff --git a/src/main/java/appeng/client/render/effects/LightningArcFX.java b/src/main/java/appeng/client/render/effects/LightningArcFX.java index 2caa8549..4869b291 100644 --- a/src/main/java/appeng/client/render/effects/LightningArcFX.java +++ b/src/main/java/appeng/client/render/effects/LightningArcFX.java @@ -32,7 +32,7 @@ public class LightningArcFX extends LightningFX final double ry; final double rz; - public LightningArcFX( World w, double x, double y, double z, double ex, double ey, double ez, double r, double g, double b ) + public LightningArcFX( final World w, final double x, final double y, final double z, final double ex, final double ey, final double ez, final double r, final double g, final double b ) { super( w, x, y, z, r, g, b, 6 ); this.noClip = true; @@ -47,12 +47,12 @@ public class LightningArcFX extends LightningFX @Override protected void regen() { - double i = 1.0 / ( this.steps - 1 ); - double lastDirectionX = this.rx * i; - double lastDirectionY = this.ry * i; - double lastDirectionZ = this.rz * i; + final double i = 1.0 / ( this.steps - 1 ); + final double lastDirectionX = this.rx * i; + final double lastDirectionY = this.ry * i; + final double lastDirectionZ = this.rz * i; - double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ ); + final double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ ); for( int s = 0; s < this.steps; s++ ) { this.Steps[s][0] = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0; diff --git a/src/main/java/appeng/client/render/effects/LightningFX.java b/src/main/java/appeng/client/render/effects/LightningFX.java index 7ac2ef3c..5aaf253e 100644 --- a/src/main/java/appeng/client/render/effects/LightningFX.java +++ b/src/main/java/appeng/client/render/effects/LightningFX.java @@ -40,13 +40,13 @@ public class LightningFX extends EntityFX float currentPoint = 0; boolean hasData = false; - public LightningFX( World w, double x, double y, double z, double r, double g, double b ) + public LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b ) { this( w, x, y, z, r, g, b, 6 ); this.regen(); } - protected LightningFX( World w, double x, double y, double z, double r, double g, double b, int maxAge ) + protected LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b, final int maxAge ) { super( w, x, y, z, r, g, b ); this.Steps = new double[this.steps][3]; @@ -76,39 +76,39 @@ public class LightningFX extends EntityFX } @Override - public int getBrightnessForRender( float par1 ) + public int getBrightnessForRender( final float par1 ) { - int j1 = 13; + final int j1 = 13; return j1 << 20 | j1 << 4; } @Override - public void renderParticle( Tessellator tess, float l, float rX, float rY, float rZ, float rYZ, float rXY ) + public void renderParticle( final Tessellator tess, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY ) { - float j = 1.0f; + final float j = 1.0f; tess.setColorRGBA_F( this.particleRed * j * 0.9f, this.particleGreen * j * 0.95f, this.particleBlue * j, this.particleAlpha ); if( this.particleAge == 3 ) { this.regen(); } double f6 = this.particleTextureIndexX / 16.0; - double f7 = f6 + 0.0324375F; + final double f7 = f6 + 0.0324375F; double f8 = this.particleTextureIndexY / 16.0; - double f9 = f8 + 0.0324375F; + final double f9 = f8 + 0.0324375F; f6 = f7; f8 = f9; double scale = 0.02;// 0.02F * this.particleScale; - double[] a = new double[3]; - double[] b = new double[3]; + final double[] a = new double[3]; + final double[] b = new double[3]; double ox = 0; double oy = 0; double oz = 0; - EntityPlayer p = Minecraft.getMinecraft().thePlayer; + final EntityPlayer p = Minecraft.getMinecraft().thePlayer; double offX = -rZ; double offY = MathHelper.cos( (float) ( Math.PI / 2.0f + p.rotationPitch * 0.017453292F ) ); double offZ = rX; @@ -142,13 +142,13 @@ public class LightningFX extends EntityFX for( int s = 0; s < this.steps; s++ ) { - double xN = x + this.Steps[s][0]; - double yN = y + this.Steps[s][1]; - double zN = z + this.Steps[s][2]; + final double xN = x + this.Steps[s][0]; + final double yN = y + this.Steps[s][1]; + final double zN = z + this.Steps[s][2]; - double xD = xN - x; - double yD = yN - y; - double zD = zN - z; + final double xD = xN - x; + final double yD = yN - y; + final double zD = zN - z; if( cycle == 0 ) { @@ -169,7 +169,7 @@ public class LightningFX extends EntityFX oz = ( xD * 0 ) - ( 1 * yD ); } - double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale ); + final double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale ); ox /= ss; oy /= ss; oz /= ss; @@ -201,7 +201,7 @@ public class LightningFX extends EntityFX this.hasData = false; } - private void draw( Tessellator tess, double[] a, double[] b, double f6, double f8 ) + private void draw( final Tessellator tess, final double[] a, final double[] b, final double f6, final double f8 ) { if( this.hasData ) { diff --git a/src/main/java/appeng/client/render/effects/MatterCannonFX.java b/src/main/java/appeng/client/render/effects/MatterCannonFX.java index 7efaae48..acde8401 100644 --- a/src/main/java/appeng/client/render/effects/MatterCannonFX.java +++ b/src/main/java/appeng/client/render/effects/MatterCannonFX.java @@ -34,7 +34,7 @@ public class MatterCannonFX extends EntityBreakingFX private final IIcon particleTextureIndex; - public MatterCannonFX( World par1World, double par2, double par4, double par6, Item par8Item ) + public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -50,7 +50,7 @@ public class MatterCannonFX extends EntityBreakingFX this.noClip = true; } - public void fromItem( ForgeDirection d ) + public void fromItem( final ForgeDirection d ) { this.particleScale *= 1.2f; } @@ -70,18 +70,18 @@ public class MatterCannonFX extends EntityBreakingFX } @Override - public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7 ) + public void renderParticle( final Tessellator par1Tessellator, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7 ) { - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float f10 = 0.05F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float f10 = 0.05F * this.particleScale; - 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; + final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); + final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); + final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 ); diff --git a/src/main/java/appeng/client/render/effects/VibrantFX.java b/src/main/java/appeng/client/render/effects/VibrantFX.java index 5a94a3c5..40f1ee71 100644 --- a/src/main/java/appeng/client/render/effects/VibrantFX.java +++ b/src/main/java/appeng/client/render/effects/VibrantFX.java @@ -30,10 +30,10 @@ import cpw.mods.fml.relauncher.SideOnly; public class VibrantFX extends EntityFX { - public VibrantFX( World par1World, double x, double y, double z, double par8, double par10, double par12 ) + public VibrantFX( final World par1World, final double x, final double y, final double z, final double par8, final double par10, final double par12 ) { super( par1World, x, y, z, par8, par10, par12 ); - float f = this.rand.nextFloat() * 0.1F + 0.8F; + final float f = this.rand.nextFloat() * 0.1F + 0.8F; this.particleRed = f * 0.7f; this.particleGreen = f * 0.89f; this.particleBlue = f * 0.9f; @@ -51,7 +51,7 @@ public class VibrantFX extends EntityFX } @Override - public float getBrightness( float par1 ) + public float getBrightness( final float par1 ) { return 1.0f; } diff --git a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java index 640a71cb..51232a1f 100644 --- a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java +++ b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java @@ -38,13 +38,13 @@ public class ItemEncodedPatternRenderer implements IItemRenderer boolean recursive; @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { - boolean isShiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT ); + final boolean isShiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT ); if( !this.recursive && type == IItemRenderer.ItemRenderType.INVENTORY && isShiftHeld ) { - ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); + final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); if( iep.getOutput( item ) != null ) { return true; @@ -55,20 +55,20 @@ public class ItemEncodedPatternRenderer implements IItemRenderer } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return false; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { this.recursive = true; - ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); + final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem(); - ItemStack is = iep.getOutput( item ); - Minecraft mc = Minecraft.getMinecraft(); + final ItemStack is = iep.getOutput( item ); + final Minecraft mc = Minecraft.getMinecraft(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); RenderHelper.enableGUIStandardItemLighting(); diff --git a/src/main/java/appeng/client/render/items/PaintBallRender.java b/src/main/java/appeng/client/render/items/PaintBallRender.java index 1c9887d4..6f890adf 100644 --- a/src/main/java/appeng/client/render/items/PaintBallRender.java +++ b/src/main/java/appeng/client/render/items/PaintBallRender.java @@ -36,19 +36,19 @@ public class PaintBallRender implements IItemRenderer { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { IIcon par2Icon = item.getIconIndex(); if( item.getItemDamage() >= 20 ) @@ -56,28 +56,28 @@ public class PaintBallRender implements IItemRenderer par2Icon = ExtraItemTextures.ItemPaintBallShimmer.getIcon(); } - float f4 = par2Icon.getMinU(); - float f5 = par2Icon.getMaxU(); - float f6 = par2Icon.getMinV(); - float f7 = par2Icon.getMaxV(); + final float f4 = par2Icon.getMinU(); + final float f5 = par2Icon.getMaxU(); + final float f6 = par2Icon.getMinV(); + final float f7 = par2Icon.getMaxV(); - ItemPaintBall ipb = (ItemPaintBall) item.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) item.getItem(); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - AEColor col = ipb.getColor( item ); + final AEColor col = ipb.getColor( item ); - int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; - int r = ( colorValue >> 16 ) & 0xff; - int g = ( colorValue >> 8 ) & 0xff; - int b = ( colorValue ) & 0xff; + final int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; + final int r = ( colorValue >> 16 ) & 0xff; + final int g = ( colorValue >> 8 ) & 0xff; + final int b = ( colorValue ) & 0xff; if( item.getItemDamage() >= 20 ) { - float fail = 0.7f; - int full = (int) ( 255 * 0.3 ); + final float fail = 0.7f; + final int full = (int) ( 255 * 0.3 ); GL11.glColor4ub( (byte) ( full + r * fail ), (byte) ( full + g * fail ), (byte) ( full + b * fail ), (byte) 255 ); } else @@ -110,7 +110,7 @@ public class PaintBallRender implements IItemRenderer { GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); } - float f12 = 0.0625F; + final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); diff --git a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java index e7c20680..65913fb6 100644 --- a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java +++ b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java @@ -38,28 +38,28 @@ public class ToolBiometricCardRender implements IItemRenderer { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { - IIcon par2Icon = item.getIconIndex(); + final IIcon par2Icon = item.getIconIndex(); - float f4 = par2Icon.getMinU(); - float f5 = par2Icon.getMaxU(); - float f6 = par2Icon.getMinV(); - float f7 = par2Icon.getMaxV(); + final float f4 = par2Icon.getMinU(); + final float f5 = par2Icon.getMaxU(); + final float f6 = par2Icon.getMinV(); + final float f7 = par2Icon.getMaxV(); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); @@ -82,7 +82,7 @@ public class ToolBiometricCardRender implements IItemRenderer else { GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); - float f12 = 0.0625F; + final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); @@ -92,19 +92,19 @@ public class ToolBiometricCardRender implements IItemRenderer GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F ); } - float u = ExtraItemTextures.White.getIcon().getInterpolatedU( 8.1 ); - float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 ); + final float u = ExtraItemTextures.White.getIcon().getInterpolatedU( 8.1 ); + final float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 ); String username = ""; if( item.getItem() instanceof IBiometricCard ) { - GameProfile gp = ( (IBiometricCard) item.getItem() ).getProfile( item ); + final GameProfile gp = ( (IBiometricCard) item.getItem() ).getProfile( item ); if( gp != null ) { username = gp.getName(); } } - int hash = username.length() > 0 ? username.hashCode() : 0; + final int hash = username.length() > 0 ? username.hashCode() : 0; GL11.glScalef( 1F / 16F, 1F / 16F, 1F ); GL11.glTranslatef( 4, 6, 0 ); @@ -118,7 +118,7 @@ public class ToolBiometricCardRender implements IItemRenderer col = AEColor.Black; } - float z = 0; + final float z = 0; for( int x = 0; x < 8; x++ )// 8 { for( int y = 0; y < 6; y++ )// 6 @@ -140,7 +140,7 @@ public class ToolBiometricCardRender implements IItemRenderer } else { - float scale = 0.3f / 255.0f; + final float scale = 0.3f / 255.0f; tessellator.setColorOpaque_F( ( ( col.blackVariant >> 16 ) & 0xff ) * scale, ( ( col.blackVariant >> 8 ) & 0xff ) * scale, ( col.blackVariant & 0xff ) * scale ); } diff --git a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java index 91a0d81a..80b6caff 100644 --- a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java +++ b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java @@ -36,28 +36,28 @@ public class ToolColorApplicatorRender implements IItemRenderer { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { - IIcon par2Icon = item.getIconIndex(); + final IIcon par2Icon = item.getIconIndex(); float f4 = par2Icon.getMinU(); float f5 = par2Icon.getMaxU(); float f6 = par2Icon.getMinV(); float f7 = par2Icon.getMaxV(); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); @@ -91,7 +91,7 @@ public class ToolColorApplicatorRender implements IItemRenderer { GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); } - float f12 = 0.0625F; + final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); @@ -101,9 +101,9 @@ public class ToolColorApplicatorRender implements IItemRenderer GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F ); } - IIcon dark = ExtraItemTextures.ToolColorApplicatorTip_Dark.getIcon(); - IIcon med = ExtraItemTextures.ToolColorApplicatorTip_Medium.getIcon(); - IIcon light = ExtraItemTextures.ToolColorApplicatorTip_Light.getIcon(); + final IIcon dark = ExtraItemTextures.ToolColorApplicatorTip_Dark.getIcon(); + final IIcon med = ExtraItemTextures.ToolColorApplicatorTip_Medium.getIcon(); + final IIcon light = ExtraItemTextures.ToolColorApplicatorTip_Light.getIcon(); GL11.glScalef( 1F / 16F, 1F / 16F, 1F ); if( type != ItemRenderType.INVENTORY ) @@ -112,7 +112,7 @@ public class ToolColorApplicatorRender implements IItemRenderer } GL11.glDisable( GL11.GL_LIGHTING ); - AEColor col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item ); + final AEColor col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item ); if( col != null ) { diff --git a/src/main/java/appeng/client/render/model/ModelCompass.java b/src/main/java/appeng/client/render/model/ModelCompass.java index 92d28aad..bd60629b 100644 --- a/src/main/java/appeng/client/render/model/ModelCompass.java +++ b/src/main/java/appeng/client/render/model/ModelCompass.java @@ -93,14 +93,14 @@ public class ModelCompass extends ModelBase this.setRotation( this.Base, 0F, 0F, 0F ); } - private void setRotation( ModelRenderer model, float x, float y, float z ) + private void setRotation( final ModelRenderer model, final float x, final float y, final float z ) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - public void renderAll( float rad ) + public void renderAll( final float rad ) { this.setRotation( this.Pointer, 0F, 0F, 0F ); diff --git a/src/main/java/appeng/client/texture/CableBusTextures.java b/src/main/java/appeng/client/texture/CableBusTextures.java index 5212468c..f8a65ced 100644 --- a/src/main/java/appeng/client/texture/CableBusTextures.java +++ b/src/main/java/appeng/client/texture/CableBusTextures.java @@ -80,12 +80,12 @@ public enum CableBusTextures private final String name; public IIcon IIcon; - CableBusTextures( String name ) + CableBusTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return null; } @@ -106,7 +106,7 @@ public enum CableBusTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } diff --git a/src/main/java/appeng/client/texture/ExtraBlockTextures.java b/src/main/java/appeng/client/texture/ExtraBlockTextures.java index 066267f8..62fcfd3b 100644 --- a/src/main/java/appeng/client/texture/ExtraBlockTextures.java +++ b/src/main/java/appeng/client/texture/ExtraBlockTextures.java @@ -91,12 +91,12 @@ public enum ExtraBlockTextures private final String name; public IIcon IIcon; - ExtraBlockTextures( String name ) + ExtraBlockTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return new ResourceLocation( "appliedenergistics2", "textures/" + string ); } @@ -117,7 +117,7 @@ public enum ExtraBlockTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } diff --git a/src/main/java/appeng/client/texture/ExtraItemTextures.java b/src/main/java/appeng/client/texture/ExtraItemTextures.java index 8c2cd3d8..8716ea81 100644 --- a/src/main/java/appeng/client/texture/ExtraItemTextures.java +++ b/src/main/java/appeng/client/texture/ExtraItemTextures.java @@ -41,12 +41,12 @@ public enum ExtraItemTextures private final String name; public IIcon IIcon; - ExtraItemTextures( String name ) + ExtraItemTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return new ResourceLocation( "appliedenergistics2", "textures/" + string ); } @@ -67,7 +67,7 @@ public enum ExtraItemTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { this.IIcon = map.registerIcon( "appliedenergistics2:" + this.name ); } diff --git a/src/main/java/appeng/client/texture/FlippableIcon.java b/src/main/java/appeng/client/texture/FlippableIcon.java index 1db6e69f..5ef8b7ce 100644 --- a/src/main/java/appeng/client/texture/FlippableIcon.java +++ b/src/main/java/appeng/client/texture/FlippableIcon.java @@ -29,7 +29,7 @@ public class FlippableIcon implements IIcon boolean flip_u; boolean flip_v; - public FlippableIcon( IIcon o ) + public FlippableIcon( final IIcon o ) { if( o == null ) { @@ -74,7 +74,7 @@ public class FlippableIcon implements IIcon } @Override - public float getInterpolatedU( double px ) + public float getInterpolatedU( final double px ) { if( this.flip_u ) { @@ -104,7 +104,7 @@ public class FlippableIcon implements IIcon } @Override - public float getInterpolatedV( double px ) + public float getInterpolatedV( final double px ) { if( this.flip_v ) { @@ -124,13 +124,13 @@ public class FlippableIcon implements IIcon return this.original; } - public void setFlip( boolean u, boolean v ) + public void setFlip( final boolean u, final boolean v ) { this.flip_u = u; this.flip_v = v; } - public int setFlip( int orientation ) + public int setFlip( final int orientation ) { this.flip_u = ( orientation & 8 ) == 8; this.flip_v = ( orientation & 16 ) == 16; diff --git a/src/main/java/appeng/client/texture/FullIcon.java b/src/main/java/appeng/client/texture/FullIcon.java index 272a76ae..6ee3b6f2 100644 --- a/src/main/java/appeng/client/texture/FullIcon.java +++ b/src/main/java/appeng/client/texture/FullIcon.java @@ -30,7 +30,7 @@ public class FullIcon implements IIcon private final IIcon p; - public FullIcon( IIcon o ) + public FullIcon( final IIcon o ) { if( o == null ) { @@ -68,7 +68,7 @@ public class FullIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { if( d0 > 8.0 ) { @@ -93,7 +93,7 @@ public class FullIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { if( d0 > 8.0 ) { diff --git a/src/main/java/appeng/client/texture/MissingIcon.java b/src/main/java/appeng/client/texture/MissingIcon.java index 3b8541e8..d92a4a17 100644 --- a/src/main/java/appeng/client/texture/MissingIcon.java +++ b/src/main/java/appeng/client/texture/MissingIcon.java @@ -33,7 +33,7 @@ public class MissingIcon implements IIcon final boolean isBlock; - public MissingIcon( Object forWhat ) + public MissingIcon( final Object forWhat ) { this.isBlock = forWhat instanceof Block; } @@ -69,7 +69,7 @@ public class MissingIcon implements IIcon } @Override - public float getInterpolatedU( double var1 ) + public float getInterpolatedU( final double var1 ) { return this.getMissing().getInterpolatedU( var1 ); } @@ -87,7 +87,7 @@ public class MissingIcon implements IIcon } @Override - public float getInterpolatedV( double var1 ) + public float getInterpolatedV( final double var1 ) { return this.getMissing().getInterpolatedV( var1 ); } diff --git a/src/main/java/appeng/client/texture/OffsetIcon.java b/src/main/java/appeng/client/texture/OffsetIcon.java index 33bb066b..41d211c1 100644 --- a/src/main/java/appeng/client/texture/OffsetIcon.java +++ b/src/main/java/appeng/client/texture/OffsetIcon.java @@ -33,7 +33,7 @@ public class OffsetIcon implements IIcon private final IIcon p; - public OffsetIcon( IIcon o, float x, float y ) + public OffsetIcon( final IIcon o, final float x, final float y ) { if( o == null ) { @@ -73,7 +73,7 @@ public class OffsetIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { return this.u( d0 - this.offsetX ); } @@ -94,7 +94,7 @@ public class OffsetIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { return this.v( d0 - this.offsetY ); } @@ -106,12 +106,12 @@ public class OffsetIcon implements IIcon return this.p.getIconName(); } - private float v( double d ) + private float v( final double d ) { return this.p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); } - private float u( double d ) + private float u( final double d ) { return this.p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); } diff --git a/src/main/java/appeng/client/texture/TaughtIcon.java b/src/main/java/appeng/client/texture/TaughtIcon.java index 12699c34..0d0c859a 100644 --- a/src/main/java/appeng/client/texture/TaughtIcon.java +++ b/src/main/java/appeng/client/texture/TaughtIcon.java @@ -32,7 +32,7 @@ public class TaughtIcon implements IIcon private final IIcon icon; - public TaughtIcon( IIcon icon, float tightness ) + public TaughtIcon( final IIcon icon, final float tightness ) { if( icon == null ) { @@ -71,7 +71,7 @@ public class TaughtIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { return this.u( d0 ); } @@ -92,7 +92,7 @@ public class TaughtIcon implements IIcon @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { return this.v( d0 ); } diff --git a/src/main/java/appeng/client/texture/TmpFlippableIcon.java b/src/main/java/appeng/client/texture/TmpFlippableIcon.java index ca789dc9..94e0efd6 100644 --- a/src/main/java/appeng/client/texture/TmpFlippableIcon.java +++ b/src/main/java/appeng/client/texture/TmpFlippableIcon.java @@ -39,7 +39,7 @@ public class TmpFlippableIcon extends FlippableIcon while( i instanceof FlippableIcon ) { - FlippableIcon fi = (FlippableIcon) i; + final FlippableIcon fi = (FlippableIcon) i; if( fi.flip_u ) { this.flip_u = !this.flip_u; diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index 5213988a..d16aeef8 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -102,12 +102,12 @@ public abstract class AEBaseContainer extends Container int ticksSinceCheck = 900; IAEItemStack clientRequestedTargetItem = null; - public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart ) + public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart ) { this( ip, myTile, myPart, null ); } - public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart, IGuiItemObject gio ) + public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio ) { this.invPlayer = ip; this.tileEntity = myTile; @@ -139,11 +139,11 @@ public abstract class AEBaseContainer extends Container private void prepareSync() { - for( Field f : this.getClass().getFields() ) + for( final Field f : this.getClass().getFields() ) { if( f.isAnnotationPresent( GuiSync.class ) ) { - GuiSync annotation = f.getAnnotation( GuiSync.class ); + final GuiSync annotation = f.getAnnotation( GuiSync.class ); if( this.syncData.containsKey( annotation.value() ) ) { AELog.warning( "Channel already in use: " + annotation.value() + " for " + f.getName() ); @@ -156,7 +156,7 @@ public abstract class AEBaseContainer extends Container } } - public AEBaseContainer( InventoryPlayer ip, Object anchor ) + public AEBaseContainer( final InventoryPlayer ip, final Object anchor ) { this.invPlayer = ip; this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; @@ -173,7 +173,7 @@ public abstract class AEBaseContainer extends Container this.prepareSync(); } - public void postPartial( PacketPartialItem packetPartialItem ) + public void postPartial( final PacketPartialItem packetPartialItem ) { this.dataChunks.add( packetPartialItem ); if( packetPartialItem.getPageCount() == this.dataChunks.size() ) @@ -185,28 +185,28 @@ public abstract class AEBaseContainer extends Container private void parsePartials() { int total = 0; - for( PacketPartialItem ppi : this.dataChunks ) + for( final PacketPartialItem ppi : this.dataChunks ) { total += ppi.getSize(); } - byte[] buffer = new byte[total]; + final byte[] buffer = new byte[total]; int cursor = 0; - for( PacketPartialItem ppi : this.dataChunks ) + for( final PacketPartialItem ppi : this.dataChunks ) { cursor = ppi.write( buffer, cursor ); } try { - NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) ); + final NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) ); if( data != null ) { this.setTargetStack( AEApi.instance().storage().createItemStack( ItemStack.loadItemStackFromNBT( data ) ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -219,21 +219,21 @@ public abstract class AEBaseContainer extends Container return this.clientRequestedTargetItem; } - public void setTargetStack( IAEItemStack stack ) + public void setTargetStack( final IAEItemStack stack ) { // client doesn't need to re-send, makes for lower overhead rapid packets. if( Platform.isClient() ) { - ItemStack a = stack == null ? null : stack.getItemStack(); - ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); + final ItemStack a = stack == null ? null : stack.getItemStack(); + final ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); if( Platform.isSameItemPrecise( a, b ) ) { return; } - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - NBTTagCompound item = new NBTTagCompound(); + final ByteArrayOutputStream stream = new ByteArrayOutputStream(); + final NBTTagCompound item = new NBTTagCompound(); if( stack != null ) { @@ -244,16 +244,16 @@ public abstract class AEBaseContainer extends Container { CompressedStreamTools.writeCompressed( item, stream ); - int maxChunkSize = 30000; - List miniPackets = new LinkedList(); + final int maxChunkSize = 30000; + final List miniPackets = new LinkedList(); - byte[] data = stream.toByteArray(); + final byte[] data = stream.toByteArray(); - ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() ); + final ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() ); while( bis.available() > 0 ) { - int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available(); - byte[] nextSegment = new byte[nextBLock]; + final int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available(); + final byte[] nextSegment = new byte[nextBLock]; bis.read( nextSegment ); miniPackets.add( nextSegment ); } @@ -261,14 +261,14 @@ public abstract class AEBaseContainer extends Container stream.close(); int page = 0; - for( byte[] packet : miniPackets ) + for( final byte[] packet : miniPackets ) { - PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet ); + final PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet ); page++; NetworkHandler.instance.sendToServer( ppi ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); return; @@ -283,7 +283,7 @@ public abstract class AEBaseContainer extends Container return this.mySrc; } - public void verifyPermissions( SecurityPermissions security, boolean requirePower ) + public void verifyPermissions( final SecurityPermissions security, final boolean requirePower ) { if( Platform.isClient() ) { @@ -300,28 +300,28 @@ public abstract class AEBaseContainer extends Container this.isContainerValid = this.isContainerValid && this.hasAccess( security, requirePower ); } - protected boolean hasAccess( SecurityPermissions perm, boolean requirePower ) + protected boolean hasAccess( final SecurityPermissions perm, final boolean requirePower ) { - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode gn = host.getActionableNode(); + final IGridNode gn = host.getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( this.invPlayer.player, perm ) ) { return true; @@ -333,7 +333,7 @@ public abstract class AEBaseContainer extends Container return false; } - public void lockPlayerInventorySlot( int idx ) + public void lockPlayerInventorySlot( final int idx ) { this.locked.add( idx ); } @@ -365,7 +365,7 @@ public abstract class AEBaseContainer extends Container return this.tileEntity; } - public final void updateFullProgressBar( int idx, long value ) + public final void updateFullProgressBar( final int idx, final long value ) { if( this.syncData.containsKey( idx ) ) { @@ -376,7 +376,7 @@ public abstract class AEBaseContainer extends Container this.updateProgressBar( idx, (int) value ); } - public void stringSync( int idx, String value ) + public void stringSync( final int idx, final String value ) { if( this.syncData.containsKey( idx ) ) { @@ -384,7 +384,7 @@ public abstract class AEBaseContainer extends Container } } - protected void bindPlayerInventory( InventoryPlayer inventoryPlayer, int offsetX, int offsetY ) + protected void bindPlayerInventory( final InventoryPlayer inventoryPlayer, final int offsetX, final int offsetY ) { // bind player inventory for( int i = 0; i < 3; i++ ) @@ -417,11 +417,11 @@ public abstract class AEBaseContainer extends Container } @Override - protected Slot addSlotToContainer( Slot newSlot ) + protected Slot addSlotToContainer( final Slot newSlot ) { if( newSlot instanceof AppEngSlot ) { - AppEngSlot s = (AppEngSlot) newSlot; + final AppEngSlot s = (AppEngSlot) newSlot; s.myContainer = this; return super.addSlotToContainer( newSlot ); } @@ -438,11 +438,11 @@ public abstract class AEBaseContainer extends Container if( Platform.isServer() ) { - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; - for( SyncData sd : this.syncData.values() ) + for( final SyncData sd : this.syncData.values() ) { sd.tick( icrafting ); } @@ -453,7 +453,7 @@ public abstract class AEBaseContainer extends Container } @Override - public ItemStack transferStackInSlot( EntityPlayer p, int idx ) + public ItemStack transferStackInSlot( final EntityPlayer p, final int idx ) { if( Platform.isClient() ) { @@ -461,7 +461,7 @@ public abstract class AEBaseContainer extends Container } boolean hasMETiles = false; - for( Object is : this.inventorySlots ) + for( final Object is : this.inventorySlots ) { if( is instanceof InternalSlotME ) { @@ -475,7 +475,7 @@ public abstract class AEBaseContainer extends Container return null; } - AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots! + final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots! if( clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessible ) { @@ -490,7 +490,7 @@ public abstract class AEBaseContainer extends Container return null; } - List selectedSlots = new ArrayList(); + final List selectedSlots = new ArrayList(); /** * Gather a list of valid destinations. @@ -500,9 +500,9 @@ public abstract class AEBaseContainer extends Container tis = this.shiftStoreItem( tis ); // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; + final AppEngSlot cs = (AppEngSlot) inventorySlot; if( !( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) ) { @@ -516,9 +516,9 @@ public abstract class AEBaseContainer extends Container else { // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; + final AppEngSlot cs = (AppEngSlot) inventorySlot; if( ( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) ) { @@ -538,10 +538,10 @@ public abstract class AEBaseContainer extends Container if( tis != null ) { // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; - ItemStack destination = cs.getStack(); + final AppEngSlot cs = (AppEngSlot) inventorySlot; + final ItemStack destination = cs.getStack(); if( !( cs.isPlayerSide() ) && cs instanceof SlotFake ) { @@ -564,7 +564,7 @@ public abstract class AEBaseContainer extends Container if( tis != null ) { // find partials.. - for( Slot d : selectedSlots ) + for( final Slot d : selectedSlots ) { if( d instanceof SlotDisabled || d instanceof SlotME ) { @@ -575,7 +575,7 @@ public abstract class AEBaseContainer extends Container { if( d.getHasStack() ) { - ItemStack t = d.getStack(); + final ItemStack t = d.getStack(); if( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis)) { @@ -616,7 +616,7 @@ public abstract class AEBaseContainer extends Container } // any match.. - for( Slot d : selectedSlots ) + for( final Slot d : selectedSlots ) { if( d instanceof SlotDisabled || d instanceof SlotME ) { @@ -627,7 +627,7 @@ public abstract class AEBaseContainer extends Container { if( d.getHasStack() ) { - ItemStack t = d.getStack(); + final ItemStack t = d.getStack(); if( Platform.isSameItemPrecise( t, tis ) ) { @@ -674,7 +674,7 @@ public abstract class AEBaseContainer extends Container maxSize = d.getSlotStackLimit(); } - ItemStack tmp = tis.copy(); + final ItemStack tmp = tis.copy(); if( tmp.stackSize > maxSize ) { tmp.stackSize = maxSize; @@ -713,7 +713,7 @@ public abstract class AEBaseContainer extends Container } @Override - public final void updateProgressBar( int idx, int value ) + public final void updateProgressBar( final int idx, final int value ) { if( this.syncData.containsKey( idx ) ) { @@ -722,7 +722,7 @@ public abstract class AEBaseContainer extends Container } @Override - public boolean canInteractWith( EntityPlayer entityplayer ) + public boolean canInteractWith( final EntityPlayer entityplayer ) { if( this.isContainerValid ) { @@ -736,16 +736,16 @@ public abstract class AEBaseContainer extends Container } @Override - public boolean canDragIntoSlot( Slot s ) + public boolean canDragIntoSlot( final Slot s ) { return ( (AppEngSlot) s ).isDraggable; } - public void doAction( EntityPlayerMP player, InventoryAction action, int slot, long id ) + public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) { if( slot >= 0 && slot < this.inventorySlots.size() ) { - Slot s = this.getSlot( slot ); + final Slot s = this.getSlot( slot ); if( s instanceof SlotCraftingTerm ) { @@ -762,7 +762,7 @@ public abstract class AEBaseContainer extends Container if( s instanceof SlotFake ) { - ItemStack hand = player.inventory.getItemStack(); + final ItemStack hand = player.inventory.getItemStack(); switch( action ) { @@ -782,7 +782,7 @@ public abstract class AEBaseContainer extends Container if( hand != null ) { - ItemStack is = hand.copy(); + final ItemStack is = hand.copy(); is.stackSize = 1; s.putStack( is ); } @@ -827,9 +827,9 @@ public abstract class AEBaseContainer extends Container if( action == InventoryAction.MOVE_REGION ) { - List from = new LinkedList(); + final List from = new LinkedList(); - for( Object j : this.inventorySlots ) + for( final Object j : this.inventorySlots ) { if( j instanceof Slot && j.getClass() == s.getClass() ) { @@ -837,7 +837,7 @@ public abstract class AEBaseContainer extends Container } } - for( Slot fr : from ) + for( final Slot fr : from ) { this.transferStackInSlot( player, fr.slotNumber ); } @@ -847,7 +847,7 @@ public abstract class AEBaseContainer extends Container } // get target item. - IAEItemStack slotItem = this.clientRequestedTargetItem; + final IAEItemStack slotItem = this.clientRequestedTargetItem; switch( action ) { @@ -864,7 +864,7 @@ public abstract class AEBaseContainer extends Container ais.setStackSize( myItem.getMaxStackSize() ); - InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); + final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); myItem.stackSize = (int) ais.getStackSize(); myItem = adp.simulateAdd( myItem ); @@ -886,21 +886,21 @@ public abstract class AEBaseContainer extends Container return; } - int releaseQty = 1; - ItemStack isg = player.inventory.getItemStack(); + final int releaseQty = 1; + final ItemStack isg = player.inventory.getItemStack(); if( isg != null && releaseQty > 0 ) { IAEItemStack ais = AEApi.instance().storage().createItemStack( isg ); ais.setStackSize( 1 ); - IAEItemStack extracted = ais.copy(); + final IAEItemStack extracted = ais.copy(); ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais == null ) { - InventoryAdaptor ia = new AdaptorPlayerHand( player ); + final InventoryAdaptor ia = new AdaptorPlayerHand( player ); - ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null ); + final ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null ); if( fail == null ) { this.cellInv.extractItems( extracted, Actionable.MODULATE, this.mySrc ); @@ -921,7 +921,7 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { int liftQty = 1; - ItemStack item = player.inventory.getItemStack(); + final ItemStack item = player.inventory.getItemStack(); if( item != null ) { @@ -942,9 +942,9 @@ public abstract class AEBaseContainer extends Container ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais != null ) { - InventoryAdaptor ia = new AdaptorPlayerHand( player ); + final InventoryAdaptor ia = new AdaptorPlayerHand( player ); - ItemStack fail = ia.addItems( ais.getItemStack() ); + final ItemStack fail = ia.addItems( ais.getItemStack() ); if( fail != null ) { this.cellInv.injectItems( ais, Actionable.MODULATE, this.mySrc ); @@ -1006,13 +1006,13 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { IAEItemStack ais = slotItem.copy(); - long maxSize = ais.getItemStack().getMaxStackSize(); + final long maxSize = ais.getItemStack().getMaxStackSize(); ais.setStackSize( maxSize ); ais = this.cellInv.extractItems( ais, Actionable.SIMULATE, this.mySrc ); if( ais != null ) { - long stackSize = Math.min( maxSize, ais.getStackSize() ); + final long stackSize = Math.min( maxSize, ais.getStackSize() ); ais.setStackSize( ( stackSize + 1 ) >> 1 ); ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); } @@ -1035,7 +1035,7 @@ public abstract class AEBaseContainer extends Container ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais == null ) { - ItemStack is = player.inventory.getItemStack(); + final ItemStack is = player.inventory.getItemStack(); is.stackSize--; if( is.stackSize <= 0 ) { @@ -1049,7 +1049,7 @@ public abstract class AEBaseContainer extends Container case CREATIVE_DUPLICATE: if( player.capabilities.isCreativeMode && slotItem != null ) { - ItemStack is = slotItem.getItemStack(); + final ItemStack is = slotItem.getItemStack(); is.stackSize = is.getMaxStackSize(); player.inventory.setItemStack( is ); this.updateHeld( player ); @@ -1064,7 +1064,7 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { - int playerInv = 9 * 4; + final int playerInv = 9 * 4; for( int slotNum = 0; slotNum < playerInv; slotNum++ ) { IAEItemStack ais = slotItem.copy(); @@ -1072,7 +1072,7 @@ public abstract class AEBaseContainer extends Container ais.setStackSize( myItem.getMaxStackSize() ); - InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); + final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); myItem.stackSize = (int) ais.getStackSize(); myItem = adp.simulateAdd( myItem ); @@ -1099,7 +1099,7 @@ public abstract class AEBaseContainer extends Container } } - protected void updateHeld( EntityPlayerMP p ) + protected void updateHeld( final EntityPlayerMP p ) { if( Platform.isServer() ) { @@ -1107,20 +1107,20 @@ public abstract class AEBaseContainer extends Container { NetworkHandler.instance.sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } } - public ItemStack shiftStoreItem( ItemStack input ) + public ItemStack shiftStoreItem( final ItemStack input ) { if( this.powerSrc == null || this.cellInv == null ) { return input; } - IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc ); + final IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc ); if( ais == null ) { return null; @@ -1128,7 +1128,7 @@ public abstract class AEBaseContainer extends Container return ais.getItemStack(); } - private void updateSlot( Slot clickSlot ) + private void updateSlot( final Slot clickSlot ) { // ??? this.detectAndSendChanges(); @@ -1176,7 +1176,7 @@ public abstract class AEBaseContainer extends Container { NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.customName ), (EntityPlayerMP) this.invPlayer.player ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -1186,10 +1186,10 @@ public abstract class AEBaseContainer extends Container } } - public void swapSlotContents( int slotA, int slotB ) + public void swapSlotContents( final int slotA, final int slotB ) { - Slot a = this.getSlot( slotA ); - Slot b = this.getSlot( slotB ); + final Slot a = this.getSlot( slotA ); + final Slot b = this.getSlot( slotB ); // NPE protection... if( a == null || b == null ) @@ -1197,8 +1197,8 @@ public abstract class AEBaseContainer extends Container return; } - ItemStack isA = a.getStack(); - ItemStack isB = b.getStack(); + final ItemStack isA = a.getStack(); + final ItemStack isB = b.getStack(); // something to do? if( isA == null && isB == null ) @@ -1241,7 +1241,7 @@ public abstract class AEBaseContainer extends Container return; } - int totalA = testA.stackSize; + final int totalA = testA.stackSize; testA.stackSize = a.getSlotStackLimit(); testB = testA.copy(); @@ -1255,7 +1255,7 @@ public abstract class AEBaseContainer extends Container return; } - int totalB = testB.stackSize; + final int totalB = testB.stackSize; testB.stackSize = b.getSlotStackLimit(); testA = testB.copy(); @@ -1266,17 +1266,17 @@ public abstract class AEBaseContainer extends Container b.putStack( testB ); } - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { } - public void onSlotChange( Slot s ) + public void onSlotChange( final Slot s ) { } - public boolean isValidForSlot( Slot s, ItemStack i ) + public boolean isValidForSlot( final Slot s, final ItemStack i ) { return true; } diff --git a/src/main/java/appeng/container/ContainerNull.java b/src/main/java/appeng/container/ContainerNull.java index c1c8ee73..8e94d3ca 100644 --- a/src/main/java/appeng/container/ContainerNull.java +++ b/src/main/java/appeng/container/ContainerNull.java @@ -30,7 +30,7 @@ public class ContainerNull extends Container { @Override - public boolean canInteractWith( EntityPlayer entityplayer ) + public boolean canInteractWith( final EntityPlayer entityplayer ) { return false; } diff --git a/src/main/java/appeng/container/ContainerOpenContext.java b/src/main/java/appeng/container/ContainerOpenContext.java index 0380132b..e5ac25e5 100644 --- a/src/main/java/appeng/container/ContainerOpenContext.java +++ b/src/main/java/appeng/container/ContainerOpenContext.java @@ -36,9 +36,9 @@ public class ContainerOpenContext public int z; public ForgeDirection side; - public ContainerOpenContext( Object myItem ) + public ContainerOpenContext( final Object myItem ) { - boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity; + final boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity; this.isItem = !isWorld; } diff --git a/src/main/java/appeng/container/guisync/SyncData.java b/src/main/java/appeng/container/guisync/SyncData.java index dca07d0d..29726698 100644 --- a/src/main/java/appeng/container/guisync/SyncData.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -41,7 +41,7 @@ public class SyncData private final int channel; private Object clientVersion; - public SyncData( AEBaseContainer container, Field field, GuiSync annotation ) + public SyncData( final AEBaseContainer container, final Field field, final GuiSync annotation ) { this.clientVersion = null; this.source = container; @@ -54,11 +54,11 @@ public class SyncData return this.channel; } - public void tick( ICrafting c ) + public void tick( final ICrafting c ) { try { - Object val = this.field.get( this.source ); + final Object val = this.field.get( this.source ); if( val != null && this.clientVersion == null ) { this.send( c, val ); @@ -68,21 +68,21 @@ public class SyncData this.send( c, val ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } - private void send( ICrafting o, Object val ) throws IOException + private void send( final ICrafting o, final Object val ) throws IOException { if( val instanceof String ) { @@ -111,11 +111,11 @@ public class SyncData this.clientVersion = val; } - public void update( Object val ) + public void update( final Object val ) { try { - Object oldValue = this.field.get( this.source ); + final Object oldValue = this.field.get( this.source ); if( val instanceof String ) { this.updateString( oldValue, (String) val ); @@ -125,40 +125,40 @@ public class SyncData this.updateValue( oldValue, (Long) val ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } } - private void updateString( Object oldValue, String val ) + private void updateString( final Object oldValue, final String val ) { try { this.field.set( this.source, val ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } } - private void updateValue( Object oldValue, long val ) + private void updateValue( final Object oldValue, final long val ) { try { if( this.field.getType().isEnum() ) { - EnumSet valList = EnumSet.allOf( (Class) this.field.getType() ); - for( Enum e : valList ) + final EnumSet valList = EnumSet.allOf( (Class) this.field.getType() ); + for( final Enum e : valList ) { if( e.ordinal() == val ) { @@ -197,11 +197,11 @@ public class SyncData this.source.onUpdate( this.field.getName(), oldValue, this.field.get( this.source ) ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index 5e47aa00..89a20c5e 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -57,15 +57,15 @@ public class ContainerCellWorkbench extends ContainerUpgradeable private int lastUpgrades = 0; private ItemStack LastCell; - public ContainerCellWorkbench( InventoryPlayer ip, TileCellWorkbench te ) + public ContainerCellWorkbench( final InventoryPlayer ip, final TileCellWorkbench te ) { super( ip, te ); this.workBench = te; } - public void setFuzzy( FuzzyMode valueOf ) + public void setFuzzy( final FuzzyMode valueOf ) { - ICellWorkbenchItem cwi = this.workBench.getCell(); + final ICellWorkbenchItem cwi = this.workBench.getCell(); if( cwi != null ) { cwi.setFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ), valueOf ); @@ -91,17 +91,16 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override protected void setupConfig() { - - IInventory cell = this.upgradeable.getInventoryByName( "cell" ); + final IInventory cell = this.upgradeable.getInventoryByName( "cell" ); this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) ); - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IInventory upgradeInventory = new Upgrades(); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory upgradeInventory = new Upgrades(); // null, 3 * 8 ); int offset = 0; - int y = 29; - int x = 8; + final int x = 8; + final int y = 29; for( int w = 0; w < 7; w++ ) { for( int z = 0; z < 9; z++ ) @@ -115,7 +114,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { for( int z = 0; z < 8; z++ ) { - int iSLot = zz * 8 + z; + final int iSLot = zz * 8 + z; this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.invPlayer ) ); } } @@ -132,7 +131,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public int availableUpgrades() { - ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if( this.prevStack != is ) { this.prevStack = is; @@ -144,7 +143,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public void detectAndSendChanges() { - ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if( Platform.isServer() ) { if( this.workBench.getWorldObj().getTileEntity( this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord ) != this.workBench ) @@ -152,18 +151,18 @@ public class ContainerCellWorkbench extends ContainerUpgradeable this.isContainerValid = false; } - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; if( this.prevStack != is ) { // if the bars changed an item was probably made, so just send shit! - for( Object s : this.inventorySlots ) + for( final Object s : this.inventorySlots ) { if( s instanceof OptionalSlotRestrictedInput ) { - OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s; + final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s; icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() ); } } @@ -180,7 +179,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { return idx < this.availableUpgrades(); } @@ -193,7 +192,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "copyMode" ) ) { @@ -205,7 +204,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void clear() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { inv.setInventorySlotContents( x, null ); @@ -215,7 +214,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable private FuzzyMode getFuzzyMode() { - ICellWorkbenchItem cwi = this.workBench.getCell(); + final ICellWorkbenchItem cwi = this.workBench.getCell(); if( cwi != null ) { return cwi.getFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ) ); @@ -225,14 +224,14 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void partition() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); + final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); Iterator i = new NullIterator(); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); i = list.iterator(); } @@ -240,7 +239,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { if( i.hasNext() ) { - ItemStack g = i.next().getItemStack(); + final ItemStack g = i.next().getItemStack(); g.stackSize = 1; inv.setInventorySlotContents( x, g ); } @@ -263,33 +262,33 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return ContainerCellWorkbench.this.getCellUpgradeInventory().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); - ItemStack is = inv.decrStackSize( i, j ); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final ItemStack is = inv.decrStackSize( i, j ); inv.markDirty(); return is; } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); - ItemStack is = inv.getStackInSlotOnClosing( i ); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final ItemStack is = inv.getStackInSlotOnClosing( i ); inv.markDirty(); return is; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); inv.setInventorySlotContents( i, itemstack ); inv.markDirty(); } @@ -319,7 +318,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -335,7 +334,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return ContainerCellWorkbench.this.getCellUpgradeInventory().isItemValidForSlot( i, itemstack ); } diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index 0100f98f..f1ddc2dc 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -31,7 +31,7 @@ public class ContainerChest extends AEBaseContainer final TileChest chest; - public ContainerChest( InventoryPlayer ip, TileChest chest ) + public ContainerChest( final InventoryPlayer ip, final TileChest chest ) { super( ip, chest, null ); this.chest = chest; diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index 94146223..c61c7515 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -43,7 +43,7 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv @GuiSync( 2 ) public CondenserOutput output = CondenserOutput.TRASH; - public ContainerCondenser( InventoryPlayer ip, TileCondenser condenser ) + public ContainerCondenser( final InventoryPlayer ip, final TileCondenser condenser ) { super( ip, condenser, null ); this.condenser = condenser; @@ -60,8 +60,8 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv { if( Platform.isServer() ) { - double maxStorage = this.condenser.getStorage(); - double requiredEnergy = this.condenser.getRequiredPower(); + final double maxStorage = this.condenser.getStorage(); + final double requiredEnergy = this.condenser.getRequiredPower(); this.requiredEnergy = requiredEnergy == 0 ? (int) maxStorage : (int) Math.min( requiredEnergy, maxStorage ); this.storedPower = (int) this.condenser.storedPower; diff --git a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java index ed512352..9b9f22ef 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java @@ -42,7 +42,7 @@ public class ContainerCraftAmount extends AEBaseContainer final ITerminalHost priHost; public IAEItemStack whatToMake; - public ContainerCraftAmount( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftAmount( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); this.priHost = te; @@ -60,7 +60,7 @@ public class ContainerCraftAmount extends AEBaseContainer public IGrid getGrid() { - IActionHost h = ( (IActionHost) this.getTarget() ); + final IActionHost h = ( (IActionHost) this.getTarget() ); return h.getActionableNode().getGrid(); } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index 679a3cc7..6f96ac8a 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -89,13 +89,13 @@ public class ContainerCraftConfirm extends AEBaseContainer public String myName = ""; protected long cpuIdx = Long.MIN_VALUE; - public ContainerCraftConfirm( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftConfirm( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); this.priHost = te; } - public void cycleCpu( boolean next ) + public void cycleCpu( final boolean next ) { if( next ) { @@ -137,15 +137,15 @@ public class ContainerCraftConfirm extends AEBaseContainer return; } - ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); - ImmutableSet cpuSet = cc.getCpus(); + final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); + final ImmutableSet cpuSet = cc.getCpus(); int matches = 0; boolean changed = false; - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { boolean found = false; - for( CraftingCPURecord ccr : this.cpus ) + for( final CraftingCPURecord ccr : this.cpus ) { if( ccr.cpu == c ) { @@ -153,7 +153,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } } - boolean matched = this.cpuMatches( c ); + final boolean matched = this.cpuMatches( c ); if( matched ) { @@ -169,7 +169,7 @@ public class ContainerCraftConfirm extends AEBaseContainer if( changed || this.cpus.size() != matches ) { this.cpus.clear(); - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { if( this.cpuMatches( c ) ) { @@ -206,28 +206,28 @@ public class ContainerCraftConfirm extends AEBaseContainer try { - PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); - PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); - PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; + final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); + final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); + final PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; - IItemList plan = AEApi.instance().storage().createItemList(); + final IItemList plan = AEApi.instance().storage().createItemList(); this.result.populatePlan( plan ); this.bytesUsed = this.result.getByteTotal(); - for( IAEItemStack out : plan ) + for( final IAEItemStack out : plan ) { IAEItemStack o = out.copy(); o.reset(); o.setStackSize( out.getStackSize() ); - IAEItemStack p = out.copy(); + final IAEItemStack p = out.copy(); p.reset(); p.setStackSize( out.getCountRequestable() ); - IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class ); - IMEInventory items = sg.getItemInventory(); + final IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class ); + final IMEInventory items = sg.getItemInventory(); IAEItemStack m = null; if( c != null && this.result.isSimulation() ) @@ -260,7 +260,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } } - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -273,12 +273,12 @@ public class ContainerCraftConfirm extends AEBaseContainer } } } - catch( IOException e ) + catch( final IOException e ) { // :P } } - catch( Throwable e ) + catch( final Throwable e ) { this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) ); AELog.error( e ); @@ -293,11 +293,11 @@ public class ContainerCraftConfirm extends AEBaseContainer public IGrid getGrid() { - IActionHost h = ( (IActionHost) this.getTarget() ); + final IActionHost h = ( (IActionHost) this.getTarget() ); return h.getActionableNode().getGrid(); } - private boolean cpuMatches( ICraftingCPU c ) + private boolean cpuMatches( final ICraftingCPU c ) { return c.getAvailableStorage() >= this.bytesUsed && !c.isBusy(); } @@ -325,7 +325,7 @@ public class ContainerCraftConfirm extends AEBaseContainer { GuiBridge originalGui = null; - IActionHost ah = this.getActionHost(); + final IActionHost ah = this.getActionHost(); if( ah instanceof WirelessTerminalGuiObject ) { originalGui = GuiBridge.GUI_WIRELESS_TERM; @@ -348,14 +348,14 @@ public class ContainerCraftConfirm extends AEBaseContainer if( this.result != null && !this.simulation ) { - ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); - ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); + final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); + final ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); this.autoStart = false; if( g != null && originalGui != null && this.openContext != null ) { NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.invPlayer.player ); - TileEntity te = this.openContext.getTile(); + final TileEntity te = this.openContext.getTile(); Platform.openGUI( this.invPlayer.player, te, this.openContext.side, originalGui ); } } @@ -367,7 +367,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); if( this.job != null ) @@ -378,7 +378,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { super.onContainerClosed( par1EntityPlayer ); if( this.job != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index 8822d72c..bcd9e855 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -63,15 +63,15 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH @GuiSync( 0 ) public long eta = -1; - public ContainerCraftingCPU( InventoryPlayer ip, Object te ) + public ContainerCraftingCPU( final InventoryPlayer ip, final Object te ) { super( ip, te ); - IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null ); + final IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null ); if( host != null ) { this.findNode( host, ForgeDirection.UNKNOWN ); - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { this.findNode( host, d ); } @@ -88,11 +88,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } - private void findNode( IGridHost host, ForgeDirection d ) + private void findNode( final IGridHost host, final ForgeDirection d ) { if( this.network == null ) { - IGridNode node = host.getGridNode( d ); + final IGridNode node = host.getGridNode( d ); if( node != null ) { this.network = node.getGrid(); @@ -100,7 +100,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } - protected void setCPU( ICraftingCPU c ) + protected void setCPU( final ICraftingCPU c ) { if( c == this.monitor ) { @@ -112,7 +112,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.monitor.removeListener( this ); } - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -120,7 +120,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -154,7 +154,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); @@ -165,7 +165,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); if( this.monitor != null ) @@ -190,11 +190,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.eta = eta; } - PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); - PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); - PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 ); + final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); + final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); + final PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 ); - for( IAEItemStack out : this.list ) + for( final IAEItemStack out : this.list ) { a.appendItem( this.monitor.getItemStack( out, CraftingItemList.STORAGE ) ); b.appendItem( this.monitor.getItemStack( out, CraftingItemList.ACTIVE ) ); @@ -203,7 +203,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.list.resetStatus(); - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -224,7 +224,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } } - catch( IOException e ) + catch( final IOException e ) { // :P } @@ -233,13 +233,13 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return true; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource actionSource ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource ) { for( IAEItemStack is : change ) { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java index 8e56a71a..ee98ecde 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java @@ -43,7 +43,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU @GuiSync( 7 ) public String myName = ""; - public ContainerCraftingStatus( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftingStatus( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); } @@ -51,15 +51,15 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU @Override public void detectAndSendChanges() { - ICraftingGrid cc = this.network.getCache( ICraftingGrid.class ); - ImmutableSet cpuSet = cc.getCpus(); + final ICraftingGrid cc = this.network.getCache( ICraftingGrid.class ); + final ImmutableSet cpuSet = cc.getCpus(); int matches = 0; boolean changed = false; - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { boolean found = false; - for( CraftingCPURecord ccr : this.cpus ) + for( final CraftingCPURecord ccr : this.cpus ) { if( ccr.cpu == c ) { @@ -67,7 +67,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU } } - boolean matched = this.cpuMatches( c ); + final boolean matched = this.cpuMatches( c ); if( matched ) { @@ -83,7 +83,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU if( changed || this.cpus.size() != matches ) { this.cpus.clear(); - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { if( this.cpuMatches( c ) ) { @@ -99,7 +99,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU super.detectAndSendChanges(); } - private boolean cpuMatches( ICraftingCPU c ) + private boolean cpuMatches( final ICraftingCPU c ) { return c.isBusy(); } @@ -136,7 +136,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU } } - public void cycleCpu( boolean next ) + public void cycleCpu( final boolean next ) { if( next ) { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index 39cb8dcb..423df4c5 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -44,12 +44,12 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9]; final SlotCraftingTerm outputSlot; - public ContainerCraftingTerm( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerCraftingTerm( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); this.ct = (PartCraftingTerminal) monitorable; - IInventory crafting = this.ct.getInventoryByName( "crafting" ); + final IInventory crafting = this.ct.getInventoryByName( "crafting" ); for( int y = 0; y < 3; y++ ) { @@ -70,10 +70,10 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE * Callback for when the crafting matrix is changed. */ @Override - public void onCraftMatrixChanged( IInventory par1IInventory ) + public void onCraftMatrixChanged( final IInventory par1IInventory ) { - ContainerNull cn = new ContainerNull(); - InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 ); + final ContainerNull cn = new ContainerNull(); + final InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 ); for( int x = 0; x < 9; x++ ) { @@ -90,13 +90,13 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "player" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index a00a94d1..b5d88402 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -31,7 +31,7 @@ public class ContainerDrive extends AEBaseContainer final TileDrive drive; - public ContainerDrive( InventoryPlayer ip, TileDrive drive ) + public ContainerDrive( final InventoryPlayer ip, final TileDrive drive ) { super( ip, drive, null ); this.drive = drive; diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index 4ec34bc0..641a950b 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 @GuiSync( 6 ) public YesNo placeMode; - public ContainerFormationPlane( InventoryPlayer ip, PartFormationPlane te ) + public ContainerFormationPlane( final InventoryPlayer ip, final PartFormationPlane te ) { super( ip, te ); this.storageBus = te; @@ -58,10 +58,10 @@ public class ContainerFormationPlane extends ContainerUpgradeable @Override protected void setupConfig() { - int xo = 8; - int yo = 23 + 6; + final int xo = 8; + final int yo = 23 + 6; - IInventory config = this.upgradeable.getInventoryByName( "config" ); + final IInventory config = this.upgradeable.getInventoryByName( "config" ); for( int y = 0; y < 7; y++ ) { for( int x = 0; x < 9; x++ ) @@ -77,7 +77,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); @@ -112,9 +112,9 @@ public class ContainerFormationPlane extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index b187746c..968913f3 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -33,7 +33,7 @@ public class ContainerGrinder extends AEBaseContainer final TileGrinder grinder; - public ContainerGrinder( InventoryPlayer ip, TileGrinder grinder ) + public ContainerGrinder( final InventoryPlayer ip, final TileGrinder grinder ) { super( ip, grinder, null ); this.grinder = grinder; diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index 2dcb2538..ab1225fa 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -44,7 +44,7 @@ public class ContainerIOPort extends ContainerUpgradeable @GuiSync( 3 ) public OperationMode opMode = OperationMode.EMPTY; - public ContainerIOPort( InventoryPlayer ip, TileIOPort te ) + public ContainerIOPort( final InventoryPlayer ip, final TileIOPort te ) { super( ip, te ); this.ioPort = te; @@ -62,7 +62,7 @@ public class ContainerIOPort extends ContainerUpgradeable int offX = 19; int offY = 17; - IInventory cells = this.upgradeable.getInventoryByName( "cells" ); + final IInventory cells = this.upgradeable.getInventoryByName( "cells" ); for( int y = 0; y < 3; y++ ) { @@ -82,7 +82,7 @@ public class ContainerIOPort extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index 91001f15..9281bbb7 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -55,7 +55,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres @GuiSync( 3 ) public int processingTime = -1; - public ContainerInscriber( InventoryPlayer ip, TileInscriber te ) + public ContainerInscriber( final InventoryPlayer ip, final TileInscriber te ) { super( ip, te ); this.ti = te; @@ -106,14 +106,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres } @Override - public boolean isValidForSlot( Slot s, ItemStack is ) + public boolean isValidForSlot( final Slot s, final ItemStack is ) { - ItemStack top = this.ti.getStackInSlot( 0 ); - ItemStack bot = this.ti.getStackInSlot( 1 ); + final ItemStack top = this.ti.getStackInSlot( 0 ); + final ItemStack bot = this.ti.getStackInSlot( 1 ); if( s == this.middle ) { - for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optional, is ) ) { @@ -124,18 +124,18 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres boolean matches = false; boolean found = false; - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and... ( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) ); - boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and... ( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) ); if( matchA || matchB ) { matches = true; - for( ItemStack option : recipe.getInputs() ) + for( final ItemStack option : recipe.getInputs() ) { if( Platform.isSameItemPrecise( is, option ) ) { @@ -172,7 +172,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres // everything else boolean isValid = false; - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index 565d33c3..ea326e56 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -44,7 +44,7 @@ public class ContainerInterface extends ContainerUpgradeable @GuiSync( 4 ) public YesNo iTermMode = YesNo.YES; - public ContainerInterface( InventoryPlayer ip, IInterfaceHost te ) + public ContainerInterface( final InventoryPlayer ip, final IInterfaceHost te ) { super( ip, te.getInterfaceDuality().getHost() ); @@ -92,7 +92,7 @@ public class ContainerInterface extends ContainerUpgradeable } @Override - protected void loadSettingsFromHost( IConfigManager cm ) + protected void loadSettingsFromHost( final IConfigManager cm ) { this.bMode = (YesNo) cm.getSetting( Settings.BLOCK ); this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL ); diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index 2852226b..525796bc 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -67,7 +67,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer IGrid grid; NBTTagCompound data = new NBTTagCompound(); - public ContainerInterfaceTerminal( InventoryPlayer ip, PartInterfaceTerminal anchor ) + public ContainerInterfaceTerminal( final InventoryPlayer ip, final PartInterfaceTerminal anchor ) { super( ip, anchor ); @@ -97,23 +97,23 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer int total = 0; boolean missing = false; - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode agn = host.getActionableNode(); + final IGridNode agn = host.getActionableNode(); if( agn != null && agn.isActive() ) { - for( IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) { if( gn.isActive() ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) { continue; } - InvTracker t = this.diList.get( ih ); + final InvTracker t = this.diList.get( ih ); if( t == null ) { @@ -121,7 +121,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - DualityInterface dual = ih.getInterfaceDuality(); + final DualityInterface dual = ih.getInterfaceDuality(); if( !t.unlocalizedName.equals( dual.getTermName() ) ) { missing = true; @@ -132,17 +132,17 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } } - for( IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) { if( gn.isActive() ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) { continue; } - InvTracker t = this.diList.get( ih ); + final InvTracker t = this.diList.get( ih ); if( t == null ) { @@ -150,7 +150,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - DualityInterface dual = ih.getInterfaceDuality(); + final DualityInterface dual = ih.getInterfaceDuality(); if( !t.unlocalizedName.equals( dual.getTermName() ) ) { missing = true; @@ -169,9 +169,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - for( Entry en : this.diList.entrySet() ) + for( final Entry en : this.diList.entrySet() ) { - InvTracker inv = en.getValue(); + final InvTracker inv = en.getValue(); for( int x = 0; x < inv.server.getSizeInventory(); x++ ) { if( this.isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) ) @@ -188,7 +188,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer { NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player ); } - catch( IOException e ) + catch( final IOException e ) { // :P } @@ -198,20 +198,20 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } @Override - public void doAction( EntityPlayerMP player, InventoryAction action, int slot, long id ) + public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) { - InvTracker inv = this.byId.get( id ); + final InvTracker inv = this.byId.get( id ); if( inv != null ) { - ItemStack is = inv.server.getStackInSlot( slot ); - boolean hasItemInHand = player.inventory.getItemStack() != null; + final ItemStack is = inv.server.getStackInSlot( slot ); + final boolean hasItemInHand = player.inventory.getItemStack() != null; - InventoryAdaptor playerHand = new AdaptorPlayerHand( player ); + final InventoryAdaptor playerHand = new AdaptorPlayerHand( player ); - WrapperInvSlot slotInv = new PatternInvSlot( inv.server ); + final WrapperInvSlot slotInv = new PatternInvSlot( inv.server ); - IInventory theSlot = slotInv.getWrapper( slot ); - InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot ); + final IInventory theSlot = slotInv.getWrapper( slot ); + final InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot ); switch( action ) { @@ -227,7 +227,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer else { inSlot = inSlot.copy(); - ItemStack inHand = player.inventory.getItemStack().copy(); + final ItemStack inHand = player.inventory.getItemStack().copy(); theSlot.setInventorySlotContents( 0, null ); player.inventory.setItemStack( null ); @@ -247,7 +247,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - IInventory mySlot = slotInv.getWrapper( slot ); + final IInventory mySlot = slotInv.getWrapper( slot ); mySlot.setInventorySlotContents( 0, playerHand.addItems( mySlot.getStackInSlot( 0 ) ) ); } @@ -282,14 +282,14 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer break; case SHIFT_CLICK: - IInventory mySlot = slotInv.getWrapper( slot ); - InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); + final IInventory mySlot = slotInv.getWrapper( slot ); + final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); mySlot.setInventorySlotContents( 0, playerInv.addItems( mySlot.getStackInSlot( 0 ) ) ); break; case MOVE_REGION: - InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); + final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); for( int x = 0; x < inv.server.getSizeInventory(); x++ ) { inv.server.setInventorySlotContents( x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) ); @@ -312,31 +312,31 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } } - private void regenList( NBTTagCompound data ) + private void regenList( final NBTTagCompound data ) { this.byId.clear(); this.diList.clear(); - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode agn = host.getActionableNode(); + final IGridNode agn = host.getActionableNode(); if( agn != null && agn.isActive() ) { - for( IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); - DualityInterface dual = ih.getInterfaceDuality(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); } } - for( IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); - DualityInterface dual = ih.getInterfaceDuality(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); @@ -347,15 +347,15 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer data.setBoolean( "clear", true ); - for( Entry en : this.diList.entrySet() ) + for( final Entry en : this.diList.entrySet() ) { - InvTracker inv = en.getValue(); + final InvTracker inv = en.getValue(); this.byId.put( inv.which, inv ); this.addItems( data, inv, 0, inv.server.getSizeInventory() ); } } - private boolean isDifferent( ItemStack a, ItemStack b ) + private boolean isDifferent( final ItemStack a, final ItemStack b ) { if( a == null && b == null ) { @@ -370,10 +370,10 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer return !ItemStack.areItemStacksEqual( a, b ); } - private void addItems( NBTTagCompound data, InvTracker inv, int offset, int length ) + private void addItems( final NBTTagCompound data, final InvTracker inv, final int offset, final int length ) { - String name = '=' + Long.toString( inv.which, Character.MAX_RADIX ); - NBTTagCompound tag = data.getCompoundTag( name ); + final String name = '=' + Long.toString( inv.which, Character.MAX_RADIX ); + final NBTTagCompound tag = data.getCompoundTag( name ); if( tag.hasNoTags() ) { @@ -383,9 +383,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer for( int x = 0; x < length; x++ ) { - NBTTagCompound itemNBT = new NBTTagCompound(); + final NBTTagCompound itemNBT = new NBTTagCompound(); - ItemStack is = inv.server.getStackInSlot( x + offset ); + final ItemStack is = inv.server.getStackInSlot( x + offset ); // "update" client side. inv.client.setInventorySlotContents( x + offset, is == null ? null : is.copy() ); @@ -410,7 +410,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer final IInventory client; final IInventory server; - public InvTracker( DualityInterface dual, IInventory patterns, String unlocalizedName ) + public InvTracker( final DualityInterface dual, final IInventory patterns, final String unlocalizedName ) { this.server = patterns; this.client = new AppEngInternalInventory( null, this.server.getSizeInventory() ); @@ -422,13 +422,13 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer static class PatternInvSlot extends WrapperInvSlot { - public PatternInvSlot( IInventory inv ) + public PatternInvSlot( final IInventory inv ) { super( inv ); } @Override - public boolean isItemValid( ItemStack itemstack ) + public boolean isItemValid( final ItemStack itemstack ) { return itemstack != null && itemstack.getItem() instanceof ItemEncodedPattern; } diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index b280c446..7c0f798b 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -54,20 +54,20 @@ public class ContainerLevelEmitter extends ContainerUpgradeable @GuiSync( 4 ) public YesNo cmType; - public ContainerLevelEmitter( InventoryPlayer ip, PartLevelEmitter te ) + public ContainerLevelEmitter( final InventoryPlayer ip, final PartLevelEmitter te ) { super( ip, te ); this.lvlEmitter = te; } @SideOnly( Side.CLIENT ) - public void setTextField( GuiTextField level ) + public void setTextField( final GuiTextField level ) { this.textField = level; this.textField.setText( String.valueOf( this.EmitterValue ) ); } - public void setLevel( long l, EntityPlayer player ) + public void setLevel( final long l, final EntityPlayer player ) { this.lvlEmitter.setReportingValue( l ); this.EmitterValue = l; @@ -76,8 +76,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable @Override protected void setupConfig() { - - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); @@ -95,9 +94,10 @@ public class ContainerLevelEmitter extends ContainerUpgradeable this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() ); } - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - int y = 40; - int x = 80 + 44; + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final int y = 40; + final int x = 80 + 44; + this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); } @@ -132,7 +132,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final 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 81d49d30..22942b98 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -46,17 +46,17 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi @GuiSync( 4 ) public int craftProgress = 0; - public ContainerMAC( InventoryPlayer ip, TileMolecularAssembler te ) + public ContainerMAC( final InventoryPlayer ip, final TileMolecularAssembler te ) { super( ip, te ); this.tma = te; } - public boolean isValidItemForSlot( int slotIndex, ItemStack i ) + public boolean isValidItemForSlot( final int slotIndex, final ItemStack i ) { - IInventory mac = this.upgradeable.getInventoryByName( "mac" ); + final IInventory mac = this.upgradeable.getInventoryByName( "mac" ); - ItemStack is = mac.getStackInSlot( 10 ); + final ItemStack is = mac.getStackInSlot( 10 ); if( is == null ) { return false; @@ -64,9 +64,9 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi if( is.getItem() instanceof ItemEncodedPattern ) { - World w = this.getTileEntity().getWorldObj(); - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); + final World w = this.getTileEntity().getWorldObj(); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); if( ph.isCraftable() ) { return ph.isValidItemForSlot( slotIndex, i, w ); @@ -88,13 +88,13 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi int offX = 29; int offY = 30; - IInventory mac = this.upgradeable.getInventoryByName( "mac" ); + final IInventory mac = this.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 ); + final SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); this.addSlotToContainer( s ); } } @@ -108,7 +108,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi offX = 122; offY = 17; - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index 525848f6..413f117a 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -85,12 +85,12 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa IConfigManager serverCM; private IGridNode networkNode; - public ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable ) { this( ip, monitorable, true ); } - protected ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory ) + protected ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory ) { super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, monitorable instanceof IPart ? (IPart) monitorable : null ); @@ -122,11 +122,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } else if( monitorable instanceof IGridHost ) { - IGridNode node = ( (IGridHost) monitorable ).getGridNode( ForgeDirection.UNKNOWN ); + final IGridNode node = ( (IGridHost) monitorable ).getGridNode( ForgeDirection.UNKNOWN ); if( node != null ) { this.networkNode = node; - IGrid g = node.getGrid(); + final IGrid g = node.getGrid(); if( g != null ) { this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergySource) g.getCache( IEnergyGrid.class ) ); @@ -176,21 +176,21 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.isContainerValid = false; } - for( Settings set : this.serverCM.getSettings() ) + for( final Settings set : this.serverCM.getSettings() ) { - Enum sideLocal = this.serverCM.getSetting( set ); - Enum sideRemote = this.clientCM.getSetting( set ); + final Enum sideLocal = this.serverCM.getSetting( set ); + final Enum sideRemote = this.clientCM.getSetting( set ); if( sideLocal != sideRemote ) { this.clientCM.putSetting( set, sideLocal ); - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { try { NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -202,13 +202,13 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { try { - IItemList monitorCache = this.monitor.getStorageList(); + final IItemList monitorCache = this.monitor.getStorageList(); - PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); + final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - for( IAEItemStack is : this.items ) + for( final IAEItemStack is : this.items ) { - IAEItemStack send = monitorCache.findPrecise( is ); + final IAEItemStack send = monitorCache.findPrecise( is ); if( send == null ) { is.setStackSize( 0 ); @@ -224,7 +224,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { this.items.resetStatus(); - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof EntityPlayer ) { @@ -233,7 +233,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -241,7 +241,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.updatePowerStatus(); - boolean oldAccessible = this.canAccessViewCells; + final boolean oldAccessible = this.canAccessViewCells; this.canAccessViewCells = this.hasAccess( SecurityPermissions.BUILD, false ); if( this.canAccessViewCells != oldAccessible ) { @@ -275,14 +275,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.hasPower = this.powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8; } } - catch( Throwable t ) + catch( final Throwable t ) { // :P } } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "canAccessViewCells" ) ) { @@ -299,28 +299,28 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void addCraftingToCrafters( ICrafting c ) + public void addCraftingToCrafters( final ICrafting c ) { super.addCraftingToCrafters( c ); this.queueInventory( c ); } - public void queueInventory( ICrafting c ) + public void queueInventory( final ICrafting c ) { if( Platform.isServer() && c instanceof EntityPlayer && this.monitor != null ) { try { PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - IItemList monitorCache = this.monitor.getStorageList(); + final IItemList monitorCache = this.monitor.getStorageList(); - for( IAEItemStack send : monitorCache ) + for( final IAEItemStack send : monitorCache ) { try { piu.appendItem( send ); } - catch( BufferOverflowException boe ) + catch( final BufferOverflowException boe ) { NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c ); @@ -331,7 +331,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -339,7 +339,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); @@ -350,7 +350,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); if( this.monitor != null ) @@ -360,15 +360,15 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return true; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { - for( IAEItemStack is : change ) + for( final IAEItemStack is : change ) { this.items.add( is ); } @@ -377,18 +377,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa @Override public void onListUpdate() { - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof ICrafting ) { - ICrafting cr = (ICrafting) c; + final ICrafting cr = (ICrafting) c; this.queueInventory( cr ); } } } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.gui != null ) { @@ -408,7 +408,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa public ItemStack[] getViewCells() { - ItemStack[] list = new ItemStack[this.cellView.length]; + final ItemStack[] list = new ItemStack[this.cellView.length]; for( int x = 0; x < this.cellView.length; x++ ) { diff --git a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java index 4aad8c4b..777305ad 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java +++ b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java @@ -38,12 +38,12 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable private int ticks = 0; private final int slot; - public ContainerMEPortableCell( InventoryPlayer ip, IPortableCell monitorable ) + public ContainerMEPortableCell( final InventoryPlayer ip, final IPortableCell monitorable ) { super( ip, monitorable, false ); if( monitorable instanceof IInventorySlotAware ) { - int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot(); + final int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot(); this.lockPlayerInventorySlot( slotIndex ); this.slot = slotIndex; } @@ -59,7 +59,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable @Override public void detectAndSendChanges() { - ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot ); + final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot ); if( this.civ != null ) { diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java index b106291f..03ed286a 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java @@ -58,15 +58,15 @@ public class ContainerNetworkStatus extends AEBaseContainer IGrid network; int delay = 40; - public ContainerNetworkStatus( InventoryPlayer ip, INetworkTool te ) + public ContainerNetworkStatus( final InventoryPlayer ip, final INetworkTool te ) { super( ip, null, null ); - IGridHost host = te.getGridHost(); + final IGridHost host = te.getGridHost(); if( host != null ) { this.findNode( host, ForgeDirection.UNKNOWN ); - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { this.findNode( host, d ); } @@ -78,11 +78,11 @@ public class ContainerNetworkStatus extends AEBaseContainer } } - private void findNode( IGridHost host, ForgeDirection d ) + private void findNode( final IGridHost host, final ForgeDirection d ) { if( this.network == null ) { - IGridNode node = host.getGridNode( d ); + final IGridNode node = host.getGridNode( d ); if( node != null ) { this.network = node.getGrid(); @@ -98,7 +98,7 @@ public class ContainerNetworkStatus extends AEBaseContainer { this.delay = 0; - IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); if( eg != null ) { this.avgAddition = (long) ( 100.0 * eg.getAvgPowerInjection() ); @@ -109,31 +109,31 @@ public class ContainerNetworkStatus extends AEBaseContainer try { - PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); + final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - for( Class machineClass : this.network.getMachinesClasses() ) + for( final Class machineClass : this.network.getMachinesClasses() ) { - IItemList list = AEApi.instance().storage().createItemList(); - for( IGridNode machine : this.network.getMachines( machineClass ) ) + final IItemList list = AEApi.instance().storage().createItemList(); + for( final IGridNode machine : this.network.getMachines( machineClass ) ) { - IGridBlock blk = machine.getGridBlock(); - ItemStack is = blk.getMachineRepresentation(); + final IGridBlock blk = machine.getGridBlock(); + final ItemStack is = blk.getMachineRepresentation(); if( is != null && is.getItem() != null ) { - IAEItemStack ais = AEItemStack.create( is ); + final IAEItemStack ais = AEItemStack.create( is ); ais.setStackSize( 1 ); ais.setCountRequestable( (long) ( blk.getIdlePowerUsage() * 100.0 ) ); list.add( ais ); } } - for( IAEItemStack ais : list ) + for( final IAEItemStack ais : list ) { piu.appendItem( ais ); } } - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof EntityPlayer ) { @@ -141,7 +141,7 @@ public class ContainerNetworkStatus extends AEBaseContainer } } } - catch( IOException e ) + catch( final IOException e ) { // :P } diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 3cebae3f..db1ae73c 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -38,7 +38,7 @@ public class ContainerNetworkTool extends AEBaseContainer @GuiSync( 1 ) public boolean facadeMode; - public ContainerNetworkTool( InventoryPlayer ip, INetworkTool te ) + public ContainerNetworkTool( final InventoryPlayer ip, final INetworkTool te ) { super( ip, null, null ); this.toolInv = te; @@ -58,7 +58,7 @@ public class ContainerNetworkTool extends AEBaseContainer public void toggleFacadeMode() { - NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() ); + final NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() ); data.setBoolean( "hideFacades", !data.getBoolean( "hideFacades" ) ); this.detectAndSendChanges(); } @@ -66,7 +66,7 @@ public class ContainerNetworkTool extends AEBaseContainer @Override public void detectAndSendChanges() { - ItemStack currentItem = this.getPlayerInv().getCurrentItem(); + final ItemStack currentItem = this.getPlayerInv().getCurrentItem(); if( currentItem != this.toolInv.getItemStack() ) { @@ -89,7 +89,7 @@ public class ContainerNetworkTool extends AEBaseContainer if( this.isContainerValid ) { - NBTTagCompound data = Platform.openNbtData( currentItem ); + final NBTTagCompound data = Platform.openNbtData( currentItem ); this.facadeMode = data.getBoolean( "hideFacades" ); } diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index 2573c7a2..07ceda66 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -81,13 +81,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA @GuiSync( 97 ) public boolean craftingMode = true; - public ContainerPatternTerm( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerPatternTerm( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); this.ct = (PartPatternTerminal) monitorable; - IInventory patternInv = this.ct.getInventoryByName( "pattern" ); - IInventory output = this.ct.getInventoryByName( "output" ); + final IInventory patternInv = this.ct.getInventoryByName( "pattern" ); + final IInventory output = this.ct.getInventoryByName( "output" ); this.crafting = this.ct.getInventoryByName( "crafting" ); for( int y = 0; y < 3; y++ ) @@ -140,14 +140,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void putStackInSlot( int par1, ItemStack par2ItemStack ) + public void putStackInSlot( final int par1, final ItemStack par2ItemStack ) { super.putStackInSlot( par1, par2ItemStack ); this.getAndUpdateOutput(); } @Override - public void putStacksInSlots( ItemStack[] par1ArrayOfItemStack ) + public void putStacksInSlots( final ItemStack[] par1ArrayOfItemStack ) { super.putStacksInSlots( par1ArrayOfItemStack ); this.getAndUpdateOutput(); @@ -155,13 +155,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public ItemStack getAndUpdateOutput() { - InventoryCrafting ic = new InventoryCrafting( this, 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( this, 3, 3 ); for( int x = 0; x < ic.getSizeInventory(); x++ ) { ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) ); } - ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ); + final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ); this.cOut.setInventorySlotContents( 0, is ); return is; } @@ -173,7 +173,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @@ -182,8 +182,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { ItemStack output = this.patternSlotOUT.getStack(); - ItemStack[] in = this.getInputs(); - ItemStack[] out = this.getOutputs(); + final ItemStack[] in = this.getInputs(); + final ItemStack[] out = this.getOutputs(); // if there is no input, this would be silly. if( in == null || out == null ) @@ -212,7 +212,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } // add a new encoded pattern. - for( ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() ) + for( final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() ) { output = encodedPatternStack; this.patternSlotOUT.putStack( output ); @@ -220,17 +220,17 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } // encode the slot. - NBTTagCompound encodedValue = new NBTTagCompound(); + final NBTTagCompound encodedValue = new NBTTagCompound(); - NBTTagList tagIn = new NBTTagList(); - NBTTagList tagOut = new NBTTagList(); + final NBTTagList tagIn = new NBTTagList(); + final NBTTagList tagOut = new NBTTagList(); - for( ItemStack i : in ) + for( final ItemStack i : in ) { tagIn.appendTag( this.createItemTag( i ) ); } - for( ItemStack i : out ) + for( final ItemStack i : out ) { tagOut.appendTag( this.createItemTag( i ) ); } @@ -244,7 +244,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA private ItemStack[] getInputs() { - ItemStack[] input = new ItemStack[9]; + final ItemStack[] input = new ItemStack[9]; boolean hasValue = false; for( int x = 0; x < this.craftingSlots.length; x++ ) @@ -268,7 +268,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { if( this.craftingMode ) { - ItemStack out = this.getAndUpdateOutput(); + final ItemStack out = this.getAndUpdateOutput(); if( out != null && out.stackSize > 0 ) { return new ItemStack[] { out }; @@ -276,12 +276,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } else { - List list = new ArrayList( 3 ); + final List list = new ArrayList( 3 ); boolean hasValue = false; - for( OptionalSlotFake outputSlot : this.outputSlots ) + for( final OptionalSlotFake outputSlot : this.outputSlots ) { - ItemStack out = outputSlot.getStack(); + final ItemStack out = outputSlot.getStack(); if( out != null && out.stackSize > 0 ) { list.add( out ); @@ -298,7 +298,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return null; } - private boolean isPattern( ItemStack output ) + private boolean isPattern( final ItemStack output ) { if( output == null ) { @@ -313,9 +313,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return isPattern; } - private NBTBase createItemTag( ItemStack i ) + private NBTBase createItemTag( final ItemStack i ) { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); if( i != null ) { @@ -326,7 +326,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { if( idx == 1 ) { @@ -342,14 +342,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } } - public void craftOrGetItem( PacketPatternSlot packetPatternSlot ) + public void craftOrGetItem( final PacketPatternSlot packetPatternSlot ) { if( packetPatternSlot.slotItem != null && this.cellInv != null ) { - IAEItemStack out = packetPatternSlot.slotItem.copy(); + final IAEItemStack out = packetPatternSlot.slotItem.copy(); InventoryAdaptor inv = new AdaptorPlayerHand( this.getPlayerInv().player ); - InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, ForgeDirection.UNKNOWN ); + final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, ForgeDirection.UNKNOWN ); if( packetPatternSlot.shift ) { inv = playerInv; @@ -360,8 +360,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return; } - IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc ); - EntityPlayer p = this.getPlayerInv().player; + final IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc ); + final EntityPlayer p = this.getPlayerInv().player; if( extracted != null ) { @@ -374,44 +374,44 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return; } - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack() ); } - IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); if( r == null ) { return; } - IMEMonitor storage = this.ct.getItemInventory(); - IItemList all = storage.getStorageList(); + final IMEMonitor storage = this.ct.getItemInventory(); + final IItemList all = storage.getStorageList(); - ItemStack is = r.getCraftingResult( ic ); + final ItemStack is = r.getCraftingResult( ic ); for( int x = 0; x < ic.getSizeInventory(); x++ ) { if( ic.getStackInSlot( x ) != null ) { - ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) ); + final ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) ); real.setInventorySlotContents( x, pulled ); } } - IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj ); + final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj ); if( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) ) { - SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 ); + final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 ); sc.onPickupFromSlot( p, is ); for( int x = 0; x < real.getSizeInventory(); x++ ) { - ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) ); + final ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) ); if( failed != null ) { p.dropPlayerItemWithRandomChoice( failed, false ); @@ -429,7 +429,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { for( int x = 0; x < real.getSizeInventory(); x++ ) { - ItemStack failed = real.getStackInSlot( x ); + final ItemStack failed = real.getStackInSlot( x ); if( failed != null ) { this.cellInv.injectItems( AEItemStack.create( failed ), Actionable.MODULATE, new MachineSource( this.ct ) ); @@ -454,7 +454,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { super.onUpdate( field, oldValue, newValue ); @@ -466,19 +466,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onSlotChange( Slot s ) + public void onSlotChange( final Slot s ) { if( s == this.patternSlotOUT && Platform.isServer() ) { - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; - for( Object g : this.inventorySlots ) + for( final Object g : this.inventorySlots ) { if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix ) { - Slot sri = (Slot) g; + final Slot sri = (Slot) g; icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() ); } } @@ -490,12 +490,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public void clear() { - for( Slot s : this.craftingSlots ) + for( final Slot s : this.craftingSlots ) { s.putStack( null ); } - for( Slot s : this.outputSlots ) + for( final Slot s : this.outputSlots ) { s.putStack( null ); } @@ -505,7 +505,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "player" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerPriority.java b/src/main/java/appeng/container/implementations/ContainerPriority.java index a554957f..fb2ca8a7 100644 --- a/src/main/java/appeng/container/implementations/ContainerPriority.java +++ b/src/main/java/appeng/container/implementations/ContainerPriority.java @@ -45,20 +45,20 @@ public class ContainerPriority extends AEBaseContainer @GuiSync( 2 ) public long PriorityValue = -1; - public ContainerPriority( InventoryPlayer ip, IPriorityHost te ) + public ContainerPriority( final InventoryPlayer ip, final IPriorityHost te ) { super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) ); this.priHost = te; } @SideOnly( Side.CLIENT ) - public void setTextField( GuiTextField level ) + public void setTextField( final GuiTextField level ) { this.textField = level; this.textField.setText( String.valueOf( this.PriorityValue ) ); } - public void setPriority( int newValue, EntityPlayer player ) + public void setPriority( final int newValue, final EntityPlayer player ) { this.priHost.setPriority( newValue ); this.PriorityValue = newValue; @@ -77,7 +77,7 @@ public class ContainerPriority extends AEBaseContainer } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "PriorityValue" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index 25956d5d..1d210049 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -31,7 +31,7 @@ public class ContainerQNB extends AEBaseContainer final TileQuantumBridge quantumBridge; - public ContainerQNB( InventoryPlayer ip, TileQuantumBridge quantumBridge ) + public ContainerQNB( final InventoryPlayer ip, final TileQuantumBridge quantumBridge ) { super( ip, quantumBridge, null ); this.quantumBridge = quantumBridge; diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index df53d532..0f526848 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -48,7 +48,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn final QuartzKnifeOutput output; String myName = ""; - public ContainerQuartzKnife( InventoryPlayer ip, QuartzKnifeObj te ) + public ContainerQuartzKnife( final InventoryPlayer ip, final QuartzKnifeObj te ) { super( ip, null, null ); this.toolInv = te; @@ -61,7 +61,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn this.bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 ); } - public void setName( String value ) + public void setName( final String value ) { this.myName = value; } @@ -69,7 +69,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @Override public void detectAndSendChanges() { - ItemStack currentItem = this.getPlayerInv().getCurrentItem(); + final ItemStack currentItem = this.getPlayerInv().getCurrentItem(); if( currentItem != this.toolInv.getItemStack() ) { @@ -94,7 +94,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { if( this.inSlot.getStackInSlot( 0 ) != null ) { @@ -109,7 +109,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @@ -121,9 +121,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { - ItemStack input = this.inSlot.getStackInSlot( 0 ); + final ItemStack input = this.inSlot.getStackInSlot( 0 ); if( input == null ) { return null; @@ -133,7 +133,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn { if( this.myName.length() > 0 ) { - for( ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() ) + for( final ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() ) { final NBTTagCompound compound = Platform.openNbtData( namePressStack ); compound.setString( "InscribeName", this.myName ); @@ -147,9 +147,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { - ItemStack is = this.getStackInSlot( 0 ); + final ItemStack is = this.getStackInSlot( 0 ); if( is != null ) { if( this.makePlate() ) @@ -164,7 +164,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn { if( this.inSlot.decrStackSize( 0, 1 ) != null ) { - ItemStack item = this.toolInv.getItemStack(); + final ItemStack item = this.toolInv.getItemStack(); item.damageItem( 1, this.getPlayerInv().player ); if( item.stackSize == 0 ) @@ -179,13 +179,13 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { if( var2 == null && Platform.isServer() ) { @@ -218,7 +218,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return false; } @@ -236,7 +236,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public boolean isItemValidForSlot( int var1, ItemStack var2 ) + public boolean isItemValidForSlot( final int var1, final ItemStack var2 ) { return false; } diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index 31325b76..6034c25e 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -54,7 +54,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE @GuiSync( 0 ) public int security = 0; - public ContainerSecurity( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerSecurity( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); @@ -68,16 +68,16 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.bindPlayerInventory( ip, 0, 0 ); } - public void toggleSetting( String value, EntityPlayer player ) + public void toggleSetting( final String value, final EntityPlayer player ) { try { - SecurityPermissions permission = SecurityPermissions.valueOf( value ); + final SecurityPermissions permission = SecurityPermissions.valueOf( value ); - ItemStack a = this.configSlot.getStack(); + final ItemStack a = this.configSlot.getStack(); if( a != null && a.getItem() instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) a.getItem(); + final IBiometricCard bc = (IBiometricCard) a.getItem(); if( bc.hasPermission( a, permission ) ) { bc.removePermission( a, permission ); @@ -88,7 +88,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } } } - catch( EnumConstantNotPresentException ex ) + catch( final EnumConstantNotPresentException ex ) { // :( } @@ -101,12 +101,12 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.security = 0; - ItemStack a = this.configSlot.getStack(); + final ItemStack a = this.configSlot.getStack(); if( a != null && a.getItem() instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) a.getItem(); + final IBiometricCard bc = (IBiometricCard) a.getItem(); - for( SecurityPermissions sp : bc.getPermissions( a ) ) + for( final SecurityPermissions sp : bc.getPermissions( a ) ) { this.security |= ( 1 << sp.ordinal() ); } @@ -118,7 +118,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); @@ -140,13 +140,13 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( !this.wirelessOut.getHasStack() ) { if( this.wirelessIn.getHasStack() ) { - ItemStack term = this.wirelessIn.getStack().copy(); + final ItemStack term = this.wirelessIn.getStack().copy(); INetworkEncodable networkEncodable = null; if( term.getItem() instanceof INetworkEncodable ) @@ -154,7 +154,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE networkEncodable = (INetworkEncodable) term.getItem(); } - IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term ); + final IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term ); if( wTermHandler != null ) { networkEncodable = wTermHandler; @@ -168,9 +168,9 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.wirelessOut.putStack( term ); // update the two slots in question... - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; icrafting.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() ); icrafting.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index de85dbc7..a5316eb5 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -35,7 +35,7 @@ public class ContainerSkyChest extends AEBaseContainer final TileSkyChest chest; - public ContainerSkyChest( InventoryPlayer ip, TileSkyChest chest ) + public ContainerSkyChest( final InventoryPlayer ip, final TileSkyChest chest ) { super( ip, chest, null ); this.chest = chest; @@ -54,7 +54,7 @@ public class ContainerSkyChest extends AEBaseContainer } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { super.onContainerClosed( par1EntityPlayer ); this.chest.closeInventory(); diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index 5fe4b262..f8e39a4e 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -49,7 +49,7 @@ public class ContainerSpatialIOPort extends AEBaseContainer IGrid network; int delay = 40; - public ContainerSpatialIOPort( InventoryPlayer ip, TileSpatialIOPort spatialIOPort ) + public ContainerSpatialIOPort( final InventoryPlayer ip, final TileSpatialIOPort spatialIOPort ) { super( ip, spatialIOPort, null ); this.spatialIOPort = spatialIOPort; @@ -77,8 +77,8 @@ public class ContainerSpatialIOPort extends AEBaseContainer { this.delay = 0; - IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); - ISpatialCache sc = this.network.getCache( ISpatialCache.class ); + final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); + final ISpatialCache sc = this.network.getCache( ISpatialCache.class ); if( eg != null ) { this.currentPower = (long) ( 100.0 * eg.getStoredPower() ); diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index a5ec6b6d..becf54ef 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -55,7 +55,7 @@ public class ContainerStorageBus extends ContainerUpgradeable @GuiSync( 4 ) public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY; - public ContainerStorageBus( InventoryPlayer ip, PartStorageBus te ) + public ContainerStorageBus( final InventoryPlayer ip, final PartStorageBus te ) { super( ip, te ); this.storageBus = te; @@ -70,10 +70,10 @@ public class ContainerStorageBus extends ContainerUpgradeable @Override protected void setupConfig() { - int xo = 8; - int yo = 23 + 6; + final int xo = 8; + final int yo = 23 + 6; - IInventory config = this.upgradeable.getInventoryByName( "config" ); + final IInventory config = this.upgradeable.getInventoryByName( "config" ); for( int y = 0; y < 7; y++ ) { for( int x = 0; x < 9; x++ ) @@ -89,7 +89,7 @@ public class ContainerStorageBus extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); @@ -125,16 +125,16 @@ public class ContainerStorageBus extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } public void clear() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { inv.setInventorySlotContents( x, null ); @@ -144,14 +144,14 @@ public class ContainerStorageBus extends ContainerUpgradeable public void partition() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IMEInventory cellInv = this.storageBus.getInternalHandler(); + final IMEInventory cellInv = this.storageBus.getInternalHandler(); Iterator i = new NullIterator(); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); i = list.iterator(); } @@ -159,7 +159,7 @@ public class ContainerStorageBus extends ContainerUpgradeable { if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) ) { - ItemStack g = i.next().getItemStack(); + final ItemStack g = i.next().getItemStack(); g.stackSize = 1; inv.setInventorySlotContents( x, g ); } diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index e9b4710e..6c8af4ab 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -64,7 +64,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl int tbSlot; NetworkToolViewer tbInventory; - public ContainerUpgradeable( InventoryPlayer ip, IUpgradeableHost te ) + public ContainerUpgradeable( final InventoryPlayer ip, final IUpgradeableHost te ) { super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) ); this.upgradeable = te; @@ -76,7 +76,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( te instanceof TileEntity ) { - TileEntity myTile = (TileEntity) te; + final TileEntity myTile = (TileEntity) te; w = myTile.getWorldObj(); xCoord = myTile.xCoord; yCoord = myTile.yCoord; @@ -85,17 +85,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( te instanceof IPart ) { - TileEntity mk = te.getTile(); + final TileEntity mk = te.getTile(); w = mk.getWorldObj(); xCoord = mk.xCoord; yCoord = mk.yCoord; zCoord = mk.zCoord; } - IInventory pi = this.getPlayerInv(); + final IInventory pi = this.getPlayerInv(); for( int x = 0; x < pi.getSizeInventory(); x++ ) { - ItemStack pii = pi.getStackInSlot( x ); + final ItemStack pii = pi.getStackInSlot( x ); if( pii != null && pii.getItem() instanceof ToolNetworkTool ) { this.lockPlayerInventorySlot( x ); @@ -135,9 +135,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { this.setupUpgrades(); - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - int y = 40; - int x = 80; + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final int y = 40; + final int x = 80; this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); if( this.supportCapacity() ) @@ -156,7 +156,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl protected void setupUpgrades() { - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); @@ -192,17 +192,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( Platform.isServer() ) { - IConfigManager cm = this.upgradeable.getConfigManager(); + final IConfigManager cm = this.upgradeable.getConfigManager(); this.loadSettingsFromHost( cm ); } this.checkToolbox(); - for( Object o : this.inventorySlots ) + for( final Object o : this.inventorySlots ) { if( o instanceof OptionalSlotFake ) { - OptionalSlotFake fs = (OptionalSlotFake) o; + final OptionalSlotFake fs = (OptionalSlotFake) o; if( !fs.isEnabled() && fs.getDisplayStack() != null ) { fs.clearStack(); @@ -213,7 +213,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl this.standardDetectAndSendChanges(); } - protected void loadSettingsFromHost( IConfigManager cm ) + protected void loadSettingsFromHost( final IConfigManager cm ) { this.fzMode = (FuzzyMode) cm.getSetting( Settings.FUZZY_MODE ); this.rsMode = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED ); @@ -228,7 +228,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { if( this.hasToolbox() ) { - ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot ); + final ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot ); if( currentItem != this.tbInventory.getItemStack() ) { @@ -257,9 +257,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); if( idx == 1 && upgrades > 0 ) { diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index 38794a65..520caa8b 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -40,7 +40,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr @GuiSync( 1 ) public int burnSpeed = 100; - public ContainerVibrationChamber( InventoryPlayer ip, TileVibrationChamber vibrationChamber ) + public ContainerVibrationChamber( final InventoryPlayer ip, final TileVibrationChamber vibrationChamber ) { super( ip, vibrationChamber, null ); this.vibrationChamber = vibrationChamber; diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index 4352d19a..eaff7e62 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -38,7 +38,7 @@ public class ContainerWireless extends AEBaseContainer @GuiSync( 2 ) public long drain = 0; - public ContainerWireless( InventoryPlayer ip, TileWireless te ) + public ContainerWireless( final InventoryPlayer ip, final TileWireless te ) { super( ip, te, null ); this.wirelessTerminal = te; @@ -51,7 +51,7 @@ public class ContainerWireless extends AEBaseContainer @Override public void detectAndSendChanges() { - int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize; + final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize; this.range = (long) ( 10 * AEConfig.instance.wireless_getMaxRange( boosters ) ); this.drain = (long) ( 100 * AEConfig.instance.wireless_getPowerDrain( boosters ) ); diff --git a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java index a13d73dc..789da90e 100644 --- a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java @@ -32,7 +32,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell final WirelessTerminalGuiObject wirelessTerminalGUIObject; - public ContainerWirelessTerm( InventoryPlayer ip, WirelessTerminalGuiObject gui ) + public ContainerWirelessTerm( final InventoryPlayer ip, final WirelessTerminalGuiObject gui ) { super( ip, gui ); this.wirelessTerminalGUIObject = gui; diff --git a/src/main/java/appeng/container/implementations/CraftingCPURecord.java b/src/main/java/appeng/container/implementations/CraftingCPURecord.java index b75325a2..adcb1a95 100644 --- a/src/main/java/appeng/container/implementations/CraftingCPURecord.java +++ b/src/main/java/appeng/container/implementations/CraftingCPURecord.java @@ -33,7 +33,7 @@ public class CraftingCPURecord implements Comparable final long size; final int processors; - public CraftingCPURecord( long size, int coProcessors, ICraftingCPU server ) + public CraftingCPURecord( final long size, final int coProcessors, final ICraftingCPU server ) { this.size = size; this.processors = coProcessors; @@ -42,9 +42,9 @@ public class CraftingCPURecord implements Comparable } @Override - public int compareTo( @Nonnull CraftingCPURecord o ) + public int compareTo( @Nonnull final CraftingCPURecord o ) { - int a = ItemSorters.compareLong( o.processors, this.processors ); + final int a = ItemSorters.compareLong( o.processors, this.processors ); if( a != 0 ) { return a; diff --git a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java index 1fa83d44..64d1aa22 100644 --- a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java +++ b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java @@ -54,7 +54,7 @@ public class AppEngCraftingSlot extends AppEngSlot */ private int amountCrafted; - public AppEngCraftingSlot( EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6 ) + public AppEngCraftingSlot( final EntityPlayer par1EntityPlayer, final IInventory par2IInventory, final IInventory par3IInventory, final int par4, final int par5, final int par6 ) { super( par3IInventory, par4, par5, par6 ); this.thePlayer = par1EntityPlayer; @@ -65,7 +65,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 ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -75,7 +75,7 @@ public class AppEngCraftingSlot extends AppEngSlot * internal count then calls onCrafting(item). */ @Override - protected void onCrafting( ItemStack par1ItemStack, int par2 ) + protected void onCrafting( final ItemStack par1ItemStack, final int par2 ) { this.amountCrafted += par2; this.onCrafting( par1ItemStack ); @@ -85,7 +85,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 ) + protected void onCrafting( final ItemStack par1ItemStack ) { par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted ); this.amountCrafted = 0; @@ -142,14 +142,14 @@ public class AppEngCraftingSlot extends AppEngSlot } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, this.craftMatrix ); this.onCrafting( par2ItemStack ); for( int i = 0; i < this.craftMatrix.getSizeInventory(); ++i ) { - ItemStack itemstack1 = this.craftMatrix.getStackInSlot( i ); + final ItemStack itemstack1 = this.craftMatrix.getStackInSlot( i ); if( itemstack1 != null ) { @@ -157,7 +157,7 @@ public class AppEngCraftingSlot extends AppEngSlot if( itemstack1.getItem().hasContainerItem( itemstack1 ) ) { - ItemStack itemstack2 = itemstack1.getItem().getContainerItem( itemstack1 ); + final ItemStack itemstack2 = itemstack1.getItem().getContainerItem( itemstack1 ); if( itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage() ) { @@ -186,7 +186,7 @@ public class AppEngCraftingSlot extends AppEngSlot * stack. */ @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { if( this.getHasStack() ) { diff --git a/src/main/java/appeng/container/slot/AppEngSlot.java b/src/main/java/appeng/container/slot/AppEngSlot.java index 9882c1ea..60598271 100644 --- a/src/main/java/appeng/container/slot/AppEngSlot.java +++ b/src/main/java/appeng/container/slot/AppEngSlot.java @@ -40,7 +40,7 @@ public class AppEngSlot extends Slot public hasCalculatedValidness isValid; public boolean isDisplay = false; - public AppEngSlot( IInventory inv, int idx, int x, int y ) + public AppEngSlot( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); this.defX = x; @@ -71,7 +71,7 @@ public class AppEngSlot extends Slot } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { if( this.isEnabled() ) { @@ -102,7 +102,7 @@ public class AppEngSlot extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { if( this.isEnabled() ) { @@ -131,7 +131,7 @@ public class AppEngSlot extends Slot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { if( this.isEnabled() ) { diff --git a/src/main/java/appeng/container/slot/NullSlot.java b/src/main/java/appeng/container/slot/NullSlot.java index 0645e05d..c018203b 100644 --- a/src/main/java/appeng/container/slot/NullSlot.java +++ b/src/main/java/appeng/container/slot/NullSlot.java @@ -34,19 +34,19 @@ public class NullSlot extends Slot } @Override - public void onSlotChange( ItemStack par1ItemStack, ItemStack par2ItemStack ) + public void onSlotChange( final ItemStack par1ItemStack, final ItemStack par2ItemStack ) { } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -58,7 +58,7 @@ public class NullSlot extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @@ -76,19 +76,19 @@ public class NullSlot extends Slot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isSlotInInventory( IInventory par1IInventory, int par2 ) + public boolean isSlotInInventory( final IInventory par1IInventory, final int par2 ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/OptionalSlotFake.java b/src/main/java/appeng/container/slot/OptionalSlotFake.java index 47a509f7..9bbc8a5d 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFake.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFake.java @@ -33,7 +33,7 @@ public class OptionalSlotFake extends SlotFake final IOptionalSlotHost host; public boolean renderDisabled = true; - public OptionalSlotFake( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public OptionalSlotFake( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, idx, x + offX * 18, y + offY * 18 ); this.srcX = x; diff --git a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java index 5dbaa0a0..666d9b60 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java @@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack; public class OptionalSlotFakeTypeOnly extends OptionalSlotFake { - public OptionalSlotFakeTypeOnly( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public OptionalSlotFakeTypeOnly( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, containerBus, idx, x, y, offX, offY, groupNum ); } diff --git a/src/main/java/appeng/container/slot/OptionalSlotNormal.java b/src/main/java/appeng/container/slot/OptionalSlotNormal.java index eae5b639..7edd1dc8 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotNormal.java +++ b/src/main/java/appeng/container/slot/OptionalSlotNormal.java @@ -28,7 +28,7 @@ public class OptionalSlotNormal extends AppEngSlot final int groupNum; final IOptionalSlotHost host; - public OptionalSlotNormal( IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum ) + public OptionalSlotNormal( final IInventory inv, final IOptionalSlotHost containerBus, final int slot, final int xPos, final int yPos, final int groupNum ) { super( inv, slot, xPos, yPos ); this.groupNum = groupNum; diff --git a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java index 45c194d0..175b7ed5 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java @@ -29,7 +29,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput final int groupNum; final IOptionalSlotHost host; - public OptionalSlotRestrictedInput( PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum, InventoryPlayer invPlayer ) + public OptionalSlotRestrictedInput( final PlacableItemType valid, final IInventory i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer ) { super( valid, i, slotIndex, x, y, invPlayer ); this.groupNum = grpNum; diff --git a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java index 8e793852..319d479a 100644 --- a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java +++ b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class QuartzKnifeOutput extends SlotOutput { - public QuartzKnifeOutput( IInventory a, int b, int c, int d, int i ) + public QuartzKnifeOutput( final IInventory a, final int b, final int c, final int d, final int i ) { super( a, b, c, d, i ); } diff --git a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java index de23c969..923a0874 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java @@ -29,7 +29,7 @@ public class SlotCraftingMatrix extends AppEngSlot final Container c; - public SlotCraftingMatrix( Container c, IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotCraftingMatrix( final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); this.c = c; @@ -43,7 +43,7 @@ public class SlotCraftingMatrix extends AppEngSlot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { super.putStack( par1ItemStack ); this.c.onCraftMatrixChanged( this.inventory ); @@ -56,9 +56,9 @@ public class SlotCraftingMatrix extends AppEngSlot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { - ItemStack is = super.decrStackSize( par1 ); + final ItemStack is = super.decrStackSize( par1 ); this.c.onCraftMatrixChanged( this.inventory ); return is; } diff --git a/src/main/java/appeng/container/slot/SlotCraftingTerm.java b/src/main/java/appeng/container/slot/SlotCraftingTerm.java index 17d6053e..ae285621 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingTerm.java +++ b/src/main/java/appeng/container/slot/SlotCraftingTerm.java @@ -57,7 +57,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot private final IStorageMonitorable storage; private final IContainerCraftingPacket container; - public SlotCraftingTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IContainerCraftingPacket ccp ) + public SlotCraftingTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp ) { super( player, cMatrix, output, 0, x, y ); this.energySrc = energySrc; @@ -74,17 +74,17 @@ public class SlotCraftingTerm extends AppEngCraftingSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @Override - public void onPickupFromSlot( EntityPlayer p, ItemStack is ) + public void onPickupFromSlot( final EntityPlayer p, final ItemStack is ) { } - public void doClick( InventoryAction action, EntityPlayer who ) + public void doClick( final InventoryAction action, final EntityPlayer who ) { if( this.getStack() == null ) { @@ -95,8 +95,8 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return; } - IMEMonitor inv = this.storage.getItemInventory(); - int howManyPerCraft = this.getStack().stackSize; + final IMEMonitor inv = this.storage.getItemInventory(); + final int howManyPerCraft = this.getStack().stackSize; int maxTimesToCraft = 0; InventoryAdaptor ia = null; @@ -124,7 +124,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return; } - ItemStack rs = Platform.cloneItemStack( this.getStack() ); + final ItemStack rs = Platform.cloneItemStack( this.getStack() ); if( rs == null ) { return; @@ -134,11 +134,11 @@ public class SlotCraftingTerm extends AppEngCraftingSlot { if( ia.simulateAdd( rs ) == null ) { - IItemList all = inv.getStorageList(); - ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) ); + final IItemList all = inv.getStorageList(); + final ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) ); if( extra != null ) { - List drops = new ArrayList(); + final List drops = new ArrayList(); drops.add( extra ); Platform.spawnDrops( who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops ); return; @@ -147,40 +147,40 @@ public class SlotCraftingTerm extends AppEngCraftingSlot } } - protected int capCraftingAttempts( int maxTimesToCraft ) + protected int capCraftingAttempts( final int maxTimesToCraft ) { return maxTimesToCraft; } - public ItemStack craftItem( EntityPlayer p, ItemStack request, IMEMonitor inv, IItemList all ) + public ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor inv, final IItemList all ) { // update crafting matrix... ItemStack is = this.getStack(); if( is != null && Platform.isSameItem( request, is ) ) { - ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()]; + final ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()]; // add one of each item to the items on the board... if( Platform.isServer() ) { - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { ic.setInventorySlotContents( x, this.pattern.getStackInSlot( x ) ); } - IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); if( r == null ) { - Item target = request.getItem(); + final Item target = request.getItem(); if( target.isDamageable() && target.isRepairable() ) { boolean isBad = false; for( int x = 0; x < ic.getSizeInventory(); x++ ) { - ItemStack pis = ic.getStackInSlot( x ); + final ItemStack pis = ic.getStackInSlot( x ); if( pis == null ) { continue; @@ -232,19 +232,19 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return null; } - public boolean preCraft( EntityPlayer p, IMEMonitor inv, ItemStack[] set, ItemStack result ) + public boolean preCraft( final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result ) { return true; } - public void makeItem( EntityPlayer p, ItemStack is ) + public void makeItem( final EntityPlayer p, final ItemStack is ) { super.onPickupFromSlot( p, is ); } - public void postCraft( EntityPlayer p, IMEMonitor inv, ItemStack[] set, ItemStack result ) + public void postCraft( final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result ) { - List drops = new ArrayList(); + final List drops = new ArrayList(); // add one of each item to the items on the board... if( Platform.isServer() ) @@ -259,7 +259,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot else if( set[x] != null ) { // eek! put it back! - IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc ); + final IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc ); if( fail != null ) { drops.add( fail.getItemStack() ); diff --git a/src/main/java/appeng/container/slot/SlotDisabled.java b/src/main/java/appeng/container/slot/SlotDisabled.java index a5121a16..f298e6e7 100644 --- a/src/main/java/appeng/container/slot/SlotDisabled.java +++ b/src/main/java/appeng/container/slot/SlotDisabled.java @@ -27,19 +27,19 @@ import net.minecraft.item.ItemStack; public class SlotDisabled extends AppEngSlot { - public SlotDisabled( IInventory par1iInventory, int slotIndex, int x, int y ) + public SlotDisabled( final IInventory par1iInventory, final int slotIndex, final int x, final int y ) { super( par1iInventory, slotIndex, x, y ); } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotFake.java b/src/main/java/appeng/container/slot/SlotFake.java index e4e3f53a..ee389b6a 100644 --- a/src/main/java/appeng/container/slot/SlotFake.java +++ b/src/main/java/appeng/container/slot/SlotFake.java @@ -29,25 +29,25 @@ public class SlotFake extends AppEngSlot final int invSlot; - public SlotFake( IInventory inv, int idx, int x, int y ) + public SlotFake( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); this.invSlot = idx; } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -64,7 +64,7 @@ public class SlotFake extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java index fd4251df..b0d9ba51 100644 --- a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java +++ b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotFakeBlacklist extends SlotFakeTypeOnly { - public SlotFakeBlacklist( IInventory inv, int idx, int x, int y ) + public SlotFakeBlacklist( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java index 10691a1f..e1bf15b2 100644 --- a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotFakeCraftingMatrix extends SlotFake { - public SlotFakeCraftingMatrix( IInventory inv, int idx, int x, int y ) + public SlotFakeCraftingMatrix( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java index 686c87a8..809da8ac 100644 --- a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java @@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack; public class SlotFakeTypeOnly extends SlotFake { - public SlotFakeTypeOnly( IInventory inv, int idx, int x, int y ) + public SlotFakeTypeOnly( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotInaccessible.java b/src/main/java/appeng/container/slot/SlotInaccessible.java index f7f8eedc..968e3171 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessible.java +++ b/src/main/java/appeng/container/slot/SlotInaccessible.java @@ -29,13 +29,13 @@ public class SlotInaccessible extends AppEngSlot ItemStack dspStack = null; - public SlotInaccessible( IInventory i, int slotIdx, int x, int y ) + public SlotInaccessible( final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return false; } @@ -48,7 +48,7 @@ public class SlotInaccessible extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @@ -58,7 +58,7 @@ public class SlotInaccessible extends AppEngSlot { if( this.dspStack == null ) { - ItemStack dsp = super.getDisplayStack(); + final ItemStack dsp = super.getDisplayStack(); if( dsp != null ) { this.dspStack = dsp.copy(); diff --git a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java index ff66547b..10d675d4 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java +++ b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotInaccessibleHD extends SlotInaccessible { - public SlotInaccessibleHD( IInventory i, int slotIdx, int x, int y ) + public SlotInaccessibleHD( final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotMACPattern.java b/src/main/java/appeng/container/slot/SlotMACPattern.java index 05cff8e0..ad8eef12 100644 --- a/src/main/java/appeng/container/slot/SlotMACPattern.java +++ b/src/main/java/appeng/container/slot/SlotMACPattern.java @@ -30,14 +30,14 @@ public class SlotMACPattern extends AppEngSlot final ContainerMAC mac; - public SlotMACPattern( ContainerMAC mac, IInventory i, int slotIdx, int x, int y ) + public SlotMACPattern( final ContainerMAC mac, final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); this.mac = mac; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return this.mac.isValidItemForSlot( this.getSlotIndex(), i ); } diff --git a/src/main/java/appeng/container/slot/SlotNormal.java b/src/main/java/appeng/container/slot/SlotNormal.java index 02a26731..96e705b2 100644 --- a/src/main/java/appeng/container/slot/SlotNormal.java +++ b/src/main/java/appeng/container/slot/SlotNormal.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotNormal extends AppEngSlot { - public SlotNormal( IInventory inv, int slot, int xPos, int yPos ) + public SlotNormal( final IInventory inv, final int slot, final int xPos, final int yPos ) { super( inv, slot, xPos, yPos ); } diff --git a/src/main/java/appeng/container/slot/SlotOutput.java b/src/main/java/appeng/container/slot/SlotOutput.java index 30c0d4d1..191291f2 100644 --- a/src/main/java/appeng/container/slot/SlotOutput.java +++ b/src/main/java/appeng/container/slot/SlotOutput.java @@ -26,14 +26,14 @@ import net.minecraft.item.ItemStack; public class SlotOutput extends AppEngSlot { - public SlotOutput( IInventory a, int b, int c, int d, int i ) + public SlotOutput( final IInventory a, final int b, final int c, final int d, final int i ) { super( a, b, c, d ); this.IIcon = i; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotPatternOutputs.java b/src/main/java/appeng/container/slot/SlotPatternOutputs.java index 59eef686..49a85806 100644 --- a/src/main/java/appeng/container/slot/SlotPatternOutputs.java +++ b/src/main/java/appeng/container/slot/SlotPatternOutputs.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotPatternOutputs extends OptionalSlotFake { - public SlotPatternOutputs( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public SlotPatternOutputs( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, containerBus, idx, x, y, offX, offY, groupNum ); } diff --git a/src/main/java/appeng/container/slot/SlotPatternTerm.java b/src/main/java/appeng/container/slot/SlotPatternTerm.java index ad45ced8..332d3dae 100644 --- a/src/main/java/appeng/container/slot/SlotPatternTerm.java +++ b/src/main/java/appeng/container/slot/SlotPatternTerm.java @@ -40,7 +40,7 @@ public class SlotPatternTerm extends SlotCraftingTerm final int groupNum; final 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 groupNumber, IContainerCraftingPacket c ) + public SlotPatternTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c ) { super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c ); @@ -48,7 +48,7 @@ public class SlotPatternTerm extends SlotCraftingTerm this.groupNum = groupNumber; } - public AppEngPacket getRequest( boolean shift ) throws IOException + public AppEngPacket getRequest( final boolean shift ) throws IOException { return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( this.getStack() ), shift ); } diff --git a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java index b56309d3..3ec5c234 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java +++ b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotPlayerHotBar extends AppEngSlot { - public SlotPlayerHotBar( IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotPlayerHotBar( final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); this.isPlayerSide = true; diff --git a/src/main/java/appeng/container/slot/SlotPlayerInv.java b/src/main/java/appeng/container/slot/SlotPlayerInv.java index 2e694b3d..a8607e0a 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerInv.java +++ b/src/main/java/appeng/container/slot/SlotPlayerInv.java @@ -27,7 +27,7 @@ import net.minecraft.inventory.IInventory; public class SlotPlayerInv extends AppEngSlot { - public SlotPlayerInv( IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotPlayerInv( final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); diff --git a/src/main/java/appeng/container/slot/SlotRestrictedInput.java b/src/main/java/appeng/container/slot/SlotRestrictedInput.java index 5e9c5891..7d1ca8d8 100644 --- a/src/main/java/appeng/container/slot/SlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/SlotRestrictedInput.java @@ -59,7 +59,7 @@ public class SlotRestrictedInput extends AppEngSlot public boolean allowEdit = true; public int stackLimit = -1; - public SlotRestrictedInput( PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p ) + public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p ) { super( i, slotIndex, x, y ); this.which = valid; @@ -77,24 +77,24 @@ public class SlotRestrictedInput extends AppEngSlot return super.getSlotStackLimit(); } - public boolean isValid( ItemStack is, World theWorld ) + public boolean isValid( final ItemStack is, final World theWorld ) { if( this.which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT ) { - ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null; + final ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null; return ap != null; } return true; } - public Slot setStackLimit( int i ) + public Slot setStackLimit( final int i ) { this.stackLimit = i; return this; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { if( !this.myContainer.isValidForSlot( this, i ) ) { @@ -129,8 +129,8 @@ public class SlotRestrictedInput extends AppEngSlot case ENCODED_CRAFTING_PATTERN: if( i.getItem() instanceof ICraftingPatternItem ) { - ICraftingPatternItem b = (ICraftingPatternItem) i.getItem(); - ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj ); + final ICraftingPatternItem b = (ICraftingPatternItem) i.getItem(); + final ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj ); if( de != null ) { return de.isCraftable(); @@ -168,7 +168,7 @@ public class SlotRestrictedInput extends AppEngSlot return true; } - for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optional, i ) ) { @@ -232,7 +232,7 @@ public class SlotRestrictedInput extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return this.allowEdit; } @@ -242,11 +242,11 @@ public class SlotRestrictedInput extends AppEngSlot { if( Platform.isClient() && ( this.which == PlacableItemType.ENCODED_PATTERN ) ) { - ItemStack is = super.getStack(); + final ItemStack is = super.getStack(); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ItemStack out = iep.getOutput( is ); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ItemStack out = iep.getOutput( is ); if( out != null ) { return out; @@ -256,16 +256,16 @@ public class SlotRestrictedInput extends AppEngSlot return super.getStack(); } - public static boolean isMetalIngot( ItemStack i ) + public static boolean isMetalIngot( final ItemStack i ) { if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) ) { return true; } - for( String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } ) + for( final String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } ) { - for( ItemStack ingot : OreDictionary.getOres( "ingot" + name ) ) + for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) ) { if( Platform.isSameItemPrecise( i, ingot ) ) { @@ -293,7 +293,7 @@ public class SlotRestrictedInput extends AppEngSlot public final int IIcon; - PlacableItemType( int o ) + PlacableItemType( final int o ) { this.IIcon = o; } diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index 2259d0df..b5db31d5 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -108,7 +108,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject private double WirelessBoosterRangeMultiplier = 1; private double WirelessBoosterExp = 1.5; - public AEConfig( File configFile ) + public AEConfig( final File configFile ) { super( configFile ); this.configFile = configFile; @@ -125,7 +125,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject final double DEFAULT_RF_EXCHANGE = 0.5; PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE ); - double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); + final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective ); CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 ); @@ -169,7 +169,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject this.clientSync(); - for( AEFeature feature : AEFeature.values() ) + for( final AEFeature feature : AEFeature.values() ) { if( feature.isVisible ) { @@ -184,10 +184,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); + final ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); if( imb != null ) { - List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); + final List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); if( version.contains( imb.getVersion() ) ) { this.featureFlags.remove( AEFeature.AlphaPass ); @@ -198,12 +198,12 @@ public final class AEConfig extends Configuration implements IConfigurableObject { this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() ); } - catch( Throwable t ) + catch( final Throwable t ) { this.selectedPowerUnit = PowerUnits.AE; } - for( TickRates tr : TickRates.values() ) + for( final TickRates tr : TickRates.values() ) { tr.Load( this ); } @@ -234,11 +234,11 @@ public final class AEConfig extends Configuration implements IConfigurableObject // load buttons.. for( int btnNum = 0; btnNum < 4; btnNum++ ) { - Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] ); - Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] ); - Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] ); + final Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] ); + final Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] ); + final Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] ); - int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 ); + final int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 ); this.craftByStacks[btnNum] = Math.abs( cmb.getInt( this.craftByStacks[btnNum] ) ); this.priorityByStacks[btnNum] = Math.abs( pmb.getInt( this.priorityByStacks[btnNum] ) ); @@ -253,18 +253,18 @@ public final class AEConfig extends Configuration implements IConfigurableObject this.levelByStacks[btnNum] = Math.min( this.levelByStacks[btnNum], buttonCap ); } - for( Settings e : this.settings.getSettings() ) + for( final Settings e : this.settings.getSettings() ) { - String Category = "Client"; // e.getClass().getSimpleName(); + final String Category = "Client"; // e.getClass().getSimpleName(); Enum value = this.settings.getSetting( e ); - Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) ); + final Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) ); try { value = Enum.valueOf( value.getClass(), p.getString() ); } - catch( IllegalArgumentException er ) + catch( final IllegalArgumentException er ) { AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" ); } @@ -273,17 +273,17 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - private String getListComment( Enum value ) + private String getListComment( final Enum value ) { String comment = null; if( value != null ) { - EnumSet set = EnumSet.allOf( value.getClass() ); + final EnumSet set = EnumSet.allOf( value.getClass() ); - for( Object Oeg : set ) + for( final Object Oeg : set ) { - Enum eg = (Enum) Oeg; + final Enum eg = (Enum) Oeg; if( comment == null ) { comment = "Possible Values: " + eg.name(); @@ -298,30 +298,30 @@ public final class AEConfig extends Configuration implements IConfigurableObject return comment; } - public boolean isFeatureEnabled( AEFeature f ) + public boolean isFeatureEnabled( final AEFeature f ) { return this.featureFlags.contains( f ); } - public double wireless_getDrainRate( double range ) + public double wireless_getDrainRate( final double range ) { return this.WirelessTerminalDrainMultiplier * range; } - public double wireless_getMaxRange( int boosters ) + public double wireless_getMaxRange( final int boosters ) { return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp ); } - public double wireless_getPowerDrain( int boosters ) + public double wireless_getPowerDrain( final int boosters ) { return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount ); } @Override - public Property get( String category, String key, String defaultValue, String comment, Property.Type type ) + public Property get( final String category, final String key, final String defaultValue, final String comment, final Property.Type type ) { - Property prop = super.get( category, key, defaultValue, comment, type ); + final Property prop = super.get( category, key, defaultValue, comment, type ); if( prop != null ) { @@ -352,7 +352,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject } @SubscribeEvent - public void onConfigChanged( ConfigChangedEvent.OnConfigChangedEvent eventArgs ) + public void onConfigChanged( final ConfigChangedEvent.OnConfigChangedEvent eventArgs ) { if( eventArgs.modID.equals( AppEng.MOD_ID ) ) { @@ -370,7 +370,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.configFile.toString(); } - public boolean useAEVersion( MaterialType mt ) + public boolean useAEVersion( final MaterialType mt ) { if( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) ) { @@ -378,21 +378,21 @@ public final class AEConfig extends Configuration implements IConfigurableObject } this.setCategoryComment( "OreCamouflage", "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." ); - Property p = this.get( "OreCamouflage", mt.name(), true ); + final Property p = this.get( "OreCamouflage", mt.name(), true ); p.comment = "OreDictionary Names: " + mt.getOreName(); return !p.getBoolean( true ); } @Override - public void updateSetting( IConfigManager manager, Enum setting, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum setting, final Enum newValue ) { - for( Settings e : this.settings.getSettings() ) + for( final Settings e : this.settings.getSettings() ) { if( e == setting ) { - String Category = "Client"; - Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) ); + final String Category = "Client"; + final Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) ); p.set( newValue.name() ); } } @@ -403,19 +403,19 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - public int getFreeMaterial( int varID ) + public int getFreeMaterial( final int varID ) { return this.getFreeIDSLot( varID, "materials" ); } - public int getFreeIDSLot( int varID, String category ) + public int getFreeIDSLot( final int varID, final String category ) { boolean alreadyUsed = false; int min = 0; - for( Property p : this.getCategory( category ).getValues().values() ) + for( final Property p : this.getCategory( category ).getValues().values() ) { - int thisInt = p.getInt(); + final int thisInt = p.getInt(); if( varID == thisInt ) { @@ -438,7 +438,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return varID; } - public int getFreePart( int varID ) + public int getFreePart( final int varID ) { return this.getFreeIDSLot( varID, "parts" ); } @@ -454,31 +454,31 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.useLargeFonts; } - public int craftItemsByStackAmounts( int i ) + public int craftItemsByStackAmounts( final int i ) { return this.craftByStacks[i]; } - public int priorityByStacksAmounts( int i ) + public int priorityByStacksAmounts( final int i ) { return this.priorityByStacks[i]; } - public int levelByStackAmounts( int i ) + public int levelByStackAmounts( final int i ) { return this.levelByStacks[i]; } - public Enum getSetting( String category, Class class1, Enum myDefault ) + public Enum getSetting( final String category, final Class class1, final Enum myDefault ) { - String name = class1.getSimpleName(); - Property p = this.get( category, name, myDefault.name() ); + final String name = class1.getSimpleName(); + final Property p = this.get( category, name, myDefault.name() ); try { return (Enum) class1.getField( p.toString() ).get( class1 ); } - catch( Throwable t ) + catch( final Throwable t ) { // :{ } @@ -486,9 +486,9 @@ public final class AEConfig extends Configuration implements IConfigurableObject return myDefault; } - public void setSetting( String category, Enum s ) + public void setSetting( final String category, final Enum s ) { - String name = s.getClass().getSimpleName(); + final String name = s.getClass().getSimpleName(); this.get( category, name, s.name() ).set( s.name() ); this.save(); } @@ -498,7 +498,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.selectedPowerUnit; } - public void nextPowerUnit( boolean backwards ) + public void nextPowerUnit( final boolean backwards ) { this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() ); this.save(); diff --git a/src/main/java/appeng/core/AELog.java b/src/main/java/appeng/core/AELog.java index b9d1e2ed..554f324a 100644 --- a/src/main/java/appeng/core/AELog.java +++ b/src/main/java/appeng/core/AELog.java @@ -37,12 +37,12 @@ public final class AELog { } - public static void warning( String format, Object... data ) + public static void warning( final String format, final Object... data ) { log( Level.WARN, format, data ); } - private static void log( Level level, String format, Object... data ) + private static void log( final Level level, final String format, final Object... data ) { if( AEConfig.instance == null || AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) ) { @@ -50,7 +50,7 @@ public final class AELog } } - public static void grinder( String o ) + public static void grinder( final String o ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.GrinderLogging ) ) { @@ -58,7 +58,7 @@ public final class AELog } } - public static void integration( Throwable exception ) + public static void integration( final Throwable exception ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.IntegrationLogging ) ) { @@ -66,7 +66,7 @@ public final class AELog } } - public static void error( Throwable e ) + public static void error( final Throwable e ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) ) { @@ -75,12 +75,12 @@ public final class AELog } } - public static void severe( String format, Object... data ) + public static void severe( final String format, final Object... data ) { log( Level.ERROR, format, data ); } - public static void blockUpdate( int xCoord, int yCoord, int zCoord, AEBaseTile aeBaseTile ) + public static void blockUpdate( final int xCoord, final int yCoord, final int zCoord, final AEBaseTile aeBaseTile ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.UpdateLogging ) ) { @@ -88,12 +88,12 @@ public final class AELog } } - public static void info( String format, Object... data ) + public static void info( final String format, final Object... data ) { log( Level.INFO, format, data ); } - public static void crafting( String format, Object... data ) + public static void crafting( final String format, final Object... data ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog ) ) { diff --git a/src/main/java/appeng/core/Api.java b/src/main/java/appeng/core/Api.java index 4668caac..423e3b82 100644 --- a/src/main/java/appeng/core/Api.java +++ b/src/main/java/appeng/core/Api.java @@ -116,7 +116,7 @@ public final class Api implements IAppEngApi } @Override - public IGridNode createGridNode( IGridBlock blk ) + public IGridNode createGridNode( final IGridBlock blk ) { if( Platform.isClient() ) { @@ -127,7 +127,7 @@ public final class Api implements IAppEngApi } @Override - public IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection + public IGridConnection createGridConnection( final IGridNode a, final IGridNode b ) throws FailedConnection { return new GridConnection( a, b, ForgeDirection.UNKNOWN ); } diff --git a/src/main/java/appeng/core/ApiDefinitions.java b/src/main/java/appeng/core/ApiDefinitions.java index eb2a937e..2a44fc33 100644 --- a/src/main/java/appeng/core/ApiDefinitions.java +++ b/src/main/java/appeng/core/ApiDefinitions.java @@ -40,7 +40,7 @@ public final class ApiDefinitions implements IDefinitions private final FeatureHandlerRegistry handlers; private final FeatureRegistry features; - public ApiDefinitions( IPartHelper partHelper ) + public ApiDefinitions( final IPartHelper partHelper ) { this.features = new FeatureRegistry(); this.handlers = new FeatureHandlerRegistry(); diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index b14cc3a0..5725656a 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -98,14 +98,14 @@ public final class AppEng } @EventHandler - private void preInit( FMLPreInitializationEvent event ) + private void preInit( final FMLPreInitializationEvent event ) { if( !Loader.isModLoaded( "appliedenergistics2-core" ) ) { CommonHelper.proxy.missingCoreMod(); } - Stopwatch watch = Stopwatch.createStarted(); + final Stopwatch watch = Stopwatch.createStarted(); this.configDirectory = new File( event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2" ); final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg" ); @@ -142,7 +142,7 @@ public final class AppEng AELog.info( "Pre Initialization ( ended after " + watch.elapsed( TimeUnit.MILLISECONDS ) + "ms )" ); } - private void startService( String serviceName, Thread thread ) + private void startService( final String serviceName, final Thread thread ) { thread.setName( serviceName ); thread.setPriority( Thread.MIN_PRIORITY ); @@ -152,9 +152,9 @@ public final class AppEng } @EventHandler - private void init( FMLInitializationEvent event ) + private void init( final FMLInitializationEvent event ) { - Stopwatch star = Stopwatch.createStarted(); + final Stopwatch star = Stopwatch.createStarted(); AELog.info( "Initialization ( started )" ); Registration.INSTANCE.initialize( event ); @@ -164,9 +164,9 @@ public final class AppEng } @EventHandler - private void postInit( FMLPostInitializationEvent event ) + private void postInit( final FMLPostInitializationEvent event ) { - Stopwatch star = Stopwatch.createStarted(); + final Stopwatch star = Stopwatch.createStarted(); AELog.info( "Post Initialization ( started )" ); Registration.INSTANCE.postInit( event ); @@ -183,26 +183,26 @@ public final class AppEng } @EventHandler - private void handleIMCEvent( FMLInterModComms.IMCEvent event ) + private void handleIMCEvent( final FMLInterModComms.IMCEvent event ) { this.imcHandler.handleIMCEvent( event ); } @EventHandler - private void serverAboutToStart( FMLServerAboutToStartEvent evt ) + private void serverAboutToStart( final FMLServerAboutToStartEvent evt ) { WorldData.onServerAboutToStart(); } @EventHandler - private void serverStopping( FMLServerStoppingEvent event ) + private void serverStopping( final FMLServerStoppingEvent event ) { WorldData.instance().onServerStopping(); TickHandler.INSTANCE.shutdown(); } @EventHandler - private void serverStarting( FMLServerStartingEvent evt ) + private void serverStarting( final FMLServerStartingEvent evt ) { evt.registerServerCommand( new AECommand( evt.getServer() ) ); } diff --git a/src/main/java/appeng/core/CreativeTab.java b/src/main/java/appeng/core/CreativeTab.java index cd5d4bd8..5568aa1b 100644 --- a/src/main/java/appeng/core/CreativeTab.java +++ b/src/main/java/appeng/core/CreativeTab.java @@ -63,11 +63,11 @@ public final class CreativeTab extends CreativeTabs return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluix(), items.cell1k(), items.networkTool(), materials.fluixCrystal(), materials.certusQuartzCrystal() ); } - private ItemStack findFirst( IItemDefinition... choices ) + private ItemStack findFirst( final IItemDefinition... choices ) { - for( IItemDefinition definition : choices ) + for( final IItemDefinition definition : choices ) { - for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) + for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) { return definitionStack; } diff --git a/src/main/java/appeng/core/FacadeConfig.java b/src/main/java/appeng/core/FacadeConfig.java index 05065364..5ff1d247 100644 --- a/src/main/java/appeng/core/FacadeConfig.java +++ b/src/main/java/appeng/core/FacadeConfig.java @@ -37,23 +37,23 @@ public class FacadeConfig extends Configuration public static FacadeConfig instance; final Pattern replacementPattern; - public FacadeConfig( File facadeFile ) + public FacadeConfig( final File facadeFile ) { super( facadeFile ); this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" ); } - public boolean checkEnabled( Block id, int metadata, boolean automatic ) + public boolean checkEnabled( final Block id, final int metadata, final boolean automatic ) { if( id == null ) { return false; } - UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id ); + final UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id ); if( blk == null ) { - for( Field f : Block.class.getFields() ) + for( final Field f : Block.class.getFields() ) { try { @@ -62,7 +62,7 @@ public class FacadeConfig extends Configuration return this.get( "minecraft", f.getName() + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic ); } } - catch( Throwable e ) + catch( final Throwable e ) { // :P } @@ -70,8 +70,8 @@ public class FacadeConfig extends Configuration } else { - Matcher mod = this.replacementPattern.matcher( blk.modId ); - Matcher name = this.replacementPattern.matcher( blk.name ); + final Matcher mod = this.replacementPattern.matcher( blk.modId ); + final Matcher name = this.replacementPattern.matcher( blk.name ); return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic ); } diff --git a/src/main/java/appeng/core/FeatureHandlerRegistry.java b/src/main/java/appeng/core/FeatureHandlerRegistry.java index 9bb5f191..2464b3b7 100644 --- a/src/main/java/appeng/core/FeatureHandlerRegistry.java +++ b/src/main/java/appeng/core/FeatureHandlerRegistry.java @@ -29,7 +29,7 @@ public final class FeatureHandlerRegistry { private final Set registry = new LinkedHashSet(); - public void addFeatureHandler( IFeatureHandler feature ) + public void addFeatureHandler( final IFeatureHandler feature ) { this.registry.add( feature ); } diff --git a/src/main/java/appeng/core/FeatureRegistry.java b/src/main/java/appeng/core/FeatureRegistry.java index 26fa3920..4991f1d7 100644 --- a/src/main/java/appeng/core/FeatureRegistry.java +++ b/src/main/java/appeng/core/FeatureRegistry.java @@ -29,7 +29,7 @@ public final class FeatureRegistry { private final Set registry = new LinkedHashSet(); - public void addFeature( IAEFeature feature ) + public void addFeature( final IAEFeature feature ) { this.registry.add( feature ); } diff --git a/src/main/java/appeng/core/IMCHandler.java b/src/main/java/appeng/core/IMCHandler.java index 724de8f4..aa73b796 100644 --- a/src/main/java/appeng/core/IMCHandler.java +++ b/src/main/java/appeng/core/IMCHandler.java @@ -64,7 +64,7 @@ public class IMCHandler this.processors.put( "add-grindable", new IMCGrinder() ); this.processors.put( "add-mattercannon-ammo", new IMCMatterCannon() ); - for( TunnelType type : TunnelType.values() ) + for( final TunnelType type : TunnelType.values() ) { this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase( Locale.ENGLISH ), new IMCP2PAttunement() ); } @@ -75,9 +75,9 @@ public class IMCHandler * * @param event Event carrying the identifier and message for the handlers */ - public void handleIMCEvent( FMLInterModComms.IMCEvent event ) + public void handleIMCEvent( final FMLInterModComms.IMCEvent event ) { - for( FMLInterModComms.IMCMessage message : event.getMessages() ) + for( final FMLInterModComms.IMCMessage message : event.getMessages() ) { final String key = message.key; @@ -93,7 +93,7 @@ public class IMCHandler throw new IllegalStateException( "Invalid IMC Called: " + key ); } } - catch( Exception t ) + catch( final Exception t ) { AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() ); AELog.error( t ); diff --git a/src/main/java/appeng/core/RecipeLoader.java b/src/main/java/appeng/core/RecipeLoader.java index b5668e50..ea5e021b 100644 --- a/src/main/java/appeng/core/RecipeLoader.java +++ b/src/main/java/appeng/core/RecipeLoader.java @@ -51,7 +51,7 @@ public class RecipeLoader implements Runnable * * @throws NullPointerException if handler is null */ - public RecipeLoader( @Nonnull IRecipeHandler handler ) + public RecipeLoader( @Nonnull final IRecipeHandler handler ) { Preconditions.checkNotNull( handler ); @@ -86,12 +86,12 @@ public class RecipeLoader implements Runnable this.handler.parseRecipes( new ConfigLoader( generatedRecipesDir, userRecipesDir ), "index.recipe" ); } // on failure use jar parsing - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); } - catch( URISyntaxException e ) + catch( final URISyntaxException e ) { AELog.error( e ); this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index 9a347fe3..259a09b1 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -129,12 +129,12 @@ public final class Registration this.recipeHandler = new RecipeHandler(); } - public void preInitialize( FMLPreInitializationEvent event ) + public void preInitialize( final FMLPreInitializationEvent event ) { this.registerSpatial( false ); final Api api = Api.INSTANCE; - IRecipeHandlerRegistry recipeRegistry = api.registries().recipes(); + final IRecipeHandlerRegistry recipeRegistry = api.registries().recipes(); this.registerCraftHandlers( recipeRegistry ); RecipeSorter.register( "AE2-Facade", FacadeRecipe.class, Category.SHAPED, "" ); @@ -161,25 +161,25 @@ public final class Registration this.assignItems( items, apiItems ); // Register all detected handlers and features (items, blocks) in pre-init - for( IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() ) + for( final IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() ) { handler.register(); } - for( IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() ) + for( final IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() ) { feature.postInit(); } } - private void registerSpatial( boolean force ) + private void registerSpatial( final boolean force ) { if( !AEConfig.instance.isFeatureEnabled( AEFeature.SpatialIO ) ) { return; } - AEConfig config = AEConfig.instance; + final AEConfig config = AEConfig.instance; if( this.storageBiome == null ) { @@ -219,7 +219,7 @@ public final class Registration } } - private void registerCraftHandlers( IRecipeHandlerRegistry registry ) + private void registerCraftHandlers( final IRecipeHandlerRegistry registry ) { registry.addNewSubItemResolver( new AEItemResolver() ); @@ -251,7 +251,7 @@ public final class Registration * @deprecated to be removed when the public definition API is removed */ @Deprecated - private void assignMaterials( Materials target, IMaterials source ) + private void assignMaterials( final Materials target, final IMaterials source ) { target.materialCell2SpatialPart = this.converter.of( source.cell2SpatialPart() ); target.materialCell16SpatialPart = this.converter.of( source.cell16SpatialPart() ); @@ -335,7 +335,7 @@ public final class Registration * @deprecated to be removed when the public definition API is removed */ @Deprecated - private void assignParts( Parts target, IParts source ) + private void assignParts( final Parts target, final IParts source ) { target.partCableSmart = source.cableSmart(); target.partCableCovered = source.cableCovered(); @@ -384,7 +384,7 @@ public final class Registration * @deprecated to be removed when the public definition API is removed */ @Deprecated - private void assignBlocks( Blocks target, IBlocks source ) + private void assignBlocks( final Blocks target, final IBlocks source ) { target.blockMultiPart = this.converter.of( source.multiPart() ); @@ -454,7 +454,7 @@ public final class Registration * @deprecated to be removed when the public definition API is removed */ @Deprecated - private void assignItems( Items target, IItems source ) + private void assignItems( final Items target, final IItems source ) { target.itemCellCreative = this.converter.of( source.cellCreative() ); target.itemViewCell = this.converter.of( source.viewCell() ); @@ -503,7 +503,7 @@ public final class Registration target.itemLumenPaintBall = source.coloredLumenPaintBall(); } - public void initialize( FMLInitializationEvent event ) + public void initialize( final FMLInitializationEvent event ) { final IAppEngApi api = AEApi.instance(); final IPartHelper partHelper = api.partHelper(); @@ -522,11 +522,11 @@ public final class Registration FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE ); MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE ); - PartPlacement pp = new PartPlacement(); + final PartPlacement pp = new PartPlacement(); MinecraftForge.EVENT_BUS.register( pp ); FMLCommonHandler.instance().bus().register( pp ); - IGridCacheRegistry gcr = registries.gridCache(); + final IGridCacheRegistry gcr = registries.gridCache(); gcr.registerGridCache( ITickManager.class, TickManagerCache.class ); gcr.registerGridCache( IEnergyGrid.class, EnergyGridCache.class ); gcr.registerGridCache( IPathingGrid.class, PathGridCache.class ); @@ -541,7 +541,7 @@ public final class Registration registries.cell().addCellHandler( new BasicCellHandler() ); registries.cell().addCellHandler( new CreativeCellHandler() ); - for( ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() ) + for( final ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() ) { final double weight = 32; @@ -567,7 +567,7 @@ public final class Registration } } - public void postInit( FMLPostInitializationEvent event ) + public void postInit( final FMLPostInitializationEvent event ) { this.registerSpatial( true ); @@ -586,7 +586,7 @@ public final class Registration GuiText.values(); Api.INSTANCE.partHelper().initFMPSupport(); - for( Block block : blocks.multiPart().maybeBlock().asSet() ) + for( final Block block : blocks.multiPart().maybeBlock().asSet() ) { ( (BlockCableBus) block ).setupTile(); } @@ -656,22 +656,22 @@ public final class Registration // Inscriber Upgrades.SPEED.registerItem( blocks.inscriber(), 3 ); - for( Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() ) + for( final Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() ) { registries.wireless().registerWirelessHandler( (IWirelessTermHandler) wirelessTerminalItem ); } if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) ) { - ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR ); + final ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR ); final IMaterials materials = definitions.materials(); - for( ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() ) + for( final ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() ) { d.addItem( new WeightedRandomChestContent( crystal, 1, 4, 2 ) ); } - for( ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() ) + for( final ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() ) { d.addItem( new WeightedRandomChestContent( dust, 1, 4, 2 ) ); } @@ -693,7 +693,7 @@ public final class Registration GameRegistry.registerWorldGenerator( new MeteoriteWorldGen(), 0 ); } - IMovableRegistry mr = registries.movable(); + final IMovableRegistry mr = registries.movable(); /** * You can't move bed rock. @@ -731,7 +731,7 @@ public final class Registration /** * world gen */ - for( WorldGenType type : WorldGenType.values() ) + for( final WorldGenType type : WorldGenType.values() ) { registries.worldgen().disableWorldGenForProviderID( type, StorageWorldProvider.class ); @@ -743,7 +743,7 @@ public final class Registration } // whitelist from config - for( int dimension : AEConfig.instance.meteoriteDimensionWhitelist ) + for( final int dimension : AEConfig.instance.meteoriteDimensionWhitelist ) { registries.worldgen().enableWorldGenForDimension( WorldGenType.Meteorites, dimension ); } diff --git a/src/main/java/appeng/core/api/ApiPart.java b/src/main/java/appeng/core/api/ApiPart.java index b87c409b..a77d1c44 100644 --- a/src/main/java/appeng/core/api/ApiPart.java +++ b/src/main/java/appeng/core/api/ApiPart.java @@ -71,7 +71,7 @@ public class ApiPart implements IPartHelper public void initFMPSupport() { - for( Class layerInterface : this.interfaces2Layer.keySet() ) + for( final Class layerInterface : this.interfaces2Layer.keySet() ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) ) { @@ -80,7 +80,7 @@ public class ApiPart implements IPartHelper } } - public Class getCombinedInstance( String base ) + public Class getCombinedInstance( final String base ) { if( this.desc.isEmpty() ) { @@ -88,13 +88,13 @@ public class ApiPart implements IPartHelper { return Class.forName( base ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { throw new IllegalStateException( e ); } } - String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() ); + final String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() ); if( this.tileImplementations.get( description ) != null ) { @@ -107,7 +107,7 @@ public class ApiPart implements IPartHelper { Addendum = Class.forName( base ).getSimpleName(); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { AELog.error( e ); } @@ -117,22 +117,22 @@ public class ApiPart implements IPartHelper { myCLass = Class.forName( f ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { throw new IllegalStateException( e ); } String path = f; - for( String name : this.desc ) + for( final String name : this.desc ) { try { - String newPath = path + ';' + name; + final String newPath = path + ';' + name; myCLass = this.getClassByDesc( Addendum, newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) ); path = newPath; } - catch( Throwable t ) + catch( final Throwable t ) { AELog.warning( "Error loading " + name ); AELog.error( t ); @@ -146,51 +146,51 @@ public class ApiPart implements IPartHelper return myCLass; } - public Class getClassByDesc( String addendum, String fullPath, String root, String next ) + public Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next ) { if( this.roots.get( fullPath ) != null ) { return this.roots.get( fullPath ); } - ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); - ClassNode n = this.getReader( next ); - String originalName = n.name; + final ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassNode n = this.getReader( next ); + final String originalName = n.name; try { n.name = n.name + '_' + addendum; n.superName = Class.forName( root ).getName().replace( ".", "/" ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } - for( MethodNode mn : n.methods ) + for( final MethodNode mn : n.methods ) { - Iterator i = mn.instructions.iterator(); + final Iterator i = mn.instructions.iterator(); while( i.hasNext() ) { this.processNode( i.next(), n.superName ); } } - DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper(); + final DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper(); remapper.inputOutput.put( "appeng/api/parts/LayerBase", n.superName ); remapper.inputOutput.put( originalName, n.name ); n.accept( new RemappingClassAdapter( cw, remapper ) ); // n.accept( cw ); // n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) ); - byte[] byteArray = cw.toByteArray(); - int size = byteArray.length; - Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray ); + final byte[] byteArray = cw.toByteArray(); + final int size = byteArray.length; + final Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray ); try { - Object fish = clazz.newInstance(); - Class rootC = Class.forName( root ); + final Object fish = clazz.newInstance(); + final Class rootC = Class.forName( root ); boolean hasError = false; @@ -226,7 +226,7 @@ public class ApiPart implements IPartHelper AELog.info( "Layer: " + n.name + " loaded successfully - " + size + " bytes" ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.severe( "Layer: " + n.name + " Failed." ); AELog.error( t ); @@ -236,30 +236,30 @@ public class ApiPart implements IPartHelper return clazz; } - public ClassNode getReader( String name ) + public ClassNode getReader( final String name ) { - String path = '/' + name.replace( ".", "/" ) + ".class"; - InputStream is = this.getClass().getResourceAsStream( path ); + final String path = '/' + name.replace( ".", "/" ) + ".class"; + final InputStream is = this.getClass().getResourceAsStream( path ); try { - ClassReader cr = new ClassReader( is ); + final ClassReader cr = new ClassReader( is ); - ClassNode cn = new ClassNode(); + final ClassNode cn = new ClassNode(); cr.accept( cn, ClassReader.EXPAND_FRAMES ); return cn; } - catch( IOException e ) + catch( final IOException e ) { throw new IllegalStateException( "Error loading " + name, e ); } } - private void processNode( AbstractInsnNode next, String nePar ) + private void processNode( final AbstractInsnNode next, final String nePar ) { if( next instanceof MethodInsnNode ) { - MethodInsnNode min = (MethodInsnNode) next; + final MethodInsnNode min = (MethodInsnNode) next; if( min.owner.equals( "appeng/api/parts/LayerBase" ) ) { min.owner = nePar; @@ -267,26 +267,26 @@ public class ApiPart implements IPartHelper } } - private Class loadClass( String name, byte[] b ) + private Class loadClass( final String name, byte[] b ) { // override classDefine (as it is protected) and define the class. Class clazz = null; try { - ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); - Class root = ClassLoader.class; - Class cls = loader.getClass(); - Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class ); - Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class ); + final ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); + final Class root = ClassLoader.class; + final Class cls = loader.getClass(); + final Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class ); + final Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class ); runTransformersMethod.setAccessible( true ); defineClassMethod.setAccessible( true ); try { - Object[] argsA = { name, name, b }; + final Object[] argsA = { name, name, b }; b = (byte[]) runTransformersMethod.invoke( loader, argsA ); - Object[] args = { name, b, 0, b.length }; + final Object[] args = { name, b, 0, b.length }; clazz = (Class) defineClassMethod.invoke( loader, args ); } finally @@ -295,7 +295,7 @@ public class ApiPart implements IPartHelper defineClassMethod.setAccessible( false ); } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); throw new IllegalStateException( "Unable to manage part API.", e ); @@ -304,7 +304,7 @@ public class ApiPart implements IPartHelper } @Override - public boolean registerNewLayer( String layer, String layerInterface ) + public boolean registerNewLayer( final String layer, final String layerInterface ) { try { @@ -320,7 +320,7 @@ public class ApiPart implements IPartHelper AELog.info( "Layer " + layer + " not registered, " + layerInterface + " already has a layer." ); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -328,7 +328,7 @@ public class ApiPart implements IPartHelper } @Override - public void setItemBusRenderer( IPartItem i ) + public void setItemBusRenderer( final IPartItem i ) { if( Platform.isClient() && i instanceof Item ) { @@ -337,7 +337,7 @@ public class ApiPart implements IPartHelper } @Override - public boolean placeBus( ItemStack is, int x, int y, int z, int side, EntityPlayer player, World w ) + public boolean placeBus( final ItemStack is, final int x, final int y, final int z, final int side, final EntityPlayer player, final World w ) { return PartPlacement.place( is, x, y, z, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 ); } @@ -354,9 +354,9 @@ public class ApiPart implements IPartHelper public final HashMap inputOutput = new HashMap(); @Override - public String map( String typeName ) + public String map( final String typeName ) { - String o = this.inputOutput.get( typeName ); + final String o = this.inputOutput.get( typeName ); if( o == null ) { return typeName; diff --git a/src/main/java/appeng/core/api/ApiStorage.java b/src/main/java/appeng/core/api/ApiStorage.java index 301f21d7..afbb2766 100644 --- a/src/main/java/appeng/core/api/ApiStorage.java +++ b/src/main/java/appeng/core/api/ApiStorage.java @@ -48,19 +48,19 @@ public class ApiStorage implements IStorageHelper { @Override - public ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req ) + public ICraftingLink loadCraftingLink( final NBTTagCompound data, final ICraftingRequester req ) { return new CraftingLink( data, req ); } @Override - public IAEItemStack createItemStack( ItemStack is ) + public IAEItemStack createItemStack( final ItemStack is ) { return AEItemStack.create( is ); } @Override - public IAEFluidStack createFluidStack( FluidStack is ) + public IAEFluidStack createFluidStack( final FluidStack is ) { return AEFluidStack.create( is ); } @@ -78,25 +78,25 @@ public class ApiStorage implements IStorageHelper } @Override - public IAEItemStack readItemFromPacket( ByteBuf input ) throws IOException + public IAEItemStack readItemFromPacket( final ByteBuf input ) throws IOException { return AEItemStack.loadItemStackFromPacket( input ); } @Override - public IAEFluidStack readFluidFromPacket( ByteBuf input ) throws IOException + public IAEFluidStack readFluidFromPacket( final ByteBuf input ) throws IOException { return AEFluidStack.loadFluidStackFromPacket( input ); } @Override - public IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory cell, IAEItemStack request, BaseActionSource src ) + public IAEItemStack poweredExtraction( final IEnergySource energy, final IMEInventory cell, final IAEItemStack request, final BaseActionSource src ) { return Platform.poweredExtraction( energy, cell, request, src ); } @Override - public IAEItemStack poweredInsert( IEnergySource energy, IMEInventory cell, IAEItemStack input, BaseActionSource src ) + public IAEItemStack poweredInsert( final IEnergySource energy, final IMEInventory cell, final IAEItemStack input, final BaseActionSource src ) { return Platform.poweredInsert( energy, cell, input, src ); } diff --git a/src/main/java/appeng/core/api/definitions/ApiBlocks.java b/src/main/java/appeng/core/api/definitions/ApiBlocks.java index dbed86b9..50525cea 100644 --- a/src/main/java/appeng/core/api/definitions/ApiBlocks.java +++ b/src/main/java/appeng/core/api/definitions/ApiBlocks.java @@ -166,7 +166,7 @@ public final class ApiBlocks implements IBlocks private final Set orientables; - public ApiBlocks( DefinitionConstructor constructor ) + public ApiBlocks( final DefinitionConstructor constructor ) { final BlockLightDetector lightDetector = new BlockLightDetector(); final BlockQuartzPillar quartzPillar = new BlockQuartzPillar(); diff --git a/src/main/java/appeng/core/api/definitions/ApiItems.java b/src/main/java/appeng/core/api/definitions/ApiItems.java index d98816c9..566fb3eb 100644 --- a/src/main/java/appeng/core/api/definitions/ApiItems.java +++ b/src/main/java/appeng/core/api/definitions/ApiItems.java @@ -113,7 +113,7 @@ public final class ApiItems implements IItems private final IItemDefinition toolDebugCard; private final IItemDefinition toolReplicatorCard; - public ApiItems( DefinitionConstructor constructor ) + public ApiItems( final DefinitionConstructor constructor ) { this.certusQuartzAxe = constructor.registerItemDefinition( new ToolQuartzAxe( AEFeature.CertusQuartzTools ) ); this.certusQuartzHoe = constructor.registerItemDefinition( new ToolQuartzHoe( AEFeature.CertusQuartzTools ) ); diff --git a/src/main/java/appeng/core/api/definitions/ApiMaterials.java b/src/main/java/appeng/core/api/definitions/ApiMaterials.java index 4deb5f0e..b62e688c 100644 --- a/src/main/java/appeng/core/api/definitions/ApiMaterials.java +++ b/src/main/java/appeng/core/api/definitions/ApiMaterials.java @@ -103,7 +103,7 @@ public final class ApiMaterials implements IMaterials private final IItemDefinition qESingularity; private final IItemDefinition blankPattern; - public ApiMaterials( DefinitionConstructor constructor ) + public ApiMaterials( final DefinitionConstructor constructor ) { final ItemMultiMaterial itemMultiMaterial = new ItemMultiMaterial(); constructor.registerItemDefinition( itemMultiMaterial ); diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index b3e1ad11..0f57f9e2 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -73,7 +73,7 @@ public final class ApiParts implements IParts private final IItemDefinition storageMonitor; private final IItemDefinition conversionMonitor; - public ApiParts( DefinitionConstructor constructor, IPartHelper partHelper ) + public ApiParts( final DefinitionConstructor constructor, final IPartHelper partHelper ) { final ItemMultiPart itemMultiPart = new ItemMultiPart( partHelper ); constructor.registerItemDefinition( itemMultiPart ); diff --git a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java index 68923b8c..63d83422 100644 --- a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java +++ b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java @@ -42,13 +42,13 @@ public class DefinitionConstructor private final FeatureRegistry features; private final FeatureHandlerRegistry handlers; - public DefinitionConstructor( FeatureRegistry features, FeatureHandlerRegistry handlers ) + public DefinitionConstructor( final FeatureRegistry features, final FeatureHandlerRegistry handlers ) { this.features = features; this.handlers = handlers; } - public final ITileDefinition registerTileDefinition( IAEFeature feature ) + public final ITileDefinition registerTileDefinition( final IAEFeature feature ) { final IBlockDefinition definition = this.registerBlockDefinition( feature ); @@ -60,7 +60,7 @@ public class DefinitionConstructor throw new IllegalStateException( "No tile definition for " + feature ); } - public final IBlockDefinition registerBlockDefinition( IAEFeature feature ) + public final IBlockDefinition registerBlockDefinition( final IAEFeature feature ) { final IItemDefinition definition = this.registerItemDefinition( feature ); @@ -72,7 +72,7 @@ public class DefinitionConstructor throw new IllegalStateException( "No block definition for " + feature ); } - public final IItemDefinition registerItemDefinition( IAEFeature feature ) + public final IItemDefinition registerItemDefinition( final IAEFeature feature ) { final IFeatureHandler handler = feature.handler(); @@ -87,13 +87,13 @@ public class DefinitionConstructor return definition; } - public final AEColoredItemDefinition constructColoredDefinition( IItemDefinition target, int offset ) + public final AEColoredItemDefinition constructColoredDefinition( final IItemDefinition target, final int offset ) { final ColoredItemDefinition definition = new ColoredItemDefinition(); - for( Item targetItem : target.maybeItem().asSet() ) + for( final Item targetItem : target.maybeItem().asSet() ) { - for( AEColor color : AEColor.VALID_COLORS ) + for( final AEColor color : AEColor.VALID_COLORS ) { final ActivityState state = ActivityState.from( target.isEnabled() ); @@ -104,11 +104,11 @@ public class DefinitionConstructor return definition; } - public final AEColoredItemDefinition constructColoredDefinition( ItemMultiPart target, PartType type ) + public final AEColoredItemDefinition constructColoredDefinition( final ItemMultiPart target, final PartType type ) { final ColoredItemDefinition definition = new ColoredItemDefinition(); - for( AEColor color : AEColor.values() ) + for( final AEColor color : AEColor.values() ) { final ItemStackSrc multiPartSource = target.createPart( type, color ); diff --git a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java index 30663ddd..40fb94ab 100644 --- a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java @@ -33,13 +33,13 @@ public class IMCBlackListSpatial implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - ItemStack is = m.getItemStackValue(); + final ItemStack is = m.getItemStackValue(); if( is != null ) { - Block blk = Block.getBlockFromItem( is.getItem() ); + final Block blk = Block.getBlockFromItem( is.getItem() ); if( blk != null ) { AEApi.instance().registries().movable().blacklistBlock( blk ); diff --git a/src/main/java/appeng/core/api/imc/IMCGrinder.java b/src/main/java/appeng/core/api/imc/IMCGrinder.java index c289d890..4e2fc892 100644 --- a/src/main/java/appeng/core/api/imc/IMCGrinder.java +++ b/src/main/java/appeng/core/api/imc/IMCGrinder.java @@ -65,16 +65,16 @@ import appeng.core.api.IIMCProcessor; public class IMCGrinder implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - NBTTagCompound msg = m.getNBTValue(); - NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" ); - NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" ); + final NBTTagCompound msg = m.getNBTValue(); + final NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" ); + final NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" ); - ItemStack in = ItemStack.loadItemStackFromNBT( inTag ); - ItemStack out = ItemStack.loadItemStackFromNBT( outTag ); + final ItemStack in = ItemStack.loadItemStackFromNBT( inTag ); + final ItemStack out = ItemStack.loadItemStackFromNBT( outTag ); - int turns = msg.getInteger( "turns" ); + final int turns = msg.getInteger( "turns" ); if( in == null ) { @@ -88,15 +88,15 @@ public class IMCGrinder implements IIMCProcessor if( msg.hasKey( "optional" ) ) { - NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" ); - ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag ); + final NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" ); + final ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag ); if( optional == null ) { throw new IllegalStateException( "invalid optional" ); } - float chance = msg.getFloat( "chance" ); + final float chance = msg.getFloat( "chance" ); AEApi.instance().registries().grinder().addRecipe( in, out, optional, chance, turns ); } diff --git a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java index c99e6e88..5cb8774a 100644 --- a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java +++ b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java @@ -45,13 +45,13 @@ public class IMCMatterCannon implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - NBTTagCompound msg = m.getNBTValue(); - NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" ); + final NBTTagCompound msg = m.getNBTValue(); + final NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" ); - ItemStack ammo = ItemStack.loadItemStackFromNBT( item ); - double weight = msg.getDouble( "weight" ); + final ItemStack ammo = ItemStack.loadItemStackFromNBT( item ); + final double weight = msg.getDouble( "weight" ); if( ammo == null ) { diff --git a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java index e35ae92c..99b29f77 100644 --- a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java +++ b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java @@ -46,15 +46,15 @@ public class IMCP2PAttunement implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH ); + final String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH ); - TunnelType type = TunnelType.valueOf( key ); + final TunnelType type = TunnelType.valueOf( key ); if( type != null ) { - ItemStack is = m.getItemStackValue(); + final ItemStack is = m.getItemStackValue(); if( is != null ) { AEApi.instance().registries().p2pTunnel().addNewAttunement( is, type ); diff --git a/src/main/java/appeng/core/api/imc/IMCSpatial.java b/src/main/java/appeng/core/api/imc/IMCSpatial.java index ba8a1fd7..5196f141 100644 --- a/src/main/java/appeng/core/api/imc/IMCSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCSpatial.java @@ -36,15 +36,15 @@ public class IMCSpatial implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { try { - Class classInstance = Class.forName( m.getStringValue() ); + final Class classInstance = Class.forName( m.getStringValue() ); AEApi.instance().registries().movable().whiteListTileEntity( classInstance ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { AELog.info( "Bad Class Registered: " + m.getStringValue() + " by " + m.getSender() ); } diff --git a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java index 905e3c3b..d19ed92d 100644 --- a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java @@ -27,7 +27,7 @@ abstract class BaseCrashEnhancement implements ICrashCallable private final String name; private final String value; - public BaseCrashEnhancement( String name, String value ) + public BaseCrashEnhancement( final String name, final String value ) { this.name = name; this.value = value; diff --git a/src/main/java/appeng/core/crash/ModCrashEnhancement.java b/src/main/java/appeng/core/crash/ModCrashEnhancement.java index 274b7751..74e50993 100644 --- a/src/main/java/appeng/core/crash/ModCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/ModCrashEnhancement.java @@ -13,7 +13,7 @@ public class ModCrashEnhancement extends BaseCrashEnhancement + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion + net.minecraftforge.common.ForgeVersion.buildVersion; - public ModCrashEnhancement( CrashInfo output ) + public ModCrashEnhancement( final CrashInfo output ) { super( "AE2 Version", MOD_VERSION ); } diff --git a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java index 711c5c6d..6b651120 100644 --- a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java @@ -37,7 +37,7 @@ public final class AEBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final BlockDefinition definition; - public AEBlockFeatureHandler( EnumSet features, AEBaseBlock featured, Optional subName ) + public AEBlockFeatureHandler( final EnumSet features, final AEBaseBlock featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -64,7 +64,7 @@ public final class AEBlockFeatureHandler implements IFeatureHandler { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name ); this.featured.setBlockTextureName( "appliedenergistics2:" + name ); diff --git a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java index 90ae8156..4ae9055a 100644 --- a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java +++ b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java @@ -42,7 +42,7 @@ public final class AECableBusFeatureHandler implements IFeatureHandler private final boolean enabled; private final TileDefinition definition; - public AECableBusFeatureHandler( EnumSet features, BlockCableBus featured, Optional subName ) + public AECableBusFeatureHandler( final EnumSet features, final BlockCableBus featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -72,7 +72,7 @@ public final class AECableBusFeatureHandler implements IFeatureHandler { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name ); this.featured.setBlockTextureName( "appliedenergistics2:" + name ); diff --git a/src/main/java/appeng/core/features/AEFeature.java b/src/main/java/appeng/core/features/AEFeature.java index c90ae61e..f0ed7fa1 100644 --- a/src/main/java/appeng/core/features/AEFeature.java +++ b/src/main/java/appeng/core/features/AEFeature.java @@ -77,12 +77,12 @@ public enum AEFeature public final boolean isVisible; public final boolean defaultValue; - AEFeature( String cat ) + AEFeature( final String cat ) { this( cat, true ); } - AEFeature( String cat, boolean defaultValue ) + AEFeature( final String cat, final boolean defaultValue ) { this.category = cat; this.isVisible = !this.name().equals( "Core" ); diff --git a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java index 80009cd7..35a3ebcc 100644 --- a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java @@ -40,7 +40,7 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final TileDefinition definition; - public AETileBlockFeatureHandler( EnumSet features, AEBaseTileBlock featured, Optional subName ) + public AETileBlockFeatureHandler( final EnumSet features, final AEBaseTileBlock featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -67,7 +67,7 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name ); this.featured.setBlockTextureName( "appliedenergistics2:" + name ); diff --git a/src/main/java/appeng/core/features/ActivityState.java b/src/main/java/appeng/core/features/ActivityState.java index a4702fbe..1c4f71d1 100644 --- a/src/main/java/appeng/core/features/ActivityState.java +++ b/src/main/java/appeng/core/features/ActivityState.java @@ -24,7 +24,7 @@ public enum ActivityState Enabled, Disabled; - public static ActivityState from( boolean enabled ) + public static ActivityState from( final boolean enabled ) { if( enabled ) { diff --git a/src/main/java/appeng/core/features/BlockDefinition.java b/src/main/java/appeng/core/features/BlockDefinition.java index 0a3d851b..252f7a7d 100644 --- a/src/main/java/appeng/core/features/BlockDefinition.java +++ b/src/main/java/appeng/core/features/BlockDefinition.java @@ -41,7 +41,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition private static final ItemBlockTransformer ITEMBLOCK_TRANSFORMER = new ItemBlockTransformer(); private final Optional block; - public BlockDefinition( Block block, ActivityState state ) + public BlockDefinition( final Block block, final ActivityState state ) { super( constructItemFromBlock( block ), state ); @@ -65,7 +65,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return item from block */ - private static Item constructItemFromBlock( Block block ) + private static Item constructItemFromBlock( final Block block ) { final Class itemclass = getItemBlockConstructor( block ); return constructItemBlock( block, itemclass ); @@ -81,7 +81,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return a {@link Class} extending ItemBlock */ - private static Class getItemBlockConstructor( Block block ) + private static Class getItemBlockConstructor( final Block block ) { if( block instanceof AEBaseBlock ) { @@ -104,22 +104,22 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return an {@link Item} for the block. Actually always a sub type of {@link ItemBlock} */ - private static Item constructItemBlock( Block block, Class itemclass ) + private static Item constructItemBlock( final Block block, final Class itemclass ) { try { - Object[] itemCtorArgs = {}; - Class[] ctorArgClasses = new Class[itemCtorArgs.length + 1]; + final Object[] itemCtorArgs = {}; + final Class[] ctorArgClasses = new Class[itemCtorArgs.length + 1]; ctorArgClasses[0] = Block.class; for( int idx = 1; idx < ctorArgClasses.length; idx++ ) { ctorArgClasses[idx] = itemCtorArgs[idx - 1].getClass(); } - Constructor itemCtor = itemclass.getConstructor( ctorArgClasses ); + final Constructor itemCtor = itemclass.getConstructor( ctorArgClasses ); return itemCtor.newInstance( ObjectArrays.concat( block, itemCtorArgs ) ); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } @@ -138,13 +138,13 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition } @Override - public final Optional maybeStack( int stackSize ) + public final Optional maybeStack( final int stackSize ) { return this.block.transform( new ItemStackTransformer( stackSize ) ); } @Override - public final boolean isSameAs( IBlockAccess world, int x, int y, int z ) + public final boolean isSameAs( final IBlockAccess world, final int x, final int y, final int z ) { return this.isEnabled() && world.getBlock( x, y, z ) == this.block.get(); } @@ -152,7 +152,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition private static class ItemBlockTransformer implements Function { @Override - public ItemBlock apply( Block input ) + public ItemBlock apply( final Block input ) { return new ItemBlock( input ); } @@ -162,7 +162,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -170,7 +170,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition } @Override - public ItemStack apply( Block input ) + public ItemStack apply( final Block input ) { return new ItemStack( input, this.stackSize ); } diff --git a/src/main/java/appeng/core/features/BlockStackSrc.java b/src/main/java/appeng/core/features/BlockStackSrc.java index 8030107d..1f6f18a1 100644 --- a/src/main/java/appeng/core/features/BlockStackSrc.java +++ b/src/main/java/appeng/core/features/BlockStackSrc.java @@ -35,7 +35,7 @@ public class BlockStackSrc implements IStackSrc public final int damage; private final boolean enabled; - public BlockStackSrc( Block block, int damage, ActivityState state ) + public BlockStackSrc( final Block block, final int damage, final ActivityState state ) { Preconditions.checkNotNull( block ); Preconditions.checkArgument( damage >= 0 ); @@ -49,7 +49,7 @@ public class BlockStackSrc implements IStackSrc @Nullable @Override - public ItemStack stack( int i ) + public ItemStack stack( final int i ) { return new ItemStack( this.block, i, this.damage ); } diff --git a/src/main/java/appeng/core/features/ColoredItemDefinition.java b/src/main/java/appeng/core/features/ColoredItemDefinition.java index 2ab2e89d..aef97a96 100644 --- a/src/main/java/appeng/core/features/ColoredItemDefinition.java +++ b/src/main/java/appeng/core/features/ColoredItemDefinition.java @@ -33,21 +33,21 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition final ItemStackSrc[] colors = new ItemStackSrc[17]; - public void add( AEColor v, ItemStackSrc is ) + public void add( final AEColor v, final ItemStackSrc is ) { this.colors[v.ordinal()] = is; } @Override - public Block block( AEColor color ) + public Block block( final AEColor color ) { return null; } @Override - public Item item( AEColor color ) + public Item item( final AEColor color ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( is == null ) { @@ -58,15 +58,15 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public Class entity( AEColor color ) + public Class entity( final AEColor color ) { return null; } @Override - public ItemStack stack( AEColor color, int stackSize ) + public ItemStack stack( final AEColor color, final int stackSize ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( is == null ) { @@ -77,9 +77,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public ItemStack[] allStacks( int stackSize ) + public ItemStack[] allStacks( final int stackSize ) { - ItemStack[] is = new ItemStack[this.colors.length]; + final ItemStack[] is = new ItemStack[this.colors.length]; for( int x = 0; x < is.length; x++ ) { is[x] = this.colors[x].stack( 1 ); @@ -88,9 +88,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public boolean sameAs( AEColor color, ItemStack comparableItem ) + public boolean sameAs( final AEColor color, final ItemStack comparableItem ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( comparableItem == null || is == null ) { diff --git a/src/main/java/appeng/core/features/DamagedItemDefinition.java b/src/main/java/appeng/core/features/DamagedItemDefinition.java index 54c6dec5..6228b0d7 100644 --- a/src/main/java/appeng/core/features/DamagedItemDefinition.java +++ b/src/main/java/appeng/core/features/DamagedItemDefinition.java @@ -37,7 +37,7 @@ public final class DamagedItemDefinition implements IItemDefinition private static final ItemTransformer ITEM_TRANSFORMER = new ItemTransformer(); private final Optional source; - public DamagedItemDefinition( @Nonnull IStackSrc source ) + public DamagedItemDefinition( @Nonnull final IStackSrc source ) { Preconditions.checkNotNull( source ); @@ -58,7 +58,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public Optional maybeStack( int stackSize ) + public Optional maybeStack( final int stackSize ) { return this.source.transform( new ItemStackTransformer( stackSize ) ); } @@ -70,7 +70,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public boolean isSameAs( ItemStack comparableStack ) + public boolean isSameAs( final ItemStack comparableStack ) { if( comparableStack == null ) { @@ -81,7 +81,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public boolean isSameAs( IBlockAccess world, int x, int y, int z ) + public boolean isSameAs( final IBlockAccess world, final int x, final int y, final int z ) { return false; } @@ -89,7 +89,7 @@ public final class DamagedItemDefinition implements IItemDefinition private static class ItemTransformer implements Function { @Override - public Item apply( IStackSrc input ) + public Item apply( final IStackSrc input ) { return input.getItem(); } @@ -99,7 +99,7 @@ public final class DamagedItemDefinition implements IItemDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -107,7 +107,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public ItemStack apply( IStackSrc input ) + public ItemStack apply( final IStackSrc input ) { return input.stack( this.stackSize ); } diff --git a/src/main/java/appeng/core/features/DefinitionConverter.java b/src/main/java/appeng/core/features/DefinitionConverter.java index 0dc79c34..d9370943 100644 --- a/src/main/java/appeng/core/features/DefinitionConverter.java +++ b/src/main/java/appeng/core/features/DefinitionConverter.java @@ -23,22 +23,22 @@ import appeng.api.util.AEItemDefinition; @Deprecated public final class DefinitionConverter { - public AEItemDefinition of( ITileDefinition definition ) + public AEItemDefinition of( final ITileDefinition definition ) { return new AETile( definition ); } - public AEItemDefinition of( IBlockDefinition definition ) + public AEItemDefinition of( final IBlockDefinition definition ) { return new AEBlock( definition ); } - public AEItemDefinition of( IItemDefinition definition ) + public AEItemDefinition of( final IItemDefinition definition ) { return new AEItem( definition ); } - public AEItemDefinition of( IComparableDefinition definition ) + public AEItemDefinition of( final IComparableDefinition definition ) { return new AEComparable( definition ); } @@ -47,7 +47,7 @@ public final class DefinitionConverter { private final IComparableDefinition definition; - public AEComparable( IComparableDefinition definition ) + public AEComparable( final IComparableDefinition definition ) { this.definition = definition; } @@ -75,19 +75,19 @@ public final class DefinitionConverter @Nullable @Override - public ItemStack stack( int stackSize ) + public ItemStack stack( final int stackSize ) { return null; } @Override - public boolean sameAsStack( ItemStack comparableItem ) + public boolean sameAsStack( final ItemStack comparableItem ) { return this.definition.isSameAs( comparableItem ); } @Override - public boolean sameAsBlock( IBlockAccess world, int x, int y, int z ) + public boolean sameAsBlock( final IBlockAccess world, final int x, final int y, final int z ) { return false; } @@ -97,7 +97,7 @@ public final class DefinitionConverter { private final IItemDefinition definition; - public AEItem( IItemDefinition definition ) + public AEItem( final IItemDefinition definition ) { super( definition ); @@ -106,7 +106,7 @@ public final class DefinitionConverter @Nullable @Override - public ItemStack stack( int stackSize ) + public ItemStack stack( final int stackSize ) { return this.definition.maybeStack( stackSize ).orNull(); } @@ -123,7 +123,7 @@ public final class DefinitionConverter { private final IBlockDefinition definition; - public AEBlock( IBlockDefinition definition ) + public AEBlock( final IBlockDefinition definition ) { super( definition ); @@ -138,7 +138,7 @@ public final class DefinitionConverter } @Override - public boolean sameAsBlock( IBlockAccess world, int x, int y, int z ) + public boolean sameAsBlock( final IBlockAccess world, final int x, final int y, final int z ) { return this.definition.isSameAs( world, x, y, z ); } @@ -148,7 +148,7 @@ public final class DefinitionConverter { private final ITileDefinition definition; - public AETile( ITileDefinition definition ) + public AETile( final ITileDefinition definition ) { super( definition ); diff --git a/src/main/java/appeng/core/features/FeatureNameExtractor.java b/src/main/java/appeng/core/features/FeatureNameExtractor.java index 75f47c74..4eb0cfd4 100644 --- a/src/main/java/appeng/core/features/FeatureNameExtractor.java +++ b/src/main/java/appeng/core/features/FeatureNameExtractor.java @@ -33,7 +33,7 @@ public class FeatureNameExtractor private final Class clazz; private final Optional subName; - public FeatureNameExtractor( Class clazz, Optional subName ) + public FeatureNameExtractor( final Class clazz, final Optional subName ) { this.clazz = clazz; this.subName = subName; diff --git a/src/main/java/appeng/core/features/FeaturedActiveChecker.java b/src/main/java/appeng/core/features/FeaturedActiveChecker.java index 6f0de24a..49b5b885 100644 --- a/src/main/java/appeng/core/features/FeaturedActiveChecker.java +++ b/src/main/java/appeng/core/features/FeaturedActiveChecker.java @@ -28,14 +28,14 @@ public final class FeaturedActiveChecker { private final Set features; - public FeaturedActiveChecker( Set features ) + public FeaturedActiveChecker( final Set features ) { this.features = features; } public ActivityState getActivityState() { - for( AEFeature f : this.features ) + for( final AEFeature f : this.features ) { if( !AEConfig.instance.isFeatureEnabled( f ) ) { diff --git a/src/main/java/appeng/core/features/ItemDefinition.java b/src/main/java/appeng/core/features/ItemDefinition.java index 399b56c7..4ecc35c1 100644 --- a/src/main/java/appeng/core/features/ItemDefinition.java +++ b/src/main/java/appeng/core/features/ItemDefinition.java @@ -35,7 +35,7 @@ public class ItemDefinition implements IItemDefinition { private final Optional item; - public ItemDefinition( Item item, ActivityState state ) + public ItemDefinition( final Item item, final ActivityState state ) { Preconditions.checkNotNull( item ); Preconditions.checkNotNull( state ); @@ -57,7 +57,7 @@ public class ItemDefinition implements IItemDefinition } @Override - public Optional maybeStack( int stackSize ) + public Optional maybeStack( final int stackSize ) { return this.item.transform( new ItemStackTransformer( stackSize ) ); } @@ -69,13 +69,13 @@ public class ItemDefinition implements IItemDefinition } @Override - public final boolean isSameAs( ItemStack comparableStack ) + public final boolean isSameAs( final ItemStack comparableStack ) { return this.isEnabled() && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() ); } @Override - public boolean isSameAs( IBlockAccess world, int x, int y, int z ) + public boolean isSameAs( final IBlockAccess world, final int x, final int y, final int z ) { return false; } @@ -84,7 +84,7 @@ public class ItemDefinition implements IItemDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -92,7 +92,7 @@ public class ItemDefinition implements IItemDefinition } @Override - public ItemStack apply( Item input ) + public ItemStack apply( final Item input ) { return new ItemStack( input, this.stackSize ); } diff --git a/src/main/java/appeng/core/features/ItemFeatureHandler.java b/src/main/java/appeng/core/features/ItemFeatureHandler.java index 324d8ceb..816ccba6 100644 --- a/src/main/java/appeng/core/features/ItemFeatureHandler.java +++ b/src/main/java/appeng/core/features/ItemFeatureHandler.java @@ -40,7 +40,7 @@ public final class ItemFeatureHandler implements IFeatureHandler private final boolean enabled; private final ItemDefinition definition; - public ItemFeatureHandler( EnumSet features, Item item, IAEFeature featured, Optional subName ) + public ItemFeatureHandler( final EnumSet features, final Item item, final IAEFeature featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); diff --git a/src/main/java/appeng/core/features/ItemStackSrc.java b/src/main/java/appeng/core/features/ItemStackSrc.java index fc4b6f0e..ae7ee32a 100644 --- a/src/main/java/appeng/core/features/ItemStackSrc.java +++ b/src/main/java/appeng/core/features/ItemStackSrc.java @@ -34,7 +34,7 @@ public class ItemStackSrc implements IStackSrc public final int damage; private final boolean enabled; - public ItemStackSrc( Item item, int damage, ActivityState state ) + public ItemStackSrc( final Item item, final int damage, final ActivityState state ) { Preconditions.checkNotNull( item ); Preconditions.checkArgument( damage >= 0 ); @@ -48,7 +48,7 @@ public class ItemStackSrc implements IStackSrc @Nullable @Override - public ItemStack stack( int i ) + public ItemStack stack( final int i ) { return new ItemStack( this.item, i, this.damage ); } diff --git a/src/main/java/appeng/core/features/MaterialStackSrc.java b/src/main/java/appeng/core/features/MaterialStackSrc.java index 48b99730..1c09cc31 100644 --- a/src/main/java/appeng/core/features/MaterialStackSrc.java +++ b/src/main/java/appeng/core/features/MaterialStackSrc.java @@ -31,7 +31,7 @@ public class MaterialStackSrc implements IStackSrc { private final MaterialType src; - public MaterialStackSrc( MaterialType src ) + public MaterialStackSrc( final MaterialType src ) { Preconditions.checkNotNull( src ); @@ -39,7 +39,7 @@ public class MaterialStackSrc implements IStackSrc } @Override - public ItemStack stack( int stackSize ) + public ItemStack stack( final int stackSize ) { return this.src.stack( stackSize ); } diff --git a/src/main/java/appeng/core/features/NameResolver.java b/src/main/java/appeng/core/features/NameResolver.java index ec3a01ba..638c9f21 100644 --- a/src/main/java/appeng/core/features/NameResolver.java +++ b/src/main/java/appeng/core/features/NameResolver.java @@ -41,12 +41,12 @@ public final class NameResolver private final Class withOriginalName; - public NameResolver( Class withOriginalName ) + public NameResolver( final Class withOriginalName ) { this.withOriginalName = withOriginalName; } - public String getName( String subName ) + public String getName( final String subName ) { String name = this.withOriginalName.getSimpleName(); diff --git a/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java b/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java index 7a2345c6..23170b9d 100644 --- a/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java @@ -38,7 +38,7 @@ public class SlabBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final BlockDefinition definition; - public SlabBlockFeatureHandler( EnumSet features, AEBaseSlabBlock slabs ) + public SlabBlockFeatureHandler( final EnumSet features, final AEBaseSlabBlock slabs ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); this.slabs = slabs; diff --git a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java index 06073fbf..64558108 100644 --- a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java @@ -38,7 +38,7 @@ public class StairBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final BlockDefinition definition; - public StairBlockFeatureHandler( EnumSet features, BlockStairs stairs, Optional subName ) + public StairBlockFeatureHandler( final EnumSet features, final BlockStairs stairs, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -65,7 +65,7 @@ public class StairBlockFeatureHandler implements IFeatureHandler { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.stairs.setCreativeTab( CreativeTab.instance ); this.stairs.setBlockName( "appliedenergistics2." + name ); this.stairs.setBlockTextureName( "appliedenergistics2:" + name ); diff --git a/src/main/java/appeng/core/features/TileDefinition.java b/src/main/java/appeng/core/features/TileDefinition.java index bacac0ab..35a0ba04 100644 --- a/src/main/java/appeng/core/features/TileDefinition.java +++ b/src/main/java/appeng/core/features/TileDefinition.java @@ -34,7 +34,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini private static final TileEntityTransformer TILEENTITY_TRANSFORMER = new TileEntityTransformer(); private final Optional block; - public TileDefinition( AEBaseTileBlock block, ActivityState state ) + public TileDefinition( final AEBaseTileBlock block, final ActivityState state ) { super( block, state ); @@ -61,7 +61,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini private static class TileEntityTransformer implements Function> { @Override - public Class apply( AEBaseTileBlock input ) + public Class apply( final AEBaseTileBlock input ) { final Class entity = input.getTileEntityClass(); diff --git a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java index 087136a3..5c9805b1 100644 --- a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java +++ b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java @@ -38,7 +38,7 @@ public final class WrappedDamageItemDefinition implements ITileDefinition private final ITileDefinition definition; private final int damage; - public WrappedDamageItemDefinition( ITileDefinition definition, int damage ) + public WrappedDamageItemDefinition( final ITileDefinition definition, final int damage ) { Preconditions.checkNotNull( definition ); Preconditions.checkArgument( damage >= 0 ); @@ -84,7 +84,7 @@ public final class WrappedDamageItemDefinition implements ITileDefinition } @Override - public boolean isSameAs( ItemStack comparableStack ) + public boolean isSameAs( final ItemStack comparableStack ) { if( comparableStack == null ) { @@ -98,7 +98,7 @@ public final class WrappedDamageItemDefinition implements ITileDefinition } @Override - public boolean isSameAs( IBlockAccess world, int x, int y, int z ) + public boolean isSameAs( final IBlockAccess world, final int x, final int y, final int z ) { return this.definition.isSameAs( world, x, y, z ) && world.getBlockMetadata( x, y, z ) == this.damage; } @@ -108,7 +108,7 @@ public final class WrappedDamageItemDefinition implements ITileDefinition private final int stackSize; private final int damage; - public BlockTransformFunction( int stackSize, int damage ) + public BlockTransformFunction( final int stackSize, final int damage ) { Preconditions.checkArgument( stackSize > 0 ); Preconditions.checkArgument( damage >= 0 ); @@ -118,7 +118,7 @@ public final class WrappedDamageItemDefinition implements ITileDefinition } @Override - public ItemStack apply( Block input ) + public ItemStack apply( final Block input ) { Preconditions.checkNotNull( input ); diff --git a/src/main/java/appeng/core/features/registries/CellRegistry.java b/src/main/java/appeng/core/features/registries/CellRegistry.java index 3e5680db..8fb1d9d0 100644 --- a/src/main/java/appeng/core/features/registries/CellRegistry.java +++ b/src/main/java/appeng/core/features/registries/CellRegistry.java @@ -42,7 +42,7 @@ public class CellRegistry implements ICellRegistry } @Override - public void addCellHandler( ICellHandler h ) + public void addCellHandler( final ICellHandler h ) { if( h != null ) { @@ -51,13 +51,13 @@ public class CellRegistry implements ICellRegistry } @Override - public boolean isCellHandled( ItemStack is ) + public boolean isCellHandled( final ItemStack is ) { if( is == null ) { return false; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { @@ -68,13 +68,13 @@ public class CellRegistry implements ICellRegistry } @Override - public ICellHandler getHandler( ItemStack is ) + public ICellHandler getHandler( final ItemStack is ) { if( is == null ) { return null; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { @@ -85,13 +85,13 @@ public class CellRegistry implements ICellRegistry } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel chan ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel chan ) { if( is == null ) { return null; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { diff --git a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java index 085b8aa1..79a2dc1f 100644 --- a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java +++ b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java @@ -44,15 +44,15 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry } @Override - public void addExternalStorageInterface( IExternalStorageHandler ei ) + public void addExternalStorageInterface( final IExternalStorageHandler ei ) { this.Handlers.add( ei ); } @Override - public IExternalStorageHandler getHandler( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc ) + public IExternalStorageHandler getHandler( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc ) { - for( IExternalStorageHandler x : this.Handlers ) + for( final IExternalStorageHandler x : this.Handlers ) { if( x.canHandle( te, d, chan, mySrc ) ) { diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index 78e1ef1c..ea777e36 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -35,7 +35,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry private final Map, Class> caches = new HashMap, Class>(); @Override - public void registerGridCache( Class iface, Class implementation ) + public void registerGridCache( final Class iface, final Class implementation ) { if( iface.isAssignableFrom( implementation ) ) { @@ -48,33 +48,33 @@ public final class GridCacheRegistry implements IGridCacheRegistry } @Override - public HashMap, IGridCache> createCacheInstance( IGrid g ) + public HashMap, IGridCache> createCacheInstance( final IGrid g ) { - HashMap, IGridCache> map = new HashMap, IGridCache>(); + final HashMap, IGridCache> map = new HashMap, IGridCache>(); - for( Class iface : this.caches.keySet() ) + for( final Class iface : this.caches.keySet() ) { try { - Constructor c = this.caches.get( iface ).getConstructor( IGrid.class ); + final Constructor c = this.caches.get( iface ).getConstructor( IGrid.class ); map.put( iface, c.newInstance( g ) ); } - catch( NoSuchMethodException e ) + catch( final NoSuchMethodException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalArgumentException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); diff --git a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java index e65f117a..0c1d6e65 100644 --- a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java +++ b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java @@ -83,7 +83,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final int cost ) { if( in == null || out == null ) { @@ -96,7 +96,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final int cost ) { if( in == null || ( optional == null && out == null ) ) { @@ -109,7 +109,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final ItemStack optional2, final float chance2, final int cost ) { if( in == null || ( optional == null && out == null && optional2 == null ) ) { @@ -121,9 +121,9 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), this.copy( optional2 ), chance, chance2, cost ) ); } - private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe ) + private void injectRecipe( final AppEngGrinderRecipe appEngGrinderRecipe ) { - for( IGrinderEntry gr : this.recipes ) + for( final IGrinderEntry gr : this.recipes ) { if( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) ) { @@ -134,7 +134,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.recipes.add( appEngGrinderRecipe ); } - private ItemStack copy( ItemStack is ) + private ItemStack copy( final ItemStack is ) { if( is != null ) { @@ -144,12 +144,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public IGrinderEntry getRecipeForInput( ItemStack input ) + public IGrinderEntry getRecipeForInput( final ItemStack input ) { this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) ); if( input != null ) { - for( IGrinderEntry r : this.recipes ) + for( final IGrinderEntry r : this.recipes ) { if( Platform.isSameItem( input, r.getInput() ) ) { @@ -164,12 +164,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene return null; } - public void log( String o ) + public void log( final String o ) { AELog.grinder( o ); } - private int getDustToOreRatio( String name ) + private int getDustToOreRatio( final String name ) { if( name.equals( "Obsidian" ) ) { @@ -186,7 +186,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene return 2; } - private void addOre( String name, ItemStack item ) + private void addOre( final String name, final ItemStack item ) { if( item == null ) { @@ -198,11 +198,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene if( this.dusts.containsKey( name ) ) { - ItemStack is = this.dusts.get( name ).copy(); - int ratio = this.getDustToOreRatio( name ); + final ItemStack is = this.dusts.get( name ).copy(); + final int ratio = this.getDustToOreRatio( name ); if( ratio > 1 ) { - ItemStack extra = is.copy(); + final ItemStack extra = is.copy(); extra.stackSize = ratio - 1; this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 ); } @@ -213,7 +213,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - private void addIngot( String name, ItemStack item ) + private void addIngot( final String name, final ItemStack item ) { if( item == null ) { @@ -229,7 +229,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - private void addDust( String name, ItemStack item ) + private void addDust( final String name, final ItemStack item ) { if( item == null ) { @@ -245,16 +245,16 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.dusts.put( name, item ); - for( Entry d : this.ores.entrySet() ) + for( final Entry d : this.ores.entrySet() ) { if( name.equals( d.getValue() ) ) { - ItemStack is = item.copy(); + final ItemStack is = item.copy(); is.stackSize = 1; - int ratio = this.getDustToOreRatio( name ); + final int ratio = this.getDustToOreRatio( name ); if( ratio > 1 ) { - ItemStack extra = is.copy(); + final ItemStack extra = is.copy(); extra.stackSize = ratio - 1; this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 ); } @@ -265,7 +265,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - for( Entry d : this.ingots.entrySet() ) + for( final Entry d : this.ingots.entrySet() ) { if( name.equals( d.getValue() ) ) { @@ -275,11 +275,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void oreRegistered( String name, ItemStack item ) + public void oreRegistered( final String name, final ItemStack item ) { if( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) ) { - for( String ore : AEConfig.instance.grinderOres ) + for( final String ore : AEConfig.instance.grinderOres ) { if( name.equals( "ore" + ore ) ) { diff --git a/src/main/java/appeng/core/features/registries/InscriberRegistry.java b/src/main/java/appeng/core/features/registries/InscriberRegistry.java index 3e43741f..b19975eb 100644 --- a/src/main/java/appeng/core/features/registries/InscriberRegistry.java +++ b/src/main/java/appeng/core/features/registries/InscriberRegistry.java @@ -85,7 +85,7 @@ public final class InscriberRegistry implements IInscriberRegistry } @Override - public void addRecipe( IInscriberRecipe recipe ) + public void addRecipe( final IInscriberRecipe recipe ) { if( recipe == null ) { @@ -101,7 +101,7 @@ public final class InscriberRegistry implements IInscriberRegistry } @Override - public void removeRecipe( IInscriberRecipe toBeRemovedRecipe ) + public void removeRecipe( final IInscriberRecipe toBeRemovedRecipe ) { for( final Iterator iterator = this.recipes.iterator(); iterator.hasNext(); ) { @@ -127,7 +127,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withInputs( @Nonnull Collection inputs ) + public Builder withInputs( @Nonnull final Collection inputs ) { this.inputs = new ArrayList( inputs.size() ); this.inputs.addAll( inputs ); @@ -137,7 +137,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withOutput( @Nonnull ItemStack output ) + public Builder withOutput( @Nonnull final ItemStack output ) { this.output = output; @@ -146,7 +146,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withTopOptional( @Nonnull ItemStack topOptional ) + public Builder withTopOptional( @Nonnull final ItemStack topOptional ) { this.topOptional = topOptional; @@ -155,7 +155,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withBottomOptional( @Nonnull ItemStack bottomOptional ) + public Builder withBottomOptional( @Nonnull final ItemStack bottomOptional ) { this.bottomOptional = bottomOptional; @@ -164,7 +164,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withProcessType( @Nonnull InscriberProcessType type ) + public Builder withProcessType( @Nonnull final InscriberProcessType type ) { this.type = type; diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index 3ce6f10a..d5553ea3 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -44,7 +44,7 @@ public final class LocatableRegistry implements ILocatableRegistry } @SubscribeEvent - public void updateLocatable( LocatableEventAnnounce e ) + public void updateLocatable( final LocatableEventAnnounce e ) { if( Platform.isClient() ) { @@ -66,13 +66,13 @@ public final class LocatableRegistry implements ILocatableRegistry */ @Override @Deprecated - public Object findLocatableBySerial( long ser ) + public Object findLocatableBySerial( final long ser ) { return this.set.get( ser ); } @Override - public ILocatable getLocatableBy( long serial ) + public ILocatable getLocatableBy( final long serial ) { return this.set.get( serial ); } diff --git a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java index 72a07ed8..607845fa 100644 --- a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java +++ b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java @@ -42,15 +42,15 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo } @Override - public void registerAmmo( ItemStack ammo, double weight ) + public void registerAmmo( final ItemStack ammo, final double weight ) { this.DamageModifiers.put( ammo, weight ); } @Override - public float getPenetration( ItemStack is ) + public float getPenetration( final ItemStack is ) { - for( ItemStack o : this.DamageModifiers.keySet() ) + for( final ItemStack o : this.DamageModifiers.keySet() ) { if( Platform.isSameItem( o, is ) ) { @@ -61,7 +61,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo } @Override - public void oreRegistered( String name, ItemStack item ) + public void oreRegistered( final String name, final ItemStack item ) { if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) ) { @@ -141,7 +141,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo this.considerItem( name, item, "Electrum", ( 107.8682 + 196.96655 ) / 2.0 ); } - private void considerItem( String ore, ItemStack item, String name, double weight ) + private void considerItem( final String ore, final ItemStack item, final String name, final double weight ) { if( ore.equals( "berry" + name ) || ore.equals( "nugget" + name ) ) { diff --git a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java index 0558af32..0af4439c 100644 --- a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java +++ b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java @@ -46,13 +46,13 @@ public class MovableTileRegistry implements IMovableRegistry private final IMovableHandler nullHandler = new DefaultSpatialHandler(); @Override - public void blacklistBlock( Block blk ) + public void blacklistBlock( final Block blk ) { this.blacklisted.add( blk ); } @Override - public void whiteListTileEntity( Class c ) + public void whiteListTileEntity( final Class c ) { if( c.getName().equals( TileEntity.class.getName() ) ) { @@ -63,9 +63,9 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public boolean askToMove( TileEntity te ) + public boolean askToMove( final TileEntity te ) { - Class myClass = te.getClass(); + final Class myClass = te.getClass(); IMovableHandler canMove = this.Valid.get( myClass ); if( canMove == null ) @@ -87,12 +87,12 @@ public class MovableTileRegistry implements IMovableRegistry return false; } - private IMovableHandler testClass( Class myClass, TileEntity te ) + private IMovableHandler testClass( final Class myClass, final TileEntity te ) { IMovableHandler handler = null; // ask handlers... - for( IMovableHandler han : this.handlers ) + for( final IMovableHandler han : this.handlers ) { if( han.canHandle( myClass, te ) ) { @@ -116,7 +116,7 @@ public class MovableTileRegistry implements IMovableRegistry } // if you are on the white list your opted in. - for( Class testClass : this.test ) + for( final Class testClass : this.test ) { if( testClass.isAssignableFrom( myClass ) ) { @@ -130,26 +130,26 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public void doneMoving( TileEntity te ) + public void doneMoving( final TileEntity te ) { if( te instanceof IMovableTile ) { - IMovableTile mt = (IMovableTile) te; + final IMovableTile mt = (IMovableTile) te; mt.doneMoving(); } } @Override - public void addHandler( IMovableHandler han ) + public void addHandler( final IMovableHandler han ) { this.handlers.add( han ); } @Override - public IMovableHandler getHandler( TileEntity te ) + public IMovableHandler getHandler( final TileEntity te ) { - Class myClass = te.getClass(); - IMovableHandler h = this.Valid.get( myClass ); + final Class myClass = te.getClass(); + final IMovableHandler h = this.Valid.get( myClass ); return h == null ? this.dsh : h; } @@ -160,7 +160,7 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public boolean isBlacklisted( Block blk ) + public boolean isBlacklisted( final Block blk ) { return this.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 d639bde1..a5e3b0b2 100644 --- a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java +++ b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java @@ -108,7 +108,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry this.addNewAttunement( this.getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); this.addNewAttunement( this.getModItem( "ThermalDynamics", "ThermalDynamics_16", 0 ), TunnelType.FLUID ); - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { this.addNewAttunement( parts.cableGlass().stack( c, 1 ), TunnelType.ME ); this.addNewAttunement( parts.cableCovered().stack( c, 1 ), TunnelType.ME ); @@ -118,7 +118,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry } @Override - public void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type ) + public void addNewAttunement( @Nullable final ItemStack trigger, @Nullable final TunnelType type ) { if( type == null || trigger == null ) { @@ -130,7 +130,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry @Nullable @Override - public TunnelType getTunnelTypeByItem( ItemStack trigger ) + public TunnelType getTunnelTypeByItem( final ItemStack trigger ) { if( trigger != null ) { @@ -139,7 +139,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry return TunnelType.FLUID; } - for( ItemStack is : this.tunnels.keySet() ) + for( final ItemStack is : this.tunnels.keySet() ) { if( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) { @@ -157,9 +157,9 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry } @Nullable - private ItemStack getModItem( String modID, String name, int meta ) + private ItemStack getModItem( final String modID, final String name, final int meta ) { - ItemStack myItemStack = GameRegistry.findItemStack( modID, name, 1 ); + final ItemStack myItemStack = GameRegistry.findItemStack( modID, name, 1 ); if( myItemStack == null ) { @@ -170,9 +170,9 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry return myItemStack; } - private void addNewAttunement( IItemDefinition definition, TunnelType type ) + private void addNewAttunement( final IItemDefinition definition, final TunnelType type ) { - for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) + for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) { this.addNewAttunement( definitionStack, type ); } diff --git a/src/main/java/appeng/core/features/registries/PlayerRegistry.java b/src/main/java/appeng/core/features/registries/PlayerRegistry.java index a550fa33..c4f663e6 100644 --- a/src/main/java/appeng/core/features/registries/PlayerRegistry.java +++ b/src/main/java/appeng/core/features/registries/PlayerRegistry.java @@ -33,7 +33,7 @@ public class PlayerRegistry implements IPlayerRegistry { @Override - public int getID( GameProfile username ) + public int getID( final GameProfile username ) { if( username == null || !username.isComplete() ) { @@ -44,14 +44,14 @@ public class PlayerRegistry implements IPlayerRegistry } @Override - public int getID( EntityPlayer player ) + public int getID( final EntityPlayer player ) { return this.getID( player.getGameProfile() ); } @Nullable @Override - public EntityPlayer findPlayer( int playerID ) + public EntityPlayer findPlayer( final int playerID ) { return WorldData.instance().playerData().getPlayerFromID( playerID ); } diff --git a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java index 24d0f961..da5a6169 100644 --- a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java +++ b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java @@ -46,22 +46,22 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry private final Collection resolvers = new LinkedList(); @Override - public void addNewCraftHandler( String name, Class handler ) + public void addNewCraftHandler( final String name, final Class handler ) { this.handlers.put( name.toLowerCase( Locale.ENGLISH ), handler ); } @Override - public void addNewSubItemResolver( ISubItemResolver sir ) + public void addNewSubItemResolver( final ISubItemResolver sir ) { this.resolvers.add( sir ); } @Nullable @Override - public ICraftHandler getCraftHandlerFor( String name ) + public ICraftHandler getCraftHandlerFor( final String name ) { - Class clz = this.handlers.get( name ); + final Class clz = this.handlers.get( name ); if( clz == null ) { return null; @@ -70,7 +70,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { return clz.newInstance(); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.severe( "Error Caused when trying to construct " + clz.getName() ); AELog.error( e ); @@ -89,9 +89,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry @Nullable @Override - public Object resolveItem( String nameSpace, String itemName ) + public Object resolveItem( final String nameSpace, final String itemName ) { - for( ISubItemResolver sir : this.resolvers ) + for( final ISubItemResolver sir : this.resolvers ) { Object rr = null; @@ -99,7 +99,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { rr = sir.resolveItemByName( nameSpace, itemName ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } diff --git a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java index 013cb5f1..9b02ec85 100644 --- a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java +++ b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java @@ -40,11 +40,11 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry } @Override - public IItemComparison getSpecialComparison( ItemStack stack ) + public IItemComparison getSpecialComparison( final ItemStack stack ) { - for( IItemComparisonProvider i : this.CompRegistry ) + for( final IItemComparisonProvider i : this.CompRegistry ) { - IItemComparison comp = i.getComparison( stack ); + final IItemComparison comp = i.getComparison( stack ); if( comp != null ) { return comp; @@ -55,7 +55,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry } @Override - public void addComparisonProvider( IItemComparisonProvider prov ) + public void addComparisonProvider( final IItemComparisonProvider prov ) { this.CompRegistry.add( prov ); } diff --git a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java index 2895c47d..baf16b59 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java +++ b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java @@ -28,7 +28,7 @@ public class WirelessRangeResult public final float dist; public final TileEntity te; - public WirelessRangeResult( TileEntity t, float d ) + public WirelessRangeResult( final TileEntity t, final float d ) { this.dist = d; this.te = t; diff --git a/src/main/java/appeng/core/features/registries/WirelessRegistry.java b/src/main/java/appeng/core/features/registries/WirelessRegistry.java index 328b9fe4..680f56d6 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRegistry.java +++ b/src/main/java/appeng/core/features/registries/WirelessRegistry.java @@ -45,7 +45,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public void registerWirelessHandler( IWirelessTermHandler handler ) + public void registerWirelessHandler( final IWirelessTermHandler handler ) { if( handler != null ) { @@ -54,9 +54,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public boolean isWirelessTerminal( ItemStack is ) + public boolean isWirelessTerminal( final ItemStack is ) { - for( IWirelessTermHandler h : this.handlers ) + for( final IWirelessTermHandler h : this.handlers ) { if( h.canHandle( is ) ) { @@ -67,9 +67,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public IWirelessTermHandler getWirelessTerminalHandler( ItemStack is ) + public IWirelessTermHandler getWirelessTerminalHandler( final ItemStack is ) { - for( IWirelessTermHandler h : this.handlers ) + for( final IWirelessTermHandler h : this.handlers ) { if( h.canHandle( is ) ) { @@ -80,7 +80,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public void openWirelessTerminalGui( ItemStack item, World w, EntityPlayer player ) + public void openWirelessTerminalGui( final ItemStack item, final World w, final EntityPlayer player ) { if( Platform.isClient() ) { diff --git a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java index 7992b989..6c8262d1 100644 --- a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java +++ b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java @@ -38,14 +38,14 @@ public final class WorldGenRegistry implements IWorldGen this.types = new TypeSet[WorldGenType.values().length]; - for( WorldGenType type : WorldGenType.values() ) + for( final WorldGenType type : WorldGenType.values() ) { this.types[type.ordinal()] = new TypeSet(); } } @Override - public void disableWorldGenForProviderID( WorldGenType type, Class provider ) + public void disableWorldGenForProviderID( final WorldGenType type, final Class provider ) { if( type == null ) { @@ -61,7 +61,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public void enableWorldGenForDimension( WorldGenType type, int dimensionID ) + public void enableWorldGenForDimension( final WorldGenType type, final int dimensionID ) { if( type == null ) { @@ -72,7 +72,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public void disableWorldGenForDimension( WorldGenType type, int dimensionID ) + public void disableWorldGenForDimension( final WorldGenType type, final int dimensionID ) { if( type == null ) { @@ -83,7 +83,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public boolean isWorldGenEnabled( WorldGenType type, World w ) + public boolean isWorldGenEnabled( final WorldGenType type, final World w ) { if( type == null ) { @@ -95,9 +95,9 @@ public final class WorldGenRegistry implements IWorldGen throw new IllegalArgumentException( "Bad Provider Passed" ); } - boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() ); - boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId ); - boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId ); + final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() ); + final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId ); + final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId ); if( isBadProvider || isBadDimension ) { diff --git a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java index e88e0ce5..67d96612 100644 --- a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java @@ -38,14 +38,14 @@ public class AppEngGrinderRecipe implements IGrinderEntry private int energy; - public AppEngGrinderRecipe( ItemStack a, ItemStack b, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final int cost ) { this.in = a; this.out = b; this.energy = cost; } - public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, float chance, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final float chance, final int cost ) { this.in = a; this.out = b; @@ -56,7 +56,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry this.energy = cost; } - public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, ItemStack d, float chance, float chance2, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final ItemStack d, final float chance, final float chance2, final int cost ) { this.in = a; this.out = b; @@ -77,7 +77,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setInput( ItemStack i ) + public void setInput( final ItemStack i ) { this.in = i.copy(); } @@ -89,7 +89,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setOutput( ItemStack o ) + public void setOutput( final ItemStack o ) { this.out = o.copy(); } @@ -107,7 +107,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setOptionalOutput( ItemStack output, float chance ) + public void setOptionalOutput( final ItemStack output, final float chance ) { this.optionalOutput = output.copy(); this.optionalChance = chance; @@ -120,7 +120,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setSecondOptionalOutput( ItemStack output, float chance ) + public void setSecondOptionalOutput( final ItemStack output, final float chance ) { this.optionalChance2 = chance; this.optionalOutput2 = output.copy(); @@ -139,7 +139,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setEnergyCost( int c ) + public void setEnergyCost( final int c ) { this.energy = c; } diff --git a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java index 2bca6cf0..9a7b9d1d 100644 --- a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java @@ -43,13 +43,13 @@ public class BasicCellHandler implements ICellHandler { @Override - public boolean isCell( ItemStack is ) + public boolean isCell( final ItemStack is ) { return CellInventory.isCell( is ); } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel ) { if( channel == StorageChannel.ITEMS ) { @@ -77,26 +77,26 @@ public class BasicCellHandler implements ICellHandler } @Override - public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan ) + public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan ) { Platform.openGUI( player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME ); } @Override - public int getStatusForCell( ItemStack is, IMEInventory handler ) + public int getStatusForCell( final ItemStack is, final IMEInventory handler ) { if( handler instanceof CellInventoryHandler ) { - CellInventoryHandler ci = (CellInventoryHandler) handler; + final CellInventoryHandler ci = (CellInventoryHandler) handler; return ci.getStatusForCell(); } return 0; } @Override - public double cellIdleDrain( ItemStack is, IMEInventory handler ) + public double cellIdleDrain( final ItemStack is, final IMEInventory handler ) { - ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv(); + final ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv(); return inv.getIdleDrain(); } } diff --git a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java index 021c4b97..a8cfdb56 100644 --- a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java @@ -41,13 +41,13 @@ public class CreativeCellHandler implements ICellHandler { @Override - public boolean isCell( ItemStack is ) + public boolean isCell( final ItemStack is ) { return is != null && is.getItem() instanceof ItemCreativeStorageCell; } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel ) { if( channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell ) { @@ -75,19 +75,19 @@ public class CreativeCellHandler implements ICellHandler } @Override - public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan ) + public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan ) { Platform.openGUI( player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME ); } @Override - public int getStatusForCell( ItemStack is, IMEInventory handler ) + public int getStatusForCell( final ItemStack is, final IMEInventory handler ) { return 2; } @Override - public double cellIdleDrain( ItemStack is, IMEInventory handler ) + public double cellIdleDrain( final ItemStack is, final IMEInventory handler ) { return 0; } 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 e754ba94..e5e1b103 100644 --- a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java +++ b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java @@ -35,15 +35,15 @@ public class ExternalIInv implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc ) { return channel == StorageChannel.ITEMS && te instanceof IInventory; } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src ) { - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d ); if( channel == StorageChannel.ITEMS && ad != null ) { diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java index 9e02cd7e..f412920a 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java @@ -21,7 +21,7 @@ import appeng.api.features.InscriberProcessType; */ public class InscriberInscribeRecipe extends InscriberRecipe { - public InscriberInscribeRecipe( @Nonnull Collection inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot ) + public InscriberInscribeRecipe( @Nonnull final Collection inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot ) { super( inputs, output, top, bot, InscriberProcessType.Inscribe ); } diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java index 4619bc16..36b7a657 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java @@ -41,7 +41,7 @@ public class InscriberRecipe implements IInscriberRecipe @Nonnull private final InscriberProcessType type; - public InscriberRecipe( @Nonnull Collection inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot, @Nonnull InscriberProcessType type ) + public InscriberRecipe( @Nonnull final Collection inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot, @Nonnull final InscriberProcessType type ) { this.inputs = new ArrayList( inputs.size() ); this.inputs.addAll( inputs ); @@ -89,7 +89,7 @@ public class InscriberRecipe implements IInscriberRecipe } @Override - public boolean equals( Object o ) + public boolean equals( final Object o ) { if( this == o ) { @@ -100,7 +100,7 @@ public class InscriberRecipe implements IInscriberRecipe return false; } - IInscriberRecipe that = (IInscriberRecipe) o; + final IInscriberRecipe that = (IInscriberRecipe) o; if( !this.inputs.equals( that.getInputs() ) ) { diff --git a/src/main/java/appeng/core/localization/ButtonToolTips.java b/src/main/java/appeng/core/localization/ButtonToolTips.java index 86a58836..b740b969 100644 --- a/src/main/java/appeng/core/localization/ButtonToolTips.java +++ b/src/main/java/appeng/core/localization/ButtonToolTips.java @@ -72,7 +72,7 @@ public enum ButtonToolTips this.root = "gui.tooltips.appliedenergistics2"; } - ButtonToolTips( String r ) + ButtonToolTips( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/localization/GuiText.java b/src/main/java/appeng/core/localization/GuiText.java index 6000d8ad..4d251ed7 100644 --- a/src/main/java/appeng/core/localization/GuiText.java +++ b/src/main/java/appeng/core/localization/GuiText.java @@ -90,7 +90,7 @@ public enum GuiText this.root = "gui.appliedenergistics2"; } - GuiText( String r ) + GuiText( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/localization/WailaText.java b/src/main/java/appeng/core/localization/WailaText.java index bfcc5f04..b41cbcb0 100644 --- a/src/main/java/appeng/core/localization/WailaText.java +++ b/src/main/java/appeng/core/localization/WailaText.java @@ -39,7 +39,7 @@ public enum WailaText this.root = "waila.appliedenergistics2"; } - WailaText( String r ) + WailaText( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/settings/TickRates.java b/src/main/java/appeng/core/settings/TickRates.java index cf19a87a..35b2930e 100644 --- a/src/main/java/appeng/core/settings/TickRates.java +++ b/src/main/java/appeng/core/settings/TickRates.java @@ -54,13 +54,13 @@ public enum TickRates public int min; public int max; - TickRates( int min, int max ) + TickRates( final int min, final int max ) { this.min = min; this.max = max; } - public void Load( AEConfig config ) + public void Load( final AEConfig config ) { config.addCustomCategoryComment( "TickRates", " Min / Max Tickrates for dynamic ticking, most of these components also use sleeping, to prevent constant ticking, adjust with care, non standard rates are not supported or tested." ); this.min = config.get( "TickRates", this.name() + ".min", this.min ).getInt( this.min ); diff --git a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java index b98ca6e2..4a5f088b 100644 --- a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java +++ b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java @@ -36,20 +36,20 @@ public class AchievementCraftingHandler { private final PlayerDifferentiator differentiator; - public AchievementCraftingHandler( PlayerDifferentiator differentiator ) + public AchievementCraftingHandler( final PlayerDifferentiator differentiator ) { this.differentiator = differentiator; } @SubscribeEvent - public void onPlayerCraftingEvent( PlayerEvent.ItemCraftedEvent event ) + public void onPlayerCraftingEvent( final PlayerEvent.ItemCraftedEvent event ) { if( this.differentiator.isNoPlayer( event.player ) || event.crafting == null ) { return; } - for( Achievements achievement : Achievements.values() ) + for( final Achievements achievement : Achievements.values() ) { switch( achievement.type ) { diff --git a/src/main/java/appeng/core/stats/AchievementPickupHandler.java b/src/main/java/appeng/core/stats/AchievementPickupHandler.java index 91ba2d29..0b460385 100644 --- a/src/main/java/appeng/core/stats/AchievementPickupHandler.java +++ b/src/main/java/appeng/core/stats/AchievementPickupHandler.java @@ -38,22 +38,22 @@ public class AchievementPickupHandler { private final PlayerDifferentiator differentiator; - public AchievementPickupHandler( PlayerDifferentiator differentiator ) + public AchievementPickupHandler( final PlayerDifferentiator differentiator ) { this.differentiator = differentiator; } @SubscribeEvent - public void onItemPickUp( PlayerEvent.ItemPickupEvent event ) + public void onItemPickUp( final PlayerEvent.ItemPickupEvent event ) { if( this.differentiator.isNoPlayer( event.player ) || event.pickedUp == null || event.pickedUp.getEntityItem() == null ) { return; } - ItemStack is = event.pickedUp.getEntityItem(); + final ItemStack is = event.pickedUp.getEntityItem(); - for( Achievements achievement : Achievements.values() ) + for( final Achievements achievement : Achievements.values() ) { if( achievement.type == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.stack, is ) ) { diff --git a/src/main/java/appeng/core/stats/Achievements.java b/src/main/java/appeng/core/stats/Achievements.java index 047c1ac2..e436d016 100644 --- a/src/main/java/appeng/core/stats/Achievements.java +++ b/src/main/java/appeng/core/stats/Achievements.java @@ -114,7 +114,7 @@ public enum Achievements private Achievement parent; private Achievement stat; - Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type ) + Achievements( final int x, final int y, final AEColoredItemDefinition which, final AchievementType type ) { this.stack = ( which != null ) ? which.stack( AEColor.Transparent, 1 ) : null; this.type = type; @@ -122,7 +122,7 @@ public enum Achievements this.y = y; } - Achievements( int x, int y, IItemDefinition which, AchievementType type ) + Achievements( final int x, final int y, final IItemDefinition which, final AchievementType type ) { this.stack = which.maybeStack( 1 ).orNull(); this.type = type; @@ -130,7 +130,7 @@ public enum Achievements this.y = y; } - Achievements( int x, int y, ItemStack which, AchievementType type ) + Achievements( final int x, final int y, final ItemStack which, final AchievementType type ) { this.stack = which; this.type = type; @@ -138,7 +138,7 @@ public enum Achievements this.y = y; } - public void setParent( Achievements parent ) + public void setParent( final Achievements parent ) { this.parent = parent.getAchievement(); } @@ -154,7 +154,7 @@ public enum Achievements return this.stat; } - public void addToPlayer( EntityPlayer player ) + public void addToPlayer( final EntityPlayer player ) { player.addStat( this.getAchievement(), 1 ); } diff --git a/src/main/java/appeng/core/stats/PlayerDifferentiator.java b/src/main/java/appeng/core/stats/PlayerDifferentiator.java index 04a58323..d4efda36 100644 --- a/src/main/java/appeng/core/stats/PlayerDifferentiator.java +++ b/src/main/java/appeng/core/stats/PlayerDifferentiator.java @@ -42,7 +42,7 @@ public class PlayerDifferentiator * * @return true if {@param player} is not a real player */ - public boolean isNoPlayer( EntityPlayer player ) + public boolean isNoPlayer( final EntityPlayer player ) { return player == null || player.isDead || player instanceof FakePlayer; } diff --git a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java index 9395c092..1cf1f141 100644 --- a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java +++ b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java @@ -57,7 +57,7 @@ public class PlayerStatsRegistration * @param config {@link appeng.core.AEConfig} which is used to determine if the * {@link appeng.core.features.AEFeature#Achievements} is enabled */ - public PlayerStatsRegistration( EventBus bus, AEConfig config ) + public PlayerStatsRegistration( final EventBus bus, final AEConfig config ) { this.bus = bus; this.isAchievementFeatureEnabled = config.isFeatureEnabled( AEFeature.Achievements ); @@ -92,7 +92,7 @@ public class PlayerStatsRegistration final AchievementHierarchy hierarchy = new AchievementHierarchy(); hierarchy.registerAchievementHierarchy(); - for( Stats s : Stats.values() ) + for( final Stats s : Stats.values() ) { s.getStat(); } @@ -100,18 +100,18 @@ public class PlayerStatsRegistration /** * register */ - ArrayList list = new ArrayList(); + final ArrayList list = new ArrayList(); - for( Achievements a : Achievements.values() ) + for( final Achievements a : Achievements.values() ) { - Achievement ach = a.getAchievement(); + final Achievement ach = a.getAchievement(); if( ach != null ) { list.add( ach ); } } - AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) ); + final AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) ); AchievementPage.registerAchievementPage( ae2AchievementPage ); } } diff --git a/src/main/java/appeng/core/stats/Stats.java b/src/main/java/appeng/core/stats/Stats.java index ab076ba6..1a7144e7 100644 --- a/src/main/java/appeng/core/stats/Stats.java +++ b/src/main/java/appeng/core/stats/Stats.java @@ -42,7 +42,7 @@ public enum Stats { } - public void addToPlayer( EntityPlayer player, int howMany ) + public void addToPlayer( final EntityPlayer player, final int howMany ) { player.addStat( this.getStat(), howMany ); } diff --git a/src/main/java/appeng/core/sync/AppEngPacket.java b/src/main/java/appeng/core/sync/AppEngPacket.java index 9c2cd3ef..e5795eef 100644 --- a/src/main/java/appeng/core/sync/AppEngPacket.java +++ b/src/main/java/appeng/core/sync/AppEngPacket.java @@ -38,7 +38,7 @@ public abstract class AppEngPacket AppEngPacketHandlerBase.PacketTypes id; private ByteBuf p; - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." ); } @@ -48,12 +48,12 @@ public abstract class AppEngPacket return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal(); } - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." ); } - protected void configureWrite( ByteBuf data ) + protected void configureWrite( final ByteBuf data ) { data.capacity( data.readableBytes() ); this.p = data; @@ -66,7 +66,7 @@ public abstract class AppEngPacket throw new IllegalArgumentException( "Sorry AE2 made a " + this.p.array().length + " byte packet by accident!" ); } - FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() ); + final FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() ); if( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) ) { diff --git a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java index 23778682..9da16936 100644 --- a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java +++ b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java @@ -109,7 +109,7 @@ public class AppEngPacketHandlerBase private final Class packetClass; private final Constructor packetConstructor; - PacketTypes( Class c ) + PacketTypes( final Class c ) { this.packetClass = c; @@ -118,10 +118,10 @@ public class AppEngPacketHandlerBase { x = this.packetClass.getConstructor( ByteBuf.class ); } - catch( NoSuchMethodException ignored ) + catch( final NoSuchMethodException ignored ) { } - catch( SecurityException ignored ) + catch( final SecurityException ignored ) { } @@ -134,17 +134,17 @@ public class AppEngPacketHandlerBase } } - public static PacketTypes getPacket( int id ) + public static PacketTypes getPacket( final int id ) { return ( values() )[id]; } - public static PacketTypes getID( Class c ) + public static PacketTypes getID( final Class c ) { return REVERSE_LOOKUP.get( c ); } - public AppEngPacket parsePacket( ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException + public AppEngPacket parsePacket( final ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { return this.packetConstructor.newInstance( in ); } diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index ba5533d8..1e163ea8 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -204,7 +204,7 @@ public enum GuiBridge implements IGuiHandler this.containerClass = null; } - GuiBridge( Class containerClass, SecurityPermissions requiredPermission ) + GuiBridge( final Class containerClass, final SecurityPermissions requiredPermission ) { this.requiredPermission = requiredPermission; this.containerClass = containerClass; @@ -221,7 +221,7 @@ public enum GuiBridge implements IGuiHandler if( Platform.isClient() ) { final String start = this.containerClass.getName(); - String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" ); + final String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" ); if( start.equals( guiClass ) ) { @@ -235,7 +235,7 @@ public enum GuiBridge implements IGuiHandler } } - GuiBridge( Class containerClass, Class tileClass, GuiHostType type, SecurityPermissions requiredPermission ) + GuiBridge( final Class containerClass, final Class tileClass, final GuiHostType type, final SecurityPermissions requiredPermission ) { this.requiredPermission = requiredPermission; this.containerClass = containerClass; @@ -245,11 +245,11 @@ public enum GuiBridge implements IGuiHandler } @Override - public Object getServerGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z ) + public Object getServerGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z ) { - ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 ); - GuiBridge ID = values()[ordinal >> 4]; - boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; + final ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 ); + final GuiBridge ID = values()[ordinal >> 4]; + final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; if( ID.type.isItem() ) { ItemStack it = null; @@ -261,7 +261,7 @@ public enum GuiBridge implements IGuiHandler { it = player.inventory.getStackInSlot( x ); } - Object myItem = this.getGuiObject( it, player, w, x, y, z ); + final Object myItem = this.getGuiObject( it, player, w, x, y, z ); if( myItem != null && ID.CorrectTileOrPart( myItem ) ) { return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem ); @@ -269,11 +269,11 @@ public enum GuiBridge implements IGuiHandler } if( ID.type.isTile() ) { - TileEntity TE = w.getTileEntity( x, y, z ); + final TileEntity TE = w.getTileEntity( x, y, z ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( ID.CorrectTileOrPart( part ) ) { return this.updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part ); @@ -290,7 +290,7 @@ public enum GuiBridge implements IGuiHandler return new ContainerNull(); } - private Object getGuiObject( ItemStack it, EntityPlayer player, World w, int x, int y, int z ) + private Object getGuiObject( final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, final int z ) { if( it != null ) { @@ -299,7 +299,7 @@ public enum GuiBridge implements IGuiHandler return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, x, y, z ); } - IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it ); + final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it ); if( wh != null ) { return new WirelessTerminalGuiObject( wh, it, player, w, x, y, z ); @@ -309,7 +309,7 @@ public enum GuiBridge implements IGuiHandler return null; } - public boolean CorrectTileOrPart( Object tE ) + public boolean CorrectTileOrPart( final Object tE ) { if( this.tileClass == null ) { @@ -319,11 +319,11 @@ public enum GuiBridge implements IGuiHandler return this.tileClass.isInstance( tE ); } - private Object updateGui( Object newContainer, World w, int x, int y, int z, ForgeDirection side, Object myItem ) + private Object updateGui( final Object newContainer, final World w, final int x, final int y, final int z, final ForgeDirection side, final Object myItem ) { if( newContainer instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) newContainer; + final AEBaseContainer bc = (AEBaseContainer) newContainer; bc.openContext = new ContainerOpenContext( myItem ); bc.openContext.w = w; bc.openContext.x = x; @@ -335,36 +335,36 @@ public enum GuiBridge implements IGuiHandler return newContainer; } - public Object ConstructContainer( InventoryPlayer inventory, ForgeDirection side, Object tE ) + public Object ConstructContainer( final InventoryPlayer inventory, final ForgeDirection side, final Object tE ) { try { - Constructor[] c = this.containerClass.getConstructors(); + final Constructor[] c = this.containerClass.getConstructors(); if( c.length == 0 ) { throw new AppEngException( "Invalid Gui Class" ); } - Constructor target = this.findConstructor( c, inventory, tE ); + final Constructor target = this.findConstructor( c, inventory, tE ); if( target == null ) { throw new IllegalStateException( "Cannot find " + this.containerClass.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" ); } - Object o = target.newInstance( inventory, tE ); + final Object o = target.newInstance( inventory, tE ); /** * triggers achievement when the player sees presses. */ if( o instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) o; - for( Object so : bc.inventorySlots ) + final AEBaseContainer bc = (AEBaseContainer) o; + for( final Object so : bc.inventorySlots ) { if( so instanceof Slot ) { - ItemStack is = ( (Slot) so ).getStack(); + final ItemStack is = ( (Slot) so ).getStack(); final IMaterials materials = AEApi.instance().definitions().materials(); this.addPressAchievementToPlayer( is, materials, inventory.player ); @@ -374,17 +374,17 @@ public enum GuiBridge implements IGuiHandler return o; } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } } - private Constructor findConstructor( Constructor[] c, InventoryPlayer inventory, Object tE ) + private Constructor findConstructor( final Constructor[] c, final InventoryPlayer inventory, final Object tE ) { - for( Constructor con : c ) + for( final Constructor con : c ) { - Class[] types = con.getParameterTypes(); + final Class[] types = con.getParameterTypes(); if( types.length == 2 ) { if( types[0].isAssignableFrom( inventory.getClass() ) && types[1].isAssignableFrom( tE.getClass() ) ) @@ -396,7 +396,7 @@ public enum GuiBridge implements IGuiHandler return null; } - private String typeName( Object inventory ) + private String typeName( final Object inventory ) { if( inventory == null ) { @@ -406,7 +406,7 @@ public enum GuiBridge implements IGuiHandler return inventory.getClass().getName(); } - private void addPressAchievementToPlayer( ItemStack newItem, IMaterials possibleMaterials, EntityPlayer player ) + private void addPressAchievementToPlayer( final ItemStack newItem, final IMaterials possibleMaterials, final EntityPlayer player ) { final IComparableDefinition logic = possibleMaterials.logicProcessorPress(); final IComparableDefinition eng = possibleMaterials.engProcessorPress(); @@ -415,7 +415,7 @@ public enum GuiBridge implements IGuiHandler final List presses = Lists.newArrayList( logic, eng, calc, silicon ); - for( IComparableDefinition press : presses ) + for( final IComparableDefinition press : presses ) { if( press.isSameAs( newItem ) ) { @@ -427,11 +427,11 @@ public enum GuiBridge implements IGuiHandler } @Override - public Object getClientGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z ) + public Object getClientGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z ) { - ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 ); - GuiBridge ID = values()[ordinal >> 4]; - boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; + final ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 ); + final GuiBridge ID = values()[ordinal >> 4]; + final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; if( ID.type.isItem() ) { ItemStack it = null; @@ -443,7 +443,7 @@ public enum GuiBridge implements IGuiHandler { it = player.inventory.getStackInSlot( x ); } - Object myItem = this.getGuiObject( it, player, w, x, y, z ); + final Object myItem = this.getGuiObject( it, player, w, x, y, z ); if( myItem != null && ID.CorrectTileOrPart( myItem ) ) { return ID.ConstructGui( player.inventory, side, myItem ); @@ -451,11 +451,11 @@ public enum GuiBridge implements IGuiHandler } if( ID.type.isTile() ) { - TileEntity TE = w.getTileEntity( x, y, z ); + final TileEntity TE = w.getTileEntity( x, y, z ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( ID.CorrectTileOrPart( part ) ) { return ID.ConstructGui( player.inventory, side, part ); @@ -472,17 +472,17 @@ public enum GuiBridge implements IGuiHandler return new GuiNull( new ContainerNull() ); } - public Object ConstructGui( InventoryPlayer inventory, ForgeDirection side, Object tE ) + public Object ConstructGui( final InventoryPlayer inventory, final ForgeDirection side, final Object tE ) { try { - Constructor[] c = this.guiClass.getConstructors(); + final Constructor[] c = this.guiClass.getConstructors(); if( c.length == 0 ) { throw new AppEngException( "Invalid Gui Class" ); } - Constructor target = this.findConstructor( c, inventory, tE ); + final Constructor target = this.findConstructor( c, inventory, tE ); if( target == null ) { @@ -491,24 +491,24 @@ public enum GuiBridge implements IGuiHandler return target.newInstance( inventory, tE ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } } - public boolean hasPermissions( TileEntity te, int x, int y, int z, ForgeDirection side, EntityPlayer player ) + public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final ForgeDirection side, final EntityPlayer player ) { - World w = player.getEntityWorld(); + final World w = player.getEntityWorld(); if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, x, y, z ), player ) ) { if( this.type.isItem() ) { - ItemStack it = player.inventory.getCurrentItem(); + final ItemStack it = player.inventory.getCurrentItem(); if( it != null && it.getItem() instanceof IGuiItem ) { - Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, x, y, z ); + final Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, x, y, z ); if( this.CorrectTileOrPart( myItem ) ) { return true; @@ -518,11 +518,11 @@ public enum GuiBridge implements IGuiHandler if( this.type.isTile() ) { - TileEntity TE = w.getTileEntity( x, y, z ); + final TileEntity TE = w.getTileEntity( x, y, z ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( this.CorrectTileOrPart( part ) ) { return this.securityCheck( part, player ); @@ -540,28 +540,27 @@ public enum GuiBridge implements IGuiHandler return false; } - private boolean securityCheck( Object te, EntityPlayer player ) + private boolean securityCheck( final Object te, final EntityPlayer player ) { if( te instanceof IActionHost && this.requiredPermission != null ) { - - IGridNode gn = ( (IActionHost) te ).getActionableNode(); + final IGridNode gn = ( (IActionHost) te ).getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { - boolean requirePower = false; + final boolean requirePower = false; if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( player, this.requiredPermission ) ) { return true; diff --git a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java index 9f554dda..e95caaba 100644 --- a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java @@ -37,31 +37,31 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement { @Override - public void onPacketData( INetworkInfo network, FMLProxyPacket packet, EntityPlayer player ) + public void onPacketData( final INetworkInfo network, final FMLProxyPacket packet, EntityPlayer player ) { - ByteBuf stream = packet.payload(); + final ByteBuf stream = packet.payload(); player = Minecraft.getMinecraft().thePlayer; try { - int packetType = stream.readInt(); - AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); + final int packetType = stream.readInt(); + final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); pack.clientPacketData( network, pack, player ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java index 5f166844..022662df 100644 --- a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java @@ -36,29 +36,29 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp { @Override - public void onPacketData( INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player ) + public void onPacketData( final INetworkInfo manager, final FMLProxyPacket packet, final EntityPlayer player ) { - ByteBuf stream = packet.payload(); + final ByteBuf stream = packet.payload(); try { - int packetType = stream.readInt(); - AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); + final int packetType = stream.readInt(); + final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); pack.serverPacketData( manager, pack, player ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/sync/network/NetworkHandler.java b/src/main/java/appeng/core/sync/network/NetworkHandler.java index 16069d57..279a2abb 100644 --- a/src/main/java/appeng/core/sync/network/NetworkHandler.java +++ b/src/main/java/appeng/core/sync/network/NetworkHandler.java @@ -46,7 +46,7 @@ public class NetworkHandler final IPacketHandler clientHandler; final IPacketHandler serveHandler; - public NetworkHandler( String channelName ) + public NetworkHandler( final String channelName ) { FMLCommonHandler.instance().bus().register( this ); this.ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( this.myChannelName = channelName ); @@ -62,7 +62,7 @@ public class NetworkHandler { return new AppEngClientPacketHandler(); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } @@ -74,20 +74,20 @@ public class NetworkHandler { return new AppEngServerPacketHandler(); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } } @SubscribeEvent - public void newConnection( ServerConnectionFromClientEvent ev ) + public void newConnection( final ServerConnectionFromClientEvent ev ) { WorldData.instance().dimensionData().sendToPlayer( ev.manager ); } @SubscribeEvent - public void newConnection( PlayerLoggedInEvent loginEvent ) + public void newConnection( final PlayerLoggedInEvent loginEvent ) { if( loginEvent.player instanceof EntityPlayerMP ) { @@ -96,9 +96,9 @@ public class NetworkHandler } @SubscribeEvent - public void serverPacket( ServerCustomPacketEvent ev ) + public void serverPacket( final ServerCustomPacketEvent ev ) { - NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler(); + final NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler(); if( this.serveHandler != null ) { this.serveHandler.onPacketData( null, ev.packet, srv.playerEntity ); @@ -106,7 +106,7 @@ public class NetworkHandler } @SubscribeEvent - public void clientPacket( ClientCustomPacketEvent ev ) + public void clientPacket( final ClientCustomPacketEvent ev ) { if( this.clientHandler != null ) { @@ -119,27 +119,27 @@ public class NetworkHandler return this.myChannelName; } - public void sendToAll( AppEngPacket message ) + public void sendToAll( final AppEngPacket message ) { this.ec.sendToAll( message.getProxy() ); } - public void sendTo( AppEngPacket message, EntityPlayerMP player ) + public void sendTo( final AppEngPacket message, final EntityPlayerMP player ) { this.ec.sendTo( message.getProxy(), player ); } - public void sendToAllAround( AppEngPacket message, NetworkRegistry.TargetPoint point ) + public void sendToAllAround( final AppEngPacket message, final NetworkRegistry.TargetPoint point ) { this.ec.sendToAllAround( message.getProxy(), point ); } - public void sendToDimension( AppEngPacket message, int dimensionId ) + public void sendToDimension( final AppEngPacket message, final int dimensionId ) { this.ec.sendToDimension( message.getProxy(), dimensionId ); } - public void sendToServer( AppEngPacket message ) + public void sendToServer( final AppEngPacket message ) { this.ec.sendToServer( message.getProxy() ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java index 9129dabf..716782ba 100644 --- a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java +++ b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java @@ -47,7 +47,7 @@ public class PacketAssemblerAnimation extends AppEngPacket public final IAEItemStack is; // automatic. - public PacketAssemblerAnimation( ByteBuf stream ) throws IOException + public PacketAssemblerAnimation( final ByteBuf stream ) throws IOException { this.x = stream.readInt(); this.y = stream.readInt(); @@ -57,10 +57,10 @@ public class PacketAssemblerAnimation extends AppEngPacket } // api - public PacketAssemblerAnimation( int x, int y, int z, byte rate, IAEItemStack is ) throws IOException + public PacketAssemblerAnimation( final int x, final int y, final int z, final byte rate, final IAEItemStack is ) throws IOException { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.x = x ); @@ -75,11 +75,11 @@ public class PacketAssemblerAnimation extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); - double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); - double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketClick.java b/src/main/java/appeng/core/sync/packets/PacketClick.java index 457454f3..5848ad06 100644 --- a/src/main/java/appeng/core/sync/packets/PacketClick.java +++ b/src/main/java/appeng/core/sync/packets/PacketClick.java @@ -48,7 +48,7 @@ public class PacketClick extends AppEngPacket final float hitZ; // automatic. - public PacketClick( ByteBuf stream ) + public PacketClick( final ByteBuf stream ) { this.x = stream.readInt(); this.y = stream.readInt(); @@ -60,10 +60,10 @@ public class PacketClick extends AppEngPacket } // api - public PacketClick( int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public PacketClick( final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.x = x ); @@ -78,9 +78,9 @@ public class PacketClick extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); final IItems items = AEApi.instance().definitions().items(); final IComparableDefinition maybeMemoryCard = items.memoryCard(); final IComparableDefinition maybeColorApplicator = items.colorApplicator(); @@ -89,20 +89,20 @@ public class PacketClick extends AppEngPacket { if( is.getItem() instanceof ToolNetworkTool ) { - ToolNetworkTool tnt = (ToolNetworkTool) is.getItem(); + final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem(); tnt.serverSideToolLogic( is, player, player.worldObj, this.x, this.y, this.z, this.side, this.hitX, this.hitY, this.hitZ ); } else if( maybeMemoryCard.isSameAs( is ) ) { - IMemoryCard mem = (IMemoryCard) is.getItem(); + final IMemoryCard mem = (IMemoryCard) is.getItem(); mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED ); is.setTagCompound( null ); } else if( maybeColorApplicator.isSameAs( is ) ) { - ToolColorApplicator mem = (ToolColorApplicator) is.getItem(); + final ToolColorApplicator mem = (ToolColorApplicator) is.getItem(); mem.cycleColors( is, mem.getColor( is ), 1 ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java index 6208ca26..f1ea1825 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java @@ -44,7 +44,7 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba EntityPlayer talkBackTo; // automatic. - public PacketCompassRequest( ByteBuf stream ) + public PacketCompassRequest( final ByteBuf stream ) { this.attunement = stream.readLong(); this.cx = stream.readInt(); @@ -53,10 +53,10 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba } // api - public PacketCompassRequest( long attunement, int cx, int cz, int cdy ) + public PacketCompassRequest( final long attunement, final int cx, final int cz, final int cdy ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = attunement ); @@ -68,17 +68,17 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba } @Override - public void calculatedDirection( boolean hasResult, boolean spin, double radians, double dist ) + public void calculatedDirection( final boolean hasResult, final boolean spin, final double radians, final double dist ) { NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo ); } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { this.talkBackTo = player; - DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 ); + final DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 ); WorldData.instance().compassData().service().getCompassDirection( loc, 174, this ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java index 0307bf72..9087bd92 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java @@ -41,7 +41,7 @@ public class PacketCompassResponse extends AppEngPacket public CompassResult cr; // automatic. - public PacketCompassResponse( ByteBuf stream ) + public PacketCompassResponse( final ByteBuf stream ) { this.attunement = stream.readLong(); this.cx = stream.readInt(); @@ -52,10 +52,10 @@ public class PacketCompassResponse extends AppEngPacket } // api - public PacketCompassResponse( PacketCompassRequest req, boolean hasResult, boolean spin, double radians ) + public PacketCompassResponse( final PacketCompassRequest req, final boolean hasResult, final boolean spin, final double radians ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = req.attunement ); @@ -71,7 +71,7 @@ public class PacketCompassResponse extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { CompassManager.INSTANCE.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index 68bb97b3..85d16657 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -61,7 +61,7 @@ public class PacketCompressedNBT extends AppEngPacket this.data = null; this.compressFrame = null; - GZIPInputStream gzReader = new GZIPInputStream( new InputStream() + final GZIPInputStream gzReader = new GZIPInputStream( new InputStream() { @Override @@ -76,13 +76,13 @@ public class PacketCompressedNBT extends AppEngPacket } } ); - DataInputStream inStream = new DataInputStream( gzReader ); + final DataInputStream inStream = new DataInputStream( gzReader ); this.in = CompressedStreamTools.read( inStream ); inStream.close(); } // api - public PacketCompressedNBT( NBTTagCompound din ) throws IOException + public PacketCompressedNBT( final NBTTagCompound din ) throws IOException { this.data = Unpooled.buffer( 2048 ); @@ -94,7 +94,7 @@ public class PacketCompressedNBT extends AppEngPacket { @Override - public void write( int value ) throws IOException + public void write( final int value ) throws IOException { PacketCompressedNBT.this.data.writeByte( value ); } @@ -108,9 +108,9 @@ public class PacketCompressedNBT extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiInterfaceTerminal ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java index 77c4cf9d..42110753 100644 --- a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java +++ b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java @@ -42,19 +42,19 @@ public final class PacketConfigButton extends AppEngPacket // automatic. @Reflected - public PacketConfigButton( ByteBuf stream ) + public PacketConfigButton( final ByteBuf stream ) { this.option = Settings.values()[stream.readInt()]; this.rotationDirection = stream.readBoolean(); } // api - public PacketConfigButton( Settings option, boolean rotationDirection ) + public PacketConfigButton( final Settings option, final boolean rotationDirection ) { this.option = option; this.rotationDirection = rotationDirection; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( option.ordinal() ); @@ -64,16 +64,16 @@ public final class PacketConfigButton extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if( sender.openContainer instanceof AEBaseContainer ) { final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; if( baseContainer.getTarget() instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager(); - Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() ); + final IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager(); + final Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() ); cm.putSetting( this.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 7151edf8..ef5a021a 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java @@ -50,18 +50,18 @@ public class PacketCraftRequest extends AppEngPacket public final boolean heldShift; // automatic. - public PacketCraftRequest( ByteBuf stream ) + public PacketCraftRequest( final ByteBuf stream ) { this.heldShift = stream.readBoolean(); this.amount = stream.readLong(); } - public PacketCraftRequest( int craftAmt, boolean shift ) + public PacketCraftRequest( final int craftAmt, final boolean shift ) { this.amount = craftAmt; this.heldShift = shift; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeBoolean( shift ); @@ -71,22 +71,22 @@ public class PacketCraftRequest extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player.openContainer instanceof ContainerCraftAmount ) { - ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer; - Object target = cca.getTarget(); + final ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer; + final Object target = cca.getTarget(); if( target instanceof IGridHost ) { - IGridHost gh = (IGridHost) target; - IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN ); + final IGridHost gh = (IGridHost) target; + final IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN ); if( gn == null ) { return; } - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g == null || cca.whatToMake == null ) { return; @@ -97,25 +97,25 @@ public class PacketCraftRequest extends AppEngPacket Future futureJob = null; try { - ICraftingGrid cg = g.getCache( ICraftingGrid.class ); + final ICraftingGrid cg = g.getCache( ICraftingGrid.class ); futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.whatToMake, null ); - ContainerOpenContext context = cca.openContext; + final ContainerOpenContext context = cca.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( player, te, cca.openContext.side, GuiBridge.GUI_CRAFTING_CONFIRM ); if( player.openContainer instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer; + final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer; ccc.autoStart = this.heldShift; ccc.job = futureJob; cca.detectAndSendChanges(); } } } - catch( Throwable e ) + catch( final Throwable e ) { if( futureJob != null ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index 7c2d8c70..2b50625b 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -50,12 +50,12 @@ public class PacketInventoryAction extends AppEngPacket public final IAEItemStack slotItem; // automatic. - public PacketInventoryAction( ByteBuf stream ) throws IOException + public PacketInventoryAction( final ByteBuf stream ) throws IOException { this.action = InventoryAction.values()[stream.readInt()]; this.slot = stream.readInt(); this.id = stream.readLong(); - boolean hasItem = stream.readBoolean(); + final boolean hasItem = stream.readBoolean(); if( hasItem ) { this.slotItem = AEItemStack.loadItemStackFromPacket( stream ); @@ -67,7 +67,7 @@ public class PacketInventoryAction extends AppEngPacket } // api - public PacketInventoryAction( InventoryAction action, int slot, IAEItemStack slotItem ) throws IOException + public PacketInventoryAction( final InventoryAction action, final int slot, final IAEItemStack slotItem ) throws IOException { if( Platform.isClient() ) @@ -80,7 +80,7 @@ public class PacketInventoryAction extends AppEngPacket this.id = 0; this.slotItem = slotItem; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); @@ -101,14 +101,14 @@ public class PacketInventoryAction extends AppEngPacket } // api - public PacketInventoryAction( InventoryAction action, int slot, long id ) + public PacketInventoryAction( final InventoryAction action, final int slot, final long id ) { this.action = action; this.slot = slot; this.id = id; this.slotItem = null; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); @@ -120,23 +120,23 @@ public class PacketInventoryAction extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if( sender.openContainer instanceof AEBaseContainer ) { - AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; + final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; if( this.action == InventoryAction.AUTO_CRAFT ) { - ContainerOpenContext context = baseContainer.openContext; + final ContainerOpenContext context = baseContainer.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT ); if( sender.openContainer instanceof ContainerCraftAmount ) { - ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; + final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; if( baseContainer.getTargetStack() != null ) { @@ -156,7 +156,7 @@ public class PacketInventoryAction extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { if( this.action == InventoryAction.UPDATE_HAND ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketLightning.java b/src/main/java/appeng/core/sync/packets/PacketLightning.java index 24dee29d..1c1c3fc0 100644 --- a/src/main/java/appeng/core/sync/packets/PacketLightning.java +++ b/src/main/java/appeng/core/sync/packets/PacketLightning.java @@ -44,7 +44,7 @@ public class PacketLightning extends AppEngPacket final double z; // automatic. - public PacketLightning( ByteBuf stream ) + public PacketLightning( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -52,13 +52,13 @@ public class PacketLightning extends AppEngPacket } // api - public PacketLightning( double x, double y, double z ) + public PacketLightning( final double x, final double y, final double z ) { this.x = x; this.y = y; this.z = z; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -70,17 +70,17 @@ public class PacketLightning extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { if( Platform.isClient() && AEConfig.instance.enableEffects ) { - LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - catch( Exception ignored ) + catch( final Exception ignored ) { } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java index 075d6b09..03abfbd5 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java @@ -83,7 +83,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket // int originalBytes = stream.readableBytes(); - GZIPInputStream gzReader = new GZIPInputStream( new InputStream() + final GZIPInputStream gzReader = new GZIPInputStream( new InputStream() { @Override public int read() throws IOException @@ -97,11 +97,11 @@ public class PacketMEInventoryUpdate extends AppEngPacket } } ); - ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() ); - byte[] tmp = new byte[TEMP_BUFFER_SIZE]; + final ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() ); + final byte[] tmp = new byte[TEMP_BUFFER_SIZE]; while( gzReader.available() != 0 ) { - int bytes = gzReader.read( tmp ); + final int bytes = gzReader.read( tmp ); if( bytes > 0 ) { uncompressed.writeBytes( tmp, 0, bytes ); @@ -127,7 +127,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket } // api - public PacketMEInventoryUpdate( byte ref ) throws IOException + public PacketMEInventoryUpdate( final byte ref ) throws IOException { this.ref = ref; this.data = Unpooled.buffer( OPERATION_BYTE_LIMIT ); @@ -137,7 +137,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket this.compressFrame = new GZIPOutputStream( new OutputStream() { @Override - public void write( int value ) throws IOException + public void write( final int value ) throws IOException { PacketMEInventoryUpdate.this.data.writeByte( value ); } @@ -148,9 +148,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftConfirm ) { @@ -184,7 +184,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket this.configureWrite( this.data ); return super.getProxy(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -192,9 +192,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket return null; } - public void appendItem( IAEItemStack is ) throws IOException, BufferOverflowException + public void appendItem( final IAEItemStack is ) throws IOException, BufferOverflowException { - ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT ); + final ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT ); is.writeToPacket( tmp ); this.compressFrame.flush(); diff --git a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java index 964e0e7a..a1929344 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java +++ b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java @@ -48,7 +48,7 @@ public class PacketMatterCannon extends AppEngPacket final byte len; // automatic. - public PacketMatterCannon( ByteBuf stream ) + public PacketMatterCannon( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -60,10 +60,10 @@ public class PacketMatterCannon extends AppEngPacket } // api - public PacketMatterCannon( double x, double y, double z, float dx, float dy, float dz, byte len ) + public PacketMatterCannon( final double x, final double y, final double z, final float dx, final float dy, final float dz, final byte len ) { - float dl = dx * dx + dy * dy + dz * dz; - float dlz = (float) Math.sqrt( dl ); + final float dl = dx * dx + dy * dy + dz * dz; + final float dlz = (float) Math.sqrt( dl ); this.x = x; this.y = y; @@ -73,7 +73,7 @@ public class PacketMatterCannon extends AppEngPacket this.dz = dz / dlz; this.len = len; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -89,20 +89,20 @@ public class PacketMatterCannon extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { - World world = FMLClientHandler.instance().getClient().theWorld; + final World world = FMLClientHandler.instance().getClient().theWorld; for( int a = 1; a < this.len; a++ ) { - MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond ); + final MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - catch( Exception ignored ) + catch( final Exception ignored ) { } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java index 91e1b421..6536fa69 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java +++ b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java @@ -41,7 +41,7 @@ public class PacketMockExplosion extends AppEngPacket public final double z; // automatic. - public PacketMockExplosion( ByteBuf stream ) + public PacketMockExplosion( final ByteBuf stream ) { this.x = stream.readDouble(); this.y = stream.readDouble(); @@ -49,13 +49,13 @@ public class PacketMockExplosion extends AppEngPacket } // api - public PacketMockExplosion( double x, double y, double z ) + public PacketMockExplosion( final double x, final double y, final double z ) { this.x = x; this.y = y; this.z = z; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeDouble( x ); @@ -67,9 +67,9 @@ public class PacketMockExplosion extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - World world = CommonHelper.proxy.getWorld(); + final World world = CommonHelper.proxy.getWorld(); world.spawnParticle( "largeexplode", this.x, this.y, this.z, 1.0D, 0.0D, 0.0D ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java index d3e8cf1f..ff74b42a 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java +++ b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java @@ -37,14 +37,14 @@ public class PacketMultiPart extends AppEngPacket { // automatic. - public PacketMultiPart( ByteBuf stream ) + public PacketMultiPart( final ByteBuf stream ) { } // api public PacketMultiPart() { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); @@ -52,12 +52,12 @@ public class PacketMultiPart extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ); + final IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ); if( fmp != null ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; MinecraftForge.EVENT_BUS.post( fmp.newFMPPacketEvent( sender ) ); // when received it just posts this event. } } diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java index 2b0dafda..74ae4184 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java @@ -68,17 +68,17 @@ public class PacketNEIRecipe extends AppEngPacket ItemStack[][] recipe; // automatic. - public PacketNEIRecipe( ByteBuf stream ) throws IOException + public PacketNEIRecipe( final ByteBuf stream ) throws IOException { - ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() ); + final ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() ); bytes.skip( stream.readerIndex() ); - NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes ); + final NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes ); if( comp != null ) { this.recipe = new ItemStack[9][]; for( int x = 0; x < this.recipe.length; x++ ) { - NBTTagList list = comp.getTagList( "#" + x, 10 ); + final NBTTagList list = comp.getTagList( "#" + x, 10 ); if( list.tagCount() > 0 ) { this.recipe[x] = new ItemStack[list.tagCount()]; @@ -92,12 +92,12 @@ public class PacketNEIRecipe extends AppEngPacket } // api - public PacketNEIRecipe( NBTTagCompound recipe ) throws IOException + public PacketNEIRecipe( final NBTTagCompound recipe ) throws IOException { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream outputStream = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream outputStream = new DataOutputStream( bytes ); data.writeInt( this.getPacketID() ); @@ -108,34 +108,34 @@ public class PacketNEIRecipe extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP pmp = (EntityPlayerMP) player; - Container con = pmp.openContainer; + final EntityPlayerMP pmp = (EntityPlayerMP) player; + final Container con = pmp.openContainer; if( con instanceof IContainerCraftingPacket ) { - IContainerCraftingPacket cct = (IContainerCraftingPacket) con; - IGridNode node = cct.getNetworkNode(); + final IContainerCraftingPacket cct = (IContainerCraftingPacket) con; + final IGridNode node = cct.getNetworkNode(); if( node != null ) { - IGrid grid = node.getGrid(); + final IGrid grid = node.getGrid(); if( grid == null ) { return; } - IStorageGrid inv = grid.getCache( IStorageGrid.class ); - IEnergyGrid energy = grid.getCache( IEnergyGrid.class ); - ISecurityGrid security = grid.getCache( ISecurityGrid.class ); - IInventory craftMatrix = cct.getInventoryByName( "crafting" ); - IInventory playerInventory = cct.getInventoryByName( "player" ); + final IStorageGrid inv = grid.getCache( IStorageGrid.class ); + final IEnergyGrid energy = grid.getCache( IEnergyGrid.class ); + final ISecurityGrid security = grid.getCache( ISecurityGrid.class ); + final IInventory craftMatrix = cct.getInventoryByName( "crafting" ); + final IInventory playerInventory = cct.getInventoryByName( "player" ); - Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE; + final Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE; if( inv != null && this.recipe != null && security != null ) { - InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { if( this.recipe[x] != null && this.recipe[x].length > 0 ) @@ -144,35 +144,35 @@ public class PacketNEIRecipe extends AppEngPacket } } - IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj ); if( r != null && security.hasPermission( player, SecurityPermissions.EXTRACT ) ) { - ItemStack is = r.getCraftingResult( testInv ); + final ItemStack is = r.getCraftingResult( testInv ); if( is != null ) { - IMEMonitor storage = inv.getItemInventory(); - IItemList all = storage.getStorageList(); - IPartitionList filter = ItemViewCell.createFilter( cct.getViewCells() ); + final IMEMonitor storage = inv.getItemInventory(); + final IItemList all = storage.getStorageList(); + final IPartitionList filter = ItemViewCell.createFilter( cct.getViewCells() ); for( int x = 0; x < craftMatrix.getSizeInventory(); x++ ) { - ItemStack patternItem = testInv.getStackInSlot( x ); + final ItemStack patternItem = testInv.getStackInSlot( x ); ItemStack currentItem = craftMatrix.getStackInSlot( x ); if( currentItem != null ) { testInv.setInventorySlotContents( x, currentItem ); - ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null; + final ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null; testInv.setInventorySlotContents( x, patternItem ); if( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) ) { - IAEItemStack in = AEItemStack.create( currentItem ); + final IAEItemStack in = AEItemStack.create( currentItem ); if( in != null ) { - IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() ); + final IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() ); if( out != null ) { craftMatrix.setInventorySlotContents( x, out.getItemStack() ); @@ -199,13 +199,13 @@ public class PacketNEIRecipe extends AppEngPacket { for( int y = 0; y < this.recipe[x].length; y++ ) { - IAEItemStack request = AEItemStack.create( this.recipe[x][y] ); + final IAEItemStack request = AEItemStack.create( this.recipe[x][y] ); if( request != null ) { if( filter == null || filter.isListed( request ) ) { request.setStackSize( 1 ); - IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() ); + final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() ); if( out != null ) { whichItem = out.getItemStack(); @@ -241,7 +241,7 @@ public class PacketNEIRecipe extends AppEngPacket * @param patternItem which {@link ItemStack} to extract * @return null or a found {@link ItemStack} */ - private ItemStack extractItemFromPlayerInventory( EntityPlayer player, Actionable mode, ItemStack patternItem ) + private ItemStack extractItemFromPlayerInventory( final EntityPlayer player, final Actionable mode, final ItemStack patternItem ) { final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); final AEItemStack request = AEItemStack.create( patternItem ); diff --git a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java index 1b4d225a..62e396d8 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java +++ b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java @@ -39,17 +39,17 @@ public class PacketNewStorageDimension extends AppEngPacket final int newDim; // automatic. - public PacketNewStorageDimension( ByteBuf stream ) + public PacketNewStorageDimension( final ByteBuf stream ) { this.newDim = stream.readInt(); } // api - public PacketNewStorageDimension( int newDim ) + public PacketNewStorageDimension( final int newDim ) { this.newDim = newDim; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( newDim ); @@ -59,13 +59,13 @@ public class PacketNewStorageDimension extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { DimensionManager.registerDimension( this.newDim, AEConfig.instance.storageProviderID ); } - catch( IllegalArgumentException iae ) + catch( final IllegalArgumentException iae ) { // ok! } diff --git a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java index 28a33af7..15a32cf1 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java +++ b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java @@ -39,7 +39,7 @@ public class PacketPaintedEntity extends AppEngPacket private int ticks; // automatic. - public PacketPaintedEntity( ByteBuf stream ) + public PacketPaintedEntity( final ByteBuf stream ) { this.entityId = stream.readInt(); this.myColor = AEColor.values()[stream.readByte()]; @@ -47,10 +47,10 @@ public class PacketPaintedEntity extends AppEngPacket } // api - public PacketPaintedEntity( int myEntity, AEColor myColor, int ticksLeft ) + public PacketPaintedEntity( final int myEntity, final AEColor myColor, final int ticksLeft ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.entityId = myEntity ); @@ -61,9 +61,9 @@ public class PacketPaintedEntity extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks ); + final PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks ); TickHandler.INSTANCE.getPlayerColors().put( this.entityId, pc ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java index 4b7d064a..b407c869 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java @@ -41,7 +41,7 @@ public class PacketPartPlacement extends AppEngPacket float eyeHeight; // automatic. - public PacketPartPlacement( ByteBuf stream ) + public PacketPartPlacement( final ByteBuf stream ) { this.x = stream.readInt(); this.y = stream.readInt(); @@ -51,9 +51,9 @@ public class PacketPartPlacement extends AppEngPacket } // api - public PacketPartPlacement( int x, int y, int z, int face, float eyeHeight ) + public PacketPartPlacement( final int x, final int y, final int z, final int face, final float eyeHeight ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( x ); @@ -66,9 +66,9 @@ public class PacketPartPlacement extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; CommonHelper.proxy.updateRenderMode( sender ); PartPlacement.eyeHeight = this.eyeHeight; PartPlacement.place( sender.getHeldItem(), this.x, this.y, this.z, this.face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 ); diff --git a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java index a09e5f5e..d5d6a42c 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java @@ -36,17 +36,17 @@ public class PacketPartialItem extends AppEngPacket final byte[] data; // automatic. - public PacketPartialItem( ByteBuf stream ) + public PacketPartialItem( final ByteBuf stream ) { this.pageNum = stream.readShort(); stream.readBytes( this.data = new byte[stream.readableBytes()] ); } // api - public PacketPartialItem( int page, int maxPages, byte[] buf ) + public PacketPartialItem( final int page, final int maxPages, final byte[] buf ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); this.pageNum = (short) ( page | ( maxPages << 8 ) ); this.data = buf; @@ -58,7 +58,7 @@ public class PacketPartialItem extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player.openContainer instanceof AEBaseContainer ) { @@ -76,7 +76,7 @@ public class PacketPartialItem extends AppEngPacket return this.data.length; } - public int write( byte[] buffer, int cursor ) + public int write( final byte[] buffer, final int cursor ) { System.arraycopy( this.data, 0, buffer, cursor, this.data.length ); return cursor + this.data.length; diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index 5f27d3cd..40450c8b 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -46,7 +46,7 @@ public class PacketPatternSlot extends AppEngPacket public final boolean shift; // automatic. - public PacketPatternSlot( ByteBuf stream ) throws IOException + public PacketPatternSlot( final ByteBuf stream ) throws IOException { this.shift = stream.readBoolean(); @@ -59,9 +59,9 @@ public class PacketPatternSlot extends AppEngPacket } } - public IAEItemStack readItem( ByteBuf stream ) throws IOException + public IAEItemStack readItem( final ByteBuf stream ) throws IOException { - boolean hasItem = stream.readBoolean(); + final boolean hasItem = stream.readBoolean(); if( hasItem ) { @@ -72,13 +72,13 @@ public class PacketPatternSlot extends AppEngPacket } // api - public PacketPatternSlot( IInventory pat, IAEItemStack slotItem, boolean shift ) throws IOException + public PacketPatternSlot( final IInventory pat, final IAEItemStack slotItem, final boolean shift ) throws IOException { this.slotItem = slotItem; this.shift = shift; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); @@ -94,7 +94,7 @@ public class PacketPatternSlot extends AppEngPacket this.configureWrite( data ); } - private void writeItem( IAEItemStack slotItem, ByteBuf data ) throws IOException + private void writeItem( final IAEItemStack slotItem, final ByteBuf data ) throws IOException { if( slotItem == null ) { @@ -108,12 +108,12 @@ public class PacketPatternSlot extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if( sender.openContainer instanceof ContainerPatternTerm ) { - ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; + final ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; patternTerminal.craftOrGetItem( this ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java index 28ebbfbb..c12af158 100644 --- a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java +++ b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java @@ -37,19 +37,19 @@ public class PacketProgressBar extends AppEngPacket final long value; // automatic. - public PacketProgressBar( ByteBuf stream ) + public PacketProgressBar( final ByteBuf stream ) { this.id = stream.readShort(); this.value = stream.readLong(); } // api - public PacketProgressBar( int shortID, long value ) + public PacketProgressBar( final int shortID, final long value ) { this.id = (short) shortID; this.value = value; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeShort( shortID ); @@ -59,9 +59,9 @@ public class PacketProgressBar extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value ); @@ -69,9 +69,9 @@ public class PacketProgressBar extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value ); diff --git a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java index cedae974..a5d723c1 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java @@ -36,16 +36,16 @@ public class PacketSwapSlots extends AppEngPacket final int slotB; // automatic. - public PacketSwapSlots( ByteBuf stream ) + public PacketSwapSlots( final ByteBuf stream ) { this.slotA = stream.readInt(); this.slotB = stream.readInt(); } // api - public PacketSwapSlots( int slotA, int slotB ) + public PacketSwapSlots( final int slotA, final int slotB ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.slotA = slotA ); @@ -55,7 +55,7 @@ public class PacketSwapSlots extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player != null && player.openContainer instanceof AEBaseContainer ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java index c678602d..1c887a79 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java @@ -41,13 +41,13 @@ public class PacketSwitchGuis extends AppEngPacket final GuiBridge newGui; // automatic. - public PacketSwitchGuis( ByteBuf stream ) + public PacketSwitchGuis( final ByteBuf stream ) { this.newGui = GuiBridge.values()[stream.readInt()]; } // api - public PacketSwitchGuis( GuiBridge newGui ) + public PacketSwitchGuis( final GuiBridge newGui ) { this.newGui = newGui; @@ -56,7 +56,7 @@ public class PacketSwitchGuis extends AppEngPacket AEBaseGui.switchingGuis = true; } - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( newGui.ordinal() ); @@ -65,23 +65,23 @@ public class PacketSwitchGuis extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) c; - ContainerOpenContext context = bc.openContext; + final AEBaseContainer bc = (AEBaseContainer) c; + final ContainerOpenContext context = bc.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( player, te, context.side, this.newGui ); } } } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { AEBaseGui.switchingGuis = true; } diff --git a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java index ce097c44..2e8c9354 100644 --- a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java +++ b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java @@ -52,7 +52,7 @@ public class PacketTransitionEffect extends AppEngPacket final ForgeDirection d; // automatic. - public PacketTransitionEffect( ByteBuf stream ) + public PacketTransitionEffect( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -62,7 +62,7 @@ public class PacketTransitionEffect extends AppEngPacket } // api - public PacketTransitionEffect( double x, double y, double z, ForgeDirection dir, boolean wasBlock ) + public PacketTransitionEffect( final double x, final double y, final double z, final ForgeDirection dir, final boolean wasBlock ) { this.x = x; this.y = y; @@ -70,7 +70,7 @@ public class PacketTransitionEffect extends AppEngPacket this.d = dir; this.mode = wasBlock; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -84,15 +84,15 @@ public class PacketTransitionEffect extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - World world = ClientHelper.proxy.getWorld(); + final World world = ClientHelper.proxy.getWorld(); for( int zz = 0; zz < ( this.mode ? 32 : 8 ); zz++ ) { if( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - EnergyFx fx = new EnergyFx( world, this.x + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.y + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.z + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), Items.diamond ); + final EnergyFx fx = new EnergyFx( world, this.x + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.y + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.z + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), Items.diamond ); if( !this.mode ) { @@ -109,7 +109,7 @@ public class PacketTransitionEffect extends AppEngPacket if( this.mode ) { - Block block = world.getBlock( (int) this.x, (int) this.y, (int) this.z ); + final Block block = world.getBlock( (int) this.x, (int) this.y, (int) this.z ); Minecraft.getMinecraft().getSoundHandler().playSound( new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), ( block.stepSound.getVolume() + 1.0F ) / 2.0F, block.stepSound.getPitch() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java index 4372d9f4..a1cb07d2 100644 --- a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java +++ b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java @@ -63,26 +63,26 @@ public class PacketValueConfig extends AppEngPacket public final String Value; // automatic. - public PacketValueConfig( ByteBuf stream ) throws IOException + public PacketValueConfig( final ByteBuf stream ) throws IOException { - DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) ); + final DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) ); this.Name = dis.readUTF(); this.Value = dis.readUTF(); // dis.close(); } // api - public PacketValueConfig( String name, String value ) throws IOException + public PacketValueConfig( final String name, final String value ) throws IOException { this.Name = name; this.Value = value; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream( bos ); + final ByteArrayOutputStream bos = new ByteArrayOutputStream(); + final DataOutputStream dos = new DataOutputStream( bos ); dos.writeUTF( name ); dos.writeUTF( value ); // dos.close(); @@ -93,59 +93,59 @@ public class PacketValueConfig extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem ) { - ItemStack is = player.getHeldItem(); - IMouseWheelItem si = (IMouseWheelItem) is.getItem(); + final ItemStack is = player.getHeldItem(); + final IMouseWheelItem si = (IMouseWheelItem) is.getItem(); si.onWheel( is, this.Value.equals( "WheelUp" ) ); } else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus ) { - ContainerCraftingStatus qk = (ContainerCraftingStatus) c; + final ContainerCraftingStatus qk = (ContainerCraftingStatus) c; qk.cycleCpu( this.Value.equals( "Next" ) ); } else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm qk = (ContainerCraftConfirm) c; + final ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.cycleCpu( this.Value.equals( "Next" ) ); } else if( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm qk = (ContainerCraftConfirm) c; + final ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.startJob(); } else if( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU ) { - ContainerCraftingCPU qk = (ContainerCraftingCPU) c; + final ContainerCraftingCPU qk = (ContainerCraftingCPU) c; qk.cancelCrafting(); } else if( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife ) { - ContainerQuartzKnife qk = (ContainerQuartzKnife) c; + final ContainerQuartzKnife qk = (ContainerQuartzKnife) c; qk.setName( this.Value ); } else if( this.Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity ) { - ContainerSecurity sc = (ContainerSecurity) c; + final ContainerSecurity sc = (ContainerSecurity) c; sc.toggleSetting( this.Value, player ); } else if( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority ) { - ContainerPriority pc = (ContainerPriority) c; + final ContainerPriority pc = (ContainerPriority) c; pc.setPriority( Integer.parseInt( this.Value ), player ); } else if( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter ) { - ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; + final ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; lvc.setLevel( Long.parseLong( this.Value ), player ); } else if( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm ) { - ContainerPatternTerm cpt = (ContainerPatternTerm) c; + final ContainerPatternTerm cpt = (ContainerPatternTerm) c; if( this.Name.equals( "PatternTerminal.CraftMode" ) ) { cpt.ct.setCraftingRecipe( this.Value.equals( "1" ) ); @@ -161,7 +161,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus ) { - ContainerStorageBus ccw = (ContainerStorageBus) c; + final ContainerStorageBus ccw = (ContainerStorageBus) c; if( this.Name.equals( "StorageBus.Action" ) ) { if( this.Value.equals( "Partition" ) ) @@ -176,7 +176,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench ) { - ContainerCellWorkbench ccw = (ContainerCellWorkbench) c; + final ContainerCellWorkbench ccw = (ContainerCellWorkbench) c; if( this.Name.equals( "CellWorkbench.Action" ) ) { if( this.Value.equals( "CopyMode" ) ) @@ -206,19 +206,19 @@ public class PacketValueConfig extends AppEngPacket } else if( c instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); - for( Settings e : cm.getSettings() ) + for( final Settings e : cm.getSettings() ) { if( e.name().equals( this.Name ) ) { - Enum def = cm.getSetting( e ); + final Enum def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } - catch( IllegalArgumentException err ) + catch( final IllegalArgumentException err ) { // :P } @@ -230,9 +230,9 @@ public class PacketValueConfig extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { @@ -244,7 +244,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); @@ -252,19 +252,19 @@ public class PacketValueConfig extends AppEngPacket } else if( c instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); - for( Settings e : cm.getSettings() ) + for( final Settings e : cm.getSettings() ) { if( e.name().equals( this.Name ) ) { - Enum def = cm.getSetting( e ); + final Enum def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } - catch( IllegalArgumentException err ) + catch( final IllegalArgumentException err ) { // :P } diff --git a/src/main/java/appeng/core/worlddata/DimensionData.java b/src/main/java/appeng/core/worlddata/DimensionData.java index a66389e3..e3fb9877 100644 --- a/src/main/java/appeng/core/worlddata/DimensionData.java +++ b/src/main/java/appeng/core/worlddata/DimensionData.java @@ -72,7 +72,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn final int[] storageCellIDs = this.storageCellIDsProperty().getIntList(); this.storageCellDimensionIDs = Lists.newArrayList(); - for( int storageCellID : storageCellIDs ) + for( final int storageCellID : storageCellIDs ) { this.storageCellDimensionIDs.add( storageCellID ); } @@ -86,7 +86,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn @Override public void onWorldStart() { - for( Integer storageCellDimID : this.storageCellDimensionIDs ) + for( final Integer storageCellDimID : this.storageCellDimensionIDs ) { DimensionManager.registerDimension( storageCellDimID, AEConfig.instance.storageProviderID ); } @@ -99,7 +99,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn { this.config.save(); - for( Integer storageCellDimID : this.storageCellDimensionIDs ) + for( final Integer storageCellDimID : this.storageCellDimensionIDs ) { DimensionManager.unregisterDimension( storageCellDimID ); } @@ -108,14 +108,14 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public void addStorageCell( int newStorageCellID ) + public void addStorageCell( final int newStorageCellID ) { this.storageCellDimensionIDs.add( newStorageCellID ); DimensionManager.registerDimension( newStorageCellID, AEConfig.instance.storageProviderID ); NetworkHandler.instance.sendToAll( new PacketNewStorageDimension( newStorageCellID ) ); - String[] values = new String[this.storageCellDimensionIDs.size()]; + final String[] values = new String[this.storageCellDimensionIDs.size()]; for( int x = 0; x < values.length; x++ ) { @@ -127,7 +127,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public WorldCoord getStoredSize( int dim ) + public WorldCoord getStoredSize( final int dim ) { final String category = STORAGE_CELL_CATEGORY + dim; @@ -139,7 +139,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public void setStoredSize( int dim, int targetX, int targetY, int targetZ ) + public void setStoredSize( final int dim, final int targetX, final int targetY, final int targetZ ) { final String category = STORAGE_CELL_CATEGORY + dim; @@ -155,14 +155,14 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn { if( manager != null ) { - for( int newDim : this.config.get( PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY ).getIntList() ) + for( final int newDim : this.config.get( PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY ).getIntList() ) { manager.scheduleOutboundPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() ); } } else { - for( TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() ) + for( final TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() ) { NetworkHandler.instance.sendToAll( pc.getPacket() ); } diff --git a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java index a5f92a53..0f484709 100644 --- a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java +++ b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java @@ -51,7 +51,7 @@ public class MeteorDataNameEncoder this( DATA_SEPARATOR, BASE_EXTENSION_SEPARATOR, FILE_EXTENSION, bitScale ); } - private MeteorDataNameEncoder( char dataSeparator, char baseExtSeparator, @Nonnull final String fileExtension, final int bitScale ) + private MeteorDataNameEncoder( final char dataSeparator, final char baseExtSeparator, @Nonnull final String fileExtension, final int bitScale ) { Preconditions.checkNotNull( fileExtension ); Preconditions.checkArgument( !fileExtension.isEmpty() ); @@ -73,7 +73,7 @@ public class MeteorDataNameEncoder * * @since rv3 05.06.2015 */ - public String encode( int dimension, int chunkX, int chunkZ ) + public String encode( final int dimension, final int chunkX, final int chunkZ ) { final int shiftedX = chunkX >> this.bitScale; final int shiftedZ = chunkZ >> this.bitScale; diff --git a/src/main/java/appeng/core/worlddata/PlayerData.java b/src/main/java/appeng/core/worlddata/PlayerData.java index 0fece44b..545c9b85 100644 --- a/src/main/java/appeng/core/worlddata/PlayerData.java +++ b/src/main/java/appeng/core/worlddata/PlayerData.java @@ -69,14 +69,14 @@ final class PlayerData implements IWorldPlayerData, IOnWorldStartable, IOnWorldS @Nullable @Override - public EntityPlayer getPlayerFromID( int playerID ) + public EntityPlayer getPlayerFromID( final int playerID ) { final Optional maybe = this.playerMapping.get( playerID ); if( maybe.isPresent() ) { final UUID uuid = maybe.get(); - for( EntityPlayer player : CommonHelper.proxy.getPlayers() ) + for( final EntityPlayer player : CommonHelper.proxy.getPlayers() ) { if( player.getUniqueID().equals( uuid ) ) { diff --git a/src/main/java/appeng/core/worlddata/PlayerMapping.java b/src/main/java/appeng/core/worlddata/PlayerMapping.java index ed9af693..d9ae66e6 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMapping.java +++ b/src/main/java/appeng/core/worlddata/PlayerMapping.java @@ -46,7 +46,7 @@ final class PlayerMapping implements IWorldPlayerMapping */ private final Map mappings; - public PlayerMapping( ConfigCategory category, FMLRelaunchLog log ) + public PlayerMapping( final ConfigCategory category, final FMLRelaunchLog log ) { final PlayerMappingsInitializer init = new PlayerMappingsInitializer( category, log ); @@ -55,7 +55,7 @@ final class PlayerMapping implements IWorldPlayerMapping @Nonnull @Override - public Optional get( int id ) + public Optional get( final int id ) { final UUID maybe = this.mappings.get( id ); @@ -63,7 +63,7 @@ final class PlayerMapping implements IWorldPlayerMapping } @Override - public void put( int id, @Nonnull UUID uuid ) + public void put( final int id, @Nonnull final UUID uuid ) { Preconditions.checkNotNull( uuid ); diff --git a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java index 788af63b..10ddae25 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java +++ b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java @@ -53,7 +53,7 @@ class PlayerMappingsInitializer * @param playerList the category for the player list, generally extracted using the "players" tag * @param log the logger used to warn the server or user of faulty entries */ - PlayerMappingsInitializer( ConfigCategory playerList, FMLRelaunchLog log ) + PlayerMappingsInitializer( final ConfigCategory playerList, final FMLRelaunchLog log ) { // Matcher for UUIDs final UUIDMatcher matcher = new UUIDMatcher(); @@ -65,7 +65,7 @@ class PlayerMappingsInitializer this.playerMappings = new HashMap( capacity ); // Iterates through every pair of UUID to ID - for( Map.Entry entry : playerList.getValues().entrySet() ) + for( final Map.Entry entry : playerList.getValues().entrySet() ) { final String maybeUUID = entry.getKey(); final int id = entry.getValue().getInt(); diff --git a/src/main/java/appeng/core/worlddata/SpawnData.java b/src/main/java/appeng/core/worlddata/SpawnData.java index 9af52b30..789d406d 100644 --- a/src/main/java/appeng/core/worlddata/SpawnData.java +++ b/src/main/java/appeng/core/worlddata/SpawnData.java @@ -57,11 +57,11 @@ final class SpawnData implements IWorldSpawnData } @Override - public void setGenerated( int dim, int chunkX, int chunkZ ) + public void setGenerated( final int dim, final int chunkX, final int chunkZ ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); // edit. data.setBoolean( chunkX + "," + chunkZ, true ); @@ -71,24 +71,24 @@ final class SpawnData implements IWorldSpawnData } @Override - public boolean hasGenerated( int dim, int chunkX, int chunkZ ) + public boolean hasGenerated( final int dim, final int chunkX, final int chunkZ ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); return data.getBoolean( chunkX + "," + chunkZ ); } } @Override - public boolean addNearByMeteorites( int dim, int chunkX, int chunkZ, NBTTagCompound newData ) + public boolean addNearByMeteorites( final int dim, final int chunkX, final int chunkZ, final NBTTagCompound newData ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); // edit. - int size = data.getInteger( "num" ); + final int size = data.getInteger( "num" ); data.setTag( String.valueOf( size ), newData ); data.setInteger( "num", size + 1 ); @@ -99,9 +99,9 @@ final class SpawnData implements IWorldSpawnData } @Override - public Collection getNearByMeteorites( int dim, int chunkX, int chunkZ ) + public Collection getNearByMeteorites( final int dim, final int chunkX, final int chunkZ ) { - Collection ll = new LinkedList(); + final Collection ll = new LinkedList(); synchronized( SpawnData.class ) { @@ -109,15 +109,15 @@ final class SpawnData implements IWorldSpawnData { for( int z = -1; z <= 1; z++ ) { - int cx = x + ( chunkX >> 4 ); - int cz = z + ( chunkZ >> 4 ); + final int cx = x + ( chunkX >> 4 ); + final int cz = z + ( chunkZ >> 4 ); - NBTTagCompound data = this.loadSpawnData( dim, cx << 4, cz << 4 ); + final NBTTagCompound data = this.loadSpawnData( dim, cx << 4, cz << 4 ); if( data != null ) { // edit. - int size = data.getInteger( "num" ); + final int size = data.getInteger( "num" ); for( int s = 0; s < size; s++ ) { ll.add( data.getCompoundTag( String.valueOf( s ) ) ); @@ -130,7 +130,7 @@ final class SpawnData implements IWorldSpawnData return ll; } - private NBTTagCompound loadSpawnData( int dim, int chunkX, int chunkZ ) + private NBTTagCompound loadSpawnData( final int dim, final int chunkX, final int chunkZ ) { if( !Thread.holdsLock( SpawnData.class ) ) { @@ -150,7 +150,7 @@ final class SpawnData implements IWorldSpawnData fileInputStream = new FileInputStream( file ); data = CompressedStreamTools.readCompressed( fileInputStream ); } - catch( Throwable e ) + catch( final Throwable e ) { data = new NBTTagCompound(); AELog.error( e ); @@ -163,7 +163,7 @@ final class SpawnData implements IWorldSpawnData { fileInputStream.close(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -178,7 +178,7 @@ final class SpawnData implements IWorldSpawnData return data; } - private void writeSpawnData( int dim, int chunkX, int chunkZ, NBTTagCompound data ) + private void writeSpawnData( final int dim, final int chunkX, final int chunkZ, final NBTTagCompound data ) { if( !Thread.holdsLock( SpawnData.class ) ) { @@ -194,7 +194,7 @@ final class SpawnData implements IWorldSpawnData fileOutputStream = new FileOutputStream( file ); CompressedStreamTools.writeCompressed( data, fileOutputStream ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -206,7 +206,7 @@ final class SpawnData implements IWorldSpawnData { fileOutputStream.close(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/worlddata/StorageData.java b/src/main/java/appeng/core/worlddata/StorageData.java index f7d290b2..e13be38c 100644 --- a/src/main/java/appeng/core/worlddata/StorageData.java +++ b/src/main/java/appeng/core/worlddata/StorageData.java @@ -70,16 +70,16 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn */ @Nullable @Override - public GridStorage getGridStorage( long storageID ) + public GridStorage getGridStorage( final long storageID ) { - GridStorageSearch gss = new GridStorageSearch( storageID ); - WeakReference result = this.loadedStorage.get( gss ); + final GridStorageSearch gss = new GridStorageSearch( storageID ); + final WeakReference result = this.loadedStorage.get( gss ); if( result == null || result.get() == null ) { - String id = String.valueOf( storageID ); - String data = this.config.get( "gridstorage", id, "" ).getString(); - GridStorage thisStorage = new GridStorage( data, storageID, gss ); + final String id = String.valueOf( storageID ); + final String data = this.config.get( "gridstorage", id, "" ).getString(); + final GridStorage thisStorage = new GridStorage( data, storageID, gss ); gss.gridStorage = new WeakReference( thisStorage ); this.loadedStorage.put( gss, new WeakReference( gss ) ); return thisStorage; @@ -95,9 +95,9 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn @Override public GridStorage getNewGridStorage() { - long storageID = this.nextGridStorage(); - GridStorageSearch gss = new GridStorageSearch( storageID ); - GridStorage newStorage = new GridStorage( storageID, gss ); + final long storageID = this.nextGridStorage(); + final GridStorageSearch gss = new GridStorageSearch( storageID ); + final GridStorage newStorage = new GridStorage( storageID, gss ); gss.gridStorage = new WeakReference( newStorage ); this.loadedStorage.put( gss, new WeakReference( gss ) ); @@ -107,24 +107,24 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn @Override public long nextGridStorage() { - long r = this.lastGridStorage; + final long r = this.lastGridStorage; this.lastGridStorage++; this.config.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) ); return r; } @Override - public void destroyGridStorage( long id ) + public void destroyGridStorage( final long id ) { - String stringID = String.valueOf( id ); + final String stringID = String.valueOf( id ); this.config.getCategory( "gridstorage" ).remove( stringID ); } @Override - public int getNextOrderedValue( String name ) + public int getNextOrderedValue( final String name ) { - Property p = this.config.get( "orderedValues", name, 0 ); - int myValue = p.getInt(); + final Property p = this.config.get( "orderedValues", name, 0 ); + final int myValue = p.getInt(); p.set( myValue + 1 ); return myValue; } @@ -138,7 +138,7 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn { this.lastGridStorage = Long.parseLong( lastString ); } - catch( NumberFormatException err ) + catch( final NumberFormatException err ) { AELog.warning( "The config contained a value which was not represented as a Long: %s", lastString ); @@ -150,12 +150,12 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn public void onWorldStop() { // populate new data - for( GridStorageSearch gs : this.loadedStorage.keySet() ) + for( final GridStorageSearch gs : this.loadedStorage.keySet() ) { - GridStorage thisStorage = gs.gridStorage.get(); + final GridStorage thisStorage = gs.gridStorage.get(); if( thisStorage != null && thisStorage.getGrid() != null && !thisStorage.getGrid().isEmpty() ) { - String value = thisStorage.getValue(); + final String value = thisStorage.getValue(); this.config.get( GRID_STORAGE_CATEGORY, String.valueOf( thisStorage.getID() ), value ).set( value ); } } diff --git a/src/main/java/appeng/core/worlddata/WorldData.java b/src/main/java/appeng/core/worlddata/WorldData.java index c351fa9b..86025bf4 100644 --- a/src/main/java/appeng/core/worlddata/WorldData.java +++ b/src/main/java/appeng/core/worlddata/WorldData.java @@ -151,7 +151,7 @@ public final class WorldData implements IWorldData throw new IllegalStateException( "Failed to create " + this.spawnDirectory.getAbsolutePath() ); } - for( IOnWorldStartable startable : this.startables ) + for( final IOnWorldStartable startable : this.startables ) { startable.onWorldStart(); } @@ -164,7 +164,7 @@ public final class WorldData implements IWorldData { Preconditions.checkNotNull( instance ); - for( IOnWorldStoppable stoppable : this.stoppables ) + for( final IOnWorldStoppable stoppable : this.stoppables ) { stoppable.onWorldStop(); } diff --git a/src/main/java/appeng/crafting/CraftBranchFailure.java b/src/main/java/appeng/crafting/CraftBranchFailure.java index fcd517fa..c8da305e 100644 --- a/src/main/java/appeng/crafting/CraftBranchFailure.java +++ b/src/main/java/appeng/crafting/CraftBranchFailure.java @@ -29,7 +29,7 @@ public class CraftBranchFailure extends Exception final IAEItemStack missing; - public CraftBranchFailure( IAEItemStack what, long howMany ) + public CraftBranchFailure( final IAEItemStack what, final long howMany ) { super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany ); this.missing = what.copy(); diff --git a/src/main/java/appeng/crafting/CraftingCalculationFailure.java b/src/main/java/appeng/crafting/CraftingCalculationFailure.java index fbb66eac..d34ff80f 100644 --- a/src/main/java/appeng/crafting/CraftingCalculationFailure.java +++ b/src/main/java/appeng/crafting/CraftingCalculationFailure.java @@ -29,7 +29,7 @@ public class CraftingCalculationFailure extends RuntimeException final IAEItemStack missing; - public CraftingCalculationFailure( IAEItemStack what, long howMany ) + public CraftingCalculationFailure( final IAEItemStack what, final long howMany ) { super( "this should have been caught!" ); this.missing = what.copy(); diff --git a/src/main/java/appeng/crafting/CraftingJob.java b/src/main/java/appeng/crafting/CraftingJob.java index fb84f509..838b09cd 100644 --- a/src/main/java/appeng/crafting/CraftingJob.java +++ b/src/main/java/appeng/crafting/CraftingJob.java @@ -68,7 +68,7 @@ public class CraftingJob implements Runnable, ICraftingJob private int time = 5; private int incTime = Integer.MAX_VALUE; - public CraftingJob( World w, NBTTagCompound data ) + public CraftingJob( final World w, final NBTTagCompound data ) { this.world = this.wrapWorld( w ); this.storage = AEApi.instance().storage().createItemList(); @@ -77,12 +77,12 @@ public class CraftingJob implements Runnable, ICraftingJob this.availableCheck = null; } - private World wrapWorld( World w ) + private World wrapWorld( final World w ) { return w; } - public CraftingJob( World w, IGrid grid, BaseActionSource actionSrc, IAEItemStack what, ICraftingCallback callback ) + public CraftingJob( final World w, final IGrid grid, final BaseActionSource actionSrc, final IAEItemStack what, final ICraftingCallback callback ) { this.world = this.wrapWorld( w ); this.output = what.copy(); @@ -91,35 +91,35 @@ public class CraftingJob implements Runnable, ICraftingJob this.actionSrc = actionSrc; this.callback = callback; - ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); - IStorageGrid sg = grid.getCache( IStorageGrid.class ); + final ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); + final IStorageGrid sg = grid.getCache( IStorageGrid.class ); this.original = new MECraftingInventory( sg.getItemInventory(), actionSrc, false, false, false ); this.tree = this.getCraftingTree( cc, what ); this.availableCheck = null; } - private CraftingTreeNode getCraftingTree( ICraftingGrid cc, IAEItemStack what ) + private CraftingTreeNode getCraftingTree( final ICraftingGrid cc, final IAEItemStack what ) { return new CraftingTreeNode( cc, this, what, null, -1, 0 ); } - public void refund( IAEItemStack o ) + public void refund( final IAEItemStack o ) { this.availableCheck.injectItems( o, Actionable.MODULATE, this.actionSrc ); } - public IAEItemStack checkUse( IAEItemStack available ) + public IAEItemStack checkUse( final IAEItemStack available ) { return this.availableCheck.extractItems( available, Actionable.MODULATE, this.actionSrc ); } - public void writeToNBT( NBTTagCompound out ) + public void writeToNBT( final NBTTagCompound out ) { } - public void addTask( IAEItemStack what, long crafts, ICraftingPatternDetails details, int depth ) + public void addTask( IAEItemStack what, final long crafts, final ICraftingPatternDetails details, final int depth ) { if( crafts > 0 ) { @@ -145,18 +145,18 @@ public class CraftingJob implements Runnable, ICraftingJob TickHandler.INSTANCE.registerCraftingSimulation( this.world, this ); this.handlePausing(); - Stopwatch timer = Stopwatch.createStarted(); + final Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + final MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); craftingInventory.ignore( this.output ); this.availableCheck = new MECraftingInventory( this.original, false, false, false ); this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); this.tree.dive( this ); - for( String s : this.opsAndMultiplier.keySet() ) + for( final String s : this.opsAndMultiplier.keySet() ) { - TwoIntegers ti = this.opsAndMultiplier.get( s ); + final TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + ( ti.perOp * ti.times ) ); } @@ -164,14 +164,14 @@ public class CraftingJob implements Runnable, ICraftingJob // if ( mode == Actionable.MODULATE ) // craftingInventory.moveItemsToStorage( storage ); } - catch( CraftBranchFailure e ) + catch( final CraftBranchFailure e ) { this.simulate = true; try { - Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + final Stopwatch timer = Stopwatch.createStarted(); + final MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); craftingInventory.ignore( this.output ); this.availableCheck = new MECraftingInventory( this.original, false, false, false ); @@ -180,34 +180,34 @@ public class CraftingJob implements Runnable, ICraftingJob this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); this.tree.dive( this ); - for( String s : this.opsAndMultiplier.keySet() ) + for( final String s : this.opsAndMultiplier.keySet() ) { - TwoIntegers ti = this.opsAndMultiplier.get( s ); + final TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + ( ti.perOp * ti.times ) ); } AELog.crafting( "------------- " + this.bytes + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); } - catch( CraftBranchFailure e1 ) + catch( final CraftBranchFailure e1 ) { AELog.error( e1 ); } - catch( CraftingCalculationFailure f ) + catch( final CraftingCalculationFailure f ) { AELog.error( f ); } - catch( InterruptedException e1 ) + catch( final InterruptedException e1 ) { AELog.crafting( "Crafting calculation canceled." ); this.finish(); return; } } - catch( CraftingCalculationFailure f ) + catch( final CraftingCalculationFailure f ) { AELog.error( f ); } - catch( InterruptedException e1 ) + catch( final InterruptedException e1 ) { AELog.crafting( "Crafting calculation canceled." ); this.finish(); @@ -216,7 +216,7 @@ public class CraftingJob implements Runnable, ICraftingJob this.log( "crafting job now done" ); } - catch( Throwable t ) + catch( final Throwable t ) { this.finish(); throw new IllegalStateException( t ); @@ -278,7 +278,7 @@ public class CraftingJob implements Runnable, ICraftingJob } } - private void log( String string ) + private void log( final String string ) { // AELog.crafting( string ); } @@ -296,7 +296,7 @@ public class CraftingJob implements Runnable, ICraftingJob } @Override - public void populatePlan( IItemList plan ) + public void populatePlan( final IItemList plan ) { if( this.tree != null ) { @@ -327,7 +327,7 @@ public class CraftingJob implements Runnable, ICraftingJob * * @return true if this needs more simulation */ - public boolean simulateFor( int milli ) + public boolean simulateFor( final int milli ) { this.time = milli; @@ -352,7 +352,7 @@ public class CraftingJob implements Runnable, ICraftingJob { this.monitor.wait(); } - catch( InterruptedException ignored ) + catch( final InterruptedException ignored ) { } } @@ -363,7 +363,7 @@ public class CraftingJob implements Runnable, ICraftingJob return true; } - public void addBytes( long crafts ) + public void addBytes( final long crafts ) { this.bytes += crafts; } diff --git a/src/main/java/appeng/crafting/CraftingLink.java b/src/main/java/appeng/crafting/CraftingLink.java index 9b66419c..07dd177d 100644 --- a/src/main/java/appeng/crafting/CraftingLink.java +++ b/src/main/java/appeng/crafting/CraftingLink.java @@ -39,7 +39,7 @@ public class CraftingLink implements ICraftingLink boolean done = false; CraftingLinkNexus tie; - public CraftingLink( NBTTagCompound data, ICraftingRequester req ) + public CraftingLink( final NBTTagCompound data, final ICraftingRequester req ) { this.CraftID = data.getString( "CraftID" ); this.canceled = data.getBoolean( "canceled" ); @@ -55,7 +55,7 @@ public class CraftingLink implements ICraftingLink this.cpu = null; } - public CraftingLink( NBTTagCompound data, ICraftingCPU cpu ) + public CraftingLink( final NBTTagCompound data, final ICraftingCPU cpu ) { this.CraftID = data.getString( "CraftID" ); this.canceled = data.getBoolean( "canceled" ); @@ -138,7 +138,7 @@ public class CraftingLink implements ICraftingLink } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { tag.setString( "CraftID", this.CraftID ); tag.setBoolean( "canceled", this.canceled ); @@ -153,7 +153,7 @@ public class CraftingLink implements ICraftingLink return this.CraftID; } - public void setNexus( CraftingLinkNexus n ) + public void setNexus( final CraftingLinkNexus n ) { if( this.tie != null ) { @@ -175,7 +175,7 @@ public class CraftingLink implements ICraftingLink } } - public IAEItemStack injectItems( IAEItemStack input, Actionable mode ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode ) { if( this.tie == null || this.tie.req == null || this.tie.req.req == null ) { diff --git a/src/main/java/appeng/crafting/CraftingLinkNexus.java b/src/main/java/appeng/crafting/CraftingLinkNexus.java index 1082d223..a01a23dd 100644 --- a/src/main/java/appeng/crafting/CraftingLinkNexus.java +++ b/src/main/java/appeng/crafting/CraftingLinkNexus.java @@ -34,12 +34,12 @@ public class CraftingLinkNexus CraftingLink req; CraftingLink cpu; - public CraftingLinkNexus( String craftID ) + public CraftingLinkNexus( final String craftID ) { this.CraftID = craftID; } - public boolean isDead( IGrid g, CraftingGridCache craftingGridCache ) + public boolean isDead( final IGrid g, final CraftingGridCache craftingGridCache ) { if( this.canceled || this.done ) { @@ -52,8 +52,8 @@ public class CraftingLinkNexus } else { - boolean hasCpu = craftingGridCache.hasCpu( this.cpu.cpu ); - boolean hasMachine = this.req.req.getActionableNode().getGrid() == g; + final boolean hasCpu = craftingGridCache.hasCpu( this.cpu.cpu ); + final boolean hasMachine = this.req.req.getActionableNode().getGrid() == g; if( hasCpu && hasMachine ) { @@ -93,7 +93,7 @@ public class CraftingLinkNexus } } - public void remove( CraftingLink craftingLink ) + public void remove( final CraftingLink craftingLink ) { if( this.req == craftingLink ) { @@ -105,7 +105,7 @@ public class CraftingLinkNexus } } - public void add( CraftingLink craftingLink ) + public void add( final CraftingLink craftingLink ) { if( craftingLink.cpu != null ) { @@ -146,7 +146,7 @@ public class CraftingLinkNexus } } - public boolean isMachine( IGridHost machine ) + public boolean isMachine( final IGridHost machine ) { return this.req == machine; } diff --git a/src/main/java/appeng/crafting/CraftingTreeNode.java b/src/main/java/appeng/crafting/CraftingTreeNode.java index f5676e77..40431271 100644 --- a/src/main/java/appeng/crafting/CraftingTreeNode.java +++ b/src/main/java/appeng/crafting/CraftingTreeNode.java @@ -59,7 +59,7 @@ public class CraftingTreeNode boolean sim; - public CraftingTreeNode( ICraftingGrid cc, CraftingJob job, IAEItemStack wat, CraftingTreeProcess par, int slot, int depth ) + public CraftingTreeNode( final ICraftingGrid cc, final CraftingJob job, final IAEItemStack wat, final CraftingTreeProcess par, final int slot, final int depth ) { this.what = wat; this.parent = par; @@ -74,7 +74,7 @@ public class CraftingTreeNode return; // if you can emit for something, you can't make it with patterns. } - for( ICraftingPatternDetails details : cc.getCraftingFor( this.what, this.parent == null ? null : this.parent.details, slot, this.world ) )// in + for( final ICraftingPatternDetails details : cc.getCraftingFor( this.what, this.parent == null ? null : this.parent.details, slot, this.world ) )// in // order. { if( this.parent == null || this.parent.notRecursive( details ) ) @@ -84,10 +84,10 @@ public class CraftingTreeNode } } - boolean notRecursive( ICraftingPatternDetails details ) + boolean notRecursive( final ICraftingPatternDetails details ) { IAEItemStack[] o = details.getCondensedOutputs(); - for( IAEItemStack i : o ) + for( final IAEItemStack i : o ) { if( i.equals( this.what ) ) { @@ -96,7 +96,7 @@ public class CraftingTreeNode } o = details.getCondensedInputs(); - for( IAEItemStack i : o ) + for( final IAEItemStack i : o ) { if( i.equals( this.what ) ) { @@ -112,11 +112,11 @@ public class CraftingTreeNode return this.parent.notRecursive( details ); } - public IAEItemStack request( MECraftingInventory inv, long l, BaseActionSource src ) throws CraftBranchFailure, InterruptedException + public IAEItemStack request( final MECraftingInventory inv, long l, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException { this.job.handlePausing(); - List thingsUsed = new LinkedList(); + final List thingsUsed = new LinkedList(); this.what.setStackSize( l ); if( this.slot >= 0 && this.parent != null && this.parent.details.isCraftable() ) @@ -127,13 +127,13 @@ public class CraftingTreeNode { fuzz = fuzz.copy(); fuzz.setStackSize( l ); - IAEItemStack available = inv.extractItems( fuzz, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( fuzz, Actionable.MODULATE, src ); if( available != null ) { if( !this.exhausted ) { - IAEItemStack is = this.job.checkUse( available ); + final IAEItemStack is = this.job.checkUse( available ); if( is != null ) { thingsUsed.add( is.copy() ); @@ -154,13 +154,13 @@ public class CraftingTreeNode } else { - IAEItemStack available = inv.extractItems( this.what, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( this.what, Actionable.MODULATE, src ); if( available != null ) { if( !this.exhausted ) { - IAEItemStack is = this.job.checkUse( available ); + final IAEItemStack is = this.job.checkUse( available ); if( is != null ) { thingsUsed.add( is.copy() ); @@ -180,7 +180,7 @@ public class CraftingTreeNode if( this.canEmit ) { - IAEItemStack wat = this.what.copy(); + final IAEItemStack wat = this.what.copy(); wat.setStackSize( l ); this.howManyEmitted = wat.getStackSize(); @@ -193,16 +193,16 @@ public class CraftingTreeNode if( this.nodes.size() == 1 ) { - CraftingTreeProcess pro = this.nodes.get( 0 ); + final CraftingTreeProcess pro = this.nodes.get( 0 ); while( pro.possible && l > 0 ) { - IAEItemStack madeWhat = pro.getAmountCrafted( this.what ); + final IAEItemStack madeWhat = pro.getAmountCrafted( this.what ); pro.request( inv, pro.getTimes( l, madeWhat.getStackSize() ), src ); madeWhat.setStackSize( l ); - IAEItemStack available = inv.extractItems( madeWhat, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( madeWhat, Actionable.MODULATE, src ); if( available != null ) { @@ -222,17 +222,17 @@ public class CraftingTreeNode } else if( this.nodes.size() > 1 ) { - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { try { while( pro.possible && l > 0 ) { - MECraftingInventory subInv = new MECraftingInventory( inv, true, true, true ); + final MECraftingInventory subInv = new MECraftingInventory( inv, true, true, true ); pro.request( subInv, 1, src ); this.what.setStackSize( l ); - IAEItemStack available = subInv.extractItems( this.what, Actionable.MODULATE, src ); + final IAEItemStack available = subInv.extractItems( this.what, Actionable.MODULATE, src ); if( available != null ) { @@ -255,7 +255,7 @@ public class CraftingTreeNode } } } - catch( CraftBranchFailure fail ) + catch( final CraftBranchFailure fail ) { pro.possible = true; } @@ -266,12 +266,12 @@ public class CraftingTreeNode { this.missing += l; this.bytes += l; - IAEItemStack rv = this.what.copy(); + final IAEItemStack rv = this.what.copy(); rv.setStackSize( l ); return rv; } - for( IAEItemStack o : thingsUsed ) + for( final IAEItemStack o : thingsUsed ) { this.job.refund( o.copy() ); o.setStackSize( -o.getStackSize() ); @@ -281,7 +281,7 @@ public class CraftingTreeNode throw new CraftBranchFailure( this.what, l ); } - public void dive( CraftingJob job ) + public void dive( final CraftingJob job ) { if( this.missing > 0 ) { @@ -291,15 +291,15 @@ public class CraftingTreeNode job.addBytes( 8 + this.bytes ); - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.dive( job ); } } - public IAEItemStack getStack( long size ) + public IAEItemStack getStack( final long size ) { - IAEItemStack is = this.what.copy(); + final IAEItemStack is = this.what.copy(); is.setStackSize( size ); return is; } @@ -312,17 +312,17 @@ public class CraftingTreeNode this.used.resetStatus(); this.exhausted = false; - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.setSimulate(); } } - public void setJob( MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src ) throws CraftBranchFailure + public void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure { - for( IAEItemStack i : this.used ) + for( final IAEItemStack i : this.used ) { - IAEItemStack ex = storage.extractItems( i, Actionable.MODULATE, src ); + final IAEItemStack ex = storage.extractItems( i, Actionable.MODULATE, src ); if( ex == null || ex.getStackSize() != i.getStackSize() ) { @@ -334,39 +334,39 @@ public class CraftingTreeNode if( this.howManyEmitted > 0 ) { - IAEItemStack i = this.what.copy(); + final IAEItemStack i = this.what.copy(); i.setStackSize( this.howManyEmitted ); craftingCPUCluster.addEmitable( i ); } - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.setJob( storage, craftingCPUCluster, src ); } } - public void getPlan( IItemList plan ) + public void getPlan( final IItemList plan ) { if( this.missing > 0 ) { - IAEItemStack o = this.what.copy(); + final IAEItemStack o = this.what.copy(); o.setStackSize( this.missing ); plan.add( o ); } if( this.howManyEmitted > 0 ) { - IAEItemStack i = this.what.copy(); + final IAEItemStack i = this.what.copy(); i.setCountRequestable( this.howManyEmitted ); plan.addRequestable( i ); } - for( IAEItemStack i : this.used ) + for( final IAEItemStack i : this.used ) { plan.add( i.copy() ); } - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.getPlan( plan ); } diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index 9648b7b5..fbdc72bb 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -58,20 +58,20 @@ public class CraftingTreeProcess boolean fullSimulation; private long bytes = 0; - public CraftingTreeProcess( ICraftingGrid cc, CraftingJob job, ICraftingPatternDetails details, CraftingTreeNode craftingTreeNode, int depth ) + public CraftingTreeProcess( final ICraftingGrid cc, final CraftingJob job, final ICraftingPatternDetails details, final CraftingTreeNode craftingTreeNode, final int depth ) { this.parent = craftingTreeNode; this.details = details; this.job = job; this.depth = depth; - World world = job.getWorld(); + final World world = job.getWorld(); if( details.isCraftable() ) { - IAEItemStack[] list = details.getInputs(); + final IAEItemStack[] list = details.getInputs(); - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - IAEItemStack[] is = details.getInputs(); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final IAEItemStack[] is = details.getInputs(); for( int x = 0; x < ic.getSizeInventory(); x++ ) { ic.setInventorySlotContents( x, is[x] == null ? null : is[x].getItemStack() ); @@ -81,19 +81,19 @@ public class CraftingTreeProcess for( int x = 0; x < ic.getSizeInventory(); x++ ) { - ItemStack g = ic.getStackInSlot( x ); + final ItemStack g = ic.getStackInSlot( x ); if( g != null && g.stackSize > 1 ) { this.fullSimulation = true; } } - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { - ItemStack g = part.getItemStack(); + final ItemStack g = part.getItemStack(); boolean isAnInput = false; - for( IAEItemStack a : details.getCondensedOutputs() ) + for( final IAEItemStack a : details.getCondensedOutputs() ) { if( g != null && a != null && a.equals( g ) ) { @@ -112,13 +112,13 @@ public class CraftingTreeProcess } } - boolean complicated = false; + final boolean complicated = false; if( this.containerItems || complicated ) { for( int x = 0; x < list.length; x++ ) { - IAEItemStack part = list[x]; + final IAEItemStack part = list[x]; if( part != null ) { this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); @@ -128,11 +128,11 @@ public class CraftingTreeProcess else { // this is minor different then below, this slot uses the pattern, but kinda fudges it. - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { for( int x = 0; x < list.length; x++ ) { - IAEItemStack comparePart = list[x]; + final IAEItemStack comparePart = list[x]; if( part != null && part.equals( comparePart ) ) { // use the first slot... @@ -145,12 +145,12 @@ public class CraftingTreeProcess } else { - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { - ItemStack g = part.getItemStack(); + final ItemStack g = part.getItemStack(); boolean isAnInput = false; - for( IAEItemStack a : details.getCondensedOutputs() ) + for( final IAEItemStack a : details.getCondensedOutputs() ) { if( g != null && a != null && a.equals( g ) ) { @@ -164,19 +164,19 @@ public class CraftingTreeProcess } } - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, -1, depth + 1 ), part.getStackSize() ); } } } - public boolean notRecursive( ICraftingPatternDetails details ) + public boolean notRecursive( final ICraftingPatternDetails details ) { return this.parent == null || this.parent.notRecursive( details ); } - long getTimes( long remaining, long stackSize ) + long getTimes( final long remaining, final long stackSize ) { if( this.limitQty || this.fullSimulation ) { @@ -185,18 +185,18 @@ public class CraftingTreeProcess return ( remaining / stackSize ) + ( remaining % stackSize != 0 ? 1 : 0 ); } - public void request( MECraftingInventory inv, long i, BaseActionSource src ) throws CraftBranchFailure, InterruptedException + public void request( final MECraftingInventory inv, final long i, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException { this.job.handlePausing(); if( this.fullSimulation ) { - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - for( Entry entry : this.nodes.entrySet() ) + for( final Entry entry : this.nodes.entrySet() ) { - IAEItemStack item = entry.getKey().getStack( entry.getValue() ); - IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src ); + final IAEItemStack item = entry.getKey().getStack( entry.getValue() ); + final IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src ); ic.setInventorySlotContents( entry.getKey().slot, stack.getItemStack() ); } @@ -208,7 +208,7 @@ public class CraftingTreeProcess ItemStack is = ic.getStackInSlot( x ); is = Platform.getContainerItem( is ); - IAEItemStack o = AEApi.instance().storage().createItemStack( is ); + final IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if( o != null ) { this.bytes++; @@ -219,15 +219,15 @@ public class CraftingTreeProcess else { // request and remove inputs... - for( Entry entry : this.nodes.entrySet() ) + for( final Entry entry : this.nodes.entrySet() ) { - IAEItemStack item = entry.getKey().getStack( entry.getValue() ); - IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src ); + final IAEItemStack item = entry.getKey().getStack( entry.getValue() ); + final IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src ); if( this.containerItems ) { - ItemStack is = Platform.getContainerItem( stack.getItemStack() ); - IAEItemStack o = AEApi.instance().storage().createItemStack( is ); + final ItemStack is = Platform.getContainerItem( stack.getItemStack() ); + final IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if( o != null ) { this.bytes++; @@ -240,9 +240,9 @@ public class CraftingTreeProcess // assume its possible. // add crafting results.. - for( IAEItemStack out : this.details.getCondensedOutputs() ) + for( final IAEItemStack out : this.details.getCondensedOutputs() ) { - IAEItemStack o = out.copy(); + final IAEItemStack o = out.copy(); o.setStackSize( o.getStackSize() * i ); inv.injectItems( o, Actionable.MODULATE, src ); } @@ -250,10 +250,10 @@ public class CraftingTreeProcess this.crafts += i; } - public void dive( CraftingJob job ) + public void dive( final CraftingJob job ) { job.addTask( this.getAmountCrafted( this.parent.getStack( 1 ) ), this.crafts, this.details, this.depth ); - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.dive( job ); } @@ -263,7 +263,7 @@ public class CraftingTreeProcess IAEItemStack getAmountCrafted( IAEItemStack what2 ) { - for( IAEItemStack is : this.details.getCondensedOutputs() ) + for( final IAEItemStack is : this.details.getCondensedOutputs() ) { if( is.equals( what2 ) ) { @@ -274,7 +274,7 @@ public class CraftingTreeProcess } // more fuzzy! - for( IAEItemStack is : this.details.getCondensedOutputs() ) + for( final IAEItemStack is : this.details.getCondensedOutputs() ) { if( is.getItem() == what2.getItem() && ( is.getItem().isDamageable() || is.getItemDamage() == what2.getItemDamage() ) ) { @@ -292,23 +292,23 @@ public class CraftingTreeProcess this.crafts = 0; this.bytes = 0; - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.setSimulate(); } } - public void setJob( MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src ) throws CraftBranchFailure + public void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure { craftingCPUCluster.addCrafting( this.details, this.crafts ); - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.setJob( storage, craftingCPUCluster, src ); } } - public void getPlan( IItemList plan ) + public void getPlan( final IItemList plan ) { for( IAEItemStack i : this.details.getOutputs() ) { @@ -317,7 +317,7 @@ public class CraftingTreeProcess plan.addRequestable( i ); } - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.getPlan( plan ); } diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 5b8bae57..2ee6a41a 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -41,7 +41,7 @@ public class CraftingWatcher implements ICraftingWatcher final ICraftingWatcherHost host; final HashSet myInterests = new HashSet(); - public CraftingWatcher( CraftingGridCache cache, ICraftingWatcherHost host ) + public CraftingWatcher( final CraftingGridCache cache, final ICraftingWatcherHost host ) { this.gsc = cache; this.host = host; @@ -65,7 +65,7 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -86,13 +86,13 @@ public class CraftingWatcher implements ICraftingWatcher @Nonnull @Override - public T[] toArray( @Nonnull T[] a ) + public T[] toArray( @Nonnull final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( IAEStack e ) + public boolean add( final IAEStack e ) { if( this.myInterests.contains( e ) ) { @@ -103,23 +103,23 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this ); } @Override - public boolean containsAll( @Nonnull Collection c ) + public boolean containsAll( @Nonnull final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( @Nonnull Collection c ) + public boolean addAll( @Nonnull final Collection c ) { boolean didChange = false; - for( IAEStack o : c ) + for( final IAEStack o : c ) { didChange = this.add( o ) || didChange; } @@ -128,10 +128,10 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean removeAll( @Nonnull Collection c ) + public boolean removeAll( @Nonnull final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -139,10 +139,10 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean retainAll( @Nonnull Collection c ) + public boolean retainAll( @Nonnull final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -159,7 +159,7 @@ public class CraftingWatcher implements ICraftingWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interestManager.remove( i.next(), this ); @@ -174,7 +174,7 @@ public class CraftingWatcher implements ICraftingWatcher final Iterator interestIterator; IAEStack myLast; - public ItemWatcherIterator( CraftingWatcher parent, Iterator i ) + public ItemWatcherIterator( final CraftingWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/crafting/MECraftingInventory.java b/src/main/java/appeng/crafting/MECraftingInventory.java index 9da58d39..0ec5f990 100644 --- a/src/main/java/appeng/crafting/MECraftingInventory.java +++ b/src/main/java/appeng/crafting/MECraftingInventory.java @@ -59,7 +59,7 @@ public class MECraftingInventory implements IMEInventory this.par = null; } - public MECraftingInventory( MECraftingInventory parent ) + public MECraftingInventory( final MECraftingInventory parent ) { this.target = parent; this.logExtracted = parent.logExtracted; @@ -98,7 +98,7 @@ public class MECraftingInventory implements IMEInventory this.par = parent; } - public MECraftingInventory( IMEMonitor target, BaseActionSource src, boolean logExtracted, boolean logInjections, boolean logMissing ) + public MECraftingInventory( final IMEMonitor target, final BaseActionSource src, final boolean logExtracted, final boolean logInjections, final boolean logMissing ) { this.target = target; this.logExtracted = logExtracted; @@ -133,7 +133,7 @@ public class MECraftingInventory implements IMEInventory } this.localCache = AEApi.instance().storage().createItemList(); - for( IAEItemStack is : target.getStorageList() ) + for( final IAEItemStack is : target.getStorageList() ) { this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) ); } @@ -141,7 +141,7 @@ public class MECraftingInventory implements IMEInventory this.par = null; } - public MECraftingInventory( IMEInventory target, boolean logExtracted, boolean logInjections, boolean logMissing ) + public MECraftingInventory( final IMEInventory target, final boolean logExtracted, final boolean logInjections, final boolean logMissing ) { this.target = target; this.logExtracted = logExtracted; @@ -180,7 +180,7 @@ public class MECraftingInventory implements IMEInventory } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( input == null ) { @@ -200,14 +200,14 @@ public class MECraftingInventory implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( request == null ) { return null; } - IAEItemStack list = this.localCache.findPrecise( request ); + final IAEItemStack list = this.localCache.findPrecise( request ); if( list == null || list.getStackSize() == 0 ) { return null; @@ -227,7 +227,7 @@ public class MECraftingInventory implements IMEInventory return request; } - IAEItemStack ret = request.copy(); + final IAEItemStack ret = request.copy(); ret.setStackSize( list.getStackSize() ); if( mode == Actionable.MODULATE ) @@ -243,9 +243,9 @@ public class MECraftingInventory implements IMEInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack is : this.localCache ) + for( final IAEItemStack is : this.localCache ) { out.add( is ); } @@ -264,15 +264,15 @@ public class MECraftingInventory implements IMEInventory return this.localCache; } - public boolean commit( BaseActionSource src ) + public boolean commit( final BaseActionSource src ) { - IItemList added = AEApi.instance().storage().createItemList(); - IItemList pulled = AEApi.instance().storage().createItemList(); + final IItemList added = AEApi.instance().storage().createItemList(); + final IItemList pulled = AEApi.instance().storage().createItemList(); boolean failed = false; if( this.logInjections ) { - for( IAEItemStack inject : this.injectedCache ) + for( final IAEItemStack inject : this.injectedCache ) { IAEItemStack result = null; added.add( result = this.target.injectItems( inject, Actionable.MODULATE, src ) ); @@ -287,7 +287,7 @@ public class MECraftingInventory implements IMEInventory if( failed ) { - for( IAEItemStack is : added ) + for( final IAEItemStack is : added ) { this.target.extractItems( is, Actionable.MODULATE, src ); } @@ -297,7 +297,7 @@ public class MECraftingInventory implements IMEInventory if( this.logExtracted ) { - for( IAEItemStack extra : this.extractedCache ) + for( final IAEItemStack extra : this.extractedCache ) { IAEItemStack result = null; pulled.add( result = this.target.extractItems( extra, Actionable.MODULATE, src ) ); @@ -312,12 +312,12 @@ public class MECraftingInventory implements IMEInventory if( failed ) { - for( IAEItemStack is : added ) + for( final IAEItemStack is : added ) { this.target.extractItems( is, Actionable.MODULATE, src ); } - for( IAEItemStack is : pulled ) + for( final IAEItemStack is : pulled ) { this.target.injectItems( is, Actionable.MODULATE, src ); } @@ -327,7 +327,7 @@ public class MECraftingInventory implements IMEInventory if( this.logMissing && this.par != null ) { - for( IAEItemStack extra : this.missingCache ) + for( final IAEItemStack extra : this.missingCache ) { this.par.addMissing( extra ); } @@ -336,14 +336,14 @@ public class MECraftingInventory implements IMEInventory return true; } - public void addMissing( IAEItemStack extra ) + public void addMissing( final IAEItemStack extra ) { this.missingCache.add( extra ); } - public void ignore( IAEItemStack what ) + public void ignore( final IAEItemStack what ) { - IAEItemStack list = this.localCache.findPrecise( what ); + final IAEItemStack list = this.localCache.findPrecise( what ); if( list != null ) { list.setStackSize( 0 ); diff --git a/src/main/java/appeng/debug/BlockChunkloader.java b/src/main/java/appeng/debug/BlockChunkloader.java index 674462bc..b8cb0a48 100644 --- a/src/main/java/appeng/debug/BlockChunkloader.java +++ b/src/main/java/appeng/debug/BlockChunkloader.java @@ -46,13 +46,13 @@ public class BlockChunkloader extends AEBaseTileBlock implements LoadingCallback } @Override - public void ticketsLoaded( List tickets, World world ) + public void ticketsLoaded( final List tickets, final World world ) { } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { this.registerNoIcons(); } diff --git a/src/main/java/appeng/debug/BlockCubeGenerator.java b/src/main/java/appeng/debug/BlockCubeGenerator.java index aafbfaac..2fc7bb53 100644 --- a/src/main/java/appeng/debug/BlockCubeGenerator.java +++ b/src/main/java/appeng/debug/BlockCubeGenerator.java @@ -41,9 +41,9 @@ public class BlockCubeGenerator extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { - TileCubeGenerator tcg = this.getTileEntity( w, x, y, z ); + final TileCubeGenerator tcg = this.getTileEntity( w, x, y, z ); if( tcg != null ) { tcg.click( player ); @@ -53,7 +53,7 @@ public class BlockCubeGenerator extends AEBaseTileBlock } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { this.registerNoIcons(); } diff --git a/src/main/java/appeng/debug/BlockItemGen.java b/src/main/java/appeng/debug/BlockItemGen.java index 42f0d2c7..29eecbe1 100644 --- a/src/main/java/appeng/debug/BlockItemGen.java +++ b/src/main/java/appeng/debug/BlockItemGen.java @@ -39,7 +39,7 @@ public class BlockItemGen extends AEBaseTileBlock } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { this.registerNoIcons(); } diff --git a/src/main/java/appeng/debug/BlockPhantomNode.java b/src/main/java/appeng/debug/BlockPhantomNode.java index 6f5aa2ea..5fe75b34 100644 --- a/src/main/java/appeng/debug/BlockPhantomNode.java +++ b/src/main/java/appeng/debug/BlockPhantomNode.java @@ -41,15 +41,15 @@ public class BlockPhantomNode extends AEBaseTileBlock } @Override - public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ ) { - TilePhantomNode tpn = this.getTileEntity( w, x, y, z ); + final TilePhantomNode tpn = this.getTileEntity( w, x, y, z ); tpn.triggerCrashMode(); return true; } @Override - public void registerBlockIcons( IIconRegister iconRegistry ) + public void registerBlockIcons( final IIconRegister iconRegistry ) { this.registerNoIcons(); } diff --git a/src/main/java/appeng/debug/TileChunkLoader.java b/src/main/java/appeng/debug/TileChunkLoader.java index 4e956942..403a9fcb 100644 --- a/src/main/java/appeng/debug/TileChunkLoader.java +++ b/src/main/java/appeng/debug/TileChunkLoader.java @@ -66,11 +66,11 @@ public class TileChunkLoader extends AEBaseTile if( this.ct == null ) { - MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); + final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if( server != null ) { - List pl = server.getConfigurationManager().playerEntityList; - for( EntityPlayerMP p : pl ) + final List pl = server.getConfigurationManager().playerEntityList; + for( final EntityPlayerMP p : pl ) { p.addChatMessage( new ChatComponentText( "Can't chunk load.." ) ); } diff --git a/src/main/java/appeng/debug/TileCubeGenerator.java b/src/main/java/appeng/debug/TileCubeGenerator.java index 28faa487..f817643e 100644 --- a/src/main/java/appeng/debug/TileCubeGenerator.java +++ b/src/main/java/appeng/debug/TileCubeGenerator.java @@ -49,7 +49,7 @@ public class TileCubeGenerator extends AEBaseTile if( this.countdown % 20 == 0 ) { - for( EntityPlayer e : CommonHelper.proxy.getPlayers() ) + for( final EntityPlayer e : CommonHelper.proxy.getPlayers() ) { e.addChatMessage( new ChatComponentText( "Spawning in... " + ( this.countdown / 20 ) ) ); } @@ -66,10 +66,10 @@ public class TileCubeGenerator extends AEBaseTile { this.worldObj.setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.AIR_BLOCK, 0, 3 ); - Item i = this.is.getItem(); - int side = ForgeDirection.UP.ordinal(); + final Item i = this.is.getItem(); + final int side = ForgeDirection.UP.ordinal(); - int half = (int) Math.floor( this.size / 2 ); + final int half = (int) Math.floor( this.size / 2 ); for( int y = 0; y < this.size; y++ ) { @@ -83,11 +83,11 @@ public class TileCubeGenerator extends AEBaseTile } } - public void click( EntityPlayer player ) + public void click( final EntityPlayer player ) { if( Platform.isServer() ) { - ItemStack hand = player.inventory.getCurrentItem(); + final ItemStack hand = player.inventory.getCurrentItem(); this.who = player; if( hand == null ) diff --git a/src/main/java/appeng/debug/TileItemGen.java b/src/main/java/appeng/debug/TileItemGen.java index 631ea94e..77e99ada 100644 --- a/src/main/java/appeng/debug/TileItemGen.java +++ b/src/main/java/appeng/debug/TileItemGen.java @@ -41,9 +41,9 @@ public class TileItemGen extends AEBaseTile implements IInventory { if( POSSIBLE_ITEMS.isEmpty() ) { - for( Object obj : Item.itemRegistry ) + for( final Object obj : Item.itemRegistry ) { - Item mi = (Item) obj; + final Item mi = (Item) obj; if( mi != null ) { if( mi.isDamageable() ) @@ -55,7 +55,7 @@ public class TileItemGen extends AEBaseTile implements IInventory } else { - List list = new ArrayList(); + final List list = new ArrayList(); mi.getSubItems( mi, mi.getCreativeTab(), list ); POSSIBLE_ITEMS.addAll( list ); } @@ -71,7 +71,7 @@ public class TileItemGen extends AEBaseTile implements IInventory } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.getRandomItem(); } @@ -82,24 +82,24 @@ public class TileItemGen extends AEBaseTile implements IInventory } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { - ItemStack a = POSSIBLE_ITEMS.poll(); - ItemStack out = a.copy(); + final ItemStack a = POSSIBLE_ITEMS.poll(); + final ItemStack out = a.copy(); POSSIBLE_ITEMS.add( a ); return out; } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { - ItemStack a = POSSIBLE_ITEMS.poll(); + final ItemStack a = POSSIBLE_ITEMS.poll(); POSSIBLE_ITEMS.add( a ); } @@ -122,7 +122,7 @@ public class TileItemGen extends AEBaseTile implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -140,7 +140,7 @@ public class TileItemGen extends AEBaseTile implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return false; } diff --git a/src/main/java/appeng/debug/TilePhantomNode.java b/src/main/java/appeng/debug/TilePhantomNode.java index d9b0aa18..1fbcd3f3 100644 --- a/src/main/java/appeng/debug/TilePhantomNode.java +++ b/src/main/java/appeng/debug/TilePhantomNode.java @@ -35,7 +35,7 @@ public class TilePhantomNode extends AENetworkTile boolean crashMode = false; @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { if( !this.crashMode ) { diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index da802afa..5667cb67 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -60,7 +60,7 @@ public class ToolDebugCard extends AEBaseItem } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( Platform.isClient() ) { @@ -72,7 +72,7 @@ public class ToolDebugCard extends AEBaseItem int grids = 0; int totalNodes = 0; - for( Grid g : TickHandler.INSTANCE.getGridList() ) + for( final Grid g : TickHandler.INSTANCE.getGridList() ) { grids++; totalNodes += g.getNodes().size(); @@ -83,42 +83,42 @@ public class ToolDebugCard extends AEBaseItem } else { - TileEntity te = world.getTileEntity( x, y, z ); + final TileEntity te = world.getTileEntity( x, y, z ); if( te instanceof IGridHost ) { - GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) ); + final GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) ); if( node != null ) { - Grid g = node.getInternalGrid(); - IGridNode center = g.getPivot(); + final Grid g = node.getInternalGrid(); + final IGridNode center = g.getPivot(); this.outputMsg( player, "This Node: " + node.toString() ); this.outputMsg( player, "Center Node: " + center.toString() ); - IPathingGrid pg = g.getCache( IPathingGrid.class ); + final IPathingGrid pg = g.getCache( IPathingGrid.class ); if( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE ) { Set next = new HashSet(); next.add( node ); - int maxLength = 10000; + final int maxLength = 10000; int length = 0; outer: while( !next.isEmpty() ) { - Iterable current = next; + final Iterable current = next; next = new HashSet(); - for( IGridNode n : current ) + for( final IGridNode n : current ) { if( n.getMachine() instanceof TileController ) { break outer; } - for( IGridConnection c : n.getConnections() ) + for( final IGridConnection c : n.getConnections() ) { next.add( c.getOtherSide( n ) ); } @@ -140,12 +140,12 @@ public class ToolDebugCard extends AEBaseItem this.outputMsg( player, "Freq: " + ( (PartP2PTunnel) center.getMachine() ).freq ); } - TickManagerCache tmc = g.getCache( ITickManager.class ); - for( Class c : g.getMachineClasses() ) + final TickManagerCache tmc = g.getCache( ITickManager.class ); + for( final Class c : g.getMachineClasses() ) { int o = 0; long nanos = 0; - for( IGridNode oj : g.getMachines( c ) ) + for( final IGridNode oj : g.getMachines( c ) ) { o++; nanos += tmc.getAvgNanoTime( oj ); @@ -173,15 +173,15 @@ public class ToolDebugCard extends AEBaseItem if( te instanceof IPartHost ) { - IPart center = ( (IPartHost) te ).getPart( ForgeDirection.UNKNOWN ); + final IPart center = ( (IPartHost) te ).getPart( ForgeDirection.UNKNOWN ); ( (IPartHost) te ).markForUpdate(); if( center != null ) { - GridNode n = (GridNode) center.getGridNode(); + final GridNode n = (GridNode) center.getGridNode(); this.outputMsg( player, "Node Channels: " + n.usedChannels() ); - for( IGridConnection gc : n.getConnections() ) + for( final IGridConnection gc : n.getConnections() ) { - ForgeDirection fd = gc.getDirection( n ); + final ForgeDirection fd = gc.getDirection( n ); if( fd != ForgeDirection.UNKNOWN ) { this.outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() ); @@ -192,15 +192,15 @@ public class ToolDebugCard extends AEBaseItem if( te instanceof IAEPowerStorage ) { - IAEPowerStorage ps = (IAEPowerStorage) te; + final IAEPowerStorage ps = (IAEPowerStorage) te; this.outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() ); if( te instanceof IGridHost ) { - IGridNode node = ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) ); + final IGridNode node = ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) ); if( node != null && node.getGrid() != null ) { - IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class ); + final IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class ); this.outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) ); } } @@ -209,14 +209,14 @@ public class ToolDebugCard extends AEBaseItem return true; } - private void outputMsg( ICommandSender player, String string ) + private void outputMsg( final ICommandSender player, final String string ) { player.addChatMessage( new ChatComponentText( string ) ); } - public String timeMeasurement( long nanos ) + public String timeMeasurement( final long nanos ) { - long ms = nanos / 100000; + final long ms = nanos / 100000; if( nanos <= 100000 ) { return nanos + "ns"; diff --git a/src/main/java/appeng/debug/ToolEraser.java b/src/main/java/appeng/debug/ToolEraser.java index 411935d1..6133a683 100644 --- a/src/main/java/appeng/debug/ToolEraser.java +++ b/src/main/java/appeng/debug/ToolEraser.java @@ -49,21 +49,21 @@ public class ToolEraser extends AEBaseItem } @Override - public void registerIcons( IIconRegister par1IconRegister ) + public void registerIcons( final IIconRegister par1IconRegister ) { this.itemIcon = new MissingIcon( this ); } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( Platform.isClient() ) { return false; } - Block blk = world.getBlock( x, y, z ); - int meta = world.getBlockMetadata( x, y, z ); + final Block blk = world.getBlock( x, y, z ); + final int meta = world.getBlockMetadata( x, y, z ); List next = new LinkedList(); next.add( new WorldCoord( x, y, z ) ); @@ -71,13 +71,13 @@ public class ToolEraser extends AEBaseItem int blocks = 0; while( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() ) { - List c = next; + final List c = next; next = new LinkedList(); - for( WorldCoord wc : c ) + for( final WorldCoord wc : c ) { - Block c_blk = world.getBlock( wc.x, wc.y, wc.z ); - int c_meta = world.getBlockMetadata( wc.x, wc.y, wc.z ); + final Block c_blk = world.getBlock( wc.x, wc.y, wc.z ); + final int c_meta = world.getBlockMetadata( wc.x, wc.y, wc.z ); if( c_blk == blk && c_meta == meta ) { @@ -99,7 +99,7 @@ public class ToolEraser extends AEBaseItem return true; } - private void wrappedAdd( World world, int i, int y, int z, Collection next ) + private void wrappedAdd( final World world, final int i, final int y, final int z, final Collection next ) { next.add( new WorldCoord( i, y, z ) ); } diff --git a/src/main/java/appeng/debug/ToolMeteoritePlacer.java b/src/main/java/appeng/debug/ToolMeteoritePlacer.java index 6632ed78..b15761e9 100644 --- a/src/main/java/appeng/debug/ToolMeteoritePlacer.java +++ b/src/main/java/appeng/debug/ToolMeteoritePlacer.java @@ -43,21 +43,21 @@ public class ToolMeteoritePlacer extends AEBaseItem } @Override - public void registerIcons( IIconRegister par1IconRegister ) + public void registerIcons( final IIconRegister par1IconRegister ) { this.itemIcon = new MissingIcon( this ); } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( Platform.isClient() ) { return false; } - MeteoritePlacer mp = new MeteoritePlacer(); - boolean worked = mp.spawnMeteorite( new StandardWorld( world ), x, y, z ); + final MeteoritePlacer mp = new MeteoritePlacer(); + final boolean worked = mp.spawnMeteorite( new StandardWorld( world ), x, y, z ); if( !worked ) { diff --git a/src/main/java/appeng/debug/ToolReplicatorCard.java b/src/main/java/appeng/debug/ToolReplicatorCard.java index 70d56e2a..44d2d5d3 100644 --- a/src/main/java/appeng/debug/ToolReplicatorCard.java +++ b/src/main/java/appeng/debug/ToolReplicatorCard.java @@ -50,7 +50,7 @@ public class ToolReplicatorCard extends AEBaseItem } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, int x, int y, int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( Platform.isClient() ) { @@ -61,7 +61,7 @@ public class ToolReplicatorCard extends AEBaseItem { if( world.getTileEntity( x, y, z ) instanceof IGridHost ) { - NBTTagCompound tag = new NBTTagCompound(); + final NBTTagCompound tag = new NBTTagCompound(); tag.setInteger( "x", x ); tag.setInteger( "y", y ); tag.setInteger( "z", z ); @@ -76,49 +76,49 @@ public class ToolReplicatorCard extends AEBaseItem } else { - NBTTagCompound ish = stack.getTagCompound(); + final NBTTagCompound ish = stack.getTagCompound(); if( ish != null ) { - int src_x = ish.getInteger( "x" ); - int src_y = ish.getInteger( "y" ); - int src_z = ish.getInteger( "z" ); - int src_side = ish.getInteger( "side" ); - int dimid = ish.getInteger( "dimid" ); - World src_w = DimensionManager.getWorld( dimid ); + final int src_x = ish.getInteger( "x" ); + final int src_y = ish.getInteger( "y" ); + final int src_z = ish.getInteger( "z" ); + final int src_side = ish.getInteger( "side" ); + final int dimid = ish.getInteger( "dimid" ); + final World src_w = DimensionManager.getWorld( dimid ); - TileEntity te = src_w.getTileEntity( src_x, src_y, src_z ); + final TileEntity te = src_w.getTileEntity( src_x, src_y, src_z ); if( te instanceof IGridHost ) { - IGridHost gh = (IGridHost) te; - ForgeDirection sideOff = ForgeDirection.getOrientation( src_side ); - ForgeDirection currentSideOff = ForgeDirection.getOrientation( side ); - IGridNode n = gh.getGridNode( sideOff ); + final IGridHost gh = (IGridHost) te; + final ForgeDirection sideOff = ForgeDirection.getOrientation( src_side ); + final ForgeDirection currentSideOff = ForgeDirection.getOrientation( side ); + final IGridNode n = gh.getGridNode( sideOff ); if( n != null ) { - IGrid g = n.getGrid(); + final IGrid g = n.getGrid(); if( g != null ) { - ISpatialCache sc = g.getCache( ISpatialCache.class ); + final ISpatialCache sc = g.getCache( ISpatialCache.class ); if( sc.isValidRegion() ) { - DimensionalCoord min = sc.getMin(); - DimensionalCoord max = sc.getMax(); + final DimensionalCoord min = sc.getMin(); + final DimensionalCoord max = sc.getMax(); x += currentSideOff.offsetX; y += currentSideOff.offsetY; z += currentSideOff.offsetZ; - int min_x = min.x; - int min_y = min.y; - int min_z = min.z; + final int min_x = min.x; + final int min_y = min.y; + final int min_z = min.z; - int rel_x = min.x - src_x + x; - int rel_y = min.y - src_y + y; - int rel_z = min.z - src_z + z; + final int rel_x = min.x - src_x + x; + final int rel_y = min.y - src_y + y; + final int rel_z = min.z - src_z + z; - int scale_x = max.x - min.x; - int scale_y = max.y - min.y; - int scale_z = max.z - min.z; + final int scale_x = max.x - min.x; + final int scale_y = max.y - min.y; + final int scale_z = max.z - min.z; for( int i = 1; i < scale_x; i++ ) { @@ -126,15 +126,15 @@ public class ToolReplicatorCard extends AEBaseItem { for( int k = 1; k < scale_z; k++ ) { - Block blk = src_w.getBlock( min_x + i, min_y + j, min_z + k ); - int meta = src_w.getBlockMetadata( min_x + i, min_y + j, min_z + k ); + final Block blk = src_w.getBlock( min_x + i, min_y + j, min_z + k ); + final int meta = src_w.getBlockMetadata( min_x + i, min_y + j, min_z + k ); world.setBlock( i + rel_x, j + rel_y, k + rel_z, blk, meta, 4 ); if( blk != null && blk.hasTileEntity( meta ) ) { - TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k ); - TileEntity nte = blk.createTileEntity( world, meta ); - NBTTagCompound data = new NBTTagCompound(); + final TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k ); + final TileEntity nte = blk.createTileEntity( world, meta ); + final NBTTagCompound data = new NBTTagCompound(); ote.writeToNBT( data ); nte.readFromNBT( (NBTTagCompound) data.copy() ); world.setTileEntity( i + rel_x, j + rel_y, k + rel_z, nte ); @@ -172,7 +172,7 @@ public class ToolReplicatorCard extends AEBaseItem return true; } - private void outputMsg( ICommandSender player, String string ) + private void outputMsg( final ICommandSender player, final String string ) { player.addChatMessage( new ChatComponentText( string ) ); } diff --git a/src/main/java/appeng/entity/AEBaseEntityItem.java b/src/main/java/appeng/entity/AEBaseEntityItem.java index 516df06b..07e4c11c 100644 --- a/src/main/java/appeng/entity/AEBaseEntityItem.java +++ b/src/main/java/appeng/entity/AEBaseEntityItem.java @@ -30,18 +30,18 @@ import net.minecraft.world.World; public abstract class AEBaseEntityItem extends EntityItem { - public AEBaseEntityItem( World world ) + public AEBaseEntityItem( final World world ) { super( world ); } - public AEBaseEntityItem( World world, double x, double y, double z, ItemStack stack ) + public AEBaseEntityItem( final World world, final double x, final double y, final double z, final ItemStack stack ) { super( world, x, y, z, stack ); } @SuppressWarnings( "unchecked" ) - public List getCheckedEntitiesWithinAABBExcludingEntity( AxisAlignedBB region ) + public List getCheckedEntitiesWithinAABBExcludingEntity( final AxisAlignedBB region ) { return this.worldObj.getEntitiesWithinAABBExcludingEntity( this, region ); } diff --git a/src/main/java/appeng/entity/EntityChargedQuartz.java b/src/main/java/appeng/entity/EntityChargedQuartz.java index 9c8199f6..4f48866c 100644 --- a/src/main/java/appeng/entity/EntityChargedQuartz.java +++ b/src/main/java/appeng/entity/EntityChargedQuartz.java @@ -47,12 +47,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem int transformTime = 0; @Reflected - public EntityChargedQuartz( World w ) + public EntityChargedQuartz( final World w ) { super( w ); } - public EntityChargedQuartz( World w, double x, double y, double z, ItemStack is ) + public EntityChargedQuartz( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); } @@ -74,11 +74,11 @@ public final class EntityChargedQuartz extends AEBaseEntityItem } this.delay++; - int j = MathHelper.floor_double( this.posX ); - int i = MathHelper.floor_double( this.posY ); - int k = MathHelper.floor_double( this.posZ ); + final int j = MathHelper.floor_double( this.posX ); + final int i = MathHelper.floor_double( this.posY ); + final int k = MathHelper.floor_double( this.posZ ); - Material mat = this.worldObj.getBlock( j, i, k ).getMaterial(); + final Material mat = this.worldObj.getBlock( j, i, k ).getMaterial(); if( Platform.isServer() && mat.isLiquid() ) { this.transformTime++; @@ -98,22 +98,22 @@ public final class EntityChargedQuartz extends AEBaseEntityItem public boolean transform() { - ItemStack item = this.getEntityItem(); + final ItemStack item = this.getEntityItem(); final IMaterials materials = AEApi.instance().definitions().materials(); if( materials.certusQuartzCrystalCharged().isSameAs( item ) ) { - AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 ); - List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); + final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 ); + final List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); EntityItem redstone = null; EntityItem netherQuartz = null; - for( Entity e : l ) + for( final Entity e : l ) { if( e instanceof EntityItem && !e.isDead ) { - ItemStack other = ( (EntityItem) e ).getEntityItem(); + final ItemStack other = ( (EntityItem) e ).getEntityItem(); if( other != null && other.stackSize > 0 ) { if( Platform.isSameItem( other, new ItemStack( Items.redstone ) ) ) @@ -150,7 +150,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem netherQuartz.setDead(); } - for( ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() ) + for( final ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() ) { final EntityItem entity = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, fluixCrystalStack ); diff --git a/src/main/java/appeng/entity/EntityFloatingItem.java b/src/main/java/appeng/entity/EntityFloatingItem.java index a210e8d9..ff6c3cce 100644 --- a/src/main/java/appeng/entity/EntityFloatingItem.java +++ b/src/main/java/appeng/entity/EntityFloatingItem.java @@ -33,7 +33,7 @@ public final class EntityFloatingItem extends EntityItem int superDeath = 0; float progress = 0; - public EntityFloatingItem( Entity parent, World world, double x, double y, double z, ItemStack stack ) + public EntityFloatingItem( final Entity parent, final World world, final double x, final double y, final double z, final ItemStack stack ) { super( world, x, y, z, stack ); this.motionX = this.motionY = this.motionZ = 0.0d; @@ -61,7 +61,7 @@ public final class EntityFloatingItem extends EntityItem this.age = ageStatic; } - public void setProgress( float progress ) + public void setProgress( final float progress ) { this.progress = progress; if( this.progress > 0.99 ) diff --git a/src/main/java/appeng/entity/EntityGrowingCrystal.java b/src/main/java/appeng/entity/EntityGrowingCrystal.java index 7f3a90ea..15038e5b 100644 --- a/src/main/java/appeng/entity/EntityGrowingCrystal.java +++ b/src/main/java/appeng/entity/EntityGrowingCrystal.java @@ -42,12 +42,12 @@ public final class EntityGrowingCrystal extends EntityItem private int progress_1000 = 0; - public EntityGrowingCrystal( World w ) + public EntityGrowingCrystal( final World w ) { super( w ); } - public EntityGrowingCrystal( World w, double x, double y, double z, ItemStack is ) + public EntityGrowingCrystal( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); } @@ -67,23 +67,23 @@ public final class EntityGrowingCrystal extends EntityItem this.age = 100; } - ItemStack is = this.getEntityItem(); - Item gc = is.getItem(); + final ItemStack is = this.getEntityItem(); + final Item gc = is.getItem(); if( gc instanceof IGrowableCrystal ) // if it changes this just stops being an issue... { - int j = MathHelper.floor_double( this.posX ); - int i = MathHelper.floor_double( this.posY ); - int k = MathHelper.floor_double( this.posZ ); + final int j = MathHelper.floor_double( this.posX ); + final int i = MathHelper.floor_double( this.posY ); + final int k = MathHelper.floor_double( this.posZ ); - Block blk = this.worldObj.getBlock( j, i, k ); - Material mat = blk.getMaterial(); - IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); + final Block blk = this.worldObj.getBlock( j, i, k ); + final Material mat = blk.getMaterial(); + final IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); - float multiplier = cry.getMultiplier( blk, mat ); - int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier ); + final float multiplier = cry.getMultiplier( blk, mat ); + final int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier ); - boolean isClient = Platform.isClient(); + final boolean isClient = Platform.isClient(); if( mat.isLiquid() ) { @@ -152,7 +152,7 @@ public final class EntityGrowingCrystal extends EntityItem } } - private int getSpeed( int x, int y, int z ) + private int getSpeed( final int x, final int y, final int z ) { final int per = 80; final float mul = 0.3f; @@ -192,9 +192,9 @@ public final class EntityGrowingCrystal extends EntityItem return qty; } - private boolean isAccelerated( int x, int y, int z ) + private boolean isAccelerated( final int x, final int y, final int z ) { - TileEntity te = this.worldObj.getTileEntity( x, y, z ); + final TileEntity te = this.worldObj.getTileEntity( x, y, z ); return te instanceof ICrystalGrowthAccelerator && ( (ICrystalGrowthAccelerator) te ).isPowered(); } diff --git a/src/main/java/appeng/entity/EntityIds.java b/src/main/java/appeng/entity/EntityIds.java index 3acbc9a8..3c469421 100644 --- a/src/main/java/appeng/entity/EntityIds.java +++ b/src/main/java/appeng/entity/EntityIds.java @@ -33,7 +33,7 @@ public final class EntityIds { } - public static int get( Class droppedEntity ) + public static int get( final Class droppedEntity ) { if( droppedEntity == EntityTinyTNTPrimed.class ) { diff --git a/src/main/java/appeng/entity/EntitySingularity.java b/src/main/java/appeng/entity/EntitySingularity.java index 594a78e9..521fc893 100644 --- a/src/main/java/appeng/entity/EntitySingularity.java +++ b/src/main/java/appeng/entity/EntitySingularity.java @@ -45,18 +45,18 @@ public final class EntitySingularity extends AEBaseEntityItem private static int randTickSeed = 0; @Reflected - public EntitySingularity( World w ) + public EntitySingularity( final World w ) { super( w ); } - public EntitySingularity( World w, double x, double y, double z, ItemStack is ) + public EntitySingularity( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); } @Override - public boolean attackEntityFrom( DamageSource src, float dmg ) + public boolean attackEntityFrom( final DamageSource src, final float dmg ) { if( src.isExplosion() ) { @@ -79,24 +79,24 @@ public final class EntitySingularity extends AEBaseEntityItem return; } - ItemStack item = this.getEntityItem(); + final ItemStack item = this.getEntityItem(); final IMaterials materials = AEApi.instance().definitions().materials(); if( materials.singularity().isSameAs( item ) ) { - AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 ); - List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); + final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 ); + final List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); - for( Entity e : l ) + for( final Entity e : l ) { if( e instanceof EntityItem ) { - ItemStack other = ( (EntityItem) e ).getEntityItem(); + final ItemStack other = ( (EntityItem) e ).getEntityItem(); if( other != null ) { boolean matches = false; - for( ItemStack is : OreDictionary.getOres( "dustEnder" ) ) + for( final ItemStack is : OreDictionary.getOres( "dustEnder" ) ) { if( OreDictionary.itemMatches( other, is, false ) ) { @@ -108,7 +108,7 @@ public final class EntitySingularity extends AEBaseEntityItem // check... other name. if( !matches ) { - for( ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) ) + for( final ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) ) { if( OreDictionary.itemMatches( other, is, false ) ) { @@ -128,9 +128,9 @@ public final class EntitySingularity extends AEBaseEntityItem e.setDead(); } - for( ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() ) + for( final ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() ) { - NBTTagCompound cmp = Platform.openNbtData( singularityStack ); + final NBTTagCompound cmp = Platform.openNbtData( singularityStack ); cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 ); randTickSeed++; item.stackSize--; diff --git a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java index 28ae9202..4a162cd4 100644 --- a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java @@ -47,13 +47,13 @@ import appeng.util.Platform; public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData { @Reflected - public EntityTinyTNTPrimed( World w ) + public EntityTinyTNTPrimed( final World w ) { super( w ); this.setSize( 0.35F, 0.35F ); } - public EntityTinyTNTPrimed( World w, double x, double y, double z, EntityLivingBase igniter ) + public EntityTinyTNTPrimed( final World w, final double x, final double y, final double z, final EntityLivingBase igniter ) { super( w, x, y, z, igniter ); this.setSize( 0.55F, 0.55F ); @@ -86,7 +86,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if( this.isInWater() && Platform.isServer() ) // put out the fuse. { - for( ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() ) + for( final ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() ) { final EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, tntStack ); @@ -128,7 +128,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit return; } - for( Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.getBoundingBox( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) ) + for( final Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.getBoundingBox( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) ) { if( e instanceof Entity ) { @@ -139,7 +139,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if( AEConfig.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) ) { this.posY -= 0.25; - Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f ); + final Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f ); for( int x = (int) ( this.posX - 2 ); x <= this.posX + 2; x++ ) { @@ -147,12 +147,12 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit { for( int z = (int) ( this.posZ - 2 ); z <= this.posZ + 2; z++ ) { - Block block = this.worldObj.getBlock( x, y, z ); + final Block block = this.worldObj.getBlock( x, y, z ); if( block != null && !block.isAir( this.worldObj, x, y, z ) ) { float strength = (float) ( 2.3f - ( ( ( x + 0.5f ) - this.posX ) * ( ( x + 0.5f ) - this.posX ) + ( ( y + 0.5f ) - this.posY ) * ( ( y + 0.5f ) - this.posY ) + ( ( z + 0.5f ) - this.posZ ) * ( ( z + 0.5f ) - this.posZ ) ) ); - float resistance = block.getExplosionResistance( this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ ); + final float resistance = block.getExplosionResistance( this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ ); strength -= ( resistance + 0.3F ) * 0.11f; if( strength > 0.01 ) @@ -177,13 +177,13 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit } @Override - public void writeSpawnData( ByteBuf data ) + public void writeSpawnData( final ByteBuf data ) { data.writeByte( this.fuse ); } @Override - public void readSpawnData( ByteBuf data ) + public void readSpawnData( final ByteBuf data ) { this.fuse = data.readByte(); } diff --git a/src/main/java/appeng/entity/RenderFloatingItem.java b/src/main/java/appeng/entity/RenderFloatingItem.java index b1f76713..d46df9ca 100644 --- a/src/main/java/appeng/entity/RenderFloatingItem.java +++ b/src/main/java/appeng/entity/RenderFloatingItem.java @@ -46,11 +46,11 @@ public class RenderFloatingItem extends RenderItem } @Override - public void doRender( EntityItem entityItem, double x, double y, double z, float yaw, float partialTick ) + public void doRender( final EntityItem entityItem, final double x, final double y, final double z, final float yaw, final float partialTick ) { if( entityItem instanceof EntityFloatingItem ) { - EntityFloatingItem efi = (EntityFloatingItem) entityItem; + final EntityFloatingItem efi = (EntityFloatingItem) entityItem; if( efi.progress > 0.0 ) { GL11.glPushMatrix(); diff --git a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java index 87416125..31e7969f 100644 --- a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java @@ -46,12 +46,12 @@ public class RenderTinyTNTPrimed extends Render } @Override - public void doRender( Entity tnt, double x, double y, double z, float unused, float life ) + public void doRender( final Entity tnt, final double x, final double y, final double z, final float unused, final float life ) { this.renderPrimedTNT( (EntityTinyTNTPrimed) tnt, x, y, z, life ); } - public void renderPrimedTNT( EntityTinyTNTPrimed tnt, double x, double y, double z, float life ) + public void renderPrimedTNT( final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float life ) { GL11.glPushMatrix(); GL11.glTranslatef( (float) x, (float) y - 0.25f, (float) z ); @@ -73,7 +73,7 @@ public class RenderTinyTNTPrimed extends Render f2 *= f2; f2 *= f2; - float f3 = 1.0F + f2 * 0.3F; + final float f3 = 1.0F + f2 * 0.3F; GL11.glScalef( f3, f3, f3 ); } @@ -100,7 +100,7 @@ public class RenderTinyTNTPrimed extends Render } @Override - protected ResourceLocation getEntityTexture( Entity entity ) + protected ResourceLocation getEntityTexture( final Entity entity ) { return TextureMap.locationBlocksTexture; } diff --git a/src/main/java/appeng/facade/FacadeContainer.java b/src/main/java/appeng/facade/FacadeContainer.java index 93747730..682532e6 100644 --- a/src/main/java/appeng/facade/FacadeContainer.java +++ b/src/main/java/appeng/facade/FacadeContainer.java @@ -46,13 +46,13 @@ public class FacadeContainer implements IFacadeContainer final int facades = 6; final CableBusStorage storage; - public FacadeContainer( CableBusStorage cbs ) + public FacadeContainer( final CableBusStorage cbs ) { this.storage = cbs; } @Override - public boolean addFacade( IFacadePart a ) + public boolean addFacade( final IFacadePart a ) { if( this.getFacade( a.getSide() ) == null ) { @@ -63,7 +63,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void removeFacade( IPartHost host, ForgeDirection side ) + public void removeFacade( final IPartHost host, final ForgeDirection side ) { if( side != null && side != ForgeDirection.UNKNOWN ) { @@ -79,7 +79,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public IFacadePart getFacade( ForgeDirection s ) + public IFacadePart getFacade( final ForgeDirection s ) { return this.storage.getFacade( s.ordinal() ); } @@ -87,7 +87,7 @@ public class FacadeContainer implements IFacadeContainer @Override public void rotateLeft() { - IFacadePart[] newFacades = new FacadePart[6]; + final IFacadePart[] newFacades = new FacadePart[6]; newFacades[ForgeDirection.UP.ordinal()] = this.storage.getFacade( ForgeDirection.UP.ordinal() ); newFacades[ForgeDirection.DOWN.ordinal()] = this.storage.getFacade( ForgeDirection.DOWN.ordinal() ); @@ -105,13 +105,13 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void writeToNBT( NBTTagCompound c ) + public void writeToNBT( final NBTTagCompound c ) { for( int x = 0; x < this.facades; x++ ) { if( this.storage.getFacade( x ) != null ) { - NBTTagCompound data = new NBTTagCompound(); + final NBTTagCompound data = new NBTTagCompound(); this.storage.getFacade( x ).getItemStack().writeToNBT( data ); c.setTag( "facade:" + x, data ); } @@ -119,22 +119,22 @@ public class FacadeContainer implements IFacadeContainer } @Override - public boolean readFromStream( ByteBuf out ) throws IOException + public boolean readFromStream( final ByteBuf out ) throws IOException { - int facadeSides = out.readByte(); + final int facadeSides = out.readByte(); boolean changed = false; - int[] ids = new int[2]; + final int[] ids = new int[2]; for( int x = 0; x < this.facades; x++ ) { - ForgeDirection side = ForgeDirection.getOrientation( x ); - int ix = ( 1 << x ); + final ForgeDirection side = ForgeDirection.getOrientation( x ); + final int ix = ( 1 << x ); if( ( facadeSides & ix ) == ix ) { ids[0] = out.readInt(); ids[1] = out.readInt(); - boolean isBC = ids[0] < 0; + final boolean isBC = ids[0] < 0; ids[0] = Math.abs( ids[0] ); if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) @@ -147,10 +147,10 @@ public class FacadeContainer implements IFacadeContainer } else if( !isBC ) { - for( Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet() ) + for( final Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet() ) { - ItemFacade ifa = (ItemFacade) facadeItem; - ItemStack facade = ifa.createFromIDs( ids ); + final ItemFacade ifa = (ItemFacade) facadeItem; + final ItemStack facade = ifa.createFromIDs( ids ); if( facade != null ) { changed = changed || this.storage.getFacade( x ) == null; @@ -170,19 +170,19 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void readFromNBT( NBTTagCompound c ) + public void readFromNBT( final NBTTagCompound c ) { for( int x = 0; x < this.facades; x++ ) { this.storage.setFacade( x, null ); - NBTTagCompound t = c.getCompoundTag( "facade:" + x ); + final NBTTagCompound t = c.getCompoundTag( "facade:" + x ); if( t != null ) { - ItemStack is = ItemStack.loadItemStackFromNBT( t ); + final ItemStack is = ItemStack.loadItemStackFromNBT( t ); if( is != null ) { - Item i = is.getItem(); + final Item i = is.getItem(); if( i instanceof IFacadeItem ) { this.storage.setFacade( x, ( (IFacadeItem) i ).createPartFromItemStack( is, ForgeDirection.getOrientation( x ) ) ); @@ -204,7 +204,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void writeToStream( ByteBuf out ) throws IOException + public void writeToStream( final ByteBuf out ) throws IOException { int facadeSides = 0; for( int x = 0; x < this.facades; x++ ) @@ -218,11 +218,11 @@ public class FacadeContainer implements IFacadeContainer for( int x = 0; x < this.facades; x++ ) { - IFacadePart part = this.getFacade( ForgeDirection.getOrientation( x ) ); + final IFacadePart part = this.getFacade( ForgeDirection.getOrientation( x ) ); if( part != null ) { - int itemID = Item.getIdFromItem( part.getItem() ); - int dmgValue = part.getItemDamage(); + final int itemID = Item.getIdFromItem( part.getItem() ); + final int dmgValue = part.getItemDamage(); out.writeInt( itemID * ( part.notAEFacade() ? -1 : 1 ) ); out.writeInt( dmgValue ); } diff --git a/src/main/java/appeng/facade/FacadePart.java b/src/main/java/appeng/facade/FacadePart.java index a3c75b55..5e5965ec 100644 --- a/src/main/java/appeng/facade/FacadePart.java +++ b/src/main/java/appeng/facade/FacadePart.java @@ -69,7 +69,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @SideOnly( Side.CLIENT ) ISimplifiedBundle prevLight; - public FacadePart( ItemStack facade, ForgeDirection side ) + public FacadePart( final ItemStack facade, final ForgeDirection side ) { if( facade == null ) { @@ -80,7 +80,7 @@ public class FacadePart implements IFacadePart, IBoxProvider this.side = side; } - public static boolean isFacade( ItemStack is ) + public static boolean isFacade( final ItemStack is ) { return is.getItem() instanceof IFacadeItem; } @@ -92,7 +92,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void getBoxes( IPartCollisionHelper ch, Entity e ) + public void getBoxes( final IPartCollisionHelper ch, final Entity e ) { if( e instanceof EntityLivingBase ) { @@ -108,15 +108,15 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper instance2, final RenderBlocks renderer, final IFacadeContainer fc, final AxisAlignedBB busBounds, final boolean renderStilt ) { if( this.facade != null ) { - BusRenderHelper instance = (BusRenderHelper) instance2; + final BusRenderHelper instance = (BusRenderHelper) instance2; try { - ItemStack randomItem = this.getTexture(); + final ItemStack randomItem = this.getTexture(); RenderBlocksWorkaround rbw = null; if( renderer instanceof RenderBlocksWorkaround ) @@ -135,7 +135,7 @@ public class FacadePart implements IFacadePart, IBoxProvider IIcon myIcon = null; if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { - IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); myIcon = bc.getCobbleStructurePipeTexture(); } @@ -163,8 +163,8 @@ public class FacadePart implements IFacadePart, IBoxProvider { if( randomItem.getItem() instanceof ItemBlock ) { - ItemBlock ib = (ItemBlock) randomItem.getItem(); - Block blk = Block.getBlockFromItem( ib ); + final ItemBlock ib = (ItemBlock) randomItem.getItem(); + final Block blk = Block.getBlockFromItem( ib ); if( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) { @@ -188,7 +188,7 @@ public class FacadePart implements IFacadePart, IBoxProvider { color = ib.getColorFromItemStack( randomItem, 0 ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -337,7 +337,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -346,17 +346,17 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper instance, final RenderBlocks renderer ) { if( this.facade != null ) { - IFacadeItem fi = (IFacadeItem) this.facade.getItem(); + final IFacadeItem fi = (IFacadeItem) this.facade.getItem(); try { if( fi != null ) { - ItemStack randomItem = fi.getTextureItem( this.facade ); + final ItemStack randomItem = fi.getTextureItem( this.facade ); instance.setTexture( this.facade.getIconIndex() ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); @@ -367,16 +367,16 @@ public class FacadePart implements IFacadePart, IBoxProvider { if( randomItem.getItem() instanceof ItemBlock ) { - ItemBlock ib = (ItemBlock) randomItem.getItem(); - Block blk = Block.getBlockFromItem( ib ); + final ItemBlock ib = (ItemBlock) randomItem.getItem(); + final Block blk = Block.getBlockFromItem( ib ); try { - int color = ib.getColorFromItemStack( randomItem, 0 ); + final int color = ib.getColorFromItemStack( randomItem, 0 ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F ); instance.setInvColor( color ); } - catch( Throwable error ) + catch( final Throwable error ) { GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F ); instance.setInvColor( 0xffffff ); @@ -394,7 +394,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } } } - catch( Exception ignored ) + catch( final Exception ignored ) { } @@ -416,7 +416,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public Item getItem() { - ItemStack is = this.getTexture(); + final ItemStack is = this.getTexture(); if( is == null ) { return null; @@ -427,7 +427,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public int getItemDamage() { - ItemStack is = this.getTexture(); + final ItemStack is = this.getTexture(); if( is == null ) { return 0; @@ -442,7 +442,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void setThinFacades( boolean useThinFacades ) + public void setThinFacades( final boolean useThinFacades ) { this.thickness = useThinFacades ? 1 : 2; } @@ -455,8 +455,8 @@ public class FacadePart implements IFacadePart, IBoxProvider return true; } - ItemStack is = this.getTexture(); - Block blk = Block.getBlockFromItem( is.getItem() ); + final ItemStack is = this.getTexture(); + final Block blk = Block.getBlockFromItem( is.getItem() ); return !blk.isOpaqueCube(); } @@ -469,7 +469,7 @@ public class FacadePart implements IFacadePart, IBoxProvider // AE Facade if( maybeFacade instanceof IFacadeItem ) { - IFacadeItem facade = (IFacadeItem) maybeFacade; + final IFacadeItem facade = (IFacadeItem) maybeFacade; return facade.getTextureItem( this.facade ); } @@ -483,12 +483,12 @@ public class FacadePart implements IFacadePart, IBoxProvider return null; } - private EnumSet calculateFaceOpenFaces( IBlockAccess blockAccess, IFacadeContainer fc, int x, int y, int z, ForgeDirection side ) + private EnumSet calculateFaceOpenFaces( final IBlockAccess blockAccess, final IFacadeContainer fc, final int x, final int y, final int z, final ForgeDirection side ) { - EnumSet out = EnumSet.of( side, side.getOpposite() ); - IFacadePart facade = fc.getFacade( side ); + final EnumSet out = EnumSet.of( side, side.getOpposite() ); + final IFacadePart facade = fc.getFacade( side ); - for( ForgeDirection it : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection it : ForgeDirection.VALID_DIRECTIONS ) { if( !out.contains( it ) && this.hasAlphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) ) { @@ -498,7 +498,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( ForgeDirection.UP ) && ( side.offsetX != 0 || side.offsetZ != 0 ) ) { - IFacadePart fp = fc.getFacade( ForgeDirection.UP ); + final IFacadePart fp = fc.getFacade( ForgeDirection.UP ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( ForgeDirection.UP ); @@ -507,7 +507,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( ForgeDirection.DOWN ) && ( side.offsetX != 0 || side.offsetZ != 0 ) ) { - IFacadePart fp = fc.getFacade( ForgeDirection.DOWN ); + final IFacadePart fp = fc.getFacade( ForgeDirection.DOWN ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( ForgeDirection.DOWN ); @@ -516,7 +516,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( ForgeDirection.SOUTH ) && ( side.offsetX != 0 ) ) { - IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH ); + final IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( ForgeDirection.SOUTH ); @@ -525,7 +525,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( ForgeDirection.NORTH ) && ( side.offsetX != 0 ) ) { - IFacadePart fp = fc.getFacade( ForgeDirection.NORTH ); + final IFacadePart fp = fc.getFacade( ForgeDirection.NORTH ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( ForgeDirection.NORTH ); @@ -556,14 +556,14 @@ public class FacadePart implements IFacadePart, IBoxProvider } @SideOnly( Side.CLIENT ) - private void renderSegmentBlockCurrentBounds( IPartRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ ) + private void renderSegmentBlockCurrentBounds( final IPartRenderHelper instance, final int x, final int y, final int z, final RenderBlocks renderer, final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ ) { - double oldMinX = renderer.renderMinX; - double oldMinY = renderer.renderMinY; - double oldMinZ = renderer.renderMinZ; - double oldMaxX = renderer.renderMaxX; - double oldMaxY = renderer.renderMaxY; - double oldMaxZ = renderer.renderMaxZ; + final double oldMinX = renderer.renderMinX; + final double oldMinY = renderer.renderMinY; + final double oldMinZ = renderer.renderMinZ; + final double oldMaxX = renderer.renderMaxX; + final double oldMaxY = renderer.renderMaxY; + final double oldMaxZ = renderer.renderMaxZ; renderer.renderMinX = Math.max( renderer.renderMinX, minX ); renderer.renderMinY = Math.max( renderer.renderMinY, minY ); @@ -586,12 +586,12 @@ public class FacadePart implements IFacadePart, IBoxProvider renderer.renderMaxZ = oldMaxZ; } - private boolean hasAlphaDiff( TileEntity tileEntity, ForgeDirection side, IFacadePart facade ) + private boolean hasAlphaDiff( final TileEntity tileEntity, final ForgeDirection side, final IFacadePart facade ) { if( tileEntity instanceof IPartHost ) { - IPartHost ph = (IPartHost) tileEntity; - IFacadePart fp = ph.getFacadeContainer().getFacade( side ); + final IPartHost ph = (IPartHost) tileEntity; + final IFacadePart fp = ph.getFacadeContainer().getFacade( side ); return fp == null || ( fp.isTransparent() != facade.isTransparent() ); } @@ -600,7 +600,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { this.getBoxes( bch, null ); } diff --git a/src/main/java/appeng/fmp/CableBusPart.java b/src/main/java/appeng/fmp/CableBusPart.java index 4283cf69..2ef20ea9 100644 --- a/src/main/java/appeng/fmp/CableBusPart.java +++ b/src/main/java/appeng/fmp/CableBusPart.java @@ -122,7 +122,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask boolean canUpdate = false; @Override - public boolean recolourBlock( ForgeDirection side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor colour, final EntityPlayer who ) { return this.cb.recolourBlock( side, colour, who ); } @@ -132,7 +132,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask { AxisAlignedBB b = null; - for( AxisAlignedBB bx : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) ) + for( final AxisAlignedBB bx : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) ) { if( b == null ) { @@ -140,12 +140,12 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } else { - double minX = Math.min( b.minX, bx.minX ); - double minY = Math.min( b.minY, bx.minY ); - double minZ = Math.min( b.minZ, bx.minZ ); - double maxX = Math.max( b.maxX, bx.maxX ); - double maxY = Math.max( b.maxY, bx.maxY ); - double maxZ = Math.max( b.maxZ, bx.maxZ ); + final double minX = Math.min( b.minX, bx.minX ); + final double minY = Math.min( b.minY, bx.minY ); + final double minZ = Math.min( b.minZ, bx.minZ ); + final double maxX = Math.max( b.maxX, bx.maxX ); + final double maxY = Math.max( b.maxY, bx.maxY ); + final double maxZ = Math.max( b.maxZ, bx.maxZ ); b.setBounds( minX, minY, minZ, maxX, maxY, maxZ ); } } @@ -179,13 +179,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public boolean occlusionTest( TMultiPart part ) + public boolean occlusionTest( final TMultiPart part ) { return NormalOcclusionTest.apply( this, part ); } @Override - public boolean renderStatic( Vector3 pos, int pass ) + public boolean renderStatic( final Vector3 pos, final int pass ) { if( pass == 0 || ( pass == 1 && AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) ) ) { @@ -200,7 +200,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public void renderDynamic( Vector3 pos, float frame, int pass ) + public void renderDynamic( final Vector3 pos, final float frame, final int pass ) { if( pass == 0 || ( pass == 1 && AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) ) ) { @@ -210,25 +210,25 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public void onPartChanged( TMultiPart part ) + public void onPartChanged( final TMultiPart part ) { this.cb.updateConnections(); } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { this.cb.onEntityCollision( entity ); } @Override - public boolean activate( EntityPlayer player, MovingObjectPosition hit, ItemStack item ) + public boolean activate( final EntityPlayer player, final MovingObjectPosition hit, final ItemStack item ) { return this.cb.activate( player, hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ) ); } @Override - public void load( NBTTagCompound tag ) + public void load( final NBTTagCompound tag ) { this.cb.readFromNBT( tag ); } @@ -241,15 +241,15 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public void save( NBTTagCompound tag ) + public void save( final NBTTagCompound tag ) { this.cb.writeToNBT( tag ); } @Override - public void writeDesc( MCDataOutput packet ) + public void writeDesc( final MCDataOutput packet ) { - ByteBuf stream = Unpooled.buffer(); + final ByteBuf stream = Unpooled.buffer(); try { @@ -258,17 +258,17 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask stream.capacity( stream.readableBytes() ); packet.writeByteArray( stream.array() ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - public ItemStack pickItem( MovingObjectPosition hit ) + public ItemStack pickItem( final MovingObjectPosition hit ) { - Vec3 v3 = hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ); - SelectedPart sp = this.cb.selectPart( v3 ); + final Vec3 v3 = hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ); + final SelectedPart sp = this.cb.selectPart( v3 ); if( sp != null ) { if( sp.part != null ) @@ -308,54 +308,54 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public void readDesc( MCDataInput packet ) + public void readDesc( final MCDataInput packet ) { - int len = packet.readInt(); - byte[] data = packet.readByteArray( len ); + final int len = packet.readInt(); + final byte[] data = packet.readByteArray( len ); try { if( len > 0 ) { - ByteBuf byteBuffer = Unpooled.wrappedBuffer( data ); + final ByteBuf byteBuffer = Unpooled.wrappedBuffer( data ); this.cb.readFromStream( byteBuffer ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - public boolean canConnectRedstone( int side ) + public boolean canConnectRedstone( final int side ) { return this.cb.canConnectRedstone( EnumSet.of( ForgeDirection.getOrientation( side ) ) ); } @Override - public int weakPowerLevel( int side ) + public int weakPowerLevel( final int side ) { return this.cb.isProvidingWeakPower( ForgeDirection.getOrientation( side ) ); } @Override - public int strongPowerLevel( int side ) + public int strongPowerLevel( final int side ) { return this.cb.isProvidingStrongPower( ForgeDirection.getOrientation( side ) ); } - public void convertFromTile( TileEntity blockTileEntity ) + public void convertFromTile( final TileEntity blockTileEntity ) { - TileCableBus tcb = (TileCableBus) blockTileEntity; + final TileCableBus tcb = (TileCableBus) blockTileEntity; this.cb = tcb.cb; } @Override public Iterable getOcclusionBoxes() { - LinkedList l = new LinkedList(); - for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( true, DISABLE_FACADE_OCCLUSION.get() == null, null, true ) ) + final LinkedList l = new LinkedList(); + for( final AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( true, DISABLE_FACADE_OCCLUSION.get() == null, null, true ) ) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -363,13 +363,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.cb.getGridNode( dir ); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return this.cb.getCableConnectionType( dir ); } @@ -381,20 +381,20 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } // @Override - public int getHollowSize( int side ) + public int getHollowSize( final int side ) { - IPartCable cable = (IPartCable) this.getPart( ForgeDirection.UNKNOWN ); + final IPartCable cable = (IPartCable) this.getPart( ForgeDirection.UNKNOWN ); - ForgeDirection dir = ForgeDirection.getOrientation( side ); + final ForgeDirection dir = ForgeDirection.getOrientation( side ); if( cable != null && cable.isConnected( dir ) ) { - List boxes = new ArrayList(); + final List boxes = new ArrayList(); - BusCollisionHelper bch = new BusCollisionHelper( boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true ); + final BusCollisionHelper bch = new BusCollisionHelper( boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true ); - for( ForgeDirection whichSide : ForgeDirection.values() ) + for( final ForgeDirection whichSide : ForgeDirection.values() ) { - IPart fPart = this.getPart( whichSide ); + final IPart fPart = this.getPart( whichSide ); if( fPart != null ) { @@ -403,9 +403,9 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } AxisAlignedBB b = null; - AxisAlignedBB pb = Platform.getPrimaryBox( dir, 2 ); + final AxisAlignedBB pb = Platform.getPrimaryBox( dir, 2 ); - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { if( bb.intersectsWith( pb ) ) { @@ -448,7 +448,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask return 12; } - int getSize( double a, double b, double c, double d ) + int getSize( final double a, final double b, final double c, final double d ) { double r = Math.abs( a - 0.5 ); r = Math.max( Math.abs( b - 0.5 ), r ); @@ -461,7 +461,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask { int mask = 0; - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { if( this.getPart( side ) != null ) { @@ -483,20 +483,20 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public boolean canAddPart( ItemStack is, ForgeDirection side ) + public boolean canAddPart( ItemStack is, final ForgeDirection side ) { - IFacadePart fp = PartPlacement.isFacade( is, side ); + final IFacadePart fp = PartPlacement.isFacade( is, side ); if( fp != null ) { if( !( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) ) { - List boxes = new ArrayList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final List boxes = new ArrayList(); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); fp.getBoxes( bch, null ); - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { DISABLE_FACADE_OCCLUSION.set( true ); - boolean canAdd = this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ); + final boolean canAdd = this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ); DISABLE_FACADE_OCCLUSION.remove(); if( !canAdd ) { @@ -509,7 +509,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask if( is.getItem() instanceof IPartItem ) { - IPartItem bi = (IPartItem) is.getItem(); + final IPartItem bi = (IPartItem) is.getItem(); is = is.copy(); is.stackSize = 1; @@ -517,13 +517,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask final IPart bp = bi.createPartFromItemStack( is ); if( !( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) ) { - List boxes = new ArrayList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final List boxes = new ArrayList(); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); if( bp != null ) { bp.getBoxes( bch ); } - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { if( !this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) ) { @@ -537,19 +537,19 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner ) + public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner ) { return this.cb.addPart( is, side, owner ); } @Override - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { return this.cb.getPart( side ); } @Override - public void removePart( ForgeDirection side, boolean suppressUpdate ) + public void removePart( final ForgeDirection side, final boolean suppressUpdate ) { this.cb.removePart( side, suppressUpdate ); } @@ -582,7 +582,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public boolean isBlocked( ForgeDirection side ) + public boolean isBlocked( final ForgeDirection side ) { if( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) { @@ -594,14 +594,14 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask final int ordinal = side.ordinal(); final Cuboid6 sideTest = SIDE_TESTS[ordinal]; final NormallyOccludedPart occludedPart = new NormallyOccludedPart( sideTest ); - boolean blocked = !this.tile().canAddPart( occludedPart ); + final boolean blocked = !this.tile().canAddPart( occludedPart ); DISABLE_FACADE_OCCLUSION.remove(); return blocked; } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { return this.cb.selectPart( pos ); } @@ -610,7 +610,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask public void markForSave() { // mark the chunk for save... - TileEntity te = this.tile(); + final TileEntity te = this.tile(); if( te != null && te.getWorldObj() != null ) { te.getWorldObj().getChunkFromBlockCoords( this.x(), this.z() ).isModified = true; @@ -627,7 +627,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public boolean hasRedstone( ForgeDirection side ) + public boolean hasRedstone( final ForgeDirection side ) { return this.cb.hasRedstone( side ); } @@ -673,8 +673,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask @Override public Iterable getCollisionBoxes() { - LinkedList l = new LinkedList(); - for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) ) + final LinkedList l = new LinkedList(); + for( final AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) ) { l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) ); } @@ -684,8 +684,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask @Override public Iterable getSubParts() { - LinkedList l = new LinkedList(); - for( Cuboid6 c : this.getCollisionBoxes() ) + final LinkedList l = new LinkedList(); + for( final Cuboid6 c : this.getCollisionBoxes() ) { l.add( new IndexedCuboid6( 0, c ) ); } @@ -693,7 +693,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask } @Override - public int getConnectionMask( int side ) + public int getConnectionMask( final int side ) { return CONNECTION_MASK; } diff --git a/src/main/java/appeng/fmp/FMPEvent.java b/src/main/java/appeng/fmp/FMPEvent.java index 0521f7b4..c396c467 100644 --- a/src/main/java/appeng/fmp/FMPEvent.java +++ b/src/main/java/appeng/fmp/FMPEvent.java @@ -55,21 +55,21 @@ public class FMPEvent private final ThreadLocal placing = new ThreadLocal(); @SubscribeEvent - public void ServerFMPEvent( FMPPacketEvent event ) + public void ServerFMPEvent( final FMPPacketEvent event ) { FMPEvent.place( event.sender, event.sender.worldObj ); } - public static boolean place( EntityPlayer player, World world ) + public static boolean place( final EntityPlayer player, final World world ) { - MovingObjectPosition hit = RayTracer.reTrace( world, player ); + final MovingObjectPosition hit = RayTracer.reTrace( world, player ); if( hit == null ) { return false; } - BlockCoord pos = new BlockCoord( hit.blockX, hit.blockY, hit.blockZ ).offset( hit.sideHit ); - ItemStack held = player.getHeldItem(); + final BlockCoord pos = new BlockCoord( hit.blockX, hit.blockY, hit.blockZ ).offset( hit.sideHit ); + final ItemStack held = player.getHeldItem(); if( held == null ) { @@ -80,7 +80,7 @@ public class FMPEvent TMultiPart part = null; if( held.getItem() instanceof AEBaseItemBlock ) { - AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem(); + final AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem(); blk = Block.getBlockFromItem( ib ); part = PartRegistry.getPartByBlock( blk, hit.sideHit ); } @@ -93,8 +93,8 @@ public class FMPEvent if( world.isRemote && !player.isSneaking() )// attempt to use block activated like normal and tell the server // the right stuff { - Vector3 f = new Vector3( hit.hitVec ).add( -hit.blockX, -hit.blockY, -hit.blockZ ); - Block block = world.getBlock( hit.blockX, hit.blockY, hit.blockZ ); + final Vector3 f = new Vector3( hit.hitVec ).add( -hit.blockX, -hit.blockY, -hit.blockZ ); + final Block block = world.getBlock( hit.blockX, hit.blockY, hit.blockZ ); if( block != null && !ignoreActivate( block ) && block.onBlockActivated( world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float) f.x, (float) f.y, (float) f.z ) ) { player.swingItem(); @@ -103,7 +103,7 @@ public class FMPEvent } } - TileMultipart tile = TileMultipart.getOrConvertTile( world, pos ); + final TileMultipart tile = TileMultipart.getOrConvertTile( world, pos ); if( tile == null || !tile.canAddPart( part ) ) { return false; @@ -134,7 +134,7 @@ public class FMPEvent /** * Because vanilla is weird. */ - private static boolean ignoreActivate( Block block ) + private static boolean ignoreActivate( final Block block ) { if( block instanceof BlockFence ) { @@ -144,7 +144,7 @@ public class FMPEvent } @SubscribeEvent - public void playerInteract( PlayerInteractEvent event ) + public void playerInteract( final PlayerInteractEvent event ) { if( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote ) { diff --git a/src/main/java/appeng/fmp/FMPPlacementHelper.java b/src/main/java/appeng/fmp/FMPPlacementHelper.java index 5364bea8..8eb7aefd 100644 --- a/src/main/java/appeng/fmp/FMPPlacementHelper.java +++ b/src/main/java/appeng/fmp/FMPPlacementHelper.java @@ -53,7 +53,7 @@ public class FMPPlacementHelper implements IPartHost private TileMultipart myMP; private CableBusPart myPart; - public FMPPlacementHelper( TileMultipart mp ) + public FMPPlacementHelper( final TileMultipart mp ) { this.myMP = mp; } @@ -69,11 +69,11 @@ public class FMPPlacementHelper implements IPartHost } @Override - public boolean canAddPart( ItemStack part, ForgeDirection side ) + public boolean canAddPart( final ItemStack part, final ForgeDirection side ) { - CableBusPart myPart = this.getPart(); + final CableBusPart myPart = this.getPart(); - boolean returnValue = this.hasPart && myPart.canAddPart( part, side ); + final boolean returnValue = this.hasPart && myPart.canAddPart( part, side ); this.removePart(); @@ -82,10 +82,10 @@ public class FMPPlacementHelper implements IPartHost private CableBusPart getPart() { - scala.collection.Iterator i = this.myMP.partList().iterator(); + final scala.collection.Iterator i = this.myMP.partList().iterator(); while( i.hasNext() ) { - TMultiPart p = i.next(); + final TMultiPart p = i.next(); if( p instanceof CableBusPart ) { this.myPart = (CableBusPart) p; @@ -97,7 +97,7 @@ public class FMPPlacementHelper implements IPartHost this.myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 ); } - BlockCoord loc = new BlockCoord( this.myMP.xCoord, this.myMP.yCoord, this.myMP.zCoord ); + final BlockCoord loc = new BlockCoord( this.myMP.xCoord, this.myMP.yCoord, this.myMP.zCoord ); if( this.myMP.canAddPart( this.myPart ) && Platform.isServer() ) { @@ -112,10 +112,10 @@ public class FMPPlacementHelper implements IPartHost { if( this.myPart.isEmpty() ) { - scala.collection.Iterator i = this.myMP.partList().iterator(); + final scala.collection.Iterator i = this.myMP.partList().iterator(); while( i.hasNext() ) { - TMultiPart p = i.next(); + final TMultiPart p = i.next(); if( p == this.myPart ) { this.myMP = this.myMP.remPart( this.myPart ); @@ -128,11 +128,11 @@ public class FMPPlacementHelper implements IPartHost } @Override - public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner ) + public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner ) { - CableBusPart myPart = this.getPart(); + final CableBusPart myPart = this.getPart(); - ForgeDirection returnValue = this.hasPart ? myPart.addPart( is, side, owner ) : null; + final ForgeDirection returnValue = this.hasPart ? myPart.addPart( is, side, owner ) : null; this.removePart(); @@ -140,7 +140,7 @@ public class FMPPlacementHelper implements IPartHost } @Override - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { if( this.myPart == null ) { @@ -150,7 +150,7 @@ public class FMPPlacementHelper implements IPartHost } @Override - public void removePart( ForgeDirection side, boolean suppressUpdate ) + public void removePart( final ForgeDirection side, final boolean suppressUpdate ) { if( this.myPart == null ) { @@ -206,11 +206,11 @@ public class FMPPlacementHelper implements IPartHost } @Override - public boolean isBlocked( ForgeDirection side ) + public boolean isBlocked( final ForgeDirection side ) { this.getPart(); - boolean returnValue = this.myPart.isBlocked( side ); + final boolean returnValue = this.myPart.isBlocked( side ); this.removePart(); @@ -218,7 +218,7 @@ public class FMPPlacementHelper implements IPartHost } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { if( this.myPart == null ) { @@ -248,7 +248,7 @@ public class FMPPlacementHelper implements IPartHost } @Override - public boolean hasRedstone( ForgeDirection side ) + public boolean hasRedstone( final ForgeDirection side ) { if( this.myPart == null ) { @@ -311,13 +311,13 @@ public class FMPPlacementHelper implements IPartHost { @Override - public IFacadePart getFacade( int x ) + public IFacadePart getFacade( final int x ) { return null; } @Override - public void setFacade( int x, IFacadePart facade ) + public void setFacade( final int x, final IFacadePart facade ) { } diff --git a/src/main/java/appeng/fmp/PartRegistry.java b/src/main/java/appeng/fmp/PartRegistry.java index d8a7311e..10941170 100644 --- a/src/main/java/appeng/fmp/PartRegistry.java +++ b/src/main/java/appeng/fmp/PartRegistry.java @@ -40,7 +40,7 @@ public enum PartRegistry private final Class blk; private final Class part; - PartRegistry( String name, Class blk, Class part ) + PartRegistry( final String name, final Class blk, final Class part ) { this.name = name; this.blk = blk; @@ -48,9 +48,9 @@ public enum PartRegistry } @Nullable - public static TMultiPart getPartByBlock( Block block, int meta ) + public static TMultiPart getPartByBlock( final Block block, final int meta ) { - for( PartRegistry pr : values() ) + for( final PartRegistry pr : values() ) { if( pr.blk.isInstance( block ) ) { @@ -60,7 +60,7 @@ public enum PartRegistry return null; } - public TMultiPart construct( int meta ) + public TMultiPart construct( final int meta ) { try { @@ -73,7 +73,7 @@ public enum PartRegistry return this.part.getConstructor( int.class ).newInstance( meta ); } } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } diff --git a/src/main/java/appeng/fmp/QuartzTorchPart.java b/src/main/java/appeng/fmp/QuartzTorchPart.java index 11dd03f0..1c4203c7 100644 --- a/src/main/java/appeng/fmp/QuartzTorchPart.java +++ b/src/main/java/appeng/fmp/QuartzTorchPart.java @@ -43,12 +43,12 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi this( ForgeDirection.DOWN.ordinal() ); } - public QuartzTorchPart( int meta ) + public QuartzTorchPart( final int meta ) { super( meta ); } - public static McBlockPart placement( World world, BlockCoord pos, int side ) + public static McBlockPart placement( final World world, BlockCoord pos, final int side ) { pos = pos.copy().offset( side ); if( !world.isSideSolid( pos.x, pos.y, pos.z, ForgeDirection.getOrientation( side ) ) ) @@ -77,23 +77,23 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi return this.getBounds( this.meta ); } - public Cuboid6 getBounds( int meta ) + public Cuboid6 getBounds( final int meta ) { - ForgeDirection up = ForgeDirection.getOrientation( meta ); - double xOff = -0.3 * up.offsetX; - double yOff = -0.3 * up.offsetY; - double zOff = -0.3 * up.offsetZ; + final ForgeDirection up = ForgeDirection.getOrientation( meta ); + final double xOff = -0.3 * up.offsetX; + final double yOff = -0.3 * up.offsetY; + final double zOff = -0.3 * up.offsetZ; return new Cuboid6( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ); } @Override - public int sideForMeta( int meta ) + public int sideForMeta( final int meta ) { return ForgeDirection.getOrientation( meta ).getOpposite().ordinal(); } @Override - public void randomDisplayTick( Random r ) + public void randomDisplayTick( final Random r ) { this.getBlock().randomDisplayTick( this.world(), this.x(), this.y(), this.z(), r ); } @@ -101,7 +101,7 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi @Override public Block getBlock() { - for( Block torchBlock : AEApi.instance().definitions().blocks().quartzTorch().maybeBlock().asSet() ) + for( final Block torchBlock : AEApi.instance().definitions().blocks().quartzTorch().maybeBlock().asSet() ) { return torchBlock; } diff --git a/src/main/java/appeng/helpers/AEGlassMaterial.java b/src/main/java/appeng/helpers/AEGlassMaterial.java index 3f07aa94..478883b4 100644 --- a/src/main/java/appeng/helpers/AEGlassMaterial.java +++ b/src/main/java/appeng/helpers/AEGlassMaterial.java @@ -28,7 +28,7 @@ public class AEGlassMaterial extends Material public static final AEGlassMaterial INSTANCE = ( new AEGlassMaterial( MapColor.airColor ) ); - public AEGlassMaterial( MapColor color ) + public AEGlassMaterial( final MapColor color ) { super( color ); } diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index f94e30c9..b52fe247 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -127,7 +127,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn IMEInventory destination; private boolean isWorking = false; - public DualityInterface( AENetworkProxy networkProxy, IInterfaceHost ih ) + public DualityInterface( final AENetworkProxy networkProxy, final IInterfaceHost ih ) { this.gridProxy = networkProxy; this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); @@ -149,7 +149,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.isWorking ) { @@ -166,11 +166,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } else if( inv == this.storage && slot >= 0 ) { - boolean had = this.hasWorkToDo(); + final boolean had = this.hasWorkToDo(); this.updatePlan( slot ); - boolean now = this.hasWorkToDo(); + final boolean now = this.hasWorkToDo(); if( had != now ) { @@ -185,7 +185,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -193,7 +193,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { this.config.writeToNBT( data, "config" ); this.patterns.writeToNBT( data, "patterns" ); @@ -203,12 +203,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.craftingTracker.writeToNBT( data ); data.setInteger( "priority", this.priority ); - NBTTagList waitingToSend = new NBTTagList(); + final NBTTagList waitingToSend = new NBTTagList(); if( this.waitingToSend != null ) { - for( ItemStack is : this.waitingToSend ) + for( final ItemStack is : this.waitingToSend ) { - NBTTagCompound item = new NBTTagCompound(); + final NBTTagCompound item = new NBTTagCompound(); is.writeToNBT( item ); waitingToSend.appendTag( item ); } @@ -216,18 +216,18 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn data.setTag( "waitingToSend", waitingToSend ); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.waitingToSend = null; - NBTTagList waitingList = data.getTagList( "waitingToSend", 10 ); + final NBTTagList waitingList = data.getTagList( "waitingToSend", 10 ); if( waitingList != null ) { for( int x = 0; x < waitingList.tagCount(); x++ ) { - NBTTagCompound c = waitingList.getCompoundTagAt( x ); + final NBTTagCompound c = waitingList.getCompoundTagAt( x ); if( c != null ) { - ItemStack is = ItemStack.loadItemStackFromNBT( c ); + final ItemStack is = ItemStack.loadItemStackFromNBT( c ); this.addToSendList( is ); } } @@ -244,7 +244,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.updateCraftingList(); } - public void addToSendList( ItemStack is ) + public void addToSendList( final ItemStack is ) { if( is == null ) { @@ -262,7 +262,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -272,7 +272,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.hasConfig = false; - for( ItemStack p : this.config ) + for( final ItemStack p : this.config ) { if( p != null ) { @@ -281,14 +281,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - boolean had = this.hasWorkToDo(); + final boolean had = this.hasWorkToDo(); for( int x = 0; x < NUMBER_OF_CONFIG_SLOTS; x++ ) { this.updatePlan( x ); } - boolean has = this.hasWorkToDo(); + final boolean has = this.hasWorkToDo(); if( had != has ) { @@ -303,7 +303,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -314,7 +314,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public void updateCraftingList() { - Boolean[] accountedFor = { false, false, false, false, false, false, false, false, false }; // 9... + final Boolean[] accountedFor = { false, false, false, false, false, false, false, false, false }; // 9... assert ( accountedFor.length == this.patterns.getSizeInventory() ); @@ -325,15 +325,15 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( this.craftingList != null ) { - Iterator i = this.craftingList.iterator(); + final Iterator i = this.craftingList.iterator(); while( i.hasNext() ) { - ICraftingPatternDetails details = i.next(); + final ICraftingPatternDetails details = i.next(); boolean found = false; for( int x = 0; x < accountedFor.length; x++ ) { - ItemStack is = this.patterns.getStackInSlot( x ); + final ItemStack is = this.patterns.getStackInSlot( x ); if( details.getPattern() == is ) { accountedFor[x] = found = true; @@ -359,7 +359,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -370,7 +370,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.hasItemsToSend() || this.requireWork[0] != null || this.requireWork[1] != null || this.requireWork[2] != null || this.requireWork[3] != null || this.requireWork[4] != null || this.requireWork[5] != null || this.requireWork[6] != null || this.requireWork[7] != null; } - private void updatePlan( int slot ) + private void updatePlan( final int slot ) { IAEItemStack req = this.config.getAEStackInSlot( slot ); if( req != null && req.getStackSize() <= 0 ) @@ -379,11 +379,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn req = null; } - ItemStack Stored = this.storage.getStackInSlot( slot ); + final ItemStack Stored = this.storage.getStackInSlot( slot ); if( req == null && Stored != null ) { - IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); + final IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } @@ -406,7 +406,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn else // Stored != null; dispose! { - IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); + final IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } @@ -426,20 +426,20 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } - TileEntity te = this.iHost.getTileEntity(); + final TileEntity te = this.iHost.getTileEntity(); if( te != null && te.getWorldObj() != null ) { Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord ); } } - public void addToCraftingList( ItemStack is ) + public void addToCraftingList( final ItemStack is ) { if( is == null ) { @@ -448,8 +448,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( is.getItem() instanceof ICraftingPatternItem ) { - ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); - ICraftingPatternDetails details = cpi.getPatternForItem( is, this.iHost.getTileEntity().getWorldObj() ); + final ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); + final ICraftingPatternDetails details = cpi.getPatternForItem( is, this.iHost.getTileEntity().getWorldObj() ); if( details != null ) { @@ -469,9 +469,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { - IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); + final IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); if( out == null ) { return true; @@ -500,7 +500,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.items.setInternal( this.gridProxy.getStorage().getItemInventory() ); this.fluids.setInternal( this.gridProxy.getStorage().getFluidInventory() ); } - catch( GridAccessException gae ) + catch( final GridAccessException gae ) { this.items.setInternal( new NullInventory() ); this.fluids.setInternal( new NullInventory() ); @@ -509,7 +509,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.notifyNeighbors(); } - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -532,19 +532,19 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public int[] getAccessibleSlotsFromSide( int side ) + public int[] getAccessibleSlotsFromSide( final int side ) { return this.sides; } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.Interface.min, TickRates.Interface.max, !this.hasWorkToDo(), true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( !this.gridProxy.isActive() ) { @@ -556,37 +556,37 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.pushItemsOut( this.iHost.getTargets() ); } - boolean couldDoWork = this.updateStorage(); + final boolean couldDoWork = this.updateStorage(); return this.hasWorkToDo() ? ( couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER ) : TickRateModulation.SLEEP; } - private void pushItemsOut( EnumSet possibleDirections ) + private void pushItemsOut( final EnumSet possibleDirections ) { if( !this.hasItemsToSend() ) { return; } - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorldObj(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorldObj(); - Iterator i = this.waitingToSend.iterator(); + final Iterator i = this.waitingToSend.iterator(); while( i.hasNext() ) { ItemStack whatToSend = i.next(); - for( ForgeDirection s : possibleDirections ) + for( final ForgeDirection s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); + final TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); if( te == null ) { continue; } - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { - ItemStack Result = ad.addItems( whatToSend ); + final ItemStack Result = ad.addItems( whatToSend ); if( Result == null ) { @@ -631,16 +631,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return didSomething; } - private boolean usePlan( int x, IAEItemStack itemStack ) + private boolean usePlan( final int x, final IAEItemStack itemStack ) { - InventoryAdaptor adaptor = this.getAdaptor( x ); + final InventoryAdaptor adaptor = this.getAdaptor( x ); this.isWorking = true; boolean changed = false; try { this.destination = this.gridProxy.getStorage().getItemInventory(); - IEnergySource src = this.gridProxy.getEnergy(); + final IEnergySource src = this.gridProxy.getEnergy(); if( this.craftingTracker.isBusy( x ) ) { @@ -655,11 +655,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn throw new GridAccessException(); } - IAEItemStack acquired = Platform.poweredExtraction( src, this.destination, itemStack, this.interfaceRequestSource ); + final IAEItemStack acquired = Platform.poweredExtraction( src, this.destination, itemStack, this.interfaceRequestSource ); if( acquired != null ) { changed = true; - ItemStack issue = adaptor.addItems( acquired.getItemStack() ); + final ItemStack issue = adaptor.addItems( acquired.getItemStack() ); if( issue != null ) { throw new IllegalStateException( "bad attempt at managing inventory. ( addItems )" ); @@ -678,7 +678,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn long diff = toStore.getStackSize(); // make sure strange things didn't happen... - ItemStack canExtract = adaptor.simulateRemove( (int) diff, toStore.getItemStack(), null ); + final ItemStack canExtract = adaptor.simulateRemove( (int) diff, toStore.getItemStack(), null ); if( canExtract == null || canExtract.stackSize != diff ) { changed = true; @@ -696,7 +696,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { // extract items! changed = true; - ItemStack removed = adaptor.removeItems( (int) diff, null, null ); + final ItemStack removed = adaptor.removeItems( (int) diff, null, null ); if( removed == null ) { throw new IllegalStateException( "bad attempt at managing inventory. ( removeItems )" ); @@ -709,7 +709,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } // else wtf? } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -723,12 +723,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return changed; } - private InventoryAdaptor getAdaptor( int slot ) + private InventoryAdaptor getAdaptor( final int slot ) { return new AdaptorIInventory( this.slotInv.getWrapper( slot ) ); } - private boolean handleCrafting( int x, InventoryAdaptor d, IAEItemStack itemStack ) + private boolean handleCrafting( final int x, final InventoryAdaptor d, final IAEItemStack itemStack ) { try { @@ -737,7 +737,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorldObj(), this.gridProxy.getGrid(), this.gridProxy.getCrafting(), this.mySource ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -746,7 +746,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { if( this.upgrades == null ) { @@ -778,7 +778,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "storage" ) ) { @@ -815,7 +815,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.getInstalledUpgrades( Upgrades.CRAFTING ) == 0 ) { @@ -841,7 +841,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.craftingTracker.cancel(); } - public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src, IStorageMonitorable myInterface ) + public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src, final IStorageMonitorable myInterface ) { if( Platform.canAccess( this.gridProxy, src ) ) { @@ -868,20 +868,20 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { if( this.hasItemsToSend() || !this.gridProxy.isActive() ) { return false; } - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorldObj(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorldObj(); - EnumSet possibleDirections = this.iHost.getTargets(); - for( ForgeDirection s : possibleDirections ) + final EnumSet possibleDirections = this.iHost.getTargets(); + for( final ForgeDirection s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); + final TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); if( te instanceof IInterfaceHost ) { try @@ -891,7 +891,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn continue; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { continue; } @@ -899,7 +899,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( te instanceof ICraftingMachine ) { - ICraftingMachine cm = (ICraftingMachine) te; + final ICraftingMachine cm = (ICraftingMachine) te; if( cm.acceptsPlans() ) { if( cm.pushPattern( patternDetails, table, s.getOpposite() ) ) @@ -910,7 +910,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { if( this.isBlocking() ) @@ -925,7 +925,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { for( int x = 0; x < table.getSizeInventory(); x++ ) { - ItemStack is = table.getStackInSlot( x ); + final ItemStack is = table.getStackInSlot( x ); if( is != null ) { final ItemStack added = ad.addItems( is ); @@ -953,17 +953,17 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( this.isBlocking() ) { - EnumSet possibleDirections = this.iHost.getTargets(); - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorldObj(); + final EnumSet possibleDirections = this.iHost.getTargets(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorldObj(); boolean allAreBusy = true; - for( ForgeDirection s : possibleDirections ) + for( final ForgeDirection s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); + final TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { if( ad.simulateRemove( 1, null, null ) == null ) @@ -980,7 +980,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return busy; } - private boolean sameGrid( IGrid grid ) throws GridAccessException + private boolean sameGrid( final IGrid grid ) throws GridAccessException { return grid == this.gridProxy.getGrid(); } @@ -990,11 +990,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.cm.getSetting( Settings.BLOCK ) == YesNo.YES; } - private boolean acceptsItems( InventoryAdaptor ad, InventoryCrafting table ) + private boolean acceptsItems( final InventoryAdaptor ad, final InventoryCrafting table ) { for( int x = 0; x < table.getSizeInventory(); x++ ) { - ItemStack is = table.getStackInSlot( x ); + final ItemStack is = table.getStackInSlot( x ); if( is == null ) { continue; @@ -1010,11 +1010,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { if( this.gridProxy.isActive() && this.craftingList != null ) { - for( ICraftingPatternDetails details : this.craftingList ) + for( final ICraftingPatternDetails details : this.craftingList ) { details.setPriority( this.priority ); craftingTracker.addCraftingOption( this, details ); @@ -1022,11 +1022,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public void addDrops( List drops ) + public void addDrops( final List drops ) { if( this.waitingToSend != null ) { - for( ItemStack is : this.waitingToSend ) + for( final ItemStack is : this.waitingToSend ) { if( is != null ) { @@ -1035,7 +1035,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.upgrades ) + for( final ItemStack is : this.upgrades ) { if( is != null ) { @@ -1043,7 +1043,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.storage ) + for( final ItemStack is : this.storage ) { if( is != null ) { @@ -1051,7 +1051,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.patterns ) + for( final ItemStack is : this.patterns ) { if( is != null ) { @@ -1083,13 +1083,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.craftingTracker.getRequestedJobs(); } - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack acquired, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack acquired, final Actionable mode ) { - int slot = this.craftingTracker.getSlot( link ); + final int slot = this.craftingTracker.getSlot( link ); if( acquired != null && slot >= 0 && slot <= this.requireWork.length ) { - InventoryAdaptor adaptor = this.getAdaptor( slot ); + final InventoryAdaptor adaptor = this.getAdaptor( slot ); if( mode == Actionable.SIMULATE ) { @@ -1097,7 +1097,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } else { - IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) ); + final IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) ); this.updatePlan( slot ); return is; } @@ -1106,7 +1106,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return acquired; } - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.craftingTracker.jobStateChange( link ); } @@ -1122,7 +1122,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } final EnumSet possibleDirections = this.iHost.getTargets(); - for( ForgeDirection direction : possibleDirections ) + for( final ForgeDirection direction : possibleDirections ) { final int xPos = hostTile.xCoord + direction.offsetX; final int yPos = hostTile.yCoord + direction.offsetY; @@ -1143,7 +1143,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn continue; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { continue; } @@ -1159,7 +1159,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( directedTile instanceof ISidedInventory ) { - int[] sides = ( (ISidedInventory) directedTile ).getAccessibleSlotsFromSide( direction.getOpposite().ordinal() ); + final int[] sides = ( (ISidedInventory) directedTile ).getAccessibleSlotsFromSide( direction.getOpposite().ordinal() ); if( sides == null || sides.length == 0 ) { @@ -1173,13 +1173,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { Vec3 from = Vec3.createVectorHelper( hostTile.xCoord + 0.5, hostTile.yCoord + 0.5, hostTile.zCoord + 0.5 ); from = from.addVector( direction.offsetX * 0.501, direction.offsetY * 0.501, direction.offsetZ * 0.501 ); - Vec3 to = from.addVector( direction.offsetX, direction.offsetY, direction.offsetZ ); - MovingObjectPosition mop = hostWorld.rayTraceBlocks( from, to, true ); + final Vec3 to = from.addVector( direction.offsetX, direction.offsetY, direction.offsetZ ); + final MovingObjectPosition mop = hostWorld.rayTraceBlocks( from, to, true ); if( mop != null && !BAD_BLOCKS.contains( directedBlock ) ) { if( mop.blockX == directedTile.xCoord && mop.blockY == directedTile.yCoord && mop.blockZ == directedTile.zCoord ) { - ItemStack g = directedBlock.getPickBlock( mop, hostWorld, directedTile.xCoord, directedTile.yCoord, directedTile.zCoord, null ); + final ItemStack g = directedBlock.getPickBlock( mop, hostWorld, directedTile.xCoord, directedTile.yCoord, directedTile.zCoord, null ); if( g != null ) { what = g; @@ -1187,7 +1187,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } } - catch( Throwable t ) + catch( final Throwable t ) { BAD_BLOCKS.add( directedBlock ); // nope! } @@ -1197,7 +1197,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return what.getUnlocalizedName(); } - Item item = Item.getItemFromBlock( directedBlock ); + final Item item = Item.getItemFromBlock( directedBlock ); if( item == null ) { return directedBlock.getUnlocalizedName(); @@ -1210,7 +1210,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public long getSortValue() { - TileEntity te = this.iHost.getTileEntity(); + final TileEntity te = this.iHost.getTileEntity(); return ( te.zCoord << 24 ) ^ ( te.xCoord << 8 ) ^ te.yCoord; } @@ -1226,7 +1226,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.markDirty(); @@ -1235,7 +1235,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -1244,7 +1244,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private class InterfaceRequestSource extends MachineSource { - public InterfaceRequestSource( IActionHost v ) + public InterfaceRequestSource( final IActionHost v ) { super( v ); } @@ -1254,14 +1254,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private class InterfaceInventory extends MEMonitorIInventory { - public InterfaceInventory( DualityInterface tileInterface ) + public InterfaceInventory( final DualityInterface tileInterface ) { super( new AdaptorIInventory( tileInterface.storage ) ); this.mySource = new MachineSource( DualityInterface.this.iHost ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( src instanceof InterfaceRequestSource ) { @@ -1272,7 +1272,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable type, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable type, final BaseActionSource src ) { if( src instanceof InterfaceRequestSource ) { diff --git a/src/main/java/appeng/helpers/LocationRotation.java b/src/main/java/appeng/helpers/LocationRotation.java index b3bc5b7f..fb0c578c 100644 --- a/src/main/java/appeng/helpers/LocationRotation.java +++ b/src/main/java/appeng/helpers/LocationRotation.java @@ -33,7 +33,7 @@ public class LocationRotation implements IOrientable final int y; final int z; - public LocationRotation( IBlockAccess world, int x, int y, int z ) + public LocationRotation( final IBlockAccess world, final int x, final int y, final int z ) { this.w = world; this.x = x; @@ -60,12 +60,12 @@ public class LocationRotation implements IOrientable @Override public ForgeDirection getUp() { - int num = Math.abs( this.x + this.y + this.z ) % 6; + final int num = Math.abs( this.x + this.y + this.z ) % 6; return ForgeDirection.getOrientation( num ); } @Override - public void setOrientation( ForgeDirection forward, ForgeDirection up ) + public void setOrientation( final ForgeDirection forward, final ForgeDirection up ) { } diff --git a/src/main/java/appeng/helpers/MetaRotation.java b/src/main/java/appeng/helpers/MetaRotation.java index 557009fa..5c4ac6ca 100644 --- a/src/main/java/appeng/helpers/MetaRotation.java +++ b/src/main/java/appeng/helpers/MetaRotation.java @@ -34,7 +34,7 @@ public class MetaRotation implements IOrientable final int y; final int z; - public MetaRotation( IBlockAccess world, int x, int y, int z ) + public MetaRotation( final IBlockAccess world, final int x, final int y, final int z ) { this.w = world; this.x = x; @@ -65,7 +65,7 @@ public class MetaRotation implements IOrientable } @Override - public void setOrientation( ForgeDirection forward, ForgeDirection up ) + public void setOrientation( final ForgeDirection forward, final ForgeDirection up ) { if( this.w instanceof World ) { diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index 03f6029e..aa44e08e 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -48,7 +48,7 @@ public class MultiCraftingTracker private ICraftingLink[] links = null; private int failedCraftingAttempts = 0; - public MultiCraftingTracker( ICraftingRequester o, int size ) + public MultiCraftingTracker( final ICraftingRequester o, final int size ) { this.owner = o; this.size = size; @@ -59,7 +59,7 @@ public class MultiCraftingTracker return failedCraftingAttempts; } - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { for( int x = 0; x < this.size; x++ ) { @@ -72,7 +72,7 @@ public class MultiCraftingTracker } } - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { for( int x = 0; x < this.size; x++ ) { @@ -87,7 +87,7 @@ public class MultiCraftingTracker } } - public boolean handleCrafting( int x, long itemToCraft, IAEItemStack ais, InventoryAdaptor d, World w, IGrid g, ICraftingGrid cg, BaseActionSource mySrc ) + public boolean handleCrafting( final int x, final long itemToCraft, final IAEItemStack ais, final InventoryAdaptor d, final World w, final IGrid g, final ICraftingGrid cg, final BaseActionSource mySrc ) { if( ais != null && d.simulateAdd( ais.getItemStack() ) == null ) { @@ -126,11 +126,11 @@ public class MultiCraftingTracker return true; } } - catch( InterruptedException e ) + catch( final InterruptedException e ) { // :P } - catch( ExecutionException e ) + catch( final ExecutionException e ) { // :P } @@ -159,7 +159,7 @@ public class MultiCraftingTracker return ImmutableSet.copyOf( new NonNullArrayIterator( this.links ) ); } - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { if( this.links != null ) { @@ -174,7 +174,7 @@ public class MultiCraftingTracker } } - public int getSlot( ICraftingLink link ) + public int getSlot( final ICraftingLink link ) { if( this.links != null ) { @@ -194,7 +194,7 @@ public class MultiCraftingTracker { if( this.links != null ) { - for( ICraftingLink l : this.links ) + for( final ICraftingLink l : this.links ) { if( l != null ) { @@ -207,7 +207,7 @@ public class MultiCraftingTracker if( this.jobs != null ) { - for( Future l : this.jobs ) + for( final Future l : this.jobs ) { if( l != null ) { @@ -219,12 +219,12 @@ public class MultiCraftingTracker } } - public boolean isBusy( int slot ) + public boolean isBusy( final int slot ) { return this.getLink( slot ) != null || this.getJob( slot ) != null; } - private ICraftingLink getLink( int slot ) + private ICraftingLink getLink( final int slot ) { if( this.links == null ) { @@ -234,7 +234,7 @@ public class MultiCraftingTracker return this.links[slot]; } - private void setLink( int slot, ICraftingLink l ) + private void setLink( final int slot, final ICraftingLink l ) { if( this.links == null ) { @@ -264,7 +264,7 @@ public class MultiCraftingTracker } } - private Future getJob( int slot ) + private Future getJob( final int slot ) { if( this.jobs == null ) { @@ -274,7 +274,7 @@ public class MultiCraftingTracker return this.jobs[slot]; } - private void setJob( int slot, Future l ) + private void setJob( final int slot, final Future l ) { if( this.jobs == null ) { @@ -285,7 +285,7 @@ public class MultiCraftingTracker boolean hasStuff = false; - for( Future job : this.jobs ) + for( final Future job : this.jobs ) { if( job != null ) { diff --git a/src/main/java/appeng/helpers/NonNullArrayIterator.java b/src/main/java/appeng/helpers/NonNullArrayIterator.java index 3eb05b53..ca952628 100644 --- a/src/main/java/appeng/helpers/NonNullArrayIterator.java +++ b/src/main/java/appeng/helpers/NonNullArrayIterator.java @@ -30,7 +30,7 @@ public class NonNullArrayIterator implements Iterator private final E[] g; private int offset = 0; - public NonNullArrayIterator( E[] o ) + public NonNullArrayIterator( final E[] o ) { this.g = o; } diff --git a/src/main/java/appeng/helpers/NullRotation.java b/src/main/java/appeng/helpers/NullRotation.java index 258a8d8e..12ae4cea 100644 --- a/src/main/java/appeng/helpers/NullRotation.java +++ b/src/main/java/appeng/helpers/NullRotation.java @@ -51,7 +51,7 @@ public class NullRotation implements IOrientable } @Override - public void setOrientation( ForgeDirection forward, ForgeDirection up ) + public void setOrientation( final ForgeDirection forward, final ForgeDirection up ) { } diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index 6a3f3382..ba70508f 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -60,27 +60,27 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable in = new ArrayList(); - List out = new ArrayList(); + final List in = new ArrayList(); + final List out = new ArrayList(); for( int x = 0; x < inTag.tagCount(); x++ ) { - ItemStack gs = ItemStack.loadItemStackFromNBT( inTag.getCompoundTagAt( x ) ); + final ItemStack gs = ItemStack.loadItemStackFromNBT( inTag.getCompoundTagAt( x ) ); this.crafting.setInventorySlotContents( x, gs ); if( gs != null && ( !this.isCrafting || !gs.hasTagCompound() ) ) @@ -112,7 +112,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpOutputs = new HashMap(); - for( IAEItemStack io : this.outputs ) + final HashMap tmpOutputs = new HashMap(); + for( final IAEItemStack io : this.outputs ) { if( io == null ) { continue; } - IAEItemStack g = tmpOutputs.get( io ); + final IAEItemStack g = tmpOutputs.get( io ); if( g == null ) { tmpOutputs.put( io, io.copy() ); @@ -142,15 +142,15 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpInputs = new HashMap(); - for( IAEItemStack io : this.inputs ) + final HashMap tmpInputs = new HashMap(); + for( final IAEItemStack io : this.inputs ) { if( io == null ) { continue; } - IAEItemStack g = tmpInputs.get( io ); + final IAEItemStack g = tmpInputs.get( io ); if( g == null ) { tmpInputs.put( io, io.copy() ); @@ -168,7 +168,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> ( offset + 32 ) ); } @@ -400,13 +400,13 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> target; - public PlayerSecurityWrapper( HashMap> playerPerms ) + public PlayerSecurityWrapper( final HashMap> playerPerms ) { this.target = playerPerms; } @Override - public void addPlayer( int playerID, EnumSet permissions ) + public void addPlayer( final int playerID, final EnumSet permissions ) { this.target.put( playerID, permissions ); } diff --git a/src/main/java/appeng/helpers/Splotch.java b/src/main/java/appeng/helpers/Splotch.java index 2b49bc88..23cf44a9 100644 --- a/src/main/java/appeng/helpers/Splotch.java +++ b/src/main/java/appeng/helpers/Splotch.java @@ -35,13 +35,13 @@ public class Splotch public final AEColor color; private final int pos; - public Splotch( AEColor col, boolean lit, ForgeDirection side, Vec3 position ) + public Splotch( final AEColor col, final boolean lit, final ForgeDirection side, final Vec3 position ) { this.color = col; this.lumen = lit; - double x; - double y; + final double x; + final double y; if( side == ForgeDirection.SOUTH || side == ForgeDirection.NORTH ) { @@ -61,28 +61,28 @@ public class Splotch y = position.zCoord; } - int a = (int) ( x * 0xF ); - int b = (int) ( y * 0xF ); + final int a = (int) ( x * 0xF ); + final int b = (int) ( y * 0xF ); this.pos = a | ( b << 4 ); this.side = side; } - public Splotch( ByteBuf data ) + public Splotch( final ByteBuf data ) { this.pos = data.readByte(); - int val = data.readByte(); + final int val = data.readByte(); this.side = ForgeDirection.getOrientation( val & 0x07 ); this.color = AEColor.values()[( val >> 3 ) & 0x0F]; this.lumen = ( ( val >> 7 ) & 0x01 ) > 0; } - public void writeToStream( ByteBuf stream ) + public void writeToStream( final ByteBuf stream ) { stream.writeByte( this.pos ); - int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); + final int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); stream.writeByte( val ); } @@ -98,7 +98,7 @@ public class Splotch public int getSeed() { - int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); + final int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); return Math.abs( this.pos + val ); } } diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index 39b2ccb9..f2bfb1e1 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -67,7 +67,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II double myRange = Double.MAX_VALUE; private final int inventorySlot; - public WirelessTerminalGuiObject( IWirelessTermHandler wh, ItemStack is, EntityPlayer ep, World w, int x, int y, int z ) + public WirelessTerminalGuiObject( final IWirelessTermHandler wh, final ItemStack is, final EntityPlayer ep, final World w, final int x, final int y, final int z ) { this.encryptionKey = wh.getEncryptionKey( is ); this.effectiveItem = is; @@ -79,17 +79,17 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II try { - long encKey = Long.parseLong( this.encryptionKey ); + final long encKey = Long.parseLong( this.encryptionKey ); obj = AEApi.instance().registries().locatable().getLocatableBy( encKey ); } - catch( NumberFormatException err ) + catch( final NumberFormatException err ) { // :P } if( obj instanceof IGridHost ) { - IGridNode n = ( (IGridHost) obj ).getGridNode( ForgeDirection.UNKNOWN ); + final IGridNode n = ( (IGridHost) obj ).getGridNode( ForgeDirection.UNKNOWN ); if( n != null ) { this.targetGrid = n.getGrid(); @@ -131,7 +131,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { if( this.itemStorage != null ) { @@ -140,7 +140,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { if( this.itemStorage != null ) { @@ -149,7 +149,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { if( this.itemStorage != null ) { @@ -179,7 +179,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { if( this.itemStorage != null ) { @@ -189,7 +189,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { if( this.itemStorage != null ) { @@ -219,13 +219,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return this.itemStorage.validForPass( i ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.itemStorage != null ) { @@ -235,7 +235,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( this.itemStorage != null ) { @@ -255,7 +255,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { if( this.wth != null && this.effectiveItem != null ) { @@ -281,13 +281,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.getActionableNode(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.NONE; } @@ -327,13 +327,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II return false; } - IMachineSet tw = this.targetGrid.getMachines( TileWireless.class ); + final IMachineSet tw = this.targetGrid.getMachines( TileWireless.class ); this.myWap = null; - for( IGridNode n : tw ) + for( final IGridNode n : tw ) { - IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); + final IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); if( this.testWap( wap ) ) { this.myWap = wap; @@ -345,20 +345,20 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II return false; } - private boolean testWap( IWirelessAccessPoint wap ) + private boolean testWap( final IWirelessAccessPoint wap ) { double rangeLimit = wap.getRange(); rangeLimit *= rangeLimit; - DimensionalCoord dc = wap.getLocation(); + final DimensionalCoord dc = wap.getLocation(); if( dc.getWorld() == this.myPlayer.worldObj ) { - double offX = dc.x - this.myPlayer.posX; - double offY = dc.y - this.myPlayer.posY; - double offZ = dc.z - this.myPlayer.posZ; + final double offX = dc.x - this.myPlayer.posX; + final double offY = dc.y - this.myPlayer.posY; + final double offZ = dc.z - this.myPlayer.posZ; - double r = offX * offX + offY * offY + offZ * offZ; + final double r = offX * offX + offY * offY + offZ * offZ; if( r < rangeLimit && this.sqRange > r ) { if( wap.isActive() ) diff --git a/src/main/java/appeng/hooks/AETrading.java b/src/main/java/appeng/hooks/AETrading.java index 6886c707..f68b2b43 100644 --- a/src/main/java/appeng/hooks/AETrading.java +++ b/src/main/java/appeng/hooks/AETrading.java @@ -40,7 +40,7 @@ public class AETrading implements IVillageTradeHandler { @Override - public void manipulateTradesForVillager( EntityVillager villager, MerchantRecipeList recipeList, Random random ) + public void manipulateTradesForVillager( final EntityVillager villager, final MerchantRecipeList recipeList, final Random random ) { final IMaterials materials = AEApi.instance().definitions().materials(); @@ -51,17 +51,17 @@ public class AETrading implements IVillageTradeHandler this.addTrade( recipeList, materials.certusQuartzDust(), materials.certusQuartzCrystal(), random, 2 ); } - private void addMerchant( MerchantRecipeList list, IItemDefinition item, int emera, Random rand, int greed ) + private void addMerchant( final MerchantRecipeList list, final IItemDefinition item, final int emera, final Random rand, final int greed ) { - for( ItemStack itemStack : item.maybeStack( 1 ).asSet() ) + for( final ItemStack itemStack : item.maybeStack( 1 ).asSet() ) { // Sell - ItemStack from = itemStack.copy(); - ItemStack to = new ItemStack( Items.emerald ); + final ItemStack from = itemStack.copy(); + final ItemStack to = new ItemStack( Items.emerald ); - int multiplier = ( Math.abs( rand.nextInt() ) % 6 ); + final int multiplier = ( Math.abs( rand.nextInt() ) % 6 ); final int emeraldCost = emera + ( Math.abs( rand.nextInt() ) % greed ) - multiplier; - int mood = rand.nextInt() % 2; + final int mood = rand.nextInt() % 2; from.stackSize = multiplier + mood; to.stackSize = multiplier * emeraldCost - mood; @@ -75,8 +75,8 @@ public class AETrading implements IVillageTradeHandler this.addToList( list, from, to ); // Buy - ItemStack reverseTo = from.copy(); - ItemStack reverseFrom = to.copy(); + final ItemStack reverseTo = from.copy(); + final ItemStack reverseFrom = to.copy(); reverseFrom.stackSize *= rand.nextFloat() * 3.0f + 1.0f; @@ -84,7 +84,7 @@ public class AETrading implements IVillageTradeHandler } } - private void addTrade( MerchantRecipeList list, IItemDefinition inputDefinition, IItemDefinition outputDefinition, Random rand, int conversionVariance ) + private void addTrade( final MerchantRecipeList list, final IItemDefinition inputDefinition, final IItemDefinition outputDefinition, final Random rand, final int conversionVariance ) { final Optional maybeInputStack = inputDefinition.maybeStack( 1 ); final Optional maybeOutputStack = outputDefinition.maybeStack( 1 ); @@ -92,8 +92,8 @@ public class AETrading implements IVillageTradeHandler if( maybeInputStack.isPresent() && maybeOutputStack.isPresent() ) { // Sell - ItemStack inputStack = maybeInputStack.get().copy(); - ItemStack outputStack = maybeOutputStack.get().copy(); + final ItemStack inputStack = maybeInputStack.get().copy(); + final ItemStack outputStack = maybeOutputStack.get().copy(); inputStack.stackSize = 1 + ( Math.abs( rand.nextInt() ) % ( 1 + conversionVariance ) ); outputStack.stackSize = 1; @@ -102,7 +102,7 @@ public class AETrading implements IVillageTradeHandler } } - private void addToList( MerchantRecipeList l, ItemStack a, ItemStack b ) + private void addToList( final MerchantRecipeList l, final ItemStack a, final ItemStack b ) { if( a.stackSize < 1 ) { diff --git a/src/main/java/appeng/hooks/CompassManager.java b/src/main/java/appeng/hooks/CompassManager.java index f99034e9..9b26f549 100644 --- a/src/main/java/appeng/hooks/CompassManager.java +++ b/src/main/java/appeng/hooks/CompassManager.java @@ -32,28 +32,28 @@ public class CompassManager public static final CompassManager INSTANCE = new CompassManager(); final HashMap requests = new HashMap(); - public void postResult( long attunement, int x, int y, int z, CompassResult result ) + public void postResult( final long attunement, final int x, final int y, final int z, final CompassResult result ) { - CompassRequest r = new CompassRequest( attunement, x, y, z ); + final CompassRequest r = new CompassRequest( attunement, x, y, z ); this.requests.put( r, result ); } - public CompassResult getCompassDirection( long attunement, int x, int y, int z ) + public CompassResult getCompassDirection( final long attunement, final int x, final int y, final int z ) { - long now = System.currentTimeMillis(); + final long now = System.currentTimeMillis(); - Iterator i = this.requests.values().iterator(); + final Iterator i = this.requests.values().iterator(); while( i.hasNext() ) { - CompassResult res = i.next(); - long diff = now - res.time; + final CompassResult res = i.next(); + final long diff = now - res.time; if( diff > 20000 ) { i.remove(); } } - CompassRequest r = new CompassRequest( attunement, x, y, z ); + final CompassRequest r = new CompassRequest( attunement, x, y, z ); CompassResult res = this.requests.get( r ); if( res == null ) @@ -74,7 +74,7 @@ public class CompassManager return res; } - private void requestUpdate( CompassRequest r ) + private void requestUpdate( final CompassRequest r ) { NetworkHandler.instance.sendToServer( new PacketCompassRequest( r.attunement, r.cx, r.cz, r.cdy ) ); } @@ -89,7 +89,7 @@ public class CompassManager final int cdy; final int cz; - public CompassRequest( long attunement, int x, int y, int z ) + public CompassRequest( final long attunement, final int x, final int y, final int z ) { this.attunement = attunement; this.cx = x >> 4; @@ -105,7 +105,7 @@ public class CompassManager } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -115,7 +115,7 @@ public class CompassManager { return false; } - CompassRequest other = (CompassRequest) obj; + final CompassRequest other = (CompassRequest) obj; return this.attunement == other.attunement && this.cx == other.cx && this.cdy == other.cdy && this.cz == other.cz; } } diff --git a/src/main/java/appeng/hooks/CompassResult.java b/src/main/java/appeng/hooks/CompassResult.java index ead5e082..89f047d4 100644 --- a/src/main/java/appeng/hooks/CompassResult.java +++ b/src/main/java/appeng/hooks/CompassResult.java @@ -29,7 +29,7 @@ public class CompassResult public boolean requested = false; - public CompassResult( boolean hasResult, boolean spin, double rad ) + public CompassResult( final boolean hasResult, final boolean spin, final double rad ) { this.hasResult = hasResult; this.spin = spin; diff --git a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java index 887e35b7..0f46fe39 100644 --- a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java +++ b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java @@ -33,14 +33,14 @@ public final class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, final ItemStack dispensedItem ) { - EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); - World world = dispenser.getWorld(); - int i = dispenser.getXInt() + enumfacing.getFrontOffsetX(); - int j = dispenser.getYInt() + enumfacing.getFrontOffsetY(); - int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F, k + 0.5F, null ); + final EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); + final World world = dispenser.getWorld(); + final int i = dispenser.getXInt() + enumfacing.getFrontOffsetX(); + final int j = dispenser.getYInt() + enumfacing.getFrontOffsetY(); + final int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); + final 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/DispenserBlockTool.java b/src/main/java/appeng/hooks/DispenserBlockTool.java index c3308a46..85222476 100644 --- a/src/main/java/appeng/hooks/DispenserBlockTool.java +++ b/src/main/java/appeng/hooks/DispenserBlockTool.java @@ -35,20 +35,20 @@ public final class DispenserBlockTool extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, final ItemStack dispensedItem ) { - Item i = dispensedItem.getItem(); + final Item i = dispensedItem.getItem(); if( i instanceof IBlockTool ) { - EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); - IBlockTool tm = (IBlockTool) i; + final EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); + final IBlockTool tm = (IBlockTool) i; - World w = dispenser.getWorld(); + final World w = dispenser.getWorld(); if( w instanceof WorldServer ) { - int x = dispenser.getXInt() + enumfacing.getFrontOffsetX(); - int y = dispenser.getYInt() + enumfacing.getFrontOffsetY(); - int z = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); + final int x = dispenser.getXInt() + enumfacing.getFrontOffsetX(); + final int y = dispenser.getYInt() + enumfacing.getFrontOffsetY(); + final int z = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); tm.onItemUse( dispensedItem, Platform.getPlayer( (WorldServer) w ), w, x, y, z, enumfacing.ordinal(), 0.5f, 0.5f, 0.5f ); } diff --git a/src/main/java/appeng/hooks/DispenserMatterCannon.java b/src/main/java/appeng/hooks/DispenserMatterCannon.java index ab0152e4..b0ae3ece 100644 --- a/src/main/java/appeng/hooks/DispenserMatterCannon.java +++ b/src/main/java/appeng/hooks/DispenserMatterCannon.java @@ -38,14 +38,14 @@ public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, ItemStack dispensedItem ) { - Item i = dispensedItem.getItem(); + final Item i = dispensedItem.getItem(); if( i instanceof ToolMassCannon ) { - EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); + final EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() ); ForgeDirection dir = ForgeDirection.UNKNOWN; - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { if( enumfacing.getFrontOffsetX() == d.offsetX && enumfacing.getFrontOffsetY() == d.offsetY && enumfacing.getFrontOffsetZ() == d.offsetZ ) { @@ -53,12 +53,12 @@ public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem } } - ToolMassCannon tm = (ToolMassCannon) i; + final ToolMassCannon tm = (ToolMassCannon) i; - World w = dispenser.getWorld(); + final World w = dispenser.getWorld(); if( w instanceof WorldServer ) { - EntityPlayer p = Platform.getPlayer( (WorldServer) w ); + final EntityPlayer p = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( p, dir, dispenser.getBlockTileEntity() ); p.posX += dir.offsetX; diff --git a/src/main/java/appeng/hooks/TickHandler.java b/src/main/java/appeng/hooks/TickHandler.java index 92c32df0..c8e4feb5 100644 --- a/src/main/java/appeng/hooks/TickHandler.java +++ b/src/main/java/appeng/hooks/TickHandler.java @@ -80,7 +80,7 @@ public class TickHandler return this.cliPlayerColors; } - public void addCallable( World w, IWorldCallable c ) + public void addCallable( final World w, final IWorldCallable c ) { if( w == null ) { @@ -100,7 +100,7 @@ public class TickHandler } } - public void addInit( AEBaseTile tile ) + public void addInit( final AEBaseTile tile ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -117,7 +117,7 @@ public class TickHandler return this.client; } - public void addNetwork( Grid grid ) + public void addNetwork( final Grid grid ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -125,7 +125,7 @@ public class TickHandler } } - public void removeNetwork( Grid grid ) + public void removeNetwork( final Grid grid ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -144,15 +144,15 @@ public class TickHandler } @SubscribeEvent - public void unloadWorld( WorldEvent.Unload ev ) + public void unloadWorld( final WorldEvent.Unload ev ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { - LinkedList toDestroy = new LinkedList(); + final LinkedList toDestroy = new LinkedList(); - for( Grid g : this.getRepo().networks ) + for( final Grid g : this.getRepo().networks ) { - for( IGridNode n : g.getNodes() ) + for( final IGridNode n : g.getNodes() ) { if( n.getWorld() == ev.world ) { @@ -161,7 +161,7 @@ public class TickHandler } } - for( IGridNode n : toDestroy ) + for( final IGridNode n : toDestroy ) { n.destroy(); } @@ -169,9 +169,9 @@ public class TickHandler } @SubscribeEvent - public void onChunkLoad( ChunkEvent.Load load ) + public void onChunkLoad( final ChunkEvent.Load load ) { - for( Object te : load.getChunk().chunkTileEntityMap.values() ) + for( final Object te : load.getChunk().chunkTileEntityMap.values() ) { if( te instanceof AEBaseTile ) { @@ -181,14 +181,14 @@ public class TickHandler } @SubscribeEvent - public void onTick( TickEvent ev ) + public void onTick( final TickEvent ev ) { if( ev.type == Type.CLIENT && ev.phase == Phase.START ) { this.tickColors( this.cliPlayerColors ); EntityFloatingItem.ageStatic = ( EntityFloatingItem.ageStatic + 1 ) % 60000; - CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode(); + final CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode(); if( currentMode != this.crm ) { this.crm = currentMode; @@ -198,17 +198,17 @@ public class TickHandler if( ev.type == Type.WORLD && ev.phase == Phase.END ) { - WorldTickEvent wte = (WorldTickEvent) ev; + final WorldTickEvent wte = (WorldTickEvent) ev; synchronized( this.craftingJobs ) { - Collection jobSet = this.craftingJobs.get( wte.world ); + final Collection jobSet = this.craftingJobs.get( wte.world ); if( !jobSet.isEmpty() ) { - int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() ); - Iterator i = jobSet.iterator(); + final int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() ); + final Iterator i = jobSet.iterator(); while( i.hasNext() ) { - CraftingJob cj = i.next(); + final CraftingJob cj = i.next(); if( !cj.simulateFor( simTime ) ) { i.remove(); @@ -223,10 +223,10 @@ public class TickHandler { this.tickColors( this.srvPlayerColors ); // ready tiles. - HandlerRep repo = this.getRepo(); + final HandlerRep repo = this.getRepo(); while( !repo.tiles.isEmpty() ) { - AEBaseTile bt = repo.tiles.poll(); + final AEBaseTile bt = repo.tiles.poll(); if( !bt.isInvalid() ) { bt.onReady(); @@ -234,7 +234,7 @@ public class TickHandler } // tick networks. - for( Grid g : this.getRepo().networks ) + for( final Grid g : this.getRepo().networks ) { g.update(); } @@ -252,12 +252,12 @@ public class TickHandler } } - private void tickColors( HashMap playerSet ) + private void tickColors( final HashMap playerSet ) { - Iterator i = playerSet.values().iterator(); + final Iterator i = playerSet.values().iterator(); while( i.hasNext() ) { - PlayerColor pc = i.next(); + final PlayerColor pc = i.next(); if( pc.ticksLeft <= 0 ) { i.remove(); @@ -266,14 +266,14 @@ public class TickHandler } } - private void processQueue( Queue> queue, World world ) + private void processQueue( final Queue> queue, final World world ) { if( queue == null ) { return; } - Stopwatch sw = Stopwatch.createStarted(); + final Stopwatch sw = Stopwatch.createStarted(); IWorldCallable c = null; while( ( c = queue.poll() ) != null ) @@ -287,7 +287,7 @@ public class TickHandler break; } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } @@ -298,7 +298,7 @@ public class TickHandler // AELog.info( "processQueue Time: " + time + "ms" ); } - public void registerCraftingSimulation( World world, CraftingJob craftingJob ) + public void registerCraftingSimulation( final World world, final CraftingJob craftingJob ) { synchronized( this.craftingJobs ) { @@ -327,7 +327,7 @@ public class TickHandler protected final int myEntity; protected int ticksLeft; - public PlayerColor( int id, AEColor col, int ticks ) + public PlayerColor( final int id, final AEColor col, final int ticks ) { this.myEntity = id; this.myColor = col; diff --git a/src/main/java/appeng/integration/IntegrationHelper.java b/src/main/java/appeng/integration/IntegrationHelper.java index 31d078c7..783bbd48 100644 --- a/src/main/java/appeng/integration/IntegrationHelper.java +++ b/src/main/java/appeng/integration/IntegrationHelper.java @@ -22,7 +22,7 @@ package appeng.integration; public class IntegrationHelper { - public static void testClassExistence( Object o, Class clz ) + public static void testClassExistence( final Object o, final Class clz ) { clz.isInstance( o ); } diff --git a/src/main/java/appeng/integration/IntegrationNode.java b/src/main/java/appeng/integration/IntegrationNode.java index 7df9ddd1..d122d751 100644 --- a/src/main/java/appeng/integration/IntegrationNode.java +++ b/src/main/java/appeng/integration/IntegrationNode.java @@ -43,7 +43,7 @@ public final class IntegrationNode Object instance; IIntegrationModule mod = null; - public IntegrationNode( String displayName, String modID, IntegrationType shortName, String name ) + public IntegrationNode( final String displayName, final String modID, final IntegrationType shortName, final String name ) { this.displayName = displayName; this.shortName = shortName; @@ -67,7 +67,7 @@ public final class IntegrationNode return this.state != IntegrationStage.FAILED; } - void call( IntegrationStage stage ) + void call( final IntegrationStage stage ) { if( this.state != IntegrationStage.FAILED ) { @@ -85,7 +85,7 @@ public final class IntegrationNode boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ) || apiManager.hasAPI( this.modID ); AEConfig.instance.addCustomCategoryComment( "ModIntegration", "Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." ); - String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString(); + final String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString(); if( mode.toUpperCase().equals( "ON" ) ) { @@ -100,7 +100,7 @@ public final class IntegrationNode { this.classValue = this.getClass().getClassLoader().loadClass( this.name ); this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance(); - Field f = this.classValue.getField( "instance" ); + final Field f = this.classValue.getField( "instance" ); f.set( this.classValue, this.instance = this.mod ); } else @@ -126,7 +126,7 @@ public final class IntegrationNode break; } } - catch( Throwable t ) + catch( final Throwable t ) { this.failedStage = stage; this.exception = t; diff --git a/src/main/java/appeng/integration/IntegrationRegistry.java b/src/main/java/appeng/integration/IntegrationRegistry.java index c5ebfb78..1cec1adf 100644 --- a/src/main/java/appeng/integration/IntegrationRegistry.java +++ b/src/main/java/appeng/integration/IntegrationRegistry.java @@ -36,7 +36,7 @@ public enum IntegrationRegistry private final Collection modules = new LinkedList(); - public void add( IntegrationType type ) + public void add( final IntegrationType type ) { if( type.side == IntegrationSide.CLIENT && FMLLaunchHandler.side() == Side.SERVER ) { @@ -53,12 +53,12 @@ public enum IntegrationRegistry public void init() { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.PRE_INIT ); } - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.INIT ); } @@ -66,7 +66,7 @@ public enum IntegrationRegistry public void postInit() { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.POST_INIT ); } @@ -76,7 +76,7 @@ public enum IntegrationRegistry { final StringBuilder builder = new StringBuilder( this.modules.size() * 3 ); - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( builder.length() != 0 ) { @@ -90,9 +90,9 @@ public enum IntegrationRegistry return builder.toString(); } - public boolean isEnabled( IntegrationType name ) + public boolean isEnabled( final IntegrationType name ) { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( node.shortName == name ) { @@ -103,9 +103,9 @@ public enum IntegrationRegistry } @Nonnull - public Object getInstance( IntegrationType name ) + public Object getInstance( final IntegrationType name ) { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( node.shortName == name && node.isActive() ) { diff --git a/src/main/java/appeng/integration/IntegrationType.java b/src/main/java/appeng/integration/IntegrationType.java index ad08690f..583a5506 100644 --- a/src/main/java/appeng/integration/IntegrationType.java +++ b/src/main/java/appeng/integration/IntegrationType.java @@ -71,7 +71,7 @@ public enum IntegrationType public final String dspName; public final String modID; - IntegrationType( IntegrationSide side, String name, String modid ) + IntegrationType( final IntegrationSide side, final String name, final String modid ) { this.side = side; this.dspName = name; diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java index d4e2b4bf..d07800a4 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java @@ -44,9 +44,9 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar { @Override - public void rotateLeft( IBuilderContext context ) + public void rotateLeft( final IBuilderContext context ) { - CableBusContainer cbc = new CableBusContainer( this ); + final CableBusContainer cbc = new CableBusContainer( this ); cbc.readFromNBT( this.tileNBT ); cbc.rotateLeft(); @@ -62,25 +62,25 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar } @Override - public boolean canAddPart( ItemStack part, ForgeDirection side ) + public boolean canAddPart( final ItemStack part, final ForgeDirection side ) { return false; } @Override - public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner ) + public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner ) { return null; } @Override - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { return null; } @Override - public void removePart( ForgeDirection side, boolean suppressUpdate ) + public void removePart( final ForgeDirection side, final boolean suppressUpdate ) { } @@ -116,13 +116,13 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar } @Override - public boolean isBlocked( ForgeDirection side ) + public boolean isBlocked( final ForgeDirection side ) { return false; } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { return null; } @@ -140,7 +140,7 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar } @Override - public boolean hasRedstone( ForgeDirection side ) + public boolean hasRedstone( final ForgeDirection side ) { return false; } diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java index 7aeb82e3..2f5853a5 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java @@ -37,13 +37,13 @@ public class AEGenericSchematicTile extends SchematicTile { @Override - public void storeRequirements( IBuilderContext context, int x, int y, int z ) + public void storeRequirements( final IBuilderContext context, final int x, final int y, final int z ) { - TileEntity tile = context.world().getTileEntity( x, y, z ); - ArrayList list = new ArrayList(); + final TileEntity tile = context.world().getTileEntity( x, y, z ); + final ArrayList list = new ArrayList(); if( tile instanceof AEBaseTile ) { - ICommonTile tcb = (ICommonTile) tile; + final ICommonTile tcb = (ICommonTile) tile; tcb.getDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, list ); } @@ -51,12 +51,12 @@ public class AEGenericSchematicTile extends SchematicTile } @Override - public void rotateLeft( IBuilderContext context ) + public void rotateLeft( final IBuilderContext context ) { if( this.tileNBT.hasKey( "orientation_forward" ) && this.tileNBT.hasKey( "orientation_up" ) ) { - String forward = this.tileNBT.getString( "orientation_forward" ); - String up = this.tileNBT.getString( "orientation_up" ); + final String forward = this.tileNBT.getString( "orientation_forward" ); + final String up = this.tileNBT.getString( "orientation_up" ); if( forward != null && up != null ) { @@ -71,7 +71,7 @@ public class AEGenericSchematicTile extends SchematicTile this.tileNBT.setString( "orientation_forward", fdForward.name() ); this.tileNBT.setString( "orientation_up", fdUp.name() ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java index 2d9e4c51..886e2c3b 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java @@ -31,11 +31,11 @@ public class AERotatableBlockSchematic extends SchematicBlock { @Override - public void rotateLeft( IBuilderContext context ) + public void rotateLeft( final IBuilderContext context ) { if( this.meta < 6 ) { - ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN ); + final ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN ); this.meta = d.ordinal(); } } diff --git a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java index 73d63721..e94025d1 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java @@ -35,7 +35,7 @@ public class BCPipeHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { @@ -48,7 +48,7 @@ public class BCPipeHandler implements IExternalStorageHandler } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src ) { if( chan == StorageChannel.ITEMS ) { diff --git a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java index 2f078e52..d6b756f6 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java @@ -39,14 +39,14 @@ public class BCPipeInventory implements IMEInventory final TileEntity te; final ForgeDirection direction; - public BCPipeInventory( TileEntity te, ForgeDirection direction ) + public BCPipeInventory( final TileEntity te, final ForgeDirection direction ) { this.te = te; this.direction = direction; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { @@ -71,13 +71,13 @@ public class BCPipeInventory implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } diff --git a/src/main/java/appeng/integration/modules/BetterStorage.java b/src/main/java/appeng/integration/modules/BetterStorage.java index 3cc307b8..9d956996 100644 --- a/src/main/java/appeng/integration/modules/BetterStorage.java +++ b/src/main/java/appeng/integration/modules/BetterStorage.java @@ -44,13 +44,13 @@ public class BetterStorage implements IIntegrationModule, IBetterStorage } @Override - public boolean isStorageCrate( Object te ) + public boolean isStorageCrate( final Object te ) { return te instanceof ICrateStorage; } @Override - public InventoryAdaptor getAdaptor( Object te, ForgeDirection d ) + public InventoryAdaptor getAdaptor( final Object te, final ForgeDirection d ) { if( te instanceof ICrateStorage ) { diff --git a/src/main/java/appeng/integration/modules/BuildCraftBuilder.java b/src/main/java/appeng/integration/modules/BuildCraftBuilder.java index 336f1429..31ed5789 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftBuilder.java +++ b/src/main/java/appeng/integration/modules/BuildCraftBuilder.java @@ -74,7 +74,7 @@ public class BuildCraftBuilder implements IIntegrationModule { this.initBuilderSupport(); } - catch( Exception builderSupport ) + catch( final Exception builderSupport ) { // not supported? } @@ -92,7 +92,7 @@ public class BuildCraftBuilder implements IIntegrationModule final IBlocks blocks = AEApi.instance().definitions().blocks(); final IBlockDefinition maybeMultiPart = blocks.multiPart(); - for( Method blockDefinition : blocks.getClass().getMethods() ) + for( final Method blockDefinition : blocks.getClass().getMethods() ) { try { @@ -117,11 +117,11 @@ public class BuildCraftBuilder implements IIntegrationModule schematicRegistry.registerSchematicBlock( block, AEGenericSchematicTile.class ); } } - catch( InvocationTargetException ignore ) + catch( final InvocationTargetException ignore ) { AELog.warning( "Encountered problems while initializing the BuildCraft Builder support. Can not invoke the method %s", blockDefinition ); } - catch( IllegalAccessException ignore ) + catch( final IllegalAccessException ignore ) { AELog.warning( "Encountered problems while initializing the BuildCraft Builder support. Can not access the method %s", blockDefinition ); } diff --git a/src/main/java/appeng/integration/modules/BuildCraftCore.java b/src/main/java/appeng/integration/modules/BuildCraftCore.java index d1815d4a..15f889e6 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftCore.java +++ b/src/main/java/appeng/integration/modules/BuildCraftCore.java @@ -51,19 +51,19 @@ public final class BuildCraftCore implements IBuildCraftCore, IIntegrationModule } @Override - public boolean isWrench( Item eq ) + public boolean isWrench( final Item eq ) { return eq instanceof IToolWrench; } @Override - public boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z ) + public boolean canWrench( @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z ) { return ( (IToolWrench) wrench ).canWrench( wrencher, x, y, z ); } @Override - public void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z ) + public void wrenchUsed( @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z ) { ( (IToolWrench) wrench ).wrenchUsed( wrencher, x, y, z ); } diff --git a/src/main/java/appeng/integration/modules/BuildCraftTransport.java b/src/main/java/appeng/integration/modules/BuildCraftTransport.java index a0e1078b..2207caf7 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftTransport.java +++ b/src/main/java/appeng/integration/modules/BuildCraftTransport.java @@ -77,7 +77,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } @Override - public boolean isFacade( ItemStack is ) + public boolean isFacade( final ItemStack is ) { if( is == null ) { @@ -89,7 +89,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo @Nullable @Override - public IFacadePart createFacadePart( Block blk, int meta, @Nonnull ForgeDirection side ) + public IFacadePart createFacadePart( final Block blk, final int meta, @Nonnull final ForgeDirection side ) { try { @@ -98,7 +98,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo return new FacadePart( facade, side ); } - catch( Exception ignored ) + catch( final Exception ignored ) { } @@ -107,14 +107,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } @Override - public IFacadePart createFacadePart( @Nonnull ItemStack fs, @Nonnull ForgeDirection side ) + public IFacadePart createFacadePart( @Nonnull final ItemStack fs, @Nonnull final ForgeDirection side ) { return new FacadePart( fs, side ); } @Nullable @Override - public ItemStack getTextureForFacade( @Nonnull ItemStack facade ) + public ItemStack getTextureForFacade( @Nonnull final ItemStack facade ) { final Item maybeFacadeItem = facade.getItem(); @@ -142,7 +142,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo { return buildcraft.BuildCraftTransport.instance.pipeIconProvider.getIcon( PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal() ); // Structure } - catch( Exception ignored ) + catch( final Exception ignored ) { } return null; @@ -150,7 +150,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } @Override - public boolean isPipe( TileEntity te, @Nonnull ForgeDirection dir ) + public boolean isPipe( final TileEntity te, @Nonnull final ForgeDirection dir ) { if( te instanceof IPipeTile ) { @@ -162,14 +162,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } @Override - public boolean canAddItemsToPipe( TileEntity te, ItemStack is, ForgeDirection dir ) + public boolean canAddItemsToPipe( final TileEntity te, final ItemStack is, final ForgeDirection dir ) { if( is != null && te != null && te instanceof IInjectable ) { - IInjectable pt = (IInjectable) te; + final IInjectable pt = (IInjectable) te; if( pt.canInjectItems( dir ) ) { - int amt = pt.injectItem( is, false, dir, null ); + final int amt = pt.injectItem( is, false, dir, null ); if( amt == is.stackSize ) { return true; @@ -181,14 +181,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } @Override - public boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull ForgeDirection dir ) + public boolean addItemsToPipe( @Nullable final TileEntity te, @Nullable final ItemStack is, @Nonnull final ForgeDirection dir ) { if( is != null && te != null && te instanceof IInjectable ) { - IInjectable pt = (IInjectable) te; + final IInjectable pt = (IInjectable) te; if( pt.canInjectItems( dir ) ) { - int amt = pt.injectItem( is, false, dir, null ); + final int amt = pt.injectItem( is, false, dir, null ); if( amt == is.stackSize ) { pt.injectItem( is, true, dir, null ); @@ -200,7 +200,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo return false; } - private void addFacade( ItemStack item ) + private void addFacade( final ItemStack item ) { if( item != null ) { @@ -239,7 +239,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo private void registerLiquidsP2P() { - IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); + final IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsCobblestone ), TunnelType.FLUID ); reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsEmerald ), TunnelType.FLUID ); reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsGold ), TunnelType.FLUID ); @@ -283,7 +283,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo this.addFacadeStack( blocks.quartzChiseled() ); this.addFacadeStack( blocks.quartzPillar() ); - for( Block skyStoneBlock : blocks.skyStone().maybeBlock().asSet() ) + for( final Block skyStoneBlock : blocks.skyStone().maybeBlock().asSet() ) { this.addFacade( new ItemStack( skyStoneBlock, 1, 0 ) ); this.addFacade( new ItemStack( skyStoneBlock, 1, 1 ) ); @@ -292,9 +292,9 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo } } - private void addFacadeStack( IItemDefinition definition ) + private void addFacadeStack( final IItemDefinition definition ) { - for( ItemStack facadeStack : definition.maybeStack( 1 ).asSet() ) + for( final ItemStack facadeStack : definition.maybeStack( 1 ).asSet() ) { this.addFacade( facadeStack ); } diff --git a/src/main/java/appeng/integration/modules/CLApi.java b/src/main/java/appeng/integration/modules/CLApi.java index aafb5f28..8659c124 100644 --- a/src/main/java/appeng/integration/modules/CLApi.java +++ b/src/main/java/appeng/integration/modules/CLApi.java @@ -49,13 +49,13 @@ public class CLApi implements ICLApi, IIntegrationModule } @Override - public int colorLight( AEColor color, int light ) + public int colorLight( final AEColor color, final int light ) { - int mv = color.mediumVariant; + final int mv = color.mediumVariant; - float r = ( mv >> 16 ) & 0xff; - float g = ( mv >> 8 ) & 0xff; - float b = ( mv ) & 0xff; + final float r = ( mv >> 16 ) & 0xff; + final float g = ( mv >> 8 ) & 0xff; + final float b = ( mv ) & 0xff; return coloredlightscore.src.api.CLApi.makeRGBLightValue( r / 255.0f, g / 255.0f, b / 255.0f, light / 15.0f ); } diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index 76362f6d..01b3d54b 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -165,7 +165,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio } @Override - public void generateRecipes( RecipeGenerator generator ) + public void generateRecipes( final RecipeGenerator generator ) { final RecipeTemplate craftingTemplate; final RecipeTemplate smallTemplate; @@ -214,13 +214,13 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio return (List) CraftingManager.getInstance().getRecipeList(); } - private void addCraftingRecipes( RecipeTemplate template, RecipeTemplate templateSmall, RecipeTemplate templateShapeless, RecipeGenerator generator ) + private void addCraftingRecipes( final RecipeTemplate template, final RecipeTemplate templateSmall, final RecipeTemplate templateShapeless, final RecipeGenerator generator ) { final List recipes = this.getUncheckedRecipes(); int errCount = 0; - for( IRecipe recipe : recipes ) + for( final IRecipe recipe : recipes ) { try { @@ -243,7 +243,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio generator.addRecipe( template, items ); } } - catch( Exception e ) + catch( final Exception e ) { if( errCount >= 5 ) { @@ -260,12 +260,12 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio } } - private void addGrinderRecipes( IAppEngApi api, ItemStack grindstone, RecipeGenerator generator ) + private void addGrinderRecipes( final IAppEngApi api, final ItemStack grindstone, final RecipeGenerator generator ) { final ItemStack handle = api.definitions().blocks().crankHandle().maybeStack( 1 ).orNull(); final RecipeTemplate grinderTemplate = generator.createRecipeTemplate( GRINDER_SLOTS, grindstone ); - for( IGrinderEntry recipe : api.registries().grinder().getRecipes() ) + for( final IGrinderEntry recipe : api.registries().grinder().getRecipes() ) { generator.addRecipe( grinderTemplate, new Object[] { recipe.getInput(), @@ -284,11 +284,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio } } - private void addInscriberRecipes( IAppEngApi api, ItemStack inscriber, RecipeGenerator generator ) + private void addInscriberRecipes( final IAppEngApi api, final ItemStack inscriber, final RecipeGenerator generator ) { final RecipeTemplate inscriberTemplate = generator.createRecipeTemplate( INSCRIBER_SLOTS, inscriber ); - for( IInscriberRecipe recipe : api.registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : api.registries().inscriber().getRecipes() ) { generator.addRecipe( inscriberTemplate, new Object[] { recipe.getInputs(), @@ -300,7 +300,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio } } - private Object[] getCraftingShapelessRecipe( List items, ItemStack recipeOutput ) + private Object[] getCraftingShapelessRecipe( final List items, final ItemStack recipeOutput ) { final Object[] output = new Object[10]; @@ -319,11 +319,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio { output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } @@ -335,7 +335,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio return output; } - private Object[] getSmallShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput ) + private Object[] getSmallShapedRecipe( final int width, final int height, final Object[] items, final ItemStack recipeOutput ) { final Object[] output = new Object[5]; @@ -357,11 +357,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio { output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } @@ -374,7 +374,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio return output; } - private Object[] getCraftingShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput ) + private Object[] getCraftingShapedRecipe( final int width, final int height, final Object[] items, final ItemStack recipeOutput ) { final Object[] output = new Object[10]; @@ -396,11 +396,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio { output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } @@ -413,7 +413,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio return output; } - private Object toCG( ItemStack[] itemStackSet ) + private Object toCG( final ItemStack[] itemStackSet ) { final List list = Arrays.asList( itemStackSet ); @@ -430,7 +430,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio } @Nullable - private Object[] getCraftingRecipe( IRecipe recipe, boolean allowSmallGrid ) + private Object[] getCraftingRecipe( final IRecipe recipe, final boolean allowSmallGrid ) { if( recipe instanceof ShapelessRecipe ) { diff --git a/src/main/java/appeng/integration/modules/DSU.java b/src/main/java/appeng/integration/modules/DSU.java index d156fbc5..9e1c8abc 100644 --- a/src/main/java/appeng/integration/modules/DSU.java +++ b/src/main/java/appeng/integration/modules/DSU.java @@ -45,13 +45,13 @@ public class DSU implements IDSU, IIntegrationModule } @Override - public IMEInventory getDSU( TileEntity te ) + public IMEInventory getDSU( final TileEntity te ) { return new MinefactoryReloadedDeepStorageUnit( te ); } @Override - public boolean isDSU( TileEntity te ) + public boolean isDSU( final TileEntity te ) { return te instanceof IDeepStorageUnit; } diff --git a/src/main/java/appeng/integration/modules/FMP.java b/src/main/java/appeng/integration/modules/FMP.java index d664a52e..b7c1dab9 100644 --- a/src/main/java/appeng/integration/modules/FMP.java +++ b/src/main/java/appeng/integration/modules/FMP.java @@ -63,9 +63,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF public static FMP instance; @Override - public TMultiPart createPart( String name, boolean client ) + public TMultiPart createPart( final String name, final boolean client ) { - for( PartRegistry pr : PartRegistry.values() ) + for( final PartRegistry pr : PartRegistry.values() ) { if( pr.getName().equals( name ) ) { @@ -77,15 +77,15 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF } @Override - public TMultiPart convert( World world, BlockCoord pos ) + public TMultiPart convert( final World world, final BlockCoord pos ) { - Block blk = world.getBlock( pos.x, pos.y, pos.z ); - int meta = world.getBlockMetadata( pos.x, pos.y, pos.z ); + final Block blk = world.getBlock( pos.x, pos.y, pos.z ); + final int meta = world.getBlockMetadata( pos.x, pos.y, pos.z ); - TMultiPart part = PartRegistry.getPartByBlock( blk, meta ); + final TMultiPart part = PartRegistry.getPartByBlock( blk, meta ); if( part instanceof CableBusPart ) { - CableBusPart cbp = (CableBusPart) part; + final CableBusPart cbp = (CableBusPart) part; cbp.convertFromTile( world.getTileEntity( pos.x, pos.y, pos.z ) ); } @@ -104,9 +104,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF return blockTypes; } - private void addBlockTypes( Collection blockTypes, IBlockDefinition definition ) + private void addBlockTypes( final Collection blockTypes, final IBlockDefinition definition ) { - for( Block block : definition.maybeBlock().asSet() ) + for( final Block block : definition.maybeBlock().asSet() ) { blockTypes.add( block ); } @@ -125,9 +125,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF this.createAndRegister( blocks.skyStone(), 2 ); this.createAndRegister( blocks.skyStone(), 3 ); - PartRegistry[] reg = PartRegistry.values(); + final PartRegistry[] reg = PartRegistry.values(); - String[] data = new String[reg.length]; + final String[] data = new String[reg.length]; for( int x = 0; x < data.length; x++ ) { data[x] = reg[x].getName(); @@ -139,9 +139,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF MultipartGenerator.registerPassThroughInterface( "appeng.helpers.AEMultiTile" ); } - private void createAndRegister( IBlockDefinition definition, int i ) + private void createAndRegister( final IBlockDefinition definition, final int i ) { - for( Block block : definition.maybeBlock().asSet() ) + for( final Block block : definition.maybeBlock().asSet() ) { BlockMicroMaterial.createAndRegister( block, i ); } @@ -154,19 +154,19 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF } @Override - public IPartHost getOrCreateHost( TileEntity tile ) + public IPartHost getOrCreateHost( final TileEntity tile ) { try { - BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord ); + final BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord ); - TileMultipart mp = TileMultipart.getOrConvertTile( tile.getWorldObj(), loc ); + final TileMultipart mp = TileMultipart.getOrConvertTile( tile.getWorldObj(), loc ); if( mp != null ) { - scala.collection.Iterator i = mp.partList().iterator(); + final scala.collection.Iterator i = mp.partList().iterator(); while( i.hasNext() ) { - TMultiPart p = i.next(); + final TMultiPart p = i.next(); if( p instanceof CableBusPart ) { return (IPartHost) p; @@ -176,7 +176,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF return new FMPPlacementHelper( mp ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -184,15 +184,15 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF } @Override - public CableBusContainer getCableContainer( TileEntity te ) + public CableBusContainer getCableContainer( final TileEntity te ) { if( te instanceof TileMultipart ) { - TileMultipart mp = (TileMultipart) te; - scala.collection.Iterator i = mp.partList().iterator(); + final TileMultipart mp = (TileMultipart) te; + final scala.collection.Iterator i = mp.partList().iterator(); while( i.hasNext() ) { - TMultiPart p = i.next(); + final TMultiPart p = i.next(); if( p instanceof CableBusPart ) { return ( (CableBusPart) p ).cb; @@ -203,13 +203,13 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF } @Override - public void registerPassThrough( Class layerInterface ) + public void registerPassThrough( final Class layerInterface ) { try { MultipartGenerator.registerPassThroughInterface( layerInterface.getName() ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.severe( "Failed to register " + layerInterface.getName() + " with FMP, some features may not work with MultiParts." ); AELog.error( t ); @@ -217,7 +217,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF } @Override - public Event newFMPPacketEvent( EntityPlayerMP sender ) + public Event newFMPPacketEvent( final EntityPlayerMP sender ) { return new FMPPacketEvent( sender ); } diff --git a/src/main/java/appeng/integration/modules/FZ.java b/src/main/java/appeng/integration/modules/FZ.java index cda928ca..4aefa98a 100644 --- a/src/main/java/appeng/integration/modules/FZ.java +++ b/src/main/java/appeng/integration/modules/FZ.java @@ -51,7 +51,7 @@ public class FZ implements IFZ, IIntegrationModule private static Field day_item; @Override - public ItemStack barrelGetItem( TileEntity te ) + public ItemStack barrelGetItem( final TileEntity te ) { try { @@ -69,17 +69,17 @@ public class FZ implements IFZ, IIntegrationModule return i; } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - catch( IllegalAccessException ignored ) + catch( final IllegalAccessException ignored ) { } return null; } @Override - public int barrelGetMaxItemCount( TileEntity te ) + public int barrelGetMaxItemCount( final TileEntity te ) { try { @@ -88,20 +88,20 @@ public class FZ implements IFZ, IIntegrationModule return (Integer) day_getMaxSize.invoke( te ); } } - catch( IllegalAccessException ignored ) + catch( final IllegalAccessException ignored ) { } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - catch( InvocationTargetException ignored ) + catch( final InvocationTargetException ignored ) { } return 0; } @Override - public int barrelGetItemCount( TileEntity te ) + public int barrelGetItemCount( final TileEntity te ) { try { @@ -110,20 +110,20 @@ public class FZ implements IFZ, IIntegrationModule return (Integer) day_getItemCount.invoke( te ); } } - catch( IllegalAccessException ignored ) + catch( final IllegalAccessException ignored ) { } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - catch( InvocationTargetException ignored ) + catch( final InvocationTargetException ignored ) { } return 0; } @Override - public void setItemType( TileEntity te, ItemStack input ) + public void setItemType( final TileEntity te, final ItemStack input ) { try { @@ -132,16 +132,16 @@ public class FZ implements IFZ, IIntegrationModule day_item.set( te, input == null ? null : input.copy() ); } } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - catch( IllegalAccessException ignored ) + catch( final IllegalAccessException ignored ) { } } @Override - public void barrelSetCount( TileEntity te, int max ) + public void barrelSetCount( final TileEntity te, final int max ) { try { @@ -152,43 +152,43 @@ public class FZ implements IFZ, IIntegrationModule te.markDirty(); } - catch( IllegalAccessException ignored ) + catch( final IllegalAccessException ignored ) { } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - catch( InvocationTargetException ignored ) + catch( final InvocationTargetException ignored ) { } } @Override - public IMEInventory getFactorizationBarrel( TileEntity te ) + public IMEInventory getFactorizationBarrel( final TileEntity te ) { return new FactorizationBarrel( this, te ); } @Override - public boolean isBarrel( TileEntity te ) + public boolean isBarrel( final TileEntity te ) { return day_BarrelClass.isAssignableFrom( te.getClass() ); } @Override - public void grinderRecipe( ItemStack in, ItemStack out ) + public void grinderRecipe( final ItemStack in, final ItemStack out ) { try { - Class c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" ); - Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class ); + final Class c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" ); + final Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class ); - float amt = out.stackSize; + final float amt = out.stackSize; out.stackSize = 1; m.invoke( c, in, out, amt ); } - catch( Throwable t ) + catch( final Throwable t ) { // AELog.info( "" ); // throw new RuntimeException( t ); diff --git a/src/main/java/appeng/integration/modules/IC2.java b/src/main/java/appeng/integration/modules/IC2.java index 843d2eff..bf568779 100644 --- a/src/main/java/appeng/integration/modules/IC2.java +++ b/src/main/java/appeng/integration/modules/IC2.java @@ -67,7 +67,7 @@ public class IC2 implements IIC2, IIntegrationModule @Override public void postInit() { - IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); + final IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); reg.addNewAttunement( this.getItem( "copperCableItem" ), TunnelType.IC2_POWER ); reg.addNewAttunement( this.getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER ); reg.addNewAttunement( this.getItem( "goldCableItem" ), TunnelType.IC2_POWER ); @@ -85,25 +85,25 @@ public class IC2 implements IIC2, IIntegrationModule } @Override - public void addToEnergyNet( TileEntity appEngTile ) + public void addToEnergyNet( final TileEntity appEngTile ) { MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) appEngTile ) ); } @Override - public void removeFromEnergyNet( TileEntity appEngTile ) + public void removeFromEnergyNet( final TileEntity appEngTile ) { MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) appEngTile ) ); } @Override - public ItemStack getItem( String name ) + public ItemStack getItem( final String name ) { return ic2.api.item.IC2Items.getItem( name ); } @Override - public void maceratorRecipe( ItemStack in, ItemStack out ) + public void maceratorRecipe( final ItemStack in, final ItemStack out ) { ic2.api.recipe.Recipes.macerator.addRecipe( new RecipeInputItemStack( in, in.stackSize ), null, out ); } diff --git a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java index ada8d24c..25642375 100644 --- a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java +++ b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java @@ -70,7 +70,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu this.mergeIntoMicroblockContainer = this.MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class, int.class, int.class, int.class, int.class, Block.class, int.class ); this.canConvertTiles = true; } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -83,7 +83,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu } @Override - public IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te ) + public IPartHost getOrCreateHost( final EntityPlayer player, final int side, final TileEntity te ) { final World w = te.getWorldObj(); final int x = te.xCoord; @@ -110,7 +110,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu // int.class, int.class, int.class, int.class, Block.class, int.class ); this.mergeIntoMicroblockContainer.invoke( null, multiPartStack, player, w, x, y, z, side, multiPartBlock, 0 ); } - catch( Throwable e ) + catch( final Throwable e ) { this.canConvertTiles = false; return null; @@ -128,11 +128,11 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu } @Override - public boolean leaveParts( TileEntity te ) + public boolean leaveParts( final TileEntity te ) { if( te instanceof IMultipartTile ) { - ICoverSystem ci = ( (IMultipartTile) te ).getCoverSystem(); + final ICoverSystem ci = ( (IMultipartTile) te ).getCoverSystem(); if( ci != null ) { ci.convertToContainerBlock(); diff --git a/src/main/java/appeng/integration/modules/InvTweaks.java b/src/main/java/appeng/integration/modules/InvTweaks.java index 1811642c..524dc725 100644 --- a/src/main/java/appeng/integration/modules/InvTweaks.java +++ b/src/main/java/appeng/integration/modules/InvTweaks.java @@ -60,7 +60,7 @@ public class InvTweaks implements IInvTweaks, IIntegrationModule } @Override - public int compareItems( ItemStack i, ItemStack j ) + public int compareItems( final ItemStack i, final ItemStack j ) { return api.compareItems( i, j ); } diff --git a/src/main/java/appeng/integration/modules/Mekanism.java b/src/main/java/appeng/integration/modules/Mekanism.java index 129a4837..efb34fcb 100644 --- a/src/main/java/appeng/integration/modules/Mekanism.java +++ b/src/main/java/appeng/integration/modules/Mekanism.java @@ -52,7 +52,7 @@ public final class Mekanism implements IMekanism, IIntegrationModule } @Override - public void addCrusherRecipe( ItemStack in, ItemStack out ) + public void addCrusherRecipe( final ItemStack in, final ItemStack out ) { final NBTTagCompound sendTag = this.convertToSimpleRecipe( in, out ); @@ -60,14 +60,14 @@ public final class Mekanism implements IMekanism, IIntegrationModule } @Override - public void addEnrichmentChamberRecipe( ItemStack in, ItemStack out ) + public void addEnrichmentChamberRecipe( final ItemStack in, final ItemStack out ) { final NBTTagCompound sendTag = this.convertToSimpleRecipe( in, out ); FMLInterModComms.sendMessage( "mekanism", "EnrichmentChamberRecipe", sendTag ); } - private NBTTagCompound convertToSimpleRecipe( ItemStack in, ItemStack out ) + private NBTTagCompound convertToSimpleRecipe( final ItemStack in, final ItemStack out ) { final NBTTagCompound sendTag = new NBTTagCompound(); final NBTTagCompound inputTagDummy = new NBTTagCompound(); diff --git a/src/main/java/appeng/integration/modules/NEI.java b/src/main/java/appeng/integration/modules/NEI.java index f69c2b3a..9a399e77 100644 --- a/src/main/java/appeng/integration/modules/NEI.java +++ b/src/main/java/appeng/integration/modules/NEI.java @@ -99,20 +99,20 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule GuiContainerManager.addTooltipHandler( this ); // crafting terminal... - Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); - Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); + final Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); + final Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); - Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class ); + final Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class ); registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() ); registerGuiOverlay.invoke( this.apiClass, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder() ); - Class defaultHandler = NEICraftingHandler.class; - Constructor defaultConstructor = defaultHandler.getConstructor( int.class, int.class ); + final Class defaultHandler = NEICraftingHandler.class; + final Constructor defaultConstructor = defaultHandler.getConstructor( int.class, int.class ); registrar.invoke( this.apiClass, GuiCraftingTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" ); registrar.invoke( this.apiClass, GuiPatternTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" ); } - public void registerRecipeHandler( Object o ) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException + public void registerRecipeHandler( final Object o ) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { this.registerRecipeHandler.invoke( this.apiClass, o ); this.registerUsageHandler.invoke( this.apiClass, o ); @@ -125,58 +125,58 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule } @Override - public void drawSlot( Slot s ) + public void drawSlot( final Slot s ) { if( s == null ) { return; } - ItemStack stack = s.getStack(); + final ItemStack stack = s.getStack(); if( stack == null ) { return; } - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - int x = s.xDisplayPosition; - int y = s.yDisplayPosition; + final Minecraft mc = Minecraft.getMinecraft(); + final FontRenderer fontRenderer = mc.fontRenderer; + final int x = s.xDisplayPosition; + final int y = s.yDisplayPosition; GuiContainerManager.drawItems.renderItemAndEffectIntoGUI( fontRenderer, mc.getTextureManager(), stack, x, y ); GuiContainerManager.drawItems.renderItemOverlayIntoGUI( fontRenderer, mc.getTextureManager(), stack, x, y, String.valueOf( stack.stackSize ) ); } @Override - public RenderItem setItemRender( RenderItem renderItem ) + public RenderItem setItemRender( final RenderItem renderItem ) { try { - RenderItem ri = GuiContainerManager.drawItems; + final RenderItem ri = GuiContainerManager.drawItems; GuiContainerManager.drawItems = renderItem; return ri; } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( "Invalid version of NEI, please update", t ); } } @Override - public List handleTooltip( GuiContainer arg0, int arg1, int arg2, List current ) + public List handleTooltip( final GuiContainer arg0, final int arg1, final int arg2, final List current ) { return current; } @Override - public List handleItemDisplayName( GuiContainer arg0, ItemStack arg1, List current ) + public List handleItemDisplayName( final GuiContainer arg0, final ItemStack arg1, final List current ) { return current; } @Override - public List handleItemTooltip( GuiContainer guiScreen, ItemStack stack, int mouseX, int mouseY, List currentToolTip ) + public List handleItemTooltip( final GuiContainer guiScreen, final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip ) { if( guiScreen instanceof AEBaseMEGui ) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java index 7742cb43..5bacb139 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java @@ -58,18 +58,18 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( String outputId, Object... results ) + public void loadCraftingRecipes( final String outputId, final Object... results ) { if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIAEShapedRecipeHandler.class ) ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapedRecipe ) ) { if( ( (ShapedRecipe) recipe ).isEnabled() ) { - CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); + final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -83,16 +83,16 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( ItemStack result ) + public void loadCraftingRecipes( final ItemStack result ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapedRecipe ) ) { if( ( (ShapedRecipe) recipe ).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) ) { - CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); + final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -101,14 +101,14 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } @Override - public void loadUsageRecipes( ItemStack ingredient ) + public void loadUsageRecipes( final ItemStack ingredient ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapedRecipe ) ) { - CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); + final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe ); if( ( (ShapedRecipe) recipe ).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) { @@ -142,21 +142,21 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) ); } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { - IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); + final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); if( renderer != null ) { return renderer; } - IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); + final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); if( positioner == null ) { return null; @@ -166,9 +166,9 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { - IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); + final IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); if( handler != null ) { return handler; @@ -177,9 +177,9 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler return RecipeInfo.getOverlayHandler( gui, "crafting2x2" ); } - public boolean isRecipe2x2( int recipe ) + public boolean isRecipe2x2( final int recipe ) { - for( PositionedStack stack : this.getIngredientStacks( recipe ) ) + for( final PositionedStack stack : this.getIngredientStacks( recipe ) ) { if( ( stack.relx > 43 ) || ( stack.rely > 24 ) ) { @@ -201,36 +201,36 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler public final List ingredients; public final PositionedStack result; - public CachedShapedRecipe( ShapedRecipe recipe ) + public CachedShapedRecipe( final ShapedRecipe recipe ) { this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); this.ingredients = new ArrayList(); this.setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() ); } - public void setIngredients( int width, int height, Object[] items ) + public void setIngredients( final int width, final int height, final Object[] items ) { - boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI(); + final boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI(); for( int x = 0; x < width; x++ ) { for( int y = 0; y < height; y++ ) { if( items[( y * width + x )] != null ) { - IIngredient ing = (IIngredient) items[( y * width + x )]; + final IIngredient ing = (IIngredient) items[( y * width + x )]; try { - ItemStack[] is = ing.getItemStackSet(); - PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : is, 25 + x * 18, 6 + y * 18, false ); + final ItemStack[] is = ing.getItemStackSet(); + final PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : is, 25 + x * 18, 6 + y * 18, false ); stack.setMaxSize( 1 ); this.ingredients.add( stack ); } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } @@ -253,7 +253,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler public void computeVisuals() { - for( PositionedStack p : this.ingredients ) + for( final PositionedStack p : this.ingredients ) { p.generatePermutations(); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java index 6430f933..9baa1754 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java @@ -58,18 +58,18 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( String outputId, Object... results ) + public void loadCraftingRecipes( final String outputId, final Object... results ) { if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIAEShapelessRecipeHandler.class ) ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapelessRecipe ) ) { if( ( (ShapelessRecipe) recipe ).isEnabled() ) { - CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); + final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -83,16 +83,16 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( ItemStack result ) + public void loadCraftingRecipes( final ItemStack result ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapelessRecipe ) ) { if( ( (ShapelessRecipe) recipe ).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) ) { - CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); + final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -101,14 +101,14 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } @Override - public void loadUsageRecipes( ItemStack ingredient ) + public void loadUsageRecipes( final ItemStack ingredient ) { - List recipes = CraftingManager.getInstance().getRecipeList(); - for( IRecipe recipe : recipes ) + final List recipes = CraftingManager.getInstance().getRecipeList(); + for( final IRecipe recipe : recipes ) { if( ( recipe instanceof ShapelessRecipe ) ) { - CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); + final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe ); if( ( (ShapelessRecipe) recipe ).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) { @@ -142,21 +142,21 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) ); } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { - IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); + final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); if( renderer != null ) { return renderer; } - IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); + final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); if( positioner == null ) { return null; @@ -166,9 +166,9 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { - IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); + final IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); if( handler != null ) { return handler; @@ -177,9 +177,9 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler return RecipeInfo.getOverlayHandler( gui, "crafting2x2" ); } - public boolean isRecipe2x2( int recipe ) + public boolean isRecipe2x2( final int recipe ) { - for( PositionedStack stack : this.getIngredientStacks( recipe ) ) + for( final PositionedStack stack : this.getIngredientStacks( recipe ) ) { if( ( stack.relx > 43 ) || ( stack.rely > 24 ) ) { @@ -201,7 +201,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler public final List ingredients; public final PositionedStack result; - public CachedShapelessRecipe( ShapelessRecipe recipe ) + public CachedShapelessRecipe( final ShapelessRecipe recipe ) { this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 ); this.ingredients = new ArrayList(); @@ -220,29 +220,29 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler return this.getCycledIngredients( NEIAEShapelessRecipeHandler.this.cycleticks / 20, this.ingredients ); } - public void setIngredients( Object[] items ) + public void setIngredients( final Object[] items ) { - boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI(); + final boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI(); for( int x = 0; x < 3; x++ ) { for( int y = 0; y < 3; y++ ) { if( items.length > ( y * 3 + x ) ) { - IIngredient ing = (IIngredient) items[( y * 3 + x )]; + final IIngredient ing = (IIngredient) items[( y * 3 + x )]; try { - ItemStack[] is = ing.getItemStackSet(); - PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : ing.getItemStackSet(), 25 + x * 18, 6 + y * 18, false ); + final ItemStack[] is = ing.getItemStackSet(); + final PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : ing.getItemStackSet(), 25 + x * 18, 6 + y * 18, false ); stack.setMaxSize( 1 ); this.ingredients.add( stack ); } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } @@ -253,7 +253,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler public void computeVisuals() { - for( PositionedStack p : this.ingredients ) + for( final PositionedStack p : this.ingredients ) { p.generatePermutations(); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java index 6d7f3562..7d4db558 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java @@ -47,50 +47,50 @@ public class NEICraftingHandler implements IOverlayHandler final int offsetX; final int offsetY; - public NEICraftingHandler( int x, int y ) + public NEICraftingHandler( final int x, final int y ) { this.offsetX = x; this.offsetY = y; } @Override - public void overlayRecipe( GuiContainer gui, IRecipeHandler recipe, int recipeIndex, boolean shift ) + public void overlayRecipe( final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, final boolean shift ) { try { - List ingredients = recipe.getIngredientStacks( recipeIndex ); + final List ingredients = recipe.getIngredientStacks( recipeIndex ); this.overlayRecipe( gui, ingredients, shift ); } - catch( Exception ignored ) + catch( final Exception ignored ) { } - catch( Error ignored ) + catch( final Error ignored ) { } } - public void overlayRecipe( GuiContainer gui, List ingredients, boolean shift ) + public void overlayRecipe( final GuiContainer gui, final List ingredients, final boolean shift ) { try { - NBTTagCompound recipe = new NBTTagCompound(); + final NBTTagCompound recipe = new NBTTagCompound(); if( gui instanceof GuiCraftingTerm || gui instanceof GuiPatternTerm ) { - for( PositionedStack positionedStack : ingredients ) + for( final PositionedStack positionedStack : ingredients ) { - int col = ( positionedStack.relx - 25 ) / 18; - int row = ( positionedStack.rely - 6 ) / 18; + final int col = ( positionedStack.relx - 25 ) / 18; + final int row = ( positionedStack.rely - 6 ) / 18; if( positionedStack.items != null && positionedStack.items.length > 0 ) { - for( Slot slot : (List) gui.inventorySlots.inventorySlots ) + for( final Slot slot : (List) gui.inventorySlots.inventorySlots ) { if( slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix ) { if( slot.getSlotIndex() == col + row * 3 ) { - NBTTagList tags = new NBTTagList(); - List list = new LinkedList(); + final NBTTagList tags = new NBTTagList(); + final List list = new LinkedList(); // prefer pure crystals. for( int x = 0; x < positionedStack.items.length; x++ ) @@ -105,9 +105,9 @@ public class NEICraftingHandler implements IOverlayHandler } } - for( ItemStack is : list ) + for( final ItemStack is : list ) { - NBTTagCompound tag = new NBTTagCompound(); + final NBTTagCompound tag = new NBTTagCompound(); is.writeToNBT( tag ); tags.appendTag( tag ); } @@ -123,10 +123,10 @@ public class NEICraftingHandler implements IOverlayHandler NetworkHandler.instance.sendToServer( new PacketNEIRecipe( recipe ) ); } } - catch( Exception ignored ) + catch( final Exception ignored ) { } - catch( Error ignored ) + catch( final Error ignored ) { } } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java index b44f1850..912dcad7 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java @@ -64,16 +64,16 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( String outputId, Object... results ) + public void loadCraftingRecipes( final String outputId, final Object... results ) { if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIFacadeRecipeHandler.class ) ) { final List facades = this.facade.getFacades(); - for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) + for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) { - for( ItemStack is : facades ) + for( final ItemStack is : facades ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is ); + final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is ); recipe.computeVisuals(); this.arecipes.add( recipe ); } @@ -86,13 +86,13 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( ItemStack result ) + public void loadCraftingRecipes( final ItemStack result ) { if( result.getItem() == this.facade ) { - for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) + for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, result ); + final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, result ); recipe.computeVisuals(); this.arecipes.add( recipe ); } @@ -100,14 +100,14 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } @Override - public void loadUsageRecipes( ItemStack ingredient ) + public void loadUsageRecipes( final ItemStack ingredient ) { - List facades = this.facade.getFacades(); - for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) + final List facades = this.facade.getFacades(); + for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() ) { - for( ItemStack is : facades ) + for( final ItemStack is : facades ) { - CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is ); + final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is ); if( recipe.contains( recipe.ingredients, ingredient.getItem() ) ) { @@ -141,21 +141,21 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) ); } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { - IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); + final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe ); if( renderer != null ) { return renderer; } - IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); + final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" ); if( positioner == null ) { return null; @@ -165,9 +165,9 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { - IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); + final IOverlayHandler handler = super.getOverlayHandler( gui, recipe ); if( handler != null ) { return handler; @@ -176,9 +176,9 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler return RecipeInfo.getOverlayHandler( gui, "crafting2x2" ); } - public boolean isRecipe2x2( int recipe ) + public boolean isRecipe2x2( final int recipe ) { - for( PositionedStack stack : this.getIngredientStacks( recipe ) ) + for( final PositionedStack stack : this.getIngredientStacks( recipe ) ) { if( ( stack.relx > 43 ) || ( stack.rely > 24 ) ) { @@ -199,16 +199,16 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler public final List ingredients; public final PositionedStack result; - public CachedShapedRecipe( IFacadeItem facade, ItemStack anchor, ItemStack output ) + public CachedShapedRecipe( final IFacadeItem facade, final ItemStack anchor, final ItemStack output ) { output.stackSize = 4; this.result = new PositionedStack( output, 119, 24 ); this.ingredients = new ArrayList(); - ItemStack in = facade.getTextureItem( output ); + final ItemStack in = facade.getTextureItem( output ); this.setIngredients( 3, 3, new Object[] { null, anchor, null, anchor, in, anchor, null, anchor, null } ); } - public void setIngredients( int width, int height, Object[] items ) + public void setIngredients( final int width, final int height, final Object[] items ) { for( int x = 0; x < width; x++ ) { @@ -216,8 +216,8 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler { if( items[( y * width + x )] != null ) { - ItemStack is = (ItemStack) items[( y * width + x )]; - PositionedStack stack = new PositionedStack( is, 25 + x * 18, 6 + y * 18, false ); + final ItemStack is = (ItemStack) items[( y * width + x )]; + final PositionedStack stack = new PositionedStack( is, 25 + x * 18, 6 + y * 18, false ); stack.setMaxSize( 1 ); this.ingredients.add( stack ); } @@ -239,7 +239,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler public void computeVisuals() { - for( PositionedStack p : this.ingredients ) + for( final PositionedStack p : this.ingredients ) { p.generatePermutations(); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java index 6d0cce64..0b2d48c7 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java @@ -55,13 +55,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( String outputId, Object... results ) + public void loadCraftingRecipes( final String outputId, final Object... results ) { if( ( outputId.equals( "grindstone" ) ) && ( this.getClass() == NEIGrinderRecipeHandler.class ) ) { - for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) + for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) { - CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); + final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -73,13 +73,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( ItemStack result ) + public void loadCraftingRecipes( final ItemStack result ) { - for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) + for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) { if( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) ) { - CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); + final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -87,11 +87,11 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public void loadUsageRecipes( ItemStack ingredient ) + public void loadUsageRecipes( final ItemStack ingredient ) { - for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) + for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() ) { - CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); + final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe ); if( ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) ) { @@ -108,7 +108,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler @Override public String getGuiTexture() { - ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" ); + final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" ); return loc.toString(); } @@ -126,7 +126,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public void drawBackground( int recipe ) + public void drawBackground( final int recipe ) { GL11.glColor4f( 1, 1, 1, 1 ); GuiDraw.changeTexture( this.getGuiTexture() ); @@ -134,25 +134,25 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public void drawForeground( int recipe ) + public void drawForeground( final int recipe ) { super.drawForeground( recipe ); if( this.arecipes.size() > recipe ) { - CachedRecipe cr = this.arecipes.get( recipe ); + final CachedRecipe cr = this.arecipes.get( recipe ); if( cr instanceof CachedGrindStoneRecipe ) { - CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr; + final CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr; if( cachedRecipe.hasOptional ) { - FontRenderer fr = Minecraft.getMinecraft().fontRenderer; - int width = fr.getStringWidth( cachedRecipe.displayChance ); + final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; + final int width = fr.getStringWidth( cachedRecipe.displayChance ); fr.drawString( cachedRecipe.displayChance, ( 168 - width ) / 2, 5, 0 ); } else { - FontRenderer fr = Minecraft.getMinecraft().fontRenderer; - int width = fr.getStringWidth( GuiText.NoSecondOutput.getLocal() ); + final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; + final int width = fr.getStringWidth( GuiText.NoSecondOutput.getLocal() ); fr.drawString( GuiText.NoSecondOutput.getLocal(), ( 168 - width ) / 2, 5, 0 ); } } @@ -160,19 +160,19 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return false; } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { return null; } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { return null; } @@ -190,7 +190,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler public String displayChance; boolean hasOptional = false; - public CachedGrindStoneRecipe( IGrinderEntry recipe ) + public CachedGrindStoneRecipe( final IGrinderEntry recipe ) { this.result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 ); this.ingredients = new ArrayList(); @@ -233,7 +233,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler public void computeVisuals() { - for( PositionedStack p : this.ingredients ) + for( final PositionedStack p : this.ingredients ) { p.generatePermutations(); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java index a9bedb1b..40f49d1e 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java @@ -59,13 +59,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( String outputId, Object... results ) + public void loadCraftingRecipes( final String outputId, final Object... results ) { if( ( outputId.equals( "inscriber" ) ) && ( this.getClass() == NEIInscriberRecipeHandler.class ) ) { - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); + final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -77,13 +77,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } @Override - public void loadCraftingRecipes( ItemStack result ) + public void loadCraftingRecipes( final ItemStack result ) { - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { if( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) ) { - CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); + final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); cachedRecipe.computeVisuals(); this.arecipes.add( cachedRecipe ); } @@ -91,11 +91,11 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } @Override - public void loadUsageRecipes( ItemStack ingredient ) + public void loadUsageRecipes( final ItemStack ingredient ) { - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); + final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe ); if( ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) ) { @@ -112,7 +112,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler @Override public String getGuiTexture() { - ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/inscriber.png" ); + final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/inscriber.png" ); return loc.toString(); } @@ -129,7 +129,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } @Override - public void drawBackground( int recipe ) + public void drawBackground( final int recipe ) { GL11.glColor4f( 1, 1, 1, 1 ); GuiDraw.changeTexture( this.getGuiTexture() ); @@ -137,19 +137,19 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return false; } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { return null; } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { return null; } @@ -166,19 +166,19 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler public final List ingredients; public final PositionedStack result; - public CachedInscriberRecipe( IInscriberRecipe recipe ) + public CachedInscriberRecipe( final IInscriberRecipe recipe ) { this.result = new PositionedStack( recipe.getOutput(), 108, 29 ); this.ingredients = new ArrayList(); - for( ItemStack top : recipe.getTopOptional().asSet() ) + for( final ItemStack top : recipe.getTopOptional().asSet() ) { this.ingredients.add( new PositionedStack( top, 40, 5 ) ); } this.ingredients.add( new PositionedStack( recipe.getInputs(), 40 + 18, 28 ) ); - for( ItemStack bot : recipe.getBottomOptional().asSet() ) + for( final ItemStack bot : recipe.getBottomOptional().asSet() ) { this.ingredients.add( new PositionedStack( bot, 40, 51 ) ); } @@ -198,7 +198,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler public void computeVisuals() { - for( PositionedStack p : this.ingredients ) + for( final PositionedStack p : this.ingredients ) { p.generatePermutations(); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java index 3cda1e0c..b5c8f4aa 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java @@ -72,38 +72,38 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } @Override - public void drawBackground( int recipe ) + public void drawBackground( final int recipe ) { GL11.glColor4f( 1, 1, 1, 1 );// nothing. } @Override - public void drawForeground( int recipe ) + public void drawForeground( final int recipe ) { if( this.outputs.size() > recipe ) { // PositionedStack cr = this.outputs.get( recipe ); - String details = this.details.get( this.offsets.get( recipe ) ); + final String details = this.details.get( this.offsets.get( recipe ) ); - FontRenderer fr = Minecraft.getMinecraft().fontRenderer; + final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; fr.drawSplitString( details, 10, 25, 150, 0 ); } } @Override - public List getIngredientStacks( int recipeIndex ) + public List getIngredientStacks( final int recipeIndex ) { return new ArrayList(); } @Override - public List getOtherStacks( int recipeIndex ) + public List getOtherStacks( final int recipeIndex ) { return new ArrayList(); } @Override - public PositionedStack getResultStack( int recipe ) + public PositionedStack getResultStack( final int recipe ) { return this.outputs.get( recipe ); } @@ -115,19 +115,19 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } @Override - public boolean hasOverlay( GuiContainer gui, Container container, int recipe ) + public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe ) { return false; } @Override - public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe ) + public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe ) { return null; } @Override - public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe ) + public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe ) { return null; } @@ -139,39 +139,39 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } @Override - public List handleTooltip( GuiRecipe gui, List currentToolTip, int recipe ) + public List handleTooltip( final GuiRecipe gui, final List currentToolTip, final int recipe ) { return currentToolTip; } @Override - public List handleItemTooltip( GuiRecipe gui, ItemStack stack, List currentToolTip, int recipe ) + public List handleItemTooltip( final GuiRecipe gui, final ItemStack stack, final List currentToolTip, final int recipe ) { return currentToolTip; } @Override - public boolean keyTyped( GuiRecipe gui, char keyChar, int keyCode, int recipe ) + public boolean keyTyped( final GuiRecipe gui, final char keyChar, final int keyCode, final int recipe ) { return false; } @Override - public boolean mouseClicked( GuiRecipe gui, int button, int recipe ) + public boolean mouseClicked( final GuiRecipe gui, final int button, final int recipe ) { return false; } @Override - public IUsageHandler getUsageHandler( String inputId, Object... ingredients ) + public IUsageHandler getUsageHandler( final String inputId, final Object... ingredients ) { return this; } @Override - public ICraftingHandler getRecipeHandler( String outputId, Object... results ) + public ICraftingHandler getRecipeHandler( final String outputId, final Object... results ) { - NEIWorldCraftingHandler g = this.newInstance(); + final NEIWorldCraftingHandler g = this.newInstance(); if( results.length > 0 && results[0] instanceof ItemStack ) { g.target = (ItemStack) results[0]; @@ -187,11 +187,11 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler { return this.getClass().newInstance(); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } @@ -239,9 +239,9 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler } } - private void addRecipe( IItemDefinition def, String msg ) + private void addRecipe( final IItemDefinition def, final String msg ) { - for( ItemStack definitionStack : def.maybeStack( 1 ).asSet() ) + for( final ItemStack definitionStack : def.maybeStack( 1 ).asSet() ) { if( NEIServerUtils.areStacksSameTypeCrafting( definitionStack, this.target ) ) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java b/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java index fd241d45..e5df3867 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java @@ -31,9 +31,9 @@ public class TerminalCraftingSlotFinder implements IStackPositioner { @Override - public ArrayList positionStacks( ArrayList a ) + public ArrayList positionStacks( final ArrayList a ) { - for( PositionedStack ps : a ) + for( final PositionedStack ps : a ) { if( ps != null ) { diff --git a/src/main/java/appeng/integration/modules/PneumaticCraft.java b/src/main/java/appeng/integration/modules/PneumaticCraft.java index 49630930..f3edfba5 100644 --- a/src/main/java/appeng/integration/modules/PneumaticCraft.java +++ b/src/main/java/appeng/integration/modules/PneumaticCraft.java @@ -71,7 +71,7 @@ public class PneumaticCraft implements IIntegrationModule this.registerPressureAttunement( "advancedPressureTube" ); } - private void registerPressureAttunement( String itemID ) + private void registerPressureAttunement( final String itemID ) { final IP2PTunnelRegistry registry = AEApi.instance().registries().p2pTunnel(); final ItemStack modItem = GameRegistry.findItemStack( PNEUMATIC_CRAFT_MOD_ID, itemID, 1 ); diff --git a/src/main/java/appeng/integration/modules/RC.java b/src/main/java/appeng/integration/modules/RC.java index 49dc1f22..97cf01fc 100644 --- a/src/main/java/appeng/integration/modules/RC.java +++ b/src/main/java/appeng/integration/modules/RC.java @@ -43,9 +43,9 @@ public class RC implements IRC, IIntegrationModule } @Override - public void rockCrusher( ItemStack input, ItemStack output ) + public void rockCrusher( final ItemStack input, final ItemStack output ) { - IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true ); + final IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true ); re.addOutput( output, 1.0f ); } diff --git a/src/main/java/appeng/integration/modules/RF.java b/src/main/java/appeng/integration/modules/RF.java index 8c64aa38..2c3e0093 100644 --- a/src/main/java/appeng/integration/modules/RF.java +++ b/src/main/java/appeng/integration/modules/RF.java @@ -80,7 +80,7 @@ public final class RF implements IIntegrationModule this.registerRFAttunement( "EnderIO", "blockPowerMonitor", 0 ); } - private void registerRFAttunement( String mod, String name, int dmg ) + private void registerRFAttunement( final String mod, final String name, final int dmg ) { assert mod != null; assert !mod.isEmpty(); diff --git a/src/main/java/appeng/integration/modules/Waila.java b/src/main/java/appeng/integration/modules/Waila.java index 180aa56b..d66903c1 100644 --- a/src/main/java/appeng/integration/modules/Waila.java +++ b/src/main/java/appeng/integration/modules/Waila.java @@ -47,7 +47,7 @@ public class Waila implements IIntegrationModule IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.ITaggedList.class ); } - public static void register( IWailaRegistrar registrar ) + public static void register( final IWailaRegistrar registrar ) { final IWailaDataProvider partHost = new PartWailaDataProvider(); diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrate.java b/src/main/java/appeng/integration/modules/helpers/BSCrate.java index 1e0bfbf1..c5b43fb8 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrate.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrate.java @@ -37,21 +37,21 @@ public class BSCrate implements IMEInventory private final ICrateStorage crateStorage; private final ForgeDirection side; - public BSCrate( Object object, ForgeDirection d ) + public BSCrate( final Object object, final ForgeDirection d ) { this.crateStorage = (ICrateStorage) object; this.side = d; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { return null; } - ItemStack failed = this.crateStorage.insertItems( input.getItemStack() ); + final ItemStack failed = this.crateStorage.insertItems( input.getItemStack() ); if( failed == null ) { return null; @@ -61,22 +61,22 @@ public class BSCrate implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { - int howMany = this.crateStorage.getItemCount( request.getItemStack() ); + final int howMany = this.crateStorage.getItemCount( request.getItemStack() ); return howMany > request.getStackSize() ? request : request.copy().setStackSize( howMany ); } - ItemStack obtained = this.crateStorage.extractItems( request.getItemStack(), (int) request.getStackSize() ); + final ItemStack obtained = this.crateStorage.extractItems( request.getItemStack(), (int) request.getStackSize() ); return AEItemStack.create( obtained ); } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( ItemStack is : this.crateStorage.getContents() ) + for( final ItemStack is : this.crateStorage.getContents() ) { out.add( AEItemStack.create( is ) ); } diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java b/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java index 25171e0a..60fdfe63 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java @@ -33,13 +33,13 @@ public class BSCrateHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc ) { return channel == StorageChannel.ITEMS && te instanceof ICrateStorage; } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src ) { if( channel == StorageChannel.ITEMS ) { diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java index f7b12c65..25c1d9bf 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java @@ -39,18 +39,18 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor final ICrateStorage cs; final ForgeDirection side; - public BSCrateStorageAdaptor( Object te, ForgeDirection d ) + public BSCrateStorageAdaptor( final Object te, final ForgeDirection d ) { this.cs = (ICrateStorage) te; this.side = d; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { ItemStack target = null; - for( ItemStack is : this.cs.getContents() ) + for( final ItemStack is : this.cs.getContents() ) { if( is != null ) { @@ -67,7 +67,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor if( target != null ) { - ItemStack f = Platform.cloneItemStack( target ); + final ItemStack f = Platform.cloneItemStack( target ); f.stackSize = amount; return this.cs.extractItems( f, amount ); } @@ -76,11 +76,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { ItemStack target = null; - for( ItemStack is : this.cs.getContents() ) + for( final ItemStack is : this.cs.getContents() ) { if( is != null ) { @@ -106,7 +106,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { cnt = amount; } - ItemStack c = target.copy(); + final ItemStack c = target.copy(); c.stackSize = cnt; return c; } @@ -115,11 +115,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { ItemStack target = null; - for( ItemStack is : this.cs.getContents() ) + for( final ItemStack is : this.cs.getContents() ) { if( is != null ) { @@ -136,7 +136,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor if( target != null ) { - ItemStack f = Platform.cloneItemStack( target ); + final ItemStack f = Platform.cloneItemStack( target ); f.stackSize = amount; return this.cs.extractItems( f, amount ); } @@ -145,11 +145,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { ItemStack target = null; - for( ItemStack is : this.cs.getContents() ) + for( final ItemStack is : this.cs.getContents() ) { if( is != null ) { @@ -175,7 +175,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor { cnt = amount; } - ItemStack c = target.copy(); + final ItemStack c = target.copy(); c.stackSize = cnt; return c; } @@ -184,16 +184,16 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { return this.cs.insertItems( toBeAdded ); } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { - int items = this.cs.getSpaceForItem( toBeSimulated ); - ItemStack cloned = Platform.cloneItemStack( toBeSimulated ); + final int items = this.cs.getSpaceForItem( toBeSimulated ); + final ItemStack cloned = Platform.cloneItemStack( toBeSimulated ); if( toBeSimulated.stackSize <= items ) { return null; diff --git a/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java b/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java index e043452f..5e61e5fb 100644 --- a/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java +++ b/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java @@ -29,7 +29,7 @@ public class FMPPacketEvent extends Event public final EntityPlayerMP sender; - public FMPPacketEvent( EntityPlayerMP sender ) + public FMPPacketEvent( final EntityPlayerMP sender ) { this.sender = sender; } diff --git a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java index 13a74fb4..6b0aa6d8 100644 --- a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java +++ b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java @@ -38,7 +38,7 @@ public class FactorizationBarrel implements IMEInventory final IFZ fProxy; private final TileEntity te; - public FactorizationBarrel( IFZ proxy, TileEntity tile ) + public FactorizationBarrel( final IFZ proxy, final TileEntity tile ) { this.te = tile; this.fProxy = proxy; @@ -50,7 +50,7 @@ public class FactorizationBarrel implements IMEInventory } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( input == null ) { @@ -61,7 +61,7 @@ public class FactorizationBarrel implements IMEInventory return null; } - ItemStack shared = input.getItemStack(); + final ItemStack shared = input.getItemStack(); if( shared.isItemDamaged() ) { return input; @@ -77,15 +77,15 @@ public class FactorizationBarrel implements IMEInventory if( this.containsItemType( input, mode == Actionable.SIMULATE ) ) { - int max = this.fProxy.barrelGetMaxItemCount( this.te ); - int newTotal = (int) this.storedItemCount() + (int) input.getStackSize(); + final int max = this.fProxy.barrelGetMaxItemCount( this.te ); + final int newTotal = (int) this.storedItemCount() + (int) input.getStackSize(); if( newTotal > max ) { if( mode == Actionable.MODULATE ) { this.fProxy.barrelSetCount( this.te, max ); } - IAEItemStack result = input.copy(); + final IAEItemStack result = input.copy(); result.setStackSize( newTotal - max ); return result; } @@ -107,9 +107,9 @@ public class FactorizationBarrel implements IMEInventory return this.fProxy.barrelGetItem( this.te ) == null ? 1 : 0; } - public boolean containsItemType( IAEItemStack i, boolean acceptEmpty ) + public boolean containsItemType( final IAEItemStack i, final boolean acceptEmpty ) { - ItemStack currentItem = this.fProxy.barrelGetItem( this.te ); + final ItemStack currentItem = this.fProxy.barrelGetItem( this.te ); // empty barrels want your love too! if( acceptEmpty && currentItem == null ) @@ -126,11 +126,11 @@ public class FactorizationBarrel implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( this.containsItemType( request, false ) ) { - int howMany = (int) this.storedItemCount(); + final int howMany = (int) this.storedItemCount(); if( request.getStackSize() >= howMany ) { if( mode == Actionable.MODULATE ) @@ -139,7 +139,7 @@ public class FactorizationBarrel implements IMEInventory this.fProxy.barrelSetCount( this.te, 0 ); } - IAEItemStack r = request.copy(); + final IAEItemStack r = request.copy(); r.setStackSize( howMany ); return r; } @@ -156,9 +156,9 @@ public class FactorizationBarrel implements IMEInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - ItemStack i = this.fProxy.barrelGetItem( this.te ); + final ItemStack i = this.fProxy.barrelGetItem( this.te ); if( i != null ) { i.stackSize = this.fProxy.barrelGetItemCount( this.te ); diff --git a/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java b/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java index 535a5ccc..ffe35e80 100644 --- a/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java @@ -35,13 +35,13 @@ public class FactorizationHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc ) { return chan == StorageChannel.ITEMS && FZ.instance.isBarrel( te ); } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src ) { if( chan == StorageChannel.ITEMS ) { diff --git a/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java b/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java index d3389067..470aead1 100644 --- a/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java @@ -35,13 +35,13 @@ public class MFRDSUHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc ) { return chan == StorageChannel.ITEMS && DSU.instance.isDSU( te ); } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src ) { if( chan == StorageChannel.ITEMS ) { diff --git a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java index b0acfb72..8a55824a 100644 --- a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java +++ b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java @@ -39,21 +39,21 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory max ) { - IAEItemStack overflow = AEItemStack.create( is ); + final IAEItemStack overflow = AEItemStack.create( is ); overflow.setStackSize( (int) ( storedItems - max ) ); if( mode == Actionable.MODULATE ) { @@ -97,7 +97,7 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - ItemStack is = this.dsu.getStoredItemType(); + final ItemStack is = this.dsu.getStoredItemType(); if( is != null ) { out.add( AEItemStack.create( is ) ); diff --git a/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java b/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java index 2621bf3b..5398f79c 100644 --- a/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java @@ -28,25 +28,25 @@ public class NullRFHandler implements IEnergyReceiver { @Override - public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate ) + public int receiveEnergy( final ForgeDirection from, final int maxReceive, final boolean simulate ) { return 0; } @Override - public int getEnergyStored( ForgeDirection from ) + public int getEnergyStored( final ForgeDirection from ) { return 0; } @Override - public int getMaxEnergyStored( ForgeDirection from ) + public int getMaxEnergyStored( final ForgeDirection from ) { return 0; } @Override - public boolean canConnectEnergy( ForgeDirection from ) + public boolean canConnectEnergy( final ForgeDirection from ) { return true; } diff --git a/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java index 50557e85..5c9d3c0f 100644 --- a/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java @@ -42,31 +42,31 @@ import mcp.mobius.waila.api.IWailaDataProvider; public abstract class BaseWailaDataProvider implements IWailaDataProvider { @Override - public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config ) + public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return null; } @Override - public List getWailaHead( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaHead( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public List getWailaTail( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaTail( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { return tag; } diff --git a/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java index 84af51f0..c2ea41d2 100644 --- a/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java @@ -83,7 +83,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider } @Override - public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config ) + public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -96,7 +96,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider ItemStack wailaStack = null; - for( IPartWailaDataProvider provider : this.providers ) + for( final IPartWailaDataProvider provider : this.providers ) { wailaStack = provider.getWailaStack( part, config, wailaStack ); } @@ -107,7 +107,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider } @Override - public List getWailaHead( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaHead( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -118,7 +118,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider { final IPart part = maybePart.get(); - for( IPartWailaDataProvider provider : this.providers ) + for( final IPartWailaDataProvider provider : this.providers ) { provider.getWailaHead( part, currentToolTip, accessor, config ); } @@ -128,7 +128,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider } @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -139,7 +139,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider { final IPart part = maybePart.get(); - for( IPartWailaDataProvider provider : this.providers ) + for( final IPartWailaDataProvider provider : this.providers ) { provider.getWailaBody( part, currentToolTip, accessor, config ); } @@ -149,7 +149,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider } @Override - public List getWailaTail( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaTail( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -160,7 +160,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider { final IPart part = maybePart.get(); - for( IPartWailaDataProvider provider : this.providers ) + for( final IPartWailaDataProvider provider : this.providers ) { provider.getWailaTail( part, currentToolTip, accessor, config ); } @@ -170,7 +170,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider } @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { final MovingObjectPosition mop = this.tracer.retraceBlock( world, player, x, y, z ); @@ -182,7 +182,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider { final IPart part = maybePart.get(); - for( IPartWailaDataProvider provider : this.providers ) + for( final IPartWailaDataProvider provider : this.providers ) { provider.getNBTData( player, part, te, tag, world, x, y, z ); } diff --git a/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java index 92944d0e..1cdad422 100644 --- a/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java @@ -67,15 +67,15 @@ public final class TileWailaDataProvider implements IWailaDataProvider } @Override - public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config ) + public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return null; } @Override - public List getWailaHead( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaHead( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { - for( IWailaDataProvider provider : this.providers ) + for( final IWailaDataProvider provider : this.providers ) { provider.getWailaHead( itemStack, currentToolTip, accessor, config ); } @@ -84,9 +84,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider } @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { - for( IWailaDataProvider provider : this.providers ) + for( final IWailaDataProvider provider : this.providers ) { provider.getWailaBody( itemStack, currentToolTip, accessor, config ); } @@ -95,9 +95,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider } @Override - public List getWailaTail( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaTail( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { - for( IWailaDataProvider provider : this.providers ) + for( final IWailaDataProvider provider : this.providers ) { provider.getWailaTail( itemStack, currentToolTip, accessor, config ); } @@ -106,9 +106,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider } @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { - for( IWailaDataProvider provider : this.providers ) + for( final IWailaDataProvider provider : this.providers ) { provider.getNBTData( player, te, tag, world, x, y, z ); } diff --git a/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java index b7042238..44f449f9 100644 --- a/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java @@ -43,31 +43,31 @@ import appeng.api.parts.IPart; public abstract class BasePartWailaDataProvider implements IPartWailaDataProvider { @Override - public ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack ) + public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, final ItemStack partStack ) { return null; } @Override - public List getWailaHead( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaHead( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public List getWailaBody( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public List getWailaTail( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaTail( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { return currentToolTip; } @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final IPart part, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { return tag; } diff --git a/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java index cfec5a90..4ad995cd 100644 --- a/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java @@ -72,7 +72,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider * @return modified tool tip */ @Override - public List getWailaBody( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { if( part instanceof PartCableSmart || part instanceof PartDenseCable ) { @@ -100,7 +100,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider * * @return used channels on the cable */ - private byte getUsedChannels( IPart part, NBTTagCompound tag, TObjectByteMap cache ) + private byte getUsedChannels( final IPart part, final NBTTagCompound tag, final TObjectByteMap cache ) { final byte usedChannels; @@ -139,7 +139,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider * @return tag send to the client */ @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final IPart part, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { if( part instanceof PartCableSmart || part instanceof PartDenseCable ) { diff --git a/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java b/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java index 09ae6ef1..bb0ee23d 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java +++ b/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java @@ -50,7 +50,7 @@ public final class PartAccessor * * @return maybe the looked at {@link appeng.api.parts.IPart} */ - public Optional getMaybePart( TileEntity te, MovingObjectPosition mop ) + public Optional getMaybePart( final TileEntity te, final MovingObjectPosition mop ) { if( te instanceof IPartHost ) { diff --git a/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java index 12f7b3d0..cd7b8d52 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java @@ -38,7 +38,7 @@ public class PartStackWailaDataProvider extends BasePartWailaDataProvider { @Override - public ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack ) + public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, ItemStack partStack ) { partStack = part.getItemStack( PartItemStack.Pick ); return partStack; diff --git a/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java index be55dd73..c7e3a826 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java @@ -49,7 +49,7 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider * @return modified tooltip */ @Override - public List getWailaBody( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { if( part instanceof IPowerChannelState ) { @@ -69,7 +69,7 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider * * @return tooltip of the state */ - private String getToolTip( boolean isActive, boolean isPowered ) + private String getToolTip( final boolean isActive, final boolean isPowered ) { final String result; diff --git a/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java index c5c1aa85..829a9c55 100644 --- a/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java @@ -53,7 +53,7 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv * @return modified tooltip */ @Override - public List getWailaBody( IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final IPart part, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { if( part instanceof IPartStorageMonitor ) { @@ -64,12 +64,12 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv if( displayed instanceof IAEItemStack ) { - IAEItemStack ais = (IAEItemStack) displayed; + final IAEItemStack ais = (IAEItemStack) displayed; currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() ); } else if( displayed instanceof IAEFluidStack ) { - IAEFluidStack ais = (IAEFluidStack) displayed; + final IAEFluidStack ais = (IAEFluidStack) displayed; currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) ); } diff --git a/src/main/java/appeng/integration/modules/waila/part/Tracer.java b/src/main/java/appeng/integration/modules/waila/part/Tracer.java index 304d2f12..74f4cede 100644 --- a/src/main/java/appeng/integration/modules/waila/part/Tracer.java +++ b/src/main/java/appeng/integration/modules/waila/part/Tracer.java @@ -48,14 +48,14 @@ public final class Tracer * * @return trace movement. Can be null */ - public MovingObjectPosition retraceBlock( World world, EntityPlayerMP player, int x, int y, int z ) + public MovingObjectPosition retraceBlock( final World world, final EntityPlayerMP player, final int x, final int y, final int z ) { - Block block = world.getBlock( x, y, z ); + final Block block = world.getBlock( x, y, z ); - Vec3 headVec = this.getCorrectedHeadVec( player ); - Vec3 lookVec = player.getLook( 1.0F ); - double reach = this.getBlockReachDistance_server( player ); - Vec3 endVec = headVec.addVector( lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach ); + final Vec3 headVec = this.getCorrectedHeadVec( player ); + final Vec3 lookVec = player.getLook( 1.0F ); + final double reach = this.getBlockReachDistance_server( player ); + final Vec3 endVec = headVec.addVector( lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach ); return block.collisionRayTrace( world, x, y, z, headVec, endVec ); } @@ -67,9 +67,9 @@ public final class Tracer * * @return view point of player */ - private Vec3 getCorrectedHeadVec( EntityPlayer player ) + private Vec3 getCorrectedHeadVec( final EntityPlayer player ) { - Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ ); + final Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ ); if( player.worldObj.isRemote ) { // compatibility with eye height changing mods @@ -91,7 +91,7 @@ public final class Tracer * * @return block reach distance of player */ - private double getBlockReachDistance_server( EntityPlayerMP player ) + private double getBlockReachDistance_server( final EntityPlayerMP player ) { return player.theItemInWorldManager.getBlockReachDistance(); } diff --git a/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java index 1168345d..ebc4339a 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java @@ -54,7 +54,7 @@ public final class ChargerWailaDataProvider extends BaseWailaDataProvider * @return modified tooltip */ @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); if( te instanceof TileCharger ) diff --git a/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java index bf6425b9..7159cfd3 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java @@ -53,7 +53,7 @@ public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvide * @return modified tooltip */ @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); if( te instanceof TileCraftingMonitorTile ) diff --git a/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java index 8fffa8b1..cff256dd 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java @@ -52,7 +52,7 @@ public final class PowerStateWailaDataProvider extends BaseWailaDataProvider * @return modified tooltip */ @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); diff --git a/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java index 3e4957cb..f642301b 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java @@ -75,7 +75,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider * @return modified tool tip */ @Override - public List getWailaBody( ItemStack itemStack, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ) + public List getWailaBody( final ItemStack itemStack, final List currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { // Removes RF tooltip on WAILA 1.5.9+ ( (ITaggedList) currentToolTip ).removeEntries( "RFEnergyStorage" ); @@ -120,7 +120,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider * @return tag send to the client */ @Override - public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z ) + public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z ) { if( te instanceof IAEPowerStorage ) { @@ -148,7 +148,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider * * @return used channels on the cable */ - private long getInternalCurrentPower( NBTTagCompound tag, TileEntity te ) + private long getInternalCurrentPower( final NBTTagCompound tag, final TileEntity te ) { final long internalCurrentPower; diff --git a/src/main/java/appeng/items/AEBaseItem.java b/src/main/java/appeng/items/AEBaseItem.java index a736c005..6e9380d1 100644 --- a/src/main/java/appeng/items/AEBaseItem.java +++ b/src/main/java/appeng/items/AEBaseItem.java @@ -48,7 +48,7 @@ public abstract class AEBaseItem extends Item implements IAEFeature this.setNoRepair(); } - public AEBaseItem( Optional subName ) + public AEBaseItem( final Optional subName ) { this.subName = subName; this.fullName = new FeatureNameExtractor( this.getClass(), subName ).get(); @@ -72,37 +72,37 @@ public abstract class AEBaseItem extends Item implements IAEFeature // override! } - public void setFeature( EnumSet f ) + public void setFeature( final EnumSet f ) { this.feature = new ItemFeatureHandler( f, this, this, this.subName ); } @Override @SuppressWarnings( "unchecked" ) - public final void addInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public final void addInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { this.addCheckedInformation( stack, player, lines, displayMoreInfo ); } @Override @SuppressWarnings( "unchecked" ) - public final void getSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + public final void getSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { this.getCheckedSubItems( sameItem, creativeTab, itemStacks ); } @Override - public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 ) + public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 ) { return false; } - protected void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + protected void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addInformation( stack, player, lines, displayMoreInfo ); } - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { super.getSubItems( sameItem, creativeTab, itemStacks ); } diff --git a/src/main/java/appeng/items/contents/CellConfig.java b/src/main/java/appeng/items/contents/CellConfig.java index be8f63a0..b9509c0b 100644 --- a/src/main/java/appeng/items/contents/CellConfig.java +++ b/src/main/java/appeng/items/contents/CellConfig.java @@ -30,7 +30,7 @@ public class CellConfig extends AppEngInternalInventory final ItemStack is; - public CellConfig( ItemStack is ) + public CellConfig( final ItemStack is ) { super( null, 63 ); this.is = is; diff --git a/src/main/java/appeng/items/contents/CellUpgrades.java b/src/main/java/appeng/items/contents/CellUpgrades.java index 225b0fa8..acc5fbd2 100644 --- a/src/main/java/appeng/items/contents/CellUpgrades.java +++ b/src/main/java/appeng/items/contents/CellUpgrades.java @@ -29,7 +29,7 @@ public final class CellUpgrades extends StackUpgradeInventory { final ItemStack is; - public CellUpgrades( ItemStack is, int upgrades ) + public CellUpgrades( final ItemStack is, final int upgrades ) { super( is, null, upgrades ); this.is = is; diff --git a/src/main/java/appeng/items/contents/NetworkToolViewer.java b/src/main/java/appeng/items/contents/NetworkToolViewer.java index 8b9e3130..68b7f408 100644 --- a/src/main/java/appeng/items/contents/NetworkToolViewer.java +++ b/src/main/java/appeng/items/contents/NetworkToolViewer.java @@ -36,7 +36,7 @@ public class NetworkToolViewer implements INetworkTool final ItemStack is; final IGridHost gh; - public NetworkToolViewer( ItemStack is, IGridHost gHost ) + public NetworkToolViewer( final ItemStack is, final IGridHost gHost ) { this.is = is; this.gh = gHost; @@ -54,25 +54,25 @@ public class NetworkToolViewer implements INetworkTool } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.inv.getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.inv.decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.inv.getStackInSlotOnClosing( i ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( i, itemstack ); } @@ -103,7 +103,7 @@ public class NetworkToolViewer implements INetworkTool } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.inv.isUseableByPlayer( entityplayer ); } @@ -121,7 +121,7 @@ public class NetworkToolViewer implements INetworkTool } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null; } diff --git a/src/main/java/appeng/items/contents/PortableCellViewer.java b/src/main/java/appeng/items/contents/PortableCellViewer.java index 43ef16ec..9c31e72e 100644 --- a/src/main/java/appeng/items/contents/PortableCellViewer.java +++ b/src/main/java/appeng/items/contents/PortableCellViewer.java @@ -49,7 +49,7 @@ public class PortableCellViewer extends MEMonitorHandler implement private final IAEItemPowerStorage ips; private final int inventorySlot; - public PortableCellViewer( ItemStack is, int slot ) + public PortableCellViewer( final ItemStack is, final int slot ) { super( CellInventory.getCell( is, null ) ); this.ips = (IAEItemPowerStorage) is.getItem(); @@ -70,7 +70,7 @@ public class PortableCellViewer extends MEMonitorHandler implement } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { amt = usePowerMultiplier.multiply( amt ); @@ -101,9 +101,9 @@ public class PortableCellViewer extends MEMonitorHandler implement { @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { - NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target ); + final NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target ); manager.writeToNBT( data ); } } ); diff --git a/src/main/java/appeng/items/contents/QuartzKnifeObj.java b/src/main/java/appeng/items/contents/QuartzKnifeObj.java index 5b5b46ac..e12bef47 100644 --- a/src/main/java/appeng/items/contents/QuartzKnifeObj.java +++ b/src/main/java/appeng/items/contents/QuartzKnifeObj.java @@ -29,7 +29,7 @@ public class QuartzKnifeObj implements IGuiItemObject final ItemStack is; - public QuartzKnifeObj( ItemStack o ) + public QuartzKnifeObj( final ItemStack o ) { this.is = o; } diff --git a/src/main/java/appeng/items/materials/ItemMultiMaterial.java b/src/main/java/appeng/items/materials/ItemMultiMaterial.java index 28945395..25870a71 100644 --- a/src/main/java/appeng/items/materials/ItemMultiMaterial.java +++ b/src/main/java/appeng/items/materials/ItemMultiMaterial.java @@ -86,11 +86,11 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - MaterialType mt = this.getTypeByStack( stack ); + final MaterialType mt = this.getTypeByStack( stack ); if( mt == null ) { return; @@ -98,24 +98,24 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo if( mt == MaterialType.NamePress ) { - NBTTagCompound c = Platform.openNbtData( stack ); + final NBTTagCompound c = Platform.openNbtData( stack ); lines.add( c.getString( "InscribeName" ) ); } - Upgrades u = this.getType( stack ); + final Upgrades u = this.getType( stack ); if( u != null ) { - List textList = new LinkedList(); - for( Entry j : u.getSupported().entrySet() ) + final List textList = new LinkedList(); + for( final Entry j : u.getSupported().entrySet() ) { String name = null; - int limit = j.getValue(); + final int limit = j.getValue(); if( j.getKey().getItem() instanceof IItemGroup ) { - IItemGroup ig = (IItemGroup) j.getKey().getItem(); - String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() ); + final IItemGroup ig = (IItemGroup) j.getKey().getItem(); + final String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() ); if( str != null ) { name = Platform.gui_localize( str ) + ( limit > 1 ? " (" + limit + ')' : "" ); @@ -133,14 +133,14 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } } - Pattern p = Pattern.compile( "(\\d+)[^\\d]" ); - SlightlyBetterSort s = new SlightlyBetterSort( p ); + final Pattern p = Pattern.compile( "(\\d+)[^\\d]" ); + final SlightlyBetterSort s = new SlightlyBetterSort( p ); Collections.sort( textList, s ); lines.addAll( textList ); } } - public MaterialType getTypeByStack( ItemStack is ) + public MaterialType getTypeByStack( final ItemStack is ) { if( this.dmgToMaterial.containsKey( is.getItemDamage() ) ) { @@ -150,7 +150,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public Upgrades getType( ItemStack itemstack ) + public Upgrades getType( final ItemStack itemstack ) { switch( this.getTypeByStack( itemstack ) ) { @@ -171,13 +171,13 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } } - public IStackSrc createMaterial( MaterialType mat ) + public IStackSrc createMaterial( final MaterialType mat ) { Preconditions.checkState( !mat.isRegistered(), "Cannot create the same material twice." ); boolean enabled = true; - for( AEFeature f : mat.getFeature() ) + for( final AEFeature f : mat.getFeature() ) { enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); } @@ -188,7 +188,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo { mat.itemInstance = this; mat.markReady(); - int newMaterialNum = mat.damageValue; + final int newMaterialNum = mat.damageValue; if( this.dmgToMaterial.get( newMaterialNum ) == null ) { @@ -206,25 +206,25 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo public void makeUnique() { - for( MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) ) + for( final MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) ) { if( mt.getOreName() != null ) { ItemStack replacement = null; - String[] names = mt.getOreName().split( "," ); + final String[] names = mt.getOreName().split( "," ); - for( String name : names ) + for( final String name : names ) { if( replacement != null ) { break; } - List options = OreDictionary.getOres( name ); + final List options = OreDictionary.getOres( name ); if( options != null && options.size() > 0 ) { - for( ItemStack is : options ) + for( final ItemStack is : options ) { if( is != null && is.getItem() != null ) { @@ -238,7 +238,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo if( replacement == null || AEConfig.instance.useAEVersion( mt ) ) { // continue using the AE2 item. - for( String name : names ) + for( final String name : names ) { OreDictionary.registerOre( name, mt.stack( 1 ) ); } @@ -258,7 +258,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public IIcon getIconFromDamage( int dmg ) + public IIcon getIconFromDamage( final int dmg ) { if( this.dmgToMaterial.containsKey( dmg ) ) { @@ -268,19 +268,19 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return "item.appliedenergistics2." + this.nameOf( is ); } - private String nameOf( ItemStack is ) + private String nameOf( final ItemStack is ) { if( is == null ) { return "null"; } - MaterialType mt = this.getTypeByStack( is ); + final MaterialType mt = this.getTypeByStack( is ); if( mt == null ) { return "null"; @@ -290,20 +290,20 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - List types = Arrays.asList( MaterialType.values() ); + final List types = Arrays.asList( MaterialType.values() ); Collections.sort( types, new Comparator() { @Override - public int compare( MaterialType o1, MaterialType o2 ) + public int compare( final MaterialType o1, final MaterialType o2 ) { return o1.name().compareTo( o2.name() ); } } ); - for( MaterialType mat : types ) + for( final MaterialType mat : types ) { if( mat.damageValue >= 0 && mat.isRegistered() && mat.itemInstance == this ) { @@ -313,16 +313,16 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public void registerIcons( IIconRegister icoRegister ) + public void registerIcons( final IIconRegister icoRegister ) { - for( MaterialType mat : MaterialType.values() ) + for( final MaterialType mat : MaterialType.values() ) { if( mat.damageValue != -1 ) { - ItemStack what = new ItemStack( this, 1, mat.damageValue ); + final ItemStack what = new ItemStack( this, 1, mat.damageValue ); if( this.getTypeByStack( what ) != MaterialType.InvalidType ) { - String tex = "appliedenergistics2:" + this.nameOf( what ); + final String tex = "appliedenergistics2:" + this.nameOf( what ); mat.IIcon = icoRegister.registerIcon( tex ); } } @@ -330,16 +330,16 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( player.isSneaking() ) { - TileEntity te = world.getTileEntity( x, y, z ); + final TileEntity te = world.getTileEntity( x, y, z ); IInventory upgrades = null; if( te instanceof IPartHost ) { - SelectedPart sp = ( (IPartHost) te ).selectPart( Vec3.createVectorHelper( hitX, hitY, hitZ ) ); + final SelectedPart sp = ( (IPartHost) te ).selectPart( Vec3.createVectorHelper( hitX, hitY, hitZ ) ); if( sp.part instanceof IUpgradeableHost ) { upgrades = ( (ISegmentedInventory) sp.part ).getInventoryByName( "upgrades" ); @@ -352,12 +352,12 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo if( upgrades != null && is != null && is.getItem() instanceof IUpgradeModule ) { - IUpgradeModule um = (IUpgradeModule) is.getItem(); - Upgrades u = um.getType( is ); + final IUpgradeModule um = (IUpgradeModule) is.getItem(); + final Upgrades u = um.getType( is ); if( u != null ) { - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, ForgeDirection.UNKNOWN ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, ForgeDirection.UNKNOWN ); if( ad != null ) { if( player.worldObj.isRemote ) @@ -376,22 +376,22 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public boolean hasCustomEntity( ItemStack is ) + public boolean hasCustomEntity( final ItemStack is ) { return this.getTypeByStack( is ).hasCustomEntity(); } @Override - public Entity createEntity( World w, Entity location, ItemStack itemstack ) + public Entity createEntity( final World w, final Entity location, final ItemStack itemstack ) { - Class droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass(); - Entity eqi; + final Class droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass(); + final Entity eqi; try { eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX, location.posY, location.posZ, itemstack ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } @@ -409,7 +409,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public int getBytes( ItemStack is ) + public int getBytes( final ItemStack is ) { switch( this.getTypeByStack( is ) ) { @@ -427,7 +427,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo } @Override - public boolean isStorageComponent( ItemStack is ) + public boolean isStorageComponent( final ItemStack is ) { switch( this.getTypeByStack( is ) ) { @@ -445,26 +445,26 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo { private final Pattern pattern; - public SlightlyBetterSort( Pattern pattern ) + public SlightlyBetterSort( final Pattern pattern ) { this.pattern = pattern; } @Override - public int compare( String o1, String o2 ) + public int compare( final String o1, final String o2 ) { try { - Matcher a = this.pattern.matcher( o1 ); - Matcher b = this.pattern.matcher( o2 ); + final Matcher a = this.pattern.matcher( o1 ); + final Matcher b = this.pattern.matcher( o2 ); if( a.find() && b.find() ) { - int ia = Integer.parseInt( a.group( 1 ) ); - int ib = Integer.parseInt( b.group( 1 ) ); + final int ia = Integer.parseInt( a.group( 1 ) ); + final int ib = Integer.parseInt( b.group( 1 ) ); return Integer.compare( ia, ib ); } } - catch( Throwable t ) + catch( final Throwable t ) { // ek! } diff --git a/src/main/java/appeng/items/materials/MaterialType.java b/src/main/java/appeng/items/materials/MaterialType.java index a252bf2c..1d1c1fb3 100644 --- a/src/main/java/appeng/items/materials/MaterialType.java +++ b/src/main/java/appeng/items/materials/MaterialType.java @@ -96,19 +96,19 @@ public enum MaterialType private Class droppedEntity; private boolean isRegistered = false; - MaterialType( int metaValue ) + MaterialType( final int metaValue ) { this.damageValue = metaValue; this.features = EnumSet.of( AEFeature.Core ); } - MaterialType( int metaValue, AEFeature part ) + MaterialType( final int metaValue, final AEFeature part ) { this.damageValue = metaValue; this.features = EnumSet.of( part ); } - MaterialType( int metaValue, AEFeature part, Class c ) + MaterialType( final int metaValue, final AEFeature part, final Class c ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; @@ -117,7 +117,7 @@ public enum MaterialType EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true ); } - MaterialType( int metaValue, AEFeature part, String oreDictionary, Class c ) + MaterialType( final int metaValue, final AEFeature part, final String oreDictionary, final Class c ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; @@ -126,14 +126,14 @@ public enum MaterialType EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true ); } - MaterialType( int metaValue, AEFeature part, String oreDictionary ) + MaterialType( final int metaValue, final AEFeature part, final String oreDictionary ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; this.oreName = oreDictionary; } - public ItemStack stack( int size ) + public ItemStack stack( final int size ) { return new ItemStack( this.itemInstance, size, this.damageValue ); } diff --git a/src/main/java/appeng/items/misc/ItemCrystalSeed.java b/src/main/java/appeng/items/misc/ItemCrystalSeed.java index c6ae884e..599600b1 100644 --- a/src/main/java/appeng/items/misc/ItemCrystalSeed.java +++ b/src/main/java/appeng/items/misc/ItemCrystalSeed.java @@ -77,7 +77,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Nullable - public static ResolverResult getResolver( int certus2 ) + public static ResolverResult getResolver( final int certus2 ) { ResolverResult resolver = null; @@ -91,13 +91,13 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal return resolver; } - private static ItemStack newStyle( ItemStack itemStack ) + private static ItemStack newStyle( final ItemStack itemStack ) { ( (ItemCrystalSeed) itemStack.getItem() ).getProgress( itemStack ); return itemStack; } - private int getProgress( ItemStack is ) + private int getProgress( final ItemStack is ) { if( is.hasTagCompound() ) { @@ -105,8 +105,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } else { - int progress; - NBTTagCompound comp = Platform.openNbtData( is ); + final int progress; + final NBTTagCompound comp = Platform.openNbtData( is ); comp.setInteger( "progress", progress = is.getItemDamage() ); is.setItemDamage( ( is.getItemDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET ); return progress; @@ -115,29 +115,29 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Nullable @Override - public ItemStack triggerGrowth( ItemStack is ) + public ItemStack triggerGrowth( final ItemStack is ) { - int newDamage = this.getProgress( is ) + 1; + final int newDamage = this.getProgress( is ) + 1; final IMaterials materials = AEApi.instance().definitions().materials(); final int size = is.stackSize; if( newDamage == CERTUS + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() ) { return quartzStack; } } if( newDamage == NETHER + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() ) { return quartzStack; } } if( newDamage == FLUIX + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() ) { return quartzStack; } @@ -151,39 +151,39 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal return is; } - private void setProgress( ItemStack is, int newDamage ) + private void setProgress( final ItemStack is, final int newDamage ) { - NBTTagCompound comp = Platform.openNbtData( is ); + final NBTTagCompound comp = Platform.openNbtData( is ); comp.setInteger( "progress", newDamage ); is.setItemDamage( is.getItemDamage() / LEVEL_OFFSET * LEVEL_OFFSET ); } @Override - public float getMultiplier( Block blk, Material mat ) + public float getMultiplier( final Block blk, final Material mat ) { return 0.5f; } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { lines.add( ButtonToolTips.DoesntDespawn.getLocal() ); - int progress = this.getProgress( stack ) % SINGLE_OFFSET; + final int progress = this.getProgress( stack ) % SINGLE_OFFSET; lines.add( Math.floor( (float) progress / (float) ( SINGLE_OFFSET / 100 ) ) + "%" ); super.addCheckedInformation( stack, player, lines, displayMoreInfo ); } @Override - public int getEntityLifespan( ItemStack itemStack, World world ) + public int getEntityLifespan( final ItemStack itemStack, final World world ) { return Integer.MAX_VALUE; } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { - int damage = this.getProgress( is ); + final int damage = this.getProgress( is ); if( damage < CERTUS + SINGLE_OFFSET ) { @@ -210,25 +210,25 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - public boolean isDamaged( ItemStack stack ) + public boolean isDamaged( final ItemStack stack ) { return false; } @Override - public int getMaxDamage( ItemStack stack ) + public int getMaxDamage( final ItemStack stack ) { return FINAL_STAGE; } @Override - public IIcon getIcon( ItemStack stack, int pass ) + public IIcon getIcon( final ItemStack stack, final int pass ) { return this.getIconIndex( stack ); } @Override - public IIcon getIconIndex( ItemStack stack ) + public IIcon getIconIndex( final ItemStack stack ) { IIcon[] list = null; @@ -270,9 +270,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - public void registerIcons( IIconRegister ir ) + public void registerIcons( final IIconRegister ir ) { - String preFix = "appliedenergistics2:ItemCrystalSeed."; + final String preFix = "appliedenergistics2:ItemCrystalSeed."; this.certus[0] = ir.registerIcon( preFix + "Certus" ); this.certus[1] = ir.registerIcon( preFix + "Certus2" ); @@ -288,15 +288,15 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - public boolean hasCustomEntity( ItemStack stack ) + public boolean hasCustomEntity( final ItemStack stack ) { return true; } @Override - public Entity createEntity( World world, Entity location, ItemStack itemstack ) + public Entity createEntity( final World world, final Entity location, final ItemStack itemstack ) { - EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack ); + final EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack ); egc.motionX = location.motionX; egc.motionY = location.motionY; @@ -311,7 +311,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { // lvl 0 itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) ); diff --git a/src/main/java/appeng/items/misc/ItemEncodedPattern.java b/src/main/java/appeng/items/misc/ItemEncodedPattern.java index 39f532b7..88362eb9 100644 --- a/src/main/java/appeng/items/misc/ItemEncodedPattern.java +++ b/src/main/java/appeng/items/misc/ItemEncodedPattern.java @@ -60,7 +60,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public ItemStack onItemRightClick( ItemStack stack, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player ) { this.clearPattern( stack, player ); @@ -68,12 +68,12 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { return this.clearPattern( stack, player ); } - private boolean clearPattern( ItemStack stack, EntityPlayer player ) + private boolean clearPattern( final ItemStack stack, final EntityPlayer player ) { if( player.isSneaking() ) { @@ -82,13 +82,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return false; } - InventoryPlayer inv = player.inventory; + final InventoryPlayer inv = player.inventory; for( int s = 0; s < player.inventory.getSizeInventory(); s++ ) { if( inv.getStackInSlot( s ) == stack ) { - for( ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() ) + for( final ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() ) { inv.setInventorySlotContents( s, blankPattern ); } @@ -102,9 +102,9 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj ); + final ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj ); if( details == null ) { @@ -112,17 +112,17 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return; } - boolean isCrafting = details.isCraftable(); + final boolean isCrafting = details.isCraftable(); - IAEItemStack[] in = details.getCondensedInputs(); - IAEItemStack[] out = details.getCondensedOutputs(); + final IAEItemStack[] in = details.getCondensedInputs(); + final IAEItemStack[] out = details.getCondensedOutputs(); - String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": "; - String and = ' ' + GuiText.And.getLocal() + ' '; - String with = GuiText.With.getLocal() + ": "; + final String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": "; + final String and = ' ' + GuiText.And.getLocal() + ' '; + final String with = GuiText.With.getLocal() + ": "; boolean first = true; - for( IAEItemStack anOut : out ) + for( final IAEItemStack anOut : out ) { if( anOut == null ) { @@ -134,7 +134,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } first = true; - for( IAEItemStack anIn : in ) + for( final IAEItemStack anIn : in ) { if( anIn == null ) { @@ -147,19 +147,19 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public ICraftingPatternDetails getPatternForItem( ItemStack is, World w ) + public ICraftingPatternDetails getPatternForItem( final ItemStack is, final World w ) { try { return new PatternHelper( is, w ); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } } - public ItemStack getOutput( ItemStack item ) + public ItemStack getOutput( final ItemStack item ) { ItemStack out = SIMPLE_CACHE.get( item ); if( out != null ) @@ -167,13 +167,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return out; } - World w = CommonHelper.proxy.getWorld(); + final World w = CommonHelper.proxy.getWorld(); if( w == null ) { return null; } - ICraftingPatternDetails details = this.getPatternForItem( item, w ); + final ICraftingPatternDetails details = this.getPatternForItem( item, w ); if( details == null ) { diff --git a/src/main/java/appeng/items/misc/ItemPaintBall.java b/src/main/java/appeng/items/misc/ItemPaintBall.java index 184a1dca..5a26b420 100644 --- a/src/main/java/appeng/items/misc/ItemPaintBall.java +++ b/src/main/java/appeng/items/misc/ItemPaintBall.java @@ -52,17 +52,17 @@ public class ItemPaintBall extends AEBaseItem } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is ); } - public String getExtraName( ItemStack is ) + public String getExtraName( final ItemStack is ) { return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is ); } - public AEColor getColor( ItemStack is ) + public AEColor getColor( final ItemStack is ) { int dmg = is.getItemDamage(); if( dmg >= DAMAGE_THRESHOLD ) @@ -79,9 +79,9 @@ public class ItemPaintBall extends AEBaseItem } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { if( c != AEColor.Transparent ) { @@ -89,7 +89,7 @@ public class ItemPaintBall extends AEBaseItem } } - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { if( c != AEColor.Transparent ) { @@ -98,9 +98,9 @@ public class ItemPaintBall extends AEBaseItem } } - public boolean isLumen( ItemStack is ) + public boolean isLumen( final ItemStack is ) { - int dmg = is.getItemDamage(); + final int dmg = is.getItemDamage(); return dmg >= DAMAGE_THRESHOLD; } } diff --git a/src/main/java/appeng/items/parts/ItemFacade.java b/src/main/java/appeng/items/parts/ItemFacade.java index c01866f8..ca3d1362 100644 --- a/src/main/java/appeng/items/parts/ItemFacade.java +++ b/src/main/java/appeng/items/parts/ItemFacade.java @@ -78,23 +78,23 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, w ); } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { try { - ItemStack in = this.getTextureItem( is ); + final ItemStack in = this.getTextureItem( is ); if( in != null ) { return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName(); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -103,7 +103,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { this.calculateSubTypes(); itemStacks.addAll( this.subTypes ); @@ -114,25 +114,25 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte if( this.subTypes == null ) { this.subTypes = new ArrayList( 1000 ); - for( Object blk : Block.blockRegistry ) + for( final Object blk : Block.blockRegistry ) { - Block b = (Block) blk; + final Block b = (Block) blk; try { - Item item = Item.getItemFromBlock( b ); + final Item item = Item.getItemFromBlock( b ); - List tmpList = new ArrayList( 100 ); + final List tmpList = new ArrayList( 100 ); b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList ); - for( ItemStack l : tmpList ) + for( final ItemStack l : tmpList ) { - ItemStack facade = this.createFacadeForItem( l, false ); + final ItemStack facade = this.createFacadeForItem( l, false ); if( facade != null ) { this.subTypes.add( facade ); } } } - catch( Throwable t ) + catch( final Throwable t ) { // just absorb.. } @@ -145,26 +145,26 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } } - public ItemStack createFacadeForItem( ItemStack l, boolean returnItem ) + public ItemStack createFacadeForItem( final ItemStack l, final boolean returnItem ) { if( l == null ) { return null; } - Block b = Block.getBlockFromItem( l.getItem() ); + final Block b = Block.getBlockFromItem( l.getItem() ); if( b == null || l.hasTagCompound() ) { return null; } - int metadata = l.getItem().getMetadata( l.getItemDamage() ); + final int metadata = l.getItem().getMetadata( l.getItemDamage() ); - boolean hasTile = b.hasTileEntity( metadata ); - boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass; - boolean disableOre = b instanceof OreQuartz; + final boolean hasTile = b.hasTileEntity( metadata ); + final boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass; + final boolean disableOre = b instanceof OreQuartz; - boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass; + final boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass; if( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) ) { if( returnItem ) @@ -172,13 +172,13 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte return l; } - ItemStack is = new ItemStack( this ); - NBTTagCompound data = new NBTTagCompound(); - int[] ds = new int[2]; + final ItemStack is = new ItemStack( this ); + final NBTTagCompound data = new NBTTagCompound(); + final int[] ds = new int[2]; ds[0] = Item.getIdFromItem( l.getItem() ); ds[1] = metadata; data.setIntArray( "x", ds ); - UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() ); + final UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() ); data.setString( "modid", ui.modId ); data.setString( "itemname", ui.name ); is.setTagCompound( data ); @@ -188,9 +188,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public FacadePart createPartFromItemStack( ItemStack is, ForgeDirection side ) + public FacadePart createPartFromItemStack( final ItemStack is, final ForgeDirection side ) { - ItemStack in = this.getTextureItem( is ); + final ItemStack in = this.getTextureItem( is ); if( in != null ) { return new FacadePart( is, side ); @@ -199,9 +199,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public ItemStack getTextureItem( ItemStack is ) + public ItemStack getTextureItem( final ItemStack is ) { - Block blk = this.getBlock( is ); + final Block blk = this.getBlock( is ); if( blk != null ) { return new ItemStack( blk, 1, this.getMeta( is ) ); @@ -210,12 +210,12 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public int getMeta( ItemStack is ) + public int getMeta( final ItemStack is ) { - NBTTagCompound data = is.getTagCompound(); + final NBTTagCompound data = is.getTagCompound(); if( data != null ) { - int[] blk = data.getIntArray( "x" ); + final int[] blk = data.getIntArray( "x" ); if( blk != null && blk.length == 2 ) { return blk[1]; @@ -225,9 +225,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public Block getBlock( ItemStack is ) + public Block getBlock( final ItemStack is ) { - NBTTagCompound data = is.getTagCompound(); + final NBTTagCompound data = is.getTagCompound(); if( data != null ) { if( data.hasKey( "modid" ) && data.hasKey( "itemname" ) ) @@ -236,7 +236,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } else { - int[] blk = data.getIntArray( "x" ); + final int[] blk = data.getIntArray( "x" ); if( blk != null && blk.length == 2 ) { return Block.getBlockById( blk[0] ); @@ -262,11 +262,11 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte return this.subTypes.get( 0 ); } - public ItemStack createFromIDs( int[] ids ) + public ItemStack createFromIDs( final int[] ids ) { - for( ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() ) + for( final ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() ) { - NBTTagCompound facadeTag = new NBTTagCompound(); + final NBTTagCompound facadeTag = new NBTTagCompound(); facadeTag.setIntArray( "x", ids.clone() ); facadeStack.setTagCompound( facadeTag ); @@ -277,16 +277,16 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public boolean useAlphaPass( ItemStack is ) + public boolean useAlphaPass( final ItemStack is ) { - ItemStack out = this.getTextureItem( is ); + final ItemStack out = this.getTextureItem( is ); if( out == null || out.getItem() == null ) { return false; } - Block blk = Block.getBlockFromItem( out.getItem() ); + final Block blk = Block.getBlockFromItem( out.getItem() ); if( blk != null && blk.canRenderInPass( 1 ) ) { return true; diff --git a/src/main/java/appeng/items/parts/ItemMultiPart.java b/src/main/java/appeng/items/parts/ItemMultiPart.java index b8eae36e..081cdfd7 100644 --- a/src/main/java/appeng/items/parts/ItemMultiPart.java +++ b/src/main/java/appeng/items/parts/ItemMultiPart.java @@ -73,7 +73,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG private final NameResolver nameResolver; private final Map registered; - public ItemMultiPart( IPartHelper partHelper ) + public ItemMultiPart( final IPartHelper partHelper ) { Preconditions.checkNotNull( partHelper ); @@ -88,7 +88,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public final ItemStackSrc createPart( PartType mat ) + public final ItemStackSrc createPart( final PartType mat ) { Preconditions.checkNotNull( mat ); @@ -96,7 +96,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public ItemStackSrc createPart( PartType mat, AEColor color ) + public ItemStackSrc createPart( final PartType mat, final AEColor color ) { Preconditions.checkNotNull( mat ); Preconditions.checkNotNull( color ); @@ -107,13 +107,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - private ItemStackSrc createPart( PartType mat, int varID ) + private ItemStackSrc createPart( final PartType mat, final int varID ) { assert mat != null; assert varID >= 0; // verify - for( PartTypeWithVariant p : this.registered.values() ) + for( final PartTypeWithVariant p : this.registered.values() ) { if( p.part == mat && p.variant == varID ) { @@ -122,12 +122,12 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } boolean enabled = true; - for( AEFeature f : mat.getFeature() ) + for( final AEFeature f : mat.getFeature() ) { enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); } - for( IntegrationType integrationType : mat.getIntegrations() ) + for( final IntegrationType integrationType : mat.getIntegrations() ) { enabled &= IntegrationRegistry.INSTANCE.isEnabled( integrationType ); } @@ -143,7 +143,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG return output; } - private void processMetaOverlap( boolean enabled, int partDamage, PartType mat, PartTypeWithVariant pti ) + private void processMetaOverlap( final boolean enabled, final int partDamage, final PartType mat, final PartTypeWithVariant pti ) { assert partDamage >= 0; assert mat != null; @@ -161,11 +161,11 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } } - public int getDamageByType( PartType t ) + public int getDamageByType( final PartType t ) { Preconditions.checkNotNull( t ); - for( Entry pt : this.registered.entrySet() ) + for( final Entry pt : this.registered.entrySet() ) { if( pt.getValue().part == t ) { @@ -183,7 +183,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public IIcon getIconFromDamage( int dmg ) + public IIcon getIconFromDamage( final int dmg ) { final PartTypeWithVariant registeredType = this.registered.get( dmg ); if( registeredType != null ) @@ -196,7 +196,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( this.getTypeByStack( is ) == PartType.InvalidType ) { @@ -207,13 +207,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return "item.appliedenergistics2." + this.getName( is ); } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { final PartType pt = this.getTypeByStack( is ); @@ -238,28 +238,28 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public void registerIcons( IIconRegister iconRegister ) + public void registerIcons( final IIconRegister iconRegister ) { - for( Entry part : this.registered.entrySet() ) + for( final Entry part : this.registered.entrySet() ) { - String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) ); + final String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) ); part.getValue().ico = iconRegister.registerIcon( tex ); } } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - List> types = new ArrayList>( this.registered.entrySet() ); + final List> types = new ArrayList>( this.registered.entrySet() ); Collections.sort( types, REGISTERED_COMPARATOR ); - for( Entry part : types ) + for( final Entry part : types ) { itemStacks.add( new ItemStack( this, 1, part.getKey() ) ); } } - public String getName( ItemStack is ) + public String getName( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -270,7 +270,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public PartType getTypeByStack( ItemStack is ) + public PartType getTypeByStack( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -285,7 +285,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @Nullable @Override - public IPart createPartFromItemStack( ItemStack is ) + public IPart createPartFromItemStack( final ItemStack is ) { final PartType type = this.getTypeByStack( is ); final Class part = type.getPart(); @@ -303,25 +303,25 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG return type.constructor.newInstance( is ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( NoSuchMethodException e ) + catch( final NoSuchMethodException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } } - public int variantOf( int itemDamage ) + public int variantOf( final int itemDamage ) { final PartTypeWithVariant registeredPartType = this.registered.get( itemDamage ); if( registeredPartType != null ) @@ -334,19 +334,19 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @Nullable @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { boolean importBus = false; boolean exportBus = false; boolean group = false; - PartType u = this.getTypeByStack( is ); + final PartType u = this.getTypeByStack( is ); - for( ItemStack stack : others ) + for( final ItemStack stack : others ) { if( stack.getItem() == this ) { - PartType pt = this.getTypeByStack( stack ); + final PartType pt = this.getTypeByStack( stack ); switch( pt ) { case ImportBus: @@ -384,7 +384,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @SideOnly( Side.CLIENT ) private IIcon ico; - private PartTypeWithVariant( PartType part, int variant ) + private PartTypeWithVariant( final PartType part, final int variant ) { assert part != null; assert variant >= 0; @@ -407,7 +407,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG private static final class RegisteredComparator implements Comparator> { @Override - public int compare( Entry o1, Entry o2 ) + public int compare( final Entry o1, final Entry o2 ) { return o1.getValue().part.name().compareTo( o2.getValue().part.name() ); } diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 608a7a05..e9c35af7 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -171,12 +171,12 @@ public enum PartType private final GuiText extraName; public Constructor constructor; - PartType( int baseMetaValue, Set features, Set integrations, Class c ) + PartType( final int baseMetaValue, final Set features, final Set integrations, final Class c ) { this( baseMetaValue, features, integrations, c, null ); } - PartType( int baseMetaValue, Set features, Set integrations, Class c, GuiText en ) + PartType( final int baseMetaValue, final Set features, final Set integrations, final Class c, final GuiText en ) { this.features = Collections.unmodifiableSet( features ); this.integrations = Collections.unmodifiableSet( integrations ); diff --git a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java index acfeef61..98aeb72e 100644 --- a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java @@ -63,7 +63,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe private final int perType; private final double idleDrain; - public ItemBasicStorageCell( MaterialType whichCell, int kilobytes ) + public ItemBasicStorageCell( final MaterialType whichCell, final int kilobytes ) { super( Optional.of( kilobytes + "k" ) ); @@ -97,14 +97,14 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( inventory instanceof ICellInventoryHandler ) { - ICellInventoryHandler handler = (ICellInventoryHandler) inventory; - ICellInventory cellInventory = handler.getCellInv(); + final ICellInventoryHandler handler = (ICellInventoryHandler) inventory; + final ICellInventory cellInventory = handler.getCellInv(); if( cellInventory != null ) { @@ -114,7 +114,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe if( handler.isPreformatted() ) { - String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal(); + final String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal(); if( handler.isFuzzy() ) { @@ -130,31 +130,31 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return this.totalBytes; } @Override - public int BytePerType( ItemStack cell ) + public int BytePerType( final ItemStack cell ) { return this.perType; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return this.perType; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 63; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { return false; } @@ -166,7 +166,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -178,57 +178,57 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack stack, final World world, final EntityPlayer player ) { this.disassembleDrive( stack, world, player ); return stack; } - private boolean disassembleDrive( ItemStack stack, World world, EntityPlayer player ) + private boolean disassembleDrive( final ItemStack stack, final World world, final EntityPlayer player ) { if( player.isSneaking() ) { @@ -237,18 +237,18 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe return false; } - InventoryPlayer playerInventory = player.inventory; - IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final InventoryPlayer playerInventory = player.inventory; + final IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( inv != null && playerInventory.getCurrentItem() == stack ) { - InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); - IItemList list = inv.getAvailableItems( StorageChannel.ITEMS.createList() ); + final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN ); + final IItemList list = inv.getAvailableItems( StorageChannel.ITEMS.createList() ); if( list.isEmpty() && ia != null ) { playerInventory.setInventorySlotContents( playerInventory.currentItem, null ); // drop core - ItemStack extraB = ia.addItems( this.component.stack( 1 ) ); + final ItemStack extraB = ia.addItems( this.component.stack( 1 ) ); if( extraB != null ) { player.dropPlayerItemWithRandomChoice( extraB, false ); @@ -267,7 +267,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } // drop empty storage cell case - for( ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) + for( final ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) { final ItemStack extraA = ia.addItems( storageCellStack ); if( extraA != null ) @@ -289,15 +289,15 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { return this.disassembleDrive( stack, world, player ); } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { - for( ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) { return stack; } @@ -306,7 +306,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting ); } diff --git a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java index 7f1eb4a1..f33bf41f 100644 --- a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java @@ -41,31 +41,31 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return null; } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { return FuzzyMode.IGNORE_ALL; } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { } diff --git a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java index 4c3ce371..fdbf728d 100644 --- a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java @@ -46,7 +46,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag { private final int maxRegion; - public ItemSpatialStorageCell( int spatialScale ) + public ItemSpatialStorageCell( final int spatialScale ) { super( Optional.of( spatialScale + "Cubed" ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); @@ -55,9 +55,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - WorldCoord wc = this.getStoredSize( stack ); + final WorldCoord wc = this.getStoredSize( stack ); if( wc.x > 0 ) { lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z ); @@ -65,24 +65,24 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public boolean isSpatialStorage( ItemStack is ) + public boolean isSpatialStorage( final ItemStack is ) { return true; } @Override - public int getMaxStoredDim( ItemStack is ) + public int getMaxStoredDim( final ItemStack is ) { return this.maxRegion; } @Override - public World getWorld( ItemStack is ) + public World getWorld( final ItemStack is ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); - int dim = c.getInteger( "StorageDim" ); + final NBTTagCompound c = is.getTagCompound(); + final int dim = c.getInteger( "StorageDim" ); World w = DimensionManager.getWorld( dim ); if( w == null ) { @@ -102,14 +102,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getStoredSize( ItemStack is ) + public WorldCoord getStoredSize( final ItemStack is ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( Platform.isServer() ) { - int dim = c.getInteger( "StorageDim" ); + final int dim = c.getInteger( "StorageDim" ); return WorldData.instance().dimensionData().getStoredSize( dim ); } else @@ -121,12 +121,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getMin( ItemStack is ) + public WorldCoord getMin( final ItemStack is ) { - World w = this.getWorld( is ); + final World w = this.getWorld( is ); if( w != null ) { - NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); + final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); if( info != null ) { return new WorldCoord( info.getInteger( "minX" ), info.getInteger( "minY" ), info.getInteger( "minZ" ) ); @@ -136,12 +136,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getMax( ItemStack is ) + public WorldCoord getMax( final ItemStack is ) { - World w = this.getWorld( is ); + final World w = this.getWorld( is ); if( w != null ) { - NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); + final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); if( info != null ) { return new WorldCoord( info.getInteger( "maxX" ), info.getInteger( "maxY" ), info.getInteger( "maxZ" ) ); @@ -151,14 +151,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition ) + public TransitionResult doSpatialTransition( final ItemStack is, final World w, final WorldCoord min, final WorldCoord max, final boolean doTransition ) { - WorldCoord scale = this.getStoredSize( is ); + final WorldCoord scale = this.getStoredSize( is ); - int targetX = max.x - min.x - 1; - int targetY = max.y - min.y - 1; - int targetZ = max.z - min.z - 1; - int maxSize = this.getMaxStoredDim( is ); + final int targetX = max.x - min.x - 1; + final int targetY = max.y - min.y - 1; + final int targetZ = max.z - min.z - 1; + final int maxSize = this.getMaxStoredDim( is ); World destination = this.getWorld( is ); @@ -171,7 +171,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag destination = this.createNewWorld( is ); } - int floorBuffer = 64; + final int floorBuffer = 64; StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 ); this.setStoredSize( is, targetX, targetY, targetZ ); @@ -182,22 +182,22 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag return new TransitionResult( false, 0 ); } - public World createNewWorld( ItemStack is ) + public World createNewWorld( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); - int newDim = DimensionManager.getNextFreeDimId(); + final NBTTagCompound c = Platform.openNbtData( is ); + final int newDim = DimensionManager.getNextFreeDimId(); c.setInteger( "StorageDim", newDim ); WorldData.instance().dimensionData().addStorageCell( newDim ); DimensionManager.initDimension( newDim ); return DimensionManager.getWorld( newDim ); } - private void setStoredSize( ItemStack is, int targetX, int targetY, int targetZ ) + private void setStoredSize( final ItemStack is, final int targetX, final int targetY, final int targetZ ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); - int dim = c.getInteger( "StorageDim" ); + final NBTTagCompound c = is.getTagCompound(); + final int dim = c.getInteger( "StorageDim" ); c.setInteger( "sizeX", targetX ); c.setInteger( "sizeY", targetY ); c.setInteger( "sizeZ", targetZ ); diff --git a/src/main/java/appeng/items/storage/ItemViewCell.java b/src/main/java/appeng/items/storage/ItemViewCell.java index 3c5e13dc..c69aee33 100644 --- a/src/main/java/appeng/items/storage/ItemViewCell.java +++ b/src/main/java/appeng/items/storage/ItemViewCell.java @@ -51,13 +51,13 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem this.setMaxStackSize( 1 ); } - public static IPartitionList createFilter( ItemStack[] list ) + public static IPartitionList createFilter( final ItemStack[] list ) { IPartitionList myPartitionList = null; - MergedPriorityList myMergedList = new MergedPriorityList(); + final MergedPriorityList myMergedList = new MergedPriorityList(); - for( ItemStack currentViewCell : list ) + for( final ItemStack currentViewCell : list ) { if( currentViewCell == null ) { @@ -66,22 +66,22 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem if( ( currentViewCell.getItem() instanceof ItemViewCell ) ) { - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem(); - IInventory upgrades = vc.getUpgradesInventory( currentViewCell ); - IInventory config = vc.getConfigInventory( currentViewCell ); - FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell ); + final ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem(); + final IInventory upgrades = vc.getUpgradesInventory( currentViewCell ); + final IInventory config = vc.getConfigInventory( currentViewCell ); + final FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell ); boolean hasInverter = false; boolean hasFuzzy = false; for( int x = 0; x < upgrades.getSizeInventory(); x++ ) { - ItemStack is = upgrades.getStackInSlot( x ); + final ItemStack is = upgrades.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); if( u != null ) { switch( u ) @@ -100,7 +100,7 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem for( int x = 0; x < config.getSizeInventory(); x++ ) { - ItemStack is = config.getStackInSlot( x ); + final ItemStack is = config.getStackInSlot( x ); if( is != null ) { priorityList.add( AEItemStack.create( is ) ); @@ -127,39 +127,39 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } diff --git a/src/main/java/appeng/items/tools/ToolBiometricCard.java b/src/main/java/appeng/items/tools/ToolBiometricCard.java index 09051405..4baefa68 100644 --- a/src/main/java/appeng/items/tools/ToolBiometricCard.java +++ b/src/main/java/appeng/items/tools/ToolBiometricCard.java @@ -57,7 +57,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public ItemStack onItemRightClick( ItemStack is, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack is, final World w, final EntityPlayer p ) { if( p.isSneaking() ) { @@ -70,7 +70,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public boolean itemInteractionForEntity( ItemStack is, EntityPlayer par2EntityPlayer, EntityLivingBase target ) + public boolean itemInteractionForEntity( ItemStack is, final EntityPlayer par2EntityPlayer, final EntityLivingBase target ) { if( target instanceof EntityPlayer && !par2EntityPlayer.isSneaking() ) { @@ -86,15 +86,15 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { - GameProfile username = this.getProfile( is ); + final GameProfile username = this.getProfile( is ); return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is ); } - private void encode( ItemStack is, EntityPlayer p ) + private void encode( final ItemStack is, final EntityPlayer p ) { - GameProfile username = this.getProfile( is ); + final GameProfile username = this.getProfile( is ); if( username != null && username.equals( p.getGameProfile() ) ) { @@ -107,13 +107,13 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public void setProfile( ItemStack itemStack, GameProfile profile ) + public void setProfile( final ItemStack itemStack, final GameProfile profile ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); if( profile != null ) { - NBTTagCompound pNBT = new NBTTagCompound(); + final NBTTagCompound pNBT = new NBTTagCompound(); NBTUtil.func_152460_a( pNBT, profile ); tag.setTag( "profile", pNBT ); } @@ -124,9 +124,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public GameProfile getProfile( ItemStack is ) + public GameProfile getProfile( final ItemStack is ) { - NBTTagCompound tag = Platform.openNbtData( is ); + final NBTTagCompound tag = Platform.openNbtData( is ); if( tag.hasKey( "profile" ) ) { return NBTUtil.func_152459_a( tag.getCompoundTag( "profile" ) ); @@ -135,12 +135,12 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public EnumSet getPermissions( ItemStack is ) + public EnumSet getPermissions( final ItemStack is ) { - NBTTagCompound tag = Platform.openNbtData( is ); - EnumSet result = EnumSet.noneOf( SecurityPermissions.class ); + final NBTTagCompound tag = Platform.openNbtData( is ); + final EnumSet result = EnumSet.noneOf( SecurityPermissions.class ); - for( SecurityPermissions sp : SecurityPermissions.values() ) + for( final SecurityPermissions sp : SecurityPermissions.values() ) { if( tag.getBoolean( sp.name() ) ) { @@ -152,16 +152,16 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public boolean hasPermission( ItemStack is, SecurityPermissions permission ) + public boolean hasPermission( final ItemStack is, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( is ); + final NBTTagCompound tag = Platform.openNbtData( is ); return tag.getBoolean( permission.name() ); } @Override - public void removePermission( ItemStack itemStack, SecurityPermissions permission ) + public void removePermission( final ItemStack itemStack, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); if( tag.hasKey( permission.name() ) ) { tag.removeTag( permission.name() ); @@ -169,22 +169,22 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public void addPermission( ItemStack itemStack, SecurityPermissions permission ) + public void addPermission( final ItemStack itemStack, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); tag.setBoolean( permission.name(), true ); } @Override - public void registerPermissions( ISecurityRegistry register, IPlayerRegistry pr, ItemStack is ) + public void registerPermissions( final ISecurityRegistry register, final IPlayerRegistry pr, final ItemStack is ) { register.addPlayer( pr.getID( this.getProfile( is ) ), this.getPermissions( is ) ); } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - EnumSet perms = this.getPermissions( stack ); + final EnumSet perms = this.getPermissions( stack ); if( perms.isEmpty() ) { lines.add( GuiText.NoPermissions.getLocal() ); @@ -193,7 +193,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard { String msg = null; - for( SecurityPermissions sp : perms ) + for( final SecurityPermissions sp : perms ) { if( msg == null ) { diff --git a/src/main/java/appeng/items/tools/ToolMemoryCard.java b/src/main/java/appeng/items/tools/ToolMemoryCard.java index 91d82dbc..582d2b65 100644 --- a/src/main/java/appeng/items/tools/ToolMemoryCard.java +++ b/src/main/java/appeng/items/tools/ToolMemoryCard.java @@ -46,11 +46,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) ); - NBTTagCompound data = this.getData( stack ); + final NBTTagCompound data = this.getData( stack ); if( data.hasKey( "tooltip" ) ) { lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) ); @@ -64,18 +64,18 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard * * @return localized name */ - private String getLocalizedName( String... name ) + private String getLocalizedName( final String... name ) { - for( String n : name ) + for( final String n : name ) { - String l = StatCollector.translateToLocal( n ); + final String l = StatCollector.translateToLocal( n ); if( !l.equals( n ) ) { return l; } } - for( String n : name ) + for( final String n : name ) { return n; } @@ -84,25 +84,25 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void setMemoryCardContents( ItemStack is, String settingsName, NBTTagCompound data ) + public void setMemoryCardContents( final ItemStack is, final String settingsName, final NBTTagCompound data ) { - NBTTagCompound c = Platform.openNbtData( is ); + final NBTTagCompound c = Platform.openNbtData( is ); c.setString( "Config", settingsName ); c.setTag( "Data", data ); } @Override - public String getSettingsName( ItemStack is ) + public String getSettingsName( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); - String name = c.getString( "Config" ); + final NBTTagCompound c = Platform.openNbtData( is ); + final String name = c.getString( "Config" ); return name == null || name.isEmpty() ? GuiText.Blank.getUnlocalized() : name; } @Override - public NBTTagCompound getData( ItemStack is ) + public NBTTagCompound getData( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); + final NBTTagCompound c = Platform.openNbtData( is ); NBTTagCompound o = c.getCompoundTag( "Data" ); if( o == null ) { @@ -112,7 +112,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void notifyUser( EntityPlayer player, MemoryCardMessages msg ) + public void notifyUser( final EntityPlayer player, final MemoryCardMessages msg ) { if( Platform.isClient() ) { @@ -138,11 +138,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hx, float hy, float hz ) + public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hx, final float hy, final float hz ) { if( player.isSneaking() && !w.isRemote ) { - IMemoryCard mem = (IMemoryCard) is.getItem(); + final IMemoryCard mem = (IMemoryCard) is.getItem(); mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED ); is.setTagCompound( null ); return true; @@ -154,7 +154,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player ) + public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player ) { return true; } diff --git a/src/main/java/appeng/items/tools/ToolNetworkTool.java b/src/main/java/appeng/items/tools/ToolNetworkTool.java index 66a00634..961daa22 100644 --- a/src/main/java/appeng/items/tools/ToolNetworkTool.java +++ b/src/main/java/appeng/items/tools/ToolNetworkTool.java @@ -69,18 +69,18 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, } @Override - public IGuiItemObject getGuiObject( ItemStack is, World world, int x, int y, int z ) + public IGuiItemObject getGuiObject( final ItemStack is, final World world, final int x, final int y, final int z ) { - TileEntity te = world.getTileEntity( x, y, z ); + final TileEntity te = world.getTileEntity( x, y, z ); return new NetworkToolViewer( is, (IGridHost) ( te instanceof IGridHost ? te : null ) ); } @Override - public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p ) { if( Platform.isClient() ) { - MovingObjectPosition mop = ClientHelper.proxy.getMOP(); + final MovingObjectPosition mop = ClientHelper.proxy.getMOP(); if( mop == null ) { @@ -88,9 +88,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, } else { - int i = mop.blockX; - int j = mop.blockY; - int k = mop.blockZ; + final int i = mop.blockX; + final int j = mop.blockY; + final int k = mop.blockZ; if( w.getBlock( i, j, k ).isAir( w, i, j, k ) ) { @@ -103,13 +103,13 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, } @Override - public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { - MovingObjectPosition mop = new MovingObjectPosition( x, y, z, side, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); - TileEntity te = world.getTileEntity( x, y, z ); + final MovingObjectPosition mop = new MovingObjectPosition( x, y, z, side, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); + final TileEntity te = world.getTileEntity( x, y, z ); if( te instanceof IPartHost ) { - SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec ); + final SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec ); if( part.part != null ) { if( part.part instanceof INetworkToolAgent && !( (INetworkToolAgent) part.part ).showNetworkInfo( mop ) ) @@ -131,12 +131,12 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, } @Override - public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player ) + public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player ) { return true; } - public boolean serverSideToolLogic( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean serverSideToolLogic( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( side >= 0 ) { @@ -145,10 +145,10 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, return false; } - Block b = w.getBlock( x, y, z ); + final Block b = w.getBlock( x, y, z ); if( b != null && !p.isSneaking() ) { - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( !( te instanceof IGridHost ) ) { if( b.rotateBlock( w, x, y, z, ForgeDirection.getOrientation( side ) ) ) @@ -167,7 +167,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, return true; } - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( te instanceof IGridHost ) { @@ -194,19 +194,19 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, } @Override - public boolean canWrench( ItemStack is, EntityPlayer player, int x, int y, int z ) + public boolean canWrench( final ItemStack is, final EntityPlayer player, final int x, final int y, final int z ) { return true; } @Override - public boolean canWrench( EntityPlayer player, int x, int y, int z ) + public boolean canWrench( final EntityPlayer player, final int x, final int y, final int z ) { return true; } @Override - public void wrenchUsed( EntityPlayer player, int x, int y, int z ) + public void wrenchUsed( final EntityPlayer player, final int x, final int y, final int z ) { player.swingItem(); } diff --git a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java index eb1a20b4..205a1a40 100644 --- a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java +++ b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java @@ -45,7 +45,7 @@ public class ToolChargedStaff extends AEBasePoweredItem } @Override - public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter ) + public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter ) { if( this.getAECurrentPower( item ) > 300 ) { @@ -54,9 +54,9 @@ public class ToolChargedStaff extends AEBasePoweredItem { for( int x = 0; x < 2; x++ ) { - float dx = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minX ); - float dy = (float) ( Platform.getRandomFloat() * target.height + target.boundingBox.minY ); - float dz = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minZ ); + final float dx = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minX ); + final float dy = (float) ( Platform.getRandomFloat() * target.height + target.boundingBox.minY ); + final float dz = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minZ ); ServerHelper.proxy.sendToAllNearExcept( null, dx, dy, dz, 32.0, target.worldObj, new PacketLightning( dx, dy, dz ) ); } } diff --git a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java index 99dfa530..803d7db8 100644 --- a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java +++ b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java @@ -87,7 +87,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe static { - for( AEColor col : AEColor.values() ) + for( final AEColor col : AEColor.values() ) { if( col == AEColor.Transparent ) { @@ -116,16 +116,16 @@ 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( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { - Block blk = w.getBlock( x, y, z ); + final Block blk = w.getBlock( x, y, z ); ItemStack paintBall = this.getColor( is ); - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); if( inv != null ) { - IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() ); + final IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() ); if( option != null ) { @@ -142,11 +142,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return false; } - double powerPerUse = 100; + final double powerPerUse = 100; if( paintBall != null && paintBall.getItem() instanceof ItemSnowball ) { - ForgeDirection orientation = ForgeDirection.getOrientation( side ); - TileEntity te = w.getTileEntity( x, y, z ); + final ForgeDirection orientation = ForgeDirection.getOrientation( side ); + final TileEntity te = w.getTileEntity( x, y, z ); // clean cables. if( te instanceof IColorableTile ) { @@ -162,8 +162,8 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } // clean paint balls.. - 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 ); + final Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); + final TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ ); if( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); @@ -174,7 +174,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } else if( paintBall != null ) { - AEColor color = this.getColorFromItem( paintBall ); + final AEColor color = this.getColorFromItem( paintBall ); if( color != null && this.getAECurrentPower( is ) > powerPerUse ) { @@ -197,11 +197,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public String getItemStackDisplayName( ItemStack par1ItemStack ) + public String getItemStackDisplayName( final ItemStack par1ItemStack ) { String extra = GuiText.Empty.getLocal(); - AEColor selected = this.getActiveColor( par1ItemStack ); + final AEColor selected = this.getActiveColor( par1ItemStack ); if( selected != null && Platform.isClient() ) { @@ -211,12 +211,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra; } - public AEColor getActiveColor( ItemStack tol ) + public AEColor getActiveColor( final ItemStack tol ) { return this.getColorFromItem( this.getColor( tol ) ); } - public AEColor getColorFromItem( ItemStack paintBall ) + public AEColor getColorFromItem( final ItemStack paintBall ) { if( paintBall == null ) { @@ -230,14 +230,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( paintBall.getItem() instanceof ItemPaintBall ) { - ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem(); return ipb.getColor( paintBall ); } else { - int[] id = OreDictionary.getOreIDs( paintBall ); + final int[] id = OreDictionary.getOreIDs( paintBall ); - for( int oreID : id ) + for( final int oreID : id ) { if( ORE_TO_COLOR.containsKey( oreID ) ) { @@ -249,13 +249,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return null; } - public ItemStack getColor( ItemStack is ) + public ItemStack getColor( final ItemStack is ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( c != null && c.hasKey( "color" ) ) { - NBTTagCompound color = c.getCompoundTag( "color" ); - ItemStack oldColor = ItemStack.loadItemStackFromNBT( color ); + final NBTTagCompound color = c.getCompoundTag( "color" ); + final ItemStack oldColor = ItemStack.loadItemStackFromNBT( color ); if( oldColor != null ) { return oldColor; @@ -265,17 +265,17 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return this.findNextColor( is, null, 0 ); } - private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset ) + private ItemStack findNextColor( final ItemStack is, final ItemStack anchor, final int scrollOffset ) { ItemStack newColor = null; - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); if( inv != null ) { - IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); if( anchor == null ) { - IAEItemStack firstItem = itemList.getFirstItem(); + final IAEItemStack firstItem = itemList.getFirstItem(); if( firstItem != null ) { newColor = firstItem.getItemStack(); @@ -283,9 +283,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } else { - LinkedList list = new LinkedList(); + final LinkedList list = new LinkedList(); - for( IAEItemStack i : itemList ) + for( final IAEItemStack i : itemList ) { list.add( i ); } @@ -294,7 +294,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe { @Override - public int compare( IAEItemStack a, IAEItemStack b ) + public int compare( final IAEItemStack a, final IAEItemStack b ) { return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() ); } @@ -337,26 +337,26 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return newColor; } - public void setColor( ItemStack is, ItemStack newColor ) + public void setColor( final ItemStack is, final ItemStack newColor ) { - NBTTagCompound data = Platform.openNbtData( is ); + final NBTTagCompound data = Platform.openNbtData( is ); if( newColor == null ) { data.removeTag( "color" ); } else { - NBTTagCompound color = new NBTTagCompound(); + final NBTTagCompound color = new NBTTagCompound(); newColor.writeToNBT( color ); data.setTag( "color", color ); } } - private boolean recolourBlock( Block blk, ForgeDirection side, World w, int x, int y, int z, ForgeDirection orientation, AEColor newColor, EntityPlayer p ) + private boolean recolourBlock( final Block blk, final ForgeDirection side, final World w, final int x, final int y, final int z, final ForgeDirection orientation, final AEColor newColor, final EntityPlayer p ) { if( blk == Blocks.carpet ) { - int meta = w.getBlockMetadata( x, y, z ); + final int meta = w.getBlockMetadata( x, y, z ); if( newColor.ordinal() == meta ) { return false; @@ -371,7 +371,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( blk == Blocks.stained_glass ) { - int meta = w.getBlockMetadata( x, y, z ); + final int meta = w.getBlockMetadata( x, y, z ); if( newColor.ordinal() == meta ) { return false; @@ -386,7 +386,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( blk == Blocks.stained_glass_pane ) { - int meta = w.getBlockMetadata( x, y, z ); + final int meta = w.getBlockMetadata( x, y, z ); if( newColor.ordinal() == meta ) { return false; @@ -401,7 +401,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( blk == Blocks.stained_hardened_clay ) { - int meta = w.getBlockMetadata( x, y, z ); + final int meta = w.getBlockMetadata( x, y, z ); if( newColor.ordinal() == meta ) { return false; @@ -417,7 +417,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return blk.recolourBlock( w, x, y, z, side, newColor.ordinal() ); } - public void cycleColors( ItemStack is, ItemStack paintBall, int i ) + public void cycleColors( final ItemStack is, final ItemStack paintBall, final int i ) { if( paintBall == null ) { @@ -430,15 +430,15 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -448,37 +448,37 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int BytePerType( ItemStack cell ) + public int BytePerType( final ItemStack cell ) { return 8; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 27; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { if( requestedAddition != null ) { - int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() ); + final int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() ); - for( int x : id ) + for( final int x : id ) { if( ORE_TO_COLOR.containsKey( x ) ) { @@ -503,7 +503,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -515,51 +515,51 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public void onWheel( ItemStack is, boolean up ) + public void onWheel( final ItemStack is, final boolean up ) { this.cycleColors( is, this.getColor( is ), up ? 1 : -1 ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java index 42340dd8..661222e0 100644 --- a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java +++ b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java @@ -75,7 +75,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_lava, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.obsidian ) ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.grass, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.dirt ) ) ); - List snowBalls = new ArrayList(); + final List snowBalls = new ArrayList(); snowBalls.add( new ItemStack( Items.snowball ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( null, snowBalls ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.ice ) ) ); @@ -98,7 +98,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT private final Block blockID; private final int metadata; - public InWorldToolOperationIngredient( Block blockID, int metadata ) + public InWorldToolOperationIngredient( final Block blockID, final int metadata ) { this.blockID = blockID; this.metadata = metadata; @@ -111,7 +111,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -121,12 +121,12 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { return false; } - InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj; + final InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj; return this.blockID == other.blockID && this.metadata == other.metadata; } } - private void heat( Block blockID, int metadata, World w, int x, int y, int z ) + private void heat( final Block blockID, final int metadata, final World w, final int x, final int y, final int z ) { InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( blockID, metadata ) ); @@ -150,7 +150,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } } - private boolean canHeat( Block blockID, int metadata ) + private boolean canHeat( final Block blockID, final int metadata ) { InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( blockID, metadata ) ); @@ -162,7 +162,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return r != null; } - private void cool( Block blockID, int metadata, World w, int x, int y, int z ) + private void cool( final Block blockID, final int metadata, final World w, final int x, final int y, final int z ) { InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( blockID, metadata ) ); @@ -186,7 +186,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } } - private boolean canCool( Block blockID, int metadata ) + private boolean canCool( final Block blockID, final int metadata ) { InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( blockID, metadata ) ); @@ -199,7 +199,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter ) + public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter ) { if( this.getAECurrentPower( item ) > 1600 ) { @@ -211,9 +211,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p ) { - MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true ); + final MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true ); if( target == null ) { @@ -223,9 +223,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { if( target.typeOfHit == MovingObjectType.BLOCK ) { - int x = target.blockX; - int y = target.blockY; - int z = target.blockZ; + final int x = target.blockX; + final int y = target.blockY; + final int z = target.blockZ; if( w.getBlock( x, y, z ).getMaterial() == Material.lava || w.getBlock( x, y, z ).getMaterial() == Material.water ) { @@ -241,7 +241,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public boolean onItemUse( ItemStack item, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUse( final ItemStack item, final EntityPlayer p, final World w, int x, int y, int z, final int side, final float hitX, final float hitY, final float hitZ ) { if( this.getAECurrentPower( item ) > 1600 ) { @@ -250,8 +250,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return false; } - Block blockID = w.getBlock( x, y, z ); - int metadata = w.getBlockMetadata( x, y, z ); + final Block blockID = w.getBlock( x, y, z ); + final int metadata = w.getBlockMetadata( x, y, z ); if( p.isSneaking() ) { @@ -285,14 +285,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return true; } - ItemStack[] stack = Platform.getBlockDrops( w, x, y, z ); - List out = new ArrayList(); + final ItemStack[] stack = Platform.getBlockDrops( w, x, y, z ); + final List out = new ArrayList(); boolean hasFurnaceable = false; boolean canFurnaceable = true; - for( ItemStack i : stack ) + for( final ItemStack i : stack ) { - ItemStack result = FurnaceRecipes.smelting().getSmeltingResult( i ); + final ItemStack result = FurnaceRecipes.smelting().getSmeltingResult( i ); if( result != null ) { @@ -316,7 +316,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if( hasFurnaceable && canFurnaceable ) { this.extractAEPower( item, 1600 ); - InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); + final InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); 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 ) @@ -337,7 +337,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } else { - ForgeDirection dir = ForgeDirection.getOrientation( side ); + final ForgeDirection dir = ForgeDirection.getOrientation( side ); x += dir.offsetX; y += dir.offsetY; z += dir.offsetZ; diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index eab1d9b6..5f1a165e 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -95,15 +95,15 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -113,22 +113,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p ) { if( this.getAECurrentPower( item ) > 1600 ) { int shots = 1; - CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item ); + final CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item ); if( cu != null ) { shots += cu.getInstalledUpgrades( Upgrades.SPEED ); } - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS ); if( inv != null ) { - IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); IAEStack aeAmmo = itemList.getFirstItem(); if( aeAmmo instanceof IAEItemStack ) { @@ -143,7 +143,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } aeAmmo.setStackSize( 1 ); - ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack(); + final ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack(); if( ammo == null ) { return item; @@ -156,29 +156,29 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell 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 ) * 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 ); - float f5 = -MathHelper.cos( -f1 * 0.017453292F ); - float f6 = MathHelper.sin( -f1 * 0.017453292F ); - float f7 = f4 * f5; - float f8 = f3 * f5; - double d3 = 32.0D; + final float f = 1.0F; + final float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f; + final float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f; + final double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f; + final double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.yOffset; + final double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f; + final Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); + final float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); + final float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); + final float f5 = -MathHelper.cos( -f1 * 0.017453292F ); + final float f6 = MathHelper.sin( -f1 * 0.017453292F ); + final float f7 = f4 * f5; + final float f8 = f3 * f5; + final double d3 = 32.0D; - Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); - Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 ); + final Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); + final Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 ); direction.normalize(); - float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f; + final float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f; if( penetration <= 0 ) { - ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack(); + final ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack(); if( type.getItem() instanceof ItemPaintBall ) { this.shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 ); @@ -204,17 +204,17 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell return item; } - private void shootPaintBalls( ItemStack type, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 ) + private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 ) { - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); double closest = 9999999.0D; for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -226,14 +226,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; } - float f1 = 0.3F; + final float f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -247,7 +247,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, false ); - Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); + final Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { pos = new MovingObjectPosition( entity ); @@ -261,27 +261,27 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { 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( vec ) + 1 ) ) ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } if( pos != null && type != null && type.getItem() instanceof ItemPaintBall ) { - ItemPaintBall ipb = (ItemPaintBall) type.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) type.getItem(); - AEColor col = ipb.getColor( type ); + final AEColor col = ipb.getColor( type ); // boolean lit = ipb.isLumen( type ); if( pos.typeOfHit == MovingObjectType.ENTITY ) { - int id = pos.entityHit.getEntityId(); - PlayerColor marker = new PlayerColor( id, col, 20 * 30 ); + final int id = pos.entityHit.getEntityId(); + final PlayerColor marker = new PlayerColor( id, col, 20 * 30 ); TickHandler.INSTANCE.getPlayerColors().put( id, marker ); if( pos.entityHit instanceof EntitySheep ) { - EntitySheep sh = (EntitySheep) pos.entityHit; + final EntitySheep sh = (EntitySheep) pos.entityHit; sh.setFleeceColor( col.ordinal() ); } @@ -290,27 +290,27 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } else if( pos.typeOfHit == MovingObjectType.BLOCK ) { - ForgeDirection side = ForgeDirection.getOrientation( pos.sideHit ); + final ForgeDirection side = ForgeDirection.getOrientation( pos.sideHit ); - int x = pos.blockX + side.offsetX; - int y = pos.blockY + side.offsetY; - int z = pos.blockZ + side.offsetZ; + final int x = pos.blockX + side.offsetX; + final int y = pos.blockY + side.offsetY; + final int z = pos.blockZ + side.offsetZ; if( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) ) { return; } - Block whatsThere = w.getBlock( x, y, z ); + final Block whatsThere = w.getBlock( x, y, z ); if( whatsThere.isReplaceable( w, x, y, z ) && w.isAirBlock( x, y, z ) ) { - for( Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() ) + for( final Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() ) { w.setBlock( x, y, z, paintBlock, 0, 3 ); } } - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( te instanceof TilePaint ) { pos.hitVec.xCoord -= x; @@ -322,22 +322,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } } - private void standardAmmo( float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 ) + private void standardAmmo( float penetration, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 ) { boolean hasDestroyed = true; while( penetration > 0 && hasDestroyed ) { hasDestroyed = false; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); double closest = 9999999.0D; for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -349,14 +349,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; } - float f1 = 0.3F; + final float f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -368,7 +368,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } } - Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); + final Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 ); MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, true ); if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { @@ -383,22 +383,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { 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( vec ) + 1 ) ) ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } if( pos != null ) { - DamageSource dmgSrc = DamageSource.causePlayerDamage( p ); + final DamageSource dmgSrc = DamageSource.causePlayerDamage( p ); dmgSrc.damageType = "masscannon"; if( pos.typeOfHit == MovingObjectType.ENTITY ) { - int dmg = (int) Math.ceil( penetration / 20.0f ); + final int dmg = (int) Math.ceil( penetration / 20.0f ); if( pos.entityHit instanceof EntityLivingBase ) { - EntityLivingBase el = (EntityLivingBase) pos.entityHit; + final EntityLivingBase el = (EntityLivingBase) pos.entityHit; penetration -= dmg; el.knockBack( p, 0, -direction.xCoord, -direction.zCoord ); // el.knockBack( p, 0, vec3.xCoord, @@ -427,11 +427,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } else { - Block b = w.getBlock( pos.blockX, pos.blockY, pos.blockZ ); + final Block b = w.getBlock( pos.blockX, pos.blockY, pos.blockZ ); // int meta = w.getBlockMetadata( // pos.blockX, pos.blockY, pos.blockZ ); - float hardness = b.getBlockHardness( w, pos.blockX, pos.blockY, pos.blockZ ) * 9.0f; + final float hardness = b.getBlockHardness( w, pos.blockX, pos.blockY, pos.blockZ ) * 9.0f; if( hardness >= 0.0 ) { if( penetration > hardness && Platform.hasPermissions( new DimensionalCoord( w, pos.blockX, pos.blockY, pos.blockZ ), p ) ) @@ -450,71 +450,71 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 4 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int BytePerType( ItemStack cell ) + public int BytePerType( final ItemStack cell ) { return 8; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 1; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { - float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() ); + final float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() ); if( pen > 0 ) { return false; @@ -535,7 +535,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } diff --git a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java index de2d3a3b..af4f5937 100644 --- a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java +++ b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java @@ -66,7 +66,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player ) { Platform.openGUI( player, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_PORTABLE_CELL ); return item; @@ -80,15 +80,15 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -98,31 +98,31 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int BytePerType( ItemStack cell ) + public int BytePerType( final ItemStack cell ) { return 8; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 27; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { return false; } @@ -134,7 +134,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -146,51 +146,51 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public IGuiItemObject getGuiObject( ItemStack is, World w, int x, int y, int z ) + public IGuiItemObject getGuiObject( final ItemStack is, final World w, final int x, final int y, final int z ) { return new PortableCellViewer( is, x ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java index 1203a8a1..bb4cc386 100644 --- a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java +++ b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java @@ -59,7 +59,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player ) { AEApi.instance().registries().wireless().openWirelessTerminalGui( item, w, player ); return item; @@ -73,16 +73,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); if( stack.hasTagCompound() ) { - NBTTagCompound tag = Platform.openNbtData( stack ); + final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { - String encKey = tag.getString( "encryptionKey" ); + final String encKey = tag.getString( "encryptionKey" ); if( encKey == null || encKey.isEmpty() ) { @@ -101,19 +101,19 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public boolean canHandle( ItemStack is ) + public boolean canHandle( final ItemStack is ) { return AEApi.instance().definitions().items().wirelessTerminal().isSameAs( is ); } @Override - public boolean usePower( EntityPlayer player, double amount, ItemStack is ) + public boolean usePower( final EntityPlayer player, final double amount, final ItemStack is ) { return this.extractAEPower( is, amount ) >= amount - 0.5; } @Override - public boolean hasPower( EntityPlayer player, double amt, ItemStack is ) + public boolean hasPower( final EntityPlayer player, final double amt, final ItemStack is ) { return this.getAECurrentPower( is ) >= amt; } @@ -125,9 +125,9 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless { @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { - NBTTagCompound data = Platform.openNbtData( target ); + final NBTTagCompound data = Platform.openNbtData( target ); manager.writeToNBT( data ); } } ); @@ -141,16 +141,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public String getEncryptionKey( ItemStack item ) + public String getEncryptionKey( final ItemStack item ) { - NBTTagCompound tag = Platform.openNbtData( item ); + final NBTTagCompound tag = Platform.openNbtData( item ); return tag.getString( "encryptionKey" ); } @Override - public void setEncryptionKey( ItemStack item, String encKey, String name ) + public void setEncryptionKey( final ItemStack item, final String encKey, final String name ) { - NBTTagCompound tag = Platform.openNbtData( item ); + final NBTTagCompound tag = Platform.openNbtData( item ); tag.setString( "encryptionKey", encKey ); tag.setString( "name", name ); } 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 4d05d132..9cd1dedb 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java @@ -24,7 +24,7 @@ import com.google.common.base.Optional; public abstract class AEBasePoweredItem extends RedstoneFlux { - public AEBasePoweredItem( double powerCapacity, Optional subName ) + public AEBasePoweredItem( final double powerCapacity, final Optional subName ) { super( powerCapacity, subName ); 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 41252075..a007a86c 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java @@ -43,7 +43,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow private static final String POWER_NBT_KEY = "internalCurrentPower"; private final double powerCapacity; - public AERootPoweredItem( double powerCapacity, Optional subName ) + public AERootPoweredItem( final double powerCapacity, final Optional subName ) { super( subName ); this.setMaxDamage( 32 ); @@ -54,18 +54,18 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - NBTTagCompound tag = stack.getTagCompound(); + final NBTTagCompound tag = stack.getTagCompound(); double internalCurrentPower = 0; - double internalMaxPower = this.getAEMaxPower( stack ); + final double internalMaxPower = this.getAEMaxPower( stack ); if( tag != null ) { internalCurrentPower = tag.getDouble( "internalCurrentPower" ); } - double percent = internalCurrentPower / internalMaxPower; + final double percent = internalCurrentPower / internalMaxPower; lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) ); } @@ -77,7 +77,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { super.getCheckedSubItems( sameItem, creativeTab, itemStacks ); @@ -96,29 +96,29 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - public double getDurabilityForDisplay( ItemStack is ) + public double getDurabilityForDisplay( final ItemStack is ) { return 1 - this.getAECurrentPower( is ) / this.getAEMaxPower( is ); } @Override - public boolean isDamaged( ItemStack stack ) + public boolean isDamaged( final ItemStack stack ) { return true; } @Override - public void setDamage( ItemStack stack, int damage ) + public void setDamage( final ItemStack stack, final int damage ) { } - private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment ) + private double getInternalBattery( final ItemStack is, final batteryOperation op, final double adjustment ) { - NBTTagCompound data = Platform.openNbtData( is ); + final NBTTagCompound data = Platform.openNbtData( is ); double currentStorage = data.getDouble( POWER_NBT_KEY ); - double maxStorage = this.getAEMaxPower( is ); + final double maxStorage = this.getAEMaxPower( is ); switch( op ) { @@ -126,7 +126,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow currentStorage += adjustment; if( currentStorage > maxStorage ) { - double diff = currentStorage - maxStorage; + final double diff = currentStorage - maxStorage; data.setDouble( POWER_NBT_KEY, maxStorage ); return diff; } @@ -151,11 +151,11 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow /** * inject external */ - double injectExternalPower( PowerUnits input, ItemStack is, double amount, boolean simulate ) + double injectExternalPower( final PowerUnits input, final ItemStack is, final double amount, final boolean simulate ) { if( simulate ) { - int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) ); + final int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) ); if( amount < requiredEU ) { return 0; @@ -164,37 +164,37 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } else { - double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); + final double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); return PowerUnits.AE.convertTo( PowerUnits.EU, powerRemainder ); } } @Override - public double injectAEPower( ItemStack is, double amt ) + public double injectAEPower( final ItemStack is, final double amt ) { return this.getInternalBattery( is, batteryOperation.INJECT, amt ); } @Override - public double extractAEPower( ItemStack is, double amt ) + public double extractAEPower( final ItemStack is, final double amt ) { return this.getInternalBattery( is, batteryOperation.EXTRACT, amt ); } @Override - public double getAEMaxPower( ItemStack is ) + public double getAEMaxPower( final ItemStack is ) { return this.powerCapacity; } @Override - public double getAECurrentPower( ItemStack is ) + public double getAECurrentPower( final ItemStack is ) { return this.getInternalBattery( is, batteryOperation.STORAGE, 0 ); } @Override - public AccessRestriction getPowerFlow( ItemStack is ) + public AccessRestriction getPowerFlow( final ItemStack is ) { return AccessRestriction.WRITE; } 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 263279f2..05163cf6 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/IC2.java +++ b/src/main/java/appeng/items/tools/powered/powersink/IC2.java @@ -38,16 +38,16 @@ import appeng.transformer.annotations.Integration.Method; @InterfaceList( value = { @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2 ), @Interface( iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2 ) } ) public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem { - public IC2( double powerCapacity, Optional subName ) + public IC2( final double powerCapacity, final Optional subName ) { super( powerCapacity, subName ); } @Override - public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate ) + public double charge( final ItemStack is, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean simulate ) { double addedAmt = amount; - double limit = this.getTransferLimit( is ); + final double limit = this.getTransferLimit( is ); if( !ignoreTransferLimit && amount > limit ) { @@ -58,25 +58,25 @@ public abstract class IC2 extends AERootPoweredItem implements IElectricItemMana } @Override - public double discharge( ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate ) + public double discharge( final ItemStack itemStack, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean externally, final boolean simulate ) { return 0; } @Override - public double getCharge( ItemStack is ) + public double getCharge( final ItemStack is ) { return (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) ); } @Override - public boolean canUse( ItemStack is, double amount ) + public boolean canUse( final ItemStack is, final double amount ) { return this.getCharge( is ) > amount; } @Override - public boolean use( ItemStack is, double amount, EntityLivingBase entity ) + public boolean use( final ItemStack is, final double amount, final EntityLivingBase entity ) { if( this.canUse( is, amount ) ) { @@ -88,56 +88,56 @@ public abstract class IC2 extends AERootPoweredItem implements IElectricItemMana } @Override - public void chargeFromArmor( ItemStack itemStack, EntityLivingBase entity ) + public void chargeFromArmor( final ItemStack itemStack, final EntityLivingBase entity ) { // wtf? } @Override - public String getToolTip( ItemStack itemStack ) + public String getToolTip( final ItemStack itemStack ) { return null; } @Override - public boolean canProvideEnergy( ItemStack itemStack ) + public boolean canProvideEnergy( final ItemStack itemStack ) { return false; } @Override - public Item getChargedItem( ItemStack itemStack ) + public Item getChargedItem( final ItemStack itemStack ) { return itemStack.getItem(); } @Override - public Item getEmptyItem( ItemStack itemStack ) + public Item getEmptyItem( final ItemStack itemStack ) { return itemStack.getItem(); } @Override - public double getMaxCharge( ItemStack itemStack ) + public double getMaxCharge( final ItemStack itemStack ) { return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) ); } @Override - public int getTier( ItemStack itemStack ) + public int getTier( final ItemStack itemStack ) { return 1; } @Override - public double getTransferLimit( ItemStack itemStack ) + public double getTransferLimit( final ItemStack itemStack ) { return Math.max( 32, this.getMaxCharge( itemStack ) / 200 ); } @Override @Method( iname = IntegrationType.IC2 ) - public IElectricItemManager getManager( ItemStack itemStack ) + public IElectricItemManager getManager( final ItemStack itemStack ) { return this; } 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 7476951c..c64a2724 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java @@ -33,31 +33,31 @@ import appeng.transformer.annotations.Integration.Interface; @Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = IntegrationType.RFItem ) public abstract class RedstoneFlux extends IC2 implements IEnergyContainerItem { - public RedstoneFlux( double powerCapacity, Optional subName ) + public RedstoneFlux( final double powerCapacity, final Optional subName ) { super( powerCapacity, subName ); } @Override - public int receiveEnergy( ItemStack is, int maxReceive, boolean simulate ) + public int receiveEnergy( final ItemStack is, final int maxReceive, final boolean simulate ) { return maxReceive - (int) this.injectExternalPower( PowerUnits.RF, is, maxReceive, simulate ); } @Override - public int extractEnergy( ItemStack container, int maxExtract, boolean simulate ) + public int extractEnergy( final ItemStack container, final int maxExtract, final boolean simulate ) { return 0; } @Override - public int getEnergyStored( ItemStack is ) + public int getEnergyStored( final ItemStack is ) { return (int) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower( is ) ); } @Override - public int getMaxEnergyStored( ItemStack is ) + public int getMaxEnergyStored( final ItemStack is ) { return (int) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower( is ) ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java index 5339b790..092b73ac 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java @@ -38,7 +38,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzAxe( AEFeature type ) + public ToolQuartzAxe( final AEFeature type ) { super( ToolMaterial.IRON ); this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzAxe ), this, this, Optional.of( type.name() ) ); @@ -57,7 +57,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.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 8a6aa5a8..8887e088 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java @@ -41,7 +41,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem { private final AEFeature type; - public ToolQuartzCuttingKnife( AEFeature type ) + public ToolQuartzCuttingKnife( final AEFeature type ) { super( Optional.of( type.name() ) ); @@ -52,7 +52,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( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int s, final float hitX, final float hitY, final float hitZ ) { if( Platform.isServer() ) { @@ -62,7 +62,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p ) { if( Platform.isServer() ) { @@ -73,13 +73,13 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public boolean doesContainerItemLeaveCraftingGrid( ItemStack par1ItemStack ) + public boolean doesContainerItemLeaveCraftingGrid( final ItemStack par1ItemStack ) { return false; } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } @@ -91,20 +91,20 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { itemStack.setItemDamage( itemStack.getItemDamage() + 1 ); return itemStack; } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return true; } @Override - public IGuiItemObject getGuiObject( ItemStack is, World world, int x, int y, int z ) + public IGuiItemObject getGuiObject( final ItemStack is, final World world, final int x, final int y, final int z ) { return new QuartzKnifeObj( is ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java index 23edeb89..1fd06627 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java @@ -38,7 +38,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature private final AEFeature feature; private final IFeatureHandler handler; - public ToolQuartzHoe( AEFeature feature ) + public ToolQuartzHoe( final AEFeature feature ) { super( ToolMaterial.IRON ); @@ -59,7 +59,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.feature, 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 1d933327..2ee95a47 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java @@ -38,7 +38,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzPickaxe( AEFeature type ) + public ToolQuartzPickaxe( final AEFeature type ) { super( ToolMaterial.IRON ); @@ -59,7 +59,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.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 c126ab74..a717c0ce 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java @@ -38,7 +38,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature private final AEFeature type; private final IFeatureHandler handler; - public ToolQuartzSpade( AEFeature type ) + public ToolQuartzSpade( final AEFeature type ) { super( ToolMaterial.IRON ); @@ -58,7 +58,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.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 27d1d582..6670f100 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java @@ -38,7 +38,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzSword( AEFeature type ) + public ToolQuartzSword( final AEFeature type ) { super( ToolMaterial.IRON ); this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzSword ), this, this, Optional.of( type.name() ) ); @@ -57,7 +57,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java index 521d9678..14b3bd8c 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java @@ -44,7 +44,7 @@ import appeng.util.Platform; public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWrench { - public ToolQuartzWrench( AEFeature type ) + public ToolQuartzWrench( final AEFeature type ) { super( Optional.of( type.name() ) ); @@ -54,9 +54,9 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren } @Override - public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ ) { - Block b = world.getBlock( x, y, z ); + final Block b = world.getBlock( x, y, z ); if( b != null && !player.isSneaking() && Platform.hasPermissions( new DimensionalCoord( world, x, y, z ), player ) ) { if( Platform.isClient() ) @@ -64,7 +64,7 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren return !world.isRemote; } - ForgeDirection mySide = ForgeDirection.getOrientation( side ); + final ForgeDirection mySide = ForgeDirection.getOrientation( side ); if( b.rotateBlock( world, x, y, z, mySide ) ) { b.onNeighborBlockChange( world, x, y, z, Platform.AIR_BLOCK ); @@ -77,25 +77,25 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren @Override // public boolean shouldPassSneakingClickToBlock(World w, int x, int y, int z) - public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player ) + public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player ) { return true; } @Override - public boolean canWrench( ItemStack is, EntityPlayer player, int x, int y, int z ) + public boolean canWrench( final ItemStack is, final EntityPlayer player, final int x, final int y, final int z ) { return true; } @Override - public boolean canWrench( EntityPlayer player, int x, int y, int z ) + public boolean canWrench( final EntityPlayer player, final int x, final int y, final int z ) { return true; } @Override - public void wrenchUsed( EntityPlayer player, int x, int y, int z ) + public void wrenchUsed( final EntityPlayer player, final int x, final int y, final int z ) { player.swingItem(); } diff --git a/src/main/java/appeng/me/Grid.java b/src/main/java/appeng/me/Grid.java index 80c18318..8bd513f8 100644 --- a/src/main/java/appeng/me/Grid.java +++ b/src/main/java/appeng/me/Grid.java @@ -50,16 +50,16 @@ public class Grid implements IGrid private int priority; // how import is this network? private GridStorage myStorage; - public Grid( GridNode center ) + public Grid( final GridNode center ) { this.pivot = center; - Map, IGridCache> myCaches = AEApi.instance().registries().gridCache().createCacheInstance( this ); - for( Entry, IGridCache> c : myCaches.entrySet() ) + final Map, IGridCache> myCaches = AEApi.instance().registries().gridCache().createCacheInstance( this ); + for( final Entry, IGridCache> c : myCaches.entrySet() ) { - Class key = c.getKey(); - IGridCache value = c.getValue(); - Class valueClass = value.getClass(); + final Class key = c.getKey(); + final IGridCache value = c.getValue(); + final Class valueClass = value.getClass(); this.eventBus.readClass( key, valueClass ); this.caches.put( key, new GridCacheWrapper( value ) ); @@ -94,23 +94,23 @@ public class Grid implements IGrid public int size() { int out = 0; - for( Collection x : this.machines.values() ) + for( final Collection x : this.machines.values() ) { out += x.size(); } return out; } - public void remove( GridNode gridNode ) + public void remove( final GridNode gridNode ) { - for( IGridCache c : this.caches.values() ) + for( final IGridCache c : this.caches.values() ) { - IGridHost machine = gridNode.getMachine(); + final IGridHost machine = gridNode.getMachine(); c.removeNode( gridNode, machine ); } - Class machineClass = gridNode.getMachineClass(); - Set nodes = this.machines.get( machineClass ); + final Class machineClass = gridNode.getMachineClass(); + final Set nodes = this.machines.get( machineClass ); if( nodes != null ) { nodes.remove( gridNode ); @@ -120,7 +120,7 @@ public class Grid implements IGrid if( this.pivot == gridNode ) { - Iterator n = this.getNodes().iterator(); + final Iterator n = this.getNodes().iterator(); if( n.hasNext() ) { this.pivot = (GridNode) n.next(); @@ -134,9 +134,9 @@ public class Grid implements IGrid } } - public void add( GridNode gridNode ) + public void add( final GridNode gridNode ) { - Class mClass = gridNode.getMachineClass(); + final Class mClass = gridNode.getMachineClass(); MachineSet nodes = this.machines.get( mClass ); if( nodes == null ) @@ -149,15 +149,15 @@ public class Grid implements IGrid // handle loading grid storages. if( gridNode.getGridStorage() != null ) { - GridStorage gs = gridNode.getGridStorage(); - IGrid grid = gs.getGrid(); + final GridStorage gs = gridNode.getGridStorage(); + final IGrid grid = gs.getGrid(); if( grid == null ) { this.myStorage = gs; this.myStorage.setGrid( this ); - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { gc.onJoin( this.myStorage ); } @@ -170,17 +170,17 @@ public class Grid implements IGrid this.myStorage.setGrid( this ); } - IGridStorage tmp = new GridStorage(); + final IGridStorage tmp = new GridStorage(); if( !gs.hasDivided( this.myStorage ) ) { gs.addDivided( this.myStorage ); - for( IGridCache gc : ( (Grid) grid ).caches.values() ) + for( final IGridCache gc : ( (Grid) grid ).caches.values() ) { gc.onSplit( tmp ); } - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { gc.onJoin( tmp ); } @@ -199,9 +199,9 @@ public class Grid implements IGrid // track node. nodes.add( gridNode ); - for( IGridCache cache : this.caches.values() ) + for( final IGridCache cache : this.caches.values() ) { - IGridHost machine = gridNode.getMachine(); + final IGridHost machine = gridNode.getMachine(); cache.addNode( gridNode, machine ); } @@ -211,19 +211,19 @@ public class Grid implements IGrid @Override @SuppressWarnings( "unchecked" ) - public C getCache( Class iface ) + public C getCache( final Class iface ) { return (C) this.caches.get( iface ).myCache; } @Override - public MENetworkEvent postEvent( MENetworkEvent ev ) + public MENetworkEvent postEvent( final MENetworkEvent ev ) { return this.eventBus.postEvent( this, ev ); } @Override - public MENetworkEvent postEventTo( IGridNode node, MENetworkEvent ev ) + public MENetworkEvent postEventTo( final IGridNode node, final MENetworkEvent ev ) { return this.eventBus.postEventTo( this, (GridNode) node, ev ); } @@ -231,15 +231,15 @@ public class Grid implements IGrid @Override public IReadOnlyCollection> getMachinesClasses() { - Set> machineKeys = this.machines.keySet(); + final Set> machineKeys = this.machines.keySet(); return new ReadOnlyCollection>( machineKeys ); } @Override - public IMachineSet getMachines( Class c ) + public IMachineSet getMachines( final Class c ) { - MachineSet s = this.machines.get( c ); + final MachineSet s = this.machines.get( c ); if( s == null ) { return new MachineSet( c ); @@ -265,14 +265,14 @@ public class Grid implements IGrid return this.pivot; } - public void setPivot( GridNode pivot ) + public void setPivot( final GridNode pivot ) { this.pivot = pivot; } public void update() { - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { // are there any nodes left? if( this.pivot != null ) @@ -284,15 +284,15 @@ public class Grid implements IGrid public void saveState() { - for( IGridCache c : this.caches.values() ) + for( final IGridCache c : this.caches.values() ) { c.populateGridStorage( this.myStorage ); } } - public void setImportantFlag( int i, boolean publicHasPower ) + public void setImportantFlag( final int i, final boolean publicHasPower ) { - int flag = 1 << i; + final int flag = 1 << i; this.priority = ( this.priority & ~flag ) | ( publicHasPower ? flag : 0 ); } } diff --git a/src/main/java/appeng/me/GridConnection.java b/src/main/java/appeng/me/GridConnection.java index d5f72090..d21e11af 100644 --- a/src/main/java/appeng/me/GridConnection.java +++ b/src/main/java/appeng/me/GridConnection.java @@ -50,11 +50,11 @@ public class GridConnection implements IGridConnection, IPathItem private ForgeDirection fromAtoB; private GridNode sideB; - public GridConnection( IGridNode aNode, IGridNode bNode, ForgeDirection fromAtoB ) throws FailedConnection + public GridConnection( final IGridNode aNode, final IGridNode bNode, final ForgeDirection fromAtoB ) throws FailedConnection { - GridNode a = (GridNode) aNode; - GridNode b = (GridNode) bNode; + final GridNode a = (GridNode) aNode; + final GridNode b = (GridNode) bNode; if( Platform.securityCheck( a, b ) ) { @@ -94,41 +94,41 @@ public class GridConnection implements IGridConnection, IPathItem { if( a.getMyGrid() == null ) { - GridPropagator gp = new GridPropagator( b.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( b.getInternalGrid() ); a.beginVisit( gp ); } else if( b.getMyGrid() == null ) { - GridPropagator gp = new GridPropagator( a.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); } else if( this.isNetworkABetter( a, b ) ) { - GridPropagator gp = new GridPropagator( a.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); } else { - GridPropagator gp = new GridPropagator( b.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( b.getInternalGrid() ); a.beginVisit( gp ); } } // a connection was destroyed RE-PATH!! - IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); + final IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); this.sideA.addConnection( this ); this.sideB.addConnection( this ); } - private boolean isNetworkABetter( GridNode a, GridNode b ) + private boolean isNetworkABetter( final GridNode a, final GridNode b ) { return a.getMyGrid().getPriority() > b.getMyGrid().getPriority() || a.getMyGrid().size() > b.getMyGrid().size(); } @Override - public IGridNode getOtherSide( IGridNode gridNode ) + public IGridNode getOtherSide( final IGridNode gridNode ) { if( gridNode == this.sideA ) { @@ -143,7 +143,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public ForgeDirection getDirection( IGridNode side ) + public ForgeDirection getDirection( final IGridNode side ) { if( this.fromAtoB == ForgeDirection.UNKNOWN ) { @@ -164,7 +164,7 @@ public class GridConnection implements IGridConnection, IPathItem public void destroy() { // a connection was destroyed RE-PATH!! - IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); + final IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); this.sideA.removeConnection( this ); @@ -209,7 +209,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public void setControllerRoute( IPathItem fast, boolean zeroOut ) + public void setControllerRoute( final IPathItem fast, final boolean zeroOut ) { if( zeroOut ) { @@ -218,7 +218,7 @@ public class GridConnection implements IGridConnection, IPathItem if( this.sideB == fast ) { - GridNode tmp = this.sideA; + final GridNode tmp = this.sideA; this.sideA = this.sideB; this.sideB = tmp; this.fromAtoB = this.fromAtoB.getOpposite(); @@ -238,7 +238,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public void incrementChannelCount( int usedChannels ) + public void incrementChannelCount( final int usedChannels ) { this.channelData += usedChannels; } diff --git a/src/main/java/appeng/me/GridException.java b/src/main/java/appeng/me/GridException.java index ad236ee7..5a3f418b 100644 --- a/src/main/java/appeng/me/GridException.java +++ b/src/main/java/appeng/me/GridException.java @@ -24,7 +24,7 @@ public class GridException extends RuntimeException private static final long serialVersionUID = -8110077032108243076L; - public GridException( String s ) + public GridException( final String s ) { super( s ); diff --git a/src/main/java/appeng/me/GridNode.java b/src/main/java/appeng/me/GridNode.java index aba4d8bf..ef2962e9 100644 --- a/src/main/java/appeng/me/GridNode.java +++ b/src/main/java/appeng/me/GridNode.java @@ -74,7 +74,7 @@ public class GridNode implements IGridNode, IPathItem private int usedChannels = 0; private int lastUsedChannels = 0; - public GridNode( IGridBlock what ) + public GridNode( final IGridBlock what ) { this.gridProxy = what; } @@ -99,7 +99,7 @@ public class GridNode implements IGridNode, IPathItem return this.getMachine().getClass(); } - public void addConnection( IGridConnection gridConnection ) + public void addConnection( final IGridConnection gridConnection ) { this.connections.add( gridConnection ); if( gridConnection.hasDirection() ) @@ -112,7 +112,7 @@ public class GridNode implements IGridNode, IPathItem Collections.sort( this.connections, new ConnectionComparator( gn ) ); } - public void removeConnection( IGridConnection gridConnection ) + public void removeConnection( final IGridConnection gridConnection ) { this.connections.remove( gridConnection ); if( gridConnection.hasDirection() ) @@ -121,9 +121,9 @@ public class GridNode implements IGridNode, IPathItem } } - public boolean hasConnection( IGridNode otherSide ) + public boolean hasConnection( final IGridNode otherSide ) { - for( IGridConnection gc : this.connections ) + for( final IGridConnection gc : this.connections ) { if( gc.a() == otherSide || gc.b() == otherSide ) { @@ -135,11 +135,11 @@ public class GridNode implements IGridNode, IPathItem public void validateGrid() { - GridSplitDetector gsd = new GridSplitDetector( this.getInternalGrid().getPivot() ); + final GridSplitDetector gsd = new GridSplitDetector( this.getInternalGrid().getPivot() ); this.beginVisit( gsd ); if( !gsd.pivotFound ) { - IGridVisitor gp = new GridPropagator( new Grid( this ) ); + final IGridVisitor gp = new GridPropagator( new Grid( this ) ); this.beginVisit( gp ); } } @@ -155,9 +155,9 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void beginVisit( IGridVisitor g ) + public void beginVisit( final IGridVisitor g ) { - Object tracker = new Object(); + final Object tracker = new Object(); LinkedList nextRun = new LinkedList(); nextRun.add( this ); @@ -166,8 +166,8 @@ public class GridNode implements IGridNode, IPathItem if( g instanceof IGridConnectionVisitor ) { - LinkedList nextConn = new LinkedList(); - IGridConnectionVisitor gcv = (IGridConnectionVisitor) g; + final LinkedList nextConn = new LinkedList(); + final IGridConnectionVisitor gcv = (IGridConnectionVisitor) g; while( !nextRun.isEmpty() ) { @@ -176,10 +176,10 @@ public class GridNode implements IGridNode, IPathItem gcv.visitConnection( nextConn.poll() ); } - Iterable thisRun = nextRun; + final Iterable thisRun = nextRun; nextRun = new LinkedList(); - for( GridNode n : thisRun ) + for( final GridNode n : thisRun ) { n.visitorConnection( tracker, g, nextRun, nextConn ); } @@ -189,10 +189,10 @@ public class GridNode implements IGridNode, IPathItem { while( !nextRun.isEmpty() ) { - Iterable thisRun = nextRun; + final Iterable thisRun = nextRun; nextRun = new LinkedList(); - for( GridNode n : thisRun ) + for( final GridNode n : thisRun ) { n.visitorNode( tracker, g, nextRun ); } @@ -203,13 +203,13 @@ public class GridNode implements IGridNode, IPathItem @Override public void updateState() { - EnumSet set = this.gridProxy.getFlags(); + final EnumSet set = this.gridProxy.getFlags(); this.compressedData = set.contains( GridFlags.CANNOT_CARRY ) ? 0 : ( set.contains( GridFlags.DENSE_CAPACITY ) ? 2 : 1 ); this.compressedData |= ( this.gridProxy.getGridColor().ordinal() << 3 ); - for( ForgeDirection dir : this.gridProxy.getConnectableSides() ) + for( final ForgeDirection dir : this.gridProxy.getConnectableSides() ) { this.compressedData |= ( 1 << ( dir.ordinal() + 8 ) ); } @@ -230,7 +230,7 @@ public class GridNode implements IGridNode, IPathItem return this.myGrid; } - public void setGrid( Grid grid ) + public void setGrid( final Grid grid ) { if( this.myGrid == grid ) { @@ -245,7 +245,7 @@ public class GridNode implements IGridNode, IPathItem { this.myGrid.saveState(); - for( IGridCache c : grid.getCaches().values() ) + for( final IGridCache c : grid.getCaches().values() ) { c.onJoin( this.myGrid.getMyStorage() ); } @@ -267,8 +267,8 @@ public class GridNode implements IGridNode, IPathItem this.setGridStorage( null ); } - IGridConnection c = this.connections.listIterator().next(); - GridNode otherSide = (GridNode) c.getOtherSide( this ); + final IGridConnection c = this.connections.listIterator().next(); + final GridNode otherSide = (GridNode) c.getOtherSide( this ); otherSide.getInternalGrid().setPivot( otherSide ); c.destroy(); } @@ -288,8 +288,8 @@ public class GridNode implements IGridNode, IPathItem @Override public EnumSet getConnectedSides() { - EnumSet set = EnumSet.noneOf( ForgeDirection.class ); - for( IGridConnection gc : this.connections ) + final EnumSet set = EnumSet.noneOf( ForgeDirection.class ); + for( final IGridConnection gc : this.connections ) { set.add( gc.getDirection( this ) ); } @@ -311,22 +311,22 @@ public class GridNode implements IGridNode, IPathItem @Override public boolean isActive() { - IGrid g = this.getGrid(); + final IGrid g = this.getGrid(); if( g != null ) { - IPathingGrid pg = g.getCache( IPathingGrid.class ); - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IPathingGrid pg = g.getCache( IPathingGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); return this.meetsChannelRequirements() && eg.isNetworkPowered() && !pg.isNetworkBooting(); } return false; } @Override - public void loadFromNBT( String name, NBTTagCompound nodeData ) + public void loadFromNBT( final String name, final NBTTagCompound nodeData ) { if( this.myGrid == null ) { - NBTTagCompound node = nodeData.getCompoundTag( name ); + final NBTTagCompound node = nodeData.getCompoundTag( name ); this.playerID = node.getInteger( "p" ); this.lastSecurityKey = node.getLong( "k" ); @@ -341,11 +341,11 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void saveToNBT( String name, NBTTagCompound nodeData ) + public void saveToNBT( final String name, final NBTTagCompound nodeData ) { if( this.myStorage != null ) { - NBTTagCompound node = new NBTTagCompound(); + final NBTTagCompound node = new NBTTagCompound(); node.setInteger( "p", this.playerID ); node.setLong( "k", this.lastSecurityKey ); @@ -366,7 +366,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public boolean hasFlag( GridFlags flag ) + public boolean hasFlag( final GridFlags flag ) { return this.gridProxy.getFlags().contains( flag ); } @@ -378,7 +378,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void setPlayerID( int playerID ) + public void setPlayerID( final int playerID ) { if( playerID >= 0 ) { @@ -398,25 +398,25 @@ public class GridNode implements IGridNode, IPathItem return; } - EnumSet newSecurityConnections = EnumSet.noneOf( ForgeDirection.class ); + final EnumSet newSecurityConnections = EnumSet.noneOf( ForgeDirection.class ); - DimensionalCoord dc = this.gridProxy.getLocation(); - for( ForgeDirection f : ForgeDirection.VALID_DIRECTIONS ) + final DimensionalCoord dc = this.gridProxy.getLocation(); + for( final ForgeDirection f : ForgeDirection.VALID_DIRECTIONS ) { - IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ ); + final IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ ); if( te != null ) { - GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); + final GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); if( node == null ) { continue; } - boolean isValidConnection = this.canConnect( node, f ) && node.canConnect( this, f.getOpposite() ); + final boolean isValidConnection = this.canConnect( node, f ) && node.canConnect( this, f.getOpposite() ); IGridConnection con = null; // find the connection for this // direction.. - for( IGridConnection c : this.getConnections() ) + for( final IGridConnection c : this.getConnections() ) { if( c.getDirection( this ) == f ) { @@ -427,7 +427,7 @@ public class GridNode implements IGridNode, IPathItem if( con != null ) { - IGridNode os = con.getOtherSide( this ); + final IGridNode os = con.getOtherSide( this ); if( os == node ) { // if this connection is no longer valid, destroy it. @@ -455,7 +455,7 @@ public class GridNode implements IGridNode, IPathItem { new GridConnection( node, this, f.getOpposite() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { TickHandler.INSTANCE.addCallable( node.getWorld(), new MachineSecurityBreak( this ) ); @@ -466,12 +466,12 @@ public class GridNode implements IGridNode, IPathItem } } - for( ForgeDirection f : newSecurityConnections ) + for( final ForgeDirection f : newSecurityConnections ) { - IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ ); + final IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ ); if( te != null ) { - GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); + final GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); if( node == null ) { continue; @@ -482,7 +482,7 @@ public class GridNode implements IGridNode, IPathItem { new GridConnection( node, this, f.getOpposite() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { TickHandler.INSTANCE.addCallable( node.getWorld(), new MachineSecurityBreak( this ) ); @@ -492,11 +492,11 @@ public class GridNode implements IGridNode, IPathItem } } - private IGridHost findGridHost( World world, int x, int y, int z ) + private IGridHost findGridHost( final World world, final int x, final int y, final int z ) { if( world.blockExists( x, y, z ) ) { - TileEntity te = world.getTileEntity( x, y, z ); + final TileEntity te = world.getTileEntity( x, y, z ); if( te instanceof IGridHost ) { return (IGridHost) te; @@ -505,7 +505,7 @@ public class GridNode implements IGridNode, IPathItem return null; } - public boolean canConnect( GridNode from, ForgeDirection dir ) + public boolean canConnect( final GridNode from, final ForgeDirection dir ) { if( !this.isValidDirection( dir ) ) { @@ -520,7 +520,7 @@ public class GridNode implements IGridNode, IPathItem return true; } - private boolean isValidDirection( ForgeDirection dir ) + private boolean isValidDirection( final ForgeDirection dir ) { return ( this.compressedData & ( 1 << ( 8 + dir.ordinal() ) ) ) > 0; } @@ -530,14 +530,14 @@ public class GridNode implements IGridNode, IPathItem return AEColor.values()[( this.compressedData >> 3 ) & 0x1F]; } - private void visitorConnection( Object tracker, IGridVisitor g, Deque nextRun, Deque nextConnections ) + private void visitorConnection( final Object tracker, final IGridVisitor g, final Deque nextRun, final Deque nextConnections ) { if( g.visitNode( this ) ) { - for( IGridConnection gc : this.getConnections() ) + for( final IGridConnection gc : this.getConnections() ) { - GridNode gn = (GridNode) gc.getOtherSide( this ); - GridConnection gcc = (GridConnection) gc; + final GridNode gn = (GridNode) gc.getOtherSide( this ); + final GridConnection gcc = (GridConnection) gc; if( gcc.visitorIterationNumber != tracker ) { @@ -557,13 +557,13 @@ public class GridNode implements IGridNode, IPathItem } } - private void visitorNode( Object tracker, IGridVisitor g, Deque nextRun ) + private void visitorNode( final Object tracker, final IGridVisitor g, final Deque nextRun ) { if( g.visitNode( this ) ) { - for( IGridConnection gc : this.getConnections() ) + for( final IGridConnection gc : this.getConnections() ) { - GridNode gn = (GridNode) gc.getOtherSide( this ); + final GridNode gn = (GridNode) gc.getOtherSide( this ); if( tracker == gn.visitorIterationNumber ) { @@ -582,7 +582,7 @@ public class GridNode implements IGridNode, IPathItem return this.myStorage; } - public void setGridStorage( GridStorage s ) + public void setGridStorage( final GridStorage s ) { this.myStorage = s; this.usedChannels = 0; @@ -601,14 +601,14 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void setControllerRoute( IPathItem fast, boolean zeroOut ) + public void setControllerRoute( final IPathItem fast, final boolean zeroOut ) { if( zeroOut ) { this.usedChannels = 0; } - int idx = this.connections.indexOf( fast ); + final int idx = this.connections.indexOf( fast ); if( idx > 0 ) { this.connections.remove( fast ); @@ -634,7 +634,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void incrementChannelCount( int usedChannels ) + public void incrementChannelCount( final int usedChannels ) { this.usedChannels += usedChannels; } @@ -673,13 +673,13 @@ public class GridNode implements IGridNode, IPathItem { private final GridNode node; - public MachineSecurityBreak( GridNode node ) + public MachineSecurityBreak( final GridNode node ) { this.node = node; } @Override - public Void call(World world) throws Exception + public Void call( final World world) throws Exception { this.node.getMachine().securityBreak(); @@ -691,16 +691,16 @@ public class GridNode implements IGridNode, IPathItem { private final IGridNode gn; - public ConnectionComparator( IGridNode gn ) + public ConnectionComparator( final IGridNode gn ) { this.gn = gn; } @Override - public int compare( IGridConnection o1, IGridConnection o2 ) + public int compare( final IGridConnection o1, final IGridConnection o2 ) { - boolean preferredA = o1.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); - boolean preferredB = o2.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); + final boolean preferredA = o1.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); + final boolean preferredB = o2.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); return preferredA == preferredB ? 0 : ( preferredA ? -1 : 1 ); } diff --git a/src/main/java/appeng/me/GridNodeCollection.java b/src/main/java/appeng/me/GridNodeCollection.java index 4895b4e3..e0a8515b 100644 --- a/src/main/java/appeng/me/GridNodeCollection.java +++ b/src/main/java/appeng/me/GridNodeCollection.java @@ -32,7 +32,7 @@ public class GridNodeCollection implements IReadOnlyCollection { private final Map, MachineSet> machines; - public GridNodeCollection( Map, MachineSet> machines ) + public GridNodeCollection( final Map, MachineSet> machines ) { this.machines = machines; } @@ -48,7 +48,7 @@ public class GridNodeCollection implements IReadOnlyCollection { int size = 0; - for( Set o : this.machines.values() ) + for( final Set o : this.machines.values() ) { size += o.size(); } @@ -59,7 +59,7 @@ public class GridNodeCollection implements IReadOnlyCollection @Override public boolean isEmpty() { - for( Set o : this.machines.values() ) + for( final Set o : this.machines.values() ) { if( !o.isEmpty() ) { @@ -71,17 +71,17 @@ public class GridNodeCollection implements IReadOnlyCollection } @Override - public boolean contains( Object maybeGridNode ) + public boolean contains( final Object maybeGridNode ) { final boolean doesContainNode; if( maybeGridNode instanceof IGridNode ) { final IGridNode node = (IGridNode) maybeGridNode; - IGridHost machine = node.getMachine(); - Class machineClass = machine.getClass(); + final IGridHost machine = node.getMachine(); + final Class machineClass = machine.getClass(); - MachineSet machineSet = this.machines.get( machineClass ); + final MachineSet machineSet = this.machines.get( machineClass ); doesContainNode = machineSet != null && machineSet.contains( maybeGridNode ); } diff --git a/src/main/java/appeng/me/GridNodeIterator.java b/src/main/java/appeng/me/GridNodeIterator.java index d4dda95d..e441aeb0 100644 --- a/src/main/java/appeng/me/GridNodeIterator.java +++ b/src/main/java/appeng/me/GridNodeIterator.java @@ -37,7 +37,7 @@ public class GridNodeIterator implements Iterator private final Iterator outerIterator; private Iterator innerIterator; - public GridNodeIterator( Map, MachineSet> machines ) + public GridNodeIterator( final Map, MachineSet> machines ) { this.outerIterator = machines.values().iterator(); this.innerHasNext(); diff --git a/src/main/java/appeng/me/GridPropagator.java b/src/main/java/appeng/me/GridPropagator.java index 65d2e17a..4bc6c99f 100644 --- a/src/main/java/appeng/me/GridPropagator.java +++ b/src/main/java/appeng/me/GridPropagator.java @@ -27,15 +27,15 @@ public class GridPropagator implements IGridVisitor { private final Grid g; - public GridPropagator( Grid g ) + public GridPropagator( final Grid g ) { this.g = g; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; if( gn.getMyGrid() != this.g || this.g.getPivot() == n ) { gn.setGrid( this.g ); diff --git a/src/main/java/appeng/me/GridSplitDetector.java b/src/main/java/appeng/me/GridSplitDetector.java index 695f83fd..d406c005 100644 --- a/src/main/java/appeng/me/GridSplitDetector.java +++ b/src/main/java/appeng/me/GridSplitDetector.java @@ -29,13 +29,13 @@ class GridSplitDetector implements IGridVisitor final IGridNode pivot; boolean pivotFound; - public GridSplitDetector( IGridNode pivot ) + public GridSplitDetector( final IGridNode pivot ) { this.pivot = pivot; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { if( n == this.pivot ) { diff --git a/src/main/java/appeng/me/GridStorage.java b/src/main/java/appeng/me/GridStorage.java index a3edb7bc..29254c80 100644 --- a/src/main/java/appeng/me/GridStorage.java +++ b/src/main/java/appeng/me/GridStorage.java @@ -52,7 +52,7 @@ public class GridStorage implements IGridStorage * @param id ID of grid storage * @param gss grid storage search */ - public GridStorage( long id, GridStorageSearch gss ) + public GridStorage( final long id, final GridStorageSearch gss ) { this.myID = id; this.mySearchEntry = gss; @@ -66,7 +66,7 @@ public class GridStorage implements IGridStorage * @param id ID of grid storage * @param gss grid storage search */ - public GridStorage( String input, long id, GridStorageSearch gss ) + public GridStorage( final String input, final long id, final GridStorageSearch gss ) { this.myID = id; this.mySearchEntry = gss; @@ -74,10 +74,10 @@ public class GridStorage implements IGridStorage try { - byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); + final byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( byteData ) ); } - catch( Throwable t ) + catch( final Throwable t ) { myTag = new NBTTagCompound(); } @@ -99,7 +99,7 @@ public class GridStorage implements IGridStorage { this.isDirty = false; - Grid currentGrid = (Grid) this.getGrid(); + final Grid currentGrid = (Grid) this.getGrid(); if( currentGrid != null ) { currentGrid.saveState(); @@ -107,11 +107,11 @@ public class GridStorage implements IGridStorage try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); + final ByteArrayOutputStream out = new ByteArrayOutputStream(); CompressedStreamTools.writeCompressed( this.data, out ); return javax.xml.bind.DatatypeConverter.printBase64Binary( out.toByteArray() ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -124,7 +124,7 @@ public class GridStorage implements IGridStorage return this.internalGrid == null ? null : this.internalGrid.get(); } - public void setGrid( Grid grid ) + public void setGrid( final Grid grid ) { this.internalGrid = new WeakReference( grid ); } @@ -146,12 +146,12 @@ public class GridStorage implements IGridStorage this.isDirty = true; } - public void addDivided( GridStorage gs ) + public void addDivided( final GridStorage gs ) { this.divided.put( gs, true ); } - public boolean hasDivided( GridStorage myStorage ) + public boolean hasDivided( final GridStorage myStorage ) { return this.divided.containsKey( myStorage ); } diff --git a/src/main/java/appeng/me/GridStorageSearch.java b/src/main/java/appeng/me/GridStorageSearch.java index dc119b05..a95633e4 100644 --- a/src/main/java/appeng/me/GridStorageSearch.java +++ b/src/main/java/appeng/me/GridStorageSearch.java @@ -33,7 +33,7 @@ public class GridStorageSearch * * @param id ID of grid storage search */ - public GridStorageSearch( long id ) + public GridStorageSearch( final long id ) { this.id = id; } @@ -45,7 +45,7 @@ public class GridStorageSearch } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -56,7 +56,7 @@ public class GridStorageSearch return false; } - GridStorageSearch other = (GridStorageSearch) obj; + final GridStorageSearch other = (GridStorageSearch) obj; if( this.id == other.id ) { return true; diff --git a/src/main/java/appeng/me/MachineSet.java b/src/main/java/appeng/me/MachineSet.java index 8f2f56c6..f35209c5 100644 --- a/src/main/java/appeng/me/MachineSet.java +++ b/src/main/java/appeng/me/MachineSet.java @@ -33,7 +33,7 @@ public class MachineSet extends HashSet implements IMachineSet private final Class machine; - MachineSet( Class m ) + MachineSet( final Class m ) { this.machine = m; } diff --git a/src/main/java/appeng/me/NetworkEventBus.java b/src/main/java/appeng/me/NetworkEventBus.java index 4fc15cc5..7f13c7e3 100644 --- a/src/main/java/appeng/me/NetworkEventBus.java +++ b/src/main/java/appeng/me/NetworkEventBus.java @@ -39,7 +39,7 @@ public class NetworkEventBus private static final Collection READ_CLASSES = new HashSet(); private static final Map, Map> EVENTS = new HashMap, Map>(); - public void readClass( Class listAs, Class c ) + public void readClass( final Class listAs, final Class c ) { if( READ_CLASSES.contains( c ) ) { @@ -49,12 +49,12 @@ public class NetworkEventBus try { - for( Method m : c.getMethods() ) + for( final Method m : c.getMethods() ) { - MENetworkEventSubscribe s = m.getAnnotation( MENetworkEventSubscribe.class ); + final MENetworkEventSubscribe s = m.getAnnotation( MENetworkEventSubscribe.class ); if( s != null ) { - Class[] types = m.getParameterTypes(); + final Class[] types = m.getParameterTypes(); if( types.length == 1 ) { if( MENetworkEvent.class.isAssignableFrom( types[0] ) ) @@ -88,32 +88,32 @@ public class NetworkEventBus } } } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( "Error while adding " + c.getName() + " to event bus", t ); } } - public MENetworkEvent postEvent( Grid g, MENetworkEvent e ) + public MENetworkEvent postEvent( final Grid g, final MENetworkEvent e ) { - Map subscribers = EVENTS.get( e.getClass() ); + final Map subscribers = EVENTS.get( e.getClass() ); int x = 0; try { if( subscribers != null ) { - for( Entry subscriber : subscribers.entrySet() ) + for( final Entry subscriber : subscribers.entrySet() ) { - MENetworkEventInfo target = subscriber.getValue(); - GridCacheWrapper cache = g.getCaches().get( subscriber.getKey() ); + final MENetworkEventInfo target = subscriber.getValue(); + final GridCacheWrapper cache = g.getCaches().get( subscriber.getKey() ); if( cache != null ) { x++; target.invoke( cache.myCache, e ); } - for( IGridNode obj : g.getMachines( subscriber.getKey() ) ) + for( final IGridNode obj : g.getMachines( subscriber.getKey() ) ) { x++; target.invoke( obj.getMachine(), e ); @@ -121,7 +121,7 @@ public class NetworkEventBus } } } - catch( NetworkEventDone done ) + catch( final NetworkEventDone done ) { // Early out. } @@ -130,16 +130,16 @@ public class NetworkEventBus return e; } - public MENetworkEvent postEventTo( Grid grid, GridNode node, MENetworkEvent e ) + public MENetworkEvent postEventTo( final Grid grid, final GridNode node, final MENetworkEvent e ) { - Map subscribers = EVENTS.get( e.getClass() ); + final Map subscribers = EVENTS.get( e.getClass() ); int x = 0; try { if( subscribers != null ) { - MENetworkEventInfo target = subscribers.get( node.getMachineClass() ); + final MENetworkEventInfo target = subscribers.get( node.getMachineClass() ); if( target != null ) { x++; @@ -147,7 +147,7 @@ public class NetworkEventBus } } } - catch( NetworkEventDone done ) + catch( final NetworkEventDone done ) { // Early out. } @@ -169,20 +169,20 @@ public class NetworkEventBus public final Method objMethod; public final Class objEvent; - public EventMethod( Class Event, Class ObjClass, Method ObjMethod ) + public EventMethod( final Class Event, final Class ObjClass, final Method ObjMethod ) { this.objClass = ObjClass; this.objMethod = ObjMethod; this.objEvent = Event; } - public void invoke( Object obj, MENetworkEvent e ) throws NetworkEventDone + public void invoke( final Object obj, final MENetworkEvent e ) throws NetworkEventDone { try { this.objMethod.invoke( obj, e ); } - catch( Throwable e1 ) + catch( final Throwable e1 ) { AELog.severe( "[AppEng] Network Event caused exception:" ); AELog.severe( "Offending Class: " + obj.getClass().getName() ); @@ -203,14 +203,14 @@ public class NetworkEventBus private final List methods = new ArrayList(); - public void Add( Class Event, Class ObjClass, Method ObjMethod ) + public void Add( final Class Event, final Class ObjClass, final Method ObjMethod ) { this.methods.add( new EventMethod( Event, ObjClass, ObjMethod ) ); } - public void invoke( Object obj, MENetworkEvent e ) throws NetworkEventDone + public void invoke( final Object obj, final MENetworkEvent e ) throws NetworkEventDone { - for( EventMethod em : this.methods ) + for( final EventMethod em : this.methods ) { em.invoke( obj, e ); } diff --git a/src/main/java/appeng/me/NetworkList.java b/src/main/java/appeng/me/NetworkList.java index 95a01255..166bf240 100644 --- a/src/main/java/appeng/me/NetworkList.java +++ b/src/main/java/appeng/me/NetworkList.java @@ -43,7 +43,7 @@ public class NetworkList implements Collection } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.networks.contains( o ); } @@ -61,47 +61,47 @@ public class NetworkList implements Collection } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.networks.toArray( a ); } @Override - public boolean add( Grid e ) + public boolean add( final Grid e ) { this.copy(); return this.networks.add( e ); } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { this.copy(); return this.networks.remove( o ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.networks.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { this.copy(); return this.networks.addAll( c ); } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { this.copy(); return this.networks.removeAll( c ); } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { this.copy(); return this.networks.retainAll( c ); @@ -115,7 +115,7 @@ public class NetworkList implements Collection private void copy() { - List old = this.networks; + final List old = this.networks; this.networks = new LinkedList(); this.networks.addAll( old ); } diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index c8154865..c1a9163e 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -93,7 +93,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper static final Comparator COMPARATOR = new Comparator() { @Override - public int compare( ICraftingPatternDetails firstDetail, ICraftingPatternDetails nextDetail ) + public int compare( final ICraftingPatternDetails firstDetail, final ICraftingPatternDetails nextDetail ) { return nextDetail.getPriority() - firstDetail.getPriority(); } @@ -101,11 +101,11 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper static { - ThreadFactory factory = new ThreadFactory() + final ThreadFactory factory = new ThreadFactory() { @Override - public Thread newThread( Runnable ar ) + public Thread newThread( final Runnable ar ) { return new Thread( ar, "AE Crafting Calculator" ); } @@ -128,13 +128,13 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper private IEnergyGrid energyGrid; private boolean updateList = false; - public CraftingGridCache( IGrid grid ) + public CraftingGridCache( final IGrid grid ) { this.grid = grid; } @MENetworkEventSubscribe - public void afterCacheConstruction( MENetworkPostCacheConstruction cacheConstruction ) + public void afterCacheConstruction( final MENetworkPostCacheConstruction cacheConstruction ) { this.storageGrid = this.grid.getCache( IStorageGrid.class ); this.energyGrid = this.grid.getCache( IEnergyGrid.class ); @@ -151,7 +151,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper this.updateCPUClusters(); } - Iterator craftingLinkIterator = this.craftingLinks.values().iterator(); + final Iterator craftingLinkIterator = this.craftingLinks.values().iterator(); while( craftingLinkIterator.hasNext() ) { if( craftingLinkIterator.next().isDead( this.grid, this ) ) @@ -160,18 +160,18 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } } - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { cpu.updateCraftingLogic( this.grid, this.energyGrid, this ); } } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ICraftingWatcherHost ) { - ICraftingWatcher craftingWatcher = this.craftingWatchers.get( machine ); + final ICraftingWatcher craftingWatcher = this.craftingWatchers.get( machine ); if( craftingWatcher != null ) { craftingWatcher.clear(); @@ -181,7 +181,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if( machine instanceof ICraftingRequester ) { - for( CraftingLinkNexus link : this.craftingLinks.values() ) + for( final CraftingLinkNexus link : this.craftingLinks.values() ) { if( link.isMachine( machine ) ) { @@ -203,19 +203,19 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ICraftingWatcherHost ) { - ICraftingWatcherHost watcherHost = (ICraftingWatcherHost) machine; - CraftingWatcher watcher = new CraftingWatcher( this, watcherHost ); + final ICraftingWatcherHost watcherHost = (ICraftingWatcherHost) machine; + final CraftingWatcher watcher = new CraftingWatcher( this, watcherHost ); this.craftingWatchers.put( gridNode, watcher ); watcherHost.updateWatcher( watcher ); } if( machine instanceof ICraftingRequester ) { - for( ICraftingLink link : ( (ICraftingRequester) machine ).getRequestedJobs() ) + for( final ICraftingLink link : ( (ICraftingRequester) machine ).getRequestedJobs() ) { if( link instanceof CraftingLink ) { @@ -237,25 +237,25 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void onSplit( IGridStorage destinationStorage ) + public void onSplit( final IGridStorage destinationStorage ) { // nothing! } @Override - public void onJoin( IGridStorage sourceStorage ) + public void onJoin( final IGridStorage sourceStorage ) { // nothing! } @Override - public void populateGridStorage( IGridStorage destinationStorage ) + public void populateGridStorage( final IGridStorage destinationStorage ) { // nothing! } private void updatePatterns() { - Map> oldItems = this.craftableItems; + final Map> oldItems = this.craftableItems; // erase list. this.craftingMethods.clear(); @@ -266,15 +266,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper this.storageGrid.postAlterationOfStoredItems( StorageChannel.ITEMS, oldItems.keySet(), new BaseActionSource() ); // re-create list.. - for( ICraftingProvider provider : this.craftingProviders ) + for( final ICraftingProvider provider : this.craftingProviders ) { provider.provideCrafting( this ); } - Map> tmpCraft = new HashMap>(); + final Map> tmpCraft = new HashMap>(); // new craftables! - for( ICraftingPatternDetails details : this.craftingMethods.keySet() ) + for( final ICraftingPatternDetails details : this.craftingMethods.keySet() ) { for( IAEItemStack out : details.getOutputs() ) { @@ -294,7 +294,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } // make them immutable - for( Entry> e : tmpCraft.entrySet() ) + for( final Entry> e : tmpCraft.entrySet() ) { this.craftableItems.put( e.getKey(), ImmutableList.copyOf( e.getValue() ) ); } @@ -306,10 +306,10 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper { this.craftingCPUClusters.clear(); - for( IGridNode cst : this.grid.getMachines( TileCraftingStorageTile.class ) ) + for( final IGridNode cst : this.grid.getMachines( TileCraftingStorageTile.class ) ) { - TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); - CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); + final TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); + final CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); if( cluster != null ) { this.craftingCPUClusters.add( cluster ); @@ -322,7 +322,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } } - public void addLink( CraftingLink link ) + public void addLink( final CraftingLink link ) { if( link.isStandalone() ) { @@ -339,19 +339,19 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @MENetworkEventSubscribe - public void updateCPUClusters( MENetworkCraftingCpuChange c ) + public void updateCPUClusters( final MENetworkCraftingCpuChange c ) { this.updateList = true; } @MENetworkEventSubscribe - public void updateCPUClusters( MENetworkCraftingPatternChange c ) + public void updateCPUClusters( final MENetworkCraftingPatternChange c ) { this.updatePatterns(); } @Override - public void addCraftingOption( ICraftingMedium medium, ICraftingPatternDetails api ) + public void addCraftingOption( final ICraftingMedium medium, final ICraftingPatternDetails api ) { List details = this.craftingMethods.get( api ); if( details == null ) @@ -367,15 +367,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void setEmitable( IAEItemStack someItem ) + public void setEmitable( final IAEItemStack someItem ) { this.emitableItems.add( someItem.copy() ); } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { - List list = new ArrayList( 1 ); + final List list = new ArrayList( 1 ); if( channel == StorageChannel.ITEMS ) { @@ -398,15 +398,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean isPrioritized( IAEStack input ) + public boolean isPrioritized( final IAEStack input ) { return true; } @Override - public boolean canAccept( IAEStack input ) + public boolean canAccept( final IAEStack input ) { - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { if( cpu.canAccept( input ) ) { @@ -424,15 +424,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 1; } @Override - public IAEStack injectItems( IAEStack input, Actionable type, BaseActionSource src ) + public IAEStack injectItems( IAEStack input, final Actionable type, final BaseActionSource src ) { - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { input = cpu.injectItems( input, type, src ); } @@ -441,21 +441,21 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public IAEStack extractItems( IAEStack request, Actionable mode, BaseActionSource src ) + public IAEStack extractItems( final IAEStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { // add craftable items! - for( IAEItemStack stack : this.craftableItems.keySet() ) + for( final IAEItemStack stack : this.craftableItems.keySet() ) { out.addCrafting( stack ); } - for( IAEItemStack st : this.emitableItems ) + for( final IAEItemStack st : this.emitableItems ) { out.addCrafting( st ); } @@ -470,15 +470,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public ImmutableCollection getCraftingFor( IAEItemStack whatToCraft, ICraftingPatternDetails details, int slotIndex, World world ) + public ImmutableCollection getCraftingFor( final IAEItemStack whatToCraft, final ICraftingPatternDetails details, final int slotIndex, final World world ) { - ImmutableList res = this.craftableItems.get( whatToCraft ); + final ImmutableList res = this.craftableItems.get( whatToCraft ); if( res == null ) { if( details != null && details.isCraftable() ) { - for( IAEItemStack ais : this.craftableItems.keySet() ) + for( final IAEItemStack ais : this.craftableItems.keySet() ) { if( ais.getItem() == whatToCraft.getItem() && ( !ais.getItem().getHasSubtypes() || ais.getItemDamage() == whatToCraft.getItemDamage() ) ) { @@ -497,20 +497,20 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public Future beginCraftingJob( World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack slotItem, ICraftingCallback cb ) + public Future beginCraftingJob( final World world, final IGrid grid, final BaseActionSource actionSrc, final IAEItemStack slotItem, final ICraftingCallback cb ) { if( world == null || grid == null || actionSrc == null || slotItem == null ) { throw new IllegalArgumentException( "Invalid Crafting Job Request" ); } - CraftingJob job = new CraftingJob( world, grid, actionSrc, slotItem, cb ); + final CraftingJob job = new CraftingJob( world, grid, actionSrc, slotItem, cb ); return CRAFTING_POOL.submit( job, (ICraftingJob) job ); } @Override - public ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, final boolean prioritizePower, BaseActionSource src ) + public ICraftingLink submitJob( final ICraftingJob job, final ICraftingRequester requestingMachine, final ICraftingCPU target, final boolean prioritizePower, final BaseActionSource src ) { if( job.isSimulation() ) { @@ -526,8 +526,8 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if( target == null ) { - List validCpusClusters = new ArrayList(); - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + final List validCpusClusters = new ArrayList(); + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { if( cpu.isActive() && !cpu.isBusy() && cpu.getAvailableStorage() >= job.getByteTotal() ) { @@ -538,11 +538,11 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper Collections.sort( validCpusClusters, new Comparator() { @Override - public int compare( CraftingCPUCluster firstCluster, CraftingCPUCluster nextCluster ) + public int compare( final CraftingCPUCluster firstCluster, final CraftingCPUCluster nextCluster ) { if( prioritizePower ) { - int comparison = ItemSorters.compareLong( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() ); + final int comparison = ItemSorters.compareLong( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() ); if( comparison != 0 ) { return comparison; @@ -550,7 +550,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return ItemSorters.compareLong( nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage() ); } - int comparison = ItemSorters.compareLong( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() ); + final int comparison = ItemSorters.compareLong( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() ); if( comparison != 0 ) { return comparison; @@ -580,15 +580,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean canEmitFor( IAEItemStack someItem ) + public boolean canEmitFor( final IAEItemStack someItem ) { return this.emitableItems.contains( someItem ); } @Override - public boolean isRequesting( IAEItemStack what ) + public boolean isRequesting( final IAEItemStack what ) { - for( CraftingCPUCluster cluster : this.craftingCPUClusters ) + for( final CraftingCPUCluster cluster : this.craftingCPUClusters ) { if( cluster.isMaking( what ) ) { @@ -599,7 +599,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return false; } - public List getMediums( ICraftingPatternDetails key ) + public List getMediums( final ICraftingPatternDetails key ) { List mediums = this.craftingMethods.get( key ); @@ -611,7 +611,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return mediums; } - public boolean hasCpu( ICraftingCPU cpu ) + public boolean hasCpu( final ICraftingCPU cpu ) { return this.craftingCPUClusters.contains( cpu ); } @@ -622,7 +622,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper private final Iterator iterator; private CraftingCPUCluster cpuCluster; - public ActiveCpuIterator( Collection o ) + public ActiveCpuIterator( final Collection o ) { this.iterator = o.iterator(); this.cpuCluster = null; diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index 8bd4149f..cfc058f4 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -95,33 +95,33 @@ public class EnergyGridCache implements IEnergyGrid PathGridCache pgc; double lastStoredPower = -1; - public EnergyGridCache( IGrid g ) + public EnergyGridCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void postInit( MENetworkPostCacheConstruction pcc ) + public void postInit( final MENetworkPostCacheConstruction pcc ) { this.pgc = this.myGrid.getCache( IPathingGrid.class ); } @MENetworkEventSubscribe - public void EnergyNodeChanges( MENetworkPowerIdleChange ev ) + public void EnergyNodeChanges( final MENetworkPowerIdleChange ev ) { // update power usage based on event. - GridNode node = (GridNode) ev.node; - IGridBlock gb = node.getGridBlock(); + final GridNode node = (GridNode) ev.node; + final IGridBlock gb = node.getGridBlock(); - double newDraw = gb.getIdlePowerUsage(); - double diffDraw = newDraw - node.previousDraw; + final double newDraw = gb.getIdlePowerUsage(); + final double diffDraw = newDraw - node.previousDraw; node.previousDraw = newDraw; this.drainPerTick += diffDraw; } @MENetworkEventSubscribe - public void EnergyNodeChanges( MENetworkPowerStorage ev ) + public void EnergyNodeChanges( final MENetworkPowerStorage ev ) { if( ev.storage.isAEPublicPowerStorage() ) { @@ -152,12 +152,12 @@ public class EnergyGridCache implements IEnergyGrid { if( !this.interests.isEmpty() ) { - double oldPower = this.lastStoredPower; + final double oldPower = this.lastStoredPower; this.lastStoredPower = this.getStoredPower(); - EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, this.lastStoredPower ), null ); - EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, this.lastStoredPower ), null ); - for( EnergyThreshold th : this.interests.subSet( low, true, high, true ) ) + final EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, this.lastStoredPower ), null ); + final EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, this.lastStoredPower ), null ); + for( final EnergyThreshold th : this.interests.subSet( low, true, high, true ) ) { ( (EnergyWatcher) th.watcher ).post( this ); } @@ -177,7 +177,7 @@ public class EnergyGridCache implements IEnergyGrid if( this.drainPerTick > 0.0001 ) { - double drained = this.extractAEPower( this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); + final double drained = this.extractAEPower( this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); currentlyHasPower = drained >= this.drainPerTick - 0.001; } else @@ -212,7 +212,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { this.localSeen.clear(); return pm.divide( this.extractAEPower( pm.multiply( amt ), mode, this.localSeen ) ); @@ -224,7 +224,7 @@ public class EnergyGridCache implements IEnergyGrid return this.drainPerTick + this.pgc.channelPowerUsage; } - private void publicPowerState( boolean newState, IGrid grid ) + private void publicPowerState( final boolean newState, final IGrid grid ) { if( this.publicHasPower == newState ) { @@ -243,14 +243,14 @@ public class EnergyGridCache implements IEnergyGrid { this.availableTicksSinceUpdate = 0; this.globalAvailablePower = 0; - for( IAEPowerStorage p : this.providers ) + for( final IAEPowerStorage p : this.providers ) { this.globalAvailablePower += p.getAECurrentPower(); } } @Override - public double extractAEPower( double amt, Actionable mode, Set seen ) + public double extractAEPower( final double amt, final Actionable mode, final Set seen ) { if( !seen.add( this ) ) { @@ -265,7 +265,7 @@ public class EnergyGridCache implements IEnergyGrid if( extractedPower < amt ) { - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( extractedPower < amt && i.hasNext() ) { extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); @@ -292,7 +292,7 @@ public class EnergyGridCache implements IEnergyGrid if( extractedPower < amt ) { - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( extractedPower < amt && i.hasNext() ) { extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); @@ -306,26 +306,26 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double injectAEPower( double amt, Actionable mode, Set seen ) + public double injectAEPower( double amt, final Actionable mode, final Set seen ) { if( !seen.add( this ) ) { return 0; } - double ignore = this.extra; + final double ignore = this.extra; amt += this.extra; if( mode == Actionable.SIMULATE ) { - Iterator it = this.requesters.iterator(); + final Iterator it = this.requesters.iterator(); while( amt > 0 && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); amt = node.injectAEPower( amt, Actionable.SIMULATE ); } - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( amt > 0 && i.hasNext() ) { amt = i.next().injectAEPower( amt, mode, seen ); @@ -338,7 +338,7 @@ public class EnergyGridCache implements IEnergyGrid while( amt > 0 && !this.requesters.isEmpty() ) { - IAEPowerStorage node = this.getFirstRequester(); + final IAEPowerStorage node = this.getFirstRequester(); amt = node.injectAEPower( amt, Actionable.MODULATE ); if( amt > 0 ) @@ -348,14 +348,14 @@ public class EnergyGridCache implements IEnergyGrid } } - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( amt > 0 && i.hasNext() ) { - IEnergyGridProvider what = i.next(); - Set listCopy = new HashSet(); + final IEnergyGridProvider what = i.next(); + final Set listCopy = new HashSet(); listCopy.addAll( seen ); - double cannotHold = what.injectAEPower( amt, Actionable.SIMULATE, listCopy ); + final double cannotHold = what.injectAEPower( amt, Actionable.SIMULATE, listCopy ); what.injectAEPower( amt - cannotHold, mode, seen ); amt = cannotHold; @@ -368,7 +368,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double getEnergyDemand( double maxRequired, Set seen ) + public double getEnergyDemand( final double maxRequired, final Set seen ) { if( !seen.add( this ) ) { @@ -377,50 +377,50 @@ public class EnergyGridCache implements IEnergyGrid double required = this.buffer() - this.extra; - Iterator it = this.requesters.iterator(); + final Iterator it = this.requesters.iterator(); while( required < maxRequired && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); if( node.getPowerFlow() != AccessRestriction.READ ) { required += Math.max( 0.0, node.getAEMaxPower() - node.getAECurrentPower() ); } } - Iterator ix = this.energyGridProviders.iterator(); + final Iterator ix = this.energyGridProviders.iterator(); while( required < maxRequired && ix.hasNext() ) { - IEnergyGridProvider node = ix.next(); + final IEnergyGridProvider node = ix.next(); required += node.getEnergyDemand( maxRequired - required, seen ); } return required; } - private double simulateExtract( double extractedPower, double amt ) + private double simulateExtract( double extractedPower, final double amt ) { - Iterator it = this.providers.iterator(); + final Iterator it = this.providers.iterator(); while( extractedPower < amt && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); - double req = amt - extractedPower; - double newPower = node.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.ONE ); + final double req = amt - extractedPower; + final double newPower = node.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.ONE ); extractedPower += newPower; } return extractedPower; } - private double doExtract( double extractedPower, double amt ) + private double doExtract( double extractedPower, final double amt ) { while( extractedPower < amt && !this.providers.isEmpty() ) { - IAEPowerStorage node = this.getFirstProvider(); + final IAEPowerStorage node = this.getFirstProvider(); - double req = amt - extractedPower; - double newPower = node.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.ONE ); + final double req = amt - extractedPower; + final double newPower = node.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.ONE ); extractedPower += newPower; if( newPower < req ) @@ -438,7 +438,7 @@ public class EnergyGridCache implements IEnergyGrid { if( this.lastProvider == null ) { - Iterator i = this.providers.iterator(); + final Iterator i = this.providers.iterator(); this.lastProvider = i.hasNext() ? i.next() : null; } @@ -464,7 +464,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double injectPower( double amt, Actionable mode ) + public double injectPower( final double amt, final Actionable mode ) { this.localSeen.clear(); return this.injectAEPower( amt, mode, this.localSeen ); @@ -474,7 +474,7 @@ public class EnergyGridCache implements IEnergyGrid { if( this.lastRequester == null ) { - Iterator i = this.requesters.iterator(); + final Iterator i = this.requesters.iterator(); this.lastRequester = i.hasNext() ? i.next() : null; } @@ -504,14 +504,14 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double getEnergyDemand( double maxRequired ) + public double getEnergyDemand( final double maxRequired ) { this.localSeen.clear(); return this.getEnergyDemand( maxRequired, this.localSeen ); } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof IEnergyGridProvider ) { @@ -519,13 +519,13 @@ public class EnergyGridCache implements IEnergyGrid } // idle draw. - GridNode gridNode = (GridNode) node; + final GridNode gridNode = (GridNode) node; this.drainPerTick -= gridNode.previousDraw; // power storage. if( machine instanceof IAEPowerStorage ) { - IAEPowerStorage ps = (IAEPowerStorage) machine; + final IAEPowerStorage ps = (IAEPowerStorage) machine; if( ps.isAEPublicPowerStorage() ) { if( ps.getPowerFlow() != AccessRestriction.WRITE ) @@ -551,7 +551,7 @@ public class EnergyGridCache implements IEnergyGrid if( machine instanceof IStackWatcherHost ) { - IEnergyWatcher myWatcher = this.watchers.get( machine ); + final IEnergyWatcher myWatcher = this.watchers.get( machine ); if( myWatcher != null ) { myWatcher.clear(); @@ -561,7 +561,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof IEnergyGridProvider ) { @@ -569,19 +569,19 @@ public class EnergyGridCache implements IEnergyGrid } // idle draw... - GridNode gridNode = (GridNode) node; - IGridBlock gb = gridNode.getGridBlock(); + final GridNode gridNode = (GridNode) node; + final IGridBlock gb = gridNode.getGridBlock(); gridNode.previousDraw = gb.getIdlePowerUsage(); this.drainPerTick += gridNode.previousDraw; // power storage if( machine instanceof IAEPowerStorage ) { - IAEPowerStorage ps = (IAEPowerStorage) machine; + final IAEPowerStorage ps = (IAEPowerStorage) machine; if( ps.isAEPublicPowerStorage() ) { - double max = ps.getAEMaxPower(); - double current = ps.getAECurrentPower(); + final double max = ps.getAEMaxPower(); + final double current = ps.getAECurrentPower(); if( ps.getPowerFlow() != AccessRestriction.WRITE ) { @@ -603,8 +603,8 @@ public class EnergyGridCache implements IEnergyGrid if( machine instanceof IEnergyWatcherHost ) { - IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; - EnergyWatcher iw = new EnergyWatcher( this, swh ); + final IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; + final EnergyWatcher iw = new EnergyWatcher( this, swh ); this.watchers.put( node, iw ); swh.updateWatcher( iw ); } @@ -613,20 +613,20 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { this.extra /= 2; storageB.dataObject().setDouble( "extraEnergy", this.extra ); } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { this.extra += storageB.dataObject().getDouble( "extraEnergy" ); } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { storage.dataObject().setDouble( "extraEnergy", this.extra ); } diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 60a69854..666ad9c5 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -69,7 +69,7 @@ public class GridStorageCache implements IStorageGrid private NetworkInventoryHandler myItemNetwork; private NetworkInventoryHandler myFluidNetwork; - public GridStorageCache( IGrid g ) + public GridStorageCache( final IGrid g ) { this.myGrid = g; } @@ -82,11 +82,11 @@ public class GridStorageCache implements IStorageGrid } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof ICellContainer ) { - ICellContainer cc = (ICellContainer) machine; + final ICellContainer cc = (ICellContainer) machine; this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); this.removeCellProvider( cc, new CellChangeTracker() ).applyChanges(); @@ -95,7 +95,7 @@ public class GridStorageCache implements IStorageGrid if( machine instanceof IStackWatcherHost ) { - IStackWatcher myWatcher = this.watchers.get( machine ); + final IStackWatcher myWatcher = this.watchers.get( machine ); if( myWatcher != null ) { myWatcher.clear(); @@ -105,11 +105,11 @@ public class GridStorageCache implements IStorageGrid } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof ICellContainer ) { - ICellContainer cc = (ICellContainer) machine; + final ICellContainer cc = (ICellContainer) machine; this.inactiveCellProviders.add( cc ); this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); @@ -121,32 +121,32 @@ public class GridStorageCache implements IStorageGrid if( machine instanceof IStackWatcherHost ) { - IStackWatcherHost swh = (IStackWatcherHost) machine; - ItemWatcher iw = new ItemWatcher( this, swh ); + final IStackWatcherHost swh = (IStackWatcherHost) machine; + final ItemWatcher iw = new ItemWatcher( this, swh ); this.watchers.put( node, iw ); swh.updateWatcher( iw ); } } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } - public CellChangeTracker addCellProvider( ICellProvider cc, CellChangeTracker tracker ) + public CellChangeTracker addCellProvider( final ICellProvider cc, final CellChangeTracker tracker ) { if( this.inactiveCellProviders.contains( cc ) ) { @@ -159,12 +159,12 @@ public class GridStorageCache implements IStorageGrid actionSrc = new MachineSource( (IActionHost) cc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) { tracker.postChanges( StorageChannel.ITEMS, 1, h, actionSrc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) { tracker.postChanges( StorageChannel.FLUIDS, 1, h, actionSrc ); } @@ -173,7 +173,7 @@ public class GridStorageCache implements IStorageGrid return tracker; } - public CellChangeTracker removeCellProvider( ICellProvider cc, CellChangeTracker tracker ) + public CellChangeTracker removeCellProvider( final ICellProvider cc, final CellChangeTracker tracker ) { if( this.activeCellProviders.contains( cc ) ) { @@ -186,12 +186,12 @@ public class GridStorageCache implements IStorageGrid actionSrc = new MachineSource( (IActionHost) cc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) { tracker.postChanges( StorageChannel.ITEMS, -1, h, actionSrc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) { tracker.postChanges( StorageChannel.FLUIDS, -1, h, actionSrc ); } @@ -201,24 +201,24 @@ public class GridStorageCache implements IStorageGrid } @MENetworkEventSubscribe - public void cellUpdate( MENetworkCellArrayUpdate ev ) + public void cellUpdate( final MENetworkCellArrayUpdate ev ) { this.myItemNetwork = null; this.myFluidNetwork = null; - LinkedList ll = new LinkedList(); + final LinkedList ll = new LinkedList(); ll.addAll( this.inactiveCellProviders ); ll.addAll( this.activeCellProviders ); - CellChangeTracker tracker = new CellChangeTracker(); + final CellChangeTracker tracker = new CellChangeTracker(); - for( ICellProvider cc : ll ) + for( final ICellProvider cc : ll ) { boolean Active = true; if( cc instanceof IActionHost ) { - IGridNode node = ( (IActionHost) cc ).getActionableNode(); + final IGridNode node = ( (IActionHost) cc ).getActionableNode(); if( node != null && node.isActive() ) { Active = true; @@ -245,7 +245,7 @@ public class GridStorageCache implements IStorageGrid tracker.applyChanges(); } - private void postChangesToNetwork( StorageChannel chan, int upOrDown, IItemList availableItems, BaseActionSource src ) + private void postChangesToNetwork( final StorageChannel chan, final int upOrDown, final IItemList availableItems, final BaseActionSource src ) { switch( chan ) { @@ -268,17 +268,17 @@ public class GridStorageCache implements IStorageGrid return this.myItemNetwork; } - private void buildNetworkStorage( StorageChannel chan ) + private void buildNetworkStorage( final StorageChannel chan ) { - SecurityCache security = this.myGrid.getCache( ISecurityGrid.class ); + final SecurityCache security = this.myGrid.getCache( ISecurityGrid.class ); switch( chan ) { case FLUIDS: this.myFluidNetwork = new NetworkInventoryHandler( StorageChannel.FLUIDS, security ); - for( ICellProvider cc : this.activeCellProviders ) + for( final ICellProvider cc : this.activeCellProviders ) { - for( IMEInventoryHandler h : cc.getCellArray( chan ) ) + for( final IMEInventoryHandler h : cc.getCellArray( chan ) ) { this.myFluidNetwork.addNewStorage( h ); } @@ -286,9 +286,9 @@ public class GridStorageCache implements IStorageGrid break; case ITEMS: this.myItemNetwork = new NetworkInventoryHandler( StorageChannel.ITEMS, security ); - for( ICellProvider cc : this.activeCellProviders ) + for( final ICellProvider cc : this.activeCellProviders ) { - for( IMEInventoryHandler h : cc.getCellArray( chan ) ) + for( final IMEInventoryHandler h : cc.getCellArray( chan ) ) { this.myItemNetwork.addNewStorage( h ); } @@ -308,7 +308,7 @@ public class GridStorageCache implements IStorageGrid } @Override - public void postAlterationOfStoredItems( StorageChannel chan, Iterable input, BaseActionSource src ) + public void postAlterationOfStoredItems( final StorageChannel chan, final Iterable input, final BaseActionSource src ) { if( chan == StorageChannel.ITEMS ) { @@ -321,14 +321,14 @@ public class GridStorageCache implements IStorageGrid } @Override - public void registerCellProvider( ICellProvider provider ) + public void registerCellProvider( final ICellProvider provider ) { this.inactiveCellProviders.add( provider ); this.addCellProvider( provider, new CellChangeTracker() ).applyChanges(); } @Override - public void unregisterCellProvider( ICellProvider provider ) + public void unregisterCellProvider( final ICellProvider provider ) { this.removeCellProvider( provider, new CellChangeTracker() ).applyChanges(); this.inactiveCellProviders.remove( provider ); @@ -354,7 +354,7 @@ public class GridStorageCache implements IStorageGrid final IItemList list; final BaseActionSource src; - public CellChangeTrackerRecord( StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc ) + public CellChangeTrackerRecord( final StorageChannel channel, final int i, final IMEInventoryHandler h, final BaseActionSource actionSrc ) { this.channel = channel; this.up_or_down = i; @@ -385,14 +385,14 @@ public class GridStorageCache implements IStorageGrid final List data = new LinkedList(); - public void postChanges( StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc ) + public void postChanges( final StorageChannel channel, final int i, final IMEInventoryHandler h, final BaseActionSource actionSrc ) { this.data.add( new CellChangeTrackerRecord( channel, i, h, actionSrc ) ); } public void applyChanges() { - for( CellChangeTrackerRecord rec : this.data ) + for( final CellChangeTrackerRecord rec : this.data ) { rec.applyChanges(); } diff --git a/src/main/java/appeng/me/cache/NetworkMonitor.java b/src/main/java/appeng/me/cache/NetworkMonitor.java index 9b704ec1..8b0c1cd4 100644 --- a/src/main/java/appeng/me/cache/NetworkMonitor.java +++ b/src/main/java/appeng/me/cache/NetworkMonitor.java @@ -44,7 +44,7 @@ public class NetworkMonitor> extends MEMonitorHandler private final StorageChannel myChannel; boolean sendEvent = false; - public NetworkMonitor( GridStorageCache cache, StorageChannel chan ) + public NetworkMonitor( final GridStorageCache cache, final StorageChannel chan ) { super( null, chan ); this.myGridCache = cache; @@ -55,11 +55,11 @@ public class NetworkMonitor> extends MEMonitorHandler { this.hasChanged = true; - Iterator, Object>> i = this.getListeners(); + final Iterator, Object>> i = this.getListeners(); while( i.hasNext() ) { - Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver receiver = o.getKey(); + final Entry, Object> o = i.next(); + final IMEMonitorHandlerReceiver receiver = o.getKey(); if( receiver.isValid( o.getValue() ) ) { @@ -96,12 +96,12 @@ public class NetworkMonitor> extends MEMonitorHandler } @Override - protected void postChangesToListeners( Iterable changes, BaseActionSource src ) + protected void postChangesToListeners( final Iterable changes, final BaseActionSource src ) { this.postChange( true, changes, src ); } - protected void postChange( boolean add, Iterable changes, BaseActionSource src ) + protected void postChange( final boolean add, final Iterable changes, final BaseActionSource src ) { if( DEPTH.contains( this ) ) { @@ -113,9 +113,9 @@ public class NetworkMonitor> extends MEMonitorHandler this.sendEvent = true; this.notifyListenersOfChange( changes, src ); - IItemList myStorageList = this.getStorageList(); + final IItemList myStorageList = this.getStorageList(); - for( T changedItem : changes ) + for( final T changedItem : changes ) { T difference = changedItem; @@ -126,7 +126,7 @@ public class NetworkMonitor> extends MEMonitorHandler if( this.myGridCache.interestManager.containsKey( changedItem ) ) { - Collection list = this.myGridCache.interestManager.get( changedItem ); + final Collection list = this.myGridCache.interestManager.get( changedItem ); if( !list.isEmpty() ) { IAEStack fullStack = myStorageList.findPrecise( changedItem ); @@ -138,7 +138,7 @@ public class NetworkMonitor> extends MEMonitorHandler this.myGridCache.interestManager.enableTransactions(); - for( ItemWatcher iw : list ) + for( final ItemWatcher iw : list ) { iw.getHost().onStackChange( myStorageList, fullStack, difference, src, this.getChannel() ); } diff --git a/src/main/java/appeng/me/cache/P2PCache.java b/src/main/java/appeng/me/cache/P2PCache.java index 6cab8faf..caae09a5 100644 --- a/src/main/java/appeng/me/cache/P2PCache.java +++ b/src/main/java/appeng/me/cache/P2PCache.java @@ -47,16 +47,16 @@ public class P2PCache implements IGridCache private final Multimap outputs = LinkedHashMultimap.create(); private final TunnelCollection NullColl = new TunnelCollection( null, null ); - public P2PCache( IGrid g ) + public P2PCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void bootComplete( MENetworkBootingStatusChange bootStatus ) + public void bootComplete( final MENetworkBootingStatusChange bootStatus ) { - ITickManager tm = this.myGrid.getCache( ITickManager.class ); - for( PartP2PTunnel me : this.inputs.values() ) + final ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for( final PartP2PTunnel me : this.inputs.values() ) { if( me instanceof PartP2PTunnelME ) { @@ -66,10 +66,10 @@ public class P2PCache implements IGridCache } @MENetworkEventSubscribe - public void bootComplete( MENetworkPowerStatusChange power ) + public void bootComplete( final MENetworkPowerStatusChange power ) { - ITickManager tm = this.myGrid.getCache( ITickManager.class ); - for( PartP2PTunnel me : this.inputs.values() ) + final ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for( final PartP2PTunnel me : this.inputs.values() ) { if( me instanceof PartP2PTunnelME ) { @@ -85,7 +85,7 @@ public class P2PCache implements IGridCache } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof PartP2PTunnel ) { @@ -97,7 +97,7 @@ public class P2PCache implements IGridCache } } - PartP2PTunnel t = (PartP2PTunnel) machine; + final PartP2PTunnel t = (PartP2PTunnel) machine; // AELog.info( "rmv-" + (t.output ? "output: " : "input: ") + t.freq // ); @@ -115,7 +115,7 @@ public class P2PCache implements IGridCache } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof PartP2PTunnel ) { @@ -127,7 +127,7 @@ public class P2PCache implements IGridCache } } - PartP2PTunnel t = (PartP2PTunnel) machine; + final PartP2PTunnel t = (PartP2PTunnel) machine; // AELog.info( "add-" + (t.output ? "output: " : "input: ") + t.freq // ); @@ -145,26 +145,26 @@ public class P2PCache implements IGridCache } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } - private void updateTunnel( long freq, boolean updateOutputs, boolean configChange ) + private void updateTunnel( final long freq, final boolean updateOutputs, final boolean configChange ) { - for( PartP2PTunnel p : this.outputs.get( freq ) ) + for( final PartP2PTunnel p : this.outputs.get( freq ) ) { if( configChange ) { @@ -173,7 +173,7 @@ public class P2PCache implements IGridCache p.onTunnelNetworkChange(); } - PartP2PTunnel in = this.inputs.get( freq ); + final PartP2PTunnel in = this.inputs.get( freq ); if( in != null ) { if( configChange ) @@ -184,7 +184,7 @@ public class P2PCache implements IGridCache } } - public void updateFreq( PartP2PTunnel t, long newFrequency ) + public void updateFreq( final PartP2PTunnel t, final long newFrequency ) { if( this.outputs.containsValue( t ) ) { @@ -213,15 +213,15 @@ public class P2PCache implements IGridCache this.updateTunnel( t.freq, !t.output, true ); } - public TunnelCollection getOutputs( long freq, Class c ) + public TunnelCollection getOutputs( final long freq, final Class c ) { - PartP2PTunnel in = this.inputs.get( freq ); + final PartP2PTunnel in = this.inputs.get( freq ); if( in == null ) { return this.NullColl; } - TunnelCollection out = this.inputs.get( freq ).getCollection( this.outputs.get( freq ), c ); + final TunnelCollection out = this.inputs.get( freq ).getCollection( this.outputs.get( freq ), c ); if( out == null ) { return this.NullColl; @@ -230,7 +230,7 @@ public class P2PCache implements IGridCache return out; } - public PartP2PTunnel getInput( long freq ) + public PartP2PTunnel getInput( final long freq ) { return this.inputs.get( freq ); } diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index 1151d681..b589d4d2 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -77,7 +77,7 @@ public class PathGridCache implements IPathingGrid int lastChannels = 0; private HashSet semiOpen = new HashSet(); - public PathGridCache( IGrid g ) + public PathGridCache( final IGrid g ) { this.myGrid = g; } @@ -104,9 +104,9 @@ public class PathGridCache implements IPathingGrid if( !AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - int used = this.calculateRequiredChannels(); + final int used = this.calculateRequiredChannels(); - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); this.channelsByBlocks = nodes * used; this.channelPowerUsage = this.channelsByBlocks / 128.0; @@ -115,14 +115,14 @@ public class PathGridCache implements IPathingGrid } else if( this.controllerState == ControllerState.NO_CONTROLLER ) { - int requiredChannels = this.calculateRequiredChannels(); + final int requiredChannels = this.calculateRequiredChannels(); int used = requiredChannels; if( requiredChannels > 8 ) { used = 0; } - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.channelsInUse = used; this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); @@ -138,22 +138,22 @@ public class PathGridCache implements IPathingGrid } else { - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); - HashSet closedList = new HashSet(); + final HashSet closedList = new HashSet(); this.semiOpen = new HashSet(); // myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) // ); - for( IGridNode node : this.myGrid.getMachines( TileController.class ) ) + for( final IGridNode node : this.myGrid.getMachines( TileController.class ) ) { closedList.add( (IPathItem) node ); - for( IGridConnection gcc : node.getConnections() ) + for( final IGridConnection gcc : node.getConnections() ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; if( !( gc.getOtherSide( node ).getMachine() instanceof TileController ) ) { - List open = new LinkedList(); + final List open = new LinkedList(); closedList.add( gc ); open.add( gc ); gc.setControllerRoute( (GridNode) node, true ); @@ -166,10 +166,10 @@ public class PathGridCache implements IPathingGrid if( !this.active.isEmpty() || this.ticksUntilReady > 0 ) { - Iterator i = this.active.iterator(); + final Iterator i = this.active.iterator(); while( i.hasNext() ) { - PathSegment pat = i.next(); + final PathSegment pat = i.next(); if( pat.step() ) { pat.isDead = true; @@ -202,7 +202,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof TileController ) { @@ -210,7 +210,7 @@ public class PathGridCache implements IPathingGrid this.recalculateControllerNextTick = true; } - EnumSet flags = gridNode.getGridBlock().getFlags(); + final EnumSet flags = gridNode.getGridBlock().getFlags(); if( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { @@ -226,7 +226,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof TileController ) { @@ -234,7 +234,7 @@ public class PathGridCache implements IPathingGrid this.recalculateControllerNextTick = true; } - EnumSet flags = gridNode.getGridBlock().getFlags(); + final EnumSet flags = gridNode.getGridBlock().getFlags(); if( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { @@ -250,19 +250,19 @@ public class PathGridCache implements IPathingGrid } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } @@ -270,7 +270,7 @@ public class PathGridCache implements IPathingGrid private void recalcController() { this.recalculateControllerNextTick = false; - ControllerState old = this.controllerState; + final ControllerState old = this.controllerState; if( this.controllers.isEmpty() ) { @@ -278,15 +278,15 @@ public class PathGridCache implements IPathingGrid } else { - IGridNode startingNode = this.controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN ); + final IGridNode startingNode = this.controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN ); if( startingNode == null ) { this.controllerState = ControllerState.CONTROLLER_CONFLICT; return; } - DimensionalCoord dc = startingNode.getGridBlock().getLocation(); - ControllerValidator cv = new ControllerValidator( dc.x, dc.y, dc.z ); + final DimensionalCoord dc = startingNode.getGridBlock().getLocation(); + final ControllerValidator cv = new ControllerValidator( dc.x, dc.y, dc.z ); startingNode.beginVisit( cv ); @@ -311,12 +311,12 @@ public class PathGridCache implements IPathingGrid this.semiOpen.clear(); int depth = 0; - for( IGridNode nodes : this.requireChannels ) + for( final IGridNode nodes : this.requireChannels ) { if( !this.semiOpen.contains( nodes ) ) { - IGridBlock gb = nodes.getGridBlock(); - EnumSet flags = gb.getFlags(); + final IGridBlock gb = nodes.getGridBlock(); + final EnumSet flags = gb.getFlags(); if( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !this.blockDense.isEmpty() ) { @@ -327,8 +327,8 @@ public class PathGridCache implements IPathingGrid if( flags.contains( GridFlags.MULTIBLOCK ) ) { - IGridMultiblock gmb = (IGridMultiblock) gb; - Iterator i = gmb.getMultiblockNodes(); + final IGridMultiblock gmb = (IGridMultiblock) gb; + final Iterator i = gmb.getMultiblockNodes(); while( i.hasNext() ) { this.semiOpen.add( (IPathItem) i.next() ); @@ -344,17 +344,17 @@ public class PathGridCache implements IPathingGrid { if( this.lastChannels != this.channelsInUse && AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - Achievements currentBracket = this.getAchievementBracket( this.channelsInUse ); - Achievements lastBracket = this.getAchievementBracket( this.lastChannels ); + final Achievements currentBracket = this.getAchievementBracket( this.channelsInUse ); + final Achievements lastBracket = this.getAchievementBracket( this.lastChannels ); if( currentBracket != lastBracket && currentBracket != null ) { - Set players = new HashSet(); - for( IGridNode n : this.requireChannels ) + final Set players = new HashSet(); + for( final IGridNode n : this.requireChannels ) { players.add( n.getPlayerID() ); } - for( int id : players ) + for( final int id : players ) { Platform.addStat( id, currentBracket.getAchievement() ); } @@ -363,7 +363,7 @@ public class PathGridCache implements IPathingGrid this.lastChannels = this.channelsInUse; } - private Achievements getAchievementBracket( int ch ) + private Achievements getAchievementBracket( final int ch ) { if( ch < 8 ) { @@ -384,9 +384,9 @@ public class PathGridCache implements IPathingGrid } @MENetworkEventSubscribe - void updateNodReq( MENetworkChannelChanged ev ) + void updateNodReq( final MENetworkChannelChanged ev ) { - IGridNode gridNode = ev.node; + final IGridNode gridNode = ev.node; if( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) ) { diff --git a/src/main/java/appeng/me/cache/SecurityCache.java b/src/main/java/appeng/me/cache/SecurityCache.java index 7ee8cb0b..3bc0b1df 100644 --- a/src/main/java/appeng/me/cache/SecurityCache.java +++ b/src/main/java/appeng/me/cache/SecurityCache.java @@ -50,13 +50,13 @@ public class SecurityCache implements ISecurityGrid private final HashMap> playerPerms = new HashMap>(); private long securityKey = -1; - public SecurityCache( IGrid g ) + public SecurityCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void updatePermissions( MENetworkSecurityChange ev ) + public void updatePermissions( final MENetworkSecurityChange ev ) { this.playerPerms.clear(); if( this.securityProvider.isEmpty() ) @@ -79,7 +79,7 @@ public class SecurityCache implements ISecurityGrid } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ISecurityProvider ) { @@ -90,7 +90,7 @@ public class SecurityCache implements ISecurityGrid private void updateSecurityKey() { - long lastCode = this.securityKey; + final long lastCode = this.securityKey; if( this.securityProvider.size() == 1 ) { @@ -104,7 +104,7 @@ public class SecurityCache implements ISecurityGrid if( lastCode != this.securityKey ) { this.myGrid.postEvent( new MENetworkSecurityChange() ); - for( IGridNode n : this.myGrid.getNodes() ) + for( final IGridNode n : this.myGrid.getNodes() ) { ( (GridNode) n ).lastSecurityKey = this.securityKey; } @@ -112,7 +112,7 @@ public class SecurityCache implements ISecurityGrid } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ISecurityProvider ) { @@ -126,19 +126,19 @@ public class SecurityCache implements ISecurityGrid } @Override - public void onSplit( IGridStorage destinationStorage ) + public void onSplit( final IGridStorage destinationStorage ) { } @Override - public void onJoin( IGridStorage sourceStorage ) + public void onJoin( final IGridStorage sourceStorage ) { } @Override - public void populateGridStorage( IGridStorage destinationStorage ) + public void populateGridStorage( final IGridStorage destinationStorage ) { } @@ -150,7 +150,7 @@ public class SecurityCache implements ISecurityGrid } @Override - public boolean hasPermission( EntityPlayer player, SecurityPermissions perm ) + public boolean hasPermission( final EntityPlayer player, final SecurityPermissions perm ) { Preconditions.checkNotNull( player ); Preconditions.checkNotNull( perm ); @@ -162,11 +162,11 @@ public class SecurityCache implements ISecurityGrid } @Override - public boolean hasPermission( int playerID, SecurityPermissions perm ) + public boolean hasPermission( final int playerID, final SecurityPermissions perm ) { if( this.isAvailable() ) { - EnumSet perms = this.playerPerms.get( playerID ); + final EnumSet perms = this.playerPerms.get( playerID ); if( perms == null ) { diff --git a/src/main/java/appeng/me/cache/SpatialPylonCache.java b/src/main/java/appeng/me/cache/SpatialPylonCache.java index 3f61905e..564eb8eb 100644 --- a/src/main/java/appeng/me/cache/SpatialPylonCache.java +++ b/src/main/java/appeng/me/cache/SpatialPylonCache.java @@ -51,34 +51,34 @@ public class SpatialPylonCache implements ISpatialCache HashMap clusters = new HashMap(); boolean needsUpdate = false; - public SpatialPylonCache( IGrid g ) + public SpatialPylonCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void bootingRender( MENetworkBootingStatusChange c ) + public void bootingRender( final MENetworkBootingStatusChange c ) { this.reset( this.myGrid ); } - public void reset( IGrid grid ) + public void reset( final IGrid grid ) { this.clusters = new HashMap(); this.ioPorts = new LinkedList(); - for( IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) ) + for( final IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) ) { this.ioPorts.add( (TileSpatialIOPort) gm.getMachine() ); } - IReadOnlyCollection set = grid.getMachines( TileSpatialPylon.class ); - for( IGridNode gm : set ) + final IReadOnlyCollection set = grid.getMachines( TileSpatialPylon.class ); + for( final IGridNode gm : set ) { if( gm.meetsChannelRequirements() ) { - SpatialPylonCluster c = ( (TileSpatialPylon) gm.getMachine() ).getCluster(); + final SpatialPylonCluster c = ( (TileSpatialPylon) gm.getMachine() ).getCluster(); if( c != null ) { this.clusters.put( c, c ); @@ -91,7 +91,7 @@ public class SpatialPylonCache implements ISpatialCache this.isValid = true; int pylonBlocks = 0; - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { if( this.captureMax == null ) { @@ -119,7 +119,7 @@ public class SpatialPylonCache implements ISpatialCache { this.isValid = this.captureMax.x - this.captureMin.x > 1 && this.captureMax.y - this.captureMin.y > 1 && this.captureMax.z - this.captureMin.z > 1; - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { switch( cl.currentAxis ) { @@ -144,10 +144,10 @@ public class SpatialPylonCache implements ISpatialCache } } - int reqX = this.captureMax.x - this.captureMin.x; - int reqY = this.captureMax.y - this.captureMin.y; - int reqZ = this.captureMax.z - this.captureMin.z; - int requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 ); + final int reqX = this.captureMax.x - this.captureMin.x; + final int reqY = this.captureMax.y - this.captureMin.y; + final int reqZ = this.captureMax.z - this.captureMin.z; + final int requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 ); this.efficiency = (double) pylonBlocks / (double) requirePylonBlocks; @@ -164,12 +164,12 @@ public class SpatialPylonCache implements ISpatialCache maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerExponent ); } - double affective_efficiency = Math.pow( this.efficiency, 0.25 ); + final double affective_efficiency = Math.pow( this.efficiency, 0.25 ); this.powerRequired = (long) ( affective_efficiency * minPower + ( 1.0 - affective_efficiency ) * maxPower ); - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { - boolean myWasValid = cl.isValid; + final boolean myWasValid = cl.isValid; cl.isValid = this.isValid; if( myWasValid != this.isValid ) { @@ -220,31 +220,31 @@ public class SpatialPylonCache implements ISpatialCache } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } diff --git a/src/main/java/appeng/me/cache/TickManagerCache.java b/src/main/java/appeng/me/cache/TickManagerCache.java index 2f7c7e7b..ab291c83 100644 --- a/src/main/java/appeng/me/cache/TickManagerCache.java +++ b/src/main/java/appeng/me/cache/TickManagerCache.java @@ -47,7 +47,7 @@ public class TickManagerCache implements ITickManager final PriorityQueue upcomingTicks = new PriorityQueue(); private long currentTick = 0; - public TickManagerCache( IGrid g ) + public TickManagerCache( final IGrid g ) { this.myGrid = g; } @@ -57,7 +57,7 @@ public class TickManagerCache implements ITickManager return this.currentTick; } - public long getAvgNanoTime( IGridNode node ) + public long getAvgNanoTime( final IGridNode node ) { TickTracker tt = this.awake.get( node ); @@ -84,12 +84,12 @@ public class TickManagerCache implements ITickManager while( !this.upcomingTicks.isEmpty() ) { tt = this.upcomingTicks.peek(); - int diff = (int) ( this.currentTick - tt.lastTick ); + final int diff = (int) ( this.currentTick - tt.lastTick ); if( diff >= tt.current_rate ) { // remove tt.. this.upcomingTicks.poll(); - TickRateModulation mod = tt.gt.tickingRequest( tt.node, diff ); + final TickRateModulation mod = tt.gt.tickingRequest( tt.node, diff ); switch( mod ) { @@ -125,23 +125,23 @@ public class TickManagerCache implements ITickManager } } } - catch( Throwable t ) + catch( final Throwable t ) { - CrashReport crashreport = CrashReport.makeCrashReport( t, "Ticking GridNode" ); - CrashReportCategory crashreportcategory = crashreport.makeCategory( tt.gt.getClass().getSimpleName() + " being ticked." ); + final CrashReport crashreport = CrashReport.makeCrashReport( t, "Ticking GridNode" ); + final CrashReportCategory crashreportcategory = crashreport.makeCategory( tt.gt.getClass().getSimpleName() + " being ticked." ); tt.addEntityCrashInfo( crashreportcategory ); throw new ReportedException( crashreport ); } } - private void addToQueue( TickTracker tt ) + private void addToQueue( final TickTracker tt ) { tt.lastTick = this.currentTick; this.upcomingTicks.add( tt ); } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof IGridTickable ) { @@ -152,14 +152,14 @@ public class TickManagerCache implements ITickManager } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof IGridTickable ) { - TickingRequest tr = ( (IGridTickable) machine ).getTickingRequest( gridNode ); + final TickingRequest tr = ( (IGridTickable) machine ).getTickingRequest( gridNode ); if( tr != null ) { - TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, this.currentTick, this ); + final TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, this.currentTick, this ); if( tr.canBeAlerted ) { @@ -180,27 +180,27 @@ public class TickManagerCache implements ITickManager } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } @Override - public boolean alertDevice( IGridNode node ) + public boolean alertDevice( final IGridNode node ) { - TickTracker tt = this.alertable.get( node ); + final TickTracker tt = this.alertable.get( node ); if( tt == null ) { return false; @@ -224,11 +224,11 @@ public class TickManagerCache implements ITickManager } @Override - public boolean sleepDevice( IGridNode node ) + public boolean sleepDevice( final IGridNode node ) { if( this.awake.containsKey( node ) ) { - TickTracker gt = this.awake.get( node ); + final TickTracker gt = this.awake.get( node ); this.awake.remove( node ); this.sleeping.put( node, gt ); @@ -239,11 +239,11 @@ public class TickManagerCache implements ITickManager } @Override - public boolean wakeDevice( IGridNode node ) + public boolean wakeDevice( final IGridNode node ) { if( this.sleeping.containsKey( node ) ) { - TickTracker gt = this.sleeping.get( node ); + final TickTracker gt = this.sleeping.get( node ); this.sleeping.remove( node ); this.awake.put( node, gt ); this.addToQueue( gt ); diff --git a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java index 760bf5d9..514f50fc 100644 --- a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java +++ b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java @@ -27,7 +27,7 @@ public class ConnectionWrapper public IGridConnection connection; - public ConnectionWrapper( IGridConnection gc ) + public ConnectionWrapper( final IGridConnection gc ) { this.connection = gc; } diff --git a/src/main/java/appeng/me/cache/helpers/Connections.java b/src/main/java/appeng/me/cache/helpers/Connections.java index f99db2b9..02f7846c 100644 --- a/src/main/java/appeng/me/cache/helpers/Connections.java +++ b/src/main/java/appeng/me/cache/helpers/Connections.java @@ -36,13 +36,13 @@ public class Connections implements IWorldCallable public boolean create = false; public boolean destroy = false; - public Connections( PartP2PTunnelME o ) + public Connections( final PartP2PTunnelME o ) { this.me = o; } @Override - public Void call( World world ) throws Exception + public Void call( final World world ) throws Exception { this.me.updateConnections( this ); diff --git a/src/main/java/appeng/me/cache/helpers/TickTracker.java b/src/main/java/appeng/me/cache/helpers/TickTracker.java index a66b4a28..d7b40a22 100644 --- a/src/main/java/appeng/me/cache/helpers/TickTracker.java +++ b/src/main/java/appeng/me/cache/helpers/TickTracker.java @@ -44,7 +44,7 @@ public class TickTracker implements Comparable public long lastTick; public int current_rate; - public TickTracker( TickingRequest req, IGridNode node, IGridTickable gt, long currentTick, TickManagerCache tickManagerCache ) + public TickTracker( final TickingRequest req, final IGridNode node, final IGridTickable gt, final long currentTick, final TickManagerCache tickManagerCache ) { this.request = req; this.gt = gt; @@ -59,7 +59,7 @@ public class TickTracker implements Comparable return( this.LastFiveTicksTime / 5 ); } - public void setRate( int rate ) + public void setRate( final int rate ) { this.current_rate = rate; @@ -75,18 +75,18 @@ public class TickTracker implements Comparable } @Override - public int compareTo( @Nonnull TickTracker t ) + public int compareTo( @Nonnull final TickTracker t ) { - int nextTick = (int) ( ( this.lastTick - this.host.getCurrentTick() ) + this.current_rate ); - int ts_nextTick = (int) ( ( t.lastTick - this.host.getCurrentTick() ) + t.current_rate ); + final int nextTick = (int) ( ( this.lastTick - this.host.getCurrentTick() ) + this.current_rate ); + final int ts_nextTick = (int) ( ( t.lastTick - this.host.getCurrentTick() ) + t.current_rate ); return nextTick - ts_nextTick; } - public void addEntityCrashInfo( CrashReportCategory crashreportcategory ) + public void addEntityCrashInfo( final CrashReportCategory crashreportcategory ) { if( this.gt instanceof AEBasePart ) { - AEBasePart part = (AEBasePart) this.gt; + final AEBasePart part = (AEBasePart) this.gt; part.addEntityCrashInfo( crashreportcategory ); } @@ -97,7 +97,7 @@ public class TickTracker implements Comparable crashreportcategory.addCrashSection( "GridBlockType", this.node.getGridBlock().getClass().getName() ); crashreportcategory.addCrashSection( "ConnectedSides", this.node.getConnectedSides() ); - DimensionalCoord dc = this.node.getGridBlock().getLocation(); + final DimensionalCoord dc = this.node.getGridBlock().getLocation(); 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 f6f2f850..88763bbb 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java @@ -32,13 +32,13 @@ public class TunnelCollection implements Iterable final Class clz; Collection tunnelSources; - public TunnelCollection( Collection src, Class c ) + public TunnelCollection( final Collection src, final Class c ) { this.tunnelSources = src; this.clz = c; } - public void setSource( Collection c ) + public void setSource( final Collection c ) { this.tunnelSources = c; } @@ -58,7 +58,7 @@ public class TunnelCollection implements Iterable return new TunnelIterator( this.tunnelSources, this.clz ); } - public boolean matches( Class c ) + public boolean matches( final Class c ) { return this.clz == c; } diff --git a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java index f1762baa..388ab370 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java @@ -29,7 +29,7 @@ public class TunnelConnection public final PartP2PTunnelME tunnel; public final IGridConnection c; - public TunnelConnection( PartP2PTunnelME t, IGridConnection con ) + public TunnelConnection( final PartP2PTunnelME t, final IGridConnection con ) { this.tunnel = t; this.c = con; diff --git a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java index 89436df1..bfe6a669 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java @@ -32,7 +32,7 @@ public class TunnelIterator implements Iterator final Class targetType; T Next; - public TunnelIterator( Collection tunnelSources, Class clz ) + public TunnelIterator( final Collection tunnelSources, final Class clz ) { this.wrapped = tunnelSources.iterator(); this.targetType = clz; @@ -61,7 +61,7 @@ public class TunnelIterator implements Iterator @Override public T next() { - T tmp = this.Next; + final T tmp = this.Next; this.Next = null; return tmp; } diff --git a/src/main/java/appeng/me/cluster/MBCalculator.java b/src/main/java/appeng/me/cluster/MBCalculator.java index 0cface0e..029d8489 100644 --- a/src/main/java/appeng/me/cluster/MBCalculator.java +++ b/src/main/java/appeng/me/cluster/MBCalculator.java @@ -33,12 +33,12 @@ public abstract class MBCalculator private final IAEMultiBlock target; - public MBCalculator( IAEMultiBlock t ) + public MBCalculator( final IAEMultiBlock t ) { this.target = t; } - public void calculateMultiblock( World world, WorldCoord loc ) + public void calculateMultiblock( final World world, final WorldCoord loc ) { if( Platform.isClient() ) { @@ -47,8 +47,8 @@ public abstract class MBCalculator try { - WorldCoord min = loc.copy(); - WorldCoord max = loc.copy(); + final WorldCoord min = loc.copy(); + final WorldCoord max = loc.copy(); // find size of MB structure... while( this.isValidTileAt( world, min.x - 1, min.y, min.z ) ) @@ -90,14 +90,14 @@ public abstract class MBCalculator return; } } - catch( Exception err ) + catch( final Exception err ) { this.disconnect(); return; } boolean updateGrid = false; - IAECluster cluster = this.target.getCluster(); + final IAECluster cluster = this.target.getCluster(); if( cluster == null ) { this.updateTiles( c, world, min, max ); @@ -114,7 +114,7 @@ public abstract class MBCalculator } } } - catch( Throwable err ) + catch( final Throwable err ) { AELog.error( err ); } @@ -122,7 +122,7 @@ public abstract class MBCalculator this.disconnect(); } - public boolean isValidTileAt( World w, int x, int y, int z ) + public boolean isValidTileAt( final World w, final int x, final int y, final int z ) { return this.isValidTile( w.getTileEntity( x, y, z ) ); } @@ -137,9 +137,9 @@ public abstract class MBCalculator */ public abstract boolean checkMultiblockScale( WorldCoord min, WorldCoord max ); - public boolean verifyUnownedRegion( World w, WorldCoord min, WorldCoord max ) + public boolean verifyUnownedRegion( final World w, final WorldCoord min, final WorldCoord max ) { - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { if( this.verifyUnownedRegionInner( w, min.x, min.y, min.z, max.x, max.y, max.z, side ) ) { @@ -187,7 +187,7 @@ public abstract class MBCalculator */ public abstract boolean isValidTile( TileEntity te ); - public boolean verifyUnownedRegionInner( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ForgeDirection side ) + public boolean verifyUnownedRegionInner( final World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, final ForgeDirection side ) { switch( side ) { @@ -225,7 +225,7 @@ public abstract class MBCalculator { for( int z = minZ; z <= maxZ; z++ ) { - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( this.isValidTile( te ) ) { return true; diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java index d2d32204..60c8c582 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java @@ -41,14 +41,14 @@ public class CraftingCPUCalculator extends MBCalculator final TileCraftingTile tqb; - public CraftingCPUCalculator( IAEMultiBlock t ) + public CraftingCPUCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileCraftingTile) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max ) { if( max.x - min.x > 16 ) { @@ -69,13 +69,13 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max ) { return new CraftingCPUCluster( min, max ); } @Override - public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { boolean storage = false; @@ -85,7 +85,7 @@ public class CraftingCPUCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); if( !te.isValid() ) { @@ -110,9 +110,9 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { - CraftingCPUCluster c = (CraftingCPUCluster) cl; + final CraftingCPUCluster c = (CraftingCPUCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -120,7 +120,7 @@ public class CraftingCPUCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileCraftingTile te = (TileCraftingTile) w.getTileEntity( x, y, z ); + final TileCraftingTile te = (TileCraftingTile) w.getTileEntity( x, y, z ); te.updateStatus( c ); c.addTile( te ); } @@ -129,14 +129,14 @@ public class CraftingCPUCalculator extends MBCalculator c.done(); - Iterator i = c.getTiles(); + final Iterator i = c.getTiles(); while( i.hasNext() ) { - IGridHost gh = i.next(); - IGridNode n = gh.getGridNode( ForgeDirection.UNKNOWN ); + final IGridHost gh = i.next(); + final IGridNode n = gh.getGridNode( ForgeDirection.UNKNOWN ); if( n != null ) { - IGrid g = n.getGrid(); + final IGrid g = n.getGrid(); if( g != null ) { g.postEvent( new MENetworkCraftingCpuChange( n ) ); @@ -147,7 +147,7 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileCraftingTile; } diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index defbfa48..9254e2f0 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -114,7 +114,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU private long startItemCount; private long remainingItemCount; - public CraftingCPUCluster( WorldCoord min, WorldCoord max ) + public CraftingCPUCluster( final WorldCoord min, final WorldCoord max ) { this.min = min; this.max = max; @@ -134,7 +134,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU * add a new Listener to the monitor, be sure to properly remove yourself when your done. */ @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @@ -143,7 +143,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU * remove a Listener to the monitor. */ @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @@ -154,9 +154,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { r.updateMeta( true ); } @@ -173,7 +173,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU boolean posted = false; - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { final IGridNode n = r.getActionableNode(); if( n != null && !posted ) @@ -196,7 +196,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return (Iterator) this.tiles.iterator(); } - public void addTile( TileCraftingTile te ) + public void addTile( final TileCraftingTile te ) { if( this.machineSrc == null || te.isCoreBlock ) { @@ -222,7 +222,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public boolean canAccept( IAEStack input ) + public boolean canAccept( final IAEStack input ) { if( input instanceof IAEItemStack ) { @@ -235,7 +235,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return false; } - public IAEStack injectItems( IAEStack input, Actionable type, BaseActionSource src ) + public IAEStack injectItems( final IAEStack input, final Actionable type, final BaseActionSource src ) { if( !( input instanceof IAEItemStack ) ) { @@ -364,7 +364,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return input; } - protected void postChange( IAEItemStack diff, BaseActionSource src ) + protected void postChange( final IAEItemStack diff, final BaseActionSource src ) { final Iterator, Object>> i = this.getListeners(); @@ -396,7 +396,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.getCore().markDirty(); } - public void postCraftingStatusChange( IAEItemStack diff ) + public void postCraftingStatusChange( final IAEItemStack diff ) { if( this.getGrid() == null ) { @@ -411,7 +411,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU if( !list.isEmpty() ) { - for( CraftingWatcher iw : list ) + for( final CraftingWatcher iw : list ) { iw.getHost().onRequestChange( sg, diff ); @@ -444,7 +444,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU send = null; } - for( TileCraftingMonitorTile t : this.status ) + for( final TileCraftingMonitorTile t : this.status ) { t.setJob( send ); } @@ -462,7 +462,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU public IGrid getGrid() { - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { final IGridNode gn = r.getActionableNode(); if( gn != null ) @@ -478,7 +478,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return null; } - private boolean canCraft( ICraftingPatternDetails details, IAEItemStack[] condensedInputs ) + private boolean canCraft( final ICraftingPatternDetails details, final IAEItemStack[] condensedInputs ) { for( IAEItemStack g : condensedInputs ) { @@ -533,9 +533,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.myLastLink.cancel(); } - IItemList list; + final IItemList list; this.getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.postChange( is, this.machineSrc ); } @@ -548,7 +548,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.waitingFor.resetStatus(); - for( IAEItemStack is : items ) + for( final IAEItemStack is : items ) { this.postCraftingStatusChange( is ); } @@ -559,7 +559,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.storeItems(); // marks dirty } - public void updateCraftingLogic( IGrid grid, IEnergyGrid eg, CraftingGridCache cc ) + public void updateCraftingLogic( final IGrid grid, final IEnergyGrid eg, final CraftingGridCache cc ) { if( !this.getCore().isActive() ) { @@ -614,7 +614,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - private void executeCrafting( IEnergyGrid eg, CraftingGridCache cc ) + private void executeCrafting( final IEnergyGrid eg, final CraftingGridCache cc ) { final Iterator> i = this.tasks.entrySet().iterator(); @@ -634,7 +634,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU { InventoryCrafting ic = null; - for( ICraftingMedium m : cc.getMediums( e.getKey() ) ) + for( final ICraftingMedium m : cc.getMediums( e.getKey() ) ) { if( e.getValue().value <= 0 ) { @@ -648,7 +648,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU final IAEItemStack[] input = details.getInputs(); double sum = 0; - for( IAEItemStack anInput : input ) + for( final IAEItemStack anInput : input ) { if( anInput != null ) { @@ -738,7 +738,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.somethingChanged = true; this.remainingOperations--; - for( IAEItemStack out : details.getCondensedOutputs() ) + for( final IAEItemStack out : details.getCondensedOutputs() ) { this.postChange( out, this.machineSrc ); this.waitingFor.add( out.copy() ); @@ -831,7 +831,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.markDirty(); } - public ICraftingLink submitJob( IGrid g, ICraftingJob job, BaseActionSource src, ICraftingRequester requestingMachine ) + public ICraftingLink submitJob( final IGrid g, final ICraftingJob job, final BaseActionSource src, final ICraftingRequester requestingMachine ) { if( !this.tasks.isEmpty() || !this.waitingFor.isEmpty() ) { @@ -882,7 +882,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU final IItemList list = AEApi.instance().storage().createItemList(); this.getListOfItem( list, CraftingItemList.ALL ); - for( IAEItemStack ge : list ) + for( final IAEItemStack ge : list ) { this.postChange( ge, this.machineSrc ); } @@ -895,7 +895,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.inventory.getItemList().resetStatus(); } } - catch( CraftBranchFailure e ) + catch( final CraftBranchFailure e ) { this.tasks.clear(); this.inventory.getItemList().resetStatus(); @@ -972,7 +972,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm, Character.MAX_RADIX ); } - private NBTTagCompound generateLinkData( String craftingID, boolean standalone, boolean req ) + private NBTTagCompound generateLinkData( final String craftingID, final boolean standalone, final boolean req ) { final NBTTagCompound tag = new NBTTagCompound(); @@ -985,7 +985,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return tag; } - private void submitLink( ICraftingLink myLastLink2 ) + private void submitLink( final ICraftingLink myLastLink2 ) { if( this.getGrid() != null ) { @@ -994,18 +994,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public void getListOfItem( IItemList list, CraftingItemList whichList ) + public void getListOfItem( final IItemList list, final CraftingItemList whichList ) { switch( whichList ) { case ACTIVE: - for( IAEItemStack ais : this.waitingFor ) + for( final IAEItemStack ais : this.waitingFor ) { list.add( ais ); } break; case PENDING: - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) { @@ -1022,12 +1022,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU case ALL: this.inventory.getAvailableItems( list ); - for( IAEItemStack ais : this.waitingFor ) + for( final IAEItemStack ais : this.waitingFor ) { list.add( ais ); } - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) { @@ -1040,18 +1040,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public void addStorage( IAEItemStack extractItems ) + public void addStorage( final IAEItemStack extractItems ) { this.inventory.injectItems( extractItems, Actionable.MODULATE, null ); } - public void addEmitable( IAEItemStack i ) + public void addEmitable( final IAEItemStack i ) { this.waitingFor.add( i ); this.postCraftingStatusChange( i ); } - public void addCrafting( ICraftingPatternDetails details, long crafts ) + public void addCrafting( final ICraftingPatternDetails details, final long crafts ) { TaskProgress i = this.tasks.get( details ); @@ -1063,7 +1063,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU i.value += crafts; } - public IAEItemStack getItemStack( IAEItemStack what, CraftingItemList storage2 ) + public IAEItemStack getItemStack( final IAEItemStack what, final CraftingItemList storage2 ) { IAEItemStack is; @@ -1080,9 +1080,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU is = what.copy(); is.setStackSize( 0 ); - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { - for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) + for( final IAEItemStack ais : t.getKey().getCondensedOutputs() ) { if( ais.equals( is ) ) { @@ -1107,7 +1107,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return is; } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { data.setTag( "finalOutput", this.writeItem( this.finalOutput ) ); data.setTag( "inventory", this.writeList( this.inventory.getItemList() ) ); @@ -1122,7 +1122,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } final NBTTagList list = new NBTTagList(); - for( Entry e : this.tasks.entrySet() ) + for( final Entry e : this.tasks.entrySet() ) { final NBTTagCompound item = this.writeItem( AEItemStack.create( e.getKey().getPattern() ) ); item.setLong( "craftingProgress", e.getValue().value ); @@ -1137,7 +1137,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU data.setLong( "remainingItemCount", this.getRemainingItemCount() ); } - private NBTTagCompound writeItem( IAEItemStack finalOutput2 ) + private NBTTagCompound writeItem( final IAEItemStack finalOutput2 ) { final NBTTagCompound out = new NBTTagCompound(); @@ -1149,11 +1149,11 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return out; } - private NBTTagList writeList( IItemList myList ) + private NBTTagList writeList( final IItemList myList ) { final NBTTagList out = new NBTTagList(); - for( IAEItemStack ais : myList ) + for( final IAEItemStack ais : myList ) { out.appendTag( this.writeItem( ais ) ); } @@ -1177,10 +1177,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.updateName(); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.finalOutput = AEItemStack.loadItemStackFromNBT( (NBTTagCompound) data.getTag( "finalOutput" ) ); - for( IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) ) + for( final IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) ) { this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc ); } @@ -1214,7 +1214,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } this.waitingFor = this.readList( (NBTTagList) data.getTag( "waitingFor" ) ); - for( IAEItemStack is : this.waitingFor ) + for( final IAEItemStack is : this.waitingFor ) { this.postCraftingStatusChange( is.copy() ); } @@ -1228,7 +1228,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU public void updateName() { this.myName = ""; - for( TileCraftingTile te : this.tiles ) + for( final TileCraftingTile te : this.tiles ) { if( te.hasCustomName() ) @@ -1245,7 +1245,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - private IItemList readList( NBTTagList tag ) + private IItemList readList( final NBTTagList tag ) { final IItemList out = AEApi.instance().storage().createItemList(); @@ -1271,7 +1271,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return this.getCore().getWorldObj(); } - public boolean isMaking( IAEItemStack what ) + public boolean isMaking( final IAEItemStack what ) { final IAEItemStack wat = this.waitingFor.findPrecise( what ); return wat != null && wat.getStackSize() > 0; @@ -1298,7 +1298,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.getListOfItem( list, CraftingItemList.PENDING ); int itemCount = 0; - for( IAEItemStack ge : list ) + for( final IAEItemStack ge : list ) { itemCount += ge.getStackSize(); } @@ -1307,7 +1307,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.remainingItemCount = itemCount; } - private void updateElapsedTime( IAEItemStack is ) + private void updateElapsedTime( final IAEItemStack is ) { final long nextStartTime = System.nanoTime(); this.elapsedTime = this.getElapsedTime() + nextStartTime - this.lastTime; diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java index fc597d3e..73cf143c 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java @@ -39,21 +39,21 @@ public class QuantumCalculator extends MBCalculator private final TileQuantumBridge tqb; - public QuantumCalculator( IAEMultiBlock t ) + public QuantumCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileQuantumBridge) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max ) { if( ( max.x - min.x + 1 ) * ( max.y - min.y + 1 ) * ( max.z - min.z + 1 ) == 9 ) { - int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 ); + final int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 ); - int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 ); + final int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 ); return ones == 1 && threes == 2; } @@ -61,13 +61,13 @@ public class QuantumCalculator extends MBCalculator } @Override - public IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max ) { return new QuantumCluster( min, max ); } @Override - public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { byte num = 0; @@ -78,7 +78,7 @@ public class QuantumCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); if( !te.isValid() ) { @@ -114,11 +114,11 @@ public class QuantumCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { byte num = 0; byte ringNum = 0; - QuantumCluster c = (QuantumCluster) cl; + final QuantumCluster c = (QuantumCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -126,10 +126,10 @@ public class QuantumCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); + final TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); num++; - byte flags; + final byte flags; if( num == 5 ) { flags = num; @@ -156,14 +156,14 @@ public class QuantumCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileQuantumBridge; } - private boolean isBlockAtLocation( IBlockAccess w, int x, int y, int z, IBlockDefinition def ) + private boolean isBlockAtLocation( final IBlockAccess w, final int x, final int y, final int z, final IBlockDefinition def ) { - for( Block block : def.maybeBlock().asSet() ) + for( final Block block : def.maybeBlock().asSet() ) { return block == w.getBlock( x, y, z ); } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 26a3bf17..ce140f60 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -59,7 +59,7 @@ public class QuantumCluster implements ILocatable, IAECluster private long otherSide; private TileQuantumBridge center; - public QuantumCluster( WorldCoord min, WorldCoord max ) + public QuantumCluster( final WorldCoord min, final WorldCoord max ) { this.min = min; this.max = max; @@ -67,7 +67,7 @@ public class QuantumCluster implements ILocatable, IAECluster } @SubscribeEvent - public void onUnload( WorldEvent.Unload e ) + public void onUnload( final WorldEvent.Unload e ) { if( this.center.getWorldObj() == e.world ) { @@ -77,10 +77,9 @@ public class QuantumCluster implements ILocatable, IAECluster } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - - long qe = this.center.getQEFrequency(); + final long qe = this.center.getQEFrequency(); if( this.thisSide != qe && this.thisSide != -qe ) { @@ -113,23 +112,23 @@ public class QuantumCluster implements ILocatable, IAECluster } } - ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide ); + final ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide ); boolean shutdown = false; if( myOtherSide instanceof QuantumCluster ) { - QuantumCluster sideA = this; - QuantumCluster sideB = (QuantumCluster) myOtherSide; + final QuantumCluster sideA = this; + final QuantumCluster sideB = (QuantumCluster) myOtherSide; if( sideA.isActive() && sideB.isActive() ) { if( this.connection != null && this.connection.connection != null ) { - IGridNode a = this.connection.connection.a(); - IGridNode b = this.connection.connection.b(); - IGridNode sa = sideA.getNode(); - IGridNode sb = sideB.getNode(); + final IGridNode a = this.connection.connection.a(); + final IGridNode b = this.connection.connection.b(); + final IGridNode sa = sideA.getNode(); + final IGridNode sb = sideB.getNode(); if( ( a == sa || b == sa ) && ( a == sb || b == sb ) ) { return; @@ -158,7 +157,7 @@ public class QuantumCluster implements ILocatable, IAECluster sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(), sideB.getNode() ) ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // :( } @@ -184,21 +183,21 @@ public class QuantumCluster implements ILocatable, IAECluster } } - public boolean canUseNode( long qe ) + public boolean canUseNode( final long qe ) { - QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe ); + final QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe ); if( qc != null ) { - World theWorld = qc.center.getWorldObj(); + final World theWorld = qc.center.getWorldObj(); if( !qc.isDestroyed ) { - Chunk c = theWorld.getChunkFromBlockCoords( qc.center.xCoord, qc.center.zCoord ); + final Chunk c = theWorld.getChunkFromBlockCoords( qc.center.xCoord, qc.center.zCoord ); if( c.isChunkLoaded ) { - int id = theWorld.provider.dimensionId; - World cur = DimensionManager.getWorld( id ); + final int id = theWorld.provider.dimensionId; + final World cur = DimensionManager.getWorld( id ); - TileEntity te = theWorld.getTileEntity( qc.center.xCoord, qc.center.yCoord, qc.center.zCoord ); + final TileEntity te = theWorld.getTileEntity( qc.center.xCoord, qc.center.yCoord, qc.center.zCoord ); return te != qc.center || theWorld != cur; } } @@ -249,7 +248,7 @@ public class QuantumCluster implements ILocatable, IAECluster this.center.updateStatus( null, (byte) -1, this.updateStatus ); - for( TileQuantumBridge r : this.Ring ) + for( final TileQuantumBridge r : this.Ring ) { r.updateStatus( null, (byte) -1, this.updateStatus ); } @@ -264,7 +263,7 @@ public class QuantumCluster implements ILocatable, IAECluster return new ChainedIterator( this.Ring[0], this.Ring[1], this.Ring[2], this.Ring[3], this.Ring[4], this.Ring[5], this.Ring[6], this.Ring[7], this.center ); } - public boolean isCorner( TileQuantumBridge tileQuantumBridge ) + public boolean isCorner( final TileQuantumBridge tileQuantumBridge ) { return this.Ring[0] == tileQuantumBridge || this.Ring[2] == tileQuantumBridge || this.Ring[4] == tileQuantumBridge || this.Ring[6] == tileQuantumBridge; } @@ -280,7 +279,7 @@ public class QuantumCluster implements ILocatable, IAECluster return this.center; } - public void setCenter( TileQuantumBridge c ) + public void setCenter( final TileQuantumBridge c ) { this.registered = true; MinecraftForge.EVENT_BUS.register( this ); diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java index 5941699e..3d0c0081 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java @@ -35,26 +35,26 @@ public class SpatialPylonCalculator extends MBCalculator private final TileSpatialPylon tqb; - public SpatialPylonCalculator( IAEMultiBlock t ) + public SpatialPylonCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileSpatialPylon) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max ) { return ( min.x == max.x && min.y == max.y && min.z != max.z ) || ( min.x == max.x && min.y != max.y && min.z == max.z ) || ( min.x != max.x && min.y == max.y && min.z == max.z ); } @Override - public IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max ) { return new SpatialPylonCluster( new DimensionalCoord( w, min.x, min.y, min.z ), new DimensionalCoord( w, max.x, max.y, max.z ) ); } @Override - public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { for( int x = min.x; x <= max.x; x++ ) @@ -63,7 +63,7 @@ public class SpatialPylonCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z ); if( !te.isValid() ) { @@ -83,9 +83,9 @@ public class SpatialPylonCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { - SpatialPylonCluster c = (SpatialPylonCluster) cl; + final SpatialPylonCluster c = (SpatialPylonCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -93,7 +93,7 @@ public class SpatialPylonCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( x, y, z ); + final TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( x, y, z ); te.updateStatus( c ); c.line.add( ( te ) ); } @@ -102,7 +102,7 @@ public class SpatialPylonCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileSpatialPylon; } diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java index 96814786..c33801d9 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java @@ -42,7 +42,7 @@ public class SpatialPylonCluster implements IAECluster public boolean hasPower; public boolean hasChannel; - public SpatialPylonCluster( DimensionalCoord min, DimensionalCoord max ) + public SpatialPylonCluster( final DimensionalCoord min, final DimensionalCoord max ) { this.min = min.copy(); this.max = max.copy(); @@ -66,9 +66,9 @@ public class SpatialPylonCluster implements IAECluster } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - for( TileSpatialPylon r : this.line ) + for( final TileSpatialPylon r : this.line ) { r.recalculateDisplay(); } @@ -84,7 +84,7 @@ public class SpatialPylonCluster implements IAECluster } this.isDestroyed = true; - for( TileSpatialPylon r : this.line ) + for( final TileSpatialPylon r : this.line ) { r.updateStatus( null ); } diff --git a/src/main/java/appeng/me/energy/EnergyThreshold.java b/src/main/java/appeng/me/energy/EnergyThreshold.java index 25d1937c..13522fbe 100644 --- a/src/main/java/appeng/me/energy/EnergyThreshold.java +++ b/src/main/java/appeng/me/energy/EnergyThreshold.java @@ -30,7 +30,7 @@ public class EnergyThreshold implements Comparable public final IEnergyWatcher watcher; final int hash; - public EnergyThreshold( double lim, IEnergyWatcher wat ) + public EnergyThreshold( final double lim, final IEnergyWatcher wat ) { this.Limit = lim; this.watcher = wat; @@ -52,7 +52,7 @@ public class EnergyThreshold implements Comparable } @Override - public int compareTo( EnergyThreshold o ) + public int compareTo( final EnergyThreshold o ) { return ItemSorters.compareDouble( this.Limit, o.Limit ); } diff --git a/src/main/java/appeng/me/energy/EnergyWatcher.java b/src/main/java/appeng/me/energy/EnergyWatcher.java index 63167bf2..c827279d 100644 --- a/src/main/java/appeng/me/energy/EnergyWatcher.java +++ b/src/main/java/appeng/me/energy/EnergyWatcher.java @@ -38,13 +38,13 @@ public class EnergyWatcher implements IEnergyWatcher final IEnergyWatcherHost myObject; final HashSet myInterests = new HashSet(); - public EnergyWatcher( EnergyGridCache cache, IEnergyWatcherHost host ) + public EnergyWatcher( final EnergyGridCache cache, final IEnergyWatcherHost host ) { this.gsc = cache; this.myObject = host; } - public void post( EnergyGridCache energyGridCache ) + public void post( final EnergyGridCache energyGridCache ) { this.myObject.onThresholdPass( energyGridCache ); } @@ -67,7 +67,7 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -85,42 +85,42 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( Double e ) + public boolean add( final Double e ) { if( this.myInterests.contains( e ) ) { return false; } - EnergyThreshold eh = new EnergyThreshold( e, this ); + final EnergyThreshold eh = new EnergyThreshold( e, this ); return this.gsc.interests.add( eh ) && this.myInterests.add( eh ); } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { - EnergyThreshold eh = new EnergyThreshold( (Double) o, this ); + final EnergyThreshold eh = new EnergyThreshold( (Double) o, this ); return this.myInterests.remove( eh ) && this.gsc.interests.remove( eh ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { boolean didChange = false; - for( Double o : c ) + for( final Double o : c ) { didChange = this.add( o ) || didChange; } @@ -129,10 +129,10 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -140,10 +140,10 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -160,7 +160,7 @@ public class EnergyWatcher implements IEnergyWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interests.remove( i.next() ); @@ -175,7 +175,7 @@ public class EnergyWatcher implements IEnergyWatcher final Iterator interestIterator; EnergyThreshold myLast; - public EnergyWatcherIterator( EnergyWatcher parent, Iterator i ) + public EnergyWatcherIterator( final EnergyWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/me/helpers/AENetworkProxy.java b/src/main/java/appeng/me/helpers/AENetworkProxy.java index f756d8c2..3f6c924d 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxy.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxy.java @@ -71,7 +71,7 @@ public class AENetworkProxy implements IGridBlock private double idleDraw = 1.0; private EntityPlayer owner; - public AENetworkProxy( IGridProxyable te, String nbtName, ItemStack visual, boolean inWorld ) + public AENetworkProxy( final IGridProxyable te, final String nbtName, final ItemStack visual, final boolean inWorld ) { this.gp = te; this.nbtName = nbtName; @@ -80,12 +80,12 @@ public class AENetworkProxy implements IGridBlock this.validSides = EnumSet.allOf( ForgeDirection.class ); } - public void setVisualRepresentation( ItemStack is ) + public void setVisualRepresentation( final ItemStack is ) { this.myRepInstance = is; } - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { if( this.node != null ) { @@ -93,7 +93,7 @@ public class AENetworkProxy implements IGridBlock } } - public void setValidSides( EnumSet validSides ) + public void setValidSides( final EnumSet validSides ) { this.validSides = validSides; if( this.node != null ) @@ -133,7 +133,7 @@ public class AENetworkProxy implements IGridBlock // send orientation based directionality to the node. if( this.gp instanceof IOrientable ) { - IOrientable ori = (IOrientable) this.gp; + final IOrientable ori = (IOrientable) this.gp; if( ori.canBeRotated() ) { ori.setOrientation( ori.getForward(), ori.getUp() ); @@ -155,7 +155,7 @@ public class AENetworkProxy implements IGridBlock return this.node; } - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { this.data = tag; if( this.node != null && this.data != null ) @@ -175,12 +175,12 @@ public class AENetworkProxy implements IGridBlock public IPathingGrid getPath() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IPathingGrid pg = grid.getCache( IPathingGrid.class ); + final IPathingGrid pg = grid.getCache( IPathingGrid.class ); if( pg == null ) { throw new GridAccessException(); @@ -201,7 +201,7 @@ public class AENetworkProxy implements IGridBlock { throw new GridAccessException(); } - IGrid grid = this.node.getGrid(); + final IGrid grid = this.node.getGrid(); if( grid == null ) { throw new GridAccessException(); @@ -211,12 +211,12 @@ public class AENetworkProxy implements IGridBlock public ITickManager getTick() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ITickManager pg = grid.getCache( ITickManager.class ); + final ITickManager pg = grid.getCache( ITickManager.class ); if( pg == null ) { throw new GridAccessException(); @@ -226,13 +226,13 @@ public class AENetworkProxy implements IGridBlock public IStorageGrid getStorage() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IStorageGrid pg = grid.getCache( IStorageGrid.class ); + final IStorageGrid pg = grid.getCache( IStorageGrid.class ); if( pg == null ) { @@ -244,13 +244,13 @@ public class AENetworkProxy implements IGridBlock public P2PCache getP2P() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - P2PCache pg = grid.getCache( P2PCache.class ); + final P2PCache pg = grid.getCache( P2PCache.class ); if( pg == null ) { @@ -262,13 +262,13 @@ public class AENetworkProxy implements IGridBlock public ISecurityGrid getSecurity() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ISecurityGrid sg = grid.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = grid.getCache( ISecurityGrid.class ); if( sg == null ) { @@ -280,13 +280,13 @@ public class AENetworkProxy implements IGridBlock public ICraftingGrid getCrafting() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ICraftingGrid sg = grid.getCache( ICraftingGrid.class ); + final ICraftingGrid sg = grid.getCache( ICraftingGrid.class ); if( sg == null ) { @@ -327,7 +327,7 @@ public class AENetworkProxy implements IGridBlock } @Override - public void onGridNotification( GridNotification notification ) + public void onGridNotification( final GridNotification notification ) { if( this.gp instanceof PartCable ) { @@ -336,7 +336,7 @@ public class AENetworkProxy implements IGridBlock } @Override - public void setNetworkStatus( IGrid grid, int channelsInUse ) + public void setNetworkStatus( final IGrid grid, final int channelsInUse ) { } @@ -365,16 +365,16 @@ public class AENetworkProxy implements IGridBlock return this.myRepInstance; } - public void setFlags( GridFlags... requireChannel ) + public void setFlags( final GridFlags... requireChannel ) { - EnumSet flags = EnumSet.noneOf( GridFlags.class ); + final EnumSet flags = EnumSet.noneOf( GridFlags.class ); Collections.addAll( flags, requireChannel ); this.flags = flags; } - public void setIdlePowerUsage( double idle ) + public void setIdlePowerUsage( final double idle ) { this.idleDraw = idle; @@ -382,10 +382,10 @@ public class AENetworkProxy implements IGridBlock { try { - IGrid g = this.getGrid(); + final IGrid g = this.getGrid(); g.postEvent( new MENetworkPowerIdleChange( this.node ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // not ready for this yet.. } @@ -413,7 +413,7 @@ public class AENetworkProxy implements IGridBlock { return this.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } @@ -421,12 +421,12 @@ public class AENetworkProxy implements IGridBlock public IEnergyGrid getEnergy() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); if( eg == null ) { throw new GridAccessException(); @@ -434,7 +434,7 @@ public class AENetworkProxy implements IGridBlock return eg; } - public void setOwner( EntityPlayer player ) + public void setOwner( final EntityPlayer player ) { this.owner = player; } diff --git a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java index 73a8bce9..3123294b 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java @@ -34,7 +34,7 @@ import appeng.util.iterators.ProxyNodeIterator; public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMultiblock { - public AENetworkProxyMultiblock( IGridProxyable te, String nbtName, ItemStack itemStack, boolean inWorld ) + public AENetworkProxyMultiblock( final IGridProxyable te, final String nbtName, final ItemStack itemStack, final boolean inWorld ) { super( te, nbtName, itemStack, inWorld ); } diff --git a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java index 1b57baca..9bfff2b9 100644 --- a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java +++ b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java @@ -31,14 +31,14 @@ public class ChannelPowerSrc implements IEnergySource final IGridNode node; final IEnergySource realSrc; - public ChannelPowerSrc( IGridNode networkNode, IEnergySource src ) + public ChannelPowerSrc( final IGridNode networkNode, final IEnergySource src ) { this.node = networkNode; this.realSrc = src; } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { if( this.node.isActive() ) { diff --git a/src/main/java/appeng/me/helpers/GenericInterestManager.java b/src/main/java/appeng/me/helpers/GenericInterestManager.java index 884673f9..ea646930 100644 --- a/src/main/java/appeng/me/helpers/GenericInterestManager.java +++ b/src/main/java/appeng/me/helpers/GenericInterestManager.java @@ -34,7 +34,7 @@ public class GenericInterestManager private LinkedList transactions = null; private int transDepth = 0; - public GenericInterestManager( Multimap interests ) + public GenericInterestManager( final Multimap interests ) { this.container = interests; } @@ -55,10 +55,10 @@ public class GenericInterestManager if( this.transDepth == 0 ) { - LinkedList myActions = this.transactions; + final LinkedList myActions = this.transactions; this.transactions = null; - for( SavedTransactions t : myActions ) + for( final SavedTransactions t : myActions ) { if( t.put ) { @@ -72,7 +72,7 @@ public class GenericInterestManager } } - public boolean put( IAEStack stack, T iw ) + public boolean put( final IAEStack stack, final T iw ) { if( this.transactions != null ) { @@ -85,7 +85,7 @@ public class GenericInterestManager } } - public boolean remove( IAEStack stack, T iw ) + public boolean remove( final IAEStack stack, final T iw ) { if( this.transactions != null ) { @@ -98,12 +98,12 @@ public class GenericInterestManager } } - public boolean containsKey( IAEStack stack ) + public boolean containsKey( final IAEStack stack ) { return this.container.containsKey( stack ); } - public Collection get( IAEStack stack ) + public Collection get( final IAEStack stack ) { return this.container.get( stack ); } @@ -115,7 +115,7 @@ public class GenericInterestManager public final IAEStack stack; public final T iw; - public SavedTransactions( boolean putOperation, IAEStack myStack, T watcher ) + public SavedTransactions( final boolean putOperation, final IAEStack myStack, final T watcher ) { this.put = putOperation; this.stack = myStack; diff --git a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java index 987f9ca7..8a0afab1 100644 --- a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java @@ -31,15 +31,15 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor private final int usedChannels; - public AdHocChannelUpdater( int used ) + public AdHocChannelUpdater( final int used ) { this.usedChannels = used; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; gn.setControllerRoute( null, true ); gn.incrementChannelCount( this.usedChannels ); gn.finalizeChannels(); @@ -47,9 +47,9 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor } @Override - public void visitConnection( IGridConnection gcc ) + public void visitConnection( final IGridConnection gcc ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; gc.setControllerRoute( null, true ); gc.incrementChannelCount( this.usedChannels ); gc.finalizeChannels(); diff --git a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java index e7bba5b1..f6bb4ff7 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java @@ -30,17 +30,17 @@ public class ControllerChannelUpdater implements IGridConnectionVisitor { @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; gn.finalizeChannels(); return true; } @Override - public void visitConnection( IGridConnection gcc ) + public void visitConnection( final IGridConnection gcc ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; gc.finalizeChannels(); } } diff --git a/src/main/java/appeng/me/pathfinding/ControllerValidator.java b/src/main/java/appeng/me/pathfinding/ControllerValidator.java index 23aa4fc4..a02705c8 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerValidator.java +++ b/src/main/java/appeng/me/pathfinding/ControllerValidator.java @@ -37,7 +37,7 @@ public class ControllerValidator implements IGridVisitor int maxY; int maxZ; - public ControllerValidator( int x, int y, int z ) + public ControllerValidator( final int x, final int y, final int z ) { this.minX = x; this.minY = y; @@ -48,12 +48,12 @@ public class ControllerValidator implements IGridVisitor } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - IGridHost host = n.getMachine(); + final IGridHost host = n.getMachine(); if( this.isValid && host instanceof TileController ) { - TileController c = (TileController) host; + final TileController c = (TileController) host; this.minX = Math.min( c.xCoord, this.minX ); this.maxX = Math.max( c.xCoord, this.maxX ); diff --git a/src/main/java/appeng/me/pathfinding/PathSegment.java b/src/main/java/appeng/me/pathfinding/PathSegment.java index 0d4249f0..1c38ba59 100644 --- a/src/main/java/appeng/me/pathfinding/PathSegment.java +++ b/src/main/java/appeng/me/pathfinding/PathSegment.java @@ -40,7 +40,7 @@ public class PathSegment public boolean isDead; List open; - public PathSegment( PathGridCache myPGC, List open, Set semiOpen, Set closed ) + public PathSegment( final PathGridCache myPGC, final List open, final Set semiOpen, final Set closed ) { this.open = open; this.semiOpen = semiOpen; @@ -51,14 +51,14 @@ public class PathSegment public boolean step() { - List oldOpen = this.open; + final List oldOpen = this.open; this.open = new LinkedList(); - for( IPathItem i : oldOpen ) + for( final IPathItem i : oldOpen ) { - for( IPathItem pi : i.getPossibleOptions() ) + for( final IPathItem pi : i.getPossibleOptions() ) { - EnumSet flags = pi.getFlags(); + final EnumSet flags = pi.getFlags(); if( !this.closed.contains( pi ) ) { @@ -69,7 +69,7 @@ public class PathSegment // close the semi open. if( !this.semiOpen.contains( pi ) ) { - boolean worked; + final boolean worked; if( flags.contains( GridFlags.COMPRESSED_CHANNEL ) ) { @@ -82,10 +82,10 @@ public class PathSegment if( worked && flags.contains( GridFlags.MULTIBLOCK ) ) { - Iterator oni = ( (IGridMultiblock) ( (IGridNode) pi ).getGridBlock() ).getMultiblockNodes(); + final Iterator oni = ( (IGridMultiblock) ( (IGridNode) pi ).getGridBlock() ).getMultiblockNodes(); while( oni.hasNext() ) { - IGridNode otherNodes = oni.next(); + final IGridNode otherNodes = oni.next(); if( otherNodes != pi ) { this.semiOpen.add( (IPathItem) otherNodes ); @@ -109,7 +109,7 @@ public class PathSegment return this.open.isEmpty(); } - private boolean useDenseChannel( IPathItem start ) + private boolean useDenseChannel( final IPathItem start ) { IPathItem pi = start; while( pi != null ) @@ -134,7 +134,7 @@ public class PathSegment return true; } - private boolean useChannel( IPathItem start ) + private boolean useChannel( final IPathItem start ) { IPathItem pi = start; while( pi != null ) diff --git a/src/main/java/appeng/me/storage/AEExternalHandler.java b/src/main/java/appeng/me/storage/AEExternalHandler.java index 0ac82eae..44418790 100644 --- a/src/main/java/appeng/me/storage/AEExternalHandler.java +++ b/src/main/java/appeng/me/storage/AEExternalHandler.java @@ -37,7 +37,7 @@ public class AEExternalHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc ) { if( channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable ) { @@ -48,7 +48,7 @@ public class AEExternalHandler implements IExternalStorageHandler } @Override - public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src ) { if( te instanceof TileCondenser ) { @@ -64,12 +64,12 @@ public class AEExternalHandler implements IExternalStorageHandler if( te instanceof ITileStorageMonitorable ) { - ITileStorageMonitorable iface = (ITileStorageMonitorable) te; - IStorageMonitorable sm = iface.getMonitorable( d, src ); + final ITileStorageMonitorable iface = (ITileStorageMonitorable) te; + final IStorageMonitorable sm = iface.getMonitorable( d, src ); if( channel == StorageChannel.ITEMS && sm != null ) { - IMEInventory ii = sm.getItemInventory(); + final IMEInventory ii = sm.getItemInventory(); if( ii != null ) { return ii; @@ -78,7 +78,7 @@ public class AEExternalHandler implements IExternalStorageHandler if( channel == StorageChannel.FLUIDS && sm != null ) { - IMEInventory fi = sm.getFluidInventory(); + final IMEInventory fi = sm.getFluidInventory(); if( fi != null ) { return fi; diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index 565d3113..b4cd78e6 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -68,13 +68,13 @@ public class CellInventory implements ICellInventory protected ItemStack i; protected IStorageCell CellType; - protected CellInventory( NBTTagCompound data, ISaveProvider container ) + protected CellInventory( final NBTTagCompound data, final ISaveProvider container ) { this.tagCompound = data; this.container = container; } - protected CellInventory( ItemStack o, ISaveProvider container ) throws AppEngException + protected CellInventory( final ItemStack o, final ISaveProvider container ) throws AppEngException { if( itemSlots == null ) { @@ -96,7 +96,7 @@ public class CellInventory implements ICellInventory this.CellType = null; this.i = o; - Item type = this.i.getItem(); + final Item type = this.i.getItem(); if( type instanceof IStorageCell ) { this.CellType = (IStorageCell) this.i.getItem(); @@ -129,19 +129,19 @@ public class CellInventory implements ICellInventory this.cellItems = null; } - public static IMEInventoryHandler getCell( ItemStack o, ISaveProvider container2 ) + public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new CellInventoryHandler( new CellInventory( o, container2 ) ); } - catch( AppEngException e ) + catch( final AppEngException e ) { return null; } } - private static boolean isStorageCell( ItemStack i ) + private static boolean isStorageCell( final ItemStack i ) { if( i == null ) { @@ -150,13 +150,13 @@ public class CellInventory implements ICellInventory try { - Item type = i.getItem(); + final Item type = i.getItem(); if( type instanceof IStorageCell ) { return !( (IStorageCell) type ).storableInStorageCell(); } } - catch( Throwable err ) + catch( final Throwable err ) { return true; } @@ -164,14 +164,14 @@ public class CellInventory implements ICellInventory return false; } - public static boolean isCell( ItemStack i ) + public static boolean isCell( final ItemStack i ) { if( i == null ) { return false; } - Item type = i.getItem(); + final Item type = i.getItem(); if( type instanceof IStorageCell ) { return ( (IStorageCell) type ).isStorageCell( i ); @@ -180,12 +180,12 @@ public class CellInventory implements ICellInventory return false; } - public static void addBasicBlackList( int itemID, int meta ) + public static void addBasicBlackList( final int itemID, final int meta ) { BLACK_LIST.add( ( meta << Platform.DEF_OFFSET ) | itemID ); } - public static boolean isBlackListed( IAEItemStack input ) + public static boolean isBlackListed( final IAEItemStack input ) { if( BLACK_LIST.contains( ( OreDictionary.WILDCARD_VALUE << Platform.DEF_OFFSET ) | Item.getIdFromItem( input.getItem() ) ) ) { @@ -194,13 +194,13 @@ public class CellInventory implements ICellInventory return BLACK_LIST.contains( ( input.getItemDamage() << Platform.DEF_OFFSET ) | Item.getIdFromItem( input.getItem() ) ); } - private boolean isEmpty( IMEInventory meInventory ) + private boolean isEmpty( final IMEInventory meInventory ) { return meInventory.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty(); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( input == null ) { @@ -216,21 +216,21 @@ public class CellInventory implements ICellInventory return input; } - ItemStack sharedItemStack = input.getItemStack(); + final ItemStack sharedItemStack = input.getItemStack(); if( CellInventory.isStorageCell( sharedItemStack ) ) { - IMEInventory meInventory = getCell( sharedItemStack, null ); + final IMEInventory meInventory = getCell( sharedItemStack, null ); if( meInventory != null && !this.isEmpty( meInventory ) ) { return input; } } - IAEItemStack l = this.getCellItems().findPrecise( input ); + final IAEItemStack l = this.getCellItems().findPrecise( input ); if( l != null ) { - long remainingItemSlots = this.getRemainingItemCount(); + final long remainingItemSlots = this.getRemainingItemCount(); if( remainingItemSlots < 0 ) { return input; @@ -238,7 +238,7 @@ public class CellInventory implements ICellInventory if( input.getStackSize() > remainingItemSlots ) { - IAEItemStack r = input.copy(); + final IAEItemStack r = input.copy(); r.setStackSize( r.getStackSize() - remainingItemSlots ); if( mode == Actionable.MODULATE ) { @@ -262,16 +262,16 @@ public class CellInventory implements ICellInventory if( this.canHoldNewItem() ) // room for new type, and for at least one item! { - int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * 8; + final int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * 8; if( remainingItemCount > 0 ) { if( input.getStackSize() > remainingItemCount ) { - ItemStack toReturn = Platform.cloneItemStack( sharedItemStack ); + final ItemStack toReturn = Platform.cloneItemStack( sharedItemStack ); toReturn.stackSize = sharedItemStack.stackSize - remainingItemCount; if( mode == Actionable.MODULATE ) { - ItemStack toWrite = Platform.cloneItemStack( sharedItemStack ); + final ItemStack toWrite = Platform.cloneItemStack( sharedItemStack ); toWrite.stackSize = remainingItemCount; this.cellItems.add( AEItemStack.create( toWrite ) ); @@ -297,18 +297,18 @@ public class CellInventory implements ICellInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( request == null ) { return null; } - long size = Math.min( Integer.MAX_VALUE, request.getStackSize() ); + final long size = Math.min( Integer.MAX_VALUE, request.getStackSize() ); IAEItemStack Results = null; - IAEItemStack l = this.getCellItems().findPrecise( request ); + final IAEItemStack l = this.getCellItems().findPrecise( request ); if( l != null ) { Results = l.copy(); @@ -349,7 +349,7 @@ public class CellInventory implements ICellInventory return this.cellItems; } - private void updateItemCount( long delta ) + private void updateItemCount( final long delta ) { this.storedItemCount += delta; this.tagCompound.setInteger( ITEM_COUNT_TAG, this.storedItemCount ); @@ -362,18 +362,18 @@ public class CellInventory implements ICellInventory // add new pretty stuff... int x = 0; - for( IAEItemStack v : this.cellItems ) + for( final IAEItemStack v : this.cellItems ) { itemCount += v.getStackSize(); - NBTBase c = this.tagCompound.getTag( itemSlots[x] ); + final NBTBase c = this.tagCompound.getTag( itemSlots[x] ); if( c instanceof NBTTagCompound ) { v.writeToNBT( (NBTTagCompound) c ); } else { - NBTTagCompound g = new NBTTagCompound(); + final NBTTagCompound g = new NBTTagCompound(); v.writeToNBT( g ); this.tagCompound.setTag( itemSlots[x], g ); } @@ -389,7 +389,7 @@ public class CellInventory implements ICellInventory // NBTBase tagType = tagCompound.getTag( ITEM_TYPE_TAG ); // NBTBase tagCount = tagCompound.getTag( ITEM_COUNT_TAG ); - short oldStoredItems = this.storedItems; + final short oldStoredItems = this.storedItems; /* * if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size(); @@ -440,11 +440,11 @@ public class CellInventory implements ICellInventory this.cellItems.resetStatus(); // clears totals and stuff. - int types = (int) this.getStoredItemTypes(); + final int types = (int) this.getStoredItemTypes(); for( int x = 0; x < types; x++ ) { - ItemStack t = ItemStack.loadItemStackFromNBT( this.tagCompound.getCompoundTag( itemSlots[x] ) ); + final ItemStack t = ItemStack.loadItemStackFromNBT( this.tagCompound.getCompoundTag( itemSlots[x] ) ); if( t != null ) { t.stackSize = this.tagCompound.getInteger( itemSlotCount[x] ); @@ -460,9 +460,9 @@ public class CellInventory implements ICellInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack i : this.getCellItems() ) + for( final IAEItemStack i : this.getCellItems() ) { out.add( i ); } @@ -515,7 +515,7 @@ public class CellInventory implements ICellInventory @Override public boolean canHoldNewItem() { - long bytesFree = this.getFreeBytes(); + final long bytesFree = this.getFreeBytes(); return ( bytesFree > this.getBytesPerType() || ( bytesFree == this.getBytesPerType() && this.getUnusedItemCount() > 0 ) ) && this.getRemainingItemTypes() > 0; } @@ -534,7 +534,7 @@ public class CellInventory implements ICellInventory @Override public long getUsedBytes() { - long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / 8; + final long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / 8; return this.getStoredItemTypes() * this.getBytesPerType() + bytesForItemCount; } @@ -559,22 +559,22 @@ public class CellInventory implements ICellInventory @Override public long getRemainingItemTypes() { - long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); - long baseOnTotal = this.getTotalItemTypes() - this.getStoredItemTypes(); + final long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); + final long baseOnTotal = this.getTotalItemTypes() - this.getStoredItemTypes(); return basedOnStorage > baseOnTotal ? baseOnTotal : basedOnStorage; } @Override public long getRemainingItemCount() { - long remaining = this.getFreeBytes() * 8 + this.getUnusedItemCount(); + final long remaining = this.getFreeBytes() * 8 + this.getUnusedItemCount(); return remaining > 0 ? remaining : 0; } @Override public int getUnusedItemCount() { - int div = (int) ( this.getStoredItemCount() % 8 ); + final int div = (int) ( this.getStoredItemCount() % 8 ); if( div == 0 ) { diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index 60385265..f7248efb 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -43,28 +43,28 @@ import appeng.util.prioitylist.PrecisePriorityList; public class CellInventoryHandler extends MEInventoryHandler implements ICellInventoryHandler { - CellInventoryHandler( IMEInventory c ) + CellInventoryHandler( final IMEInventory c ) { super( c, StorageChannel.ITEMS ); - ICellInventory ci = this.getCellInv(); + final ICellInventory ci = this.getCellInv(); if( ci != null ) { - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - IInventory upgrades = ci.getUpgradesInventory(); - IInventory config = ci.getConfigInventory(); - FuzzyMode fzMode = ci.getFuzzyMode(); + final IInventory upgrades = ci.getUpgradesInventory(); + final IInventory config = ci.getConfigInventory(); + final FuzzyMode fzMode = ci.getFuzzyMode(); boolean hasInverter = false; boolean hasFuzzy = false; for( int x = 0; x < upgrades.getSizeInventory(); x++ ) { - ItemStack is = upgrades.getStackInSlot( x ); + final ItemStack is = upgrades.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); if( u != null ) { switch( u ) @@ -83,7 +83,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple for( int x = 0; x < config.getSizeInventory(); x++ ) { - ItemStack is = config.getStackInSlot( x ); + final ItemStack is = config.getStackInSlot( x ); if( is != null ) { priorityList.add( AEItemStack.create( is ) ); diff --git a/src/main/java/appeng/me/storage/CreativeCellInventory.java b/src/main/java/appeng/me/storage/CreativeCellInventory.java index f9983d1d..121c4ba1 100644 --- a/src/main/java/appeng/me/storage/CreativeCellInventory.java +++ b/src/main/java/appeng/me/storage/CreativeCellInventory.java @@ -38,29 +38,29 @@ public class CreativeCellInventory implements IMEInventoryHandler final IItemList itemListCache = AEApi.instance().storage().createItemList(); - protected CreativeCellInventory( ItemStack o ) + protected CreativeCellInventory( final ItemStack o ) { - CellConfig cc = new CellConfig( o ); - for( ItemStack is : cc ) + final CellConfig cc = new CellConfig( o ); + for( final ItemStack is : cc ) { if( is != null ) { - IAEItemStack i = AEItemStack.create( is ); + final IAEItemStack i = AEItemStack.create( is ); i.setStackSize( Integer.MAX_VALUE ); this.itemListCache.add( i ); } } } - public static IMEInventoryHandler getCell( ItemStack o ) + public static IMEInventoryHandler getCell( final ItemStack o ) { return new CellInventoryHandler( new CreativeCellInventory( o ) ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { - IAEItemStack local = this.itemListCache.findPrecise( input ); + final IAEItemStack local = this.itemListCache.findPrecise( input ); if( local == null ) { return input; @@ -70,9 +70,9 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { - IAEItemStack local = this.itemListCache.findPrecise( request ); + final IAEItemStack local = this.itemListCache.findPrecise( request ); if( local == null ) { return null; @@ -82,9 +82,9 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack ais : this.itemListCache ) + for( final IAEItemStack ais : this.itemListCache ) { out.add( ais ); } @@ -104,13 +104,13 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return this.itemListCache.findPrecise( input ) != null; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return this.itemListCache.findPrecise( input ) != null; } @@ -128,7 +128,7 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/DriveWatcher.java b/src/main/java/appeng/me/storage/DriveWatcher.java index dede9791..9f55e9ef 100644 --- a/src/main/java/appeng/me/storage/DriveWatcher.java +++ b/src/main/java/appeng/me/storage/DriveWatcher.java @@ -37,7 +37,7 @@ public class DriveWatcher> extends MEInventoryHandler final ICellHandler handler; final IChestOrDrive cord; - public DriveWatcher( IMEInventory i, ItemStack is, ICellHandler han, IChestOrDrive cod ) + public DriveWatcher( final IMEInventory i, final ItemStack is, final ICellHandler han, final IChestOrDrive cod ) { super( i, i.getChannel() ); this.is = is; @@ -46,15 +46,15 @@ public class DriveWatcher> extends MEInventoryHandler } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { - long size = input.getStackSize(); + final long size = input.getStackSize(); - T a = super.injectItems( input, type, src ); + final T a = super.injectItems( input, type, src ); if( a == null || a.getStackSize() != size ) { - int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); + final int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); if( newStatus != this.oldStatus ) { @@ -66,13 +66,13 @@ public class DriveWatcher> extends MEInventoryHandler } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { - T a = super.extractItems( request, type, src ); + final T a = super.extractItems( request, type, src ); if( a != null ) { - int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); + final int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); if( newStatus != this.oldStatus ) { diff --git a/src/main/java/appeng/me/storage/ItemWatcher.java b/src/main/java/appeng/me/storage/ItemWatcher.java index d1c9a64b..91699ad9 100644 --- a/src/main/java/appeng/me/storage/ItemWatcher.java +++ b/src/main/java/appeng/me/storage/ItemWatcher.java @@ -39,7 +39,7 @@ public class ItemWatcher implements IStackWatcher final IStackWatcherHost myObject; final HashSet myInterests = new HashSet(); - public ItemWatcher( GridStorageCache cache, IStackWatcherHost host ) + public ItemWatcher( final GridStorageCache cache, final IStackWatcherHost host ) { this.gsc = cache; this.myObject = host; @@ -63,7 +63,7 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -81,13 +81,13 @@ public class ItemWatcher implements IStackWatcher } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( IAEStack e ) + public boolean add( final IAEStack e ) { if( this.myInterests.contains( e ) ) { @@ -98,23 +98,23 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { boolean didChange = false; - for( IAEStack o : c ) + for( final IAEStack o : c ) { didChange = this.add( o ) || didChange; } @@ -123,10 +123,10 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -134,10 +134,10 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -154,7 +154,7 @@ public class ItemWatcher implements IStackWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interestManager.remove( i.next(), this ); @@ -169,7 +169,7 @@ public class ItemWatcher implements IStackWatcher final Iterator interestIterator; IAEStack myLast; - public ItemWatcherIterator( ItemWatcher parent, Iterator i ) + public ItemWatcherIterator( final ItemWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java index ef9a4a6e..22826eb1 100644 --- a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java +++ b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java @@ -39,20 +39,20 @@ public class MEIInventoryWrapper implements IMEInventory protected final IInventory target; protected final InventoryAdaptor adaptor; - public MEIInventoryWrapper( IInventory m, InventoryAdaptor ia ) + public MEIInventoryWrapper( final IInventory m, final InventoryAdaptor ia ) { this.target = m; this.adaptor = ia; } @Override - public IAEItemStack injectItems( IAEItemStack iox, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack iox, final Actionable mode, final BaseActionSource src ) { - ItemStack input = iox.getItemStack(); + final ItemStack input = iox.getItemStack(); if( this.adaptor != null ) { - ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd( input ) : this.adaptor.addItems( input ); + final ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd( input ) : this.adaptor.addItems( input ); if( is == null ) { return null; @@ -60,17 +60,17 @@ public class MEIInventoryWrapper implements IMEInventory return AEItemStack.create( is ); } - ItemStack out = Platform.cloneItemStack( input ); + final ItemStack out = Platform.cloneItemStack( input ); if( mode == Actionable.MODULATE ) // absolutely no need for a first run in simulate mode. { for( int x = 0; x < this.target.getSizeInventory(); x++ ) { - ItemStack t = this.target.getStackInSlot( x ); + final ItemStack t = this.target.getStackInSlot( x ); if( Platform.isSameItem( t, input ) ) { - int oriStack = t.stackSize; + final int oriStack = t.stackSize; t.stackSize += out.stackSize; this.target.setInventorySlotContents( x, t ); @@ -126,9 +126,9 @@ public class MEIInventoryWrapper implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { - ItemStack Req = request.getItemStack(); + final ItemStack Req = request.getItemStack(); int request_stackSize = Req.stackSize; @@ -152,7 +152,7 @@ public class MEIInventoryWrapper implements IMEInventory // try to find matching inventories that already have it... for( int x = 0; x < this.target.getSizeInventory(); x++ ) { - ItemStack sub = this.target.getStackInSlot( x ); + final ItemStack sub = this.target.getStackInSlot( x ); if( Platform.isSameItem( sub, Req ) ) { @@ -207,7 +207,7 @@ public class MEIInventoryWrapper implements IMEInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { for( int x = 0; x < this.target.getSizeInventory(); x++ ) { diff --git a/src/main/java/appeng/me/storage/MEInventoryHandler.java b/src/main/java/appeng/me/storage/MEInventoryHandler.java index ded200ea..79eb4713 100644 --- a/src/main/java/appeng/me/storage/MEInventoryHandler.java +++ b/src/main/java/appeng/me/storage/MEInventoryHandler.java @@ -48,7 +48,7 @@ public class MEInventoryHandler> implements IMEInventoryHa private boolean hasReadAccess; private boolean hasWriteAccess; - public MEInventoryHandler( IMEInventory i, StorageChannel channel ) + public MEInventoryHandler( final IMEInventory i, final StorageChannel channel ) { this.channel = channel; @@ -74,7 +74,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myWhitelist; } - public void setWhitelist( IncludeExclude myWhitelist ) + public void setWhitelist( final IncludeExclude myWhitelist ) { this.myWhitelist = myWhitelist; } @@ -84,7 +84,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myAccess; } - public void setBaseAccess( AccessRestriction myAccess ) + public void setBaseAccess( final AccessRestriction myAccess ) { this.myAccess = myAccess; this.cachedAccessRestriction = this.myAccess.restrictPermissions( this.internal.getAccess() ); @@ -97,13 +97,13 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myPartitionList; } - public void setPartitionList( IPartitionList myPartitionList ) + public void setPartitionList( final IPartitionList myPartitionList ) { this.myPartitionList = myPartitionList; } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { if( !this.canAccept( input ) ) { @@ -114,7 +114,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { if( !this.hasReadAccess ) { @@ -125,7 +125,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { if( !this.hasReadAccess ) { @@ -148,7 +148,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { if( this.myWhitelist == IncludeExclude.WHITELIST ) { @@ -158,7 +158,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { if( !this.hasWriteAccess ) { @@ -182,7 +182,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myPriority; } - public void setPriority( int myPriority ) + public void setPriority( final int myPriority ) { this.myPriority = myPriority; } @@ -194,7 +194,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/MEMonitorIInventory.java b/src/main/java/appeng/me/storage/MEMonitorIInventory.java index b6e0332a..5a7dbbd0 100644 --- a/src/main/java/appeng/me/storage/MEMonitorIInventory.java +++ b/src/main/java/appeng/me/storage/MEMonitorIInventory.java @@ -54,26 +54,26 @@ public class MEMonitorIInventory implements IMEMonitor public BaseActionSource mySource; public StorageFilter mode = StorageFilter.EXTRACTABLE_ONLY; - public MEMonitorIInventory( InventoryAdaptor adaptor ) + public MEMonitorIInventory( final InventoryAdaptor adaptor ) { this.adaptor = adaptor; this.memory = new ConcurrentSkipListMap(); } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { ItemStack out = null; @@ -97,13 +97,13 @@ public class MEMonitorIInventory implements IMEMonitor } // better then doing construction from scratch :3 - IAEItemStack o = input.copy(); + final IAEItemStack o = input.copy(); o.setStackSize( out.stackSize ); return o; } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable type, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable type, final BaseActionSource src ) { ItemStack out = null; @@ -122,7 +122,7 @@ public class MEMonitorIInventory implements IMEMonitor } // better then doing construction from scratch :3 - IAEItemStack o = request.copy(); + final IAEItemStack o = request.copy(); o.setStackSize( out.stackSize ); if( type == Actionable.MODULATE ) @@ -142,22 +142,22 @@ public class MEMonitorIInventory implements IMEMonitor public TickRateModulation onTick() { - LinkedList changes = new LinkedList(); + final LinkedList changes = new LinkedList(); this.list.resetStatus(); int high = 0; boolean changed = false; - for( ItemSlot is : this.adaptor ) + for( final ItemSlot is : this.adaptor ) { - CachedItemStack old = this.memory.get( is.slot ); + final CachedItemStack old = this.memory.get( is.slot ); high = Math.max( high, is.slot ); - ItemStack newIS = !is.isExtractable && this.mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); - ItemStack oldIS = old == null ? null : old.itemStack; + final ItemStack newIS = !is.isExtractable && this.mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); + final ItemStack oldIS = old == null ? null : old.itemStack; if( this.isDifferent( newIS, oldIS ) ) { - CachedItemStack cis = new CachedItemStack( is.getItemStack() ); + final CachedItemStack cis = new CachedItemStack( is.getItemStack() ); this.memory.put( is.slot, cis ); if( old != null && old.aeStack != null ) @@ -176,10 +176,10 @@ public class MEMonitorIInventory implements IMEMonitor } else { - int newSize = ( newIS == null ? 0 : newIS.stackSize ); - int diff = newSize - ( oldIS == null ? 0 : oldIS.stackSize ); + final int newSize = ( newIS == null ? 0 : newIS.stackSize ); + final int diff = newSize - ( oldIS == null ? 0 : oldIS.stackSize ); - IAEItemStack stack = ( old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack( newIS ) : old.aeStack.copy() ); + final IAEItemStack stack = ( old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack( newIS ) : old.aeStack.copy() ); if( stack != null ) { stack.setStackSize( newSize ); @@ -188,10 +188,10 @@ public class MEMonitorIInventory implements IMEMonitor if( diff != 0 && stack != null ) { - CachedItemStack cis = new CachedItemStack( is.getItemStack() ); + final CachedItemStack cis = new CachedItemStack( is.getItemStack() ); this.memory.put( is.slot, cis ); - IAEItemStack a = stack.copy(); + final IAEItemStack a = stack.copy(); a.setStackSize( diff ); changes.add( a ); changed = true; @@ -200,14 +200,14 @@ public class MEMonitorIInventory implements IMEMonitor } // detect dropped items; should fix non IISided Inventory Changes. - NavigableMap end = this.memory.tailMap( high, false ); + final NavigableMap end = this.memory.tailMap( high, false ); if( !end.isEmpty() ) { - for( CachedItemStack cis : end.values() ) + for( final CachedItemStack cis : end.values() ) { if( cis != null && cis.aeStack != null ) { - IAEItemStack a = cis.aeStack.copy(); + final IAEItemStack a = cis.aeStack.copy(); a.setStackSize( -a.getStackSize() ); changes.add( a ); changed = true; @@ -224,7 +224,7 @@ public class MEMonitorIInventory implements IMEMonitor return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER; } - private boolean isDifferent( ItemStack a, ItemStack b ) + private boolean isDifferent( final ItemStack a, final ItemStack b ) { if( a == b && b == null ) { @@ -239,16 +239,16 @@ public class MEMonitorIInventory implements IMEMonitor return !Platform.isSameItemPrecise( a, b ); } - private void postDifference( Iterable a ) + private void postDifference( final Iterable a ) { // AELog.info( a.getItemStack().getUnlocalizedName() + " @ " + a.getStackSize() ); if( a != null ) { - Iterator, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> l = i.next(); - IMEMonitorHandlerReceiver key = l.getKey(); + final Entry, Object> l = i.next(); + final IMEMonitorHandlerReceiver key = l.getKey(); if( key.isValid( l.getValue() ) ) { key.postChange( this, a, this.mySource ); @@ -268,13 +268,13 @@ public class MEMonitorIInventory implements IMEMonitor } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return true; } @@ -292,15 +292,15 @@ public class MEMonitorIInventory implements IMEMonitor } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( CachedItemStack is : this.memory.values() ) + for( final CachedItemStack is : this.memory.values() ) { out.addStorage( is.aeStack ); } @@ -320,7 +320,7 @@ public class MEMonitorIInventory implements IMEMonitor final ItemStack itemStack; final IAEItemStack aeStack; - public CachedItemStack( ItemStack is ) + public CachedItemStack( final ItemStack is ) { if( is == null ) { diff --git a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java index dd0940b7..dfc054c0 100644 --- a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java +++ b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java @@ -42,7 +42,7 @@ public class MEMonitorPassThrough> extends MEPassThrough monitor; - public MEMonitorPassThrough( IMEInventory i, StorageChannel channel ) + public MEMonitorPassThrough( final IMEInventory i, final StorageChannel channel ) { super( i, channel ); if( i instanceof IMEMonitor ) @@ -52,7 +52,7 @@ public class MEMonitorPassThrough> extends MEPassThrough i ) + public void setInternal( final IMEInventory i ) { if( this.monitor != null ) { @@ -60,7 +60,7 @@ public class MEMonitorPassThrough> extends MEPassThrough before = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); + final IItemList before = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); super.setInternal( i ); if( i instanceof IMEMonitor ) @@ -68,7 +68,7 @@ public class MEMonitorPassThrough> extends MEPassThrough) i; } - IItemList after = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); + final IItemList after = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); if( this.monitor != null ) { @@ -79,20 +79,20 @@ public class MEMonitorPassThrough> extends MEPassThrough getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { super.getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @@ -102,7 +102,7 @@ public class MEMonitorPassThrough> extends MEPassThrough out = this.channel.createList(); + final IItemList out = this.channel.createList(); this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } @@ -110,19 +110,19 @@ public class MEMonitorPassThrough> extends MEPassThrough monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { - Iterator, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver receiver = e.getKey(); + final Entry, Object> e = i.next(); + final IMEMonitorHandlerReceiver receiver = e.getKey(); if( receiver.isValid( e.getValue() ) ) { receiver.postChange( this, change, source ); @@ -137,11 +137,11 @@ public class MEMonitorPassThrough> extends MEPassThrough, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver receiver = e.getKey(); + final Entry, Object> e = i.next(); + final IMEMonitorHandlerReceiver receiver = e.getKey(); if( receiver.isValid( e.getValue() ) ) { receiver.onListUpdate(); diff --git a/src/main/java/appeng/me/storage/MEPassThrough.java b/src/main/java/appeng/me/storage/MEPassThrough.java index c3dde45d..e5e4bcc3 100644 --- a/src/main/java/appeng/me/storage/MEPassThrough.java +++ b/src/main/java/appeng/me/storage/MEPassThrough.java @@ -35,7 +35,7 @@ public class MEPassThrough> implements IMEInventoryHandler protected final StorageChannel channel; private IMEInventory internal; - public MEPassThrough( IMEInventory i, StorageChannel channel ) + public MEPassThrough( final IMEInventory i, final StorageChannel channel ) { this.channel = channel; this.setInternal( i ); @@ -46,25 +46,25 @@ public class MEPassThrough> implements IMEInventoryHandler return this.internal; } - public void setInternal( IMEInventory i ) + public void setInternal( final IMEInventory i ) { this.internal = i; } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { return this.internal.injectItems( input, type, src ); } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { return this.internal.extractItems( request, type, src ); } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return this.internal.getAvailableItems( out ); } @@ -82,13 +82,13 @@ public class MEPassThrough> implements IMEInventoryHandler } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return true; } @@ -106,7 +106,7 @@ public class MEPassThrough> implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java index 4de3f971..729baa36 100644 --- a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java +++ b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java @@ -53,7 +53,7 @@ public class NetworkInventoryHandler> implements IMEInvent { @Override - public int compare( Integer o1, Integer o2 ) + public int compare( final Integer o1, final Integer o2 ) { return ItemSorters.compareInt( o2, o1 ); } @@ -65,7 +65,7 @@ public class NetworkInventoryHandler> implements IMEInvent private final NavigableMap>> priorityInventory; int myPass = 0; - public NetworkInventoryHandler( StorageChannel chan, SecurityCache security ) + public NetworkInventoryHandler( final StorageChannel chan, final SecurityCache security ) { this.myChannel = chan; this.security = security; @@ -74,9 +74,9 @@ public class NetworkInventoryHandler> implements IMEInvent // hashSorter ); } - public void addNewStorage( IMEInventoryHandler h ) + public void addNewStorage( final IMEInventoryHandler h ) { - int priority = h.getPriority(); + final int priority = h.getPriority(); List> list = this.priorityInventory.get( priority ); if( list == null ) { @@ -87,7 +87,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( T input, final Actionable type, final BaseActionSource src ) { if( this.diveList( this, type ) ) { @@ -100,12 +100,12 @@ public class NetworkInventoryHandler> implements IMEInvent return input; } - for( List> invList : this.priorityInventory.values() ) + for( final List> invList : this.priorityInventory.values() ) { Iterator> ii = invList.iterator(); while( ii.hasNext() && input != null ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); if( inv.validForPass( 1 ) && inv.canAccept( input ) && ( inv.isPrioritized( input ) || inv.extractItems( input, Actionable.SIMULATE, src ) != null ) ) { @@ -120,7 +120,7 @@ public class NetworkInventoryHandler> implements IMEInvent ii = invList.iterator(); while( ii.hasNext() && input != null ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); if( inv.validForPass( 2 ) && inv.canAccept( input ) && !inv.isPrioritized( input ) ) { @@ -134,9 +134,9 @@ public class NetworkInventoryHandler> implements IMEInvent return input; } - private boolean diveList( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private boolean diveList( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { - LinkedList cDepth = this.getDepth( type ); + final LinkedList cDepth = this.getDepth( type ); if( cDepth.contains( networkInventoryHandler ) ) { return true; @@ -146,7 +146,7 @@ public class NetworkInventoryHandler> implements IMEInvent return false; } - private boolean testPermission( BaseActionSource src, SecurityPermissions permission ) + private boolean testPermission( final BaseActionSource src, final SecurityPermissions permission ) { if( src.isPlayer() ) { @@ -159,18 +159,18 @@ public class NetworkInventoryHandler> implements IMEInvent { if( this.security.isAvailable() ) { - IGridNode n = ( (MachineSource) src ).via.getActionableNode(); + final IGridNode n = ( (MachineSource) src ).via.getActionableNode(); if( n == null ) { return true; } - IGrid gn = n.getGrid(); + final IGrid gn = n.getGrid(); if( gn != this.security.myGrid ) { - ISecurityGrid sg = gn.getCache( ISecurityGrid.class ); - int playerID = sg.getOwner(); + final ISecurityGrid sg = gn.getCache( ISecurityGrid.class ); + final int playerID = sg.getOwner(); if( !this.security.hasPermission( playerID, permission ) ) { @@ -183,7 +183,7 @@ public class NetworkInventoryHandler> implements IMEInvent return false; } - private void surface( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private void surface( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { if( this.getDepth( type ).pop() != this ) { @@ -191,9 +191,9 @@ public class NetworkInventoryHandler> implements IMEInvent } } - private LinkedList getDepth( Actionable type ) + private LinkedList getDepth( final Actionable type ) { - ThreadLocal depth = type == Actionable.MODULATE ? DEPTH_MOD : DEPTH_SIM; + final ThreadLocal depth = type == Actionable.MODULATE ? DEPTH_MOD : DEPTH_SIM; LinkedList s = depth.get(); @@ -206,7 +206,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( T request, final Actionable mode, final BaseActionSource src ) { if( this.diveList( this, mode ) ) { @@ -219,21 +219,21 @@ public class NetworkInventoryHandler> implements IMEInvent return null; } - Iterator>> i = this.priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); + final Iterator>> i = this.priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); - T output = request.copy(); + final T output = request.copy(); request = request.copy(); output.setStackSize( 0 ); - long req = request.getStackSize(); + final long req = request.getStackSize(); while( i.hasNext() ) { - List> invList = i.next(); + final List> invList = i.next(); - Iterator> ii = invList.iterator(); + final Iterator> ii = invList.iterator(); while( ii.hasNext() && output.getStackSize() < req ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); request.setStackSize( req - output.getStackSize() ); output.add( inv.extractItems( request, mode, src ) ); @@ -259,9 +259,9 @@ public class NetworkInventoryHandler> implements IMEInvent } // for (Entry> h : priorityInventory.entries()) - for( List> i : this.priorityInventory.values() ) + for( final List> i : this.priorityInventory.values() ) { - for( IMEInventoryHandler j : i ) + for( final IMEInventoryHandler j : i ) { out = j.getAvailableItems( out ); } @@ -272,9 +272,9 @@ public class NetworkInventoryHandler> implements IMEInvent return out; } - private boolean diveIteration( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private boolean diveIteration( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { - LinkedList cDepth = this.getDepth( type ); + final LinkedList cDepth = this.getDepth( type ); if( cDepth.isEmpty() ) { currentPass++; @@ -309,13 +309,13 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return true; } @@ -333,7 +333,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/NullInventory.java b/src/main/java/appeng/me/storage/NullInventory.java index 833bba4f..f674a192 100644 --- a/src/main/java/appeng/me/storage/NullInventory.java +++ b/src/main/java/appeng/me/storage/NullInventory.java @@ -32,19 +32,19 @@ public class NullInventory> implements IMEInventoryHandler { @Override - public T injectItems( T input, Actionable mode, BaseActionSource src ) + public T injectItems( final T input, final Actionable mode, final BaseActionSource src ) { return input; } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( final T request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -62,13 +62,13 @@ public class NullInventory> implements IMEInventoryHandler } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return false; } @@ -86,7 +86,7 @@ public class NullInventory> implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/me/storage/SecurityInventory.java b/src/main/java/appeng/me/storage/SecurityInventory.java index fa2efcc2..3e448aa3 100644 --- a/src/main/java/appeng/me/storage/SecurityInventory.java +++ b/src/main/java/appeng/me/storage/SecurityInventory.java @@ -42,13 +42,13 @@ public class SecurityInventory implements IMEInventoryHandler public final IItemList storedItems = AEApi.instance().storage().createItemList(); final TileSecurity securityTile; - public SecurityInventory( TileSecurity ts ) + public SecurityInventory( final TileSecurity ts ) { this.securityTile = ts; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.hasPermission( src ) ) { @@ -70,7 +70,7 @@ public class SecurityInventory implements IMEInventoryHandler return input; } - private boolean hasPermission( BaseActionSource src ) + private boolean hasPermission( final BaseActionSource src ) { if( src.isPlayer() ) { @@ -78,7 +78,7 @@ public class SecurityInventory implements IMEInventoryHandler { return this.securityTile.getProxy().getSecurity().hasPermission( ( (PlayerSource) src ).player, SecurityPermissions.SECURITY ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -87,14 +87,14 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( this.hasPermission( src ) ) { - IAEItemStack target = this.storedItems.findPrecise( request ); + final IAEItemStack target = this.storedItems.findPrecise( request ); if( target != null ) { - IAEItemStack output = target.copy(); + final IAEItemStack output = target.copy(); if( mode == Actionable.SIMULATE ) { @@ -110,9 +110,9 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack ais : this.storedItems ) + for( final IAEItemStack ais : this.storedItems ) { out.add( ais ); } @@ -133,30 +133,30 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { if( input.getItem() instanceof IBiometricCard ) { - IBiometricCard tbc = (IBiometricCard) input.getItem(); - GameProfile newUser = tbc.getProfile( input.getItemStack() ); + final IBiometricCard tbc = (IBiometricCard) input.getItem(); + final GameProfile newUser = tbc.getProfile( input.getItemStack() ); - int PlayerID = AEApi.instance().registries().players().getID( newUser ); + final int PlayerID = AEApi.instance().registries().players().getID( newUser ); if( this.securityTile.getOwner() == PlayerID ) { return false; } - for( IAEItemStack ais : this.storedItems ) + for( final IAEItemStack ais : this.storedItems ) { if( ais.isMeaningful() ) { - GameProfile thisUser = tbc.getProfile( ais.getItemStack() ); + final GameProfile thisUser = tbc.getProfile( ais.getItemStack() ); if( thisUser == newUser ) { return false; @@ -187,7 +187,7 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/VoidFluidInventory.java b/src/main/java/appeng/me/storage/VoidFluidInventory.java index 045ab04c..3cab7082 100644 --- a/src/main/java/appeng/me/storage/VoidFluidInventory.java +++ b/src/main/java/appeng/me/storage/VoidFluidInventory.java @@ -34,13 +34,13 @@ public class VoidFluidInventory implements IMEInventoryHandler final TileCondenser target; - public VoidFluidInventory( TileCondenser te ) + public VoidFluidInventory( final TileCondenser te ) { this.target = te; } @Override - public IAEFluidStack injectItems( IAEFluidStack input, Actionable mode, BaseActionSource src ) + public IAEFluidStack injectItems( final IAEFluidStack input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -55,13 +55,13 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public IAEFluidStack extractItems( IAEFluidStack request, Actionable mode, BaseActionSource src ) + public IAEFluidStack extractItems( final IAEFluidStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -79,13 +79,13 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEFluidStack input ) + public boolean isPrioritized( final IAEFluidStack input ) { return false; } @Override - public boolean canAccept( IAEFluidStack input ) + public boolean canAccept( final IAEFluidStack input ) { return true; } @@ -103,7 +103,7 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/me/storage/VoidItemInventory.java b/src/main/java/appeng/me/storage/VoidItemInventory.java index 2ed92610..5400e75b 100644 --- a/src/main/java/appeng/me/storage/VoidItemInventory.java +++ b/src/main/java/appeng/me/storage/VoidItemInventory.java @@ -34,13 +34,13 @@ public class VoidItemInventory implements IMEInventoryHandler final TileCondenser target; - public VoidItemInventory( TileCondenser te ) + public VoidItemInventory( final TileCondenser te ) { this.target = te; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -55,13 +55,13 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -79,13 +79,13 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return true; } @@ -103,7 +103,7 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index d71df56d..8e483eef 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -85,7 +85,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, protected IPartHost host = null; protected ForgeDirection side = null; - public AEBasePart( ItemStack is ) + public AEBasePart( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -100,13 +100,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.proxy.getNode(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.GLASS; } @@ -116,7 +116,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, { if( this.is.stackSize > 0 ) { - List items = new ArrayList(); + final List items = new ArrayList(); items.add( this.is.copy() ); this.host.removePart( this.side, false ); Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items ); @@ -134,20 +134,20 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return 0; } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setBounds( 1, 1, 1, 15, 15, 15 ); rh.renderInventoryBox( renderer ); @@ -199,7 +199,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setBounds( 1, 1, 1, 15, 15, 15 ); rh.renderBlock( x, y, z, renderer ); @@ -211,24 +211,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return this.is.hasDisplayName(); } - public void addEntityCrashInfo( CrashReportCategory crashreportcategory ) + public void addEntityCrashInfo( final CrashReportCategory crashreportcategory ) { crashreportcategory.addCrashSection( "Part Side", this.side ); } @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer ) { } @Override - public ItemStack getItemStack( PartItemStack type ) + public ItemStack getItemStack( final PartItemStack type ) { if( type == PartItemStack.Network ) { - ItemStack copy = this.is.copy(); + final ItemStack copy = this.is.copy(); copy.setTagCompound( null ); return copy; } @@ -254,13 +254,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.proxy.readFromNBT( data ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { this.proxy.writeToNBT( data ); } @@ -278,13 +278,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { return false; } @@ -296,7 +296,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { } @@ -314,7 +314,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final ForgeDirection side, final IPartHost host, final TileEntity tile ) { this.side = side; this.tile = tile; @@ -329,7 +329,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { } @@ -341,7 +341,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { } @@ -353,7 +353,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return false; } @@ -365,7 +365,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return null; } @@ -376,11 +376,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, * @param from source of settings * @param compound compound of source */ - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( compound != null ) { - IConfigManager cm = this.getConfigManager(); + final IConfigManager cm = this.getConfigManager(); if( cm != null ) { cm.readFromNBT( compound ); @@ -389,15 +389,15 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; pHost.setPriority( compound.getInteger( "priority" ) ); } - IInventory inv = this.getInventoryByName( "config" ); + final IInventory inv = this.getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { - AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; - AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); + final AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; + final AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); tmp.readFromNBT( compound, "config" ); for( int x = 0; x < tmp.getSizeInventory(); x++ ) { @@ -413,11 +413,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, * * @return compound of source */ - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { - NBTTagCompound output = new NBTTagCompound(); + final NBTTagCompound output = new NBTTagCompound(); - IConfigManager cm = this.getConfigManager(); + final IConfigManager cm = this.getConfigManager(); if( cm != null ) { cm.writeToNBT( output ); @@ -425,11 +425,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; output.setInteger( "priority", pHost.getPriority() ); } - IInventory inv = this.getInventoryByName( "config" ); + final IInventory inv = this.getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { ( (AppEngInternalAEInventory) inv ).writeToNBT( output, "config" ); @@ -443,13 +443,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return true; } - private boolean useMemoryCard( EntityPlayer player ) + private boolean useMemoryCard( final EntityPlayer player ) { - ItemStack memCardIS = player.inventory.getCurrentItem(); + final ItemStack memCardIS = player.inventory.getCurrentItem(); if( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) { - IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); + final IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); ItemStack is = this.getItemStack( PartItemStack.Network ); @@ -457,17 +457,17 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, final IDefinitions definitions = AEApi.instance().definitions(); if( definitions.parts().iface().isSameAs( is ) ) { - for( ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() ) + for( final ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() ) { is = iface; } } - String name = is.getUnlocalizedName(); + final String name = is.getUnlocalizedName(); if( player.isSneaking() ) { - NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD ); + final NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD ); if( data != null ) { memoryCard.setMemoryCardContents( memCardIS, name, data ); @@ -476,8 +476,8 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } else { - String storedName = memoryCard.getSettingsName( memCardIS ); - NBTTagCompound data = memoryCard.getData( memCardIS ); + final String storedName = memoryCard.getSettingsName( memCardIS ); + final NBTTagCompound data = memoryCard.getData( memCardIS ); if( name.equals( storedName ) ) { this.uploadSettings( SettingsFrom.MEMORY_CARD, data ); @@ -494,7 +494,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public final boolean onActivate( EntityPlayer player, Vec3 pos ) + public final boolean onActivate( final EntityPlayer player, final Vec3 pos ) { if( this.useMemoryCard( player ) ) { @@ -505,7 +505,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public final boolean onShiftActivate( EntityPlayer player, Vec3 pos ) + public final boolean onShiftActivate( final EntityPlayer player, final Vec3 pos ) { if( this.useMemoryCard( player ) ) { @@ -515,24 +515,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return this.onPartShiftActivate( player, pos ); } - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { return false; } - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { this.proxy.setOwner( player ); } @Override - public boolean canBePlacedOn( BusSupport what ) + public boolean canBePlacedOn( final BusSupport what ) { return what == BusSupport.CABLE; } diff --git a/src/main/java/appeng/parts/BusCollisionHelper.java b/src/main/java/appeng/parts/BusCollisionHelper.java index 85ca8353..2a4af32a 100644 --- a/src/main/java/appeng/parts/BusCollisionHelper.java +++ b/src/main/java/appeng/parts/BusCollisionHelper.java @@ -40,7 +40,7 @@ public class BusCollisionHelper implements IPartCollisionHelper private final Entity entity; private final boolean isVisual; - public BusCollisionHelper( List boxes, ForgeDirection x, ForgeDirection y, ForgeDirection z, Entity e, boolean visual ) + public BusCollisionHelper( final List boxes, final ForgeDirection x, final ForgeDirection y, final ForgeDirection z, final Entity e, final boolean visual ) { this.boxes = boxes; this.x = x; @@ -50,7 +50,7 @@ public class BusCollisionHelper implements IPartCollisionHelper this.isVisual = visual; } - public BusCollisionHelper( List boxes, ForgeDirection s, Entity e, boolean visual ) + public BusCollisionHelper( final List boxes, final ForgeDirection s, final Entity e, final boolean visual ) { this.boxes = boxes; this.entity = e; diff --git a/src/main/java/appeng/parts/CableBusContainer.java b/src/main/java/appeng/parts/CableBusContainer.java index 2b43b1cd..3a5c358a 100644 --- a/src/main/java/appeng/parts/CableBusContainer.java +++ b/src/main/java/appeng/parts/CableBusContainer.java @@ -82,18 +82,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public boolean requiresDynamicRender = false; boolean inWorld = false; - public CableBusContainer( IPartHost host ) + public CableBusContainer( final IPartHost host ) { this.tcb = host; } public static boolean isLoading() { - Boolean is = IS_LOADING.get(); + final Boolean is = IS_LOADING.get(); return is != null && is; } - public void setHost( IPartHost host ) + public void setHost( final IPartHost host ) { this.tcb.clearContainer(); this.tcb = host; @@ -101,7 +101,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public void rotateLeft() { - IPart[] newSides = new IPart[6]; + final IPart[] newSides = new IPart[6]; newSides[ForgeDirection.UP.ordinal()] = this.getSide( ForgeDirection.UP ); newSides[ForgeDirection.DOWN.ordinal()] = this.getSide( ForgeDirection.DOWN ); @@ -111,7 +111,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I newSides[ForgeDirection.WEST.ordinal()] = this.getSide( ForgeDirection.SOUTH ); newSides[ForgeDirection.NORTH.ordinal()] = this.getSide( ForgeDirection.WEST ); - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { this.setSide( dir, newSides[dir.ordinal()] ); } @@ -126,7 +126,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean canAddPart( ItemStack is, ForgeDirection side ) + public boolean canAddPart( ItemStack is, final ForgeDirection side ) { if( PartPlacement.isFacade( is, side ) != null ) { @@ -135,18 +135,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( is.getItem() instanceof IPartItem ) { - IPartItem bi = (IPartItem) is.getItem(); + final IPartItem bi = (IPartItem) is.getItem(); is = is.copy(); is.stackSize = 1; - IPart bp = bi.createPartFromItemStack( is ); + final IPart bp = bi.createPartFromItemStack( is ); if( bp != null ) { if( bp instanceof IPartCable ) { boolean canPlace = true; - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) ) { @@ -163,7 +163,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else if( !( bp instanceof IPartCable ) && side != ForgeDirection.UNKNOWN ) { - IPart cable = this.getPart( ForgeDirection.UNKNOWN ); + final IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) ) { return false; @@ -177,22 +177,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer player ) + public ForgeDirection addPart( ItemStack is, final ForgeDirection side, final EntityPlayer player ) { if( this.canAddPart( is, side ) ) { if( is.getItem() instanceof IPartItem ) { - IPartItem bi = (IPartItem) is.getItem(); + final IPartItem bi = (IPartItem) is.getItem(); is = is.copy(); is.stackSize = 1; - IPart bp = bi.createPartFromItemStack( is ); + final IPart bp = bi.createPartFromItemStack( is ); if( bp instanceof IPartCable ) { boolean canPlace = true; - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) ) { @@ -223,22 +223,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I bp.addToWorld(); } - IGridNode cn = this.getCenter().getGridNode(); + final IGridNode cn = this.getCenter().getGridNode(); if( cn != null ) { - for( ForgeDirection ins : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection ins : ForgeDirection.VALID_DIRECTIONS ) { - IPart sbp = this.getPart( ins ); + final IPart sbp = this.getPart( ins ); if( sbp != null ) { - IGridNode sn = sbp.getGridNode(); + final IGridNode sn = sbp.getGridNode(); if( sn != null ) { try { new GridConnection( cn, sn, ForgeDirection.UNKNOWN ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk! @@ -259,7 +259,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else if( bp != null && !( bp instanceof IPartCable ) && side != ForgeDirection.UNKNOWN ) { - IPart cable = this.getPart( ForgeDirection.UNKNOWN ); + final IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) ) { return null; @@ -280,8 +280,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( this.getCenter() != null ) { - IGridNode cn = this.getCenter().getGridNode(); - IGridNode sn = bp.getGridNode(); + final IGridNode cn = this.getCenter().getGridNode(); + final IGridNode sn = bp.getGridNode(); if( cn != null && sn != null ) { @@ -289,7 +289,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { new GridConnection( cn, sn, ForgeDirection.UNKNOWN ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk! @@ -313,7 +313,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { if( side == ForgeDirection.UNKNOWN ) { @@ -323,7 +323,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public void removePart( ForgeDirection side, boolean suppressUpdate ) + public void removePart( final ForgeDirection side, final boolean suppressUpdate ) { if( side == ForgeDirection.UNKNOWN ) { @@ -375,7 +375,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() != null ) { - IPartCable c = this.getCenter(); + final IPartCable c = this.getCenter(); return c.getCableColor(); } return AEColor.Transparent; @@ -388,22 +388,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean isBlocked( ForgeDirection side ) + public boolean isBlocked( final ForgeDirection side ) { return this.tcb.isBlocked( side ); } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); p.getBoxes( bch ); for( AxisAlignedBB bb : boxes ) { @@ -418,15 +418,15 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades ) { - IFacadeContainer fc = this.getFacadeContainer(); - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { - IFacadePart p = fc.getFacade( side ); + final IFacadePart p = fc.getFacade( side ); if( p != null ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); p.getBoxes( bch, null ); for( AxisAlignedBB bb : boxes ) { @@ -454,12 +454,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() == null ) { - List facades = new LinkedList(); + final List facades = new LinkedList(); - IFacadeContainer fc = this.getFacadeContainer(); - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { - IFacadePart fp = fc.getFacade( d ); + final IFacadePart fp = fc.getFacade( d ); if( fp != null ) { facades.add( fp.getItemStack() ); @@ -469,7 +469,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( !facades.isEmpty() ) { - TileEntity te = this.tcb.getTile(); + final TileEntity te = this.tcb.getTile(); Platform.spawnDrops( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, facades ); } } @@ -478,7 +478,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean hasRedstone( ForgeDirection side ) + public boolean hasRedstone( final ForgeDirection side ) { if( this.hasRedstone == YesNo.UNDECIDED ) { @@ -491,10 +491,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean isEmpty() { - IFacadeContainer fc = this.getFacadeContainer(); - for( ForgeDirection s : ForgeDirection.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { return false; @@ -502,7 +502,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != ForgeDirection.UNKNOWN ) { - IFacadePart fp = fc.getFacade( s ); + final IFacadePart fp = fc.getFacade( s ); if( fp != null ) { return false; @@ -538,16 +538,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I private void updateRedstone() { - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); this.hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO; } public void updateDynamicRender() { this.requiresDynamicRender = false; - for( ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) { - IPart p = this.getPart( s ); + final IPart p = this.getPart( s ); if( p != null ) { this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender(); @@ -562,9 +562,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() != null ) { - EnumSet sides = EnumSet.allOf( ForgeDirection.class ); + final EnumSet sides = EnumSet.allOf( ForgeDirection.class ); - for( ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection s : ForgeDirection.VALID_DIRECTIONS ) { if( this.getPart( s ) != null || this.isBlocked( s ) ) { @@ -573,7 +573,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } this.getCenter().setValidSides( sides ); - IGridNode n = this.getCenter().getGridNode(); + final IGridNode n = this.getCenter().getGridNode(); if( n != null ) { n.updateState(); @@ -591,13 +591,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.inWorld = true; IS_LOADING.set( true ); - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); // start with the center, then install the side parts into the grid. for( int x = 6; x >= 0; x-- ) { - ForgeDirection s = ForgeDirection.getOrientation( x ); - IPart part = this.getPart( s ); + final ForgeDirection s = ForgeDirection.getOrientation( x ); + final IPart part = this.getPart( s ); if( part != null ) { @@ -606,24 +606,24 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != ForgeDirection.UNKNOWN ) { - IGridNode sn = part.getGridNode(); + final IGridNode sn = part.getGridNode(); if( sn != null ) { // this is a really stupid if statement, why was this // here? // if ( !sn.getConnections().iterator().hasNext() ) - IPart center = this.getPart( ForgeDirection.UNKNOWN ); + final IPart center = this.getPart( ForgeDirection.UNKNOWN ); if( center != null ) { - IGridNode cn = center.getGridNode(); + final IGridNode cn = center.getGridNode(); if( cn != null ) { try { AEApi.instance().createGridConnection( cn, sn ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk } @@ -648,9 +648,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.inWorld = false; - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.removeFromWorld(); @@ -661,12 +661,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public IGridNode getGridNode( ForgeDirection side ) + public IGridNode getGridNode( final ForgeDirection side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); if( part != null ) { - IGridNode n = part.getExternalFacingNode(); + final IGridNode n = part.getExternalFacingNode(); if( n != null ) { return n; @@ -682,12 +682,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IGridHost ) { - AECableType t = ( (IGridHost) part ).getCableConnectionType( dir ); + final AECableType t = ( (IGridHost) part ).getCableConnectionType( dir ); if( t != null && t != AECableType.NONE ) { return t; @@ -696,7 +696,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( this.getCenter() != null ) { - IPartCable c = this.getCenter(); + final IPartCable c = this.getCenter(); return c.getCableConnectionType(); } return AECableType.NONE; @@ -705,9 +705,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public void securityBreak() { - for( ForgeDirection d : ForgeDirection.values() ) + for( final ForgeDirection d : ForgeDirection.values() ) { - IPart p = this.getPart( d ); + final IPart p = this.getPart( d ); if( p instanceof IGridHost ) { ( (IGridHost) p ).securityBreak(); @@ -715,16 +715,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - public Iterable getSelectedBoundingBoxesFromPool( boolean ignoreConnections, boolean includeFacades, Entity e, boolean visual ) + public Iterable getSelectedBoundingBoxesFromPool( final boolean ignoreConnections, final boolean includeFacades, final Entity e, final boolean visual ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IFacadeContainer fc = this.getFacadeContainer(); - for( ForgeDirection s : ForgeDirection.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final ForgeDirection s : ForgeDirection.values() ) { - IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual ); - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { if( ignoreConnections && part instanceof IPartCable ) @@ -741,7 +741,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( includeFacades && s != null && s != ForgeDirection.UNKNOWN ) { - IFacadePart fp = fc.getFacade( s ); + final IFacadePart fp = fc.getFacade( s ); if( fp != null ) { fp.getBoxes( bch, e ); @@ -754,25 +754,25 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public int isProvidingStrongPower( ForgeDirection side ) + public int isProvidingStrongPower( final ForgeDirection side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null ? part.isProvidingStrongPower() : 0; } @Override - public int isProvidingWeakPower( ForgeDirection side ) + public int isProvidingWeakPower( final ForgeDirection side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null ? part.isProvidingWeakPower() : 0; } @Override - public boolean canConnectRedstone( EnumSet enumSet ) + public boolean canConnectRedstone( final EnumSet enumSet ) { - for( ForgeDirection dir : enumSet ) + for( final ForgeDirection dir : enumSet ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part != null && part.canConnectRedstone() ) { return true; @@ -782,11 +782,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.onEntityCollision( entity ); @@ -795,9 +795,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean activate( EntityPlayer player, Vec3 pos ) + public boolean activate( final EntityPlayer player, final Vec3 pos ) { - SelectedPart p = this.selectPart( pos ); + final SelectedPart p = this.selectPart( pos ); if( p != null && p.part != null ) { return p.part.onActivate( player, pos ); @@ -810,9 +810,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { this.hasRedstone = YesNo.UNDECIDED; - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.onNeighborChanged(); @@ -821,7 +821,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean isSolidOnSide( ForgeDirection side ) + public boolean isSolidOnSide( final ForgeDirection side ) { if( side == null || side == ForgeDirection.UNKNOWN ) { @@ -829,23 +829,23 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } // facades are solid.. - IFacadePart fp = this.getFacadeContainer().getFacade( side ); + final IFacadePart fp = this.getFacadeContainer().getFacade( side ); if( fp != null ) { return true; } // buses can be too. - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null && part.isSolid(); } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { if( p.isLadder( entity ) ) @@ -859,11 +859,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { - for( ForgeDirection side : ForgeDirection.values() ) + for( final ForgeDirection side : ForgeDirection.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { p.randomDisplayTick( world, x, y, z, r ); @@ -876,9 +876,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { int light = 0; - for( ForgeDirection d : ForgeDirection.values() ) + for( final ForgeDirection d : ForgeDirection.values() ) { - IPart p = this.getPart( d ); + final IPart p = this.getPart( d ); if( p != null ) { light = Math.max( p.getLightLevel(), light ); @@ -894,23 +894,23 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @SideOnly( Side.CLIENT ) - public void renderStatic( double x, double y, double z ) + public void renderStatic( final double x, final double y, final double z ) { CableRenderHelper.getInstance().renderStatic( this, this.getFacadeContainer() ); } @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z ) + public void renderDynamic( final double x, final double y, final double z ) { CableRenderHelper.getInstance().renderDynamic( this, x, y, z ); } - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { int sides = 0; for( int x = 0; x < 7; x++ ) { - IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); + final IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); if( p != null ) { sides |= ( 1 << x ); @@ -921,10 +921,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I for( int x = 0; x < 7; x++ ) { - IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); + final IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); if( p != null ) { - ItemStack is = p.getItemStack( PartItemStack.Network ); + final ItemStack is = p.getItemStack( PartItemStack.Network ); data.writeShort( Item.getIdFromItem( is.getItem() ) ); data.writeShort( is.getItemDamage() ); @@ -936,9 +936,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.getFacadeContainer().writeToStream( data ); } - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - byte sides = data.readByte(); + final byte sides = data.readByte(); boolean updateBlock = false; @@ -949,12 +949,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { IPart p = this.getPart( side ); - short itemID = data.readShort(); - short dmgValue = data.readShort(); + final short itemID = data.readShort(); + final short dmgValue = data.readShort(); - Item myItem = Item.getItemById( itemID ); + final Item myItem = Item.getItemById( itemID ); - ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null; + final ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null; if( current != null && current.getItem() == myItem && current.getItemDamage() == dmgValue ) { if( p.readFromStream( data ) ) @@ -991,22 +991,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return updateBlock; } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { data.setInteger( "hasRedstone", this.hasRedstone.ordinal() ); - IFacadeContainer fc = this.getFacadeContainer(); - for( ForgeDirection s : ForgeDirection.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final ForgeDirection s : ForgeDirection.values() ) { fc.writeToNBT( data ); - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { - NBTTagCompound def = new NBTTagCompound(); + final NBTTagCompound def = new NBTTagCompound(); part.getItemStack( PartItemStack.World ).writeToNBT( def ); - NBTTagCompound extra = new NBTTagCompound(); + final NBTTagCompound extra = new NBTTagCompound(); part.writeToNBT( extra ); data.setTag( "def:" + this.getSide( part ).ordinal(), def ); @@ -1015,7 +1015,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - ForgeDirection getSide( IPart part ) + ForgeDirection getSide( final IPart part ) { if( this.getCenter() == part ) { @@ -1023,7 +1023,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else { - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { if( this.getSide( side ) == part ) { @@ -1035,7 +1035,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I throw new IllegalStateException( "Uhh Bad Part (" + part + ") on Side." ); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { if( data.hasKey( "hasRedstone" ) ) { @@ -1046,18 +1046,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { ForgeDirection side = ForgeDirection.getOrientation( x ); - NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() ); - NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() ); + final NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() ); + final NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() ); if( def != null && extra != null ) { IPart p = this.getPart( side ); - ItemStack iss = ItemStack.loadItemStackFromNBT( def ); + final ItemStack iss = ItemStack.loadItemStackFromNBT( def ); if( iss == null ) { continue; } - ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World ); + final ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World ); if( Platform.isSameItemType( iss, current ) ) { @@ -1087,11 +1087,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.getFacadeContainer().readFromNBT( data ); } - public List getDrops( List drops ) + public List getDrops( final List drops ) { - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { drops.add( part.getItemStack( PartItemStack.Break ) ); @@ -1100,7 +1100,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != ForgeDirection.UNKNOWN ) { - IFacadePart fp = this.getFacadeContainer().getFacade( s ); + final IFacadePart fp = this.getFacadeContainer().getFacade( s ); if( fp != null ) { drops.add( fp.getItemStack() ); @@ -1111,11 +1111,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return drops; } - public List getNoDrops( List drops ) + public List getNoDrops( final List drops ) { - for( ForgeDirection s : ForgeDirection.values() ) + for( final ForgeDirection s : ForgeDirection.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.getDrops( drops, false ); @@ -1126,12 +1126,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean recolourBlock( ForgeDirection side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor colour, final EntityPlayer who ) { - IPart cable = this.getPart( ForgeDirection.UNKNOWN ); + final IPart cable = this.getPart( ForgeDirection.UNKNOWN ); if( cable != null ) { - IPartCable pc = (IPartCable) cable; + final IPartCable pc = (IPartCable) cable; return pc.changeColor( colour, who ); } return false; diff --git a/src/main/java/appeng/parts/CableBusStorage.java b/src/main/java/appeng/parts/CableBusStorage.java index 7ada1f74..df042a1f 100644 --- a/src/main/java/appeng/parts/CableBusStorage.java +++ b/src/main/java/appeng/parts/CableBusStorage.java @@ -43,14 +43,14 @@ public class CableBusStorage return this.center; } - protected void setCenter( IPartCable center ) + protected void setCenter( final IPartCable center ) { this.center = center; } - protected IPart getSide( ForgeDirection side ) + protected IPart getSide( final ForgeDirection side ) { - int x = side.ordinal(); + final int x = side.ordinal(); if( this.sides != null && this.sides.length > x ) { return this.sides[x]; @@ -59,9 +59,9 @@ public class CableBusStorage return null; } - protected void setSide( ForgeDirection side, IPart part ) + protected void setSide( final ForgeDirection side, final IPart part ) { - int x = side.ordinal(); + final int x = side.ordinal(); if( this.sides != null && this.sides.length > x && part == null ) { @@ -75,7 +75,7 @@ public class CableBusStorage } } - private T[] shrink( T[] in, boolean parts ) + private T[] shrink( final T[] in, final boolean parts ) { int newSize = -1; for( int x = 0; x < in.length; x++ ) @@ -97,22 +97,22 @@ public class CableBusStorage return in; } - T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); + final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); System.arraycopy( in, 0, newArray, 0, newSize ); return newArray; } - private T[] grow( T[] in, int newValue, boolean parts ) + private T[] grow( final T[] in, final int newValue, final boolean parts ) { if( in != null && in.length > newValue ) { return in; } - int newSize = newValue + 1; + final int newSize = newValue + 1; - T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); + final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); if( in != null ) { System.arraycopy( in, 0, newArray, 0, in.length ); @@ -121,7 +121,7 @@ public class CableBusStorage return newArray; } - public IFacadePart getFacade( int x ) + public IFacadePart getFacade( final int x ) { if( this.facades != null && this.facades.length > x ) { @@ -131,7 +131,7 @@ public class CableBusStorage return null; } - public void setFacade( int x, @Nullable IFacadePart facade ) + public void setFacade( final int x, @Nullable final IFacadePart facade ) { if( this.facades != null && this.facades.length > x && facade == null ) { diff --git a/src/main/java/appeng/parts/NullCableBusContainer.java b/src/main/java/appeng/parts/NullCableBusContainer.java index bb71bab7..568f8be7 100644 --- a/src/main/java/appeng/parts/NullCableBusContainer.java +++ b/src/main/java/appeng/parts/NullCableBusContainer.java @@ -37,31 +37,31 @@ public class NullCableBusContainer implements ICableBusContainer { @Override - public int isProvidingStrongPower( ForgeDirection opposite ) + public int isProvidingStrongPower( final ForgeDirection opposite ) { return 0; } @Override - public int isProvidingWeakPower( ForgeDirection opposite ) + public int isProvidingWeakPower( final ForgeDirection opposite ) { return 0; } @Override - public boolean canConnectRedstone( EnumSet of ) + public boolean canConnectRedstone( final EnumSet of ) { return false; } @Override - public void onEntityCollision( Entity e ) + public void onEntityCollision( final Entity e ) { } @Override - public boolean activate( EntityPlayer player, Vec3 vecFromPool ) + public boolean activate( final EntityPlayer player, final Vec3 vecFromPool ) { return false; } @@ -73,7 +73,7 @@ public class NullCableBusContainer implements ICableBusContainer } @Override - public boolean isSolidOnSide( ForgeDirection side ) + public boolean isSolidOnSide( final ForgeDirection side ) { return false; } @@ -85,25 +85,25 @@ public class NullCableBusContainer implements ICableBusContainer } @Override - public SelectedPart selectPart( Vec3 v3 ) + public SelectedPart selectPart( final Vec3 v3 ) { return new SelectedPart(); } @Override - public boolean recolourBlock( ForgeDirection side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor colour, final EntityPlayer who ) { return false; } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return false; } @Override - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { } diff --git a/src/main/java/appeng/parts/PartBasicState.java b/src/main/java/appeng/parts/PartBasicState.java index ca0f65a1..e16731a5 100644 --- a/src/main/java/appeng/parts/PartBasicState.java +++ b/src/main/java/appeng/parts/PartBasicState.java @@ -50,26 +50,26 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel protected int clientFlags = 0; // sent as byte. - public PartBasicState( ItemStack is ) + public PartBasicState( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); } @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @SideOnly( Side.CLIENT ) - public void renderLights( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderLights( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.normalRendering(); this.setColors( ( this.clientFlags & ( POWERED_FLAG | CHANNEL_FLAG ) ) == ( POWERED_FLAG | CHANNEL_FLAG ), ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG ); @@ -79,17 +79,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.DOWN, renderer ); } - public void setColors( boolean hasChan, boolean hasPower ) + public void setColors( final boolean hasChan, final boolean hasPower ) { if( hasChan ) { - int l = 14; + final int l = 14; Tessellator.instance.setBrightness( l << 20 | l << 4 ); Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant ); } else if( hasPower ) { - int l = 9; + final int l = 9; Tessellator.instance.setBrightness( l << 20 | l << 4 ); Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant ); } @@ -101,7 +101,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); @@ -121,7 +121,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel this.clientFlags = this.populateFlags( this.clientFlags ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh } @@ -129,17 +129,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel data.writeByte( (byte) this.clientFlags ); } - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf; } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - boolean eh = super.readFromStream( data ); + final boolean eh = super.readFromStream( data ); - int old = this.clientFlags; + final int old = this.clientFlags; this.clientFlags = data.readByte(); return eh || old != this.clientFlags; diff --git a/src/main/java/appeng/parts/PartPlacement.java b/src/main/java/appeng/parts/PartPlacement.java index d0845902..ff6febf4 100644 --- a/src/main/java/appeng/parts/PartPlacement.java +++ b/src/main/java/appeng/parts/PartPlacement.java @@ -73,7 +73,7 @@ public class PartPlacement private final ThreadLocal placing = new ThreadLocal(); private boolean wasCanceled = false; - public static boolean place( ItemStack held, int x, int y, int z, int face, EntityPlayer player, World world, PlaceType pass, int depth ) + public static boolean place( final ItemStack held, final int x, final int y, final int z, final int face, final EntityPlayer player, final World world, PlaceType pass, final int depth ) { if( depth > 3 ) { @@ -89,8 +89,8 @@ public class PartPlacement return false; } - Block block = world.getBlock( x, y, z ); - TileEntity tile = world.getTileEntity( x, y, z ); + final Block block = world.getBlock( x, y, z ); + final TileEntity tile = world.getTileEntity( x, y, z ); IPartHost host = null; if( tile instanceof IPartHost ) @@ -102,12 +102,12 @@ public class PartPlacement { if( !world.isRemote ) { - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); if( mop != null ) { - List is = new LinkedList(); - SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) ); + final List is = new LinkedList(); + final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) ); if( sp.part != null ) { @@ -155,7 +155,7 @@ public class PartPlacement if( held != null ) { - IFacadePart fp = isFacade( held, side ); + final IFacadePart fp = isFacade( held, side ); if( fp != null ) { if( host != null ) @@ -208,15 +208,15 @@ public class PartPlacement // if ( held == null ) { - Block block = world.getBlock( x, y, z ); + final Block block = world.getBlock( x, y, z ); if( host != null && player.isSneaking() && block != null ) { - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); if( mop != null ) { mop.hitVec = mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ); - SelectedPart sPart = selectPart( player, host, mop.hitVec ); + final SelectedPart sPart = selectPart( player, host, mop.hitVec ); if( sPart != null && sPart.part != null ) { if( sPart.part.onShiftActivate( player, mop.hitVec ) ) @@ -246,7 +246,7 @@ public class PartPlacement { ForgeDirection offset = ForgeDirection.UNKNOWN; - Block blkID = world.getBlock( x, y, z ); + final Block blkID = world.getBlock( x, y, z ); if( blkID != null && !blkID.isReplaceable( world, x, y, z ) ) { offset = side; @@ -323,7 +323,7 @@ public class PartPlacement te_y = y + side.offsetY; te_z = z + side.offsetZ; - Block blkID = world.getBlock( te_x, te_y, te_z ); + final Block blkID = world.getBlock( te_x, te_y, te_z ); tile = world.getTileEntity( te_x, te_y, te_z ); if( tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) ) @@ -341,12 +341,12 @@ public class PartPlacement if( !world.isRemote ) { - Block block = world.getBlock( x, y, z ); - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); + final Block block = world.getBlock( x, y, z ); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, x, y, z, dir.a, dir.b ); if( mop != null ) { - SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) ); + final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) ); if( sp.part != null ) { @@ -357,16 +357,16 @@ public class PartPlacement } } - DimensionalCoord dc = host.getLocation(); + final DimensionalCoord dc = host.getLocation(); if( !Platform.hasPermissions( dc, player ) ) { return false; } - ForgeDirection mySide = host.addPart( held, side, player ); + final ForgeDirection mySide = host.addPart( held, side, player ); if( mySide != null ) { - for( Block multiPartBlock : multiPart.maybeBlock().asSet() ) + for( final Block multiPartBlock : multiPart.maybeBlock().asSet() ) { final SoundType ss = multiPartBlock.stepSound; @@ -392,7 +392,7 @@ public class PartPlacement return true; } - private static float getEyeOffset( EntityPlayer p ) + private static float getEyeOffset( final EntityPlayer p ) { if( p.worldObj.isRemote ) { @@ -402,16 +402,16 @@ public class PartPlacement return eyeHeight; } - private static SelectedPart selectPart( EntityPlayer player, IPartHost host, Vec3 pos ) + private static SelectedPart selectPart( final EntityPlayer player, final IPartHost host, final Vec3 pos ) { CommonHelper.proxy.updateRenderMode( player ); - SelectedPart sp = host.selectPart( pos ); + final SelectedPart sp = host.selectPart( pos ); CommonHelper.proxy.updateRenderMode( null ); return sp; } - public static IFacadePart isFacade( ItemStack held, ForgeDirection side ) + public static IFacadePart isFacade( final ItemStack held, final ForgeDirection side ) { if( held.getItem() instanceof IFacadeItem ) { @@ -420,7 +420,7 @@ public class PartPlacement if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { - IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); if( bc.isFacade( held ) ) { return bc.createFacadePart( held, side ); @@ -431,28 +431,28 @@ public class PartPlacement } @SubscribeEvent - public void playerInteract( TickEvent.ClientTickEvent event ) + public void playerInteract( final TickEvent.ClientTickEvent event ) { this.wasCanceled = false; } @SubscribeEvent - public void playerInteract( PlayerInteractEvent event ) + public void playerInteract( final PlayerInteractEvent event ) { if( event.action == Action.RIGHT_CLICK_AIR && event.entityPlayer.worldObj.isRemote ) { // re-check to see if this event was already channeled, cause these two events are really stupid... - MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false ); - Minecraft mc = Minecraft.getMinecraft(); + final MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false ); + final Minecraft mc = Minecraft.getMinecraft(); - float f = 1.0F; - double d0 = mc.playerController.getBlockReachDistance(); - Vec3 vec3 = mc.renderViewEntity.getPosition( f ); + final float f = 1.0F; + final double d0 = mc.playerController.getBlockReachDistance(); + final Vec3 vec3 = mc.renderViewEntity.getPosition( f ); if( mop != null && mop.hitVec.distanceTo( vec3 ) < d0 ) { - World w = event.entity.worldObj; - TileEntity te = w.getTileEntity( mop.blockX, mop.blockY, mop.blockZ ); + final World w = event.entity.worldObj; + final TileEntity te = w.getTileEntity( mop.blockX, mop.blockY, mop.blockZ ); if( te instanceof IPartHost && this.wasCanceled ) { event.setCanceled( true ); @@ -460,7 +460,7 @@ public class PartPlacement } else { - ItemStack held = event.entityPlayer.getHeldItem(); + final ItemStack held = event.entityPlayer.getHeldItem(); final IItems items = AEApi.instance().definitions().items(); boolean supportedItem = items.memoryCard().isSameAs( held ); @@ -481,7 +481,7 @@ public class PartPlacement this.placing.set( event ); - ItemStack held = event.entityPlayer.getHeldItem(); + final ItemStack held = event.entityPlayer.getHeldItem(); if( place( held, event.x, event.y, event.z, event.face, event.entityPlayer, event.entityPlayer.worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) ) { event.setCanceled( true ); diff --git a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java index 5577e1e3..c2c3c7e2 100644 --- a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java @@ -15,18 +15,18 @@ public class BlockUpgradeInventory extends UpgradeInventory { private final Block block; - public BlockUpgradeInventory( Block block, IAEAppEngInventory parent, int s ) + public BlockUpgradeInventory( final Block block, final IAEAppEngInventory parent, final int s ) { super( parent, s ); this.block = block; } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack is : upgrades.getSupported().keySet() ) + for( final ItemStack is : upgrades.getSupported().keySet() ) { final Item encodedItem = is.getItem(); diff --git a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java index e6cb39ed..30686ddb 100644 --- a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java @@ -13,7 +13,7 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory { private final IItemDefinition definition; - public DefinitionUpgradeInventory( IItemDefinition definition, IAEAppEngInventory parent, int s ) + public DefinitionUpgradeInventory( final IItemDefinition definition, final IAEAppEngInventory parent, final int s ) { super( parent, s ); @@ -21,11 +21,11 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack stack : upgrades.getSupported().keySet() ) + for( final ItemStack stack : upgrades.getSupported().keySet() ) { if( this.definition.isSameAs( stack ) ) { diff --git a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java index 4a709f6a..72df8398 100644 --- a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java @@ -81,20 +81,20 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab private boolean isAccepting = true; private boolean breaking = false; - public PartAnnihilationPlane( ItemStack is ) + public PartAnnihilationPlane( final ItemStack is ) { super( is ); } @Override - public TickRateModulation call( World world ) throws Exception + public TickRateModulation call( final World world ) throws Exception { this.breaking = false; return this.breakBlock( true ); } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { int minX = 1; int minY = 1; @@ -140,7 +140,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, this.is.getIconIndex(), SIDE_ICON, SIDE_ICON ); @@ -153,12 +153,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderStaticWithIcon( x, y, z, rh, renderer, ACTIVE_ICON ); } - protected void renderStaticWithIcon( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, IIcon activeIcon ) + protected void renderStaticWithIcon( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer, final IIcon activeIcon ) { int minX = 1; @@ -221,7 +221,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { if( this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.proxy.isActive() ) { @@ -296,7 +296,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * * @param entityItem {@link EntityItem} to store */ - private boolean storeEntityItem( EntityItem entityItem ) + private boolean storeEntityItem( final EntityItem entityItem ) { if( !entityItem.isDead ) { @@ -314,7 +314,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * @param item {@link ItemStack} to store * @return the leftover items, which could not be stored inside the network */ - private IAEItemStack storeItemStack( ItemStack item ) + private IAEItemStack storeItemStack( final ItemStack item ) { final IAEItemStack itemToStore = AEItemStack.create( item ); try @@ -344,7 +344,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * @param overflow the leftover {@link IAEItemStack} * @return true, if the entity was changed otherwise false. */ - private boolean handleOverflow( EntityItem entityItem, IAEItemStack overflow ) + private boolean handleOverflow( final EntityItem entityItem, final IAEItemStack overflow ) { if( overflow == null || overflow.getStackSize() == 0 ) { @@ -370,7 +370,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * @param z coordinate * @param overflow the item to spawn */ - private void spawnOverflow( IAEItemStack overflow ) + private void spawnOverflow( final IAEItemStack overflow ) { if( overflow == null ) { @@ -391,7 +391,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab w.spawnEntityInWorld( overflowEntity ); } - protected boolean isAnnihilationPlane( TileEntity blockTileEntity, ForgeDirection side ) + protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final ForgeDirection side ) { if( blockTileEntity instanceof IPartHost ) { @@ -403,7 +403,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.onNeighborChanged(); this.getHost().markForUpdate(); @@ -411,13 +411,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.onNeighborChanged(); this.getHost().markForUpdate(); } - public TickRateModulation breakBlock( boolean modulate ) + public TickRateModulation breakBlock( final boolean modulate ) { if( this.isAccepting && this.proxy.isActive() ) { @@ -468,13 +468,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.AnnihilationPlane.min, TickRates.AnnihilationPlane.max, false, true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.breaking ) { @@ -488,7 +488,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab /** * Checks if this plane can handle the block at the specific coordinates. */ - protected boolean canHandleBlock( WorldServer w, int x, int y, int z ) + protected boolean canHandleBlock( final WorldServer w, final int x, final int y, final int z ) { final Block block = w.getBlock( x, y, z ); final Material material = block.getMaterial(); @@ -499,7 +499,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab return !ignoreMaterials && !ignoreBlocks && !w.isAirBlock( x, y, z ) && w.blockExists( x, y, z ) && w.canMineBlock( Platform.getPlayer( w ), x, y, z ) && hardness >= 0f; } - protected List obtainBlockDrops( WorldServer w, int x, int y, int z ) + protected List obtainBlockDrops( final WorldServer w, final int x, final int y, final int z ) { final ItemStack[] out = Platform.getBlockDrops( w, x, y, z ); return Lists.newArrayList( out ); @@ -508,7 +508,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab /** * Checks if this plane can handle the block at the specific coordinates. */ - protected float calculateEnergyUsage( WorldServer w, int x, int y, int z, List items ) + protected float calculateEnergyUsage( final WorldServer w, final int x, final int y, final int z, final List items ) { final Block block = w.getBlock( x, y, z ); final float hardness = block.getBlockHardness( w, x, y, z ); @@ -531,7 +531,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * * @return true, if the network can store at least a single item of all drops or no drops are reported */ - protected boolean canStoreItemStacks( List itemStacks ) + protected boolean canStoreItemStacks( final List itemStacks ) { boolean canStore = itemStacks.isEmpty(); @@ -558,7 +558,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab return canStore; } - protected void breakBlockAndStoreItems( WorldServer w, int x, int y, int z, List items ) + protected void breakBlockAndStoreItems( final WorldServer w, final int x, final int y, final int z, final List items ) { w.setBlock( x, y, z, Platform.AIR_BLOCK, 0, 3 ); diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index b4285364..f4e31475 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -74,7 +74,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest private int nextSlot = 0; @Reflected - public PartExportBus( ItemStack is ) + public PartExportBus( final ItemStack is ) { super( is ); @@ -86,7 +86,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.craftingTracker.readFromNBT( extra ); @@ -94,7 +94,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.craftingTracker.writeToNBT( extra ); @@ -127,7 +127,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest for( x = 0; x < this.availableSlots() && this.itemToSend > 0; x++ ) { - int slotToExport = this.getStartingSlot( schedulingMode, x ); + final int slotToExport = this.getStartingSlot( schedulingMode, x ); final IAEItemStack ais = this.config.getAEStackInSlot( slotToExport ); @@ -144,7 +144,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { - for( IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) ) + for( final IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) ) { this.pushItemIntoTarget( destination, energy, inv, o ); if( this.itemToSend <= 0 ) @@ -171,7 +171,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return TickRateModulation.SLEEP; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -187,7 +187,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 4, 4, 12, 12, 12, 14 ); bch.addBox( 5, 5, 14, 11, 11, 15 ); @@ -197,7 +197,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); @@ -213,7 +213,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); @@ -242,7 +242,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -259,7 +259,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false ); } @@ -271,7 +271,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doBusWork(); } @@ -283,7 +283,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { final InventoryAdaptor d = this.getHandler(); @@ -304,7 +304,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { AELog.error( e ); } @@ -313,7 +313,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.craftingTracker.jobStateChange( link ); } @@ -334,19 +334,19 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0; } - private void pushItemIntoTarget( InventoryAdaptor d, IEnergyGrid energy, IMEInventory inv, IAEItemStack ais ) + private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory inv, IAEItemStack ais ) { final ItemStack is = ais.getItemStack(); is.stackSize = (int) this.itemToSend; final ItemStack o = d.simulateAdd( is ); - long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize; + final long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize; if( canFit > 0 ) { ais = ais.copy(); ais.setStackSize( canFit ); - IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc ); + final IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc ); if( itemsToAdd != null ) { @@ -366,7 +366,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } - private int getStartingSlot( SchedulingMode schedulingMode, int x ) + private int getStartingSlot( final SchedulingMode schedulingMode, final int x ) { if( schedulingMode == SchedulingMode.RANDOM ) { @@ -381,7 +381,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return x; } - private void updateSchedulingMode( SchedulingMode schedulingMode, int x ) + private void updateSchedulingMode( final SchedulingMode schedulingMode, final int x ) { if( schedulingMode == SchedulingMode.ROUNDROBIN ) { @@ -389,7 +389,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } - private TickRateModulation getFailedCraftingPenalty( int failedAttempts ) + private TickRateModulation getFailedCraftingPenalty( final int failedAttempts ) { if( failedAttempts > 5 ) { diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index f8e7e660..93bc3175 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -92,7 +92,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine boolean wasActive = false; boolean blocked = false; - public PartFormationPlane( ItemStack is ) + public PartFormationPlane( final ItemStack is ) { super( is ); @@ -107,12 +107,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST ); this.myHandler.setPriority( this.priority ); - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { - IAEItemStack is = this.Config.getAEStackInSlot( x ); + final IAEItemStack is = this.Config.getAEStackInSlot( x ); if( is != null ) { priorityList.add( is ); @@ -132,7 +132,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -145,14 +145,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.updateHandler(); this.host.markForSave(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); @@ -169,7 +169,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.Config.readFromNBT( data, "config" ); @@ -178,7 +178,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.Config.writeToNBT( data, "config" ); @@ -186,7 +186,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -198,9 +198,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -210,9 +210,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @MENetworkEventSubscribe - public void updateChannels( MENetworkChannelsChanged changedChannels ) + public void updateChannels( final MENetworkChannelsChanged changedChannels ) { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -222,24 +222,24 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { int minX = 1; int minY = 1; int maxX = 15; int maxY = 15; - IPartHost host = this.getHost(); + final IPartHost host = this.getHost(); if( host != null ) { - TileEntity te = host.getTile(); + final TileEntity te = host.getTile(); - int x = te.xCoord; - int y = te.yCoord; - int z = te.zCoord; + final int x = te.xCoord; + final int y = te.yCoord; + final int z = te.zCoord; - ForgeDirection e = bch.getWorldX(); - ForgeDirection u = bch.getWorldY(); + final ForgeDirection e = bch.getWorldX(); + final ForgeDirection u = bch.getWorldY(); if( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) { @@ -268,7 +268,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); @@ -281,14 +281,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { int minX = 1; - ForgeDirection e = rh.getWorldX(); - ForgeDirection u = rh.getWorldY(); + final ForgeDirection e = rh.getWorldX(); + final ForgeDirection u = rh.getWorldY(); - TileEntity te = this.getHost().getTile(); + final TileEntity te = this.getHost().getTile(); if( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) ) { @@ -313,7 +313,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine maxY = 16; } - boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ); + final boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ); this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); @@ -332,13 +332,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public void onNeighborChanged() { - TileEntity te = this.host.getTile(); - World w = te.getWorldObj(); - ForgeDirection side = this.side; + final TileEntity te = this.host.getTile(); + final World w = te.getWorldObj(); + final ForgeDirection side = this.side; - int x = te.xCoord + side.offsetX; - int y = te.yCoord + side.offsetY; - int z = te.zCoord + side.offsetZ; + final int x = te.xCoord + side.offsetX; + final int y = te.yCoord + side.offsetY; + final int z = te.zCoord + side.offsetZ; this.blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z ); } @@ -350,7 +350,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -366,22 +366,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine return false; } - private boolean isTransitionPlane( TileEntity blockTileEntity, ForgeDirection side ) + private boolean isTransitionPlane( final TileEntity blockTileEntity, final ForgeDirection side ) { if( blockTileEntity instanceof IPartHost ) { - IPart p = ( (IPartHost) blockTileEntity ).getPart( side ); + final IPart p = ( (IPartHost) blockTileEntity ).getPart( side ); return p instanceof PartFormationPlane; } return false; } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.proxy.isActive() && channel == StorageChannel.ITEMS ) { - List Handler = new ArrayList( 1 ); + final List Handler = new ArrayList( 1 ); Handler.add( this.myHandler ); return Handler; } @@ -395,7 +395,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.host.markForSave(); @@ -403,47 +403,47 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { // :P } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.blocked || input == null || input.getStackSize() <= 0 ) { return input; } - YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK ); + final YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK ); - ItemStack is = input.getItemStack(); - Item i = is.getItem(); + final ItemStack is = input.getItemStack(); + final Item i = is.getItem(); long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() ); boolean worked = false; - TileEntity te = this.host.getTile(); - World w = te.getWorldObj(); - ForgeDirection side = this.side; + final TileEntity te = this.host.getTile(); + final World w = te.getWorldObj(); + final ForgeDirection side = this.side; - int x = te.xCoord + side.offsetX; - int y = te.yCoord + side.offsetY; - int z = te.zCoord + side.offsetZ; + final int x = te.xCoord + side.offsetX; + final int y = te.yCoord + side.offsetY; + final int z = te.zCoord + side.offsetZ; if( w.getBlock( x, y, z ).isReplaceable( w, x, y, z ) ) { if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i instanceof ItemReed ) ) { - EntityPlayer player = Platform.getPlayer( (WorldServer) w ); + final EntityPlayer player = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( player, side, this.tile ); if( i instanceof ItemFirework ) { - Chunk c = w.getChunkFromBlockCoords( x, z ); + final Chunk c = w.getChunkFromBlockCoords( x, z ); int sum = 0; - for( List Z : c.entityLists ) + for( final List Z : c.entityLists ) { sum += Z.size(); } @@ -496,9 +496,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine else { worked = true; - Chunk c = w.getChunkFromBlockCoords( x, z ); + final Chunk c = w.getChunkFromBlockCoords( x, z ); int sum = 0; - for( List Z : c.entityLists ) + for( final List Z : c.entityLists ) { sum += Z.size(); } @@ -509,7 +509,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { is.stackSize = (int) maxStorage; - EntityItem ei = new EntityItem( w, + final EntityItem ei = new EntityItem( w, ( ( side.offsetX != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetX * -0.3 + x, ( ( side.offsetY != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetY * -0.3 + y, ( ( side.offsetZ != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetZ * -0.3 + z, @@ -552,7 +552,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if( worked ) { - IAEItemStack out = input.copy(); + final IAEItemStack out = input.copy(); out.decStackSize( maxStorage ); if( out.getStackSize() == 0 ) { @@ -565,13 +565,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -583,7 +583,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { // nope! } diff --git a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java index 05acc6e8..99372628 100644 --- a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java @@ -48,20 +48,20 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane private static final float SILK_TOUCH_FACTOR = 16; - public PartIdentityAnnihilationPlane( ItemStack is ) + public PartIdentityAnnihilationPlane( final ItemStack is ) { super( is ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderStaticWithIcon( x, y, z, rh, renderer, ACTIVE_ICON ); } @Override - protected boolean isAnnihilationPlane( TileEntity blockTileEntity, ForgeDirection side ) + protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final ForgeDirection side ) { if( blockTileEntity instanceof IPartHost ) { @@ -72,7 +72,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane } @Override - protected float calculateEnergyUsage( WorldServer w, int x, int y, int z, List items ) + protected float calculateEnergyUsage( final WorldServer w, final int x, final int y, final int z, final List items ) { final float requiredEnergy = super.calculateEnergyUsage( w, x, y, z, items ); @@ -80,7 +80,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane } @Override - protected List obtainBlockDrops( WorldServer w, int x, int y, int z ) + protected List obtainBlockDrops( final WorldServer w, final int x, final int y, final int z ) { final FakePlayer fakePlayer = FakePlayerFactory.getMinecraft( w ); final Block block = w.getBlock( x, y, z ); @@ -98,7 +98,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane { meta = blockMeta; } - ItemStack itemstack = new ItemStack( item, 1, meta ); + final ItemStack itemstack = new ItemStack( item, 1, meta ); out.add( itemstack ); } return out; diff --git a/src/main/java/appeng/parts/automation/PartImportBus.java b/src/main/java/appeng/parts/automation/PartImportBus.java index 8b123c36..93eab6a0 100644 --- a/src/main/java/appeng/parts/automation/PartImportBus.java +++ b/src/main/java/appeng/parts/automation/PartImportBus.java @@ -66,7 +66,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin private boolean worked; // used in tickingRequest @Reflected - public PartImportBus( ItemStack is ) + public PartImportBus( final ItemStack is ) { super( is ); @@ -76,7 +76,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { if( stack == null || stack.getItem() == null ) { @@ -92,7 +92,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 11, 10, 10, 13 ); bch.addBox( 5, 5, 13, 11, 11, 14 ); @@ -101,7 +101,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); @@ -117,7 +117,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); @@ -145,7 +145,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -162,13 +162,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doBusWork(); } @@ -224,7 +224,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :3 } @@ -237,7 +237,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } - private boolean importStuff( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor inv, IEnergySource energy, FuzzyMode fzMode ) + private boolean importStuff( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor inv, final IEnergySource energy, final FuzzyMode fzMode ) { final int toSend = this.calculateMaximumAmountToImport( myAdaptor, whatToImport, inv, fzMode ); final ItemStack newItems; @@ -285,7 +285,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return false; } - private int calculateMaximumAmountToImport( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor inv, FuzzyMode fzMode ) + private int calculateMaximumAmountToImport( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor inv, final FuzzyMode fzMode ) { final int toSend = Math.min( this.itemToSend, 64 ); final ItemStack itemStackToImport; @@ -320,7 +320,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return toSend; } - private IInventoryDestination configDestination( IMEMonitor itemInventory ) + private IInventoryDestination configDestination( final IMEMonitor itemInventory ) { this.destination = itemInventory; return this; diff --git a/src/main/java/appeng/parts/automation/PartLevelEmitter.java b/src/main/java/appeng/parts/automation/PartLevelEmitter.java index bb37b805..d5ff8c9d 100644 --- a/src/main/java/appeng/parts/automation/PartLevelEmitter.java +++ b/src/main/java/appeng/parts/automation/PartLevelEmitter.java @@ -101,7 +101,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH boolean status = false; @Reflected - public PartLevelEmitter( ItemStack is ) + public PartLevelEmitter( final ItemStack is ) { super( is ); @@ -116,7 +116,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH return this.reportingValue; } - public void setReportingValue( long v ) + public void setReportingValue( final long v ) { this.reportingValue = v; if( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) @@ -130,18 +130,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @MENetworkEventSubscribe - public void powerChanged( MENetworkPowerStatusChange c ) + public void powerChanged( final MENetworkPowerStatusChange c ) { this.updateState(); } private void updateState() { - boolean isOn = this.isLevelEmitterOn(); + final boolean isOn = this.isLevelEmitterOn(); if( this.prevState != isOn ) { this.host.markForUpdate(); - TileEntity te = this.host.getTile(); + final TileEntity te = this.host.getTile(); this.prevState = isOn; Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord ); Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); @@ -166,7 +166,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -174,18 +174,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH return this.prevState; } - boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; + final boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1; } @MENetworkEventSubscribe - public void channelChanged( MENetworkChannelsChanged c ) + public void channelChanged( final MENetworkChannelsChanged c ) { this.updateState(); } @Override - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf | ( this.prevState ? FLAG_ON : 0 ); } @@ -197,14 +197,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateWatcher( ICraftingWatcher newWatcher ) + public void updateWatcher( final ICraftingWatcher newWatcher ) { this.myCraftingWatcher = newWatcher; this.configureWatchers(); } @Override - public void onRequestChange( ICraftingGrid craftingGrid, IAEItemStack what ) + public void onRequestChange( final ICraftingGrid craftingGrid, final IAEItemStack what ) { this.updateState(); } @@ -212,7 +212,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH // update the system... public void configureWatchers() { - IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); + final IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); if( this.myWatcher != null ) { @@ -233,7 +233,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) ); } - catch( GridAccessException e1 ) + catch( final GridAccessException e1 ) { // :/ } @@ -264,7 +264,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH // no more item stuff.. this.proxy.getStorage().getItemInventory().removeListener( this ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -290,20 +290,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // >.> } } - private void updateReportingValue( IMEMonitor monitor ) + private void updateReportingValue( final IMEMonitor monitor ) { - IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); + final IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); if( myStack == null ) { this.lastReportedValue = 0; - for( IAEItemStack st : monitor.getStorageList() ) + for( final IAEItemStack st : monitor.getStorageList() ) { this.lastReportedValue += st.getStackSize(); } @@ -311,16 +311,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH else if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { this.lastReportedValue = 0; - FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); - Collection fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode ); - for( IAEItemStack st : fuzzyList ) + final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); + final Collection fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode ); + for( final IAEItemStack st : fuzzyList ) { this.lastReportedValue += st.getStackSize(); } } else { - IAEItemStack r = monitor.getStorageList().findPrecise( myStack ); + final IAEItemStack r = monitor.getStorageList().findPrecise( myStack ); if( r == null ) { this.lastReportedValue = 0; @@ -335,14 +335,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateWatcher( IStackWatcher newWatcher ) + public void updateWatcher( final IStackWatcher newWatcher ) { this.myWatcher = newWatcher; this.configureWatchers(); } @Override - public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan ) + public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan ) { if( chan == StorageChannel.ITEMS && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 ) { @@ -352,34 +352,34 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateWatcher( IEnergyWatcher newWatcher ) + public void updateWatcher( final IEnergyWatcher newWatcher ) { this.myEnergyWatcher = newWatcher; this.configureWatchers(); } @Override - public void onThresholdPass( IEnergyGrid energyGrid ) + public void onThresholdPass( final IEnergyGrid energyGrid ) { this.lastReportedValue = (long) energyGrid.getStoredPower(); this.updateState(); } @Override - public boolean isValid( Object effectiveGrid ) + public boolean isValid( final Object effectiveGrid ) { try { return this.proxy.getGrid() == effectiveGrid; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource actionSource ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource ) { this.updateReportingValue( (IMEMonitor) monitor ); } @@ -391,27 +391,27 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // ;P } } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 7, 7, 11, 9, 9, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( this.is.getIconIndex() ); Tessellator.instance.startDrawingQuads(); @@ -423,9 +423,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH public void renderTorchAtAngle( double baseX, double baseY, double baseZ ) { - boolean isOn = this.isLevelEmitterOn(); - IIcon offTexture = this.is.getIconIndex(); - IIcon IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture ); + final boolean isOn = this.isLevelEmitterOn(); + final IIcon offTexture = this.is.getIconIndex(); + final IIcon IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture ); // this.centerX = baseX + 0.5; this.centerY = baseY + 0.5; @@ -444,35 +444,35 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH * (double)IIcon.func_94214_a(9.0D); double d16 = (double)IIcon.func_94207_b(15.0D); */ - float var16 = IIcon.getMinU(); - float var17 = IIcon.getMaxU(); - float var18 = IIcon.getMinV(); - float var19 = IIcon.getMaxV(); + final float var16 = IIcon.getMinU(); + final float var17 = IIcon.getMaxU(); + final float var18 = IIcon.getMinV(); + final float var19 = IIcon.getMaxV(); /* * 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 = offTexture.getInterpolatedU( 7.0D ); - double var24b = offTexture.getInterpolatedU( 9.0D ); + final double var20b = offTexture.getInterpolatedU( 7.0D ); + final double var24b = offTexture.getInterpolatedU( 9.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 ); + final double var20 = IIcon.getInterpolatedU( 7.0D ); + final double var24 = IIcon.getInterpolatedU( 9.0D ); + final double var22 = IIcon.getInterpolatedV( 6.0D + ( isOn ? 0 : 1.0D ) ); + final double var26 = IIcon.getInterpolatedV( 8.0D + ( isOn ? 0 : 1.0D ) ); + final double var28 = IIcon.getInterpolatedU( 7.0D ); + final double var30 = IIcon.getInterpolatedV( 13.0D ); + final double var32 = IIcon.getInterpolatedU( 9.0D ); + final double var34 = IIcon.getInterpolatedV( 15.0D ); - double var22b = IIcon.getInterpolatedV( 9.0D ); - double var26b = IIcon.getInterpolatedV( 11.0D ); + final double var22b = IIcon.getInterpolatedV( 9.0D ); + final double var26b = IIcon.getInterpolatedV( 11.0D ); baseX += 0.5D; baseZ += 0.5D; - double var36 = baseX - 0.5D; - double var38 = baseX + 0.5D; - double var40 = baseZ - 0.5D; - double var42 = baseZ + 0.5D; + final double var36 = baseX - 0.5D; + final double var38 = baseX + 0.5D; + final double var40 = baseZ - 0.5D; + final double var42 = baseZ + 0.5D; double toff = 0.0d; @@ -481,23 +481,23 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH toff = 1.0d / 16.0d; } - Tessellator var12 = Tessellator.instance; + final Tessellator var12 = Tessellator.instance; if( isOn ) { var12.setColorOpaque_F( 1.0F, 1.0F, 1.0F ); var12.setBrightness( 11 << 20 | 11 << 4 ); } - double TorchLen = 0.625D; - double var44 = 0.0625D; - double Zero = 0; - double par10 = 0; + final double TorchLen = 0.625D; + final double var44 = 0.0625D; + final double Zero = 0; + final double par10 = 0; this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 ); this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 ); this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 ); this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 ); - double var422 = 0.1915D + 1.0 / 16.0; + final double var422 = 0.1915D + 1.0 / 16.0; this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b ); this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b ); this.addVertexWithUV( baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b ); @@ -529,9 +529,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH this.addVertexWithUV( var36, baseY + 1.0D, baseZ - var44, var17, var18 ); } - public void addVertexWithUV( double x, double y, double z, double u, double v ) + public void addVertexWithUV( double x, double y, double z, final double u, final double v ) { - Tessellator var12 = Tessellator.instance; + final Tessellator var12 = Tessellator.instance; x -= this.centerX; y -= this.centerY; @@ -545,7 +545,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == ForgeDirection.EAST ) { - double m = x; + final double m = x; x = y; y = m; y = -y; @@ -553,14 +553,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == ForgeDirection.WEST ) { - double m = x; + final double m = x; x = -y; y = m; } if( this.side == ForgeDirection.SOUTH ) { - double m = z; + final double m = z; z = y; y = m; y = -y; @@ -568,7 +568,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == ForgeDirection.NORTH ) { - double m = z; + final double m = z; z = -y; y = m; } @@ -582,7 +582,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( this.is.getIconIndex() ); // rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() ); @@ -595,7 +595,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH renderer.renderAllFaces = true; - Tessellator tess = Tessellator.instance; + final Tessellator tess = Tessellator.instance; tess.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorldObj(), x, y, z ) ); tess.setColorOpaque_F( 1.0F, 1.0F, 1.0F ); @@ -622,15 +622,15 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { if( this.isLevelEmitterOn() ) { - ForgeDirection d = this.side; + final ForgeDirection d = this.side; - 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; + final double d0 = d.offsetX * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; + final double d1 = d.offsetY * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; + final 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 ); } @@ -643,7 +643,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -660,13 +660,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.configureWatchers(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.config ) { @@ -689,7 +689,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.lastReportedValue = data.getLong( "lastReportedValue" ); @@ -699,7 +699,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setLong( "lastReportedValue", this.lastReportedValue ); @@ -709,7 +709,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -720,7 +720,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return false; } @@ -732,13 +732,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { if( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) { if( this.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES ) { - IAEItemStack what = this.config.getAEStackInSlot( 0 ); + final IAEItemStack what = this.config.getAEStackInSlot( 0 ); if( what != null ) { craftingTracker.setEmitable( what ); diff --git a/src/main/java/appeng/parts/automation/PartSharedItemBus.java b/src/main/java/appeng/parts/automation/PartSharedItemBus.java index 7c4f9c87..1ccfcfc7 100644 --- a/src/main/java/appeng/parts/automation/PartSharedItemBus.java +++ b/src/main/java/appeng/parts/automation/PartSharedItemBus.java @@ -42,7 +42,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid private InventoryAdaptor adaptor; private boolean lastRedstone = false; - public PartSharedItemBus( ItemStack is ) + public PartSharedItemBus( final ItemStack is ) { super( is ); } @@ -54,21 +54,21 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid } @Override - public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.readFromNBT( extra ); this.config.readFromNBT( extra, "config" ); } @Override - public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.writeToNBT( extra ); this.config.writeToNBT( extra, "config" ); } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -163,13 +163,13 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid this.proxy.getTick().sleepDevice( this.proxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } - private TileEntity getTileEntity( TileEntity self, int x, int y, int z ) + private TileEntity getTileEntity( final TileEntity self, final int x, final int y, final int z ) { final World w = self.getWorldObj(); diff --git a/src/main/java/appeng/parts/automation/PartUpgradeable.java b/src/main/java/appeng/parts/automation/PartUpgradeable.java index 2e7b934a..33b646ed 100644 --- a/src/main/java/appeng/parts/automation/PartUpgradeable.java +++ b/src/main/java/appeng/parts/automation/PartUpgradeable.java @@ -39,7 +39,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn private final IConfigManager manager; private final UpgradeInventory upgrades; - public PartUpgradeable( ItemStack is ) + public PartUpgradeable( final ItemStack is ) { super( is ); this.upgrades = new StackUpgradeInventory( this.is, this, this.getUpgradeSlots() ); @@ -53,13 +53,13 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.upgrades ) { @@ -109,7 +109,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @@ -121,7 +121,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.readFromNBT( extra ); this.manager.readFromNBT( extra ); @@ -129,7 +129,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.writeToNBT( extra ); this.manager.writeToNBT( extra ); @@ -137,9 +137,9 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { - for( ItemStack is : this.upgrades ) + for( final ItemStack is : this.upgrades ) { if( is != null ) { @@ -155,7 +155,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { diff --git a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java index 2e45f6fa..1aae3fe8 100644 --- a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java @@ -13,18 +13,18 @@ public class StackUpgradeInventory extends UpgradeInventory { private final ItemStack stack; - public StackUpgradeInventory( ItemStack stack, IAEAppEngInventory inventory, int s ) + public StackUpgradeInventory( final ItemStack stack, final IAEAppEngInventory inventory, final int s ) { super( inventory, s ); this.stack = stack; } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack is : upgrades.getSupported().keySet() ) + for( final ItemStack is : upgrades.getSupported().keySet() ) { if( Platform.isSameItem( this.stack, is ) ) { diff --git a/src/main/java/appeng/parts/automation/UpgradeInventory.java b/src/main/java/appeng/parts/automation/UpgradeInventory.java index 606bf53e..9ab39b89 100644 --- a/src/main/java/appeng/parts/automation/UpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/UpgradeInventory.java @@ -44,7 +44,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement private int inverterUpgrades = 0; private int craftingUpgrades = 0; - public UpgradeInventory( IAEAppEngInventory parent, int s ) + public UpgradeInventory( final IAEAppEngInventory parent, final int s ) { super( null, s ); this.te = this; @@ -64,16 +64,16 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( itemstack == null ) { return false; } - Item it = itemstack.getItem(); + final Item it = itemstack.getItem(); if( it instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) it ).getType( itemstack ); + final Upgrades u = ( (IUpgradeModule) it ).getType( itemstack ); if( u != null ) { return this.getInstalledUpgrades( u ) < this.getMaxInstalled( u ); @@ -82,7 +82,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement return false; } - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { if( !this.cached ) { @@ -115,14 +115,14 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement this.cached = true; this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = 0; - for( ItemStack is : this ) + for( final ItemStack is : this ) { if( is == null || is.getItem() == null || !( is.getItem() instanceof IUpgradeModule ) ) { continue; } - Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is ); switch( myUpgrade ) { case CAPACITY: @@ -157,7 +157,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public void readFromNBT( NBTTagCompound target ) + public void readFromNBT( final NBTTagCompound target ) { super.readFromNBT( target ); this.updateUpgradeInfo(); @@ -170,7 +170,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.cached = false; if( this.parent != null && Platform.isServer() ) diff --git a/src/main/java/appeng/parts/layers/InvLayerData.java b/src/main/java/appeng/parts/layers/InvLayerData.java index 276019fb..14382238 100644 --- a/src/main/java/appeng/parts/layers/InvLayerData.java +++ b/src/main/java/appeng/parts/layers/InvLayerData.java @@ -37,14 +37,14 @@ public class InvLayerData private final List inventories; private final List slots; - public InvLayerData( int[][] a, List b, List c ) + public InvLayerData( final int[][] a, final List b, final List c ) { this.sides = a; this.inventories = b; this.slots = c; } - public ItemStack decreaseStackSize( int slot, int amount ) + public ItemStack decreaseStackSize( final int slot, final int amount ) { if( this.isSlotValid( slot ) ) { @@ -61,7 +61,7 @@ public class InvLayerData * * @return true, if the slot exists. */ - boolean isSlotValid( int slot ) + boolean isSlotValid( final int slot ) { return this.slots != null && slot >= 0 && slot < this.slots.size(); } @@ -76,7 +76,7 @@ public class InvLayerData return this.slots.size(); } - public ItemStack getStackInSlot( int slot ) + public ItemStack getStackInSlot( final int slot ) { if( this.isSlotValid( slot ) ) { @@ -86,7 +86,7 @@ public class InvLayerData return null; } - public boolean isItemValidForSlot( int slot, ItemStack itemstack ) + public boolean isItemValidForSlot( final int slot, final ItemStack itemstack ) { if( this.isSlotValid( slot ) ) { @@ -96,7 +96,7 @@ public class InvLayerData return false; } - public void setInventorySlotContents( int slot, ItemStack itemstack ) + public void setInventorySlotContents( final int slot, final ItemStack itemstack ) { if( this.isSlotValid( slot ) ) { @@ -104,7 +104,7 @@ public class InvLayerData } } - public boolean canExtractItem( int slot, ItemStack itemstack, int side ) + public boolean canExtractItem( final int slot, final ItemStack itemstack, final int side ) { if( this.isSlotValid( slot ) ) { @@ -114,7 +114,7 @@ public class InvLayerData return false; } - public boolean canInsertItem( int slot, ItemStack itemstack, int side ) + public boolean canInsertItem( final int slot, final ItemStack itemstack, final int side ) { if( this.isSlotValid( slot ) ) { @@ -128,14 +128,14 @@ public class InvLayerData { if( this.inventories != null ) { - for( IInventory inv : this.inventories ) + for( final IInventory inv : this.inventories ) { inv.markDirty(); } } } - public int[] getAccessibleSlotsFromSide( int side ) + public int[] getAccessibleSlotsFromSide( final int side ) { if( this.sides == null || side < 0 || side > 5 ) { diff --git a/src/main/java/appeng/parts/layers/InvSot.java b/src/main/java/appeng/parts/layers/InvSot.java index dc13911b..7ec5647c 100644 --- a/src/main/java/appeng/parts/layers/InvSot.java +++ b/src/main/java/appeng/parts/layers/InvSot.java @@ -29,13 +29,13 @@ public class InvSot public final ISidedInventory partInv; public final int index; - public InvSot( ISidedInventory part, int slot ) + public InvSot( final ISidedInventory part, final int slot ) { this.partInv = part; this.index = slot; } - public ItemStack decreaseStackSize( int j ) + public ItemStack decreaseStackSize( final int j ) { return this.partInv.decrStackSize( this.index, j ); } @@ -45,22 +45,22 @@ public class InvSot return this.partInv.getStackInSlot( this.index ); } - public boolean isItemValidForSlot( ItemStack itemstack ) + public boolean isItemValidForSlot( final ItemStack itemstack ) { return this.partInv.isItemValidForSlot( this.index, itemstack ); } - public void setInventorySlotContents( ItemStack itemstack ) + public void setInventorySlotContents( final ItemStack itemstack ) { this.partInv.setInventorySlotContents( this.index, itemstack ); } - public boolean canExtractItem( ItemStack itemstack, int side ) + public boolean canExtractItem( final ItemStack itemstack, final int side ) { return this.partInv.canExtractItem( this.index, itemstack, side ); } - public boolean canInsertItem( ItemStack itemstack, int side ) + public boolean canInsertItem( final ItemStack itemstack, final int side ) { return this.partInv.canInsertItem( this.index, itemstack, side ); } diff --git a/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java b/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java index 422f0a02..2019fcc9 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java @@ -34,9 +34,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler { @Override - public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate ) + public int receiveEnergy( final ForgeDirection from, final int maxReceive, final boolean simulate ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IEnergyReceiver ) { return ( (IEnergyReceiver) part ).receiveEnergy( from, maxReceive, simulate ); @@ -46,9 +46,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler } @Override - public int extractEnergy( ForgeDirection from, int maxExtract, boolean simulate ) + public int extractEnergy( final ForgeDirection from, final int maxExtract, final boolean simulate ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IEnergyProvider ) { return ( (IEnergyProvider) part ).extractEnergy( from, maxExtract, simulate ); @@ -58,9 +58,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler } @Override - public int getEnergyStored( ForgeDirection from ) + public int getEnergyStored( final ForgeDirection from ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IEnergyProvider ) { return ( (IEnergyProvider) part ).getEnergyStored( from ); @@ -70,9 +70,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler } @Override - public int getMaxEnergyStored( ForgeDirection from ) + public int getMaxEnergyStored( final ForgeDirection from ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IEnergyProvider ) { return ( (IEnergyProvider) part ).getMaxEnergyStored( from ); @@ -82,9 +82,9 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler } @Override - public boolean canConnectEnergy( ForgeDirection from ) + public boolean canConnectEnergy( final ForgeDirection from ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IEnergyConnection ) { return ( (IEnergyConnection) part ).canConnectEnergy( from ); diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySink.java b/src/main/java/appeng/parts/layers/LayerIEnergySink.java index 4cdacbd4..0b9f58c9 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySink.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySink.java @@ -40,7 +40,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink private TileEntity getEnergySinkTile() { - IPartHost host = (IPartHost) this; + final IPartHost host = (IPartHost) this; return host.getTile(); } @@ -56,7 +56,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink private boolean isTileValid() { - TileEntity te = this.getEnergySinkTile(); + final TileEntity te = this.getEnergySinkTile(); if( te == null ) { @@ -105,9 +105,9 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink } int interested = 0; - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergyTile ) { interested++; @@ -132,14 +132,14 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink } @Override - public boolean acceptsEnergyFrom( TileEntity emitter, ForgeDirection direction ) + public boolean acceptsEnergyFrom( final TileEntity emitter, final ForgeDirection direction ) { if( !this.isInIC2() ) { return false; } - IPart part = this.getPart( direction ); + final IPart part = this.getPart( direction ); if( part instanceof IEnergySink ) { return ( (IEnergyAcceptor) part ).acceptsEnergyFrom( emitter, direction ); @@ -162,9 +162,9 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink // this is a flawed implementation, that requires a change to the IC2 API. - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergySink ) { // use lower number cause ic2 deletes power it sends that isn't received. @@ -182,16 +182,16 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink } @Override - public double injectEnergy( ForgeDirection directionFrom, double amount, double voltage ) + public double injectEnergy( final ForgeDirection directionFrom, final double amount, final double voltage ) { if( !this.isInIC2() ) { return amount; } - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergySink ) { return ( (IEnergySink) part ).injectEnergy( directionFrom, amount, voltage ); diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySource.java b/src/main/java/appeng/parts/layers/LayerIEnergySource.java index 8f32e385..cb080568 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySource.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySource.java @@ -41,7 +41,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource private TileEntity getEnergySourceTile() { - IPartHost host = (IPartHost) this; + final IPartHost host = (IPartHost) this; return host.getTile(); } @@ -56,7 +56,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource private boolean isTileValid() { - TileEntity te = this.getEnergySourceTile(); + final TileEntity te = this.getEnergySourceTile(); if( te == null ) { return false; @@ -103,9 +103,9 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource } int interested = 0; - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergyTile ) { interested++; @@ -130,14 +130,14 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource } @Override - public boolean emitsEnergyTo( TileEntity receiver, ForgeDirection direction ) + public boolean emitsEnergyTo( final TileEntity receiver, final ForgeDirection direction ) { if( !this.isInIC2() ) { return false; } - IPart part = this.getPart( direction ); + final IPart part = this.getPart( direction ); if( part instanceof IEnergySink ) { return ( (IEnergyEmitter) part ).emitsEnergyTo( receiver, direction ); @@ -160,9 +160,9 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource // this is a flawed implementation, that requires a change to the IC2 API. - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergySource ) { // use lower number cause ic2 deletes power it sends that isn't received. @@ -174,13 +174,13 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource } @Override - public void drawEnergy( double amount ) + public void drawEnergy( final double amount ) { // this is a flawed implementation, that requires a change to the IC2 API. - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergySource ) { ( (IEnergySource) part ).drawEnergy( amount ); @@ -194,9 +194,9 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource { // this is a flawed implementation, that requires a change to the IC2 API. - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IEnergySource ) { return ( (IEnergySource) part ).getSourceTier(); diff --git a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java index 3b3d3eaa..d989d775 100644 --- a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java +++ b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java @@ -34,9 +34,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler static final FluidTankInfo[] EMPTY_LIST = new FluidTankInfo[0]; @Override - public int fill( ForgeDirection from, FluidStack resource, boolean doFill ) + public int fill( final ForgeDirection from, final FluidStack resource, final boolean doFill ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).fill( from, resource, doFill ); @@ -45,9 +45,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler } @Override - public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final FluidStack resource, final boolean doDrain ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).drain( from, resource, doDrain ); @@ -56,9 +56,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler } @Override - public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final int maxDrain, final boolean doDrain ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).drain( from, maxDrain, doDrain ); @@ -67,9 +67,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler } @Override - public boolean canFill( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid ) + public boolean canFill( final ForgeDirection from, final net.minecraftforge.fluids.Fluid fluid ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).canFill( from, fluid ); @@ -78,9 +78,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler } @Override - public boolean canDrain( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid ) + public boolean canDrain( final ForgeDirection from, final net.minecraftforge.fluids.Fluid fluid ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).canDrain( from, fluid ); @@ -89,9 +89,9 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler } @Override - public FluidTankInfo[] getTankInfo( ForgeDirection from ) + public FluidTankInfo[] getTankInfo( final ForgeDirection from ) { - IPart part = this.getPart( from ); + final IPart part = this.getPart( from ); if( part instanceof IFluidHandler ) { return ( (IFluidHandler) part ).getTankInfo( from ); diff --git a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java index 1e40ad7f..f87d5dc5 100644 --- a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java +++ b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java @@ -34,9 +34,9 @@ public class LayerIPipeConnection extends LayerBase implements IPipeConnection { @Override - public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with ) + public ConnectOverride overridePipeConnection( final PipeType type, final ForgeDirection with ) { - IPart part = this.getPart( with ); + final IPart part = this.getPart( with ); if( part instanceof IPipeConnection ) { return ( (IPipeConnection) part ).overridePipeConnection( type, with ); diff --git a/src/main/java/appeng/parts/layers/LayerISidedInventory.java b/src/main/java/appeng/parts/layers/LayerISidedInventory.java index e7252f54..4ce6d6f1 100644 --- a/src/main/java/appeng/parts/layers/LayerISidedInventory.java +++ b/src/main/java/appeng/parts/layers/LayerISidedInventory.java @@ -63,12 +63,12 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory List inventories = new ArrayList(); int slotCount = 0; - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { - IPart bp = this.getPart( side ); + final IPart bp = this.getPart( side ); if( bp instanceof ISidedInventory ) { - ISidedInventory part = (ISidedInventory) bp; + final ISidedInventory part = (ISidedInventory) bp; slotCount += part.getSizeInventory(); inventories.add( part ); } @@ -87,13 +87,13 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory int offsetForLayer = 0; int offsetForPart = 0; - for( ISidedInventory sides : inventories ) + for( final ISidedInventory sides : inventories ) { offsetForPart = 0; slotCount = sides.getSizeInventory(); ForgeDirection currentSide = ForgeDirection.UNKNOWN; - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { if( this.getPart( side ) == sides ) { @@ -102,7 +102,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } } - int[] cSidesList = sideData[currentSide.ordinal()] = new int[slotCount]; + final int[] cSidesList = sideData[currentSide.ordinal()] = new int[slotCount]; for( int cSlot = 0; cSlot < slotCount; cSlot++ ) { cSidesList[cSlot] = offsetForLayer; @@ -138,7 +138,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public ItemStack getStackInSlot( int slot ) + public ItemStack getStackInSlot( final int slot ) { if( this.invLayer == null ) { @@ -149,7 +149,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public ItemStack decrStackSize( int slot, int amount ) + public ItemStack decrStackSize( final int slot, final int amount ) { if( this.invLayer == null ) { @@ -160,13 +160,13 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public ItemStack getStackInSlotOnClosing( int slot ) + public ItemStack getStackInSlotOnClosing( final int slot ) { return null; } @Override - public void setInventorySlotContents( int slot, ItemStack itemstack ) + public void setInventorySlotContents( final int slot, final ItemStack itemstack ) { if( this.invLayer == null ) { @@ -195,7 +195,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -211,7 +211,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public boolean isItemValidForSlot( int slot, ItemStack itemstack ) + public boolean isItemValidForSlot( final int slot, final ItemStack itemstack ) { if( this.invLayer == null ) { @@ -233,7 +233,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public int[] getAccessibleSlotsFromSide( int side ) + public int[] getAccessibleSlotsFromSide( final int side ) { if( this.invLayer != null ) { @@ -244,7 +244,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public boolean canInsertItem( int slot, ItemStack itemstack, int side ) + public boolean canInsertItem( final int slot, final ItemStack itemstack, final int side ) { if( this.invLayer == null ) { @@ -255,7 +255,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory } @Override - public boolean canExtractItem( int slot, ItemStack itemstack, int side ) + public boolean canExtractItem( final int slot, final ItemStack itemstack, final int side ) { if( this.invLayer == null ) { diff --git a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java index a6897042..fbe9de3e 100644 --- a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java +++ b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java @@ -32,9 +32,9 @@ public class LayerITileStorageMonitorable extends LayerBase implements ITileStor { @Override - public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); if( part instanceof ITileStorageMonitorable ) { return ( (ITileStorageMonitorable) part ).getMonitorable( side, src ); diff --git a/src/main/java/appeng/parts/layers/LayerPressure.java b/src/main/java/appeng/parts/layers/LayerPressure.java index 8ef3961b..8f0cdee2 100644 --- a/src/main/java/appeng/parts/layers/LayerPressure.java +++ b/src/main/java/appeng/parts/layers/LayerPressure.java @@ -35,9 +35,9 @@ public class LayerPressure extends LayerBase implements ISidedPneumaticMachine @Nullable @Override - public IAirHandler getAirHandler( ForgeDirection side ) + public IAirHandler getAirHandler( final ForgeDirection side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); if( part instanceof ISidedPneumaticMachine ) { return ( (ISidedPneumaticMachine) part ).getAirHandler( side ); diff --git a/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java b/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java index fdc35b67..182ca0c1 100644 --- a/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java +++ b/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java @@ -42,7 +42,7 @@ public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment { @Nullable @Override - public Node sidedNode( ForgeDirection side ) + public Node sidedNode( final ForgeDirection side ) { final IPart part = this.getPart( side ); if( part instanceof SidedEnvironment ) @@ -53,7 +53,7 @@ public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment } @Override - public boolean canConnect( ForgeDirection side ) + public boolean canConnect( final ForgeDirection side ) { final IPart part = this.getPart( side ); if( part instanceof SidedEnvironment ) diff --git a/src/main/java/appeng/parts/misc/PartCableAnchor.java b/src/main/java/appeng/parts/misc/PartCableAnchor.java index 55019091..0ff0c637 100644 --- a/src/main/java/appeng/parts/misc/PartCableAnchor.java +++ b/src/main/java/appeng/parts/misc/PartCableAnchor.java @@ -58,13 +58,13 @@ public class PartCableAnchor implements IPart IPartHost host = null; ForgeDirection mySide = ForgeDirection.UP; - public PartCableAnchor( ItemStack is ) + public PartCableAnchor( final ItemStack is ) { this.is = is; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) { @@ -77,14 +77,14 @@ public class PartCableAnchor implements IPart } @Override - public ItemStack getItemStack( PartItemStack wrenched ) + public ItemStack getItemStack( final PartItemStack wrenched ) { return this.is; } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper instance, final RenderBlocks renderer ) { instance.setTexture( this.is.getIconIndex() ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); @@ -94,10 +94,10 @@ public class PartCableAnchor implements IPart @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); - IIcon myIcon = this.is.getIconIndex(); + final IIcon myIcon = this.is.getIconIndex(); rh.setTexture( myIcon ); if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) { @@ -113,7 +113,7 @@ public class PartCableAnchor implements IPart @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer ) { } @@ -143,13 +143,13 @@ public class PartCableAnchor implements IPart } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { } @@ -161,7 +161,7 @@ public class PartCableAnchor implements IPart } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return this.mySide.offsetY == 0 && ( entity.isCollidedHorizontally || !entity.onGround ); } @@ -185,13 +185,13 @@ public class PartCableAnchor implements IPart } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { return false; } @@ -203,7 +203,7 @@ public class PartCableAnchor implements IPart } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { } @@ -227,26 +227,26 @@ public class PartCableAnchor implements IPart } @Override - public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final ForgeDirection side, final IPartHost host, final TileEntity tile ) { this.host = host; this.mySide = side; } @Override - public boolean onActivate( EntityPlayer player, Vec3 pos ) + public boolean onActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public boolean onShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onShiftActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { } @@ -259,19 +259,19 @@ public class PartCableAnchor implements IPart @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World world, int x, int y, int z, Random r ) + public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r ) { } @Override - public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { } @Override - public boolean canBePlacedOn( BusSupport what ) + public boolean canBePlacedOn( final BusSupport what ) { return what == BusSupport.CABLE || what == BusSupport.DENSE_CABLE; } diff --git a/src/main/java/appeng/parts/misc/PartInterface.java b/src/main/java/appeng/parts/misc/PartInterface.java index 71dfb374..fac7d0ad 100644 --- a/src/main/java/appeng/parts/misc/PartInterface.java +++ b/src/main/java/appeng/parts/misc/PartInterface.java @@ -79,39 +79,39 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto final DualityInterface duality = new DualityInterface( this.proxy, this ); @Reflected - public PartInterface( ItemStack is ) + public PartInterface( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void stateChange( MENetworkChannelsChanged c ) + public void stateChange( final MENetworkChannelsChanged c ) { this.duality.notifyNeighbors(); } @MENetworkEventSubscribe - public void stateChange( MENetworkPowerStatusChange c ) + public void stateChange( final MENetworkPowerStatusChange c ) { this.duality.notifyNeighbors(); } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 2, 2, 14, 14, 14, 16 ); bch.addBox( 5, 5, 12, 11, 11, 14 ); } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.duality.getInstalledUpgrades( u ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); @@ -133,7 +133,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); @@ -155,14 +155,14 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.duality.readFromNBT( data ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.duality.writeToNBT( data ); @@ -176,7 +176,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { this.duality.addDrops( drops ); } @@ -194,13 +194,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return this.duality.getInventoryByName( name ); } @Override - public boolean onPartActivate( EntityPlayer p, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer p, final Vec3 pos ) { if( p.isSneaking() ) { @@ -222,7 +222,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { return this.duality.canInsert( stack ); } @@ -240,13 +240,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return this.duality.getTickingRequest( node ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.duality.tickingRequest( node, ticksSinceLastCall ); } @@ -258,25 +258,25 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.duality.getStorage().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.duality.getStorage().decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.duality.getStorage().getStackInSlotOnClosing( i ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.duality.getStorage().setInventorySlotContents( i, itemstack ); } @@ -306,7 +306,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.duality.getStorage().isUseableByPlayer( entityplayer ); } @@ -324,31 +324,31 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.duality.getStorage().isItemValidForSlot( i, itemstack ); } @Override - public int[] getAccessibleSlotsFromSide( int s ) + public int[] getAccessibleSlotsFromSide( final int s ) { return this.duality.getAccessibleSlotsFromSide( s ); } @Override - public boolean canInsertItem( int i, ItemStack itemstack, int j ) + public boolean canInsertItem( final int i, final ItemStack itemstack, final int j ) { return true; } @Override - public boolean canExtractItem( int i, ItemStack itemstack, int j ) + public boolean canExtractItem( final int i, final ItemStack itemstack, final int j ) { return true; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.duality.onChangeInventory( inv, slot, mc, removedStack, newStack ); } @@ -372,13 +372,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src ) { return this.duality.getMonitorable( side, src, this ); } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return this.duality.pushPattern( patternDetails, table ); } @@ -390,7 +390,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { this.duality.provideCrafting( craftingTracker ); } @@ -402,13 +402,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { return this.duality.injectCraftedItems( link, items, mode ); } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.duality.jobStateChange( link ); } @@ -420,7 +420,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.duality.setPriority( newValue ); } diff --git a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java index fbc3885d..986a4139 100644 --- a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java @@ -27,7 +27,7 @@ import appeng.helpers.Reflected; public class PartInvertedToggleBus extends PartToggleBus { @Reflected - public PartInvertedToggleBus( ItemStack is ) + public PartInvertedToggleBus( final ItemStack is ) { super( is ); this.proxy.setIdlePowerUsage( 0.0 ); diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index 790bbbd2..bf5a4b8b 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -105,7 +105,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC private byte resetCacheLogic = 0; @Reflected - public PartStorageBus( ItemStack is ) + public PartStorageBus( final ItemStack is ) { super( is ); this.getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE ); @@ -116,14 +116,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.updateStatus(); } private void updateStatus() { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -132,7 +132,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); this.host.markForUpdate(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -140,7 +140,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @MENetworkEventSubscribe - public void updateChannels( MENetworkChannelsChanged changedChannels ) + public void updateChannels( final MENetworkChannelsChanged changedChannels ) { this.updateStatus(); } @@ -152,14 +152,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.resetCache( true ); this.host.markForSave(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); @@ -177,7 +177,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.Config.readFromNBT( data, "config" ); @@ -185,7 +185,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.Config.writeToNBT( data, "config" ); @@ -193,7 +193,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -203,7 +203,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return super.getInventoryByName( name ); } - private void resetCache( boolean fullReset ) + private void resetCache( final boolean fullReset ) { if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorldObj() == null || this.host.getTile().getWorldObj().isRemote ) { @@ -223,20 +223,20 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { this.proxy.getTick().alertDevice( this.proxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return this.handler == verificationToken; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { try { @@ -245,7 +245,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -258,7 +258,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 3, 3, 15, 13, 13, 16 ); bch.addBox( 2, 2, 14, 14, 14, 15 ); @@ -267,7 +267,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); @@ -283,7 +283,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); @@ -320,7 +320,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -337,13 +337,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.resetCacheLogic != 0 ) { @@ -360,10 +360,10 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC private void resetCache() { - boolean fullReset = this.resetCacheLogic == 2; + final boolean fullReset = this.resetCacheLogic == 2; this.resetCacheLogic = 0; - IMEInventory in = this.getInternalHandler(); + final IMEInventory in = this.getInternalHandler(); IItemList before = AEApi.instance().storage().createItemList(); if( in != null ) { @@ -376,7 +376,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.handlerHash = 0; } - IMEInventory out = this.getInternalHandler(); + final IMEInventory out = this.getInternalHandler(); if( this.monitor != null ) { @@ -399,13 +399,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return this.handler; } - boolean wasSleeping = this.monitor == null; + final boolean wasSleeping = this.monitor == null; this.cached = true; - TileEntity self = this.getHost().getTile(); - TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); + final TileEntity self = this.getHost().getTile(); + final TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); - int newHandlerHash = Platform.generateTileHash( target ); + final int newHandlerHash = Platform.generateTileHash( target ); if( this.handlerHash == newHandlerHash && this.handlerHash != 0 ) { @@ -417,7 +417,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC // force grid to update handlers... this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :3 } @@ -427,14 +427,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.monitor = null; if( target != null ) { - IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); + final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); if( esh != null ) { - IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); + final IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc ); if( inv instanceof MEMonitorIInventory ) { - MEMonitorIInventory h = (MEMonitorIInventory) inv; + final MEMonitorIInventory h = (MEMonitorIInventory) inv; h.mode = (StorageFilter) this.getConfigManager().getSetting( Settings.STORAGE_FILTER ); h.mySource = new MachineSource( this ); } @@ -454,12 +454,12 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST ); this.handler.setPriority( this.priority ); - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { - IAEItemStack is = this.Config.getAEStackInSlot( x ); + final IAEItemStack is = this.Config.getAEStackInSlot( x ); if( is != null ) { priorityList.add( is ); @@ -488,7 +488,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { try { - ITickManager tm = this.proxy.getTick(); + final ITickManager tm = this.proxy.getTick(); if( this.monitor == null ) { tm.sleepDevice( this.proxy.getNode() ); @@ -498,7 +498,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC tm.wakeDevice( this.proxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -507,7 +507,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return this.handler; } - private void checkInterfaceVsStorageBus( TileEntity target, ForgeDirection side ) + private void checkInterfaceVsStorageBus( final TileEntity target, final ForgeDirection side ) { IInterfaceHost achievement = null; @@ -518,7 +518,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC if( target instanceof IPartHost ) { - Object part = ( (IPartHost) target ).getPart( side ); + final Object part = ( (IPartHost) target ).getPart( side ); if( part instanceof IInterfaceHost ) { achievement = (IInterfaceHost) part; @@ -533,11 +533,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( channel == StorageChannel.ITEMS ) { - IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null; + final IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null; if( out != null ) { return Collections.singletonList( out ); @@ -553,7 +553,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.host.markForSave(); @@ -561,19 +561,19 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { } @Override @Method( iname = IntegrationType.BuildCraftTransport ) - public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with ) + public ConnectOverride overridePipeConnection( final PipeType type, final ForgeDirection with ) { return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT; } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { // nope! } diff --git a/src/main/java/appeng/parts/misc/PartToggleBus.java b/src/main/java/appeng/parts/misc/PartToggleBus.java index 4ac779c3..6576af8e 100644 --- a/src/main/java/appeng/parts/misc/PartToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartToggleBus.java @@ -59,7 +59,7 @@ public class PartToggleBus extends PartBasicState boolean hasRedstone = false; @Reflected - public PartToggleBus( ItemStack is ) + public PartToggleBus( final ItemStack is ) { super( is ); @@ -70,14 +70,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void setColors( boolean hasChan, boolean hasPower ) + public void setColors( final boolean hasChan, final boolean hasPower ) { this.hasRedstone = ( this.clientFlags & REDSTONE_FLAG ) == REDSTONE_FLAG; super.setColors( hasChan && this.hasRedstone, hasPower && this.hasRedstone ); } @Override - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf | ( this.getIntention() ? REDSTONE_FLAG : 0 ); } @@ -94,7 +94,7 @@ public class PartToggleBus extends PartBasicState } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.GLASS; } @@ -104,7 +104,7 @@ public class PartToggleBus extends PartBasicState { if( this.is.stackSize > 0 ) { - List items = new ArrayList(); + final List items = new ArrayList(); items.add( this.is.copy() ); this.host.removePart( this.side, false ); Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items ); @@ -113,14 +113,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 11, 10, 10, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.2, -0.3, 0.0 ); @@ -145,7 +145,7 @@ public class PartToggleBus extends PartBasicState @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( this.is.getIconIndex() ); @@ -167,7 +167,7 @@ public class PartToggleBus extends PartBasicState @Override public void onNeighborChanged() { - boolean oldHasRedstone = this.hasRedstone; + final boolean oldHasRedstone = this.hasRedstone; this.hasRedstone = this.getHost().hasRedstone( this.side ); if( this.hasRedstone != oldHasRedstone ) @@ -178,14 +178,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -208,7 +208,7 @@ public class PartToggleBus extends PartBasicState } @Override - public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final ForgeDirection side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side ) ); @@ -227,7 +227,7 @@ public class PartToggleBus extends PartBasicState } @Override - public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); @@ -235,7 +235,7 @@ public class PartToggleBus extends PartBasicState private void updateInternalState() { - boolean intention = this.getIntention(); + final boolean intention = this.getIntention(); if( intention == ( this.connection == null ) ) { if( this.proxy.getNode() != null && this.outerProxy.getNode() != null ) @@ -246,7 +246,7 @@ public class PartToggleBus extends PartBasicState { this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // :( } diff --git a/src/main/java/appeng/parts/networking/PartCable.java b/src/main/java/appeng/parts/networking/PartCable.java index cc4a4800..12fd272d 100644 --- a/src/main/java/appeng/parts/networking/PartCable.java +++ b/src/main/java/appeng/parts/networking/PartCable.java @@ -74,7 +74,7 @@ public class PartCable extends AEBasePart implements IPartCable EnumSet connections = EnumSet.noneOf( ForgeDirection.class ); boolean powered = false; - public PartCable( ItemStack is ) + public PartCable( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.PREFERRED ); @@ -101,7 +101,7 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public boolean changeColor( AEColor newColor, EntityPlayer who ) + public boolean changeColor( final AEColor newColor, final EntityPlayer who ) { if( this.getCableColor() != newColor ) { @@ -132,7 +132,7 @@ public class PartCable extends AEBasePart implements IPartCable { hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -153,13 +153,13 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void setValidSides( EnumSet sides ) + public void setValidSides( final EnumSet sides ) { this.proxy.setValidSides( sides ); } @Override - public boolean isConnected( ForgeDirection side ) + public boolean isConnected( final ForgeDirection side ) { return this.connections.contains( side ); } @@ -170,13 +170,13 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -187,15 +187,15 @@ public class PartCable extends AEBasePart implements IPartCable } } - IPartHost ph = this.getHost(); + final IPartHost ph = this.getHost(); if( ph != null ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart p = ph.getPart( dir ); + final IPart p = ph.getPart( dir ); if( p instanceof IGridHost ) { - double dist = p.cableConnectionRenderTo(); + final double dist = p.cableConnectionRenderTo(); if( dist > 8 ) { @@ -228,7 +228,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { switch( of ) { @@ -257,7 +257,7 @@ public class PartCable extends AEBasePart implements IPartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -267,12 +267,12 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( null ); } - public IIcon getTexture( AEColor c ) + public IIcon getTexture( final AEColor c ) { return this.getGlassTexture( c ); } - public IIcon getGlassTexture( AEColor c ) + public IIcon getGlassTexture( final AEColor c ) { switch( c ) { @@ -325,19 +325,19 @@ public class PartCable extends AEBasePart implements IPartCable @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); boolean useCovered = false; boolean requireDetailed = false; - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - IPart p = this.getHost().getPart( dir ); + final IPart p = this.getHost().getPart( dir ); if( p instanceof IGridHost ) { - IGridHost igh = (IGridHost) p; - AECableType type = igh.getCableConnectionType( dir.getOpposite() ); + final IGridHost igh = (IGridHost) p; + final AECableType type = igh.getCableConnectionType( dir.getOpposite() ); if( type == AECableType.COVERED || type == AECableType.SMART ) { useCovered = true; @@ -346,9 +346,9 @@ public class PartCable extends AEBasePart implements IPartCable } else if( this.connections.contains( dir ) ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; if( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS ) { requireDetailed = true; @@ -365,13 +365,13 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( this.getTexture( this.getCableColor() ) ); } - IPartHost ph = this.getHost(); - for( ForgeDirection of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final ForgeDirection of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -415,17 +415,17 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( x, y, z, renderer ); } - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { this.renderGlassConnection( x, y, z, rh, renderer, of ); } } else { - IIcon def = this.getTexture( this.getCableColor() ); + final IIcon def = this.getTexture( this.getCableColor() ); rh.setTexture( def ); - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) ); switch( of ) @@ -457,18 +457,18 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); if( Platform.isServer() ) { - IGridNode node = this.getGridNode(); + final IGridNode node = this.getGridNode(); if( node != null ) { int howMany = 0; - for( IGridConnection gc : node.getConnections() ) + for( final IGridConnection gc : node.getConnections() ) { howMany = Math.max( gc.getUsedChannels(), howMany ); } @@ -479,23 +479,23 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { int cs = 0; int sideOut = 0; - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { - for( ForgeDirection thisSide : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection thisSide : ForgeDirection.VALID_DIRECTIONS ) { - IPart part = this.getHost().getPart( thisSide ); + final IPart part = this.getHost().getPart( thisSide ); if( part != null ) { if( part.getGridNode() != null ) { - IReadOnlyCollection set = part.getGridNode().getConnections(); - for( IGridConnection gc : set ) + final IReadOnlyCollection set = part.getGridNode().getConnections(); + for( final IGridConnection gc : set ) { if( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) ) { @@ -510,13 +510,13 @@ public class PartCable extends AEBasePart implements IPartCable } } - for( IGridConnection gc : n.getConnections() ) + for( final IGridConnection gc : n.getConnections() ) { - ForgeDirection side = gc.getDirection( n ); + final ForgeDirection side = gc.getDirection( n ); if( side != ForgeDirection.UNKNOWN ) { - boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); - boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); + final boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); + final boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); if( isTier2a && isTier2b ) { @@ -538,7 +538,7 @@ public class PartCable extends AEBasePart implements IPartCable cs |= ( 1 << ForgeDirection.UNKNOWN.ordinal() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // aww... } @@ -548,21 +548,21 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - int cs = data.readByte(); - int sideOut = data.readInt(); + final int cs = data.readByte(); + final int sideOut = data.readInt(); - EnumSet myC = this.connections.clone(); - boolean wasPowered = this.powered; + final EnumSet myC = this.connections.clone(); + final boolean wasPowered = this.powered; this.powered = false; boolean channelsChanged = false; - for( ForgeDirection d : ForgeDirection.values() ) + for( final ForgeDirection d : ForgeDirection.values() ) { if( d != ForgeDirection.UNKNOWN ) { - int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF; + final int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF; if( ch != this.channelsOnSide[d.ordinal()] ) { channelsChanged = true; @@ -572,7 +572,7 @@ public class PartCable extends AEBasePart implements IPartCable if( d == ForgeDirection.UNKNOWN ) { - int id = 1 << d.ordinal(); + final int id = 1 << d.ordinal(); if( id == ( cs & id ) ) { this.powered = true; @@ -580,7 +580,7 @@ public class PartCable extends AEBasePart implements IPartCable } else { - int id = 1 << d.ordinal(); + final int id = 1 << d.ordinal(); if( id == ( cs & id ) ) { this.connections.add( d ); @@ -602,7 +602,7 @@ public class PartCable extends AEBasePart implements IPartCable return this.getTexture( this.getCableColor() ); } - public IIcon getCoveredTexture( AEColor c ) + public IIcon getCoveredTexture( final AEColor c ) { switch( c ) { @@ -647,17 +647,17 @@ public class PartCable extends AEBasePart implements IPartCable return coveredCable.item( AEColor.Transparent ).getIconIndex( coveredCableStack ); } - protected boolean nonLinear( EnumSet sides ) + protected boolean nonLinear( final EnumSet sides ) { return ( sides.contains( ForgeDirection.EAST ) && sides.contains( ForgeDirection.WEST ) ) || ( sides.contains( ForgeDirection.NORTH ) && sides.contains( ForgeDirection.SOUTH ) ) || ( sides.contains( ForgeDirection.UP ) && sides.contains( ForgeDirection.DOWN ) ); } @SideOnly( Side.CLIENT ) - public void renderGlassConnection( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, ForgeDirection of ) + public void renderGlassConnection( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer, final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); @@ -729,11 +729,11 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - public void renderCoveredConnection( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of ) + public void renderCoveredConnection( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer, final int channels, final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); if( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent ) @@ -810,11 +810,11 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - public void renderSmartConnection( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of ) + public void renderSmartConnection( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer, final int channels, final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) ); @@ -854,13 +854,13 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( x, y, z, renderer ); this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); if( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( false, true ); } @@ -918,8 +918,8 @@ public class PartCable extends AEBasePart implements IPartCable { this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); @@ -934,7 +934,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - public IIcon getSmartTexture( AEColor c ) + public IIcon getSmartTexture( final AEColor c ) { switch( c ) { @@ -980,7 +980,7 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - protected void setSmartConnectionRotations( ForgeDirection of, RenderBlocks renderer ) + protected void setSmartConnectionRotations( final ForgeDirection of, final RenderBlocks renderer ) { switch( of ) { @@ -1013,7 +1013,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - protected CableBusTextures getChannelTex( int i, boolean b ) + protected CableBusTextures getChannelTex( int i, final boolean b ) { if( !this.powered ) { @@ -1055,7 +1055,7 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - protected void renderAllFaces( AEBaseBlock blk, int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + protected void renderAllFaces( final AEBaseBlock blk, final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, (float) renderer.renderMinZ * 16.0f, (float) renderer.renderMaxX * 16.0f, (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f ); rh.renderFace( x, y, z, blk.getRendererInstance().getTexture( ForgeDirection.WEST ), ForgeDirection.WEST, renderer ); diff --git a/src/main/java/appeng/parts/networking/PartCableCovered.java b/src/main/java/appeng/parts/networking/PartCableCovered.java index 001034a8..8eb88543 100644 --- a/src/main/java/appeng/parts/networking/PartCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartCableCovered.java @@ -50,19 +50,19 @@ import appeng.util.Platform; public class PartCableCovered extends PartCable { @Reflected - public PartCableCovered( ItemStack is ) + public PartCableCovered( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @@ -74,13 +74,13 @@ public class PartCableCovered extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -91,7 +91,7 @@ public class PartCableCovered extends PartCable } } - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { switch( of ) { @@ -120,7 +120,7 @@ public class PartCableCovered extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -130,7 +130,7 @@ public class PartCableCovered extends PartCable OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) { rh.renderInventoryFace( main, side, renderer ); } @@ -139,14 +139,14 @@ public class PartCableCovered extends PartCable offV = 0; main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) { rh.renderInventoryFace( main, side, renderer ); } main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) { rh.renderInventoryFace( main, side, renderer ); } @@ -155,25 +155,25 @@ public class PartCableCovered extends PartCable } @Override - public IIcon getTexture( AEColor c ) + public IIcon getTexture( final AEColor c ) { return this.getCoveredTexture( c ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = this.getHost(); - for( ForgeDirection of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final ForgeDirection of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { if( of != ForgeDirection.UNKNOWN ) @@ -182,7 +182,7 @@ public class PartCableCovered extends PartCable hasBuses = true; } - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -215,7 +215,7 @@ public class PartCableCovered extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } @@ -226,9 +226,9 @@ public class PartCableCovered extends PartCable } else { - IIcon def = this.getTexture( this.getCableColor() ); - IIcon off = new OffsetIcon( def, 0, -12 ); - for( ForgeDirection of : this.connections ) + final IIcon def = this.getTexture( this.getCableColor() ); + final IIcon off = new OffsetIcon( def, 0, -12 ); + for( final ForgeDirection of : this.connections ) { switch( of ) { diff --git a/src/main/java/appeng/parts/networking/PartCableGlass.java b/src/main/java/appeng/parts/networking/PartCableGlass.java index 246d0760..4c9525e5 100644 --- a/src/main/java/appeng/parts/networking/PartCableGlass.java +++ b/src/main/java/appeng/parts/networking/PartCableGlass.java @@ -27,7 +27,7 @@ import appeng.helpers.Reflected; public class PartCableGlass extends PartCable { @Reflected - public PartCableGlass( ItemStack is ) + public PartCableGlass( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/networking/PartCableSmart.java b/src/main/java/appeng/parts/networking/PartCableSmart.java index 624282e4..06b39868 100644 --- a/src/main/java/appeng/parts/networking/PartCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartCableSmart.java @@ -54,19 +54,19 @@ import appeng.util.Platform; public class PartCableSmart extends PartCable { @Reflected - public PartCableSmart( ItemStack is ) + public PartCableSmart( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @@ -78,13 +78,13 @@ public class PartCableSmart extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -95,7 +95,7 @@ public class PartCableSmart extends PartCable } } - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { switch( of ) { @@ -124,7 +124,7 @@ public class PartCableSmart extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -135,7 +135,7 @@ public class PartCableSmart extends PartCable OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -149,7 +149,7 @@ public class PartCableSmart extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -161,7 +161,7 @@ public class PartCableSmart extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -173,25 +173,25 @@ public class PartCableSmart extends PartCable } @Override - public IIcon getTexture( AEColor c ) + public IIcon getTexture( final AEColor c ) { return this.getSmartTexture( c ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = this.getHost(); - for( ForgeDirection of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final ForgeDirection of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { if( of != ForgeDirection.UNKNOWN ) @@ -200,7 +200,7 @@ public class PartCableSmart extends PartCable hasBuses = true; } - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -229,13 +229,13 @@ public class PartCableSmart extends PartCable rh.renderBlock( x, y, z, renderer ); this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); + final IIcon firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); + final IIcon secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); if( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( false, true ); } @@ -257,7 +257,7 @@ public class PartCableSmart extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } @@ -270,21 +270,21 @@ public class PartCableSmart extends PartCable { ForgeDirection selectedSide = ForgeDirection.UNKNOWN; - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { selectedSide = of; break; } - int channels = this.channelsOnSide[selectedSide.ordinal()]; - IIcon def = this.getTexture( this.getCableColor() ); - IIcon off = new OffsetIcon( def, 0, -12 ); + final int channels = this.channelsOnSide[selectedSide.ordinal()]; + final IIcon def = this.getTexture( this.getCableColor() ); + final IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); + final IIcon firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IIcon firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); - IIcon secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); - IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); + final IIcon secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); switch( selectedSide ) { @@ -319,8 +319,8 @@ public class PartCableSmart extends PartCable renderer.uvRotateSouth = 0; renderer.uvRotateNorth = 0; - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( false, true ); renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 ); diff --git a/src/main/java/appeng/parts/networking/PartDenseCable.java b/src/main/java/appeng/parts/networking/PartDenseCable.java index c4b258fe..2b50f85b 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCable.java +++ b/src/main/java/appeng/parts/networking/PartDenseCable.java @@ -58,7 +58,7 @@ import appeng.util.Platform; public class PartDenseCable extends PartCable { @Reflected - public PartDenseCable( ItemStack is ) + public PartDenseCable( final ItemStack is ) { super( is ); @@ -78,17 +78,17 @@ public class PartDenseCable extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { - boolean noLadder = !bch.isBBCollision(); - double min = noLadder ? 3.0 : 4.9; - double max = noLadder ? 13.0 : 11.1; + final boolean noLadder = !bch.isBBCollision(); + final double min = noLadder ? 3.0 : 4.9; + final double max = noLadder ? 13.0 : 11.1; bch.addBox( min, min, min, max, max, max ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -99,7 +99,7 @@ public class PartDenseCable extends PartCable } } - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { if( this.isDense( of ) ) { @@ -156,7 +156,7 @@ public class PartDenseCable extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f ); @@ -168,7 +168,7 @@ public class PartDenseCable extends PartCable OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -181,7 +181,7 @@ public class PartDenseCable extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -192,7 +192,7 @@ public class PartDenseCable extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); - for( ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) + for( final ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -203,7 +203,7 @@ public class PartDenseCable extends PartCable } @Override - public IIcon getTexture( AEColor c ) + public IIcon getTexture( final AEColor c ) { if( c == AEColor.Transparent ) { @@ -215,15 +215,15 @@ public class PartDenseCable extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( this.getTexture( this.getCableColor() ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { if( !this.isDense( of ) ) { @@ -233,7 +233,7 @@ public class PartDenseCable extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { if( this.isDense( of ) ) { @@ -257,21 +257,21 @@ public class PartDenseCable extends PartCable { ForgeDirection selectedSide = ForgeDirection.UNKNOWN; - for( ForgeDirection of : this.connections ) + for( final ForgeDirection of : this.connections ) { selectedSide = of; break; } - int channels = this.channelsOnSide[selectedSide.ordinal()]; - IIcon def = this.getTexture( this.getCableColor() ); - IIcon off = new OffsetIcon( def, 0, -12 ); + final int channels = this.channelsOnSide[selectedSide.ordinal()]; + final IIcon def = this.getTexture( this.getCableColor() ); + final IIcon off = new OffsetIcon( def, 0, -12 ); - IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 ); + final IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 ); - IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); - IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 ); + final IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 ); switch( selectedSide ) { @@ -306,8 +306,8 @@ public class PartDenseCable extends PartCable renderer.uvRotateSouth = 0; renderer.uvRotateNorth = 0; - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( false, true ); renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 ); @@ -315,8 +315,8 @@ public class PartDenseCable extends PartCable Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); - FlippableIcon fpA = new FlippableIcon( firstIcon ); - FlippableIcon fpB = new FlippableIcon( secondIcon ); + final FlippableIcon fpA = new FlippableIcon( firstIcon ); + final FlippableIcon fpB = new FlippableIcon( secondIcon ); fpA.setFlip( true, false ); fpB.setFlip( true, false ); @@ -360,11 +360,11 @@ public class PartDenseCable extends PartCable } @SideOnly( Side.CLIENT ) - public void renderDenseConnection( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of ) + public void renderDenseConnection( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer, final int channels, final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); /* * ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && @@ -433,13 +433,13 @@ public class PartDenseCable extends PartCable rh.renderBlock( x, y, z, renderer ); rh.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) ); - boolean isGlass = false; + final boolean isGlass = false; if( !isGlass ) { this.setSmartConnectionRotations( of, renderer ); - IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 ); Tessellator.instance.setColorOpaque_I( myColor.blackVariant ); @@ -454,18 +454,18 @@ public class PartDenseCable extends PartCable } } - private boolean isSmart( ForgeDirection of ) + private boolean isSmart( final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); + final TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); if( te instanceof IGridHost ) { - AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); + final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); return t == AECableType.SMART; } return false; } - private IIcon getDenseTexture( AEColor c ) + private IIcon getDenseTexture( final AEColor c ) { switch( c ) { @@ -507,25 +507,25 @@ public class PartDenseCable extends PartCable return this.is.getIconIndex(); } - private boolean isDense( ForgeDirection of ) + private boolean isDense( final ForgeDirection of ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); + final TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ ); if( te instanceof IGridHost ) { - AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); + final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); return t == AECableType.DENSE; } return false; } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } diff --git a/src/main/java/appeng/parts/networking/PartQuartzFiber.java b/src/main/java/appeng/parts/networking/PartQuartzFiber.java index c2f2e116..df175597 100644 --- a/src/main/java/appeng/parts/networking/PartQuartzFiber.java +++ b/src/main/java/appeng/parts/networking/PartQuartzFiber.java @@ -54,7 +54,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true ); - public PartQuartzFiber( ItemStack is ) + public PartQuartzFiber( final ItemStack is ) { super( is ); this.proxy.setIdlePowerUsage( 0 ); @@ -64,20 +64,20 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.GLASS; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 10, 10, 10, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { GL11.glTranslated( -0.2, -0.3, 0.0 ); @@ -89,9 +89,9 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { - IIcon myIcon = this.is.getIconIndex(); + final IIcon myIcon = this.is.getIconIndex(); rh.setTexture( myIcon ); rh.setBounds( 6, 6, 10, 10, 10, 16 ); rh.renderBlock( x, y, z, renderer ); @@ -99,14 +99,14 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -127,7 +127,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final ForgeDirection side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side ) ); @@ -146,33 +146,33 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); } @Override - public double extractAEPower( double amt, Actionable mode, Set seen ) + public double extractAEPower( final double amt, final Actionable mode, final Set seen ) { double acquiredPower = 0; try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -181,31 +181,31 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public double injectAEPower( double amt, Actionable mode, Set seen ) + public double injectAEPower( final double amt, final Actionable mode, final Set seen ) { try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); if( !seen.contains( eg ) ) { return eg.injectAEPower( amt, mode, seen ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); if( !seen.contains( eg ) ) { return eg.injectAEPower( amt, mode, seen ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -214,26 +214,26 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public double getEnergyDemand( double amt, Set seen ) + public double getEnergyDemand( final double amt, final Set seen ) { double demand = 0; try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java index 5b844f71..d1151064 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java @@ -51,7 +51,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i double OutputVoltageA; double OutputVoltageB; - public PartP2PIC2Power( ItemStack is ) + public PartP2PIC2Power( final ItemStack is ) { super( is ); } @@ -64,7 +64,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { super.readFromNBT( tag ); this.OutputEnergyA = tag.getDouble( "OutputPacket" ); @@ -74,7 +74,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { super.writeToNBT( tag ); tag.setDouble( "OutputPacket", this.OutputEnergyA ); @@ -96,7 +96,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public boolean acceptsEnergyFrom( TileEntity emitter, ForgeDirection direction ) + public boolean acceptsEnergyFrom( final TileEntity emitter, final ForgeDirection direction ) { if( !this.output ) { @@ -106,7 +106,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public boolean emitsEnergyTo( TileEntity receiver, ForgeDirection direction ) + public boolean emitsEnergyTo( final TileEntity receiver, final ForgeDirection direction ) { if( this.output ) { @@ -125,7 +125,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i try { - for( PartP2PIC2Power t : this.getOutputs() ) + for( final PartP2PIC2Power t : this.getOutputs() ) { if( t.OutputEnergyA <= 0.0001 || t.OutputEnergyB <= 0.0001 ) { @@ -133,7 +133,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return 0; } @@ -148,14 +148,14 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public double injectEnergy( ForgeDirection directionFrom, double amount, double voltage ) + public double injectEnergy( final ForgeDirection directionFrom, final double amount, final double voltage ) { - TunnelCollection outs; + final TunnelCollection outs; try { outs = this.getOutputs(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return amount; } @@ -165,8 +165,8 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i return amount; } - LinkedList options = new LinkedList(); - for( PartP2PIC2Power o : outs ) + final LinkedList options = new LinkedList(); + for( final PartP2PIC2Power o : outs ) { if( o.OutputEnergyA <= 0.01 ) { @@ -176,7 +176,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if( options.isEmpty() ) { - for( PartP2PIC2Power o : outs ) + for( final PartP2PIC2Power o : outs ) { if( o.OutputEnergyB <= 0.01 ) { @@ -187,7 +187,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i if( options.isEmpty() ) { - for( PartP2PIC2Power o : outs ) + for( final PartP2PIC2Power o : outs ) { options.add( o ); } @@ -198,7 +198,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i return amount; } - PartP2PIC2Power x = Platform.pickRandom( options ); + final PartP2PIC2Power x = Platform.pickRandom( options ); if( x != null && x.OutputEnergyA <= 0.001 ) { @@ -235,7 +235,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i } @Override - public void drawEnergy( double amount ) + public void drawEnergy( final double amount ) { this.OutputEnergyA -= amount; if( this.OutputEnergyA < 0.001 ) @@ -258,7 +258,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i return 4; } - private int calculateTierFromVoltage( double voltage ) + private int calculateTierFromVoltage( final double voltage ) { return ic2.api.energy.EnergyNet.instance.getTierFromPower( voltage ); } diff --git a/src/main/java/appeng/parts/p2p/PartP2PItems.java b/src/main/java/appeng/parts/p2p/PartP2PItems.java index aa2d78f9..6081e588 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PItems.java +++ b/src/main/java/appeng/parts/p2p/PartP2PItems.java @@ -70,7 +70,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo boolean requested; IInventory cachedInv; - public PartP2PItems( ItemStack is ) + public PartP2PItems( final ItemStack is ) { super( is ); } @@ -79,7 +79,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo public void onNeighborChanged() { this.cachedInv = null; - PartP2PItems input = this.getInput(); + final PartP2PItems input = this.getInput(); if( input != null && this.output ) { input.onTunnelNetworkChange(); @@ -95,21 +95,21 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo return this.cachedInv; } - List outs = new LinkedList(); - TunnelCollection itemTunnels; + final List outs = new LinkedList(); + final TunnelCollection itemTunnels; try { itemTunnels = this.getOutputs(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return new AppEngNullInventory(); } - for( PartP2PItems t : itemTunnels ) + for( final PartP2PItems t : itemTunnels ) { - IInventory inv = t.getOutputInv(); + final IInventory inv = t.getOutputInv(); if( inv != null ) { if( Platform.getRandomInt() % 2 == 0 ) @@ -132,7 +132,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo if( this.proxy.isActive() ) { - TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); + final TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); if( this.which.contains( this ) ) { @@ -150,7 +150,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo { output = new WrapperBCPipe( te, this.side.getOpposite() ); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } } @@ -185,15 +185,15 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ItemTunnel.min, TickRates.ItemTunnel.max, false, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { - boolean wasReq = this.requested; + final boolean wasReq = this.requested; if( this.requested && this.cachedInv != null ) { @@ -205,12 +205,12 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @MENetworkEventSubscribe - public void changeStateA( MENetworkBootingStatusChange bs ) + public void changeStateA( final MENetworkBootingStatusChange bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -220,12 +220,12 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @MENetworkEventSubscribe - public void changeStateB( MENetworkChannelsChanged bs ) + public void changeStateB( final MENetworkChannelsChanged bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -235,12 +235,12 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @MENetworkEventSubscribe - public void changeStateC( MENetworkPowerStatusChange bs ) + public void changeStateC( final MENetworkPowerStatusChange bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -262,7 +262,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -271,7 +271,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } else { - PartP2PItems input = this.getInput(); + final PartP2PItems input = this.getInput(); if( input != null ) { input.getHost().notifyNeighbors(); @@ -280,9 +280,9 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @Override - public int[] getAccessibleSlotsFromSide( int var1 ) + public int[] getAccessibleSlotsFromSide( final int var1 ) { - int[] slots = new int[this.getSizeInventory()]; + final int[] slots = new int[this.getSizeInventory()]; for( int x = 0; x < this.getSizeInventory(); x++ ) { slots[x] = x; @@ -297,25 +297,25 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.getDestination().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.getDestination().decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.getDestination().setInventorySlotContents( i, itemstack ); } @@ -345,7 +345,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -361,19 +361,19 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo } @Override - public boolean isItemValidForSlot( int i, net.minecraft.item.ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final net.minecraft.item.ItemStack itemstack ) { return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override - public boolean canInsertItem( int i, ItemStack itemstack, int j ) + public boolean canInsertItem( final int i, final ItemStack itemstack, final int j ) { return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override - public boolean canExtractItem( int i, ItemStack itemstack, int j ) + public boolean canExtractItem( final int i, final ItemStack itemstack, final int j ) { return false; } @@ -385,7 +385,7 @@ public class PartP2PItems extends PartP2PTunnel implements IPipeCo @Override @Method( iname = IntegrationType.BuildCraftTransport ) - public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with ) + public ConnectOverride overridePipeConnection( final PipeType type, final ForgeDirection with ) { return this.side == with && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLight.java b/src/main/java/appeng/parts/p2p/PartP2PLight.java index 747e1f49..bd98d97c 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLight.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLight.java @@ -49,34 +49,34 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi int lastValue = 0; float opacity = -1; - public PartP2PLight( ItemStack is ) + public PartP2PLight( final ItemStack is ) { super( is ); } @Override - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.onTunnelNetworkChange(); super.chanRender( c ); } @Override - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.onTunnelNetworkChange(); super.powerRender( c ); } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); data.writeInt( this.output ? this.lastValue : 0 ); } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { super.readFromStream( data ); this.lastValue = data.readInt(); @@ -91,22 +91,22 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi return false; } - TileEntity te = this.getTile(); - World w = te.getWorldObj(); + final TileEntity te = this.getTile(); + final World w = te.getWorldObj(); - int newLevel = w.getBlockLightValue( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); + final int newLevel = w.getBlockLightValue( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); if( this.lastValue != newLevel && this.proxy.isActive() ) { this.lastValue = newLevel; try { - for( PartP2PLight out : this.getOutputs() ) + for( final PartP2PLight out : this.getOutputs() ) { out.setLightLevel( this.lastValue ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -139,17 +139,17 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi return 0; } - public void setLightLevel( int out ) + public void setLightLevel( final int out ) { this.lastValue = out; this.getHost().markForUpdate(); } - private int blockLight( int emit ) + private int blockLight( final int emit ) { if( this.opacity < 0 ) { - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ ); } @@ -164,7 +164,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { super.readFromNBT( tag ); if( tag.hasKey( "opacity" ) ) @@ -175,7 +175,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { super.writeToNBT( tag ); tag.setFloat( "opacity", this.opacity ); @@ -193,7 +193,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi { if( this.output ) { - PartP2PLight src = this.getInput(); + final PartP2PLight src = this.getInput(); if( src != null && src.proxy.isActive() ) { this.setLightLevel( src.lastValue ); @@ -210,13 +210,13 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.LightTunnel.min, TickRates.LightTunnel.max, false, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java index f41a4416..9bdb9feb 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java @@ -49,7 +49,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl IFluidHandler cachedTank; private int tmpUsed; - public PartP2PLiquids( ItemStack is ) + public PartP2PLiquids( final ItemStack is ) { super( is ); } @@ -78,7 +78,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl this.cachedTank = null; if( this.output ) { - PartP2PLiquids in = this.getInput(); + final PartP2PLiquids in = this.getInput(); if( in != null ) { in.onTunnelNetworkChange(); @@ -87,11 +87,11 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } @Override - public int fill( ForgeDirection from, FluidStack resource, boolean doFill ) + public int fill( final ForgeDirection from, final FluidStack resource, final boolean doFill ) { - Stack stack = this.getDepth(); + final Stack stack = this.getDepth(); - for( PartP2PLiquids t : stack ) + for( final PartP2PLiquids t : stack ) { if( t == this ) { @@ -101,14 +101,14 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl stack.push( this ); - List list = this.getOutputs( resource.getFluid() ); + final List list = this.getOutputs( resource.getFluid() ); int requestTotal = 0; Iterator i = list.iterator(); while( i.hasNext() ) { - PartP2PLiquids l = i.next(); - IFluidHandler tank = l.getTarget(); + final PartP2PLiquids l = i.next(); + final IFluidHandler tank = l.getTarget(); if( tank != null ) { l.tmpUsed = tank.fill( l.side.getOpposite(), resource.copy(), false ); @@ -154,16 +154,16 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl int used = 0; while( i.hasNext() ) { - PartP2PLiquids l = i.next(); + final PartP2PLiquids l = i.next(); - FluidStack insert = resource.copy(); + final FluidStack insert = resource.copy(); insert.amount = (int) Math.ceil( insert.amount * ( (double) l.tmpUsed / (double) requestTotal ) ); if( insert.amount > available ) { insert.amount = available; } - IFluidHandler tank = l.getTarget(); + final IFluidHandler tank = l.getTarget(); if( tank != null ) { l.tmpUsed = tank.fill( l.side.getOpposite(), insert.copy(), true ); @@ -197,15 +197,15 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return s; } - List getOutputs( Fluid input ) + List getOutputs( final Fluid input ) { - List outs = new LinkedList(); + final List outs = new LinkedList(); try { - for( PartP2PLiquids l : this.getOutputs() ) + for( final PartP2PLiquids l : this.getOutputs() ) { - IFluidHandler handler = l.getTarget(); + final IFluidHandler handler = l.getTarget(); if( handler != null ) { if( handler.canFill( l.side.getOpposite(), input ) ) @@ -215,7 +215,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -235,7 +235,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return this.cachedTank; } - TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); + final TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ ); if( te instanceof IFluidHandler ) { return this.cachedTank = (IFluidHandler) te; @@ -245,31 +245,31 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } @Override - public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( ForgeDirection from, Fluid fluid ) + public boolean canFill( final ForgeDirection from, final Fluid fluid ) { return !this.output && from == this.side && !this.getOutputs( fluid ).isEmpty(); } @Override - public boolean canDrain( ForgeDirection from, Fluid fluid ) + public boolean canDrain( final ForgeDirection from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( ForgeDirection from ) + public FluidTankInfo[] getTankInfo( final ForgeDirection from ) { if( from == this.side ) { @@ -282,7 +282,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl { if( this.output ) { - PartP2PLiquids tun = this.getInput(); + final PartP2PLiquids tun = this.getInput(); if( tun != null ) { return ACTIVE_TANK; @@ -297,7 +297,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return ACTIVE_TANK; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } diff --git a/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java b/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java index ce4fba71..c64e4656 100644 --- a/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java +++ b/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java @@ -62,7 +62,7 @@ public final class PartP2POpenComputers extends PartP2PTunnel updateCallback; - public PartP2POpenComputers( ItemStack is ) + public PartP2POpenComputers( final ItemStack is ) { super( is ); @@ -109,14 +109,14 @@ public final class PartP2POpenComputers extends PartP2PTunnel implem private final IAirHandler handler; private boolean isConnected = false; - public PartP2PPressure( ItemStack is ) + public PartP2PPressure( final ItemStack is ) { super( is ); this.handler = AirHandlerSupplier.getAirHandler( MAX_PRESSURE, MAX_PRESSURE, VOLUME ); @@ -73,7 +73,7 @@ public final class PartP2PPressure extends PartP2PTunnel implem @Nullable @Override - public IAirHandler getAirHandler( ForgeDirection side ) + public IAirHandler getAirHandler( final ForgeDirection side ) { if( side == this.side ) { @@ -110,13 +110,13 @@ public final class PartP2PPressure extends PartP2PTunnel implem } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.PressureTunnel.min, TickRates.PressureTunnel.max, false, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int TicksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int TicksSinceLastCall ) { if( this.proxy.isPowered() && this.proxy.isActive() ) { @@ -133,7 +133,7 @@ public final class PartP2PPressure extends PartP2PTunnel implem } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); final NBTTagCompound pneumaticNBT = new NBTTagCompound(); @@ -143,7 +143,7 @@ public final class PartP2PPressure extends PartP2PTunnel implem } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.getInternalHandler().readFromNBTI( data.getCompoundTag( PRESSURE_NBT_TAG ) ); diff --git a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java index 554626c7..06a9ffd6 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java @@ -52,7 +52,7 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen private boolean cachedTarget = false; private IEnergyReceiver outputTarget; - public PartP2PRFPower( ItemStack is ) + public PartP2PRFPower( final ItemStack is ) { super( is ); } @@ -79,7 +79,7 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen } @Override - public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate ) + public int receiveEnergy( final ForgeDirection from, int maxReceive, final boolean simulate ) { if( this.output ) { @@ -88,9 +88,9 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen if( this.isActive() ) { - Stack stack = this.getDepth(); + final Stack stack = this.getDepth(); - for( PartP2PRFPower t : stack ) + for( final PartP2PRFPower t : stack ) { if( t == this ) { @@ -104,11 +104,11 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen try { - for( PartP2PRFPower t : this.getOutputs() ) + for( final PartP2PRFPower t : this.getOutputs() ) { if( Platform.getRandomInt() % 2 > 0 ) { - int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); + final int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); maxReceive -= receiver; total += receiver; @@ -121,9 +121,9 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen if( maxReceive > 0 ) { - for( PartP2PRFPower t : this.getOutputs() ) + for( final PartP2PRFPower t : this.getOutputs() ) { - int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); + final int receiver = t.getOutput().receiveEnergy( t.side.getOpposite(), maxReceive, simulate ); maxReceive -= receiver; total += receiver; @@ -136,7 +136,7 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen this.queueTunnelDrain( PowerUnits.RF, total ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } @@ -169,8 +169,8 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen { if( !this.cachedTarget ) { - TileEntity self = this.getTile(); - TileEntity te = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); + final TileEntity self = this.getTile(); + final TileEntity te = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ ); this.outputTarget = te instanceof IEnergyReceiver ? (IEnergyReceiver) te : null; this.cachedTarget = true; } @@ -186,16 +186,16 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen } @Override - public int getEnergyStored( ForgeDirection from ) + public int getEnergyStored( final ForgeDirection from ) { if( this.output || !this.isActive() ) { return 0; } - Stack stack = this.getDepth(); + final Stack stack = this.getDepth(); - for( PartP2PRFPower t : stack ) + for( final PartP2PRFPower t : stack ) { if( t == this ) { @@ -208,12 +208,12 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen int total = 0; try { - for( PartP2PRFPower t : this.getOutputs() ) + for( final PartP2PRFPower t : this.getOutputs() ) { total += t.getOutput().getEnergyStored( t.side.getOpposite() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return 0; } @@ -227,16 +227,16 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen } @Override - public int getMaxEnergyStored( ForgeDirection from ) + public int getMaxEnergyStored( final ForgeDirection from ) { if( this.output || !this.isActive() ) { return 0; } - Stack stack = this.getDepth(); + final Stack stack = this.getDepth(); - for( PartP2PRFPower t : stack ) + for( final PartP2PRFPower t : stack ) { if( t == this ) { @@ -249,12 +249,12 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen int total = 0; try { - for( PartP2PRFPower t : this.getOutputs() ) + for( final PartP2PRFPower t : this.getOutputs() ) { total += t.getOutput().getMaxEnergyStored( t.side.getOpposite() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return 0; } @@ -268,7 +268,7 @@ public final class PartP2PRFPower extends PartP2PTunnel implemen } @Override - public boolean canConnectEnergy( ForgeDirection from ) + public boolean canConnectEnergy( final ForgeDirection from ) { return true; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java index 894a34ee..b4af9f58 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java @@ -44,13 +44,13 @@ public class PartP2PRedstone extends PartP2PTunnel int power; boolean recursive = false; - public PartP2PRedstone( ItemStack is ) + public PartP2PRedstone( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void changeStateA( MENetworkBootingStatusChange bs ) + public void changeStateA( final MENetworkBootingStatusChange bs ) { this.setNetworkReady(); } @@ -59,7 +59,7 @@ public class PartP2PRedstone extends PartP2PTunnel { if( this.output ) { - PartP2PRedstone in = this.getInput(); + final PartP2PRedstone in = this.getInput(); if( in != null ) { this.putInput( in.power ); @@ -67,7 +67,7 @@ public class PartP2PRedstone extends PartP2PTunnel } } - protected void putInput( Object o ) + protected void putInput( final Object o ) { if( this.recursive ) { @@ -77,7 +77,7 @@ public class PartP2PRedstone extends PartP2PTunnel this.recursive = true; if( this.output && this.proxy.isActive() ) { - int newPower = (Integer) o; + final int newPower = (Integer) o; if( this.power != newPower ) { this.power = newPower; @@ -89,11 +89,11 @@ public class PartP2PRedstone extends PartP2PTunnel public void notifyNeighbors() { - World worldObj = this.tile.getWorldObj(); + final World worldObj = this.tile.getWorldObj(); - int xCoord = this.tile.xCoord; - int yCoord = this.tile.yCoord; - int zCoord = this.tile.zCoord; + final int xCoord = this.tile.xCoord; + final int yCoord = this.tile.yCoord; + final int zCoord = this.tile.zCoord; Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord ); @@ -107,13 +107,13 @@ public class PartP2PRedstone extends PartP2PTunnel } @MENetworkEventSubscribe - public void changeStateB( MENetworkChannelsChanged bs ) + public void changeStateB( final MENetworkChannelsChanged bs ) { this.setNetworkReady(); } @MENetworkEventSubscribe - public void changeStateC( MENetworkPowerStatusChange bs ) + public void changeStateC( final MENetworkPowerStatusChange bs ) { this.setNetworkReady(); } @@ -126,14 +126,14 @@ public class PartP2PRedstone extends PartP2PTunnel } @Override - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { super.readFromNBT( tag ); this.power = tag.getInteger( "power" ); } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { super.writeToNBT( tag ); tag.setInteger( "power", this.power ); @@ -155,11 +155,11 @@ public class PartP2PRedstone extends PartP2PTunnel { if( !this.output ) { - int x = this.tile.xCoord + this.side.offsetX; - int y = this.tile.yCoord + this.side.offsetY; - int z = this.tile.zCoord + this.side.offsetZ; + final int x = this.tile.xCoord + this.side.offsetX; + final int y = this.tile.yCoord + this.side.offsetY; + final int z = this.tile.zCoord + this.side.offsetZ; - Block b = this.tile.getWorldObj().getBlock( x, y, z ); + final Block b = this.tile.getWorldObj().getBlock( x, y, z ); if( b != null && !this.output ) { int srcSide = this.side.ordinal(); @@ -196,16 +196,16 @@ public class PartP2PRedstone extends PartP2PTunnel return this.output ? this.power : 0; } - private void sendToOutput( int power ) + private void sendToOutput( final int power ) { try { - for( PartP2PRedstone rs : this.getOutputs() ) + for( final PartP2PRedstone rs : this.getOutputs() ) { rs.putInput( power ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java index 62b69046..a681e920 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java @@ -65,12 +65,12 @@ public abstract class PartP2PTunnel extends PartBasicSt public boolean output; public long freq; - public PartP2PTunnel( ItemStack is ) + public PartP2PTunnel( final ItemStack is ) { super( is ); } - public TunnelCollection getCollection( Collection collection, Class c ) + public TunnelCollection getCollection( final Collection collection, final Class c ) { if( this.type.matches( c ) ) { @@ -90,13 +90,13 @@ public abstract class PartP2PTunnel extends PartBasicSt try { - PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq ); + final PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq ); if( this.getClass().isInstance( tunnel ) ) { return (T) tunnel; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -113,7 +113,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5, 5, 12, 11, 11, 13 ); bch.addBox( 3, 3, 13, 13, 13, 14 ); @@ -122,7 +122,7 @@ public abstract class PartP2PTunnel extends PartBasicSt @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setTexture( this.getTypeTexture() ); @@ -153,7 +153,7 @@ public abstract class PartP2PTunnel extends PartBasicSt @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( this.getTypeTexture() ); @@ -181,7 +181,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public ItemStack getItemStack( PartItemStack type ) + public ItemStack getItemStack( final PartItemStack type ) { if( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick ) { @@ -198,7 +198,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.output = data.getBoolean( "output" ); @@ -206,7 +206,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setBoolean( "output", this.output ); @@ -226,44 +226,44 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); // UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); // AELog.info( "ID:" + id.toString() + " : " + is.getItemDamage() ); - TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is ); + final TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is ); if( is != null && is.getItem() instanceof IMemoryCard ) { - IMemoryCard mc = (IMemoryCard) is.getItem(); - NBTTagCompound data = mc.getData( is ); + final IMemoryCard mc = (IMemoryCard) is.getItem(); + final NBTTagCompound data = mc.getData( is ); - ItemStack newType = ItemStack.loadItemStackFromNBT( data ); - long freq = data.getLong( "freq" ); + final ItemStack newType = ItemStack.loadItemStackFromNBT( data ); + final long freq = data.getLong( "freq" ); if( newType != null ) { if( newType.getItem() instanceof IPartItem ) { - IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType ); + final IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType ); if( testPart instanceof PartP2PTunnel ) { this.getHost().removePart( this.side, true ); - ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); - IPart newBus = this.getHost().getPart( dir ); + final ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); + final IPart newBus = this.getHost().getPart( dir ); if( newBus instanceof PartP2PTunnel ) { - PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; + final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; newTunnel.output = true; try { - P2PCache p2p = newTunnel.proxy.getP2P(); + final P2PCache p2p = newTunnel.proxy.getP2P(); p2p.updateFreq( newTunnel, freq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -287,63 +287,63 @@ public abstract class PartP2PTunnel extends PartBasicSt switch( tt ) { case LIGHT: - for( ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() ) { newType = stack; } break; case RF_POWER: - for( ItemStack stack : parts.p2PTunnelRF().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelRF().maybeStack( 1 ).asSet() ) { newType = stack; } break; case FLUID: - for( ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() ) { newType = stack; } break; case IC2_POWER: - for( ItemStack stack : parts.p2PTunnelEU().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelEU().maybeStack( 1 ).asSet() ) { newType = stack; } break; case ITEM: - for( ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() ) { newType = stack; } break; case ME: - for( ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() ) { newType = stack; } break; case REDSTONE: - for( ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() ) { newType = stack; } break; case COMPUTER_MESSAGE: - for( ItemStack stack : parts.p2PTunnelOpenComputers().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelOpenComputers().maybeStack( 1 ).asSet() ) { newType = stack; } break; case PRESSURE: - for( ItemStack stack : parts.p2PTunnelPneumaticCraft().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelPneumaticCraft().maybeStack( 1 ).asSet() ) { newType = stack; } @@ -355,25 +355,25 @@ public abstract class PartP2PTunnel extends PartBasicSt if( newType != null && !Platform.isSameItem( newType, this.is ) ) { - boolean oldOutput = this.output; - long myFreq = this.freq; + final boolean oldOutput = this.output; + final long myFreq = this.freq; this.getHost().removePart( this.side, false ); - ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); - IPart newBus = this.getHost().getPart( dir ); + final ForgeDirection dir = this.getHost().addPart( newType, this.side, player ); + final IPart newBus = this.getHost().getPart( dir ); if( newBus instanceof PartP2PTunnel ) { - PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; + final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; newTunnel.output = oldOutput; newTunnel.onTunnelNetworkChange(); try { - P2PCache p2p = newTunnel.proxy.getP2P(); + final P2PCache p2p = newTunnel.proxy.getP2P(); p2p.updateFreq( newTunnel, myFreq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -388,16 +388,16 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); if( is != null && is.getItem() instanceof IMemoryCard ) { - IMemoryCard mc = (IMemoryCard) is.getItem(); - NBTTagCompound data = new NBTTagCompound(); + final IMemoryCard mc = (IMemoryCard) is.getItem(); + final NBTTagCompound data = new NBTTagCompound(); long newFreq = this.freq; - boolean wasOutput = this.output; + final boolean wasOutput = this.output; this.output = false; if( wasOutput || this.freq == 0 ) @@ -409,15 +409,15 @@ public abstract class PartP2PTunnel extends PartBasicSt { this.proxy.getP2P().updateFreq( this, newFreq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } this.onTunnelConfigChange(); - ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench ); - String type = p2pItem.getUnlocalizedName(); + final ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench ); + final String type = p2pItem.getUnlocalizedName(); p2pItem.writeToNBT( data ); data.setLong( "freq", this.freq ); @@ -445,15 +445,15 @@ public abstract class PartP2PTunnel extends PartBasicSt return CableBusTextures.BlockP2PTunnel2.getIcon(); } - protected void queueTunnelDrain( PowerUnits unit, double f ) + protected void queueTunnelDrain( final PowerUnits unit, final double f ) { - double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS ); + final double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS ); try { this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java index e4e5e70e..b1d9e3cb 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java @@ -53,7 +53,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public final Connections connection = new Connections( this ); final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true ); - public PartP2PTunnelME( ItemStack is ) + public PartP2PTunnelME( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL ); @@ -61,14 +61,14 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -84,7 +84,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I { this.proxy.getTick().wakeDevice( this.proxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -92,7 +92,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.DENSE; } @@ -112,7 +112,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final ForgeDirection side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side ) ); @@ -125,20 +125,20 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.METunnel.min, TickRates.METunnel.max, true, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { // just move on... try @@ -167,7 +167,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I return TickRateModulation.SLEEP; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh? } @@ -175,11 +175,11 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I return TickRateModulation.IDLE; } - public void updateConnections( Connections connections ) + public void updateConnections( final Connections connections ) { if( connections.destroy ) { - for( TunnelConnection cw : this.connection.connections.values() ) + for( final TunnelConnection cw : this.connection.connections.values() ) { cw.c.destroy(); } @@ -189,10 +189,10 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I else if( connections.create ) { - Iterator i = this.connection.connections.values().iterator(); + final Iterator i = this.connection.connections.values().iterator(); while( i.hasNext() ) { - TunnelConnection cw = i.next(); + final TunnelConnection cw = i.next(); try { if( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() ) @@ -206,16 +206,16 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I i.remove(); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } - LinkedList newSides = new LinkedList(); + final LinkedList newSides = new LinkedList(); try { - for( PartP2PTunnelME me : this.getOutputs() ) + for( final PartP2PTunnelME me : this.getOutputs() ) { if( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null ) { @@ -223,13 +223,13 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } } - for( PartP2PTunnelME me : newSides ) + for( final PartP2PTunnelME me : newSides ) { try { connections.connections.put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { final TileEntity start = this.getTile(); final TileEntity end = me.getTile(); @@ -238,7 +238,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java index 80e056af..bd3aab05 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java @@ -46,14 +46,14 @@ import appeng.client.texture.CableBusTextures; public abstract class AbstractPartDisplay extends AbstractPartReporting { - public AbstractPartDisplay( ItemStack is ) + public AbstractPartDisplay( final ItemStack is ) { super( is, true ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); @@ -78,7 +78,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java index 376add26..732b6348 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java @@ -88,13 +88,13 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements private Integer dspList; @Reflected - public AbstractPartMonitor( ItemStack is ) + public AbstractPartMonitor( final ItemStack is ) { super( is ); } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); @@ -105,7 +105,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); @@ -121,7 +121,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); @@ -134,7 +134,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { boolean needRedraw = super.readFromStream( data ); @@ -159,7 +159,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( Platform.isClient() ) { @@ -225,12 +225,12 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } } - protected void extractItem( EntityPlayer player ) + protected void extractItem( final EntityPlayer player ) { } - private void updateReportingValue( IMEMonitor itemInventory ) + private void updateReportingValue( final IMEMonitor itemInventory ) { if( this.configuredItem != null ) { @@ -260,7 +260,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer ) { if( this.dspList == null ) { @@ -309,7 +309,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements return this.configuredItem; } - private void tesrRenderScreen( Tessellator tess, IAEItemStack ais ) + private void tesrRenderScreen( final Tessellator tess, final IAEItemStack ais ) { // GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); @@ -399,14 +399,14 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void updateWatcher( IStackWatcher newWatcher ) + public void updateWatcher( final IStackWatcher newWatcher ) { this.myWatcher = newWatcher; this.configureWatchers(); } @Override - public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan ) + public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan ) { if( this.configuredItem != null ) { @@ -431,7 +431,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean showNetworkInfo( MovingObjectPosition where ) + public boolean showNetworkInfo( final MovingObjectPosition where ) { return false; } diff --git a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java index 3e70a867..b5f9513f 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java @@ -49,7 +49,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartMonitor_Colored; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartMonitor_Colored; - public AbstractPartPanel( ItemStack is ) + public AbstractPartPanel( final ItemStack is ) { super( is, false ); } @@ -80,7 +80,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) + public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); @@ -99,7 +99,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) + public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer ) { final IIcon sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java index b5ec5507..75c8e429 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java @@ -69,12 +69,12 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM private int clientFlags = 0; // sent as byte. private float opacity = -1; - public AbstractPartReporting( ItemStack is ) + public AbstractPartReporting( final ItemStack is ) { this( is, false ); } - protected AbstractPartReporting( ItemStack is, boolean requireChannel ) + protected AbstractPartReporting( final ItemStack is, final boolean requireChannel ) { super( is ); @@ -90,7 +90,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @MENetworkEventSubscribe - public final void bootingRender( MENetworkBootingStatusChange c ) + public final void bootingRender( final MENetworkBootingStatusChange c ) { if( !this.isLightSource() ) { @@ -99,13 +99,13 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @MENetworkEventSubscribe - public final void powerRender( MENetworkPowerStatusChange c ) + public final void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @Override - public final void getBoxes( IPartCollisionHelper bch ) + public final void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 2, 2, 14, 14, 14, 16 ); bch.addBox( 4, 4, 13, 12, 12, 14 ); @@ -119,7 +119,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); if( data.hasKey( "opacity" ) ) @@ -130,7 +130,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setFloat( "opacity", this.opacity ); @@ -138,7 +138,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); this.clientFlags = this.getSpin() & 3; @@ -169,7 +169,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { super.readFromStream( data ); final int oldFlags = this.getClientFlags(); @@ -189,7 +189,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { final TileEntity te = this.getTile(); @@ -230,7 +230,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public final void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side ) + public final void onPlacement( final EntityPlayer player, final ItemStack held, final ForgeDirection side ) { super.onPlacement( player, held, side ); @@ -245,7 +245,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } } - private final int blockLight( int emit ) + private final int blockLight( final int emit ) { if( this.opacity < 0 ) { diff --git a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java index 22c184c8..c8e379f9 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java @@ -64,7 +64,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement private final IConfigManager cm = new ConfigManager( this ); private final AppEngInternalInventory viewCell = new AppEngInternalInventory( this, 5 ); - public AbstractPartTerminal( ItemStack is ) + public AbstractPartTerminal( final ItemStack is ) { super( is ); @@ -74,7 +74,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { super.getDrops( drops, wrenched ); @@ -94,7 +94,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.cm.readFromNBT( data ); @@ -102,7 +102,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.cm.writeToNBT( data ); @@ -110,7 +110,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !super.onPartActivate( player, pos ) ) { @@ -129,7 +129,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement return false; } - public GuiBridge getGui( EntityPlayer player ) + public GuiBridge getGui( final EntityPlayer player ) { return GuiBridge.GUI_ME; } @@ -163,7 +163,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -175,7 +175,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.host.markForSave(); } diff --git a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java index e0137135..78ca7d33 100644 --- a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java @@ -48,13 +48,13 @@ public class PartConversionMonitor extends AbstractPartMonitor private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartConversionMonitor_Colored; @Reflected - public PartConversionMonitor( ItemStack is ) + public PartConversionMonitor( final ItemStack is ) { super( is ); } @Override - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { if( Platform.isClient() ) { @@ -122,7 +122,7 @@ public class PartConversionMonitor extends AbstractPartMonitor } @Override - protected void extractItem( EntityPlayer player ) + protected void extractItem( final EntityPlayer player ) { final IAEItemStack input = (IAEItemStack) this.getDisplayed(); if( input != null ) diff --git a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java index 9270d32a..2a53039d 100644 --- a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java @@ -41,13 +41,13 @@ public class PartCraftingTerminal extends AbstractPartTerminal private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 ); @Reflected - public PartCraftingTerminal( ItemStack is ) + public PartCraftingTerminal( final ItemStack is ) { super( is ); } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { super.getDrops( drops, wrenched ); @@ -61,21 +61,21 @@ public class PartCraftingTerminal extends AbstractPartTerminal } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.craftingGrid.readFromNBT( data, "craftingGrid" ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.craftingGrid.writeToNBT( data, "craftingGrid" ); } @Override - public GuiBridge getGui( EntityPlayer p ) + public GuiBridge getGui( final EntityPlayer p ) { int x = (int) p.posX; int y = (int) p.posY; @@ -95,7 +95,7 @@ public class PartCraftingTerminal extends AbstractPartTerminal } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "crafting" ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartDarkPanel.java b/src/main/java/appeng/parts/reporting/PartDarkPanel.java index feea7196..d5291240 100644 --- a/src/main/java/appeng/parts/reporting/PartDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartDarkPanel.java @@ -28,7 +28,7 @@ public class PartDarkPanel extends AbstractPartPanel { @Reflected - public PartDarkPanel( ItemStack is ) + public PartDarkPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java index 6a3d9b5b..7a8dc9e6 100644 --- a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java @@ -34,13 +34,13 @@ public class PartInterfaceTerminal extends AbstractPartDisplay private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartInterfaceTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartInterfaceTerm_Colored; - public PartInterfaceTerminal( ItemStack is ) + public PartInterfaceTerminal( final ItemStack is ) { super( is ); } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !super.onPartActivate( player, pos ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartPanel.java b/src/main/java/appeng/parts/reporting/PartPanel.java index 3e0f796b..073ae6da 100644 --- a/src/main/java/appeng/parts/reporting/PartPanel.java +++ b/src/main/java/appeng/parts/reporting/PartPanel.java @@ -28,7 +28,7 @@ public class PartPanel extends AbstractPartPanel { @Reflected - public PartPanel( ItemStack is ) + public PartPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java index 36d9827c..d0cecf08 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java @@ -49,13 +49,13 @@ public class PartPatternTerminal extends AbstractPartTerminal private boolean craftingMode = true; @Reflected - public PartPatternTerminal( ItemStack is ) + public PartPatternTerminal( final ItemStack is ) { super( is ); } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { for( final ItemStack is : this.pattern ) { @@ -67,7 +67,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.setCraftingRecipe( data.getBoolean( "craftingMode" ) ); @@ -77,7 +77,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setBoolean( "craftingMode", this.craftingMode ); @@ -87,7 +87,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public GuiBridge getGui( EntityPlayer p ) + public GuiBridge getGui( final EntityPlayer p ) { int x = (int) p.posX; int y = (int) p.posY; @@ -107,7 +107,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.pattern && slot == 1 ) { @@ -162,14 +162,14 @@ public class PartPatternTerminal extends AbstractPartTerminal return this.craftingMode; } - public void setCraftingRecipe( boolean craftingMode ) + public void setCraftingRecipe( final boolean craftingMode ) { this.craftingMode = craftingMode; this.fixCraftingRecipes(); } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "crafting" ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java index 060522a3..6ba84edd 100644 --- a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java @@ -28,7 +28,7 @@ public class PartSemiDarkPanel extends AbstractPartPanel { @Reflected - public PartSemiDarkPanel( ItemStack is ) + public PartSemiDarkPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java index 50d30b80..c7596c8b 100644 --- a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java @@ -39,7 +39,7 @@ public class PartStorageMonitor extends AbstractPartMonitor private static final CableBusTextures FRONT_COLORED_ICON_LOCKED = CableBusTextures.PartStorageMonitor_Colored_Locked; @Reflected - public PartStorageMonitor( ItemStack is ) + public PartStorageMonitor( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartTerminal.java b/src/main/java/appeng/parts/reporting/PartTerminal.java index e16de395..a12f39a7 100644 --- a/src/main/java/appeng/parts/reporting/PartTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartTerminal.java @@ -27,7 +27,7 @@ import appeng.client.texture.CableBusTextures; public class PartTerminal extends AbstractPartTerminal { - public PartTerminal( ItemStack is ) + public PartTerminal( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/recipes/AEItemResolver.java b/src/main/java/appeng/recipes/AEItemResolver.java index 07405c9e..1d7508e7 100644 --- a/src/main/java/appeng/recipes/AEItemResolver.java +++ b/src/main/java/appeng/recipes/AEItemResolver.java @@ -42,7 +42,7 @@ public class AEItemResolver implements ISubItemResolver { @Override - public Object resolveItemByName( String nameSpace, String itemName ) + public Object resolveItemByName( final String nameSpace, final String itemName ) { if( nameSpace.equals( AppEng.MOD_ID ) ) @@ -121,8 +121,8 @@ public class AEItemResolver implements ISubItemResolver if( itemName.startsWith( "ItemMaterial." ) ) { - String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 ); - MaterialType mt = MaterialType.valueOf( materialName ); + final String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 ); + final MaterialType mt = MaterialType.valueOf( materialName ); // itemName = itemName.substring( 0, itemName.indexOf( "." ) ); if( mt.itemInstance == ItemMultiMaterial.instance && mt.damageValue >= 0 && mt.isRegistered() ) { @@ -132,10 +132,10 @@ public class AEItemResolver implements ISubItemResolver if( itemName.startsWith( "ItemPart." ) ) { - String partName = itemName.substring( itemName.indexOf( '.' ) + 1 ); - PartType pt = PartType.valueOf( partName ); + final String partName = itemName.substring( itemName.indexOf( '.' ) + 1 ); + final PartType pt = PartType.valueOf( partName ); // itemName = itemName.substring( 0, itemName.indexOf( "." ) ); - int dVal = ItemMultiPart.instance.getDamageByType( pt ); + final int dVal = ItemMultiPart.instance.getDamageByType( pt ); if( dVal >= 0 ) { return new ResolverResult( "ItemMultiPart", dVal ); @@ -146,7 +146,7 @@ public class AEItemResolver implements ISubItemResolver return null; } - private Object paintBall( AEColoredItemDefinition partType, String substring, boolean lumen ) + private Object paintBall( final AEColoredItemDefinition partType, final String substring, final boolean lumen ) { AEColor col; @@ -154,7 +154,7 @@ public class AEItemResolver implements ISubItemResolver { col = AEColor.valueOf( substring ); } - catch( Throwable t ) + catch( final Throwable t ) { col = AEColor.Transparent; } @@ -164,11 +164,11 @@ public class AEItemResolver implements ISubItemResolver return null; } - ItemStack is = partType.stack( col, 1 ); + final ItemStack is = partType.stack( col, 1 ); return new ResolverResult( "ItemPaintBall", ( lumen ? 20 : 0 ) + is.getItemDamage() ); } - private Object cableItem( AEColoredItemDefinition partType, String substring ) + private Object cableItem( final AEColoredItemDefinition partType, final String substring ) { AEColor col; @@ -176,12 +176,12 @@ public class AEItemResolver implements ISubItemResolver { col = AEColor.valueOf( substring ); } - catch( Throwable t ) + catch( final Throwable t ) { col = AEColor.Transparent; } - ItemStack is = partType.stack( col, 1 ); + final ItemStack is = partType.stack( col, 1 ); return new ResolverResult( "ItemMultiPart", is.getItemDamage() ); } } diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index 0a3eb415..f1b4f187 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -44,7 +44,7 @@ public class GroupIngredient implements IIngredient boolean isInside = false; - public GroupIngredient( String myName, List ingredients, int qty ) throws RecipeError + public GroupIngredient( final String myName, final List ingredients, final int qty ) throws RecipeError { Preconditions.checkNotNull( myName ); Preconditions.checkNotNull( ingredients ); @@ -54,7 +54,7 @@ public class GroupIngredient implements IIngredient this.name = myName; this.qty = qty; - for( IIngredient ingredient : ingredients ) + for( final IIngredient ingredient : ingredients ) { if( ingredient.isAir() ) { @@ -65,7 +65,7 @@ public class GroupIngredient implements IIngredient this.ingredients = ingredients; } - public IIngredient copy( int qty ) throws RecipeError + public IIngredient copy( final int qty ) throws RecipeError { Preconditions.checkState( qty > 0 ); return new GroupIngredient( this.name, this.ingredients, qty ); @@ -90,17 +90,17 @@ public class GroupIngredient implements IIngredient return new ItemStack[0]; } - List out = new LinkedList(); + final List out = new LinkedList(); this.isInside = true; try { - for( IIngredient i : this.ingredients ) + for( final IIngredient i : this.ingredients ) { try { out.addAll( Arrays.asList( i.getItemStackSet() ) ); } - catch( MissingIngredientError mir ) + catch( final MissingIngredientError mir ) { // oh well this is a group! } @@ -116,7 +116,7 @@ public class GroupIngredient implements IIngredient throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); } - for( ItemStack is : out ) + for( final ItemStack is : out ) { is.stackSize = this.qty; } diff --git a/src/main/java/appeng/recipes/Ingredient.java b/src/main/java/appeng/recipes/Ingredient.java index bd3b1907..65f060cf 100644 --- a/src/main/java/appeng/recipes/Ingredient.java +++ b/src/main/java/appeng/recipes/Ingredient.java @@ -51,7 +51,7 @@ public class Ingredient implements IIngredient private NBTTagCompound nbt = null; private ItemStack[] baked; - public Ingredient( RecipeHandler handler, String input, int qty ) throws RecipeError, MissedIngredientSet + public Ingredient( final RecipeHandler handler, final String input, final int qty ) throws RecipeError, MissedIngredientSet { Preconditions.checkNotNull( handler ); Preconditions.checkNotNull( input ); @@ -70,7 +70,7 @@ public class Ingredient implements IIngredient } this.isAir = false; - String[] parts = input.split( ":" ); + final String[] parts = input.split( ":" ); if( parts.length >= 2 ) { this.nameSpace = handler.alias( parts[0] ); @@ -92,10 +92,10 @@ public class Ingredient implements IIngredient { try { - Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName ); + final Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName ); if( ro instanceof ResolverResult ) { - ResolverResult rr = (ResolverResult) ro; + final ResolverResult rr = (ResolverResult) ro; tmpName = rr.itemName; sel = rr.damageValue; this.nbt = rr.compound; @@ -105,7 +105,7 @@ public class Ingredient implements IIngredient throw new MissedIngredientSet( (ResolverResultSet) ro ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new RecipeError( tmpName + " is not a valid ae2 item definition." ); } @@ -125,7 +125,7 @@ public class Ingredient implements IIngredient { this.meta = Integer.parseInt( parts[2] ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { throw new RecipeError( "Invalid Metadata." ); } @@ -168,7 +168,7 @@ public class Ingredient implements IIngredient if( blk != null ) { - Item it = Item.getItemFromBlock( blk ); + final Item it = Item.getItemFromBlock( blk ); if( it != null ) { return this.makeItemStack( it, this.qty, this.meta, this.nbt ); @@ -199,9 +199,9 @@ public class Ingredient implements IIngredient throw new MissingIngredientError( "Unable to find item: " + this.toString() ); } - private ItemStack makeItemStack( Item it, int quantity, int damageValue, NBTTagCompound compound ) + private ItemStack makeItemStack( final Item it, final int quantity, final int damageValue, final NBTTagCompound compound ) { - ItemStack is = new ItemStack( it, quantity, damageValue ); + final ItemStack is = new ItemStack( it, quantity, damageValue ); is.setTagCompound( compound ); return is; } @@ -216,13 +216,13 @@ public class Ingredient implements IIngredient if( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) ) { - List ores = OreDictionary.getOres( this.itemName ); - ItemStack[] set = ores.toArray( new ItemStack[ores.size()] ); + final List ores = OreDictionary.getOres( this.itemName ); + final ItemStack[] set = ores.toArray( new ItemStack[ores.size()] ); // clone and set qty. for( int x = 0; x < set.length; x++ ) { - ItemStack is = set[x].copy(); + final ItemStack is = set[x].copy(); is.stackSize = this.qty; set[x] = is; } diff --git a/src/main/java/appeng/recipes/IngredientSet.java b/src/main/java/appeng/recipes/IngredientSet.java index 7835adc9..5927d566 100644 --- a/src/main/java/appeng/recipes/IngredientSet.java +++ b/src/main/java/appeng/recipes/IngredientSet.java @@ -42,7 +42,7 @@ public class IngredientSet implements IIngredient private final boolean isInside = false; private ItemStack[] baked; - public IngredientSet( ResolverResultSet rr, int qty ) + public IngredientSet( final ResolverResultSet rr, final int qty ) { Preconditions.checkNotNull( rr ); Preconditions.checkNotNull( rr.name ); @@ -73,7 +73,7 @@ public class IngredientSet implements IIngredient return new ItemStack[0]; } - List out = new LinkedList(); + final List out = new LinkedList(); out.addAll( this.items ); if( out.isEmpty() ) @@ -81,7 +81,7 @@ public class IngredientSet implements IIngredient throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); } - for( ItemStack is : out ) + for( final ItemStack is : out ) { is.stackSize = this.qty; } diff --git a/src/main/java/appeng/recipes/MissedIngredientSet.java b/src/main/java/appeng/recipes/MissedIngredientSet.java index 3b1cb4e5..840f0a6a 100644 --- a/src/main/java/appeng/recipes/MissedIngredientSet.java +++ b/src/main/java/appeng/recipes/MissedIngredientSet.java @@ -28,7 +28,7 @@ public class MissedIngredientSet extends Throwable private static final long serialVersionUID = 2672951714376345807L; private final ResolverResultSet resolverResultSet; - public MissedIngredientSet( ResolverResultSet ro ) + public MissedIngredientSet( final ResolverResultSet ro ) { this.resolverResultSet = ro; } diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index c10c79d2..f8651267 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -88,30 +88,30 @@ public class RecipeHandler implements IRecipeHandler * * @param parent owner of this handler */ - private RecipeHandler( RecipeHandler parent ) + private RecipeHandler( final RecipeHandler parent ) { Preconditions.checkNotNull( parent ); this.data = parent.data; } - private void addCrafting( ICraftHandler ch ) + private void addCrafting( final ICraftHandler ch ) { this.data.handlers.add( ch ); } - public String getName( @Nonnull IIngredient i ) + public String getName( @Nonnull final IIngredient i ) { try { - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { return this.getName( is ); } } - catch( RecipeError ignored ) + catch( final RecipeError ignored ) { } - catch( Throwable t ) + catch( final Throwable t ) { t.printStackTrace(); // :P @@ -120,11 +120,11 @@ public class RecipeHandler implements IRecipeHandler return i.getNameSpace() + ':' + i.getItemName(); } - public String getName( ItemStack is ) throws RecipeError + public String getName( final ItemStack is ) throws RecipeError { Preconditions.checkNotNull( is ); - UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); + final UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); String realName = id.modId + ':' + id.name; if( !id.modId.equals( AppEng.MOD_ID ) && !id.modId.equals( "minecraft" ) ) @@ -144,7 +144,7 @@ public class RecipeHandler implements IRecipeHandler if( maybeCrystalSeedItem.isPresent() && is.getItem() == maybeCrystalSeedItem.get() ) { - int dmg = is.getItemDamage(); + final int dmg = is.getItemDamage(); if( dmg < ItemCrystalSeed.NETHER ) { realName += ".Certus"; @@ -228,11 +228,11 @@ public class RecipeHandler implements IRecipeHandler return realName; } - public String alias( String in ) + public String alias( final String in ) { Preconditions.checkNotNull( in ); - String out = this.data.aliases.get( in ); + final String out = this.data.aliases.get( in ); if( out != null ) { @@ -243,7 +243,7 @@ public class RecipeHandler implements IRecipeHandler } @Override - public void parseRecipes( IRecipeLoader loader, String path ) + public void parseRecipes( final IRecipeLoader loader, final String path ) { Preconditions.checkNotNull( loader ); Preconditions.checkNotNull( path ); @@ -255,7 +255,7 @@ public class RecipeHandler implements IRecipeHandler { reader = loader.getFile( path ); } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "Error Loading Recipe File:" + path ); if( this.data.exceptions ) @@ -274,7 +274,7 @@ public class RecipeHandler implements IRecipeHandler int val = -1; while( ( val = reader.read() ) != -1 ) { - char c = (char) val; + final char c = (char) val; if( c == '\n' ) { @@ -358,7 +358,7 @@ public class RecipeHandler implements IRecipeHandler reader.close(); this.processTokens( loader, path, line ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); if( this.data.crash ) @@ -376,17 +376,17 @@ public class RecipeHandler implements IRecipeHandler throw new IllegalStateException( "Recipes must now be loaded in Init." ); } - Map processed = new HashMap(); + final Map processed = new HashMap(); try { - for( ICraftHandler ch : this.data.handlers ) + for( final ICraftHandler ch : this.data.handlers ) { try { ch.register(); - Class clz = ch.getClass(); - Integer i = processed.get( clz ); + final Class clz = ch.getClass(); + final Integer i = processed.get( clz ); if( i == null ) { processed.put( clz, 1 ); @@ -396,7 +396,7 @@ public class RecipeHandler implements IRecipeHandler processed.put( clz, i + 1 ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { AELog.warning( "Unable to register a recipe: " + e.getMessage() ); if( this.data.exceptions ) @@ -408,7 +408,7 @@ public class RecipeHandler implements IRecipeHandler throw e; } } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { if( this.data.errorOnMissing ) { @@ -425,7 +425,7 @@ public class RecipeHandler implements IRecipeHandler } } } - catch( Throwable e ) + catch( final Throwable e ) { if( this.data.exceptions ) { @@ -437,7 +437,7 @@ public class RecipeHandler implements IRecipeHandler } } - for( Entry e : processed.entrySet() ) + for( final Entry e : processed.entrySet() ) { AELog.info( "Recipes Loading: " + e.getKey().getSimpleName() + ": " + e.getValue() + " loaded." ); } @@ -446,52 +446,52 @@ public class RecipeHandler implements IRecipeHandler { try { - ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) ); + final ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) ); - HashMultimap combined = HashMultimap.create(); + final HashMultimap combined = HashMultimap.create(); - for( String s : this.data.knownItem ) + for( final String s : this.data.knownItem ) { try { - IIngredient i = new Ingredient( this, s, 1 ); + final IIngredient i = new Ingredient( this, s, 1 ); - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { - String realName = this.getName( is ); - List recipes = this.findRecipe( is ); + final String realName = this.getName( is ); + final List recipes = this.findRecipe( is ); if( !recipes.isEmpty() ) { combined.putAll( realName, recipes ); } } } - catch( RecipeError ignored ) + catch( final RecipeError ignored ) { } - catch( MissedIngredientSet ignored ) + catch( final MissedIngredientSet ignored ) { } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } } - for( String realName : combined.keySet() ) + for( final String realName : combined.keySet() ) { int offset = 0; - for( IWebsiteSerializer ws : combined.get( realName ) ) + for( final IWebsiteSerializer ws : combined.get( realName ) ) { - String rew = ws.getPattern( this ); + final String rew = ws.getPattern( this ); if( rew != null && rew.length() > 0 ) { out.putNextEntry( new ZipEntry( realName + '_' + offset + ".txt" ) ); @@ -503,22 +503,22 @@ public class RecipeHandler implements IRecipeHandler out.close(); } - catch( FileNotFoundException e1 ) + catch( final FileNotFoundException e1 ) { AELog.error( e1 ); } - catch( IOException e1 ) + catch( final IOException e1 ) { AELog.error( e1 ); } } } - public List findRecipe( ItemStack output ) + public List findRecipe( final ItemStack output ) { - List out = new LinkedList(); + final List out = new LinkedList(); - for( ICraftHandler ch : this.data.handlers ) + for( final ICraftHandler ch : this.data.handlers ) { try { @@ -527,7 +527,7 @@ public class RecipeHandler implements IRecipeHandler out.add( (IWebsiteSerializer) ch ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -541,18 +541,18 @@ public class RecipeHandler implements IRecipeHandler return this.data; } - private void processTokens( IRecipeLoader loader, String file, int line ) throws RecipeError + private void processTokens( final IRecipeLoader loader, final String file, final int line ) throws RecipeError { try { - IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes(); + final IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes(); if( this.tokens.isEmpty() ) { return; } - int split = this.tokens.indexOf( "->" ); + final int split = this.tokens.indexOf( "->" ); if( split != -1 ) { final String operation = this.tokens.remove( 0 ).toLowerCase( Locale.ENGLISH ); @@ -570,10 +570,10 @@ public class RecipeHandler implements IRecipeHandler } else if( operation.equals( "group" ) ) { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); + final List> inputs = this.parseLines( pre ); if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { @@ -586,14 +586,14 @@ public class RecipeHandler implements IRecipeHandler } else if( operation.equals( "ore" ) ) { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); + final List> inputs = this.parseLines( pre ); if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { - ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) ); + final ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) ); this.addCrafting( ch ); } else @@ -603,13 +603,13 @@ public class RecipeHandler implements IRecipeHandler } else { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); - List> outputs = this.parseLines( post ); + final List> inputs = this.parseLines( pre ); + final List> outputs = this.parseLines( post ); - ICraftHandler ch = cr.getCraftHandlerFor( operation ); + final ICraftHandler ch = cr.getCraftHandlerFor( operation ); if( ch != null ) { @@ -624,7 +624,7 @@ public class RecipeHandler implements IRecipeHandler } else { - String operation = this.tokens.remove( 0 ).toLowerCase(); + final String operation = this.tokens.remove( 0 ).toLowerCase(); if( operation.equals( "exceptions" ) && ( this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" ) ) ) { @@ -676,7 +676,7 @@ public class RecipeHandler implements IRecipeHandler } } } - catch( RecipeError e ) + catch( final RecipeError e ) { AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString() ); if( this.data.exceptions ) @@ -692,15 +692,15 @@ public class RecipeHandler implements IRecipeHandler this.tokens.clear(); } - private List> parseLines( Iterable subList ) throws RecipeError + private List> parseLines( final Iterable subList ) throws RecipeError { - List> out = new LinkedList>(); + final List> out = new LinkedList>(); List cList = new LinkedList(); boolean hasQty = false; int qty = 1; - for( String v : subList ) + for( final String v : subList ) { if( v.equals( "," ) ) { @@ -748,9 +748,9 @@ public class RecipeHandler implements IRecipeHandler return out; } - private IIngredient findIngredient( String v, int qty ) throws RecipeError + private IIngredient findIngredient( final String v, final int qty ) throws RecipeError { - GroupIngredient gi = this.data.groups.get( v ); + final GroupIngredient gi = this.data.groups.get( v ); if( gi != null ) { @@ -761,20 +761,20 @@ public class RecipeHandler implements IRecipeHandler { return new Ingredient( this, v, qty ); } - catch( MissedIngredientSet grp ) + catch( final MissedIngredientSet grp ) { return new IngredientSet( grp.getResolverResultSet(), qty ); } } - private boolean isNumber( CharSequence v ) + private boolean isNumber( final CharSequence v ) { if( v.length() <= 0 ) { return false; } - int l = v.length(); + final int l = v.length(); for( int x = 0; x < l; x++ ) { if( !Character.isDigit( v.charAt( x ) ) ) diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index 4b3023f9..7bfa7080 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -75,20 +75,20 @@ public final class DisassembleRecipe implements IRecipe } @Override - public boolean matches( InventoryCrafting inv, World w ) + public boolean matches( final InventoryCrafting inv, final World w ) { return this.getOutput( inv ) != null; } @Nullable - private ItemStack getOutput( IInventory inventory ) + private ItemStack getOutput( final IInventory inventory ) { int itemCount = 0; ItemStack output = MISMATCHED_STACK; for( int slotIndex = 0; slotIndex < inventory.getSizeInventory(); slotIndex++ ) { - ItemStack stackInSlot = inventory.getStackInSlot( slotIndex ); + final ItemStack stackInSlot = inventory.getStackInSlot( slotIndex ); if( stackInSlot != null ) { // needs a single input in the recipe @@ -99,13 +99,13 @@ public final class DisassembleRecipe implements IRecipe } // handle storage cells - for( ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() ) + for( final ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() ) { // make sure the storage cell stackInSlot empty... - IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS ); + final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS ); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() ); + final IItemList list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() ); if( !list.isEmpty() ) { return null; @@ -116,7 +116,7 @@ public final class DisassembleRecipe implements IRecipe } // handle crafting storage blocks - for( ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() ) + for( final ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() ) { output = craftingStorageStack; } @@ -127,9 +127,9 @@ public final class DisassembleRecipe implements IRecipe } @Nonnull - private Optional getCellOutput( ItemStack compared ) + private Optional getCellOutput( final ItemStack compared ) { - for( Map.Entry entry : this.cellMappings.entrySet() ) + for( final Map.Entry entry : this.cellMappings.entrySet() ) { if( entry.getKey().isSameAs( compared ) ) { @@ -141,9 +141,9 @@ public final class DisassembleRecipe implements IRecipe } @Nonnull - private Optional getNonCellOutput( ItemStack compared ) + private Optional getNonCellOutput( final ItemStack compared ) { - for( Map.Entry entry : this.nonCellMappings.entrySet() ) + for( final Map.Entry entry : this.nonCellMappings.entrySet() ) { if( entry.getKey().isSameAs( compared ) ) { @@ -156,7 +156,7 @@ public final class DisassembleRecipe implements IRecipe @Nullable @Override - public ItemStack getCraftingResult( InventoryCrafting inv ) + public ItemStack getCraftingResult( final InventoryCrafting inv ) { return this.getOutput( inv ); } diff --git a/src/main/java/appeng/recipes/game/FacadeRecipe.java b/src/main/java/appeng/recipes/game/FacadeRecipe.java index cd1a9f35..1d3c51d8 100644 --- a/src/main/java/appeng/recipes/game/FacadeRecipe.java +++ b/src/main/java/appeng/recipes/game/FacadeRecipe.java @@ -50,23 +50,23 @@ public final class FacadeRecipe implements IRecipe } @Override - public boolean matches( InventoryCrafting inv, World w ) + public boolean matches( final InventoryCrafting inv, final World w ) { return this.getOutput( inv, false ) != null; } @Nullable - private ItemStack getOutput( IInventory inv, boolean createFacade ) + private ItemStack getOutput( final IInventory inv, final boolean createFacade ) { if( inv.getStackInSlot( 0 ) == null && inv.getStackInSlot( 2 ) == null && inv.getStackInSlot( 6 ) == null && inv.getStackInSlot( 8 ) == null ) { if( this.anchor.isSameAs( inv.getStackInSlot( 1 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 3 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 5 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 7 ) ) ) { - for( Item facadeItemDefinition : this.maybeFacade.asSet() ) + for( final Item facadeItemDefinition : this.maybeFacade.asSet() ) { final ItemFacade facade = (ItemFacade) facadeItemDefinition; - ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); + final ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); if( facades != null && createFacade ) { facades.stackSize = 4; @@ -80,7 +80,7 @@ public final class FacadeRecipe implements IRecipe } @Override - public ItemStack getCraftingResult( InventoryCrafting inv ) + public ItemStack getCraftingResult( final InventoryCrafting inv ) { return this.getOutput( inv, true ); } diff --git a/src/main/java/appeng/recipes/game/ShapedRecipe.java b/src/main/java/appeng/recipes/game/ShapedRecipe.java index c7f7a9e2..c66c30f5 100644 --- a/src/main/java/appeng/recipes/game/ShapedRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapedRecipe.java @@ -47,11 +47,11 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable private boolean mirrored = true; private boolean disable = false; - public ShapedRecipe( ItemStack result, Object... recipe ) + public ShapedRecipe( final ItemStack result, Object... recipe ) { this.output = result.copy(); - StringBuilder shape = new StringBuilder(); + final StringBuilder shape = new StringBuilder(); int idx = 0; if( recipe[idx] instanceof Boolean ) @@ -69,10 +69,10 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable if( recipe[idx] instanceof String[] ) { - String[] parts = ( (String[]) recipe[idx] ); + final String[] parts = ( (String[]) recipe[idx] ); idx++; - for( String s : parts ) + for( final String s : parts ) { this.width = s.length(); shape.append( s ); @@ -84,7 +84,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { while( recipe[idx] instanceof String ) { - String s = (String) recipe[idx]; + final String s = (String) recipe[idx]; idx++; shape.append( s ); this.width = s.length(); @@ -94,8 +94,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable if( this.width * this.height != shape.length() ) { - StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -103,12 +103,12 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable throw new IllegalStateException( ret.toString() ); } - Map itemMap = new HashMap(); + final Map itemMap = new HashMap(); for( ; idx < recipe.length; idx += 2 ) { - Character chr = (Character) recipe[idx]; - Object in = recipe[idx + 1]; + final Character chr = (Character) recipe[idx]; + final Object in = recipe[idx + 1]; if( in instanceof IIngredient ) { @@ -116,8 +116,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } else { - StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -128,7 +128,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable this.input = new Object[this.width * this.height]; int x = 0; - for( char chr : shape.toString().toCharArray() ) + for( final char chr : shape.toString().toCharArray() ) { this.input[x] = itemMap.get( chr ); x++; @@ -141,7 +141,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @Override - public boolean matches( InventoryCrafting inv, World world ) + public boolean matches( final InventoryCrafting inv, final World world ) { if( this.disable ) { @@ -168,7 +168,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @Override - public ItemStack getCraftingResult( InventoryCrafting var1 ) + public ItemStack getCraftingResult( final InventoryCrafting var1 ) { return this.output.copy(); } @@ -186,7 +186,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @SuppressWarnings( "unchecked" ) - private boolean checkMatch( InventoryCrafting inv, int startX, int startY, boolean mirror ) + private boolean checkMatch( final InventoryCrafting inv, final int startX, final int startY, final boolean mirror ) { if( this.disable ) { @@ -197,8 +197,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { for( int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++ ) { - int subX = x - startX; - int subY = y - startY; + final int subX = x - startX; + final int subY = y - startY; Object target = null; if( subX >= 0 && subY >= 0 && subX < this.width && subY < this.height ) @@ -213,7 +213,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } } - ItemStack slot = inv.getStackInRowAndColumn( x, y ); + final ItemStack slot = inv.getStackInRowAndColumn( x, y ); if( target instanceof IIngredient ) { @@ -221,16 +221,16 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable try { - for( ItemStack item : ( (IIngredient) target ).getItemStackSet() ) + for( final ItemStack item : ( (IIngredient) target ).getItemStackSet() ) { matched = matched || this.checkItemEquals( item, slot ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { // :P } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { // :P } @@ -244,7 +244,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { boolean matched = false; - for( ItemStack item : (Iterable) target ) + for( final ItemStack item : (Iterable) target ) { matched = matched || this.checkItemEquals( item, slot ); } @@ -264,7 +264,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable return true; } - private boolean checkItemEquals( ItemStack target, ItemStack input ) + private boolean checkItemEquals( final ItemStack target, final ItemStack input ) { if( input == null && target != null || input != null && target == null ) { @@ -273,7 +273,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable return( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) ); } - public ShapedRecipe setMirrored( boolean mirror ) + public ShapedRecipe setMirrored( final boolean mirror ) { this.mirrored = mirror; return this; @@ -311,7 +311,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable try { this.disable = false; - for( Object o : this.input ) + for( final Object o : this.input ) { if( o instanceof IIngredient ) { @@ -319,7 +319,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } } } - catch( MissingIngredientError err ) + catch( final MissingIngredientError err ) { this.disable = true; } diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index 60c730f8..796e8bef 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -39,10 +39,10 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable private ItemStack output = null; private boolean disable = false; - public ShapelessRecipe( ItemStack result, Object... recipe ) + public ShapelessRecipe( final ItemStack result, final Object... recipe ) { this.output = result.copy(); - for( Object in : recipe ) + for( final Object in : recipe ) { if( in instanceof IIngredient ) { @@ -50,8 +50,8 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } else { - StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -68,24 +68,24 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable @SuppressWarnings( "unchecked" ) @Override - public boolean matches( InventoryCrafting var1, World world ) + public boolean matches( final InventoryCrafting var1, final World world ) { if( this.disable ) { return false; } - ArrayList required = new ArrayList( this.input ); + final ArrayList required = new ArrayList( this.input ); for( int x = 0; x < var1.getSizeInventory(); x++ ) { - ItemStack slot = var1.getStackInSlot( x ); + final ItemStack slot = var1.getStackInSlot( x ); if( slot != null ) { boolean inRecipe = false; - for( Object next : required ) + for( final Object next : required ) { boolean match = false; @@ -93,16 +93,16 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { try { - for( ItemStack item : ( (IIngredient) next ).getItemStackSet() ) + for( final ItemStack item : ( (IIngredient) next ).getItemStackSet() ) { match = match || this.checkItemEquals( item, slot ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { // :P } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { // :P } @@ -127,7 +127,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } @Override - public ItemStack getCraftingResult( InventoryCrafting var1 ) + public ItemStack getCraftingResult( final InventoryCrafting var1 ) { return this.output.copy(); } @@ -144,7 +144,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable return this.output; } - private boolean checkItemEquals( ItemStack target, ItemStack input ) + private boolean checkItemEquals( final ItemStack target, final ItemStack input ) { return( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) ); } @@ -166,7 +166,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable try { this.disable = false; - for( Object o : this.input ) + for( final Object o : this.input ) { if( o instanceof IIngredient ) { @@ -174,7 +174,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } } } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { this.disable = true; } diff --git a/src/main/java/appeng/recipes/handlers/Crusher.java b/src/main/java/appeng/recipes/handlers/Crusher.java index f90862c7..a6faf7ef 100644 --- a/src/main/java/appeng/recipes/handlers/Crusher.java +++ b/src/main/java/appeng/recipes/handlers/Crusher.java @@ -43,11 +43,11 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -63,14 +63,14 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RC ) ) { - IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.rockCrusher( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "RC not happy - " + err.getMessage() ); } @@ -79,13 +79,13 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Grind.java b/src/main/java/appeng/recipes/handlers/Grind.java index 7bdd058c..6dc90866 100644 --- a/src/main/java/appeng/recipes/handlers/Grind.java +++ b/src/main/java/appeng/recipes/handlers/Grind.java @@ -40,11 +40,11 @@ public class Grind implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -58,14 +58,14 @@ public class Grind implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for( ItemStack is : this.pro_input.getItemStackSet() ) + for( final ItemStack is : this.pro_input.getItemStackSet() ) { AEApi.instance().registries().grinder().addRecipe( is, this.pro_output[0].getItemStack(), 8 ); } } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return "grind\n" + h.getName( this.pro_input ) + '\n' + @@ -73,7 +73,7 @@ public class Grind implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/GrindFZ.java b/src/main/java/appeng/recipes/handlers/GrindFZ.java index 2b4262ea..aea92bac 100644 --- a/src/main/java/appeng/recipes/handlers/GrindFZ.java +++ b/src/main/java/appeng/recipes/handlers/GrindFZ.java @@ -43,11 +43,11 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -63,14 +63,14 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FZ ) ) { - IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { fz.grinderRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "FZ not happy - " + err.getMessage() ); } @@ -79,13 +79,13 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/HCCrusher.java b/src/main/java/appeng/recipes/handlers/HCCrusher.java index 763d81ea..526ed10e 100644 --- a/src/main/java/appeng/recipes/handlers/HCCrusher.java +++ b/src/main/java/appeng/recipes/handlers/HCCrusher.java @@ -43,11 +43,11 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -61,16 +61,16 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for( ItemStack beginStack : this.pro_input.getItemStackSet() ) + for( final ItemStack beginStack : this.pro_input.getItemStackSet() ) { try { - NBTTagCompound toRegister = new NBTTagCompound(); + final NBTTagCompound toRegister = new NBTTagCompound(); - ItemStack endStack = this.pro_output[0].getItemStack(); + final ItemStack endStack = this.pro_output[0].getItemStack(); - NBTTagCompound itemFrom = new NBTTagCompound(); - NBTTagCompound itemTo = new NBTTagCompound(); + final NBTTagCompound itemFrom = new NBTTagCompound(); + final NBTTagCompound itemTo = new NBTTagCompound(); beginStack.writeToNBT( itemFrom ); endStack.writeToNBT( itemTo ); @@ -81,7 +81,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer FMLInterModComms.sendMessage( "HydCraft", "registerCrushingRecipe", toRegister ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Hydraulicraft not happy - " + err.getMessage() ); } @@ -89,13 +89,13 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Inscribe.java b/src/main/java/appeng/recipes/handlers/Inscribe.java index a51bf9c9..a1c0d2a5 100644 --- a/src/main/java/appeng/recipes/handlers/Inscribe.java +++ b/src/main/java/appeng/recipes/handlers/Inscribe.java @@ -63,7 +63,7 @@ public final class Inscribe extends InscriberProcess final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Inscribe; - IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); + final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); AEApi.instance().registries().inscriber().addRecipe( recipe ); } diff --git a/src/main/java/appeng/recipes/handlers/InscriberProcess.java b/src/main/java/appeng/recipes/handlers/InscriberProcess.java index f04928ab..fdf56430 100644 --- a/src/main/java/appeng/recipes/handlers/InscriberProcess.java +++ b/src/main/java/appeng/recipes/handlers/InscriberProcess.java @@ -40,7 +40,7 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali private IIngredient output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -69,13 +69,13 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { return this.output != null && Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput ); } @Override - public String getPattern( RecipeHandler handler ) + public String getPattern( final RecipeHandler handler ) { String pattern = "inscriber "; diff --git a/src/main/java/appeng/recipes/handlers/Macerator.java b/src/main/java/appeng/recipes/handlers/Macerator.java index 5655edb0..77a16ee8 100644 --- a/src/main/java/appeng/recipes/handlers/Macerator.java +++ b/src/main/java/appeng/recipes/handlers/Macerator.java @@ -43,11 +43,11 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -63,14 +63,14 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) ) { - IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { ic2.maceratorRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "IC2 not happy - " + err.getMessage() ); } @@ -79,13 +79,13 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/MekCrusher.java b/src/main/java/appeng/recipes/handlers/MekCrusher.java index f26253e5..ec8acb8f 100644 --- a/src/main/java/appeng/recipes/handlers/MekCrusher.java +++ b/src/main/java/appeng/recipes/handlers/MekCrusher.java @@ -43,11 +43,11 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -64,14 +64,14 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) ) { - IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.addCrusherRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Mekanism not happy - " + err.getMessage() ); } @@ -80,13 +80,13 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/MekEnrichment.java b/src/main/java/appeng/recipes/handlers/MekEnrichment.java index 1ad9e7f9..7ef93c23 100644 --- a/src/main/java/appeng/recipes/handlers/MekEnrichment.java +++ b/src/main/java/appeng/recipes/handlers/MekEnrichment.java @@ -43,11 +43,11 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -63,14 +63,14 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) ) { - IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.addEnrichmentChamberRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Mekanism not happy - " + err.getMessage() ); } @@ -79,13 +79,13 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/OreRegistration.java b/src/main/java/appeng/recipes/handlers/OreRegistration.java index f77738cb..dd8987d6 100644 --- a/src/main/java/appeng/recipes/handlers/OreRegistration.java +++ b/src/main/java/appeng/recipes/handlers/OreRegistration.java @@ -37,14 +37,14 @@ public class OreRegistration implements ICraftHandler final List inputs; final String name; - public OreRegistration( List in, String out ) + public OreRegistration( final List in, final String out ) { this.inputs = in; this.name = out; } @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { } @@ -52,9 +52,9 @@ public class OreRegistration implements ICraftHandler @Override public void register() throws RegistrationError, MissingIngredientError { - for( IIngredient i : this.inputs ) + for( final IIngredient i : this.inputs ) { - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { OreDictionary.registerOre( this.name, is ); } diff --git a/src/main/java/appeng/recipes/handlers/Press.java b/src/main/java/appeng/recipes/handlers/Press.java index e07956e4..f55806ef 100644 --- a/src/main/java/appeng/recipes/handlers/Press.java +++ b/src/main/java/appeng/recipes/handlers/Press.java @@ -63,7 +63,7 @@ public final class Press extends InscriberProcess final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Press; - IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); + final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); AEApi.instance().registries().inscriber().addRecipe( recipe ); } diff --git a/src/main/java/appeng/recipes/handlers/Pulverizer.java b/src/main/java/appeng/recipes/handlers/Pulverizer.java index cd12fe35..a7ca50cc 100644 --- a/src/main/java/appeng/recipes/handlers/Pulverizer.java +++ b/src/main/java/appeng/recipes/handlers/Pulverizer.java @@ -42,11 +42,11 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -60,13 +60,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - NBTTagCompound toSend = new NBTTagCompound(); + final NBTTagCompound toSend = new NBTTagCompound(); toSend.setInteger( "energy", 800 ); toSend.setTag( "primaryOutput", new NBTTagCompound() ); this.pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + for( final ItemStack is : this.pro_input.getItemStackSet() ) { toSend.setTag( "input", new NBTTagCompound() ); is.writeToNBT( toSend.getCompoundTag( "input" ) ); @@ -75,13 +75,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Shaped.java b/src/main/java/appeng/recipes/handlers/Shaped.java index 2b710601..20f7161b 100644 --- a/src/main/java/appeng/recipes/handlers/Shaped.java +++ b/src/main/java/appeng/recipes/handlers/Shaped.java @@ -46,7 +46,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer private int cols; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -56,7 +56,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer this.cols = input.get( 0 ).size(); if( this.cols <= 3 && this.cols >= 1 ) { - for( List anInput : input ) + for( final List anInput : input ) { if( anInput.size() != this.cols ) { @@ -87,11 +87,11 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer public void register() throws RegistrationError, MissingIngredientError { char first = 'A'; - List args = new ArrayList(); + final List args = new ArrayList(); for( int y = 0; y < this.rows; y++ ) { - StringBuilder row = new StringBuilder(); + final StringBuilder row = new StringBuilder(); for( int x = 0; x < this.cols; x++ ) { if( this.inputs.get( y ).get( x ).isAir() ) @@ -110,13 +110,13 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer args.add( y, row.toString() ); } - ItemStack outIS = this.output.getItemStack(); + final ItemStack outIS = this.output.getItemStack(); try { GameRegistry.addRecipe( new ShapedRecipe( outIS, args.toArray( new Object[args.size()] ) ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); throw new RegistrationError( "Error while adding shaped recipe." ); @@ -124,7 +124,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { String o = "shaped " + this.output.getQty() + ' ' + this.cols + 'x' + this.rows + '\n'; @@ -134,7 +134,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer { for( int x = 0; x < this.cols; x++ ) { - IIngredient i = this.inputs.get( y ).get( x ); + final IIngredient i = this.inputs.get( y ).get( x ); if( i.isAir() ) { @@ -151,17 +151,17 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { for( int y = 0; y < this.rows; y++ ) { for( int x = 0; x < this.cols; x++ ) { - IIngredient i = this.inputs.get( y ).get( x ); + final IIngredient i = this.inputs.get( y ).get( x ); if( !i.isAir() ) { - for( ItemStack r : i.getItemStackSet() ) + for( final ItemStack r : i.getItemStackSet() ) { if( Platform.isSameItemPrecise( r, reqOutput ) ) { diff --git a/src/main/java/appeng/recipes/handlers/Shapeless.java b/src/main/java/appeng/recipes/handlers/Shapeless.java index 6881dbf6..460101ad 100644 --- a/src/main/java/appeng/recipes/handlers/Shapeless.java +++ b/src/main/java/appeng/recipes/handlers/Shapeless.java @@ -44,7 +44,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer IIngredient output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -67,19 +67,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - List args = new ArrayList(); - for( IIngredient i : this.inputs ) + final List args = new ArrayList(); + for( final IIngredient i : this.inputs ) { args.add( i ); } - ItemStack outIS = this.output.getItemStack(); + final ItemStack outIS = this.output.getItemStack(); try { GameRegistry.addRecipe( new ShapelessRecipe( outIS, args.toArray( new Object[args.size()] ) ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); throw new RegistrationError( "Error while adding shapeless recipe." ); @@ -87,15 +87,15 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { - StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' ); + final StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' ); o.append( h.getName( this.output ) ).append( '\n' ); for( int y = 0; y < this.inputs.size(); y++ ) { - IIngredient i = this.inputs.get( y ); + final IIngredient i = this.inputs.get( y ); if( i.isAir() ) { @@ -120,14 +120,14 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { - for( IIngredient i : this.inputs ) + for( final IIngredient i : this.inputs ) { if( !i.isAir() ) { - for( ItemStack r : i.getItemStackSet() ) + for( final ItemStack r : i.getItemStackSet() ) { if( Platform.isSameItemPrecise( r, reqOutput ) ) { diff --git a/src/main/java/appeng/recipes/handlers/Smelt.java b/src/main/java/appeng/recipes/handlers/Smelt.java index 810961f4..775fef7b 100644 --- a/src/main/java/appeng/recipes/handlers/Smelt.java +++ b/src/main/java/appeng/recipes/handlers/Smelt.java @@ -41,12 +41,12 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer IIngredient out; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - List inputList = input.get( 0 ); - List outputList = output.get( 0 ); + final List inputList = input.get( 0 ); + final List outputList = output.get( 0 ); if( inputList.size() == 1 && outputList.size() == 1 ) { this.in = inputList.get( 0 ); @@ -74,7 +74,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return "smelt " + this.out.getQty() + '\n' + h.getName( this.out ) + '\n' + @@ -82,7 +82,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.out.getItemStack(), reqOutput ); } diff --git a/src/main/java/appeng/recipes/loader/ConfigLoader.java b/src/main/java/appeng/recipes/loader/ConfigLoader.java index dfab12a9..ff753ad3 100644 --- a/src/main/java/appeng/recipes/loader/ConfigLoader.java +++ b/src/main/java/appeng/recipes/loader/ConfigLoader.java @@ -36,14 +36,14 @@ public final class ConfigLoader implements IRecipeLoader private final File generatedRecipesDir; private final File userRecipesDir; - public ConfigLoader( File generatedRecipesDir, File userRecipesDir ) + public ConfigLoader( final File generatedRecipesDir, final File userRecipesDir ) { this.generatedRecipesDir = generatedRecipesDir; this.userRecipesDir = userRecipesDir; } @Override - public BufferedReader getFile( @Nonnull String relativeFilePath ) throws Exception + public BufferedReader getFile( @Nonnull final String relativeFilePath ) throws Exception { Preconditions.checkNotNull( relativeFilePath ); Preconditions.checkArgument( !relativeFilePath.isEmpty(), "Supplying an empty String will result creating a reader of a folder." ); diff --git a/src/main/java/appeng/recipes/loader/JarLoader.java b/src/main/java/appeng/recipes/loader/JarLoader.java index 436ed468..dee71cdf 100644 --- a/src/main/java/appeng/recipes/loader/JarLoader.java +++ b/src/main/java/appeng/recipes/loader/JarLoader.java @@ -34,13 +34,13 @@ public class JarLoader implements IRecipeLoader private final String rootPath; - public JarLoader( String s ) + public JarLoader( final String s ) { this.rootPath = s; } @Override - public BufferedReader getFile( @Nonnull String s ) throws Exception + public BufferedReader getFile( @Nonnull final String s ) throws Exception { Preconditions.checkNotNull( s ); Preconditions.checkArgument( !s.isEmpty() ); diff --git a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java index f2151ef7..187d2b0b 100644 --- a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java +++ b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java @@ -66,7 +66,7 @@ public class RecipeResourceCopier * * @throws NullPointerException if root is null */ - public RecipeResourceCopier( @Nonnull String root ) + public RecipeResourceCopier( @Nonnull final String root ) { Preconditions.checkNotNull( root ); @@ -83,7 +83,7 @@ public class RecipeResourceCopier * @throws NullPointerException if either parameter is null * @throws IllegalArgumentException if destination is not a directory */ - public void copyTo( @Nonnull File destination ) throws URISyntaxException, IOException + public void copyTo( @Nonnull final File destination ) throws URISyntaxException, IOException { Preconditions.checkNotNull( destination ); Preconditions.checkArgument( destination.isDirectory() ); @@ -100,13 +100,13 @@ public class RecipeResourceCopier * @throws URISyntaxException {@see #getResourceListing} * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not possible */ - private void copyTo( File destination, String directory ) throws URISyntaxException, IOException + private void copyTo( final File destination, final String directory ) throws URISyntaxException, IOException { assert destination != null; assert directory != null; final String[] listing = this.getResourceListing( this.getClass(), directory ); - for( String list : listing ) + for( final String list : listing ) { if( list.endsWith( ".recipe" ) || list.endsWith( ".html" ) ) { @@ -130,7 +130,7 @@ public class RecipeResourceCopier * * @throws IOException if copying the file is not possible */ - private void copyFile( File destination, String directory, String fileName ) throws IOException + private void copyFile( final File destination, final String directory, final String fileName ) throws IOException { assert destination != null; assert fileName != null; @@ -160,7 +160,7 @@ public class RecipeResourceCopier * @throws UnsupportedOperationException if it is neither in jar nor in file path */ @Nonnull - private String[] getResourceListing( Class clazz, String path ) throws URISyntaxException, IOException + private String[] getResourceListing( final Class clazz, final String path ) throws URISyntaxException, IOException { assert clazz != null; assert path != null; diff --git a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java index 7b2e36b8..391eb62c 100644 --- a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java +++ b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java @@ -42,7 +42,7 @@ public class OreDictionaryHandler private boolean enableRebaking = false; @SubscribeEvent - public void onOreDictionaryRegister( OreDictionary.OreRegisterEvent event ) + public void onOreDictionaryRegister( final OreDictionary.OreRegisterEvent event ) { if( event.Name == null || event.Ore == null ) { @@ -51,7 +51,7 @@ public class OreDictionaryHandler if( this.shouldCare( event.Name ) ) { - for( IOreListener v : this.oreListeners ) + for( final IOreListener v : this.oreListeners ) { v.oreRegistered( event.Name, event.Ore ); } @@ -70,7 +70,7 @@ public class OreDictionaryHandler * * @return true if it should care */ - private boolean shouldCare( String name ) + private boolean shouldCare( final String name ) { return true; } @@ -79,7 +79,7 @@ public class OreDictionaryHandler { this.enableRebaking = true; - for( Object o : CraftingManager.getInstance().getRecipeList() ) + for( final Object o : CraftingManager.getInstance().getRecipeList() ) { if( o instanceof IRecipeBakeable ) { @@ -87,7 +87,7 @@ public class OreDictionaryHandler { ( (IRecipeBakeable) o ).bake(); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -101,16 +101,16 @@ public class OreDictionaryHandler * * @param n to be added ore listener */ - public void observe( IOreListener n ) + public void observe( final IOreListener n ) { this.oreListeners.add( n ); // notify the listener of any ore already in existence. - for( String name : OreDictionary.getOreNames() ) + for( final String name : OreDictionary.getOreNames() ) { if( name != null && this.shouldCare( name ) ) { - for( ItemStack item : OreDictionary.getOres( name ) ) + for( final ItemStack item : OreDictionary.getOres( name ) ) { if( item != null ) { diff --git a/src/main/java/appeng/server/AECommand.java b/src/main/java/appeng/server/AECommand.java index 5140e9d4..67ccb1a6 100644 --- a/src/main/java/appeng/server/AECommand.java +++ b/src/main/java/appeng/server/AECommand.java @@ -31,7 +31,7 @@ public final class AECommand extends CommandBase { private final MinecraftServer srv; - public AECommand( MinecraftServer server ) + public AECommand( final MinecraftServer server ) { this.srv = server; } @@ -46,7 +46,7 @@ public final class AECommand extends CommandBase * wtf? */ @Override - public int compareTo( Object arg0 ) + public int compareTo( final Object arg0 ) { return 1; } @@ -58,13 +58,13 @@ public final class AECommand extends CommandBase } @Override - public String getCommandUsage( ICommandSender icommandsender ) + public String getCommandUsage( final ICommandSender icommandsender ) { return "commands.ae2.usage"; } @Override - public void processCommand( ICommandSender sender, String[] args ) + public void processCommand( final ICommandSender sender, final String[] args ) { if( args.length == 0 ) { @@ -76,15 +76,15 @@ public final class AECommand extends CommandBase { if( args.length > 1 ) { - Commands c = Commands.valueOf( args[1] ); + final Commands c = Commands.valueOf( args[1] ); throw new WrongUsageException( c.command.getHelp( this.srv ) ); } } - catch( WrongUsageException wrong ) + catch( final WrongUsageException wrong ) { throw wrong; } - catch( Throwable er ) + catch( final Throwable er ) { throw new WrongUsageException( "commands.ae2.usage" ); } @@ -97,7 +97,7 @@ public final class AECommand extends CommandBase { try { - Commands c = Commands.valueOf( args[0] ); + final Commands c = Commands.valueOf( args[0] ); if( sender.canCommandSenderUseCommand( c.level, this.getCommandName() ) ) { c.command.call( this.srv, args, sender ); @@ -107,11 +107,11 @@ public final class AECommand extends CommandBase throw new WrongUsageException( "commands.ae2.permissions" ); } } - catch( WrongUsageException wrong ) + catch( final WrongUsageException wrong ) { throw wrong; } - catch( Throwable er ) + catch( final Throwable er ) { throw new WrongUsageException( "commands.ae2.usage" ); } diff --git a/src/main/java/appeng/server/Commands.java b/src/main/java/appeng/server/Commands.java index 6b726701..c880ea9f 100644 --- a/src/main/java/appeng/server/Commands.java +++ b/src/main/java/appeng/server/Commands.java @@ -30,7 +30,7 @@ public enum Commands public final int level; public final ISubCommand command; - Commands( int level, ISubCommand w ) + Commands( final int level, final ISubCommand w ) { this.level = level; this.command = w; diff --git a/src/main/java/appeng/server/ServerHelper.java b/src/main/java/appeng/server/ServerHelper.java index f5665d73..dec281c0 100644 --- a/src/main/java/appeng/server/ServerHelper.java +++ b/src/main/java/appeng/server/ServerHelper.java @@ -62,7 +62,7 @@ public class ServerHelper extends CommonHelper } @Override - public void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk ) + public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk ) { throw new UnsupportedOperationException( "This is a server..." ); } @@ -72,7 +72,7 @@ public class ServerHelper extends CommonHelper { if( !Platform.isClient() ) { - MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); + final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if( server != null ) { @@ -84,22 +84,22 @@ public class ServerHelper extends CommonHelper } @Override - public void sendToAllNearExcept( EntityPlayer p, double x, double y, double z, double dist, World w, AppEngPacket packet ) + public void sendToAllNearExcept( final EntityPlayer p, final double x, final double y, final double z, final double dist, final World w, final AppEngPacket packet ) { if( Platform.isClient() ) { return; } - for( EntityPlayer o : this.getPlayers() ) + for( final EntityPlayer o : this.getPlayers() ) { - EntityPlayerMP entityplayermp = (EntityPlayerMP) o; + final EntityPlayerMP entityplayermp = (EntityPlayerMP) o; if( entityplayermp != p && entityplayermp.worldObj == w ) { - double dX = x - entityplayermp.posX; - double dY = y - entityplayermp.posY; - double dZ = z - entityplayermp.posZ; + final double dX = x - entityplayermp.posX; + final double dY = y - entityplayermp.posY; + final double dZ = z - entityplayermp.posZ; if( dX * dX + dY * dY + dZ * dZ < dist * dist ) { @@ -110,13 +110,13 @@ public class ServerHelper extends CommonHelper } @Override - public void spawnEffect( EffectType type, World worldObj, double posX, double posY, double posZ, Object o ) + public void spawnEffect( final EffectType type, final World worldObj, final double posX, final double posY, final double posZ, final Object o ) { // :P } @Override - public boolean shouldAddParticles( Random r ) + public boolean shouldAddParticles( final Random r ) { return false; } @@ -128,7 +128,7 @@ public class ServerHelper extends CommonHelper } @Override - public void doRenderItem( ItemStack sis, World tile ) + public void doRenderItem( final ItemStack sis, final World tile ) { } @@ -150,17 +150,17 @@ public class ServerHelper extends CommonHelper return this.renderModeForPlayer( this.renderModeBased ); } - protected CableRenderMode renderModeForPlayer( EntityPlayer player ) + protected CableRenderMode renderModeForPlayer( final EntityPlayer player ) { if( player != null ) { for( int x = 0; x < InventoryPlayer.getHotbarSize(); x++ ) { - ItemStack is = player.inventory.getStackInSlot( x ); + final ItemStack is = player.inventory.getStackInSlot( x ); if( is != null && is.getItem() instanceof ToolNetworkTool ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( c != null && c.getBoolean( "hideFacades" ) ) { return CableRenderMode.CableView; @@ -179,7 +179,7 @@ public class ServerHelper extends CommonHelper } @Override - public void updateRenderMode( EntityPlayer player ) + public void updateRenderMode( final EntityPlayer player ) { this.renderModeBased = player; } diff --git a/src/main/java/appeng/server/subcommands/ChunkLogger.java b/src/main/java/appeng/server/subcommands/ChunkLogger.java index 154fa6b8..938711f8 100644 --- a/src/main/java/appeng/server/subcommands/ChunkLogger.java +++ b/src/main/java/appeng/server/subcommands/ChunkLogger.java @@ -39,7 +39,7 @@ public class ChunkLogger implements ISubCommand boolean enabled = false; @SubscribeEvent - public void onChunkLoadEvent( ChunkEvent.Load event ) + public void onChunkLoadEvent( final ChunkEvent.Load event ) { if( !event.world.isRemote ) { @@ -53,7 +53,7 @@ public class ChunkLogger implements ISubCommand if( AEConfig.instance.isFeatureEnabled( AEFeature.ChunkLoggerTrace ) ) { boolean output = false; - for( StackTraceElement e : Thread.currentThread().getStackTrace() ) + for( final StackTraceElement e : Thread.currentThread().getStackTrace() ) { if( output ) { @@ -68,7 +68,7 @@ public class ChunkLogger implements ISubCommand } @SubscribeEvent - public void onChunkUnloadEvent( ChunkEvent.Unload unload ) + public void onChunkUnloadEvent( final ChunkEvent.Unload unload ) { if( !unload.world.isRemote ) { @@ -78,13 +78,13 @@ public class ChunkLogger implements ISubCommand } @Override - public String getHelp( MinecraftServer srv ) + public String getHelp( final MinecraftServer srv ) { return "commands.ae2.ChunkLogger"; } @Override - public void call( MinecraftServer srv, String[] data, ICommandSender sender ) + public void call( final MinecraftServer srv, final String[] data, final ICommandSender sender ) { this.enabled = !this.enabled; diff --git a/src/main/java/appeng/server/subcommands/Supporters.java b/src/main/java/appeng/server/subcommands/Supporters.java index 637f7842..61059abf 100644 --- a/src/main/java/appeng/server/subcommands/Supporters.java +++ b/src/main/java/appeng/server/subcommands/Supporters.java @@ -32,15 +32,15 @@ public class Supporters implements ISubCommand { @Override - public String getHelp( MinecraftServer srv ) + public String getHelp( final MinecraftServer srv ) { return "commands.ae2.Supporters"; } @Override - public void call( MinecraftServer srv, String[] data, ICommandSender sender ) + public void call( final MinecraftServer srv, final String[] data, final ICommandSender sender ) { - String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" }; + final String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" }; sender.addChatMessage( new ChatComponentText( "Special thanks to " + Joiner.on( ", " ).join( who ) ) ); } } diff --git a/src/main/java/appeng/services/CompassService.java b/src/main/java/appeng/services/CompassService.java index 8ae10d9d..39a0a480 100644 --- a/src/main/java/appeng/services/CompassService.java +++ b/src/main/java/appeng/services/CompassService.java @@ -69,7 +69,7 @@ public final class CompassService this.jobSize = 0; } - public Future getCompassDirection( DimensionalCoord coord, int maxRange, ICompassCallback cc ) + public Future getCompassDirection( final DimensionalCoord coord, final int maxRange, final ICompassCallback cc ) { this.jobSize++; return this.executor.submit( new CMDirectionRequest( coord, maxRange, cc ) ); @@ -81,7 +81,7 @@ public final class CompassService * @param event the event containing the unloaded world. */ @SubscribeEvent - public void unloadWorld( WorldEvent.Unload event ) + public void unloadWorld( final WorldEvent.Unload event ) { if( Platform.isServer() && this.worldSet.containsKey( event.world ) ) { @@ -104,7 +104,7 @@ public final class CompassService } } - public void updateArea( World w, int chunkX, int chunkZ ) + public void updateArea( final World w, final int chunkX, final int chunkZ ) { final int x = chunkX << 4; final int z = chunkZ << 4; @@ -120,7 +120,7 @@ public final class CompassService this.updateArea( w, x, CHUNK_SIZE + 224, z ); } - public Future updateArea( World w, int x, int y, int z ) + public Future updateArea( final World w, final int x, final int y, final int z ) { this.jobSize++; @@ -177,7 +177,7 @@ public final class CompassService } } - private CompassReader getReader( World w ) + private CompassReader getReader( final World w ) { CompassReader cr = this.worldSet.get( w ); @@ -190,7 +190,7 @@ public final class CompassService return cr; } - private int dist( int ax, int az, int bx, int bz ) + private int dist( final int ax, final int az, final int bx, final int bz ) { final int up = ( bz - az ) * CHUNK_SIZE; final int side = ( bx - ax ) * CHUNK_SIZE; @@ -198,7 +198,7 @@ public final class CompassService return up * up + side * side; } - private double rad( int ax, int az, int bx, int bz ) + private double rad( final int ax, final int az, final int bx, final int bz ) { final int up = bz - az; final int side = bx - ax; @@ -216,7 +216,7 @@ public final class CompassService public final int doubleChunkY; // 32 blocks instead of 16. public final boolean value; - public CMUpdatePost( World w, int cx, int cz, int dcy, boolean val ) + public CMUpdatePost( final World w, final int cx, final int cz, final int dcy, final boolean val ) { this.world = w; this.chunkX = cx; @@ -247,7 +247,7 @@ public final class CompassService public final DimensionalCoord coord; public final ICompassCallback callback; - public CMDirectionRequest( DimensionalCoord coord, int getMaxRange, ICompassCallback cc ) + public CMDirectionRequest( final DimensionalCoord coord, final int getMaxRange, final ICompassCallback cc ) { this.coord = coord; this.maxRange = getMaxRange; diff --git a/src/main/java/appeng/services/VersionChecker.java b/src/main/java/appeng/services/VersionChecker.java index 2a1b0924..f19103b6 100644 --- a/src/main/java/appeng/services/VersionChecker.java +++ b/src/main/java/appeng/services/VersionChecker.java @@ -66,7 +66,7 @@ public final class VersionChecker implements Runnable private static final int MS_TO_SEC = 1000; private final VersionCheckerConfig config; - public VersionChecker( VersionCheckerConfig config ) + public VersionChecker( final VersionCheckerConfig config ) { this.config = config; } @@ -94,7 +94,7 @@ public final class VersionChecker implements Runnable * @param nowInMs now in milli seconds * @param lastAfterInterval last version check including the interval defined in the config */ - private void processInterval( long nowInMs, long lastAfterInterval ) + private void processInterval( final long nowInMs, final long lastAfterInterval ) { if( nowInMs > lastAfterInterval ) { @@ -121,7 +121,7 @@ public final class VersionChecker implements Runnable * @param modVersion version of mod * @param githubRelease release retrieved through github */ - private void processVersions( Version modVersion, FormattedRelease githubRelease ) + private void processVersions( final Version modVersion, final FormattedRelease githubRelease ) { final Version githubVersion = githubRelease.version(); final String modFormatted = modVersion.formatted(); @@ -156,7 +156,7 @@ public final class VersionChecker implements Runnable * @param ghFormatted retrieved github version formatted as rv2-beta-8 * @param changelog retrieved github changelog */ - private void interactWithVersionCheckerMod( String modFormatted, String ghFormatted, String changelog ) + private void interactWithVersionCheckerMod( final String modFormatted, final String ghFormatted, final String changelog ) { if( Loader.isModLoaded( "VersionChecker" ) ) { diff --git a/src/main/java/appeng/services/compass/CompassException.java b/src/main/java/appeng/services/compass/CompassException.java index 8d700ffd..61385442 100644 --- a/src/main/java/appeng/services/compass/CompassException.java +++ b/src/main/java/appeng/services/compass/CompassException.java @@ -26,7 +26,7 @@ public class CompassException extends RuntimeException public final Throwable inner; - public CompassException( Throwable t ) + public CompassException( final Throwable t ) { this.inner = t; } diff --git a/src/main/java/appeng/services/compass/CompassReader.java b/src/main/java/appeng/services/compass/CompassReader.java index a74ed740..d360a3f8 100644 --- a/src/main/java/appeng/services/compass/CompassReader.java +++ b/src/main/java/appeng/services/compass/CompassReader.java @@ -34,7 +34,7 @@ public final class CompassReader private final int dimensionId; private final File worldCompassFolder; - public CompassReader( int dimensionId, @Nonnull final File worldCompassFolder ) + public CompassReader( final int dimensionId, @Nonnull final File worldCompassFolder ) { Preconditions.checkNotNull( worldCompassFolder ); Preconditions.checkArgument( worldCompassFolder.isDirectory() ); @@ -45,7 +45,7 @@ public final class CompassReader public void close() { - for( CompassRegion r : this.regions.values() ) + for( final CompassRegion r : this.regions.values() ) { r.close(); } @@ -53,21 +53,21 @@ public final class CompassReader this.regions.clear(); } - public void setHasBeacon( int cx, int cz, int cdy, boolean hasBeacon ) + public void setHasBeacon( final int cx, final int cz, final int cdy, final boolean hasBeacon ) { final CompassRegion r = this.getRegion( cx, cz ); r.setHasBeacon( cx, cz, cdy, hasBeacon ); } - public boolean hasBeacon( int cx, int cz ) + public boolean hasBeacon( final int cx, final int cz ) { final CompassRegion r = this.getRegion( cx, cz ); return r.hasBeacon( cx, cz ); } - private CompassRegion getRegion( int cx, int cz ) + private CompassRegion getRegion( final int cx, final int cz ) { long pos = cx >> 10; pos <<= 32; diff --git a/src/main/java/appeng/services/compass/CompassRegion.java b/src/main/java/appeng/services/compass/CompassRegion.java index 086b34c9..ff47c0ef 100644 --- a/src/main/java/appeng/services/compass/CompassRegion.java +++ b/src/main/java/appeng/services/compass/CompassRegion.java @@ -43,7 +43,7 @@ public final class CompassRegion private RandomAccessFile raf = null; private ByteBuffer buffer; - public CompassRegion( int cx, int cz, int worldID, @Nonnull final File worldCompassFolder ) + public CompassRegion( final int cx, final int cz, final int worldID, @Nonnull final File worldCompassFolder ) { Preconditions.checkNotNull( worldCompassFolder ); Preconditions.checkArgument( worldCompassFolder.isDirectory() ); @@ -73,7 +73,7 @@ public final class CompassRegion this.hasFile = false; } } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } @@ -96,7 +96,7 @@ public final class CompassRegion return false; } - public void setHasBeacon( int cx, int cz, int cdy, boolean hasBeacon ) + public void setHasBeacon( int cx, int cz, final int cdy, final boolean hasBeacon ) { cx &= 0x3FF; cz &= 0x3FF; @@ -141,7 +141,7 @@ public final class CompassRegion } - private void openFile( boolean create ) + private void openFile( final boolean create ) { if( this.hasFile ) { @@ -172,12 +172,12 @@ public final class CompassRegion return new File( this.worldCompassFolder, fileName ); } - private boolean isFileExistent( File file ) + private boolean isFileExistent( final File file ) { return file.exists() && file.isFile(); } - private int read( int cx, int cz ) + private int read( final int cx, final int cz ) { try { @@ -185,17 +185,17 @@ public final class CompassRegion // raf.seek( cx + cz * 0x400 ); // return raf.readByte(); } - catch( IndexOutOfBoundsException outOfBounds ) + catch( final IndexOutOfBoundsException outOfBounds ) { return 0; } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } } - private void write( int cx, int cz, int val ) + private void write( final int cx, final int cz, final int val ) { try { @@ -203,7 +203,7 @@ public final class CompassRegion // raf.seek( cx + cz * 0x400 ); // raf.writeByte( val ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } diff --git a/src/main/java/appeng/services/version/BaseVersion.java b/src/main/java/appeng/services/version/BaseVersion.java index f174067a..0102e1c1 100644 --- a/src/main/java/appeng/services/version/BaseVersion.java +++ b/src/main/java/appeng/services/version/BaseVersion.java @@ -20,7 +20,7 @@ public abstract class BaseVersion implements Version * * @throws AssertionError if assertion are enabled and revision or build are not natural numbers */ - public BaseVersion( int revision, Channel channel, int build ) + public BaseVersion( final int revision, final Channel channel, final int build ) { assert revision >= 0; assert build >= 0; @@ -64,7 +64,7 @@ public abstract class BaseVersion implements Version } @Override - public final boolean equals( Object o ) + public final boolean equals( final Object o ) { if( this == o ) { @@ -75,7 +75,7 @@ public abstract class BaseVersion implements Version return false; } - Version that = (Version) o; + final Version that = (Version) o; if( this.revision != that.revision() ) { diff --git a/src/main/java/appeng/services/version/DefaultVersion.java b/src/main/java/appeng/services/version/DefaultVersion.java index 4d61b8b2..2bcb834b 100644 --- a/src/main/java/appeng/services/version/DefaultVersion.java +++ b/src/main/java/appeng/services/version/DefaultVersion.java @@ -13,13 +13,13 @@ public final class DefaultVersion extends BaseVersion * @param channel either alpha, beta or release * @param build natural number */ - public DefaultVersion( int revision, Channel channel, int build ) + public DefaultVersion( final int revision, final Channel channel, final int build ) { super( revision, channel, build ); } @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { if( this.revision() > maybeOlder.revision() ) { diff --git a/src/main/java/appeng/services/version/DoNotCheckVersion.java b/src/main/java/appeng/services/version/DoNotCheckVersion.java index 455f7414..9edff745 100644 --- a/src/main/java/appeng/services/version/DoNotCheckVersion.java +++ b/src/main/java/appeng/services/version/DoNotCheckVersion.java @@ -30,7 +30,7 @@ public final class DoNotCheckVersion extends BaseVersion } @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { return true; } diff --git a/src/main/java/appeng/services/version/MissingVersion.java b/src/main/java/appeng/services/version/MissingVersion.java index bf0d5e94..6ff01351 100644 --- a/src/main/java/appeng/services/version/MissingVersion.java +++ b/src/main/java/appeng/services/version/MissingVersion.java @@ -18,7 +18,7 @@ public final class MissingVersion extends BaseVersion * @return false */ @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { return false; } diff --git a/src/main/java/appeng/services/version/ModVersionFetcher.java b/src/main/java/appeng/services/version/ModVersionFetcher.java index 9594c657..1c6ac5e4 100644 --- a/src/main/java/appeng/services/version/ModVersionFetcher.java +++ b/src/main/java/appeng/services/version/ModVersionFetcher.java @@ -12,7 +12,7 @@ public final class ModVersionFetcher implements VersionFetcher private final String rawModVersion; private final VersionParser parser; - public ModVersionFetcher( String rawModVersion, VersionParser parser ) + public ModVersionFetcher( final String rawModVersion, final VersionParser parser ) { this.rawModVersion = rawModVersion; this.parser = parser; diff --git a/src/main/java/appeng/services/version/VersionCheckerConfig.java b/src/main/java/appeng/services/version/VersionCheckerConfig.java index 5282bc79..6c034bae 100644 --- a/src/main/java/appeng/services/version/VersionCheckerConfig.java +++ b/src/main/java/appeng/services/version/VersionCheckerConfig.java @@ -49,7 +49,7 @@ public final class VersionCheckerConfig /** * @param file requires fully qualified file in which the config is saved */ - public VersionCheckerConfig( File file ) + public VersionCheckerConfig( final File file ) { this.config = new Configuration( file ); diff --git a/src/main/java/appeng/services/version/VersionParser.java b/src/main/java/appeng/services/version/VersionParser.java index ef219250..5a2460bd 100644 --- a/src/main/java/appeng/services/version/VersionParser.java +++ b/src/main/java/appeng/services/version/VersionParser.java @@ -44,7 +44,7 @@ public final class VersionParser * * @throws AssertionError if raw String does not match pattern of a {@link Version} */ - public Version parse( String raw ) + public Version parse( final String raw ) { final String transformed = this.transformDelimiter( raw ); final String[] split = transformed.split( "_" ); @@ -59,7 +59,7 @@ public final class VersionParser * * @return transformed raw, where "." and "-" are replaced by "_" */ - private String transformDelimiter( String raw ) + private String transformDelimiter( final String raw ) { assert raw.contains( "." ) || raw.contains( "-" ); @@ -78,7 +78,7 @@ public final class VersionParser * * @return {@link Version} represented by the splitRaw */ - private Version parseVersion( String[] splitRaw ) + private Version parseVersion( final String[] splitRaw ) { assert splitRaw.length == 3; @@ -100,7 +100,7 @@ public final class VersionParser * * @return revision number */ - private int parseRevision( String rawRevision ) + private int parseRevision( final String rawRevision ) { assert PATTERN_VALID_REVISION.matcher( rawRevision ).matches(); @@ -120,11 +120,11 @@ public final class VersionParser * * @return matching {@link Channel} to the String */ - private Channel parseChannel( String rawChannel ) + private Channel parseChannel( final String rawChannel ) { assert rawChannel.equalsIgnoreCase( Channel.Alpha.name() ) || rawChannel.equalsIgnoreCase( Channel.Beta.name() ) || rawChannel.equalsIgnoreCase( Channel.Stable.name() ); - for( Channel channel : Channel.values() ) + for( final Channel channel : Channel.values() ) { if( channel.name().equalsIgnoreCase( rawChannel ) ) { @@ -142,7 +142,7 @@ public final class VersionParser * * @return build number */ - private int parseBuild( String rawBuild ) + private int parseBuild( final String rawBuild ) { assert PATTERN_NATURAL.matcher( rawBuild ).matches(); diff --git a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java index 06aa4efe..490fa569 100644 --- a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java +++ b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java @@ -13,7 +13,7 @@ public final class DefaultFormattedRelease implements FormattedRelease private final Version version; private final String changelog; - public DefaultFormattedRelease( Version version, String changelog ) + public DefaultFormattedRelease( final Version version, final String changelog ) { this.version = version; this.changelog = changelog; diff --git a/src/main/java/appeng/services/version/github/ReleaseFetcher.java b/src/main/java/appeng/services/version/github/ReleaseFetcher.java index b6ae4762..53a91bb5 100644 --- a/src/main/java/appeng/services/version/github/ReleaseFetcher.java +++ b/src/main/java/appeng/services/version/github/ReleaseFetcher.java @@ -27,7 +27,7 @@ public final class ReleaseFetcher private final VersionCheckerConfig config; private final VersionParser parser; - public ReleaseFetcher( VersionCheckerConfig config, VersionParser parser ) + public ReleaseFetcher( final VersionCheckerConfig config, final VersionParser parser ) { this.config = config; this.parser = parser; @@ -50,7 +50,7 @@ public final class ReleaseFetcher return latestFitRelease; } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); @@ -58,18 +58,18 @@ public final class ReleaseFetcher } } - private String getRawReleases( URL url ) throws IOException + private String getRawReleases( final URL url ) throws IOException { return IOUtils.toString( url ); } - private FormattedRelease getLatestFitRelease( Iterable releases ) + private FormattedRelease getLatestFitRelease( final Iterable releases ) { final String levelInConfig = this.config.level(); final Channel level = Channel.valueOf( levelInConfig ); final int levelOrdinal = level.ordinal(); - for( Release release : releases ) + for( final Release release : releases ) { final String rawVersion = release.tag_name; final String changelog = release.body; diff --git a/src/main/java/appeng/spatial/BiomeGenStorage.java b/src/main/java/appeng/spatial/BiomeGenStorage.java index 4e262b48..79e9e077 100644 --- a/src/main/java/appeng/spatial/BiomeGenStorage.java +++ b/src/main/java/appeng/spatial/BiomeGenStorage.java @@ -25,7 +25,7 @@ import net.minecraft.world.biome.BiomeGenBase; public class BiomeGenStorage extends BiomeGenBase { - public BiomeGenStorage( int id ) + public BiomeGenStorage( final int id ) { super( id ); this.setBiomeName( "Storage Cell" ); diff --git a/src/main/java/appeng/spatial/CachedPlane.java b/src/main/java/appeng/spatial/CachedPlane.java index b6cd0fae..8ce49308 100644 --- a/src/main/java/appeng/spatial/CachedPlane.java +++ b/src/main/java/appeng/spatial/CachedPlane.java @@ -63,7 +63,7 @@ public class CachedPlane private final IBlockDefinition matrixFrame = AEApi.instance().definitions().blocks().matrixFrame(); int verticalBits; - public CachedPlane( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) + public CachedPlane( final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ ) { this.world = w; @@ -76,15 +76,15 @@ public class CachedPlane this.y_offset = minY; this.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; + final int minCX = minX >> 4; + final int minCY = minY >> 4; + final int minCZ = minZ >> 4; + final int maxCX = maxX >> 4; + final int maxCY = maxY >> 4; + final int maxCZ = maxZ >> 4; this.cx_size = maxCX - minCX + 1; - int cy_size = maxCY - minCY + 1; + final int cy_size = maxCY - minCY + 1; this.cz_size = maxCZ - minCZ + 1; this.myChunks = new Chunk[this.cx_size][this.cz_size]; @@ -104,23 +104,23 @@ public class CachedPlane } } - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); for( int cx = 0; cx < this.cx_size; cx++ ) { for( int cz = 0; cz < this.cz_size; cz++ ) { - LinkedList> rawTiles = new LinkedList>(); - LinkedList deadTiles = new LinkedList(); + final LinkedList> rawTiles = new LinkedList>(); + final LinkedList deadTiles = new LinkedList(); - Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); + final Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); this.myChunks[cx][cz] = c; rawTiles.addAll( ( (HashMap) c.chunkTileEntityMap ).entrySet() ); - for( Entry tx : rawTiles ) + for( final Entry tx : rawTiles ) { - ChunkPosition cp = tx.getKey(); - TileEntity te = tx.getValue(); + final ChunkPosition cp = tx.getKey(); + final TileEntity te = tx.getValue(); if( te.xCoord >= minX && te.xCoord <= maxX && te.yCoord >= minY && te.yCoord <= maxY && te.zCoord >= minZ && te.zCoord <= maxZ ) { if( mr.askToMove( te ) ) @@ -130,8 +130,8 @@ public class CachedPlane } else { - Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord ); - Block blk = (Block) details[0]; + final Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord ); + final Block blk = (Block) details[0]; // 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 ) ) @@ -147,21 +147,21 @@ public class CachedPlane } } - for( ChunkPosition cp : deadTiles ) + for( final ChunkPosition cp : deadTiles ) { c.chunkTileEntityMap.remove( cp ); } - long k = this.world.getTotalWorldTime(); - List list = this.world.getPendingBlockUpdates( c, false ); + final long k = this.world.getTotalWorldTime(); + final List list = this.world.getPendingBlockUpdates( c, false ); if( list != null ) { - for( Object o : list ) + for( final Object o : list ) { - NextTickListEntry entry = (NextTickListEntry) o; + final 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( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() ); + final NextTickListEntry newEntry = new NextTickListEntry( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() ); newEntry.scheduledTime = entry.scheduledTime - k; this.ticks.add( newEntry ); } @@ -170,28 +170,28 @@ public class CachedPlane } } - for( TileEntity te : this.tiles ) + for( final TileEntity te : this.tiles ) { try { this.world.loadedTileEntityList.remove( te ); } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } } } - private IMovableHandler getHandler( TileEntity te ) + private IMovableHandler getHandler( final TileEntity te ) { - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); return mr.getHandler( te ); } - void swap( CachedPlane dst ) + void swap( final CachedPlane dst ) { - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); if( dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size ) { @@ -203,18 +203,18 @@ public class CachedPlane { for( int z = 0; z < this.z_size; z++ ) { - Column a = this.myColumns[x][z]; - Column b = dst.myColumns[x][z]; + final Column a = this.myColumns[x][z]; + final Column b = dst.myColumns[x][z]; for( int y = 0; y < this.y_size; y++ ) { - int src_y = y + this.y_offset; - int dst_y = y + dst.y_offset; + final int src_y = y + this.y_offset; + final int dst_y = y + dst.y_offset; if( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) ) { - Object[] aD = a.getDetails( src_y ); - Object[] bD = b.getDetails( dst_y ); + final Object[] aD = a.getDetails( src_y ); + final Object[] bD = b.getDetails( dst_y ); a.setBlockIDWithMetadata( src_y, bD ); b.setBlockIDWithMetadata( dst_y, aD ); @@ -232,22 +232,22 @@ public class CachedPlane long duration = endTime - startTime; AELog.info( "Block Copy Time: " + duration ); - for( TileEntity te : this.tiles ) + for( final TileEntity te : this.tiles ) { dst.addTile( te.xCoord - this.x_offset, te.yCoord - this.y_offset, te.zCoord - this.z_offset, te, this, mr ); } - for( TileEntity te : dst.tiles ) + for( final TileEntity te : dst.tiles ) { this.addTile( te.xCoord - dst.x_offset, te.yCoord - dst.y_offset, te.zCoord - dst.z_offset, te, dst, mr ); } - for( NextTickListEntry entry : this.ticks ) + for( final NextTickListEntry entry : this.ticks ) { dst.addTick( entry.xCoord - this.x_offset, entry.yCoord - this.y_offset, entry.zCoord - this.z_offset, entry ); } - for( NextTickListEntry entry : dst.ticks ) + for( final NextTickListEntry entry : dst.ticks ) { this.addTick( entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry ); } @@ -262,35 +262,35 @@ public class CachedPlane } } - private void markForUpdate( int x, int y, int z ) + private void markForUpdate( final int x, final int y, final int z ) { this.updates.add( new WorldCoord( x, y, z ) ); - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { this.updates.add( new WorldCoord( x + d.offsetX, y + d.offsetY, z + d.offsetZ ) ); } } - private void addTick( int x, int y, int z, NextTickListEntry entry ) + private void addTick( final int x, final int y, final int z, final NextTickListEntry entry ) { this.world.scheduleBlockUpdate( x + this.x_offset, y + this.y_offset, z + this.z_offset, entry.func_151351_a(), (int) entry.scheduledTime ); } - private void addTile( int x, int y, int z, TileEntity te, CachedPlane alternateDestination, IMovableRegistry mr ) + private void addTile( final int x, final int y, final int z, final TileEntity te, final CachedPlane alternateDestination, final IMovableRegistry mr ) { try { - Column c = this.myColumns[x][z]; + final Column c = this.myColumns[x][z]; if( c.doNotSkip( y + this.y_offset ) || alternateDestination == null ) { - IMovableHandler handler = this.getHandler( te ); + final IMovableHandler handler = this.getHandler( te ); try { handler.moveTile( te, this.world, x + this.x_offset, y + this.y_offset, z + this.z_offset ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); @@ -317,7 +317,7 @@ public class CachedPlane alternateDestination.addTile( x, y, z, te, null, mr ); } } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -331,7 +331,7 @@ public class CachedPlane { for( int z = 0; z < this.cz_size; z++ ) { - Chunk c = this.myChunks[x][z]; + final Chunk c = this.myChunks[x][z]; c.resetRelightChecks(); c.generateSkylightMap(); c.isModified = true; @@ -344,7 +344,7 @@ public class CachedPlane for( int z = 0; z < this.cz_size; z++ ) { - Chunk c = this.myChunks[x][z]; + final Chunk c = this.myChunks[x][z]; for( int y = 1; y < 255; y += 32 ) { @@ -366,7 +366,7 @@ public class CachedPlane private final ExtendedBlockStorage[] storage; private List skipThese = null; - public Column( Chunk chunk, int x, int z, int chunkY, int chunkHeight ) + public Column( final Chunk chunk, final int x, final int z, final int chunkY, final int chunkHeight ) { this.x = x; this.z = z; @@ -376,7 +376,7 @@ public class CachedPlane // make sure storage exists before hand... for( int ay = 0; ay < chunkHeight; ay++ ) { - int by = ( ay + chunkY ); + final int by = ( ay + chunkY ); ExtendedBlockStorage extendedblockstorage = this.storage[by]; if( extendedblockstorage == null ) { @@ -385,9 +385,9 @@ public class CachedPlane } } - public void setBlockIDWithMetadata( int y, Object[] blk ) + public void setBlockIDWithMetadata( final int y, final Object[] blk ) { - for( Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() ) + for( final Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() ) { if( blk[0] == matrixFrameBlock ) { @@ -395,25 +395,25 @@ public class CachedPlane } } - ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4]; extendedBlockStorage.func_150818_a( this.x, y & 15, this.z, (Block) blk[0] ); // extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] ); extendedBlockStorage.setExtBlockMetadata( this.x, y & 15, this.z, (Integer) blk[1] ); extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[2] ); } - public Object[] getDetails( int y ) + public Object[] getDetails( final int y ) { - ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; this.ch[0] = extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ); this.ch[1] = extendedblockstorage.getExtBlockMetadata( this.x, y & 15, this.z ); this.ch[2] = extendedblockstorage.getExtBlocklightValue( this.x, y & 15, this.z ); return this.ch; } - public boolean doNotSkip( int y ) + public boolean doNotSkip( final int y ) { - ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; if( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ) ) ) { return false; @@ -422,7 +422,7 @@ public class CachedPlane return this.skipThese == null || !this.skipThese.contains( y ); } - public void setSkip( int yCoord ) + public void setSkip( final int yCoord ) { if( this.skipThese == null ) { diff --git a/src/main/java/appeng/spatial/DefaultSpatialHandler.java b/src/main/java/appeng/spatial/DefaultSpatialHandler.java index 862a43bf..32e1ca1b 100644 --- a/src/main/java/appeng/spatial/DefaultSpatialHandler.java +++ b/src/main/java/appeng/spatial/DefaultSpatialHandler.java @@ -37,13 +37,13 @@ public class DefaultSpatialHandler implements IMovableHandler * @return true */ @Override - public boolean canHandle( Class myClass, TileEntity tile ) + public boolean canHandle( final Class myClass, final TileEntity tile ) { return true; } @Override - public void moveTile( TileEntity te, World w, int x, int y, int z ) + public void moveTile( final TileEntity te, final World w, final int x, final int y, final int z ) { te.setWorldObj( w ); @@ -51,7 +51,7 @@ public class DefaultSpatialHandler implements IMovableHandler te.yCoord = y; te.zCoord = z; - Chunk c = w.getChunkFromBlockCoords( x, z ); + final Chunk c = w.getChunkFromBlockCoords( x, z ); c.func_150812_a( x & 0xF, y, z & 0xF, te ); // c.setChunkBlockTileEntity( x & 0xF, y, z & 0xF, te ); diff --git a/src/main/java/appeng/spatial/StorageChunkProvider.java b/src/main/java/appeng/spatial/StorageChunkProvider.java index 0a58b05e..8950ac31 100644 --- a/src/main/java/appeng/spatial/StorageChunkProvider.java +++ b/src/main/java/appeng/spatial/StorageChunkProvider.java @@ -42,7 +42,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate { BLOCKS = new Block[255 * SQUARE_CHUNK_SIZE]; - for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) + for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) { for( int x = 0; x < BLOCKS.length; x++ ) { @@ -53,19 +53,19 @@ public class StorageChunkProvider extends ChunkProviderGenerate final World world; - public StorageChunkProvider( World world, long i ) + public StorageChunkProvider( final World world, final long i ) { super( world, i, false ); this.world = world; } @Override - public Chunk provideChunk( int x, int z ) + public Chunk provideChunk( final int x, final int z ) { - Chunk chunk = new Chunk( this.world, BLOCKS, x, z ); + final Chunk chunk = new Chunk( this.world, BLOCKS, x, z ); - byte[] biomes = chunk.getBiomeArray(); - AEConfig config = AEConfig.instance; + final byte[] biomes = chunk.getBiomeArray(); + final AEConfig config = AEConfig.instance; for( int k = 0; k < biomes.length; ++k ) { @@ -82,7 +82,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate } @Override - public void populate( IChunkProvider par1iChunkProvider, int par2, int par3 ) + public void populate( final IChunkProvider par1iChunkProvider, final int par2, final int par3 ) { } @@ -94,7 +94,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate } @Override - public List getPossibleCreatures( EnumCreatureType a, int b, int c, int d ) + public List getPossibleCreatures( final EnumCreatureType a, final int b, final int c, final int d ) { return new ArrayList(); } diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index ded65fcb..9f2da47a 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -62,11 +62,11 @@ public class StorageHelper * * @return teleported entity */ - public Entity teleportEntity( Entity entity, TelDestination link ) + public Entity teleportEntity( Entity entity, final TelDestination link ) { - WorldServer oldWorld; - WorldServer newWorld; - EntityPlayerMP player; + final WorldServer oldWorld; + final WorldServer newWorld; + final EntityPlayerMP player; try { @@ -74,7 +74,7 @@ public class StorageHelper newWorld = (WorldServer) link.dim; player = ( entity instanceof EntityPlayerMP ) ? (EntityPlayerMP) entity : null; } - catch( Throwable e ) + catch( final Throwable e ) { return entity; } @@ -105,7 +105,7 @@ public class StorageHelper // load the chunk! WorldServer.class.cast( newWorld ).getChunkProvider().loadChunk( MathHelper.floor_double( link.x ) >> 4, MathHelper.floor_double( link.z ) >> 4 ); - boolean diffDestination = newWorld != oldWorld; + final boolean diffDestination = newWorld != oldWorld; if( diffDestination ) { if( player != null ) @@ -119,8 +119,8 @@ public class StorageHelper } else { - int entX = entity.chunkCoordX; - int entZ = entity.chunkCoordZ; + final int entX = entity.chunkCoordX; + final int entZ = entity.chunkCoordZ; if( ( entity.addedToChunk ) && ( oldWorld.getChunkProvider().chunkExists( entX, entZ ) ) ) { @@ -128,7 +128,7 @@ public class StorageHelper oldWorld.getChunkFromChunkCoords( entX, entZ ).isModified = true; } - Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld ); + final Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld ); if( newEntity != null ) { entity.lastTickPosX = entity.prevPosX = entity.posX = link.x; @@ -137,7 +137,7 @@ public class StorageHelper if( entity instanceof EntityHanging ) { - EntityHanging h = (EntityHanging) entity; + final EntityHanging h = (EntityHanging) entity; h.field_146063_b += link.xOff; h.field_146064_c += link.yOff; h.field_146062_d += link.zOff; @@ -177,7 +177,7 @@ public class StorageHelper return entity; } - public void transverseEdges( int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ISpatialVisitor visitor ) + public void transverseEdges( final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final ISpatialVisitor visitor ) { for( int y = minY; y < maxY; y++ ) { @@ -207,44 +207,44 @@ public class StorageHelper } } - public void swapRegions( World src /** over world **/ - , World dst /** storage cell **/ - , int x, int y, int z, int i, int j, int k, int scaleX, int scaleY, int scaleZ ) + public void swapRegions( final World src /** over world **/ + , final World dst /** storage cell **/ + , final int x, final int y, final int z, final int i, final int j, final int k, final int scaleX, final int scaleY, final int scaleZ ) { - for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) + for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) { this.transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( matrixFrameBlock, 0, dst ) ); } - AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 ); + final AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 ); - AxisAlignedBB dstBox = AxisAlignedBB.getBoundingBox( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 ); + final AxisAlignedBB dstBox = AxisAlignedBB.getBoundingBox( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 ); - CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ ); - CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ ); + final CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ ); + final CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ ); // do nearly all the work... swaps blocks, tiles, and block ticks cSrc.swap( cDst ); - List srcE = src.getEntitiesWithinAABB( Entity.class, srcBox ); - List dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox ); + final List srcE = src.getEntitiesWithinAABB( Entity.class, srcBox ); + final List dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox ); - for( Entity e : dstE ) + for( final Entity e : dstE ) { this.teleportEntity( e, new TelDestination( src, srcBox, e.posX, e.posY, e.posZ, -i + x, -j + y, -k + z ) ); } - for( Entity e : srcE ) + for( final Entity e : srcE ) { this.teleportEntity( e, new TelDestination( dst, dstBox, e.posX, e.posY, e.posZ, -x + i, -y + j, -z + k ) ); } - for( WorldCoord wc : cDst.updates ) + for( final WorldCoord wc : cDst.updates ) { cDst.world.notifyBlockOfNeighborChange( wc.x, wc.y, wc.z, Platform.AIR_BLOCK ); } - for( WorldCoord wc : cSrc.updates ) + for( final WorldCoord wc : cSrc.updates ) { cSrc.world.notifyBlockOfNeighborChange( wc.x, wc.y, wc.z, Platform.AIR_BLOCK ); } @@ -269,15 +269,15 @@ public class StorageHelper final World dst; - public TriggerUpdates( World dst2 ) + public TriggerUpdates( final World dst2 ) { this.dst = dst2; } @Override - public void visit( int x, int y, int z ) + public void visit( final int x, final int y, final int z ) { - Block blk = this.dst.getBlock( x, y, z ); + final Block blk = this.dst.getBlock( x, y, z ); blk.onNeighborBlockChange( this.dst, x, y, z, Platform.AIR_BLOCK ); } } @@ -289,7 +289,7 @@ public class StorageHelper final Block blkID; final int Meta; - public WrapInMatrixFrame( Block blockID, int metaData, World dst2 ) + public WrapInMatrixFrame( final Block blockID, final int metaData, final World dst2 ) { this.dst = dst2; this.blkID = blockID; @@ -297,7 +297,7 @@ public class StorageHelper } @Override - public void visit( int x, int y, int z ) + public void visit( final int x, final int y, final int z ) { this.dst.setBlock( x, y, z, this.blkID, this.Meta, 3 ); } @@ -314,7 +314,7 @@ public class StorageHelper final int yOff; final int zOff; - TelDestination( World dimension, AxisAlignedBB srcBox, double x, double y, double z, int tileX, int tileY, int tileZ ) + TelDestination( final World dimension, final AxisAlignedBB srcBox, final double x, final double y, final double z, final int tileX, final int tileY, final int tileZ ) { this.dim = dimension; this.x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, x + tileX ) ); @@ -331,33 +331,33 @@ public class StorageHelper final TelDestination destination; - public METeleporter( WorldServer par1WorldServer, TelDestination d ) + public METeleporter( final WorldServer par1WorldServer, final TelDestination d ) { super( par1WorldServer ); this.destination = d; } @Override - public void placeInPortal( Entity par1Entity, double par2, double par4, double par6, float par8 ) + public void placeInPortal( final Entity par1Entity, final double par2, final double par4, final double par6, final float par8 ) { par1Entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F ); par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; } @Override - public boolean placeInExistingPortal( Entity par1Entity, double par2, double par4, double par6, float par8 ) + public boolean placeInExistingPortal( final Entity par1Entity, final double par2, final double par4, final double par6, final float par8 ) { return false; } @Override - public boolean makePortal( Entity par1Entity ) + public boolean makePortal( final Entity par1Entity ) { return false; } @Override - public void removeStalePortalLocations( long par1 ) + public void removeStalePortalLocations( final long par1 ) { } diff --git a/src/main/java/appeng/spatial/StorageWorldProvider.java b/src/main/java/appeng/spatial/StorageWorldProvider.java index 95b7fc36..18198fef 100644 --- a/src/main/java/appeng/spatial/StorageWorldProvider.java +++ b/src/main/java/appeng/spatial/StorageWorldProvider.java @@ -56,7 +56,7 @@ public class StorageWorldProvider extends WorldProvider } @Override - public float calculateCelestialAngle( long par1, float par3 ) + public float calculateCelestialAngle( final long par1, final float par3 ) { return 0; } @@ -69,13 +69,13 @@ public class StorageWorldProvider extends WorldProvider @Override @SideOnly( Side.CLIENT ) - public float[] calcSunriseSunsetColors( float celestialAngle, float partialTicks ) + public float[] calcSunriseSunsetColors( final float celestialAngle, final float partialTicks ) { return null; } @Override - public Vec3 getFogColor( float par1, float par2 ) + public Vec3 getFogColor( final float par1, final float par2 ) { return Vec3.createVectorHelper( 0.07, 0.07, 0.07 ); } @@ -94,7 +94,7 @@ public class StorageWorldProvider extends WorldProvider } @Override - public boolean doesXZShowFog( int par1, int par2 ) + public boolean doesXZShowFog( final int par1, final int par2 ) { return false; } @@ -118,19 +118,19 @@ public class StorageWorldProvider extends WorldProvider } @Override - public Vec3 getSkyColor( Entity cameraEntity, float partialTicks ) + public Vec3 getSkyColor( final Entity cameraEntity, final float partialTicks ) { return Vec3.createVectorHelper( 0.07, 0.07, 0.07 ); } @Override - public float getStarBrightness( float par1 ) + public float getStarBrightness( final float par1 ) { return 0; } @Override - public boolean canSnowAt( int x, int y, int z, boolean checkLight ) + public boolean canSnowAt( final int x, final int y, final int z, final boolean checkLight ) { return false; } @@ -142,13 +142,13 @@ public class StorageWorldProvider extends WorldProvider } @Override - public boolean isBlockHighHumidity( int x, int y, int z ) + public boolean isBlockHighHumidity( final int x, final int y, final int z ) { return false; } @Override - public boolean canDoLightning( Chunk chunk ) + public boolean canDoLightning( final Chunk chunk ) { return false; } diff --git a/src/main/java/appeng/tile/AEBaseInvTile.java b/src/main/java/appeng/tile/AEBaseInvTile.java index 529d9866..a59a988c 100644 --- a/src/main/java/appeng/tile/AEBaseInvTile.java +++ b/src/main/java/appeng/tile/AEBaseInvTile.java @@ -39,13 +39,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor { @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AEBaseInvTile( net.minecraft.nbt.NBTTagCompound data ) + public void readFromNBT_AEBaseInvTile( final net.minecraft.nbt.NBTTagCompound data ) { - IInventory inv = this.getInternalInventory(); - NBTTagCompound opt = data.getCompoundTag( "inv" ); + final IInventory inv = this.getInternalInventory(); + final NBTTagCompound opt = data.getCompoundTag( "inv" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - NBTTagCompound item = opt.getCompoundTag( "item" + x ); + final NBTTagCompound item = opt.getCompoundTag( "item" + x ); inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( item ) ); } } @@ -53,14 +53,14 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor public abstract IInventory getInternalInventory(); @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AEBaseInvTile( net.minecraft.nbt.NBTTagCompound data ) + public void writeToNBT_AEBaseInvTile( final net.minecraft.nbt.NBTTagCompound data ) { - IInventory inv = this.getInternalInventory(); - NBTTagCompound opt = new NBTTagCompound(); + final IInventory inv = this.getInternalInventory(); + final NBTTagCompound opt = new NBTTagCompound(); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - NBTTagCompound item = new NBTTagCompound(); - ItemStack is = this.getStackInSlot( x ); + final NBTTagCompound item = new NBTTagCompound(); + final ItemStack is = this.getStackInSlot( x ); if( is != null ) { is.writeToNBT( item ); @@ -77,25 +77,25 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.getInternalInventory().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.getInternalInventory().decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, @Nullable ItemStack itemstack ) + public void setInventorySlotContents( final int i, @Nullable final ItemStack itemstack ) { this.getInternalInventory().setInventorySlotContents( i, itemstack ); } @@ -125,7 +125,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public boolean isUseableByPlayer( EntityPlayer p ) + public boolean isUseableByPlayer( final EntityPlayer p ) { final double squaredMCReach = 64.0D; @@ -143,7 +143,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return true; } @@ -152,25 +152,25 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor public abstract void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ); @Override - public final int[] getAccessibleSlotsFromSide( int side ) + public final int[] getAccessibleSlotsFromSide( final int side ) { - Block blk = this.worldObj.getBlock( this.xCoord, this.yCoord, this.zCoord ); + final Block blk = this.worldObj.getBlock( this.xCoord, this.yCoord, this.zCoord ); if( blk instanceof AEBaseBlock ) { - ForgeDirection mySide = ForgeDirection.getOrientation( side ); + final ForgeDirection mySide = ForgeDirection.getOrientation( side ); return this.getAccessibleSlotsBySide( ( (AEBaseBlock) blk ).mapRotation( this, mySide ) ); } return this.getAccessibleSlotsBySide( ForgeDirection.getOrientation( side ) ); } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { return this.isItemValidForSlot( slotIndex, insertingItem ); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return true; } diff --git a/src/main/java/appeng/tile/AEBaseTile.java b/src/main/java/appeng/tile/AEBaseTile.java index ffd73d82..ee69b81b 100644 --- a/src/main/java/appeng/tile/AEBaseTile.java +++ b/src/main/java/appeng/tile/AEBaseTile.java @@ -73,14 +73,14 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, private ForgeDirection forward = ForgeDirection.UNKNOWN; private ForgeDirection up = ForgeDirection.UNKNOWN; - public static void registerTileItem( Class c, IStackSrc wat ) + public static void registerTileItem( final Class c, final IStackSrc wat ) { ITEM_STACKS.put( c, wat ); } public boolean dropItems() { - WeakReference what = DROP_NO_ITEMS.get(); + final WeakReference what = DROP_NO_ITEMS.get(); return what == null || what.get() != this; } @@ -96,9 +96,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nullable - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { - IStackSrc src = ITEM_STACKS.get( obj.getClass() ); + final IStackSrc src = ITEM_STACKS.get( obj.getClass() ); if( src == null ) { return null; @@ -119,7 +119,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override // NOTE: WAS FINAL, changed for Immibis - public final void readFromNBT( NBTTagCompound data ) + public final void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); @@ -140,11 +140,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, this.up = ForgeDirection.valueOf( data.getString( "orientation_up" ) ); } } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_READ ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_READ ) ) { h.readFromNBT( this, data ); } @@ -152,7 +152,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override // NOTE: WAS FINAL, changed for Immibis - public final void writeToNBT( NBTTagCompound data ) + public final void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); @@ -167,7 +167,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, data.setString( "customName", this.customName ); } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_WRITE ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_WRITE ) ) { h.writeToNBT( this, data ); } @@ -176,7 +176,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public final void updateEntity() { - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.TICK ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.TICK ) ) { h.tick( this ); } @@ -185,9 +185,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public Packet getDescriptionPacket() { - NBTTagCompound data = new NBTTagCompound(); + final NBTTagCompound data = new NBTTagCompound(); - ByteBuf stream = Unpooled.buffer(); + final ByteBuf stream = Unpooled.buffer(); try { @@ -197,7 +197,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return null; } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -213,20 +213,20 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return this.hasHandlerFor( TileEventType.TICK ); } - private boolean hasHandlerFor( TileEventType type ) + private boolean hasHandlerFor( final TileEventType type ) { - List list = this.getHandlerListFor( type ); + final List list = this.getHandlerListFor( type ); return !list.isEmpty(); } @Override - public void onDataPacket( NetworkManager net, S35PacketUpdateTileEntity pkt ) + public void onDataPacket( final NetworkManager net, final S35PacketUpdateTileEntity pkt ) { // / pkt.actionType if( pkt.func_148853_f() == 64 ) { - ByteBuf stream = Unpooled.copiedBuffer( pkt.func_148857_g().getByteArray( "X" ) ); + final ByteBuf stream = Unpooled.copiedBuffer( pkt.func_148857_g().getByteArray( "X" ) ); if( this.readFromStream( stream ) ) { this.markForUpdate(); @@ -243,7 +243,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public final boolean readFromStream( ByteBuf data ) + public final boolean readFromStream( final ByteBuf data ) { boolean output = false; @@ -252,10 +252,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this.canBeRotated() ) { - ForgeDirection old_Forward = this.forward; - ForgeDirection old_Up = this.up; + final ForgeDirection old_Forward = this.forward; + final ForgeDirection old_Up = this.up; - byte orientation = data.readByte(); + final byte orientation = data.readByte(); this.forward = ForgeDirection.getOrientation( orientation & 0x7 ); this.up = ForgeDirection.getOrientation( orientation >> 3 ); @@ -263,7 +263,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } this.renderFragment = 100; - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_READ ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_READ ) ) { if( h.readFromStream( this, data ) ) { @@ -277,7 +277,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } this.renderFragment = 0; } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -302,22 +302,22 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public final void writeToStream( ByteBuf data ) + public final void writeToStream( final ByteBuf data ) { try { if( this.canBeRotated() ) { - byte orientation = (byte) ( ( this.up.ordinal() << 3 ) | this.forward.ordinal() ); + final byte orientation = (byte) ( ( this.up.ordinal() << 3 ) | this.forward.ordinal() ); data.writeByte( orientation ); } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_WRITE ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_WRITE ) ) { h.writeToStream( this, data ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -335,7 +335,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nonnull - private List getHandlerListFor( TileEventType type ) + private List getHandlerListFor( final TileEventType type ) { final Map> eventToHandlers = this.getEventToHandlers(); final List handlers = this.getHandlers( eventToHandlers, type ); @@ -355,9 +355,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, HANDLERS.put( clazz, newStoredHandlers ); - for( Method method : clazz.getMethods() ) + for( final Method method : clazz.getMethods() ) { - TileEvent event = method.getAnnotation( TileEvent.class ); + final TileEvent event = method.getAnnotation( TileEvent.class ); if( event != null ) { this.addHandler( newStoredHandlers, event.value(), method ); @@ -373,7 +373,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nonnull - private List getHandlers( Map> eventToHandlers, TileEventType event ) + private List getHandlers( final Map> eventToHandlers, final TileEventType event ) { final List oldHandlers = eventToHandlers.get( event ); @@ -390,7 +390,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - private void addHandler( Map> handlerSet, TileEventType value, Method m ) + private void addHandler( final Map> handlerSet, final TileEventType value, final Method m ) { List list = handlerSet.get( value ); @@ -416,7 +416,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { this.forward = inForward; this.up = inUp; @@ -424,7 +424,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord ); } - public void onPlacement( ItemStack stack, EntityPlayer player, int side ) + public void onPlacement( final ItemStack stack, final EntityPlayer player, final int side ) { if( stack.hasTagCompound() ) { @@ -438,11 +438,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * @param from source of settings * @param compound compound of source */ - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( compound != null && this instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); if( cm != null ) { cm.readFromNBT( compound ); @@ -451,17 +451,17 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; pHost.setPriority( compound.getInteger( "priority" ) ); } if( this instanceof ISegmentedInventory ) { - IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); + final IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { - AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; - AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); + final AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; + final AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); tmp.readFromNBT( compound, "config" ); for( int x = 0; x < tmp.getSizeInventory(); x++ ) { @@ -481,15 +481,15 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * @param drops drops of tile entity */ @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { if( this instanceof IInventory ) { - IInventory inv = (IInventory) this; + final IInventory inv = (IInventory) this; for( int l = 0; l < inv.getSizeInventory(); l++ ) { - ItemStack is = inv.getStackInSlot( l ); + final ItemStack is = inv.getStackInSlot( l ); if( is != null ) { drops.add( is ); @@ -498,7 +498,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public void getNoDrops( World w, int x, int y, int z, List drops ) + public void getNoDrops( final World w, final int x, final int y, final int z, final List drops ) { } @@ -515,20 +515,20 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * * @return compound of source */ - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { - NBTTagCompound output = new NBTTagCompound(); + final NBTTagCompound output = new NBTTagCompound(); if( this.hasCustomName() ) { - NBTTagCompound dsp = new NBTTagCompound(); + final NBTTagCompound dsp = new NBTTagCompound(); dsp.setString( "Name", this.getCustomName() ); output.setTag( "display", dsp ); } if( this instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); if( cm != null ) { cm.writeToNBT( output ); @@ -537,13 +537,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; output.setInteger( "priority", pHost.getPriority() ); } if( this instanceof ISegmentedInventory ) { - IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); + final IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { ( (AppEngInternalAEInventory) inv ).writeToNBT( output, "config" ); @@ -586,7 +586,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return false; } - public void setName( String name ) + public void setName( final String name ) { this.customName = name; } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java index 62dbf2e2..beaf3e55 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java @@ -51,12 +51,12 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora AEColor paintedColor = AEColor.Transparent; @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCraftingMonitorTile( ByteBuf data ) throws IOException + public boolean readFromStream_TileCraftingMonitorTile( final ByteBuf data ) throws IOException { - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; - boolean hasItem = data.readBoolean(); + final boolean hasItem = data.readBoolean(); if( hasItem ) { @@ -72,7 +72,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCraftingMonitorTile( ByteBuf data ) throws IOException + public void writeToStream_TileCraftingMonitorTile( final ByteBuf data ) throws IOException { data.writeByte( this.paintedColor.ordinal() ); @@ -88,7 +88,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCraftingMonitorTile( NBTTagCompound data ) + public void readFromNBT_TileCraftingMonitorTile( final NBTTagCompound data ) { if( data.hasKey( "paintedColor" ) ) { @@ -97,7 +97,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCraftingMonitorTile( NBTTagCompound data ) + public void writeToNBT_TileCraftingMonitorTile( final NBTTagCompound data ) { data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); } @@ -114,7 +114,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora return true; } - public void setJob( IAEItemStack is ) + public void setJob( final IAEItemStack is ) { if( ( is == null ) != ( this.dspPlay == null ) ) { @@ -149,7 +149,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @Override - public boolean recolourBlock( ForgeDirection side, AEColor newPaintedColor, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor newPaintedColor, final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { diff --git a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java index 7466d410..46279282 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java @@ -30,7 +30,7 @@ public class TileCraftingStorageTile extends TileCraftingTile public static final int KILO_SCALAR = 1024; @Override - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { final IBlocks blocks = AEApi.instance().definitions().blocks(); final int storage = ( (TileCraftingTile) obj ).getStorageBytes() / KILO_SCALAR; @@ -38,19 +38,19 @@ public class TileCraftingStorageTile extends TileCraftingTile switch( storage ) { case 4: - for( ItemStack stack : blocks.craftingStorage4k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage4k().maybeStack( 1 ).asSet() ) { return stack; } break; case 16: - for( ItemStack stack : blocks.craftingStorage16k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage16k().maybeStack( 1 ).asSet() ) { return stack; } break; case 64: - for( ItemStack stack : blocks.craftingStorage64k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage64k().maybeStack( 1 ).asSet() ) { return stack; } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingTile.java b/src/main/java/appeng/tile/crafting/TileCraftingTile.java index 5e5f0a8b..be046efc 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingTile.java @@ -76,11 +76,11 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { if( ( (TileCraftingTile) obj ).isAccelerator() ) { - for( ItemStack accelerator : AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 ).asSet() ) + for( final ItemStack accelerator : AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 ).asSet() ) { return accelerator; } @@ -97,7 +97,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - public void setName( String name ) + public void setName( final String name ) { super.setName( name ); if( this.cluster != null ) @@ -128,7 +128,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP this.calc.calculateMultiblock( this.worldObj, this.getLocation() ); } - public void updateStatus( CraftingCPUCluster c ) + public void updateStatus( final CraftingCPUCluster c ) { if( this.cluster != null && this.cluster != c ) { @@ -139,14 +139,14 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP this.updateMeta( true ); } - public void updateMeta( boolean updateFormed ) + public void updateMeta( final boolean updateFormed ) { if( this.worldObj == null || this.notLoaded() ) { return; } - boolean formed = this.isFormed(); + final boolean formed = this.isFormed(); boolean power = false; if( this.gridProxy.isReady() ) @@ -154,8 +154,8 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP power = this.gridProxy.isActive(); } - int current = this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ); - int newMeta = ( current & 3 ) | ( formed ? 8 : 0 ) | ( power ? 4 : 0 ); + final int current = this.worldObj.getBlockMetadata( this.xCoord, this.yCoord, this.zCoord ); + final int newMeta = ( current & 3 ) | ( formed ? 8 : 0 ) | ( power ? 4 : 0 ); if( current != newMeta ) { @@ -185,7 +185,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCraftingTile( NBTTagCompound data ) + public void writeToNBT_TileCraftingTile( final NBTTagCompound data ) { data.setBoolean( "core", this.isCoreBlock ); if( this.isCoreBlock && this.cluster != null ) @@ -195,7 +195,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCraftingTile( NBTTagCompound data ) + public void readFromNBT_TileCraftingTile( final NBTTagCompound data ) { this.isCoreBlock = data.getBoolean( "core" ); if( this.isCoreBlock ) @@ -212,7 +212,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - public void disconnect( boolean update ) + public void disconnect( final boolean update ) { if( this.cluster != null ) { @@ -237,13 +237,13 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @MENetworkEventSubscribe - public void onPowerStateChange( MENetworkChannelsChanged ev ) + public void onPowerStateChange( final MENetworkChannelsChanged ev ) { this.updateMeta( false ); } @MENetworkEventSubscribe - public void onPowerStateChange( MENetworkPowerStatusChange ev ) + public void onPowerStateChange( final MENetworkPowerStatusChange ev ) { this.updateMeta( false ); } @@ -268,25 +268,25 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP if( this.cluster != null ) { this.cluster.cancel(); - IMEInventory inv = this.cluster.getInventory(); + final IMEInventory inv = this.cluster.getInventory(); - LinkedList places = new LinkedList(); + final LinkedList places = new LinkedList(); - Iterator i = this.cluster.getTiles(); + final Iterator i = this.cluster.getTiles(); while( i.hasNext() ) { - IGridHost h = i.next(); + final IGridHost h = i.next(); if( h == this ) { places.add( new WorldCoord( this ) ); } else { - TileEntity te = (TileEntity) h; + final TileEntity te = (TileEntity) h; - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { - WorldCoord wc = new WorldCoord( te ); + final WorldCoord wc = new WorldCoord( te ); wc.add( d, 1 ); if( this.worldObj.isAirBlock( wc.x, wc.y, wc.z ) ) { @@ -309,13 +309,13 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP ais.setStackSize( ais.getItemStack().getMaxStackSize() ); while( true ) { - IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, this.cluster.getActionSource() ); + final IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, this.cluster.getActionSource() ); if( g == null ) { break; } - WorldCoord wc = places.poll(); + final WorldCoord wc = places.poll(); places.add( wc ); Platform.spawnDrops( this.worldObj, wc.x, wc.y, wc.z, Collections.singletonList( g.getItemStack() ) ); diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index a1e37046..4534e9c9 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -113,7 +113,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table, ForgeDirection where ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final ForgeDirection where ) { if( this.myPattern == null ) { @@ -144,7 +144,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private void updateSleepiness() { - boolean wasEnabled = this.isAwake; + final boolean wasEnabled = this.isAwake; this.isAwake = this.myPlan != null && this.hasMats() || this.canPush(); if( wasEnabled != this.isAwake ) { @@ -159,7 +159,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -193,34 +193,34 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileMolecularAssembler( ByteBuf data ) + public boolean readFromStream_TileMolecularAssembler( final ByteBuf data ) { - boolean oldPower = this.isPowered; + final boolean oldPower = this.isPowered; this.isPowered = data.readBoolean(); return this.isPowered != oldPower; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileMolecularAssembler( ByteBuf data ) + public void writeToStream_TileMolecularAssembler( final ByteBuf data ) { data.writeBoolean( this.isPowered ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileMolecularAssembler( NBTTagCompound data ) + public void writeToNBT_TileMolecularAssembler( final NBTTagCompound data ) { if( this.forcePlan && this.myPlan != null ) { - ItemStack pattern = this.myPlan.getPattern(); + final ItemStack pattern = this.myPlan.getPattern(); if( pattern != null ) { - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); pattern.writeToNBT( compound ); data.setTag( "myPlan", compound ); data.setInteger( "pushDirection", this.pushDirection.ordinal() ); @@ -233,17 +233,17 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileMolecularAssembler( NBTTagCompound data ) + public void readFromNBT_TileMolecularAssembler( final NBTTagCompound data ) { if( data.hasKey( "myPlan" ) ) { - ItemStack myPat = ItemStack.loadItemStackFromNBT( data.getCompoundTag( "myPlan" ) ); + final ItemStack myPat = ItemStack.loadItemStackFromNBT( data.getCompoundTag( "myPlan" ) ); if( myPat != null && myPat.getItem() instanceof ItemEncodedPattern ) { - World w = this.getWorldObj(); - ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w ); + final World w = this.getWorldObj(); + final ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w ); if( ph != null && ph.isCraftable() ) { this.forcePlan = true; @@ -268,15 +268,15 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade return; } - ItemStack is = this.inv.getStackInSlot( 10 ); + final ItemStack is = this.inv.getStackInSlot( 10 ); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { if( !Platform.isSameItem( is, this.myPattern ) ) { - World w = this.getWorldObj(); - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); + final World w = this.getWorldObj(); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); if( ph != null && ph.isCraftable() ) { @@ -299,7 +299,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @@ -317,7 +317,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { @@ -333,7 +333,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -351,7 +351,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( i >= 9 ) { @@ -372,7 +372,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( inv == this.inv ) { @@ -381,13 +381,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return slotIndex == 9; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection whichSide ) + public int[] getAccessibleSlotsBySide( final ForgeDirection whichSide ) { return SIDES; } @@ -398,13 +398,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { super.getDrops( w, x, y, z, drops ); for( int h = 0; h < this.upgrades.getSizeInventory(); h++ ) { - ItemStack is = this.upgrades.getStackInSlot( h ); + final ItemStack is = this.upgrades.getStackInSlot( h ); if( is != null ) { drops.add( is ); @@ -413,7 +413,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { this.recalculatePlan(); this.updateSleepiness(); @@ -421,7 +421,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, int ticksSinceLastCall ) { if( this.inv.getStackInSlot( 9 ) != null ) { @@ -487,7 +487,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } this.progress = 0; - ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorldObj() ); + final ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorldObj() ); if( output != null ) { FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorldObj() ), output, this.craftingInv ); @@ -510,11 +510,11 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade try { - TargetPoint where = new TargetPoint( this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32 ); - IAEItemStack item = AEItemStack.create( output ); + final TargetPoint where = new TargetPoint( this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32 ); + final IAEItemStack item = AEItemStack.create( output ); NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( this.xCoord, this.yCoord, this.zCoord, (byte) speed, item ), where ); } - catch( IOException e ) + catch( final IOException e ) { // ;P } @@ -534,7 +534,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { for( int x = 0; x < 9; x++ ) { - ItemStack is = this.inv.getStackInSlot( x ); + final ItemStack is = this.inv.getStackInSlot( x ); if( is != null ) { if( this.myPlan == null || !this.myPlan.isValidItemForSlot( x, is, this.worldObj ) ) @@ -549,13 +549,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } } - private int userPower( int ticksPassed, int bonusValue, double acceleratorTax ) + private int userPower( final int ticksPassed, final int bonusValue, final double acceleratorTax ) { try { return (int) ( this.gridProxy.getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE, PowerMultiplier.CONFIG ) / acceleratorTax ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return 0; } @@ -565,7 +565,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { if( this.pushDirection == ForgeDirection.UNKNOWN ) { - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { output = this.pushTo( output, d ); } @@ -584,30 +584,30 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade this.inv.setInventorySlotContents( 9, output ); } - private ItemStack pushTo( ItemStack output, ForgeDirection d ) + private ItemStack pushTo( ItemStack output, final ForgeDirection d ) { if( output == null ) { return output; } - TileEntity te = this.getWorldObj().getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); + final TileEntity te = this.getWorldObj().getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); if( te == null ) { return output; } - InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( te, d.getOpposite() ); + final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( te, d.getOpposite() ); if( adaptor == null ) { return output; } - int size = output.stackSize; + final int size = output.stackSize; output = adaptor.addItems( output ); - int newSize = output == null ? 0 : output.stackSize; + final int newSize = output == null ? 0 : output.stackSize; if( size != newSize ) { @@ -618,7 +618,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @MENetworkEventSubscribe - public void onPowerEvent( MENetworkPowerStatusChange p ) + public void onPowerEvent( final MENetworkPowerStatusChange p ) { this.updatePowerState(); } @@ -631,7 +631,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { newState = this.gridProxy.isActive() && this.gridProxy.getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001; } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } diff --git a/src/main/java/appeng/tile/events/AETileEventHandler.java b/src/main/java/appeng/tile/events/AETileEventHandler.java index 3bd648e3..9aceabb9 100644 --- a/src/main/java/appeng/tile/events/AETileEventHandler.java +++ b/src/main/java/appeng/tile/events/AETileEventHandler.java @@ -37,90 +37,90 @@ public final class AETileEventHandler private final Method method; - public AETileEventHandler( Method method ) + public AETileEventHandler( final Method method ) { this.method = method; } // TICK - public void tick( AEBaseTile tile ) + public void tick( final AEBaseTile tile ) { try { this.method.invoke( tile ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // WORLD_NBT - public void writeToNBT( AEBaseTile tile, NBTTagCompound data ) + public void writeToNBT( final AEBaseTile tile, final NBTTagCompound data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // WORLD NBT - public void readFromNBT( AEBaseTile tile, NBTTagCompound data ) + public void readFromNBT( final AEBaseTile tile, final NBTTagCompound data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // NETWORK - public void writeToStream( AEBaseTile tile, ByteBuf data ) + public void writeToStream( final AEBaseTile tile, final ByteBuf data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } @@ -136,21 +136,21 @@ public final class AETileEventHandler * @return true of method could be invoked */ @SideOnly( Side.CLIENT ) - public boolean readFromStream( AEBaseTile tile, ByteBuf data ) + public boolean readFromStream( final AEBaseTile tile, final ByteBuf data ) { try { return (Boolean) this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } diff --git a/src/main/java/appeng/tile/grid/AENetworkInvTile.java b/src/main/java/appeng/tile/grid/AENetworkInvTile.java index 00871f90..369c159d 100644 --- a/src/main/java/appeng/tile/grid/AENetworkInvTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkInvTile.java @@ -37,13 +37,13 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -61,7 +61,7 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.gridProxy.getNode(); } diff --git a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java index b5a0a6b3..dafe4bc7 100644 --- a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java @@ -39,13 +39,13 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -69,13 +69,13 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.gridProxy.getNode(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } diff --git a/src/main/java/appeng/tile/grid/AENetworkTile.java b/src/main/java/appeng/tile/grid/AENetworkTile.java index db76da81..464270f5 100644 --- a/src/main/java/appeng/tile/grid/AENetworkTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkTile.java @@ -39,13 +39,13 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy protected final AENetworkProxy gridProxy = this.createProxy(); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -56,13 +56,13 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.gridProxy.getNode(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } diff --git a/src/main/java/appeng/tile/grindstone/TileCrank.java b/src/main/java/appeng/tile/grindstone/TileCrank.java index f39de93b..f66eb8a9 100644 --- a/src/main/java/appeng/tile/grindstone/TileCrank.java +++ b/src/main/java/appeng/tile/grindstone/TileCrank.java @@ -60,7 +60,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision if( this.charge >= this.ticksPerRotation ) { this.charge -= this.ticksPerRotation; - ICrankable g = this.getGrinder(); + final ICrankable g = this.getGrinder(); if( g != null ) { g.applyTurn(); @@ -78,8 +78,8 @@ public class TileCrank extends AEBaseTile implements ICustomCollision return null; } - ForgeDirection grinder = this.getUp().getOpposite(); - TileEntity te = this.worldObj.getTileEntity( this.xCoord + grinder.offsetX, this.yCoord + grinder.offsetY, this.zCoord + grinder.offsetZ ); + final ForgeDirection grinder = this.getUp().getOpposite(); + final TileEntity te = this.worldObj.getTileEntity( this.xCoord + grinder.offsetX, this.yCoord + grinder.offsetY, this.zCoord + grinder.offsetZ ); if( te instanceof ICrankable ) { return (ICrankable) te; @@ -88,20 +88,20 @@ public class TileCrank extends AEBaseTile implements ICustomCollision } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCrank( ByteBuf data ) + public boolean readFromStream_TileCrank( final ByteBuf data ) { this.rotation = data.readInt(); return false; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCrank( ByteBuf data ) + public void writeToStream_TileCrank( final ByteBuf data ) { data.writeInt( this.rotation ); } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.AIR_BLOCK ); @@ -125,7 +125,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision if( this.rotation < 3 ) { - ICrankable g = this.getGrinder(); + final ICrankable g = this.getGrinder(); if( g != null ) { if( g.canTurn() ) @@ -151,20 +151,20 @@ public class TileCrank extends AEBaseTile implements ICustomCollision } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual ) { - double xOff = -0.15 * this.getUp().offsetX; - double yOff = -0.15 * this.getUp().offsetY; - double zOff = -0.15 * this.getUp().offsetZ; + final double xOff = -0.15 * this.getUp().offsetX; + final double yOff = -0.15 * this.getUp().offsetY; + final double zOff = -0.15 * this.getUp().offsetZ; return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { - double xOff = -0.15 * this.getUp().offsetX; - double yOff = -0.15 * this.getUp().offsetY; - double zOff = -0.15 * this.getUp().offsetZ; + final double xOff = -0.15 * this.getUp().offsetX; + final double yOff = -0.15 * this.getUp().offsetY; + final double zOff = -0.15 * this.getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + 0.15, yOff + 0.15, zOff + 0.15,// ahh xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } diff --git a/src/main/java/appeng/tile/grindstone/TileGrinder.java b/src/main/java/appeng/tile/grindstone/TileGrinder.java index 7efa5185..5d232485 100644 --- a/src/main/java/appeng/tile/grindstone/TileGrinder.java +++ b/src/main/java/appeng/tile/grindstone/TileGrinder.java @@ -47,7 +47,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable int points; @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.AIR_BLOCK ); @@ -60,13 +60,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { if( AEApi.instance().registries().grinder().getRecipeForInput( insertingItem ) == null ) { @@ -77,13 +77,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return slotIndex >= 3 && slotIndex <= 5; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } @@ -98,7 +98,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable if( null == this.getStackInSlot( 6 ) ) // Add if there isn't one... { - IInventory src = new WrapperInventoryRange( this, this.inputs, true ); + final IInventory src = new WrapperInventoryRange( this, this.inputs, true ); for( int x = 0; x < src.getSizeInventory(); x++ ) { ItemStack item = src.getStackInSlot( x ); @@ -107,13 +107,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable continue; } - IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( item ); + final IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( item ); if( r != null ) { if( item.stackSize >= r.getInput().stackSize ) { item.stackSize -= r.getInput().stackSize; - ItemStack ais = item.copy(); + final ItemStack ais = item.copy(); ais.stackSize = r.getInput().stackSize; if( item.stackSize <= 0 ) @@ -142,8 +142,8 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable this.points++; - ItemStack processing = this.getStackInSlot( 6 ); - IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing ); + final ItemStack processing = this.getStackInSlot( 6 ); + final IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing ); if( r != null ) { if( r.getEnergyCost() > this.points ) @@ -152,7 +152,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } this.points = 0; - InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), ForgeDirection.EAST ); + final InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), ForgeDirection.EAST ); this.addItem( sia, r.getOutput() ); @@ -172,21 +172,21 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } } - private void addItem( InventoryAdaptor sia, ItemStack output ) + private void addItem( final InventoryAdaptor sia, final ItemStack output ) { if( output == null ) { return; } - ItemStack notAdded = sia.addItems( output ); + final ItemStack notAdded = sia.addItems( output ); if( notAdded != null ) { - WorldCoord wc = new WorldCoord( this.xCoord, this.yCoord, this.zCoord ); + final WorldCoord wc = new WorldCoord( this.xCoord, this.yCoord, this.zCoord ); wc.add( this.getForward(), 1 ); - List out = new ArrayList(); + final List out = new ArrayList(); out.add( notAdded ); Platform.spawnDrops( this.worldObj, wc.x, wc.y, wc.z, out ); @@ -194,7 +194,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public boolean canCrankAttach( ForgeDirection directionToCrank ) + public boolean canCrankAttach( final ForgeDirection directionToCrank ) { return this.getUp() == directionToCrank; } diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java index 39da082c..c32b8e1a 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java @@ -43,7 +43,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable= split.stackSize ) @@ -177,15 +177,15 @@ public class AppEngInternalAEInventory implements IInventory, Iterable protected IAEAppEngInventory te; protected int maxStack; - public AppEngInternalInventory( IAEAppEngInventory inventory, int size ) + public AppEngInternalInventory( final IAEAppEngInventory inventory, final int size ) { this.te = inventory; this.size = size; @@ -74,17 +74,17 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.inv[var1]; } @Override - public ItemStack decrStackSize( int slot, int qty ) + public ItemStack decrStackSize( final int slot, final int qty ) { if( this.inv[slot] != null ) { - ItemStack split = this.getStackInSlot( slot ); + final ItemStack split = this.getStackInSlot( slot ); ItemStack ns = null; if( qty >= split.stackSize ) @@ -115,15 +115,15 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int slot, ItemStack newItemStack ) + public void setInventorySlotContents( final int slot, final ItemStack newItemStack ) { - ItemStack oldStack = this.inv[slot]; + final ItemStack oldStack = this.inv[slot]; this.inv[slot] = newItemStack; if( this.te != null && this.eventsEnabled() ) @@ -185,7 +185,7 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return true; } @@ -201,18 +201,18 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return true; } - public void setMaxStackSize( int s ) + public void setMaxStackSize( final int s ) { this.maxStack = s; } // for guis... - public void markDirty( int slotIndex ) + public void markDirty( final int slotIndex ) { if( this.te != null && this.eventsEnabled() ) { @@ -220,20 +220,20 @@ public class AppEngInternalInventory implements IInventory, Iterable } } - public void writeToNBT( NBTTagCompound data, String name ) + public void writeToNBT( final NBTTagCompound data, final String name ) { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); this.writeToNBT( c ); data.setTag( name, c ); } - public void writeToNBT( NBTTagCompound target ) + public void writeToNBT( final NBTTagCompound target ) { for( int x = 0; x < this.size; x++ ) { try { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); if( this.inv[x] != null ) { @@ -242,35 +242,35 @@ public class AppEngInternalInventory implements IInventory, Iterable target.setTag( "#" + x, c ); } - catch( Exception ignored ) + catch( final Exception ignored ) { } } } - public void readFromNBT( NBTTagCompound data, String name ) + public void readFromNBT( final NBTTagCompound data, final String name ) { - NBTTagCompound c = data.getCompoundTag( name ); + final NBTTagCompound c = data.getCompoundTag( name ); if( c != null ) { this.readFromNBT( c ); } } - public void readFromNBT( NBTTagCompound target ) + public void readFromNBT( final NBTTagCompound target ) { for( int x = 0; x < this.size; x++ ) { try { - NBTTagCompound c = target.getCompoundTag( "#" + x ); + final NBTTagCompound c = target.getCompoundTag( "#" + x ); if( c != null ) { this.inv[x] = ItemStack.loadItemStackFromNBT( c ); } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java index 20c766d6..1cb62853 100644 --- a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java @@ -32,7 +32,7 @@ public class AppEngNullInventory implements IInventory { } - public void writeToNBT( NBTTagCompound target ) + public void writeToNBT( final NBTTagCompound target ) { } @@ -43,25 +43,25 @@ public class AppEngNullInventory implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return null; } @Override - public ItemStack decrStackSize( int slot, int qty ) + public ItemStack decrStackSize( final int slot, final int qty ) { return null; } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int slot, ItemStack newItemStack ) + public void setInventorySlotContents( final int slot, final ItemStack newItemStack ) { } @@ -91,7 +91,7 @@ public class AppEngNullInventory implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return false; } @@ -107,7 +107,7 @@ public class AppEngNullInventory implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return false; } diff --git a/src/main/java/appeng/tile/misc/TileCellWorkbench.java b/src/main/java/appeng/tile/misc/TileCellWorkbench.java index fdefc8ba..a54dbe50 100644 --- a/src/main/java/appeng/tile/misc/TileCellWorkbench.java +++ b/src/main/java/appeng/tile/misc/TileCellWorkbench.java @@ -64,19 +64,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if( this.cacheUpgrades == null ) { - ICellWorkbenchItem cell = this.getCell(); + final ICellWorkbenchItem cell = this.getCell(); if( cell == null ) { return null; } - ItemStack is = this.cell.getStackInSlot( 0 ); + final ItemStack is = this.cell.getStackInSlot( 0 ); if( is == null ) { return null; } - IInventory inv = cell.getUpgradesInventory( is ); + final IInventory inv = cell.getUpgradesInventory( is ); if( inv == null ) { return null; @@ -103,7 +103,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCellWorkbench( NBTTagCompound data ) + public void writeToNBT_TileCellWorkbench( final NBTTagCompound data ) { this.cell.writeToNBT( data, "cell" ); this.config.writeToNBT( data, "config" ); @@ -111,7 +111,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCellWorkbench( NBTTagCompound data ) + public void readFromNBT_TileCellWorkbench( final NBTTagCompound data ) { this.cell.readFromNBT( data, "cell" ); this.config.readFromNBT( data, "config" ); @@ -119,7 +119,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -135,13 +135,13 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.cell && !this.locked ) { @@ -150,7 +150,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I this.cacheUpgrades = null; this.cacheConfig = null; - IInventory configInventory = this.getCellConfigInventory(); + final IInventory configInventory = this.getCellConfigInventory(); if( configInventory != null ) { boolean cellHasConfig = false; @@ -194,7 +194,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } else if( inv == this.config && !this.locked ) { - IInventory c = this.getCellConfigInventory(); + final IInventory c = this.getCellConfigInventory(); if( c != null ) { for( int x = 0; x < this.config.getSizeInventory(); x++ ) @@ -211,19 +211,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if( this.cacheConfig == null ) { - ICellWorkbenchItem cell = this.getCell(); + final ICellWorkbenchItem cell = this.getCell(); if( cell == null ) { return null; } - ItemStack is = this.cell.getStackInSlot( 0 ); + final ItemStack is = this.cell.getStackInSlot( 0 ); if( is == null ) { return null; } - IInventory inv = cell.getConfigInventory( is ); + final IInventory inv = cell.getConfigInventory( is ); if( inv == null ) { return null; @@ -235,7 +235,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { super.getDrops( w, x, y, z, drops ); @@ -252,7 +252,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { // nothing here.. } diff --git a/src/main/java/appeng/tile/misc/TileCharger.java b/src/main/java/appeng/tile/misc/TileCharger.java index 43c9e9d5..9aa2eb28 100644 --- a/src/main/java/appeng/tile/misc/TileCharger.java +++ b/src/main/java/appeng/tile/misc/TileCharger.java @@ -71,21 +71,21 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCharger( ByteBuf data ) + public boolean readFromStream_TileCharger( final ByteBuf data ) { try { - IAEItemStack item = AEItemStack.loadItemStackFromPacket( data ); - ItemStack is = item.getItemStack(); + final IAEItemStack item = AEItemStack.loadItemStackFromPacket( data ); + final ItemStack is = item.getItemStack(); this.inv.setInventorySlotContents( 0, is ); } - catch( Throwable t ) + catch( final Throwable t ) { this.inv.setInventorySlotContents( 0, null ); } @@ -93,9 +93,9 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCharger( ByteBuf data ) throws IOException + public void writeToStream_TileCharger( final ByteBuf data ) throws IOException { - AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) ); + final AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) ); if( is != null ) { is.writeToPacket( data ); @@ -120,7 +120,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } this.tickTickTimer = 0; - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); // charge from the network! if( this.internalCurrentPower < 1499 ) @@ -130,7 +130,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable this.injectExternalPower( PowerUnits.AE, this.gridProxy.getEnergy().extractAEPower( Math.min( 150.0, 1500.0 - this.internalCurrentPower ), Actionable.MODULATE, PowerMultiplier.ONE ) ); this.tickTickTimer = 20; // keep ticking... } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // continue! } @@ -145,12 +145,12 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable if( this.internalCurrentPower > 149 && Platform.isChargeable( myItem ) ) { - IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem(); + final IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem(); if( ps.getAEMaxPower( myItem ) > ps.getAECurrentPower( myItem ) ) { - double oldPower = this.internalCurrentPower; + final double oldPower = this.internalCurrentPower; - double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); + final double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); this.internalCurrentPower += adjustment; if( oldPower > this.internalCurrentPower ) { @@ -165,7 +165,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable { this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) + for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) { this.setInventorySlotContents( 0, charged ); } @@ -174,7 +174,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); @@ -198,7 +198,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable { this.injectExternalPower( PowerUnits.AE, 150 ); - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); if( this.internalCurrentPower > 1499 ) { final IMaterials materials = AEApi.instance().definitions().materials(); @@ -207,7 +207,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable { this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) + for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) { this.setInventorySlotContents( 0, charged ); } @@ -216,7 +216,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public boolean canCrankAttach( ForgeDirection directionToCrank ) + public boolean canCrankAttach( final ForgeDirection directionToCrank ) { return this.getUp() == directionToCrank || this.getUp().getOpposite() == directionToCrank; } @@ -234,7 +234,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal(); @@ -242,17 +242,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { this.markForUpdate(); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { if( Platform.isChargeable( extractedItem ) ) { - IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem(); + final IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem(); if( ips.getAECurrentPower( extractedItem ) >= ips.getAEMaxPower( extractedItem ) ) { return true; @@ -263,19 +263,19 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection whichSide ) + public int[] getAccessibleSlotsBySide( final ForgeDirection whichSide ) { return this.sides; } - public void activate( EntityPlayer player ) + public void activate( final EntityPlayer player ) { if( !Platform.hasPermissions( new DimensionalCoord( this ), player ) ) { return; } - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); if( myItem == null ) { ItemStack held = player.inventory.getCurrentItem(); @@ -288,7 +288,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable } else { - List drops = new ArrayList(); + final List drops = new ArrayList(); drops.add( myItem ); this.setInventorySlotContents( 0, null ); Platform.spawnDrops( this.worldObj, this.xCoord + this.getForward().offsetX, this.yCoord + this.getForward().offsetY, this.zCoord + this.getForward().offsetZ, drops ); diff --git a/src/main/java/appeng/tile/misc/TileCondenser.java b/src/main/java/appeng/tile/misc/TileCondenser.java index d3da0ecf..1ddd59d0 100644 --- a/src/main/java/appeng/tile/misc/TileCondenser.java +++ b/src/main/java/appeng/tile/misc/TileCondenser.java @@ -61,14 +61,14 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCondenser( NBTTagCompound data ) + public void writeToNBT_TileCondenser( final NBTTagCompound data ) { this.cm.writeToNBT( data ); data.setDouble( "storedPower", this.storedPower ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCondenser( NBTTagCompound data ) + public void readFromNBT_TileCondenser( final NBTTagCompound data ) { this.cm.readFromNBT( data ); this.storedPower = data.getDouble( "storedPower" ); @@ -76,12 +76,12 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf public double getStorage() { - ItemStack is = this.inv.getStackInSlot( 2 ); + final ItemStack is = this.inv.getStackInSlot( 2 ); if( is != null ) { if( is.getItem() instanceof IStorageComponent ) { - IStorageComponent sc = (IStorageComponent) is.getItem(); + final IStorageComponent sc = (IStorageComponent) is.getItem(); if( sc.isStorageComponent( is ) ) { return sc.getBytes( is ) * 8; @@ -91,13 +91,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf return 0; } - public void addPower( double rawPower ) + public void addPower( final double rawPower ) { this.storedPower += rawPower; this.storedPower = Math.max( 0.0, Math.min( this.getStorage(), this.storedPower ) ); - double requiredPower = this.getRequiredPower(); - ItemStack output = this.getOutput(); + final double requiredPower = this.getRequiredPower(); + final ItemStack output = this.getOutput(); while( requiredPower <= this.storedPower && output != null && requiredPower > 0 ) { if( this.canAddOutput( output ) ) @@ -112,9 +112,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } } - private boolean canAddOutput( ItemStack output ) + private boolean canAddOutput( final ItemStack output ) { - ItemStack outputStack = this.getStackInSlot( 1 ); + final ItemStack outputStack = this.getStackInSlot( 1 ); return outputStack == null || ( Platform.isSameItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize() ); } @@ -123,9 +123,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf * * @param output to be added output */ - private void addOutput( ItemStack output ) + private void addOutput( final ItemStack output ) { - ItemStack outputStack = this.getStackInSlot( 1 ); + final ItemStack outputStack = this.getStackInSlot( 1 ); if( outputStack == null ) { this.setInventorySlotContents( 1, output.copy() ); @@ -144,13 +144,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) ) { case MATTER_BALLS: - for( ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() ) + for( final ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() ) { return matterBallStack; } case SINGULARITY: - for( ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() ) + for( final ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() ) { return singularityStack; } @@ -173,7 +173,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { if( i == 0 ) { @@ -189,17 +189,17 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return i == 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( slot == 0 ) { - ItemStack is = inv.getStackInSlot( 0 ); + final ItemStack is = inv.getStackInSlot( 0 ); if( is != null ) { this.addPower( is.stackSize ); @@ -209,25 +209,25 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { return slotIndex == 0; } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return slotIndex != 0; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } @Override - public int fill( ForgeDirection from, FluidStack resource, boolean doFill ) + public int fill( final ForgeDirection from, final FluidStack resource, final boolean doFill ) { if( doFill ) { @@ -238,37 +238,37 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( ForgeDirection from, Fluid fluid ) + public boolean canFill( final ForgeDirection from, final Fluid fluid ) { return true; } @Override - public boolean canDrain( ForgeDirection from, Fluid fluid ) + public boolean canDrain( final ForgeDirection from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( ForgeDirection from ) + public FluidTankInfo[] getTankInfo( final ForgeDirection from ) { return EMPTY; } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.addPower( 0 ); } diff --git a/src/main/java/appeng/tile/misc/TileInscriber.java b/src/main/java/appeng/tile/misc/TileInscriber.java index 94753f34..7ba90268 100644 --- a/src/main/java/appeng/tile/misc/TileInscriber.java +++ b/src/main/java/appeng/tile/misc/TileInscriber.java @@ -111,13 +111,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileInscriber( NBTTagCompound data ) + public void writeToNBT_TileInscriber( final NBTTagCompound data ) { this.inv.writeToNBT( data, "inscriberInv" ); this.upgrades.writeToNBT( data, "upgrades" ); @@ -125,7 +125,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileInscriber( NBTTagCompound data ) + public void readFromNBT_TileInscriber( final NBTTagCompound data ) { this.inv.readFromNBT( data, "inscriberInv" ); this.upgrades.readFromNBT( data, "upgrades" ); @@ -133,12 +133,12 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileInscriber( ByteBuf data ) throws IOException + public boolean readFromStream_TileInscriber( final ByteBuf data ) throws IOException { - int slot = data.readByte(); + final int slot = data.readByte(); - boolean oldSmash = this.smash; - boolean newSmash = ( slot & 64 ) == 64; + final boolean oldSmash = this.smash; + final boolean newSmash = ( slot & 64 ) == 64; if( oldSmash != newSmash && newSmash ) { @@ -162,7 +162,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileInscriber( ByteBuf data ) throws IOException + public void writeToStream_TileInscriber( final ByteBuf data ) throws IOException { int slot = this.smash ? 64 : 0; @@ -179,14 +179,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { if( ( slot & ( 1 << num ) ) > 0 ) { - AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) ); + final AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) ); st.writeToPacket( data ); } } } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) ); @@ -194,13 +194,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { super.getDrops( w, x, y, z, drops ); for( int h = 0; h < this.upgrades.getSizeInventory(); h++ ) { - ItemStack is = this.upgrades.getStackInSlot( h ); + final ItemStack is = this.upgrades.getStackInSlot( h ); if( is != null ) { drops.add( is ); @@ -227,7 +227,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.smash ) { @@ -241,7 +241,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, return true; } - for( ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optionals, itemstack ) ) { @@ -254,7 +254,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { try { @@ -273,14 +273,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { if( this.smash ) { @@ -291,7 +291,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection d ) + public int[] getAccessibleSlotsBySide( final ForgeDirection d ) { if( d == ForgeDirection.UP ) { @@ -307,7 +307,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.Inscriber.min, TickRates.Inscriber.max, !this.hasWork(), false ); } @@ -326,8 +326,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Nullable public IInscriberRecipe getTask() { - ItemStack plateA = this.getStackInSlot( 0 ); - ItemStack plateB = this.getStackInSlot( 1 ); + final ItemStack plateA = this.getStackInSlot( 0 ); + final ItemStack plateB = this.getStackInSlot( 1 ); ItemStack renamedItem = this.getStackInSlot( 2 ); if( plateA != null && plateA.stackSize > 1 ) @@ -346,8 +346,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } final IComparableDefinition namePress = AEApi.instance().definitions().materials().namePress(); - boolean isNameA = namePress.isSameAs( plateA ); - boolean isNameB = namePress.isSameAs( plateB ); + final boolean isNameA = namePress.isSameAs( plateA ); + final boolean isNameB = namePress.isSameAs( plateB ); if( ( isNameA || isNameB ) && ( isNameA || plateA == null ) && ( isNameB || plateB == null ) ) { @@ -357,13 +357,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( plateA != null ) { - NBTTagCompound tag = Platform.openNbtData( plateA ); + final NBTTagCompound tag = Platform.openNbtData( plateA ); name += tag.getString( "InscribeName" ); } if( plateB != null ) { - NBTTagCompound tag = Platform.openNbtData( plateB ); + final NBTTagCompound tag = Platform.openNbtData( plateB ); if( name.length() > 0 ) { name += " "; @@ -371,11 +371,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, name += tag.getString( "InscribeName" ); } - ItemStack startingItem = renamedItem.copy(); + final ItemStack startingItem = renamedItem.copy(); renamedItem = renamedItem.copy(); - NBTTagCompound tag = Platform.openNbtData( renamedItem ); + final NBTTagCompound tag = Platform.openNbtData( renamedItem ); - NBTTagCompound display = tag.getCompoundTag( "display" ); + final NBTTagCompound display = tag.getCompoundTag( "display" ); tag.setTag( "display", display ); if( name.length() > 0 ) @@ -394,18 +394,18 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } } - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and... ( plateB == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateB, recipe.getBottomOptional().orNull() ) ); - boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and... ( plateA == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateA, recipe.getBottomOptional().orNull() ) ); if( matchA || matchB ) { - for( ItemStack option : recipe.getInputs() ) + for( final ItemStack option : recipe.getInputs() ) { if( Platform.isSameItemPrecise( option, this.getStackInSlot( 2 ) ) ) { @@ -418,7 +418,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.smash ) { @@ -429,7 +429,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( out != null ) { final ItemStack outputCopy = out.getOutput().copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); if( ad.addItems( outputCopy ) == null ) { @@ -456,13 +456,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { try { - IEnergyGrid eg = this.gridProxy.getEnergy(); + final IEnergyGrid eg = this.gridProxy.getEnergy(); IEnergySource src = this; // Base 1, increase by 1 for each card - int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED ); - int powerConsumption = 10 * speedFactor; - double powerThreshold = powerConsumption - 0.01; + final int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED ); + final int powerConsumption = 10 * speedFactor; + final double powerThreshold = powerConsumption - 0.01; double powerReq = this.extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( powerReq <= powerThreshold ) @@ -485,7 +485,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -493,11 +493,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( this.processingTime > this.maxProcessingTime ) { this.processingTime = this.maxProcessingTime; - IInscriberRecipe out = this.getTask(); + final IInscriberRecipe out = this.getTask(); if( out != null ) { - ItemStack outputCopy = out.getOutput().copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); + final ItemStack outputCopy = out.getOutput().copy(); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN ); if( ad.simulateAdd( outputCopy ) == null ) { this.smash = true; @@ -518,7 +518,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "inv" ) ) { @@ -534,13 +534,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } } diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index 7d3e11d8..e13e4018 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -71,18 +71,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT ForgeDirection pointAt = ForgeDirection.UNKNOWN; @MENetworkEventSubscribe - public void stateChange( MENetworkChannelsChanged c ) + public void stateChange( final MENetworkChannelsChanged c ) { this.duality.notifyNeighbors(); } @MENetworkEventSubscribe - public void stateChange( MENetworkPowerStatusChange c ) + public void stateChange( final MENetworkPowerStatusChange c ) { this.duality.notifyNeighbors(); } - public void setSide( ForgeDirection axis ) + public void setSide( final ForgeDirection axis ) { if( Platform.isClient() ) { @@ -127,7 +127,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { this.duality.addDrops( drops ); } @@ -147,16 +147,16 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileInterface( NBTTagCompound data ) + public void writeToNBT_TileInterface( final NBTTagCompound data ) { data.setInteger( "pointAt", this.pointAt.ordinal() ); this.duality.writeToNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileInterface( NBTTagCompound data ) + public void readFromNBT_TileInterface( final NBTTagCompound data ) { - int val = data.getInteger( "pointAt" ); + final int val = data.getInteger( "pointAt" ); if( val >= 0 && val < ForgeDirection.values().length ) { @@ -171,7 +171,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return this.duality.getCableConnectionType( dir ); } @@ -183,7 +183,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { return this.duality.canInsert( stack ); } @@ -201,19 +201,19 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return this.duality.getInventoryByName( name ); } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return this.duality.getTickingRequest( node ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.duality.tickingRequest( node, ticksSinceLastCall ); } @@ -225,13 +225,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { this.duality.onChangeInventory( inv, slot, mc, removed, added ); } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.duality.getAccessibleSlotsFromSide( side.ordinal() ); } @@ -259,7 +259,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src ) { return this.duality.getMonitorable( side, src, this ); } @@ -271,7 +271,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return this.duality.pushPattern( patternDetails, table ); } @@ -283,13 +283,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { this.duality.provideCrafting( craftingTracker ); } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.duality.getInstalledUpgrades( u ); } @@ -301,13 +301,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { return this.duality.injectCraftedItems( link, items, mode ); } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.duality.jobStateChange( link ); } @@ -319,7 +319,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.duality.setPriority( newValue ); } diff --git a/src/main/java/appeng/tile/misc/TileLightDetector.java b/src/main/java/appeng/tile/misc/TileLightDetector.java index 3921de19..9af65a69 100644 --- a/src/main/java/appeng/tile/misc/TileLightDetector.java +++ b/src/main/java/appeng/tile/misc/TileLightDetector.java @@ -49,7 +49,7 @@ public class TileLightDetector extends AEBaseTile public void updateLight() { - int val = this.worldObj.getBlockLightValue( this.xCoord, this.yCoord, this.zCoord ); + final int val = this.worldObj.getBlockLightValue( this.xCoord, this.yCoord, this.zCoord ); if( this.lastLight != val ) { diff --git a/src/main/java/appeng/tile/misc/TilePaint.java b/src/main/java/appeng/tile/misc/TilePaint.java index a73d576d..b573c7c4 100644 --- a/src/main/java/appeng/tile/misc/TilePaint.java +++ b/src/main/java/appeng/tile/misc/TilePaint.java @@ -54,9 +54,9 @@ public class TilePaint extends AEBaseTile List dots = null; @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TilePaint( NBTTagCompound data ) + public void writeToNBT_TilePaint( final NBTTagCompound data ) { - ByteBuf myDat = Unpooled.buffer(); + final ByteBuf myDat = Unpooled.buffer(); this.writeBuffer( myDat ); if( myDat.hasArray() ) { @@ -64,7 +64,7 @@ public class TilePaint extends AEBaseTile } } - void writeBuffer( ByteBuf out ) + void writeBuffer( final ByteBuf out ) { if( this.dots == null ) { @@ -74,14 +74,14 @@ public class TilePaint extends AEBaseTile out.writeByte( this.dots.size() ); - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { s.writeToStream( out ); } } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TilePaint( NBTTagCompound data ) + public void readFromNBT_TilePaint( final NBTTagCompound data ) { if( data.hasKey( "dots" ) ) { @@ -89,9 +89,9 @@ public class TilePaint extends AEBaseTile } } - void readBuffer( ByteBuf in ) + void readBuffer( final ByteBuf in ) { - byte howMany = in.readByte(); + final byte howMany = in.readByte(); if( howMany == 0 ) { @@ -107,7 +107,7 @@ public class TilePaint extends AEBaseTile } this.isLit = 0; - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { if( s.lumen ) { @@ -132,13 +132,13 @@ public class TilePaint extends AEBaseTile } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TilePaint( ByteBuf data ) + public void writeToStream_TilePaint( final ByteBuf data ) { this.writeBuffer( data ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TilePaint( ByteBuf data ) + public boolean readFromStream_TilePaint( final ByteBuf data ) { this.readBuffer( data ); return true; @@ -151,7 +151,7 @@ public class TilePaint extends AEBaseTile return; } - for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS ) { if( !this.isSideValid( side ) ) { @@ -162,18 +162,18 @@ public class TilePaint extends AEBaseTile this.updateData(); } - public boolean isSideValid( ForgeDirection side ) + public boolean isSideValid( final ForgeDirection side ) { - Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); + final Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); return blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, side.getOpposite() ); } - private void removeSide( ForgeDirection side ) + private void removeSide( final ForgeDirection side ) { - Iterator i = this.dots.iterator(); + final Iterator i = this.dots.iterator(); while( i.hasNext() ) { - Splotch s = i.next(); + final Splotch s = i.next(); if( s.side == side ) { i.remove(); @@ -187,7 +187,7 @@ public class TilePaint extends AEBaseTile private void updateData() { this.isLit = 0; - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { if( s.lumen ) { @@ -208,7 +208,7 @@ public class TilePaint extends AEBaseTile } } - public void cleanSide( ForgeDirection side ) + public void cleanSide( final ForgeDirection side ) { if( this.dots == null ) { @@ -225,15 +225,15 @@ public class TilePaint extends AEBaseTile return this.isLit; } - public void addBlot( ItemStack type, ForgeDirection side, Vec3 hitVec ) + public void addBlot( final ItemStack type, final ForgeDirection side, final Vec3 hitVec ) { - Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); + final Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ ); if( blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, side.getOpposite() ) ) { - ItemPaintBall ipb = (ItemPaintBall) type.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) type.getItem(); - AEColor col = ipb.getColor( type ); - boolean lit = ipb.isLumen( type ); + final AEColor col = ipb.getColor( type ); + final boolean lit = ipb.isLumen( type ); if( this.dots == null ) { diff --git a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java index 94df8090..26578840 100644 --- a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java @@ -50,40 +50,40 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower } @MENetworkEventSubscribe - public void onPower( MENetworkPowerStatusChange ch ) + public void onPower( final MENetworkPowerStatusChange ch ) { this.markForUpdate(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileQuartzGrowthAccelerator( ByteBuf data ) + public boolean readFromStream_TileQuartzGrowthAccelerator( final ByteBuf data ) { - boolean hadPower = this.hasPower; + final boolean hadPower = this.hasPower; this.hasPower = data.readBoolean(); return this.hasPower != hadPower; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileQuartzGrowthAccelerator( ByteBuf data ) + public void writeToStream_TileQuartzGrowthAccelerator( final ByteBuf data ) { try { data.writeBoolean( this.gridProxy.getEnergy().isNetworkPowered() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { data.writeBoolean( false ); } } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); @@ -98,7 +98,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower { return this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } diff --git a/src/main/java/appeng/tile/misc/TileSecurity.java b/src/main/java/appeng/tile/misc/TileSecurity.java index 957a0b8b..e6d7b046 100644 --- a/src/main/java/appeng/tile/misc/TileSecurity.java +++ b/src/main/java/appeng/tile/misc/TileSecurity.java @@ -108,20 +108,20 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { if( !this.configSlot.isEmpty() ) { drops.add( this.configSlot.getStackInSlot( 0 ) ); } - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { drops.add( ais.getItemStack() ); } @@ -133,26 +133,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSecurity( ByteBuf data ) + public boolean readFromStream_TileSecurity( final ByteBuf data ) { - boolean wasActive = this.isActive; + final boolean wasActive = this.isActive; this.isActive = data.readBoolean(); - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; return oldPaintedColor != this.paintedColor || wasActive != this.isActive; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSecurity( ByteBuf data ) + public void writeToStream_TileSecurity( final ByteBuf data ) { data.writeBoolean( this.gridProxy.isActive() ); data.writeByte( this.paintedColor.ordinal() ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileSecurity( NBTTagCompound data ) + public void writeToNBT_TileSecurity( final NBTTagCompound data ) { this.cm.writeToNBT( data ); data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); @@ -160,12 +160,12 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp data.setLong( "securityKey", this.securityKey ); this.configSlot.writeToNBT( data, "config" ); - NBTTagCompound storedItems = new NBTTagCompound(); + final NBTTagCompound storedItems = new NBTTagCompound(); int offset = 0; - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { - NBTTagCompound it = new NBTTagCompound(); + final NBTTagCompound it = new NBTTagCompound(); ais.getItemStack().writeToNBT( it ); storedItems.setTag( String.valueOf( offset ), it ); offset++; @@ -175,7 +175,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileSecurity( NBTTagCompound data ) + public void readFromNBT_TileSecurity( final NBTTagCompound data ) { this.cm.readFromNBT( data ); if( data.hasKey( "paintedColor" ) ) @@ -186,10 +186,10 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp this.securityKey = data.getLong( "securityKey" ); this.configSlot.readFromNBT( data, "config" ); - NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); - for( Object key : storedItems.func_150296_c() ) + final NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); + for( final Object key : storedItems.func_150296_c() ) { - NBTBase obj = storedItems.getTag( (String) key ); + final NBTBase obj = storedItems.getTag( (String) key ); if( obj instanceof NBTTagCompound ) { this.inventory.storedItems.add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) ); @@ -204,26 +204,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp this.saveChanges(); this.gridProxy.getGrid().postEvent( new MENetworkSecurityChange() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @MENetworkEventSubscribe - public void bootUpdate( MENetworkChannelsChanged changed ) + public void bootUpdate( final MENetworkChannelsChanged changed ) { this.markForUpdate(); } @MENetworkEventSubscribe - public void powerUpdate( MENetworkPowerStatusChange changed ) + public void powerUpdate( final MENetworkPowerStatusChange changed ) { this.markForUpdate(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -296,7 +296,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -308,18 +308,18 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void readPermissions( HashMap> playerPerms ) + public void readPermissions( final HashMap> playerPerms ) { - IPlayerRegistry pr = AEApi.instance().registries().players(); + final IPlayerRegistry pr = AEApi.instance().registries().players(); // read permissions - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { - ItemStack is = ais.getItemStack(); - Item i = is.getItem(); + final ItemStack is = ais.getItemStack(); + final Item i = is.getItem(); if( i instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) i; + final IBiometricCard bc = (IBiometricCard) i; bc.registerPermissions( new PlayerSecurityWrapper( playerPerms ), pr, is ); } } @@ -347,7 +347,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public boolean recolourBlock( ForgeDirection side, AEColor newPaintedColor, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor newPaintedColor, final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { diff --git a/src/main/java/appeng/tile/misc/TileVibrationChamber.java b/src/main/java/appeng/tile/misc/TileVibrationChamber.java index f1c33184..06e48a1c 100644 --- a/src/main/java/appeng/tile/misc/TileVibrationChamber.java +++ b/src/main/java/appeng/tile/misc/TileVibrationChamber.java @@ -71,14 +71,14 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @Reflected @TileEvent( TileEventType.NETWORK_READ ) - public boolean hasUpdate( ByteBuf data ) + public boolean hasUpdate( final ByteBuf data ) { final boolean wasOn = this.isOn; @@ -89,13 +89,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka @Reflected @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToNetwork( ByteBuf data ) + public void writeToNetwork( final ByteBuf data ) { data.writeBoolean( this.burnTime > 0 ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileVibrationChamber( NBTTagCompound data ) + public void writeToNBT_TileVibrationChamber( final NBTTagCompound data ) { data.setDouble( "burnTime", this.burnTime ); data.setDouble( "maxBurnTime", this.maxBurnTime ); @@ -103,7 +103,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileVibrationChamber( NBTTagCompound data ) + public void readFromNBT_TileVibrationChamber( final NBTTagCompound data ) { this.burnTime = data.getDouble( "burnTime" ); this.maxBurnTime = data.getDouble( "maxBurnTime" ); @@ -117,13 +117,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return TileEntityFurnace.getItemBurnTime( itemstack ) > 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.burnTime <= 0 ) { @@ -133,7 +133,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // wake up! } @@ -142,23 +142,23 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return extractedItem.getItem() == Items.bucket; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return ACCESSIBLE_SLOTS; } private boolean canEatFuel() { - ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX ); + final ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX ); if( is != null ) { - int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); + final int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); if( newBurnTime > 0 && is.stackSize > 0 ) { return true; @@ -174,7 +174,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { if( this.burnTime <= 0 ) { @@ -185,7 +185,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.burnTime <= 0 ) { @@ -201,7 +201,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); - double dilation = this.burnSpeed / DILATION_SCALING; + final double dilation = this.burnSpeed / DILATION_SCALING; double timePassed = ticksSinceLastCall * dilation; this.burnTime -= timePassed; @@ -213,9 +213,9 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka try { - IEnergyGrid grid = this.gridProxy.getEnergy(); - double newPower = timePassed * POWER_PER_TICK; - double overFlow = grid.injectPower( newPower, Actionable.SIMULATE ); + final IEnergyGrid grid = this.gridProxy.getEnergy(); + final double newPower = timePassed * POWER_PER_TICK; + final double overFlow = grid.injectPower( newPower, Actionable.SIMULATE ); // burn the over flow. grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE ); @@ -232,7 +232,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); return overFlow > 0 ? TickRateModulation.SLOWER : TickRateModulation.FASTER; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { this.burnSpeed -= ticksSinceLastCall; this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); @@ -277,7 +277,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // gah! } diff --git a/src/main/java/appeng/tile/networking/TileCableBus.java b/src/main/java/appeng/tile/networking/TileCableBus.java index df0f3ea6..71ed27f8 100644 --- a/src/main/java/appeng/tile/networking/TileCableBus.java +++ b/src/main/java/appeng/tile/networking/TileCableBus.java @@ -68,23 +68,23 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl private int oldLV = -1; // on re-calculate light when it changes @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCableBus( NBTTagCompound data ) + public void readFromNBT_TileCableBus( final NBTTagCompound data ) { this.cb.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCableBus( NBTTagCompound data ) + public void writeToNBT_TileCableBus( final NBTTagCompound data ) { this.cb.writeToNBT( data ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCableBus( ByteBuf data ) throws IOException + public boolean readFromStream_TileCableBus( final ByteBuf data ) throws IOException { - boolean ret = this.cb.readFromStream( data ); + final boolean ret = this.cb.readFromStream( data ); - int newLV = this.cb.getLightValue(); + final int newLV = this.cb.getLightValue(); if( newLV != this.oldLV ) { this.oldLV = newLV; @@ -102,27 +102,27 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl { try { - TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance(); tcb.copyFrom( this ); this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } } } - protected void copyFrom( TileCableBus oldTile ) + protected void copyFrom( final TileCableBus oldTile ) { - CableBusContainer tmpCB = this.cb; + final CableBusContainer tmpCB = this.cb; this.cb = oldTile.cb; this.oldLV = oldTile.oldLV; oldTile.cb = tmpCB; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCableBus( ByteBuf data ) throws IOException + public void writeToStream_TileCableBus( final ByteBuf data ) throws IOException { this.cb.writeToStream( data ); } @@ -148,13 +148,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public IGridNode getGridNode( ForgeDirection dir ) + public IGridNode getGridNode( final ForgeDirection dir ) { return this.cb.getGridNode( dir ); } @Override - public AECableType getCableConnectionType( ForgeDirection side ) + public AECableType getCableConnectionType( final ForgeDirection side ) { return this.cb.getCableConnectionType( side ); } @@ -174,7 +174,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return; } - int newLV = this.cb.getLightValue(); + final int newLV = this.cb.getLightValue(); if( newLV != this.oldLV ) { this.oldLV = newLV; @@ -192,13 +192,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { this.cb.getDrops( drops ); } @Override - public void getNoDrops( World w, int x, int y, int z, List drops ) + public void getNoDrops( final World w, final int x, final int y, final int z, final List drops ) { this.cb.getNoDrops( drops ); } @@ -233,25 +233,25 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean canAddPart( ItemStack is, ForgeDirection side ) + public boolean canAddPart( final ItemStack is, final ForgeDirection side ) { return this.cb.canAddPart( is, side ); } @Override - public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer player ) + public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer player ) { return this.cb.addPart( is, side, player ); } @Override - public IPart getPart( ForgeDirection side ) + public IPart getPart( final ForgeDirection side ) { return this.cb.getPart( side ); } @Override - public void removePart( ForgeDirection side, boolean suppressUpdate ) + public void removePart( final ForgeDirection side, final boolean suppressUpdate ) { this.cb.removePart( side, suppressUpdate ); } @@ -275,19 +275,19 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean isBlocked( ForgeDirection side ) + public boolean isBlocked( final ForgeDirection side ) { return !this.ImmibisMicroblocks_isSideOpen( side.ordinal() ); } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean visual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean visual ) { return this.cb.getSelectedBoundingBoxesFromPool( false, true, e, visual ); } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { return this.cb.selectPart( pos ); } @@ -305,7 +305,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean hasRedstone( ForgeDirection side ) + public boolean hasRedstone( final ForgeDirection side ) { return this.cb.hasRedstone( side ); } @@ -327,7 +327,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) ) { - IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ); + final IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ); if( imb != null && imb.leaveParts( this ) ) { return; @@ -338,9 +338,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e ) { - for( AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, x, y, z, e, false ) ) + for( final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, x, y, z, e, false ) ) { out.add( AxisAlignedBB.getBoundingBox( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) ); } @@ -361,7 +361,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return this.cb.isInWorld(); } - public boolean ImmibisMicroblocks_isSideOpen( int side ) + public boolean ImmibisMicroblocks_isSideOpen( final int side ) { return true; } @@ -372,7 +372,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean recolourBlock( ForgeDirection side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor colour, final EntityPlayer who ) { return this.cb.recolourBlock( side, colour, who ); } diff --git a/src/main/java/appeng/tile/networking/TileCableBusTESR.java b/src/main/java/appeng/tile/networking/TileCableBusTESR.java index f1fcabdc..7e487c44 100644 --- a/src/main/java/appeng/tile/networking/TileCableBusTESR.java +++ b/src/main/java/appeng/tile/networking/TileCableBusTESR.java @@ -32,11 +32,11 @@ public class TileCableBusTESR extends TileCableBus { try { - TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance(); tcb.copyFrom( this ); this.getWorldObj().setTileEntity( this.xCoord, this.yCoord, this.zCoord, tcb ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } diff --git a/src/main/java/appeng/tile/networking/TileController.java b/src/main/java/appeng/tile/networking/TileController.java index 040a8603..a175838d 100644 --- a/src/main/java/appeng/tile/networking/TileController.java +++ b/src/main/java/appeng/tile/networking/TileController.java @@ -56,7 +56,7 @@ public class TileController extends AENetworkPowerTile } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.DENSE; } @@ -68,7 +68,7 @@ public class TileController extends AENetworkPowerTile super.onReady(); } - public void onNeighborChange( boolean force ) + public void onNeighborChange( final boolean force ) { final boolean xx = checkController( this.xCoord - 1, this.yCoord, this.zCoord ) && checkController( this.xCoord + 1, this.yCoord, this.zCoord ); final boolean yy = checkController( this.xCoord, this.yCoord - 1, this.zCoord ) && checkController( this.xCoord, this.yCoord + 1, this.zCoord ); @@ -119,7 +119,7 @@ public class TileController extends AENetworkPowerTile } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { meta = 0; } @@ -131,13 +131,13 @@ public class TileController extends AENetworkPowerTile } @Override - protected double getFunnelPowerDemand( double maxReceived ) + protected double getFunnelPowerDemand( final double maxReceived ) { try { return this.gridProxy.getEnergy().getEnergyDemand( 8000 ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid? use local... return super.getFunnelPowerDemand( maxReceived ); @@ -145,18 +145,18 @@ public class TileController extends AENetworkPowerTile } @Override - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { try { - double ret = this.gridProxy.getEnergy().injectPower( power, mode ); + final double ret = this.gridProxy.getEnergy().injectPower( power, mode ); if( mode == Actionable.SIMULATE ) { return ret; } return 0; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid? use local... return super.funnelPowerIntoStorage( power, mode ); @@ -164,26 +164,26 @@ public class TileController extends AENetworkPowerTile } @Override - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { try { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, x ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // not ready! } } @MENetworkEventSubscribe - public void onControllerChange( MENetworkControllerChange status ) + public void onControllerChange( final MENetworkControllerChange status ) { this.updateMeta(); } @MENetworkEventSubscribe - public void onPowerChange( MENetworkPowerStatusChange status ) + public void onPowerChange( final MENetworkPowerStatusChange status ) { this.updateMeta(); } @@ -195,13 +195,13 @@ public class TileController extends AENetworkPowerTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return ACCESSIBLE_SLOTS_BY_SIDE; } @@ -211,7 +211,7 @@ public class TileController extends AENetworkPowerTile * * @return true if there is a loaded controller */ - private boolean checkController( int x, int y, int z ) + private boolean checkController( final int x, final int y, final int z ) { if( this.worldObj.getChunkProvider().chunkExists( this.xCoord >> 4, this.zCoord >> 4 ) ) { diff --git a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java index 247be2eb..79471398 100644 --- a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java @@ -38,13 +38,13 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @Override - public double injectAEPower( double amt, Actionable mode ) + public double injectAEPower( final double amt, final Actionable mode ) { return 0; } @@ -74,7 +74,7 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { return amt; } diff --git a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java index 3b1f748d..0a9341b1 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java +++ b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java @@ -46,7 +46,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { /** * Does nothing here since the NBT tag in the parent is not needed anymore @@ -54,7 +54,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { /** * Does nothing here since the NBT tag in the parent is not needed anymore @@ -62,39 +62,39 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @Override - protected double getFunnelPowerDemand( double maxRequired ) + protected double getFunnelPowerDemand( final double maxRequired ) { try { - IEnergyGrid grid = this.gridProxy.getEnergy(); + final IEnergyGrid grid = this.gridProxy.getEnergy(); return grid.getEnergyDemand( maxRequired ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return this.internalMaxPower; } } @Override - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { try { - IEnergyGrid grid = this.gridProxy.getEnergy(); - double leftOver = grid.injectPower( power, mode ); + final IEnergyGrid grid = this.gridProxy.getEnergy(); + final double leftOver = grid.injectPower( power, mode ); if( mode == Actionable.SIMULATE ) { return leftOver; } return 0.0; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return super.funnelPowerIntoStorage( power, mode ); } @@ -107,13 +107,13 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } diff --git a/src/main/java/appeng/tile/networking/TileEnergyCell.java b/src/main/java/appeng/tile/networking/TileEnergyCell.java index 4515adcc..320cd568 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileEnergyCell.java @@ -50,7 +50,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.COVERED; } @@ -89,7 +89,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileEnergyCell( NBTTagCompound data ) + public void writeToNBT_TileEnergyCell( final NBTTagCompound data ) { if( !this.worldObj.isRemote ) { @@ -98,7 +98,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileEnergyCell( NBTTagCompound data ) + public void readFromNBT_TileEnergyCell( final NBTTagCompound data ) { this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } @@ -110,7 +110,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( from == SettingsFrom.DISMANTLE_ITEM ) { @@ -119,11 +119,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { if( from == SettingsFrom.DISMANTLE_ITEM ) { - NBTTagCompound tag = new NBTTagCompound(); + final NBTTagCompound tag = new NBTTagCompound(); tag.setDouble( "internalCurrentPower", this.internalCurrentPower ); tag.setDouble( "internalMaxPower", this.internalMaxPower ); // used for tool tip. return tag; @@ -132,11 +132,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public final double injectAEPower( double amt, Actionable mode ) + public final double injectAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { - double fakeBattery = this.internalCurrentPower + amt; + final double fakeBattery = this.internalCurrentPower + amt; if( fakeBattery > this.internalMaxPower ) { return fakeBattery - this.internalMaxPower; @@ -189,12 +189,12 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public final double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public final double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { return pm.divide( this.extractAEPower( pm.multiply( amt ), mode ) ); } - private double extractAEPower( double amt, Actionable mode ) + private double extractAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { @@ -205,7 +205,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage return this.internalCurrentPower; } - boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; + final boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if( wasFull && amt > 0.001 ) { @@ -213,7 +213,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } diff --git a/src/main/java/appeng/tile/networking/TileWireless.java b/src/main/java/appeng/tile/networking/TileWireless.java index 0622f1a1..ac488725 100644 --- a/src/main/java/appeng/tile/networking/TileWireless.java +++ b/src/main/java/appeng/tile/networking/TileWireless.java @@ -65,35 +65,35 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public void setOrientation( ForgeDirection inForward, ForgeDirection inUp ) + public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getForward().getOpposite() ) ); } @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.markForUpdate(); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileWireless( ByteBuf data ) + public boolean readFromStream_TileWireless( final ByteBuf data ) { - int old = this.clientFlags; + final int old = this.clientFlags; this.clientFlags = data.readByte(); return old != this.clientFlags; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileWireless( ByteBuf data ) + public void writeToStream_TileWireless( final ByteBuf data ) { this.clientFlags = 0; @@ -109,7 +109,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi this.clientFlags |= CHANNEL_FLAG; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh } @@ -118,7 +118,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -136,19 +136,19 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return AEApi.instance().definitions().materials().wirelessBooster().isSameAs( itemstack ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { // :P } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } @@ -167,7 +167,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi private int getBoosters() { - ItemStack boosters = this.inv.getStackInSlot( 0 ); + final ItemStack boosters = this.inv.getStackInSlot( 0 ); return boosters == null ? 0 : boosters.stackSize; } @@ -201,7 +201,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi { return this.gridProxy.getGrid(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return null; } diff --git a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java index 2d158244..4c4eb156 100644 --- a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java +++ b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java @@ -53,46 +53,46 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe return this.internalPowerSides.clone(); } - protected void setPowerSides( EnumSet sides ) + protected void setPowerSides( final EnumSet sides ) { this.internalPowerSides = sides; // trigger re-calc! } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AERootPoweredTile( NBTTagCompound data ) + public void writeToNBT_AERootPoweredTile( final NBTTagCompound data ) { data.setDouble( "internalCurrentPower", this.internalCurrentPower ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AERootPoweredTile( NBTTagCompound data ) + public void readFromNBT_AERootPoweredTile( final NBTTagCompound data ) { this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } - protected final double getExternalPowerDemand( PowerUnits externalUnit, double maxPowerRequired ) + protected final double getExternalPowerDemand( final PowerUnits externalUnit, final double maxPowerRequired ) { return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, this.getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) ); } - protected double getFunnelPowerDemand( double maxRequired ) + protected double getFunnelPowerDemand( final double maxRequired ) { return this.internalMaxPower - this.internalCurrentPower; } - public final double injectExternalPower( PowerUnits input, double amt ) + public final double injectExternalPower( final PowerUnits input, final double amt ) { return PowerUnits.AE.convertTo( input, this.funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) ); } - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { return this.injectAEPower( power, mode ); } @Override - public final double injectAEPower( double amt, Actionable mode ) + public final double injectAEPower( double amt, final Actionable mode ) { if( amt < 0.000001 ) { @@ -101,7 +101,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe if( mode == Actionable.SIMULATE ) { - double fakeBattery = this.internalCurrentPower + amt; + final double fakeBattery = this.internalCurrentPower + amt; if( fakeBattery > this.internalMaxPower ) { @@ -129,7 +129,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe } } - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { // nothing. } @@ -159,12 +159,12 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe } @Override - public final double extractAEPower( double amt, Actionable mode, PowerMultiplier multiplier ) + public final double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier multiplier ) { return multiplier.divide( this.extractAEPower( multiplier.multiply( amt ), mode ) ); } - protected double extractAEPower( double amt, Actionable mode ) + protected double extractAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { @@ -175,7 +175,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe return this.internalCurrentPower; } - boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; + final boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if( wasFull && amt > 0.001 ) { this.PowerEvent( PowerEventType.REQUEST_POWER ); diff --git a/src/main/java/appeng/tile/powersink/IC2.java b/src/main/java/appeng/tile/powersink/IC2.java index 536c8e52..89815dba 100644 --- a/src/main/java/appeng/tile/powersink/IC2.java +++ b/src/main/java/appeng/tile/powersink/IC2.java @@ -41,7 +41,7 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink boolean isInIC2 = false; @Override - public final boolean acceptsEnergyFrom( TileEntity emitter, ForgeDirection direction ) + public final boolean acceptsEnergyFrom( final TileEntity emitter, final ForgeDirection direction ) { return this.getPowerSides().contains( direction ); } @@ -59,11 +59,11 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink } @Override - public final double injectEnergy( ForgeDirection directionFrom, double amount, double voltage ) + public final double injectEnergy( final ForgeDirection directionFrom, final double amount, final double voltage ) { // just store the excess in the current block, if I return the waste, // IC2 will just disintegrate it - Oct 20th 2013 - double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, this.injectExternalPower( PowerUnits.EU, amount ) ); + final double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, this.injectExternalPower( PowerUnits.EU, amount ) ); this.internalCurrentPower += overflow; return 0; // see above comment. } @@ -79,7 +79,7 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) ) { - IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); + final IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); if( this.isInIC2 && Platform.isServer() && ic2Integration != null ) { ic2Integration.removeFromEnergyNet( this ); @@ -106,7 +106,7 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) ) { - IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); + final IIC2 ic2Integration = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); if( !this.isInIC2 && Platform.isServer() && ic2Integration != null ) { ic2Integration.addToEnergyNet( this ); @@ -116,7 +116,7 @@ public abstract class IC2 extends AERootPoweredTile implements IEnergySink } @Override - protected void setPowerSides( EnumSet sides ) + protected void setPowerSides( final EnumSet sides ) { super.setPowerSides( sides ); this.removeFromENet(); diff --git a/src/main/java/appeng/tile/powersink/MekJoules.java b/src/main/java/appeng/tile/powersink/MekJoules.java index f7099c45..f0609463 100644 --- a/src/main/java/appeng/tile/powersink/MekJoules.java +++ b/src/main/java/appeng/tile/powersink/MekJoules.java @@ -39,9 +39,9 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc } @Override - public void setEnergy( double energy ) + public void setEnergy( final double energy ) { - double extra = this.injectExternalPower( PowerUnits.MK, energy ); + final double extra = this.injectExternalPower( PowerUnits.MK, energy ); this.internalCurrentPower += PowerUnits.MK.convertTo( PowerUnits.AE, extra ); } @@ -52,20 +52,20 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc } @Override - public double transferEnergyToAcceptor( ForgeDirection side, double amount ) + public double transferEnergyToAcceptor( final ForgeDirection side, double amount ) { - double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); + final double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); if( amount > demand ) { amount = demand; } - double overflow = this.injectExternalPower( PowerUnits.MK, amount ); + final double overflow = this.injectExternalPower( PowerUnits.MK, amount ); return amount - overflow; } @Override - public boolean canReceiveEnergy( ForgeDirection side ) + public boolean canReceiveEnergy( final ForgeDirection side ) { return this.getPowerSides().contains( side ); } diff --git a/src/main/java/appeng/tile/powersink/RedstoneFlux.java b/src/main/java/appeng/tile/powersink/RedstoneFlux.java index 5060fcfe..dfe5aa73 100644 --- a/src/main/java/appeng/tile/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/tile/powersink/RedstoneFlux.java @@ -32,7 +32,7 @@ import appeng.transformer.annotations.Integration.Interface; public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceiver { @Override - public final int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate ) + public final int receiveEnergy( final ForgeDirection from, final int maxReceive, final boolean simulate ) { final int networkRFDemand = (int) Math.floor( this.getExternalPowerDemand( PowerUnits.RF, maxReceive ) ); final int usedRF = Math.min( maxReceive, networkRFDemand ); @@ -46,19 +46,19 @@ public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceive } @Override - public final int getEnergyStored( ForgeDirection from ) + public final int getEnergyStored( final ForgeDirection from ) { return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower() ) ); } @Override - public final int getMaxEnergyStored( ForgeDirection from ) + public final int getMaxEnergyStored( final ForgeDirection from ) { return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower() ) ); } @Override - public final boolean canConnectEnergy( ForgeDirection from ) + public final boolean canConnectEnergy( final ForgeDirection from ) { return this.getPowerSides().contains( from ); } diff --git a/src/main/java/appeng/tile/powersink/RotaryCraft.java b/src/main/java/appeng/tile/powersink/RotaryCraft.java index b54ad846..a7e3aa39 100644 --- a/src/main/java/appeng/tile/powersink/RotaryCraft.java +++ b/src/main/java/appeng/tile/powersink/RotaryCraft.java @@ -59,7 +59,7 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei } @Override - public final boolean addPower( int torque, int omega, long power, ForgeDirection side ) + public final boolean addPower( final int torque, final int omega, final long power, final ForgeDirection side ) { this.omega = omega; this.torque = torque; @@ -102,12 +102,12 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei } @Override - public final void setIORenderAlpha( int io ) + public final void setIORenderAlpha( final int io ) { this.alpha = io; } - public final boolean canReadFromBlock( int x, int y, int z ) + public final boolean canReadFromBlock( final int x, final int y, final int z ) { ForgeDirection side = ForgeDirection.UNKNOWN; @@ -140,7 +140,7 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei } @Override - public final boolean canReadFrom( ForgeDirection side ) + public final boolean canReadFrom( final ForgeDirection side ) { return this.getPowerSides().contains( side ); } @@ -152,15 +152,15 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei } @Override - public final int getMinTorque( int available ) + public final int getMinTorque( final int available ) { return 1; } @Override - public final ArrayList getMessages( World world, int x, int y, int z, int side ) + public final ArrayList getMessages( final World world, final int x, final int y, final int z, final int side ) { - String out; + final String out; if( this.power >= 1000000000 ) { out = String.format( "Receiving %.3f GW @ %d rad/s.", this.power / 1000000000.0D, this.omega ); @@ -178,7 +178,7 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei out = String.format( "Receiving %d W @ %d rad/s.", this.power, this.omega ); } - ArrayList messages = new ArrayList( 1 ); + final ArrayList messages = new ArrayList( 1 ); messages.add( out ); return messages; } diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index bf6ea467..31757256 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -91,7 +91,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_WRITE ) - public void onNetworkWriteEvent( ByteBuf data ) + public void onNetworkWriteEvent( final ByteBuf data ) { int out = this.constructed; @@ -109,9 +109,9 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_READ ) - public boolean onNetworkReadEvent( ByteBuf data ) + public boolean onNetworkReadEvent( final ByteBuf data ) { - int oldValue = this.constructed; + final int oldValue = this.constructed; this.constructed = data.readByte(); this.bridgePowered = ( this.constructed | this.powered ) == this.powered; return this.constructed != oldValue; @@ -124,7 +124,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.cluster != null ) { @@ -133,7 +133,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { if( this.isCenter() ) { @@ -144,7 +144,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isCenter() { - for( Block link : AEApi.instance().definitions().blocks().quantumLink().maybeBlock().asSet() ) + for( final Block link : AEApi.instance().definitions().blocks().quantumLink().maybeBlock().asSet() ) { return this.getBlockType() == link; } @@ -153,7 +153,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @MENetworkEventSubscribe - public void onPowerStatusChange( MENetworkPowerStatusChange c ) + public void onPowerStatusChange( final MENetworkPowerStatusChange c ) { this.updateStatus = true; } @@ -192,7 +192,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public void disconnect( boolean affectWorld ) + public void disconnect( final boolean affectWorld ) { if( this.cluster != null ) { @@ -224,7 +224,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock return !this.isInvalid(); } - public void updateStatus( QuantumCluster c, byte flags, boolean affectWorld ) + public void updateStatus( final QuantumCluster c, final byte flags, final boolean affectWorld ) { this.cluster = c; @@ -254,11 +254,11 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public EnumSet getConnections() { - EnumSet set = EnumSet.noneOf( ForgeDirection.class ); + final EnumSet set = EnumSet.noneOf( ForgeDirection.class ); - for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS ) { - TileEntity te = this.worldObj.getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); + final TileEntity te = this.worldObj.getTileEntity( this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ ); if( te instanceof TileQuantumBridge ) { set.add( d ); @@ -270,10 +270,10 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public long getQEFrequency() { - ItemStack is = this.internalInventory.getStackInSlot( 0 ); + final ItemStack is = this.internalInventory.getStackInSlot( 0 ); if( is != null ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( c != null ) { return c.getLong( "freq" ); @@ -293,7 +293,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock { return this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -307,7 +307,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.DENSE; } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index 43eb00c3..821a6f3f 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -62,13 +62,13 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileSpatialIOPort( NBTTagCompound data ) + public void writeToNBT_TileSpatialIOPort( final NBTTagCompound data ) { data.setInteger( "lastRedstoneState", this.lastRedstoneState.ordinal() ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileSpatialIOPort( NBTTagCompound data ) + public void readFromNBT_TileSpatialIOPort( final NBTTagCompound data ) { if( data.hasKey( "lastRedstoneState" ) ) { @@ -88,7 +88,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl public void updateRedstoneState() { - YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; + final YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; if( this.lastRedstoneState != currentState ) { this.lastRedstoneState = currentState; @@ -103,7 +103,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl { if( Platform.isServer() ) { - ItemStack cell = this.getStackInSlot( 0 ); + final ItemStack cell = this.getStackInSlot( 0 ); if( this.isSpatialCell( cell ) ) { TickHandler.INSTANCE.addCallable( null, this );// this needs to be cross world synced. @@ -111,38 +111,38 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } } - private boolean isSpatialCell( ItemStack cell ) + private boolean isSpatialCell( final ItemStack cell ) { if( cell != null && cell.getItem() instanceof ISpatialStorageCell ) { - ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); + final ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); return sc != null && sc.isSpatialStorage( cell ); } return false; } @Override - public Void call( World world ) throws Exception + public Void call( final World world ) throws Exception { - ItemStack cell = this.getStackInSlot( 0 ); + final ItemStack cell = this.getStackInSlot( 0 ); if( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null ) { - IGrid gi = this.gridProxy.getGrid(); - IEnergyGrid energy = this.gridProxy.getEnergy(); + final IGrid gi = this.gridProxy.getGrid(); + final IEnergyGrid energy = this.gridProxy.getEnergy(); - ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); + final ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); - SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); + final SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); if( spc.hasRegion() && spc.isValidRegion() ) { - double req = spc.requiredPower(); - double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double req = spc.requiredPower(); + final double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( Math.abs( pr - req ) < req * 0.001 ) { - MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) ); + final MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) ); if( !res.isCanceled() ) { - TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true ); + final TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true ); if( tr.success ) { energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); @@ -158,7 +158,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -176,31 +176,31 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return( i == 0 && this.isSpatialCell( itemstack ) ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { return this.isItemValidForSlot( slotIndex, insertingItem ); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return slotIndex == 1; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java index e5aef490..c5e64492 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java @@ -99,7 +99,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } @Override - public void disconnect( boolean b ) + public void disconnect( final boolean b ) { if( this.cluster != null ) { @@ -120,7 +120,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock return true; } - public void updateStatus( SpatialPylonCluster c ) + public void updateStatus( final SpatialPylonCluster c ) { this.cluster = c; this.gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) ); @@ -129,7 +129,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public void recalculateDisplay() { - int oldBits = this.displayBits; + final int oldBits = this.displayBits; this.displayBits = 0; @@ -176,7 +176,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock this.displayBits |= DISPLAY_ENABLED; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // nothing? } @@ -192,7 +192,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public void markForUpdate() { super.markForUpdate(); - boolean hasLight = this.getLightValue() > 0; + final boolean hasLight = this.getLightValue() > 0; if( hasLight != this.didHaveLight ) { this.didHaveLight = hasLight; @@ -217,27 +217,27 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSpatialPylon( ByteBuf data ) + public boolean readFromStream_TileSpatialPylon( final ByteBuf data ) { - int old = this.displayBits; + final int old = this.displayBits; this.displayBits = data.readByte(); return old != this.displayBits; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSpatialPylon( ByteBuf data ) + public void writeToStream_TileSpatialPylon( final ByteBuf data ) { data.writeByte( this.displayBits ); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } @MENetworkEventSubscribe - public void activeRender( MENetworkChannelsChanged c ) + public void activeRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } diff --git a/src/main/java/appeng/tile/storage/TileChest.java b/src/main/java/appeng/tile/storage/TileChest.java index 40dbcffa..082a3fd0 100644 --- a/src/main/java/appeng/tile/storage/TileChest.java +++ b/src/main/java/appeng/tile/storage/TileChest.java @@ -126,7 +126,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { if( x == PowerEventType.REQUEST_POWER ) { @@ -134,7 +134,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -147,7 +147,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan private void recalculateDisplay() { - int oldState = this.state; + final int oldState = this.state; for( int x = 0; x < this.getCellCount(); x++ ) { @@ -163,7 +163,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan this.state &= ~0x40; } - boolean currentActive = this.gridProxy.isActive(); + final boolean currentActive = this.gridProxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -171,7 +171,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -189,14 +189,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return 1; } - public IMEInventoryHandler getHandler( StorageChannel channel ) throws ChestNoHandler + public IMEInventoryHandler getHandler( final StorageChannel channel ) throws ChestNoHandler { if( !this.isCached ) { this.itemCell = null; this.fluidCell = null; - ItemStack is = this.inv.getStackInSlot( 1 ); + final ItemStack is = this.inv.getStackInSlot( 1 ); if( is != null ) { this.isCached = true; @@ -205,8 +205,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { double power = 1.0; - IMEInventoryHandler itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); - IMEInventoryHandler fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); + final IMEInventoryHandler itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); + final IMEInventoryHandler fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); if( itemCell != null ) { @@ -245,56 +245,56 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return null; } - private MEMonitorHandler wrap( IMEInventoryHandler h ) + private MEMonitorHandler wrap( final IMEInventoryHandler h ) { if( h == null ) { return null; } - MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); + final MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); ih.setPriority( this.priority ); - MEMonitorHandler g = new ChestMonitorHandler( ih ); + final MEMonitorHandler g = new ChestMonitorHandler( ih ); g.addListener( new ChestNetNotifier( h.getChannel() ), g ); return g; } @Override - public int getCellStatus( int slot ) + public int getCellStatus( final int slot ) { if( Platform.isClient() ) { return ( this.state >> ( slot * 3 ) ) & 3; } - ItemStack cell = this.inv.getStackInSlot( 1 ); - ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); + final ItemStack cell = this.inv.getStackInSlot( 1 ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); if( ch != null ) { try { - IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS ); + final IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS ); if( handler instanceof ChestMonitorHandler ) { return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() ); } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } try { - IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS ); if( handler instanceof ChestMonitorHandler ) { return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() ); } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -318,7 +318,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { gridPowered = this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } } @@ -327,9 +327,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean isCellBlinking( int slot ) + public boolean isCellBlinking( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { return false; @@ -339,20 +339,20 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - protected double extractAEPower( double amt, Actionable mode ) + protected double extractAEPower( final double amt, final Actionable mode ) { double stash = 0.0; try { - IEnergyGrid eg = this.gridProxy.getEnergy(); + final IEnergyGrid eg = this.gridProxy.getEnergy(); stash = eg.extractAEPower( amt, mode, PowerMultiplier.ONE ); if( stash >= amt ) { return stash; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid :( } @@ -369,22 +369,22 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return; } - double idleUsage = this.gridProxy.getIdlePowerUsage(); + final double idleUsage = this.gridProxy.getIdlePowerUsage(); try { if( !this.gridProxy.getEnergy().isNetworkPowered() ) { - double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + final double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 ) { this.recalculateDisplay(); } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { - double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + final double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 ) { this.recalculateDisplay(); @@ -398,7 +398,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileChest( ByteBuf data ) + public void writeToStream_TileChest( final ByteBuf data ) { if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) { @@ -426,7 +426,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan data.writeByte( this.state ); data.writeByte( this.paintedColor.ordinal() ); - ItemStack is = this.inv.getStackInSlot( 1 ); + final ItemStack is = this.inv.getStackInSlot( 1 ); if( is == null ) { @@ -439,16 +439,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileChest( ByteBuf data ) + public boolean readFromStream_TileChest( final ByteBuf data ) { - int oldState = this.state; - ItemStack oldType = this.storageType; + final int oldState = this.state; + final ItemStack oldType = this.storageType; this.state = data.readByte(); - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; - int item = data.readInt(); + final int item = data.readInt(); if( item == 0 ) { @@ -465,7 +465,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileChest( NBTTagCompound data ) + public void readFromNBT_TileChest( final NBTTagCompound data ) { this.config.readFromNBT( data ); this.priority = data.getInteger( "priority" ); @@ -476,7 +476,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileChest( NBTTagCompound data ) + public void writeToNBT_TileChest( final NBTTagCompound data ) { this.config.writeToNBT( data ); data.setInteger( "priority", this.priority ); @@ -484,13 +484,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } @MENetworkEventSubscribe - public void channelRender( MENetworkChannelsChanged c ) + public void channelRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } @@ -514,14 +514,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( i, itemstack ); this.tryToStoreContents(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( slot == 1 ) { @@ -533,10 +533,10 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = this.gridProxy.getStorage(); + final IStorageGrid gs = this.gridProxy.getStorage(); Platform.postChanges( gs, removed, added, this.mySrc ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } @@ -551,7 +551,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { if( slotIndex == 1 ) { @@ -568,11 +568,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc ); + final IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); + final IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc ); return returns == null || returns.getStackSize() != insertingItem.stackSize; } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -580,13 +580,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { return slotIndex == 1; } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { if( ForgeDirection.SOUTH == side ) { @@ -602,7 +602,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return SIDES; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // nope! } @@ -616,9 +616,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if( this.getStackInSlot( 0 ) != null ) { - IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); + final IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc ); + final IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc ); if( returns == null ) { @@ -630,13 +630,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.gridProxy.isActive() ) { @@ -644,7 +644,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { return Collections.singletonList( this.getHandler( channel ) ); } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } @@ -659,7 +659,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; @@ -671,16 +671,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { this.state = 0; @@ -693,18 +693,18 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public int fill( ForgeDirection from, FluidStack resource, boolean doFill ) + public int fill( final ForgeDirection from, final FluidStack resource, final boolean doFill ) { - double req = resource.amount / 500.0; - double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double req = resource.amount / 500.0; + final double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( available >= req - 0.01 ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); this.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); - IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc ); + final IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc ); if( results == null ) { @@ -713,7 +713,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return resource.amount - (int) results.getStackSize(); } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -721,49 +721,49 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain ) + public FluidStack drain( final ForgeDirection from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( ForgeDirection from, Fluid fluid ) + public boolean canFill( final ForgeDirection from, final Fluid fluid ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); return h.canAccept( AEFluidStack.create( new FluidStack( fluid, 1 ) ) ); } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } return false; } @Override - public boolean canDrain( ForgeDirection from, Fluid fluid ) + public boolean canDrain( final ForgeDirection from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( ForgeDirection from ) + public FluidTankInfo[] getTankInfo( final ForgeDirection from ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); if( h.getChannel() == StorageChannel.FLUIDS ) { return new FluidTankInfo[] { new FluidTankInfo( null, 1 ) }; // eh? } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } @@ -771,7 +771,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src ) { if( Platform.canAccess( this.gridProxy, src ) && side != this.getForward() ) { @@ -796,37 +796,37 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } - public boolean openGui( EntityPlayer p, ICellHandler ch, ItemStack cell, int side ) + public boolean openGui( final EntityPlayer p, final ICellHandler ch, final ItemStack cell, final int side ) { try { - IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS ); + final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS ); if( ch != null && invHandler != null ) { ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.ITEMS ); return true; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } try { - IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS ); if( ch != null && invHandler != null ) { ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.FLUIDS ); return true; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } @@ -841,7 +841,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean recolourBlock( ForgeDirection side, AEColor newPaintedColor, EntityPlayer who ) + public boolean recolourBlock( final ForgeDirection side, final AEColor newPaintedColor, final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { @@ -855,7 +855,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { this.worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); } @@ -870,13 +870,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan final StorageChannel chan; - public ChestNetNotifier( StorageChannel chan ) + public ChestNetNotifier( final StorageChannel chan ) { this.chan = chan; } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { if( this.chan == StorageChannel.ITEMS ) { @@ -890,7 +890,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { if( source == TileChest.this.mySrc || ( source instanceof PlayerSource && ( (PlayerSource) source ).via == TileChest.this ) ) { @@ -901,7 +901,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan TileChest.this.gridProxy.getStorage().postAlterationOfStoredItems( this.chan, change, TileChest.this.mySrc ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -920,14 +920,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan class ChestMonitorHandler extends MEMonitorHandler { - public ChestMonitorHandler( IMEInventoryHandler t ) + public ChestMonitorHandler( final IMEInventoryHandler t ) { super( t ); } public IMEInventoryHandler getInternalHandler() { - IMEInventoryHandler h = this.getHandler(); + final IMEInventoryHandler h = this.getHandler(); if( h instanceof MEInventoryHandler ) { return (IMEInventoryHandler) ( (MEInventoryHandler) h ).getInternal(); @@ -936,7 +936,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public T injectItems( T input, Actionable mode, BaseActionSource src ) + public T injectItems( final T input, final Actionable mode, final BaseActionSource src ) { if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.INJECT ) ) { @@ -945,28 +945,27 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return super.injectItems( input, mode, src ); } - private boolean securityCheck( EntityPlayer player, SecurityPermissions requiredPermission ) + private boolean securityCheck( final EntityPlayer player, final SecurityPermissions requiredPermission ) { if( TileChest.this.getTile() instanceof IActionHost && requiredPermission != null ) { - - IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode(); + final IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { - boolean requirePower = false; + final boolean requirePower = false; if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( player, requiredPermission ) ) { return true; @@ -980,7 +979,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( final T request, final Actionable mode, final BaseActionSource src ) { if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.EXTRACT ) ) { diff --git a/src/main/java/appeng/tile/storage/TileDrive.java b/src/main/java/appeng/tile/storage/TileDrive.java index a0acfaa3..2d5df522 100644 --- a/src/main/java/appeng/tile/storage/TileDrive.java +++ b/src/main/java/appeng/tile/storage/TileDrive.java @@ -82,7 +82,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileDrive( ByteBuf data ) + public void writeToStream_TileDrive( final ByteBuf data ) { if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) { @@ -117,17 +117,17 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public int getCellStatus( int slot ) + public int getCellStatus( final int slot ) { if( Platform.isClient() ) { return ( this.state >> ( slot * 3 ) ) & 3; } - ItemStack cell = this.inv.getStackInSlot( 2 ); - ICellHandler ch = this.handlersBySlot[slot]; + final ItemStack cell = this.inv.getStackInSlot( 2 ); + final ICellHandler ch = this.handlersBySlot[slot]; - MEInventoryHandler handler = this.invBySlot[slot]; + final MEInventoryHandler handler = this.invBySlot[slot]; if( handler == null ) { return 0; @@ -164,9 +164,9 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public boolean isCellBlinking( int slot ) + public boolean isCellBlinking( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { return false; @@ -176,37 +176,36 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileDrive( ByteBuf data ) + public boolean readFromStream_TileDrive( final ByteBuf data ) { - int oldState = this.state; + final int oldState = this.state; this.state = data.readInt(); this.lastStateChange = this.worldObj.getTotalWorldTime(); return ( this.state & 0xDB6DB6DB ) != ( oldState & 0xDB6DB6DB ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileDrive( NBTTagCompound data ) + public void readFromNBT_TileDrive( final NBTTagCompound data ) { this.isCached = false; this.priority = data.getInteger( "priority" ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileDrive( NBTTagCompound data ) + public void writeToNBT_TileDrive( final NBTTagCompound data ) { data.setInteger( "priority", this.priority ); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } private void recalculateDisplay() { - - boolean currentActive = this.gridProxy.isActive(); + final boolean currentActive = this.gridProxy.isActive(); if( currentActive ) { this.state |= 0x80000000; @@ -223,7 +222,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -234,7 +233,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior this.state |= ( this.getCellStatus( x ) << ( 3 * x ) ); } - int oldState = 0; + final int oldState = 0; if( oldState != this.state ) { this.markForUpdate(); @@ -242,13 +241,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @MENetworkEventSubscribe - public void channelRender( MENetworkChannelsChanged c ) + public void channelRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -266,13 +265,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return itemstack != null && AEApi.instance().registries().cell().isCellHandled( itemstack ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.isCached ) { @@ -284,10 +283,10 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = this.gridProxy.getStorage(); + final IStorageGrid gs = this.gridProxy.getStorage(); Platform.postChanges( gs, removed, added, this.mySrc ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } @@ -295,7 +294,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } @@ -311,7 +310,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior for( int x = 0; x < this.inv.getSizeInventory(); x++ ) { - ItemStack is = this.inv.getStackInSlot( x ); + final ItemStack is = this.inv.getStackInSlot( x ); this.invBySlot[x] = null; this.handlersBySlot[x] = null; @@ -327,7 +326,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + final DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); ih.setPriority( this.priority ); this.invBySlot[x] = ih; this.items.add( ih ); @@ -340,7 +339,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + final DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); ih.setPriority( this.priority ); this.invBySlot[x] = ih; this.fluids.add( ih ); @@ -364,7 +363,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.gridProxy.isActive() ) { @@ -381,7 +380,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.markDirty(); @@ -393,16 +392,16 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { this.state = 0; @@ -415,7 +414,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { this.worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); } diff --git a/src/main/java/appeng/tile/storage/TileIOPort.java b/src/main/java/appeng/tile/storage/TileIOPort.java index 9d580242..f1fe4b1a 100644 --- a/src/main/java/appeng/tile/storage/TileIOPort.java +++ b/src/main/java/appeng/tile/storage/TileIOPort.java @@ -120,7 +120,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileIOPort( NBTTagCompound data ) + public void writeToNBT_TileIOPort( final NBTTagCompound data ) { this.manager.writeToNBT( data ); this.cells.writeToNBT( data, "cells" ); @@ -129,7 +129,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileIOPort( NBTTagCompound data ) + public void readFromNBT_TileIOPort( final NBTTagCompound data ) { this.manager.readFromNBT( data ); this.cells.readFromNBT( data, "cells" ); @@ -141,7 +141,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public AECableType getCableConnectionType( ForgeDirection dir ) + public AECableType getCableConnectionType( final ForgeDirection dir ) { return AECableType.SMART; } @@ -165,7 +165,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -173,7 +173,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC public void updateRedstoneState() { - YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; + final YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO; if( this.lastRedstoneState != currentState ) { this.lastRedstoneState = currentState; @@ -198,7 +198,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return true; } - RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED ); + final RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED ); if( rs == RedstoneMode.HIGH_SIGNAL ) { return this.getRedstoneState(); @@ -213,7 +213,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { @@ -229,7 +229,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.updateTask(); } @@ -257,7 +257,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.cells == inv ) { @@ -266,9 +266,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side ) { - for( int inputSlotIndex : this.input ) + for( final int inputSlotIndex : this.input ) { if( inputSlotIndex == slotIndex ) { @@ -280,9 +280,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side ) { - for( int outputSlotIndex : this.output ) + for( final int outputSlotIndex : this.output ) { if( outputSlotIndex == slotIndex ) { @@ -294,7 +294,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection d ) + public int[] getAccessibleSlotsBySide( final ForgeDirection d ) { if( d == ForgeDirection.UP || d == ForgeDirection.DOWN ) { @@ -305,13 +305,13 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.IOPort.min, TickRates.IOPort.max, this.hasWork(), false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( !this.gridProxy.isActive() ) { @@ -335,18 +335,18 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC try { - IMEInventory itemNet = this.gridProxy.getStorage().getItemInventory(); - IMEInventory fluidNet = this.gridProxy.getStorage().getFluidInventory(); - IEnergySource energy = this.gridProxy.getEnergy(); + final IMEInventory itemNet = this.gridProxy.getStorage().getItemInventory(); + final IMEInventory fluidNet = this.gridProxy.getStorage().getFluidInventory(); + final IEnergySource energy = this.gridProxy.getEnergy(); for( int x = 0; x < 6; x++ ) { - ItemStack is = this.cells.getStackInSlot( x ); + final ItemStack is = this.cells.getStackInSlot( x ); if( is != null ) { if( ItemsToMove > 0 ) { - IMEInventory itemInv = this.getInv( is, StorageChannel.ITEMS ); - IMEInventory fluidInv = this.getInv( is, StorageChannel.FLUIDS ); + final IMEInventory itemInv = this.getInv( is, StorageChannel.ITEMS ); + final IMEInventory fluidInv = this.getInv( is, StorageChannel.FLUIDS ); if( this.manager.getSetting( Settings.OPERATION_MODE ) == OperationMode.EMPTY ) { @@ -385,7 +385,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return TickRateModulation.IDLE; } @@ -395,12 +395,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } - private IMEInventory getInv( ItemStack is, StorageChannel chan ) + private IMEInventory getInv( final ItemStack is, final StorageChannel chan ) { if( this.currentCell != is ) { @@ -417,9 +417,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return this.cachedFluid; } - private long transferContents( IEnergySource energy, IMEInventory src, IMEInventory destination, long itemsToMove, StorageChannel chan ) + private long transferContents( final IEnergySource energy, final IMEInventory src, final IMEInventory destination, long itemsToMove, final StorageChannel chan ) { - IItemList myList; + final IItemList myList; if( src instanceof IMEMonitor ) { myList = ( (IMEMonitor) src ).getStorageList(); @@ -435,12 +435,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC { didStuff = false; - for( IAEStack s : myList ) + for( final IAEStack s : myList ) { - long totalStackSize = s.getStackSize(); + final long totalStackSize = s.getStackSize(); if( totalStackSize > 0 ) { - IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc ); + final IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc ); long possible = 0; if( stack == null ) @@ -457,11 +457,11 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC possible = Math.min( possible, itemsToMove ); s.setStackSize( possible ); - IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc ); + final IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc ); if( extracted != null ) { possible = extracted.getStackSize(); - IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc ); + final IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc ); if( failed != null ) { @@ -486,9 +486,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return itemsToMove; } - private boolean shouldMove( IMEInventory itemInv, IMEInventory fluidInv ) + private boolean shouldMove( final IMEInventory itemInv, final IMEInventory fluidInv ) { - FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE ); + final FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE ); if( itemInv != null && fluidInv != null ) { @@ -506,10 +506,10 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return true; } - private boolean moveSlot( int x ) + private boolean moveSlot( final int x ) { - WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true ); - ItemStack result = InventoryAdaptor.getAdaptor( wir, ForgeDirection.UNKNOWN ).addItems( this.getStackInSlot( x ) ); + final WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true ); + final ItemStack result = InventoryAdaptor.getAdaptor( wir, ForgeDirection.UNKNOWN ).addItems( this.getStackInSlot( x ) ); if( result == null ) { @@ -520,14 +520,14 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return false; } - private boolean matches( FullnessMode fm, IMEInventory src ) + private boolean matches( final FullnessMode fm, final IMEInventory src ) { if( fm == FullnessMode.HALF ) { return true; } - IItemList myList; + final IItemList myList; if( src instanceof IMEMonitor ) { @@ -543,7 +543,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return myList.isEmpty(); } - IAEStack test = myList.getFirstItem(); + final IAEStack test = myList.getFirstItem(); if( test != null ) { test.setStackSize( 1 ); @@ -562,13 +562,13 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC * @param drops drops of tile entity */ @Override - public void getDrops( World w, int x, int y, int z, List drops ) + public void getDrops( final World w, final int x, final int y, final int z, final List drops ) { super.getDrops( w, x, y, z, drops ); for( int upgradeIndex = 0; upgradeIndex < this.upgrades.getSizeInventory(); upgradeIndex++ ) { - ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex ); + final ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex ); if( stackInSlot != null ) { diff --git a/src/main/java/appeng/tile/storage/TileSkyChest.java b/src/main/java/appeng/tile/storage/TileSkyChest.java index 4f2bccc9..86dd143e 100644 --- a/src/main/java/appeng/tile/storage/TileSkyChest.java +++ b/src/main/java/appeng/tile/storage/TileSkyChest.java @@ -45,15 +45,15 @@ public class TileSkyChest extends AEBaseInvTile public float lidAngle; @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSkyChest( ByteBuf data ) + public void writeToStream_TileSkyChest( final ByteBuf data ) { data.writeBoolean( this.playerOpen > 0 ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSkyChest( ByteBuf data ) + public boolean readFromStream_TileSkyChest( final ByteBuf data ) { - int wasOpen = this.playerOpen; + final int wasOpen = this.playerOpen; this.playerOpen = data.readBoolean() ? 1 : 0; if( wasOpen != this.playerOpen ) @@ -116,13 +116,13 @@ public class TileSkyChest extends AEBaseInvTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( ForgeDirection side ) + public int[] getAccessibleSlotsBySide( final ForgeDirection side ) { return this.sides; } diff --git a/src/main/java/appeng/transformer/AppEngCore.java b/src/main/java/appeng/transformer/AppEngCore.java index 191231db..5a07faff 100644 --- a/src/main/java/appeng/transformer/AppEngCore.java +++ b/src/main/java/appeng/transformer/AppEngCore.java @@ -57,7 +57,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @EventHandler - public void load( FMLInitializationEvent event ) + public void load( final FMLInitializationEvent event ) { } @@ -81,7 +81,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @Override - public void injectData( Map data ) + public void injectData( final Map data ) { } @@ -117,7 +117,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @Override - public boolean registerBus( EventBus bus, LoadController controller ) + public boolean registerBus( final EventBus bus, final LoadController controller ) { return true; } diff --git a/src/main/java/appeng/transformer/MissingCoreMod.java b/src/main/java/appeng/transformer/MissingCoreMod.java index 38288ab8..40d0524a 100644 --- a/src/main/java/appeng/transformer/MissingCoreMod.java +++ b/src/main/java/appeng/transformer/MissingCoreMod.java @@ -38,22 +38,22 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException private boolean deobf = false; @Override - public void initGui( GuiErrorScreen errorScreen, FontRenderer fontRenderer ) + public void initGui( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer ) { - Class clz = errorScreen.getClass(); + final Class clz = errorScreen.getClass(); try { clz.getField( "mc" ); this.deobf = true; } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } } @Override - public void drawScreen( GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime ) + public void drawScreen( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer, final int mouseRelX, final int mouseRelY, final float tickTime ) { int offset = 10; this.drawCenteredString( fontRenderer, "Sorry, couldn't load AE2 properly.", errorScreen.width / 2, offset, COLOR_WHITE ); @@ -90,7 +90,7 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException } } - private void drawCenteredString( FontRenderer fontRenderer, String string, int x, int y, int colour ) + private void drawCenteredString( final FontRenderer fontRenderer, final String string, final int x, final int y, final int colour ) { final String reEncoded = string.replaceAll( "\\P{InBasic_Latin}", "" ); final int reEncodedWidth = fontRenderer.getStringWidth( reEncoded ); diff --git a/src/main/java/appeng/transformer/asm/ASMIntegration.java b/src/main/java/appeng/transformer/asm/ASMIntegration.java index b89e5f07..3d54a573 100644 --- a/src/main/java/appeng/transformer/asm/ASMIntegration.java +++ b/src/main/java/appeng/transformer/asm/ASMIntegration.java @@ -52,7 +52,7 @@ public final class ASMIntegration implements IClassTransformer * Side, Display Name, ModID ClassPostFix */ - for( IntegrationType type : IntegrationType.values() ) + for( final IntegrationType type : IntegrationType.values() ) { IntegrationRegistry.INSTANCE.add( type ); } @@ -70,7 +70,7 @@ public final class ASMIntegration implements IClassTransformer @Nullable @Override - public byte[] transform( String name, String transformedName, byte[] basicClass ) + public byte[] transform( final String name, final String transformedName, final byte[] basicClass ) { if( basicClass == null || transformedName.startsWith( "appeng.transformer" ) ) { @@ -79,22 +79,22 @@ public final class ASMIntegration implements IClassTransformer if( transformedName.startsWith( "appeng." ) ) { - ClassNode classNode = new ClassNode(); - ClassReader classReader = new ClassReader( basicClass ); + final ClassNode classNode = new ClassNode(); + final ClassReader classReader = new ClassReader( basicClass ); classReader.accept( classNode, 0 ); try { - boolean reWrite = this.removeOptionals( classNode ); + final boolean reWrite = this.removeOptionals( classNode ); if( reWrite ) { - ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); classNode.accept( writer ); return writer.toByteArray(); } } - catch( Throwable t ) + catch( final Throwable t ) { t.printStackTrace(); } @@ -102,13 +102,13 @@ public final class ASMIntegration implements IClassTransformer return basicClass; } - private boolean removeOptionals( ClassNode classNode ) + private boolean removeOptionals( final ClassNode classNode ) { boolean changed = false; if( classNode.visibleAnnotations != null ) { - for( AnnotationNode an : classNode.visibleAnnotations ) + for( final AnnotationNode an : classNode.visibleAnnotations ) { if( this.hasAnnotation( an, Integration.Interface.class ) ) { @@ -119,7 +119,7 @@ public final class ASMIntegration implements IClassTransformer } else if( this.hasAnnotation( an, Integration.InterfaceList.class ) ) { - for( Object o : ( (Iterable) an.values.get( 1 ) ) ) + for( final Object o : ( (Iterable) an.values.get( 1 ) ) ) { if( this.stripInterface( classNode, Integration.InterfaceList.class, (AnnotationNode) o ) ) { @@ -130,14 +130,14 @@ public final class ASMIntegration implements IClassTransformer } } - Iterator i = classNode.methods.iterator(); + final Iterator i = classNode.methods.iterator(); while( i.hasNext() ) { - MethodNode mn = i.next(); + final MethodNode mn = i.next(); if( mn.visibleAnnotations != null ) { - for( AnnotationNode an : mn.visibleAnnotations ) + for( final AnnotationNode an : mn.visibleAnnotations ) { if( this.hasAnnotation( an, Integration.Method.class ) ) { @@ -158,12 +158,12 @@ public final class ASMIntegration implements IClassTransformer return changed; } - private boolean hasAnnotation( AnnotationNode ann, Class annotation ) + private boolean hasAnnotation( final AnnotationNode ann, final Class annotation ) { return ann.desc.equals( Type.getDescriptor( annotation ) ); } - private boolean stripInterface( ClassNode classNode, Class class1, AnnotationNode an ) + private boolean stripInterface( final ClassNode classNode, final Class class1, final AnnotationNode an ) { if( an.values.size() != 4 ) { @@ -213,7 +213,7 @@ public final class ASMIntegration implements IClassTransformer return false; } - private boolean stripMethod( ClassNode classNode, MethodNode mn, Iterator i, Class class1, AnnotationNode an ) + private boolean stripMethod( final ClassNode classNode, final MethodNode mn, final Iterator i, final Class class1, final AnnotationNode an ) { if( an.values.size() != 2 ) { @@ -229,7 +229,7 @@ public final class ASMIntegration implements IClassTransformer if( iName != null ) { - IntegrationType type = IntegrationType.valueOf( iName ); + final IntegrationType type = IntegrationType.valueOf( iName ); if( !IntegrationRegistry.INSTANCE.isEnabled( type ) ) { this.log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." ); @@ -249,7 +249,7 @@ public final class ASMIntegration implements IClassTransformer return false; } - private void log( String string ) + private void log( final String string ) { FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string ); } diff --git a/src/main/java/appeng/transformer/asm/ASMTweaker.java b/src/main/java/appeng/transformer/asm/ASMTweaker.java index 44b8a271..a4911d05 100644 --- a/src/main/java/appeng/transformer/asm/ASMTweaker.java +++ b/src/main/java/appeng/transformer/asm/ASMTweaker.java @@ -67,7 +67,7 @@ public final class ASMTweaker implements IClassTransformer @Nullable @Override - public byte[] transform( String name, String transformedName, byte[] basicClass ) + public byte[] transform( final String name, final String transformedName, final byte[] basicClass ) { if( basicClass == null ) { @@ -78,11 +78,11 @@ public final class ASMTweaker implements IClassTransformer { if( transformedName != null && this.privateToPublicMethods.containsKey( transformedName ) ) { - ClassNode classNode = new ClassNode(); - ClassReader classReader = new ClassReader( basicClass ); + final ClassNode classNode = new ClassNode(); + final ClassReader classReader = new ClassReader( basicClass ); classReader.accept( classNode, 0 ); - for( PublicLine set : this.privateToPublicMethods.get( transformedName ) ) + for( final PublicLine set : this.privateToPublicMethods.get( transformedName ) ) { this.makePublic( classNode, set ); } @@ -90,11 +90,11 @@ public final class ASMTweaker implements IClassTransformer // CALL VIRTUAL! if( transformedName.equals( "net.minecraft.client.gui.inventory.GuiContainer" ) ) { - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( "func_146977_a" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(Lzk;)V" ) ) ) { - MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS ); + final MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS ); 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 ) ); @@ -105,17 +105,17 @@ public final class ASMTweaker implements IClassTransformer } } - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( "func_73863_a" ) || mn.name.equals( "drawScreen" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(IIF)V" ) ) ) { - Iterator i = mn.instructions.iterator(); + final Iterator i = mn.instructions.iterator(); while( i.hasNext() ) { - AbstractInsnNode in = i.next(); + final AbstractInsnNode in = i.next(); if( in.getOpcode() == Opcodes.INVOKESPECIAL ) { - MethodInsnNode n = (MethodInsnNode) in; + final MethodInsnNode n = (MethodInsnNode) in; if( n.name.equals( "func_146977_a" ) || ( n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" ) ) ) { this.log( n.name + n.desc + " - Invoke Virtual" ); @@ -129,21 +129,21 @@ public final class ASMTweaker implements IClassTransformer } } - ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); classNode.accept( writer ); return writer.toByteArray(); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } return basicClass; } - private void makePublic( ClassNode classNode, PublicLine set ) + private void makePublic( final ClassNode classNode, final PublicLine set ) { - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( set.name ) && mn.desc.equals( set.desc ) ) { @@ -153,7 +153,7 @@ public final class ASMTweaker implements IClassTransformer } } - private void log( String string ) + private void log( final String string ) { FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string ); } @@ -163,7 +163,7 @@ public final class ASMTweaker implements IClassTransformer private final String name; private final String desc; - public PublicLine( String name, String desc ) + public PublicLine( final String name, final String desc ) { this.name = name; this.desc = desc; diff --git a/src/main/java/appeng/util/BlockUpdate.java b/src/main/java/appeng/util/BlockUpdate.java index 99292014..a9f3190d 100644 --- a/src/main/java/appeng/util/BlockUpdate.java +++ b/src/main/java/appeng/util/BlockUpdate.java @@ -29,7 +29,7 @@ public class BlockUpdate implements IWorldCallable final int y; final int z; - public BlockUpdate( int x, int y, int z ) + public BlockUpdate( final int x, final int y, final int z ) { this.x = x; this.y = y; @@ -37,7 +37,7 @@ public class BlockUpdate implements IWorldCallable } @Override - public Boolean call( World world ) throws Exception + public Boolean call( final World world ) throws Exception { if( world.blockExists( this.x, this.y, this.z ) ) { diff --git a/src/main/java/appeng/util/ClassInstantiation.java b/src/main/java/appeng/util/ClassInstantiation.java index af3ae018..a9589327 100644 --- a/src/main/java/appeng/util/ClassInstantiation.java +++ b/src/main/java/appeng/util/ClassInstantiation.java @@ -32,7 +32,7 @@ public class ClassInstantiation private final Class template; private final Object[] args; - public ClassInstantiation( Class template, Object... args ) + public ClassInstantiation( final Class template, final Object... args ) { this.template = template; this.args = args; @@ -41,18 +41,18 @@ public class ClassInstantiation public Optional get() { @SuppressWarnings( "unchecked" ) - Constructor[] constructors = (Constructor[]) this.template.getConstructors(); + final Constructor[] constructors = (Constructor[]) this.template.getConstructors(); - for( Constructor constructor : constructors ) + for( final Constructor constructor : constructors ) { - Class[] paramTypes = constructor.getParameterTypes(); + final Class[] paramTypes = constructor.getParameterTypes(); if( paramTypes.length == this.args.length ) { boolean valid = true; for( int idx = 0; idx < paramTypes.length; idx++ ) { - Class cz = this.args[idx].getClass(); + final Class cz = this.args[idx].getClass(); if( !this.isClassMatch( paramTypes[idx], cz, this.args[idx] ) ) { valid = false; @@ -65,15 +65,15 @@ public class ClassInstantiation { return Optional.of( constructor.newInstance( this.args ) ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { e.printStackTrace(); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { e.printStackTrace(); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { e.printStackTrace(); } @@ -85,7 +85,7 @@ public class ClassInstantiation return Optional.absent(); } - private boolean isClassMatch( Class expected, Class got, Object value ) + private boolean isClassMatch( Class expected, Class got, final Object value ) { if( value == null && !expected.isPrimitive() ) { @@ -98,11 +98,11 @@ public class ClassInstantiation return expected == got || expected.isAssignableFrom( got ); } - private Class condense( Class expected, Class... wrappers ) + private Class condense( final Class expected, final Class... wrappers ) { if( expected.isPrimitive() ) { - for( Class clz : wrappers ) + for( final Class clz : wrappers ) { try { @@ -111,7 +111,7 @@ public class ClassInstantiation return clz; } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } diff --git a/src/main/java/appeng/util/ConfigManager.java b/src/main/java/appeng/util/ConfigManager.java index 53ff5009..82c57407 100644 --- a/src/main/java/appeng/util/ConfigManager.java +++ b/src/main/java/appeng/util/ConfigManager.java @@ -37,7 +37,7 @@ public final class ConfigManager implements IConfigManager private final Map> settings = new EnumMap>( Settings.class ); private final IConfigManagerHost target; - public ConfigManager( IConfigManagerHost tile ) + public ConfigManager( final IConfigManagerHost tile ) { this.target = tile; } @@ -49,15 +49,15 @@ public final class ConfigManager implements IConfigManager } @Override - public void registerSetting( Settings settingName, Enum defaultValue ) + public void registerSetting( final Settings settingName, final Enum defaultValue ) { this.settings.put( settingName, defaultValue ); } @Override - public Enum getSetting( Settings settingName ) + public Enum getSetting( final Settings settingName ) { - Enum oldValue = this.settings.get( settingName ); + final Enum oldValue = this.settings.get( settingName ); if( oldValue != null ) { @@ -68,9 +68,9 @@ public final class ConfigManager implements IConfigManager } @Override - public Enum putSetting( Settings settingName, Enum newValue ) + public Enum putSetting( final Settings settingName, final Enum newValue ) { - Enum oldValue = this.getSetting( settingName ); + final Enum oldValue = this.getSetting( settingName ); this.settings.put( settingName, newValue ); this.target.updateSetting( this, settingName, newValue ); return oldValue; @@ -82,9 +82,9 @@ public final class ConfigManager implements IConfigManager * @param tagCompound to be written to compound */ @Override - public void writeToNBT( NBTTagCompound tagCompound ) + public void writeToNBT( final NBTTagCompound tagCompound ) { - for( Map.Entry> entry : this.settings.entrySet() ) + for( final Map.Entry> entry : this.settings.entrySet() ) { tagCompound.setString( entry.getKey().name(), this.settings.get( entry.getKey() ).toString() ); } @@ -96,9 +96,9 @@ public final class ConfigManager implements IConfigManager * @param tagCompound to be read from compound */ @Override - public void readFromNBT( NBTTagCompound tagCompound ) + public void readFromNBT( final NBTTagCompound tagCompound ) { - for( Map.Entry> entry : this.settings.entrySet() ) + for( final Map.Entry> entry : this.settings.entrySet() ) { try { @@ -116,14 +116,14 @@ public final class ConfigManager implements IConfigManager value = LevelEmitterMode.STORABLE_AMOUNT.toString(); } - Enum oldValue = this.settings.get( entry.getKey() ); + final Enum oldValue = this.settings.get( entry.getKey() ); - Enum newValue = Enum.valueOf( oldValue.getClass(), value ); + final Enum newValue = Enum.valueOf( oldValue.getClass(), value ); this.putSetting( entry.getKey(), newValue ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/util/InWorldToolOperationResult.java b/src/main/java/appeng/util/InWorldToolOperationResult.java index 303c11b3..ff1f1b6f 100644 --- a/src/main/java/appeng/util/InWorldToolOperationResult.java +++ b/src/main/java/appeng/util/InWorldToolOperationResult.java @@ -39,28 +39,28 @@ public class InWorldToolOperationResult this.Drops = null; } - public InWorldToolOperationResult( ItemStack block, List drops ) + public InWorldToolOperationResult( final ItemStack block, final List drops ) { this.BlockItem = block; this.Drops = drops; } - public InWorldToolOperationResult( ItemStack block ) + public InWorldToolOperationResult( final ItemStack block ) { this.BlockItem = block; this.Drops = null; } - public static InWorldToolOperationResult getBlockOperationResult( ItemStack[] items ) + public static InWorldToolOperationResult getBlockOperationResult( final ItemStack[] items ) { - List temp = new ArrayList(); + final List temp = new ArrayList(); ItemStack b = null; - for( ItemStack l : items ) + for( final ItemStack l : items ) { if( b == null ) { - Block bl = Block.getBlockFromItem( l.getItem() ); + final Block bl = Block.getBlockFromItem( l.getItem() ); if( bl != null && !( bl instanceof BlockAir ) ) { diff --git a/src/main/java/appeng/util/InventoryAdaptor.java b/src/main/java/appeng/util/InventoryAdaptor.java index f0265b5f..5d8336b4 100644 --- a/src/main/java/appeng/util/InventoryAdaptor.java +++ b/src/main/java/appeng/util/InventoryAdaptor.java @@ -44,14 +44,14 @@ public abstract class InventoryAdaptor implements Iterable { // returns an appropriate adaptor, or null - public static InventoryAdaptor getAdaptor( Object te, ForgeDirection d ) + public static InventoryAdaptor getAdaptor( final Object te, final ForgeDirection d ) { if( te == null ) { return null; } - IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null ); + final IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null ); if( te instanceof EntityPlayer ) { @@ -74,8 +74,8 @@ public abstract class InventoryAdaptor implements Iterable } else if( te instanceof ISidedInventory ) { - ISidedInventory si = (ISidedInventory) te; - int[] slots = si.getAccessibleSlotsFromSide( d.ordinal() ); + final ISidedInventory si = (ISidedInventory) te; + final int[] slots = si.getAccessibleSlotsFromSide( d.ordinal() ); if( si.getSizeInventory() > 0 && slots != null && slots.length > 0 ) { return new AdaptorIInventory( new WrapperMCISidedInventory( si, d ) ); @@ -83,7 +83,7 @@ public abstract class InventoryAdaptor implements Iterable } else if( te instanceof IInventory ) { - IInventory i = (IInventory) te; + final IInventory i = (IInventory) te; if( i.getSizeInventory() > 0 ) { return new AdaptorIInventory( i ); diff --git a/src/main/java/appeng/util/ItemSorters.java b/src/main/java/appeng/util/ItemSorters.java index afde6796..6f0ad451 100644 --- a/src/main/java/appeng/util/ItemSorters.java +++ b/src/main/java/appeng/util/ItemSorters.java @@ -37,7 +37,7 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( Direction == SortDir.ASCENDING ) { @@ -50,10 +50,10 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { - AEItemStack op1 = (AEItemStack) o1; - AEItemStack op2 = (AEItemStack) o2; + final AEItemStack op1 = (AEItemStack) o1; + final AEItemStack op2 = (AEItemStack) o2; if( Direction == SortDir.ASCENDING ) { @@ -62,7 +62,7 @@ public class ItemSorters return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 ); } - private int secondarySort( int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2 ) + private int secondarySort( final int compareToIgnoreCase, final IAEItemStack o1, final IAEItemStack o2 ) { if( compareToIgnoreCase == 0 ) { @@ -76,7 +76,7 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( Direction == SortDir.ASCENDING ) { @@ -90,14 +90,14 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( api == null ) { return CONFIG_BASED_SORT_BY_NAME.compare( o1, o2 ); } - int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() ); + final int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() ); if( Direction == SortDir.ASCENDING ) { @@ -124,7 +124,7 @@ public class ItemSorters } } - public static int compareInt( int a, int b ) + public static int compareInt( final int a, final int b ) { if( a == b ) { @@ -137,7 +137,7 @@ public class ItemSorters return 1; } - public static int compareLong( long a, long b ) + public static int compareLong( final long a, final long b ) { if( a == b ) { @@ -150,7 +150,7 @@ public class ItemSorters return 1; } - public static int compareDouble( double a, double b ) + public static int compareDouble( final double a, final double b ) { if( a == b ) { diff --git a/src/main/java/appeng/util/LookDirection.java b/src/main/java/appeng/util/LookDirection.java index 2821db1f..525a8a11 100644 --- a/src/main/java/appeng/util/LookDirection.java +++ b/src/main/java/appeng/util/LookDirection.java @@ -28,7 +28,7 @@ public class LookDirection public final Vec3 a; public final Vec3 b; - public LookDirection( Vec3 a, Vec3 b ) + public LookDirection( final Vec3 a, final Vec3 b ) { this.a = a; this.b = b; diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index a15a77d0..1636c5d7 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -180,11 +180,11 @@ public class Platform * * @return formatted long value */ - public static String formatPowerLong( long n, boolean isRate ) + public static String formatPowerLong( final long n, final boolean isRate ) { double p = ( (double) n ) / 100; - PowerUnits displayUnits = AEConfig.instance.selectedPowerUnit(); + final PowerUnits displayUnits = AEConfig.instance.selectedPowerUnit(); p = PowerUnits.AE.convertTo( displayUnits, p ); String unitName = displayUnits.name(); @@ -199,7 +199,7 @@ public class Platform unitName = "J"; } - String[] preFixes = new String[] { + final String[] preFixes = new String[] { "k", "M", "G", @@ -220,15 +220,15 @@ public class Platform offset++; } - DecimalFormat df = new DecimalFormat( "#.##" ); + final DecimalFormat df = new DecimalFormat( "#.##" ); return df.format( p ) + ' ' + level + unitName + ( isRate ? "/t" : "" ); } - public static ForgeDirection crossProduct( ForgeDirection forward, ForgeDirection up ) + public static ForgeDirection crossProduct( final ForgeDirection forward, final ForgeDirection up ) { - int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; - int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; - int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; + final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY; + final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ; + final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX; switch( west_x + west_y * 2 + west_z * 3 ) { @@ -251,7 +251,7 @@ public class Platform return ForgeDirection.UNKNOWN; } - public static T rotateEnum( T ce, boolean backwards, EnumSet validOptions ) + public static T rotateEnum( T ce, final boolean backwards, final EnumSet validOptions ) { do { @@ -272,9 +272,9 @@ public class Platform /* * Simple way to cycle an enum... */ - public static T prevEnum( T ce ) + public static T prevEnum( final T ce ) { - EnumSet valList = EnumSet.allOf( ce.getClass() ); + final EnumSet valList = EnumSet.allOf( ce.getClass() ); int pLoc = ce.ordinal() - 1; if( pLoc < 0 ) @@ -288,7 +288,7 @@ public class Platform } int pos = 0; - for( Object g : valList ) + for( final Object g : valList ) { if( pos == pLoc ) { @@ -303,9 +303,9 @@ public class Platform /* * Simple way to cycle an enum... */ - public static T nextEnum( T ce ) + public static T nextEnum( final T ce ) { - EnumSet valList = EnumSet.allOf( ce.getClass() ); + final EnumSet valList = EnumSet.allOf( ce.getClass() ); int pLoc = ce.ordinal() + 1; if( pLoc >= valList.size() ) @@ -319,7 +319,7 @@ public class Platform } int pos = 0; - for( Object g : valList ) + for( final Object g : valList ) { if( pos == pLoc ) { @@ -331,7 +331,7 @@ public class Platform return null; } - private static boolean isNotValidSetting( Enum e ) + private static boolean isNotValidSetting( final Enum e ) { if( e == SortOrder.INVTWEAKS && !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks ) ) { @@ -351,7 +351,7 @@ public class Platform return false; } - public static void openGUI( @Nonnull EntityPlayer p, @Nullable TileEntity tile, @Nullable ForgeDirection side, @Nonnull GuiBridge type ) + public static void openGUI( @Nonnull final EntityPlayer p, @Nullable final TileEntity tile, @Nullable final ForgeDirection side, @Nonnull final GuiBridge type ) { if( isClient() ) { @@ -393,7 +393,7 @@ public class Platform return FMLCommonHandler.instance().getEffectiveSide().isClient(); } - public static boolean hasPermissions( DimensionalCoord dc, EntityPlayer player ) + public static boolean hasPermissions( final DimensionalCoord dc, final EntityPlayer player ) { return dc.getWorld().canMineBlock( player, dc.x, dc.y, dc.z ); } @@ -401,13 +401,13 @@ public class Platform /* * Checks to see if a block is air? */ - public static boolean isBlockAir( World w, int x, int y, int z ) + public static boolean isBlockAir( final World w, final int x, final int y, final int z ) { try { return w.getBlock( x, y, z ).isAir( w, x, y, z ); } - catch( Throwable e ) + catch( final Throwable e ) { return false; } @@ -417,7 +417,7 @@ public class Platform * Lots of silliness to try and account for weird tag related junk, basically requires that two tags have at least * something in their tags before it wasts its time comparing them. */ - public static boolean sameStackStags( ItemStack a, ItemStack b ) + public static boolean sameStackStags( final ItemStack a, final ItemStack b ) { if( a == null && b == null ) { @@ -432,8 +432,8 @@ public class Platform return true; } - NBTTagCompound ta = a.getTagCompound(); - NBTTagCompound tb = b.getTagCompound(); + final NBTTagCompound ta = a.getTagCompound(); + final NBTTagCompound tb = b.getTagCompound(); if( ta == tb ) { return true; @@ -463,31 +463,31 @@ public class Platform * then the vanilla version which likes to fail when NBT Compound data changes order, it is pretty expensive * performance wise, so try an use shared tag compounds as long as the system remains in AE. */ - public static boolean NBTEqualityTest( NBTBase left, NBTBase right ) + public static boolean NBTEqualityTest( final NBTBase left, final NBTBase right ) { // same type? - byte id = left.getId(); + final byte id = left.getId(); if( id == right.getId() ) { switch( id ) { case 10: { - NBTTagCompound ctA = (NBTTagCompound) left; - NBTTagCompound ctB = (NBTTagCompound) right; + final NBTTagCompound ctA = (NBTTagCompound) left; + final NBTTagCompound ctB = (NBTTagCompound) right; - Set cA = ctA.func_150296_c(); - Set cB = ctB.func_150296_c(); + final Set cA = ctA.func_150296_c(); + final Set cB = ctB.func_150296_c(); if( cA.size() != cB.size() ) { return false; } - for( String name : cA ) + for( final String name : cA ) { - NBTBase tag = ctA.getTag( name ); - NBTBase aTag = ctB.getTag( name ); + final NBTBase tag = ctA.getTag( name ); + final NBTBase aTag = ctB.getTag( name ); if( aTag == null ) { return false; @@ -504,15 +504,15 @@ public class Platform case 9: // ) // A instanceof NBTTagList ) { - NBTTagList lA = (NBTTagList) left; - NBTTagList lB = (NBTTagList) right; + final NBTTagList lA = (NBTTagList) left; + final NBTTagList lB = (NBTTagList) right; if( lA.tagCount() != lB.tagCount() ) { return false; } - List tag = tagList( lA ); - List aTag = tagList( lB ); + final List tag = tagList( lA ); + final List aTag = tagList( lB ); if( tag.size() != aTag.size() ) { return false; @@ -560,7 +560,7 @@ public class Platform return false; } - private static List tagList( NBTTagList lB ) + private static List tagList( final NBTTagList lB ) { if( tagList == null ) { @@ -568,13 +568,13 @@ public class Platform { tagList = lB.getClass().getDeclaredField( "tagList" ); } - catch( Throwable t ) + catch( final Throwable t ) { try { tagList = lB.getClass().getDeclaredField( "field_74747_a" ); } - catch( Throwable z ) + catch( final Throwable z ) { AELog.error( t ); AELog.error( z ); @@ -587,7 +587,7 @@ public class Platform tagList.setAccessible( true ); return (List) tagList.get( lB ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -599,21 +599,21 @@ public class Platform * Orderless hash on NBT Data, used to work thought huge piles fast, but ignores the order just in case MC decided * to change it... WHICH IS BAD... */ - public static int NBTOrderlessHash( NBTBase nbt ) + public static int NBTOrderlessHash( final NBTBase nbt ) { // same type? int hash = 0; - byte id = nbt.getId(); + final byte id = nbt.getId(); hash += id; switch( id ) { case 10: { - NBTTagCompound ctA = (NBTTagCompound) nbt; + final NBTTagCompound ctA = (NBTTagCompound) nbt; - Set cA = ctA.func_150296_c(); + final Set cA = ctA.func_150296_c(); - for( String name : cA ) + for( final String name : cA ) { hash += name.hashCode() ^ NBTOrderlessHash( ctA.getTag( name ) ); } @@ -623,10 +623,10 @@ public class Platform case 9: // ) // A instanceof NBTTagList ) { - NBTTagList lA = (NBTTagList) nbt; + final NBTTagList lA = (NBTTagList) nbt; hash += 9 * lA.tagCount(); - List l = tagList( lA ); + final List l = tagList( lA ); for( int x = 0; x < l.size(); x++ ) { hash += ( (Integer) x ).hashCode() ^ NBTOrderlessHash( l.get( x ) ); @@ -661,12 +661,12 @@ public class Platform /* * The usual version of this returns an ItemStack, this version returns the recipe. */ - public static IRecipe findMatchingRecipe( InventoryCrafting inventoryCrafting, World par2World ) + public static IRecipe findMatchingRecipe( final InventoryCrafting inventoryCrafting, final World par2World ) { - CraftingManager cm = CraftingManager.getInstance(); - List rl = cm.getRecipeList(); + final CraftingManager cm = CraftingManager.getInstance(); + final List rl = cm.getRecipeList(); - for( IRecipe r : rl ) + for( final IRecipe r : rl ) { if( r.matches( inventoryCrafting, par2World ) ) { @@ -677,10 +677,10 @@ public class Platform return null; } - public static ItemStack[] getBlockDrops( World w, int x, int y, int z ) + public static ItemStack[] getBlockDrops( final World w, final int x, final int y, final int z ) { List out = new ArrayList(); - Block which = w.getBlock( x, y, z ); + final Block which = w.getBlock( x, y, z ); if( which != null ) { @@ -694,7 +694,7 @@ public class Platform return out.toArray( new ItemStack[out.size()] ); } - public static ForgeDirection cycleOrientations( ForgeDirection dir, boolean upAndDown ) + public static ForgeDirection cycleOrientations( final ForgeDirection dir, final boolean upAndDown ) { if( upAndDown ) { @@ -743,7 +743,7 @@ public class Platform /* * Creates / or loads previous NBT Data on items, used for editing items owned by AE. */ - public static NBTTagCompound openNbtData( ItemStack i ) + public static NBTTagCompound openNbtData( final ItemStack i ) { NBTTagCompound compound = i.getTagCompound(); @@ -758,20 +758,20 @@ public class Platform /* * Generates Item entities in the world similar to how items are generally dropped. */ - public static void spawnDrops( World w, int x, int y, int z, List drops ) + public static void spawnDrops( final World w, final int x, final int y, final int z, final List drops ) { if( isServer() ) { - for( ItemStack i : drops ) + for( final ItemStack i : drops ) { if( i != null ) { if( i.stackSize > 0 ) { - double offset_x = ( getRandomInt() % 32 - 16 ) / 82; - double offset_y = ( getRandomInt() % 32 - 16 ) / 82; - double offset_z = ( getRandomInt() % 32 - 16 ) / 82; - EntityItem ei = new EntityItem( w, 0.5 + offset_x + x, 0.5 + offset_y + y, 0.2 + offset_z + z, i.copy() ); + final double offset_x = ( getRandomInt() % 32 - 16 ) / 82; + final double offset_y = ( getRandomInt() % 32 - 16 ) / 82; + final double offset_z = ( getRandomInt() % 32 - 16 ) / 82; + final EntityItem ei = new EntityItem( w, 0.5 + offset_x + x, 0.5 + offset_y + y, 0.2 + offset_z + z, i.copy() ); w.spawnEntityInWorld( ei ); } } @@ -795,11 +795,11 @@ public class Platform /* * Utility function to get the full inventory for a Double Chest in the World. */ - public static IInventory GetChestInv( Object te ) + public static IInventory GetChestInv( final Object te ) { TileEntityChest teA = (TileEntityChest) te; TileEntity teB = null; - Block myBlockID = teA.getWorldObj().getBlock( teA.xCoord, teA.yCoord, teA.zCoord ); + final Block myBlockID = teA.getWorldObj().getBlock( teA.xCoord, teA.yCoord, teA.zCoord ); if( teA.getWorldObj().getBlock( teA.xCoord + 1, teA.yCoord, teA.zCoord ) == myBlockID ) { @@ -821,7 +821,7 @@ public class Platform } else { - TileEntityChest x = teA; + final TileEntityChest x = teA; teA = (TileEntityChest) teB; teB = x; } @@ -851,7 +851,7 @@ public class Platform } else { - TileEntityChest x = teA; + final TileEntityChest x = teA; teA = (TileEntityChest) teB; teB = x; } @@ -866,18 +866,18 @@ public class Platform return new InventoryLargeChest( "", teA, (IInventory) teB ); } - public static boolean isModLoaded( String modid ) + public static boolean isModLoaded( final String modid ) { try { // if this fails for some reason, try the other method. return Loader.isModLoaded( modid ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } - for( ModContainer f : Loader.instance().getActiveModList() ) + for( final ModContainer f : Loader.instance().getActiveModList() ) { if( f.getModId().equals( modid ) ) { @@ -887,13 +887,13 @@ public class Platform return false; } - public static ItemStack findMatchingRecipeOutput( InventoryCrafting ic, World worldObj ) + public static ItemStack findMatchingRecipeOutput( final InventoryCrafting ic, final World worldObj ) { return CraftingManager.getInstance().findMatchingRecipe( ic, worldObj ); } @SideOnly( Side.CLIENT ) - public static List getTooltip( Object o ) + public static List getTooltip( final Object o ) { if( o == null ) { @@ -903,7 +903,7 @@ public class Platform ItemStack itemStack = null; if( o instanceof AEItemStack ) { - AEItemStack ais = (AEItemStack) o; + final AEItemStack ais = (AEItemStack) o; return ais.getToolTip(); } else if( o instanceof ItemStack ) @@ -919,24 +919,24 @@ public class Platform { return itemStack.getTooltip( Minecraft.getMinecraft().thePlayer, false ); } - catch( Exception errB ) + catch( final Exception errB ) { return new ArrayList(); } } - public static String getModId( IAEItemStack is ) + public static String getModId( final IAEItemStack is ) { if( is == null ) { return "** Null"; } - String n = ( (AEItemStack) is ).getModID(); + final String n = ( (AEItemStack) is ).getModID(); return n == null ? "** Null" : n; } - public static String getItemDisplayName( Object o ) + public static String getItemDisplayName( final Object o ) { if( o == null ) { @@ -946,7 +946,7 @@ public class Platform ItemStack itemStack = null; if( o instanceof AEItemStack ) { - String n = ( (AEItemStack) o ).getDisplayName(); + final String n = ( (AEItemStack) o ).getDisplayName(); return n == null ? "** Null" : n; } else if( o instanceof ItemStack ) @@ -967,27 +967,27 @@ public class Platform } return name == null ? "** Null" : name; } - catch( Exception errA ) + catch( final Exception errA ) { try { - String n = itemStack.getUnlocalizedName(); + final String n = itemStack.getUnlocalizedName(); return n == null ? "** Null" : n; } - catch( Exception errB ) + catch( final Exception errB ) { return "** Exception"; } } } - public static boolean hasSpecialComparison( IAEItemStack willAdd ) + public static boolean hasSpecialComparison( final IAEItemStack willAdd ) { if( willAdd == null ) { return false; } - IAETagCompound tag = willAdd.getTagCompound(); + final IAETagCompound tag = willAdd.getTagCompound(); if( tag != null && tag.getSpecialComparison() != null ) { return true; @@ -995,7 +995,7 @@ public class Platform return false; } - public static boolean hasSpecialComparison( ItemStack willAdd ) + public static boolean hasSpecialComparison( final ItemStack willAdd ) { if( AESharedNBT.isShared( willAdd.getTagCompound() ) ) { @@ -1007,7 +1007,7 @@ public class Platform return false; } - public static boolean isWrench( EntityPlayer player, ItemStack eq, int x, int y, int z ) + public static boolean isWrench( final EntityPlayer player, final ItemStack eq, final int x, final int y, final int z ) { if( eq != null ) { @@ -1015,31 +1015,31 @@ public class Platform { if( eq.getItem() instanceof IToolWrench ) { - IToolWrench wrench = (IToolWrench) eq.getItem(); + final IToolWrench wrench = (IToolWrench) eq.getItem(); return wrench.canWrench( player, x, y, z ); } } - catch( Throwable ignore ) + catch( final Throwable ignore ) { // explodes without BC } if( eq.getItem() instanceof IAEWrench ) { - IAEWrench wrench = (IAEWrench) eq.getItem(); + final IAEWrench wrench = (IAEWrench) eq.getItem(); return wrench.canWrench( eq, player, x, y, z ); } } return false; } - public static boolean isChargeable( ItemStack i ) + public static boolean isChargeable( final ItemStack i ) { if( i == null ) { return false; } - Item it = i.getItem(); + final Item it = i.getItem(); if( it instanceof IAEItemPowerStorage ) { return ( (IAEItemPowerStorage) it ).getPowerFlow( i ) != AccessRestriction.READ; @@ -1047,25 +1047,25 @@ public class Platform return false; } - public static EntityPlayer getPlayer( WorldServer w ) + public static EntityPlayer getPlayer( final WorldServer w ) { if( w == null ) { throw new InvalidParameterException( "World is null." ); } - EntityPlayer wrp = FAKE_PLAYERS.get( w ); + final EntityPlayer wrp = FAKE_PLAYERS.get( w ); if( wrp != null ) { return wrp; } - EntityPlayer p = FakePlayerFactory.getMinecraft( w ); + final EntityPlayer p = FakePlayerFactory.getMinecraft( w ); FAKE_PLAYERS.put( w, p ); return p; } - public static int MC2MEColor( int color ) + public static int MC2MEColor( final int color ) { switch( color ) { @@ -1097,7 +1097,7 @@ public class Platform return -1; } - public static int findEmpty( Object[] l ) + public static int findEmpty( final Object[] l ) { for( int x = 0; x < l.length; x++ ) { @@ -1109,10 +1109,10 @@ public class Platform return -1; } - public static T pickRandom( Collection outs ) + public static T pickRandom( final Collection outs ) { int index = RANDOM_GENERATOR.nextInt( outs.size() ); - Iterator i = outs.iterator(); + final Iterator i = outs.iterator(); while( i.hasNext() && index > 0 ) { index--; @@ -1126,7 +1126,7 @@ public class Platform return null; // wtf? } - public static ForgeDirection rotateAround( ForgeDirection forward, ForgeDirection axis ) + public static ForgeDirection rotateAround( final ForgeDirection forward, final ForgeDirection axis ) { if( axis == ForgeDirection.UNKNOWN || forward == ForgeDirection.UNKNOWN ) { @@ -1234,17 +1234,17 @@ public class Platform } @SideOnly( Side.CLIENT ) - public static String gui_localize( String string ) + public static String gui_localize( final String string ) { return StatCollector.translateToLocal( string ); } - public static boolean isSameItemPrecise( @Nullable ItemStack is, @Nullable ItemStack filter ) + public static boolean isSameItemPrecise( @Nullable final ItemStack is, @Nullable final ItemStack filter ) { return isSameItem( is, filter ) && sameStackStags( is, filter ); } - public static boolean isSameItemFuzzy( ItemStack a, ItemStack b, FuzzyMode mode ) + public static boolean isSameItemFuzzy( final ItemStack a, final ItemStack b, final FuzzyMode mode ) { if( a == null && b == null ) { @@ -1281,13 +1281,13 @@ public class Platform } else { - float percentDamagedOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float percentDamagedOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + final float percentDamagedOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamagedOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -1299,16 +1299,16 @@ public class Platform } else { - float percentDamagedOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamagedOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); + final float percentDamagedOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamagedOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } } - OreReference aOR = OreHelper.INSTANCE.isOre( a ); - OreReference bOR = OreHelper.INSTANCE.isOre( b ); + final OreReference aOR = OreHelper.INSTANCE.isOre( a ); + final OreReference bOR = OreHelper.INSTANCE.isOre( b ); if( OreHelper.INSTANCE.sameOre( aOR, bOR ) ) { @@ -1329,64 +1329,64 @@ public class Platform return a.isItemEqual( b ); } - public static LookDirection getPlayerRay( EntityPlayer player, float eyeOffset ) + public static LookDirection getPlayerRay( final EntityPlayer player, final 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 ) * f; - double d1 = eyeOffset; - double d2 = player.prevPosZ + ( player.posZ - player.prevPosZ ) * f; + final float f = 1.0F; + final float f1 = player.prevRotationPitch + ( player.rotationPitch - player.prevRotationPitch ) * f; + final float f2 = player.prevRotationYaw + ( player.rotationYaw - player.prevRotationYaw ) * f; + final double d0 = player.prevPosX + ( player.posX - player.prevPosX ) * f; + final double d1 = eyeOffset; + final 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 ); - float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); - float f5 = -MathHelper.cos( -f1 * 0.017453292F ); - float f6 = MathHelper.sin( -f1 * 0.017453292F ); - float f7 = f4 * f5; - float f8 = f3 * f5; + final Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); + final float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); + final float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); + final float f5 = -MathHelper.cos( -f1 * 0.017453292F ); + final float f6 = MathHelper.sin( -f1 * 0.017453292F ); + final float f7 = f4 * f5; + final float f8 = f3 * f5; double d3 = 5.0D; if( player instanceof EntityPlayerMP ) { d3 = ( (EntityPlayerMP) player ).theItemInWorldManager.getBlockReachDistance(); } - Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); + final Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); return new LookDirection( vec3, vec31 ); } - public static MovingObjectPosition rayTrace( EntityPlayer p, boolean hitBlocks, boolean hitEntities ) + public static MovingObjectPosition rayTrace( final EntityPlayer p, final boolean hitBlocks, final boolean hitEntities ) { - World w = p.getEntityWorld(); + final World w = p.getEntityWorld(); - float f = 1.0F; + final 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 ) * 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 ); - float f5 = -MathHelper.cos( -f1 * 0.017453292F ); - float f6 = MathHelper.sin( -f1 * 0.017453292F ); - float f7 = f4 * f5; - float f8 = f3 * f5; - double d3 = 32.0D; + final float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f; + final double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f; + final double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.yOffset; + final double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f; + final Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); + final float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); + final float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); + final float f5 = -MathHelper.cos( -f1 * 0.017453292F ); + final float f6 = MathHelper.sin( -f1 * 0.017453292F ); + final float f7 = f4 * f5; + final float f8 = f3 * f5; + final double d3 = 32.0D; - Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); + final 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 ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; double closest = 9999999.0D; if( hitEntities ) { - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -1399,12 +1399,12 @@ public class Platform } f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -1445,9 +1445,9 @@ public class Platform return 0; } - public static StackType poweredExtraction( IEnergySource energy, IMEInventory cell, StackType request, BaseActionSource src ) + public static StackType poweredExtraction( final IEnergySource energy, final IMEInventory cell, final StackType request, final BaseActionSource src ) { - StackType possible = cell.extractItems( (StackType) request.copy(), Actionable.SIMULATE, src ); + final StackType possible = cell.extractItems( (StackType) request.copy(), Actionable.SIMULATE, src ); long retrieved = 0; if( possible != null ) @@ -1455,16 +1455,16 @@ public class Platform retrieved = possible.getStackSize(); } - double availablePower = energy.extractAEPower( retrieved, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double availablePower = energy.extractAEPower( retrieved, Actionable.SIMULATE, PowerMultiplier.CONFIG ); - long itemToExtract = Math.min( (long) ( availablePower + 0.9 ), retrieved ); + final long itemToExtract = Math.min( (long) ( availablePower + 0.9 ), retrieved ); if( itemToExtract > 0 ) { energy.extractAEPower( retrieved, Actionable.MODULATE, PowerMultiplier.CONFIG ); possible.setStackSize( itemToExtract ); - StackType ret = cell.extractItems( possible, Actionable.MODULATE, src ); + final StackType ret = cell.extractItems( possible, Actionable.MODULATE, src ); if( ret != null && src.isPlayer() ) { @@ -1477,9 +1477,9 @@ public class Platform return null; } - public static StackType poweredInsert( IEnergySource energy, IMEInventory cell, StackType input, BaseActionSource src ) + public static StackType poweredInsert( final IEnergySource energy, final IMEInventory cell, final StackType input, final BaseActionSource src ) { - StackType possible = cell.injectItems( (StackType) input.copy(), Actionable.SIMULATE, src ); + final StackType possible = cell.injectItems( (StackType) input.copy(), Actionable.SIMULATE, src ); long stored = input.getStackSize(); if( possible != null ) @@ -1487,9 +1487,9 @@ public class Platform stored -= possible.getStackSize(); } - double availablePower = energy.extractAEPower( stored, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double availablePower = energy.extractAEPower( stored, Actionable.SIMULATE, PowerMultiplier.CONFIG ); - long itemToAdd = Math.min( (long) ( availablePower + 0.9 ), stored ); + final long itemToAdd = Math.min( (long) ( availablePower + 0.9 ), stored ); if( itemToAdd > 0 ) { @@ -1497,26 +1497,26 @@ public class Platform if( itemToAdd < input.getStackSize() ) { - long original = input.getStackSize(); - StackType split = (StackType) input.copy(); + final long original = input.getStackSize(); + final StackType split = (StackType) input.copy(); split.decStackSize( itemToAdd ); input.setStackSize( itemToAdd ); split.add( cell.injectItems( input, Actionable.MODULATE, src ) ); if( src.isPlayer() ) { - long diff = original - split.getStackSize(); + final long diff = original - split.getStackSize(); Stats.ItemsInserted.addToPlayer( ( (PlayerSource) src ).player, (int) diff ); } return split; } - StackType ret = cell.injectItems( input, Actionable.MODULATE, src ); + final StackType ret = cell.injectItems( input, Actionable.MODULATE, src ); if( src.isPlayer() ) { - long diff = ret == null ? input.getStackSize() : input.getStackSize() - ret.getStackSize(); + final long diff = ret == null ? input.getStackSize() : input.getStackSize() - ret.getStackSize(); Stats.ItemsInserted.addToPlayer( ( (PlayerSource) src ).player, (int) diff ); } @@ -1526,28 +1526,28 @@ public class Platform return input; } - public static void postChanges( IStorageGrid gs, ItemStack removed, ItemStack added, BaseActionSource src ) + public static void postChanges( final IStorageGrid gs, final ItemStack removed, final ItemStack added, final BaseActionSource src ) { - IItemList itemChanges = AEApi.instance().storage().createItemList(); - IItemList fluidChanges = AEApi.instance().storage().createFluidList(); + final IItemList itemChanges = AEApi.instance().storage().createItemList(); + final IItemList fluidChanges = AEApi.instance().storage().createFluidList(); if( removed != null ) { - IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.ITEMS ); + final IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.ITEMS ); if( myItems != null ) { - for( IAEItemStack is : myItems.getAvailableItems( itemChanges ) ) + for( final IAEItemStack is : myItems.getAvailableItems( itemChanges ) ) { is.setStackSize( -is.getStackSize() ); } } - IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.FLUIDS ); + final IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.FLUIDS ); if( myFluids != null ) { - for( IAEFluidStack is : myFluids.getAvailableItems( fluidChanges ) ) + for( final IAEFluidStack is : myFluids.getAvailableItems( fluidChanges ) ) { is.setStackSize( -is.getStackSize() ); } @@ -1556,14 +1556,14 @@ public class Platform if( added != null ) { - IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.ITEMS ); + final IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.ITEMS ); if( myItems != null ) { myItems.getAvailableItems( itemChanges ); } - IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.FLUIDS ); + final IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.FLUIDS ); if( myFluids != null ) { @@ -1574,21 +1574,21 @@ public class Platform gs.postAlterationOfStoredItems( StorageChannel.ITEMS, itemChanges, src ); } - public static > void postListChanges( IItemList before, IItemList after, IMEMonitorHandlerReceiver meMonitorPassthrough, BaseActionSource source ) + public static > void postListChanges( final IItemList before, final IItemList after, final IMEMonitorHandlerReceiver meMonitorPassthrough, final BaseActionSource source ) { - LinkedList changes = new LinkedList(); + final LinkedList changes = new LinkedList(); - for( T is : before ) + for( final T is : before ) { is.setStackSize( -is.getStackSize() ); } - for( T is : after ) + for( final T is : after ) { before.add( is ); } - for( T is : before ) + for( final T is : before ) { if( is.getStackSize() != 0 ) { @@ -1602,7 +1602,7 @@ public class Platform } } - public static int generateTileHash( TileEntity target ) + public static int generateTileHash( final TileEntity target ) { if( target == null ) { @@ -1617,7 +1617,7 @@ public class Platform } else if( target instanceof TileEntityChest ) { - TileEntityChest chest = (TileEntityChest) target; + final TileEntityChest chest = (TileEntityChest) target; chest.checkForAdjacentChests(); if( chest.adjacentChestZNeg != null ) { @@ -1642,10 +1642,10 @@ public class Platform if( target instanceof ISidedInventory ) { - for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) + for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS ) { - int[] sides = ( (ISidedInventory) target ).getAccessibleSlotsFromSide( dir.ordinal() ); + final int[] sides = ( (ISidedInventory) target ).getAccessibleSlotsFromSide( dir.ordinal() ); if( sides == null ) { @@ -1653,9 +1653,9 @@ public class Platform } int offset = 0; - for( int side : sides ) + for( final int side : sides ) { - int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); + final int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); offset++; hash = c + ( hash << 6 ) + ( hash << 16 ) - hash; } @@ -1666,7 +1666,7 @@ public class Platform return hash; } - public static boolean securityCheck( GridNode a, GridNode b ) + public static boolean securityCheck( final GridNode a, final GridNode b ) { if( a.lastSecurityKey == -1 && b.lastSecurityKey == -1 ) { @@ -1677,8 +1677,8 @@ public class Platform return false; } - boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1; - boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1; + final boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1; + final boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1; if( AEConfig.instance.isFeatureEnabled( AEFeature.LogSecurityAudits ) ) { @@ -1704,25 +1704,25 @@ public class Platform return false; } - private static boolean isPowered( IGrid grid ) + private static boolean isPowered( final IGrid grid ) { if( grid == null ) { return false; } - IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); return eg.isNetworkPowered(); } - private static boolean checkPlayerPermissions( IGrid grid, int playerID ) + private static boolean checkPlayerPermissions( final IGrid grid, final int playerID ) { if( grid == null ) { return false; } - ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); + final ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); if( gs == null ) { @@ -1737,7 +1737,7 @@ public class Platform return !gs.hasPermission( playerID, SecurityPermissions.BUILD ); } - public static void configurePlayer( EntityPlayer player, ForgeDirection side, TileEntity tile ) + public static void configurePlayer( final EntityPlayer player, final ForgeDirection side, final TileEntity tile ) { player.yOffset = 1.8f; @@ -1776,7 +1776,7 @@ public class Platform player.rotationYaw = player.prevCameraYaw = player.cameraYaw = yaw; } - public static boolean canAccess( AENetworkProxy gridProxy, BaseActionSource src ) + public static boolean canAccess( final AENetworkProxy gridProxy, final BaseActionSource src ) { try { @@ -1786,14 +1786,14 @@ public class Platform } else if( src.isMachine() ) { - IActionHost te = ( (MachineSource) src ).via; - IGridNode n = te.getActionableNode(); + final IActionHost te = ( (MachineSource) src ).via; + final IGridNode n = te.getActionableNode(); if( n == null ) { return false; } - int playerID = n.getPlayerID(); + final int playerID = n.getPlayerID(); return gridProxy.getSecurity().hasPermission( playerID, SecurityPermissions.BUILD ); } else @@ -1801,13 +1801,13 @@ public class Platform return false; } } - catch( GridAccessException gae ) + catch( final GridAccessException gae ) { return false; } } - public static ItemStack extractItemsByRecipe( IEnergySource energySrc, BaseActionSource mySrc, IMEMonitor src, World w, IRecipe r, ItemStack output, InventoryCrafting ci, ItemStack providedTemplate, int slot, IItemList items, Actionable realForFake, IPartitionList filter ) + public static ItemStack extractItemsByRecipe( final IEnergySource energySrc, final BaseActionSource mySrc, final IMEMonitor src, final World w, final IRecipe r, final ItemStack output, final InventoryCrafting ci, final ItemStack providedTemplate, final int slot, final IItemList items, final Actionable realForFake, final IPartitionList filter ) { if( energySrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.9 ) { @@ -1816,15 +1816,15 @@ public class Platform return null; } - AEItemStack ae_req = AEItemStack.create( providedTemplate ); + final AEItemStack ae_req = AEItemStack.create( providedTemplate ); ae_req.setStackSize( 1 ); if( filter == null || filter.isListed( ae_req ) ) { - IAEItemStack ae_ext = src.extractItems( ae_req, realForFake, mySrc ); + final IAEItemStack ae_ext = src.extractItems( ae_req, realForFake, mySrc ); if( ae_ext != null ) { - ItemStack extracted = ae_ext.getItemStack(); + final ItemStack extracted = ae_ext.getItemStack(); if( extracted != null ) { energySrc.extractAEPower( 1, realForFake, PowerMultiplier.CONFIG ); @@ -1833,25 +1833,25 @@ public class Platform } } - boolean checkFuzzy = ae_req.isOre() || providedTemplate.getItemDamage() == OreDictionary.WILDCARD_VALUE || providedTemplate.hasTagCompound() || providedTemplate.isItemStackDamageable(); + final boolean checkFuzzy = ae_req.isOre() || providedTemplate.getItemDamage() == OreDictionary.WILDCARD_VALUE || providedTemplate.hasTagCompound() || providedTemplate.isItemStackDamageable(); if( items != null && checkFuzzy ) { - for( IAEItemStack x : items ) + for( final IAEItemStack x : items ) { - ItemStack sh = x.getItemStack(); + final ItemStack sh = x.getItemStack(); if( ( Platform.isSameItemType( providedTemplate, sh ) || ae_req.sameOre( x ) ) && !Platform.isSameItem( sh, output ) ) { // Platform.isSameItemType( sh, providedTemplate ) - ItemStack cp = Platform.cloneItemStack( sh ); + final ItemStack cp = Platform.cloneItemStack( sh ); cp.stackSize = 1; ci.setInventorySlotContents( slot, cp ); if( r.matches( ci, w ) && Platform.isSameItem( r.getCraftingResult( ci ), output ) ) { - IAEItemStack ax = x.copy(); + final IAEItemStack ax = x.copy(); ax.setStackSize( 1 ); if( filter == null || filter.isListed( ax ) ) { - IAEItemStack ex = src.extractItems( ax, realForFake, mySrc ); + final IAEItemStack ex = src.extractItems( ax, realForFake, mySrc ); if( ex != null ) { energySrc.extractAEPower( 1, realForFake, PowerMultiplier.CONFIG ); @@ -1867,7 +1867,7 @@ public class Platform return null; } - public static boolean isSameItemType( ItemStack that, ItemStack other ) + public static boolean isSameItemType( final ItemStack that, final ItemStack other ) { if( that != null && other != null && that.getItem() == other.getItem() ) { @@ -1880,24 +1880,24 @@ public class Platform return false; } - public static boolean isSameItem( @Nullable ItemStack left, @Nullable ItemStack right ) + public static boolean isSameItem( @Nullable final ItemStack left, @Nullable final ItemStack right ) { return left != null && right != null && left.isItemEqual( right ); } - public static ItemStack cloneItemStack( ItemStack a ) + public static ItemStack cloneItemStack( final ItemStack a ) { return a.copy(); } - public static ItemStack getContainerItem( ItemStack stackInSlot ) + public static ItemStack getContainerItem( final ItemStack stackInSlot ) { if( stackInSlot == null ) { return null; } - Item i = stackInSlot.getItem(); + final Item i = stackInSlot.getItem(); if( i == null || !i.hasContainerItem( stackInSlot ) ) { if( stackInSlot.stackSize > 1 ) @@ -1917,7 +1917,7 @@ public class Platform return ci; } - public static void notifyBlocksOfNeighbors( World worldObj, int xCoord, int yCoord, int zCoord ) + public static void notifyBlocksOfNeighbors( final World worldObj, final int xCoord, final int yCoord, final int zCoord ) { if( !worldObj.isRemote ) { @@ -1925,7 +1925,7 @@ public class Platform } } - public static boolean canRepair( AEFeature type, ItemStack a, ItemStack b ) + public static boolean canRepair( final AEFeature type, final ItemStack a, final ItemStack b ) { if( b == null || a == null ) { @@ -1947,11 +1947,11 @@ public class Platform return false; } - public static Object findPreferred( ItemStack[] is ) + public static Object findPreferred( final ItemStack[] is ) { final IParts parts = AEApi.instance().definitions().parts(); - for( ItemStack stack : is ) + for( final ItemStack stack : is ) { if( parts.cableGlass().sameAs( AEColor.Transparent, stack ) ) { @@ -1977,12 +1977,12 @@ public class Platform return is; } - public static void sendChunk( Chunk c, int verticalBits ) + public static void sendChunk( final Chunk c, final int verticalBits ) { try { - WorldServer ws = (WorldServer) c.worldObj; - PlayerManager pm = ws.getPlayerManager(); + final WorldServer ws = (WorldServer) c.worldObj; + final PlayerManager pm = ws.getPlayerManager(); if( getOrCreateChunkWatcher == null ) { @@ -1991,7 +1991,7 @@ public class Platform if( getOrCreateChunkWatcher != null ) { - Object playerInstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); + final Object playerInstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); if( playerInstance != null ) { Platform.playerInstance = playerInstance.getClass(); @@ -2008,13 +2008,13 @@ public class Platform } } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } } - public static AxisAlignedBB getPrimaryBox( ForgeDirection side, int facadeThickness ) + public static AxisAlignedBB getPrimaryBox( final ForgeDirection side, final int facadeThickness ) { switch( side ) { @@ -2036,22 +2036,22 @@ public class Platform return AxisAlignedBB.getBoundingBox( 0, 0, 0, 1, 1, 1 ); } - public static float getEyeOffset( EntityPlayer player ) + public static float getEyeOffset( final EntityPlayer player ) { assert player.worldObj.isRemote : "Valid only on client"; return (float) ( player.posY + player.getEyeHeight() - player.getDefaultEyeHeight() ); } - public static void addStat( int playerID, Achievement achievement ) + public static void addStat( final int playerID, final Achievement achievement ) { - EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID ); + final EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID ); if( p != null ) { p.addStat( achievement, 1 ); } } - public static boolean isRecipePrioritized( ItemStack what ) + public static boolean isRecipePrioritized( final ItemStack what ) { final IMaterials materials = AEApi.instance().definitions().materials(); diff --git a/src/main/java/appeng/util/ReadOnlyCollection.java b/src/main/java/appeng/util/ReadOnlyCollection.java index 8cdaa062..9692e889 100644 --- a/src/main/java/appeng/util/ReadOnlyCollection.java +++ b/src/main/java/appeng/util/ReadOnlyCollection.java @@ -30,7 +30,7 @@ public class ReadOnlyCollection implements IReadOnlyCollection private final Collection c; - public ReadOnlyCollection( Collection in ) + public ReadOnlyCollection( final Collection in ) { this.c = in; } @@ -54,7 +54,7 @@ public class ReadOnlyCollection implements IReadOnlyCollection } @Override - public boolean contains( Object node ) + public boolean contains( final Object node ) { return this.c.contains( node ); } diff --git a/src/main/java/appeng/util/ReadableNumberConverter.java b/src/main/java/appeng/util/ReadableNumberConverter.java index 677873c2..f5bf77db 100644 --- a/src/main/java/appeng/util/ReadableNumberConverter.java +++ b/src/main/java/appeng/util/ReadableNumberConverter.java @@ -46,7 +46,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi } @Override - public String toSlimReadableForm( long number ) + public String toSlimReadableForm( final long number ) { return this.toReadableFormRestrictedByWidth( number, 3 ); } @@ -59,7 +59,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi * * @return formatted number restricted by the width limitation */ - private String toReadableFormRestrictedByWidth( long number, int width ) + private String toReadableFormRestrictedByWidth( final long number, final int width ) { assert number >= 0; diff --git a/src/main/java/appeng/util/UUIDMatcher.java b/src/main/java/appeng/util/UUIDMatcher.java index 73293af6..2a6c9235 100644 --- a/src/main/java/appeng/util/UUIDMatcher.java +++ b/src/main/java/appeng/util/UUIDMatcher.java @@ -44,7 +44,7 @@ public final class UUIDMatcher * * @return true, if the potential {@link java.util.UUID} is indeed an {@link java.util.UUID} */ - public boolean isUUID( CharSequence potential ) + public boolean isUUID( final CharSequence potential ) { return PATTERN.matcher( potential ).matches(); } diff --git a/src/main/java/appeng/util/inv/AdaptorBCPipe.java b/src/main/java/appeng/util/inv/AdaptorBCPipe.java index f457e9bc..082c2543 100644 --- a/src/main/java/appeng/util/inv/AdaptorBCPipe.java +++ b/src/main/java/appeng/util/inv/AdaptorBCPipe.java @@ -39,7 +39,7 @@ public class AdaptorBCPipe extends InventoryAdaptor private final TileEntity i; private final ForgeDirection d; - public AdaptorBCPipe( TileEntity s, ForgeDirection dd ) + public AdaptorBCPipe( final TileEntity s, final ForgeDirection dd ) { this.buildCraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) @@ -56,31 +56,31 @@ public class AdaptorBCPipe extends InventoryAdaptor } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return null; } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return null; } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { return null; } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { return null; } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { if( this.i == null ) { @@ -103,7 +103,7 @@ public class AdaptorBCPipe extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { if( this.i == null ) { diff --git a/src/main/java/appeng/util/inv/AdaptorIInventory.java b/src/main/java/appeng/util/inv/AdaptorIInventory.java index 355be0af..2c6a17fa 100644 --- a/src/main/java/appeng/util/inv/AdaptorIInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorIInventory.java @@ -35,21 +35,21 @@ public class AdaptorIInventory extends InventoryAdaptor private final IInventory i; private final boolean wrapperEnabled; - public AdaptorIInventory( IInventory s ) + public AdaptorIInventory( final IInventory s ) { this.i = s; this.wrapperEnabled = s instanceof IInventoryWrapper; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( int amount, ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); ItemStack rv = null; for( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmounts = amount; @@ -84,7 +84,7 @@ public class AdaptorIInventory extends InventoryAdaptor } else { - ItemStack po = is.copy(); + final ItemStack po = is.copy(); po.stackSize -= boundAmounts; this.i.setInventorySlotContents( x, po ); this.i.markDirty(); @@ -100,14 +100,14 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); ItemStack rv = null; for( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmount = amount; @@ -141,12 +141,12 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { int newAmount = amount; @@ -172,7 +172,7 @@ public class AdaptorIInventory extends InventoryAdaptor } else { - ItemStack po = is.copy(); + final ItemStack po = is.copy(); po.stackSize -= rv.stackSize; this.i.setInventorySlotContents( x, po ); this.i.markDirty(); @@ -190,12 +190,12 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { @@ -211,7 +211,7 @@ public class AdaptorIInventory extends InventoryAdaptor if( boundAmount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = boundAmount; return rv; } @@ -221,13 +221,13 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { return this.addItems( toBeAdded, true ); } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { return this.addItems( toBeSimulated, false ); } @@ -235,7 +235,7 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public boolean containsItems() { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { if( this.i.getStackInSlot( x ) != null ) @@ -258,26 +258,26 @@ public class AdaptorIInventory extends InventoryAdaptor * * @return the left itemstack, which could not be added */ - private ItemStack addItems( ItemStack itemsToAdd, boolean modulate ) + private ItemStack addItems( final ItemStack itemsToAdd, final boolean modulate ) { if( itemsToAdd == null || itemsToAdd.stackSize == 0 ) { return null; } - ItemStack left = itemsToAdd.copy(); - int stackLimit = itemsToAdd.getMaxStackSize(); - int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit ); - int inventorySize = this.i.getSizeInventory(); + final ItemStack left = itemsToAdd.copy(); + final int stackLimit = itemsToAdd.getMaxStackSize(); + final int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit ); + final int inventorySize = this.i.getSizeInventory(); for( int slot = 0; slot < inventorySize; slot++ ) { - ItemStack next = left.copy(); + final ItemStack next = left.copy(); next.stackSize = Math.min( perOperationLimit, next.stackSize ); if( this.i.isItemValidForSlot( slot, next ) ) { - ItemStack is = this.i.getStackInSlot( slot ); + final ItemStack is = this.i.getStackInSlot( slot ); if( is == null ) { left.stackSize -= next.stackSize; @@ -295,8 +295,8 @@ public class AdaptorIInventory extends InventoryAdaptor } else if( Platform.isSameItemPrecise( is, left ) && is.stackSize < perOperationLimit ) { - int room = perOperationLimit - is.stackSize; - int used = Math.min( left.stackSize, room ); + final int room = perOperationLimit - is.stackSize; + final int used = Math.min( left.stackSize, room ); if( modulate ) { @@ -317,7 +317,7 @@ public class AdaptorIInventory extends InventoryAdaptor return left; } - boolean canRemoveStackFromSlot( int x, ItemStack is ) + boolean canRemoveStackFromSlot( final int x, final ItemStack is ) { if( this.wrapperEnabled ) { @@ -347,7 +347,7 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemSlot next() { - ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x ); + final ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x ); this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss ); this.is.setItemStack( iss ); diff --git a/src/main/java/appeng/util/inv/AdaptorList.java b/src/main/java/appeng/util/inv/AdaptorList.java index ddcf9447..aae14c23 100644 --- a/src/main/java/appeng/util/inv/AdaptorList.java +++ b/src/main/java/appeng/util/inv/AdaptorList.java @@ -35,18 +35,18 @@ public class AdaptorList extends InventoryAdaptor private final List i; - public AdaptorList( List s ) + public AdaptorList( final List s ) { this.i = s; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( int amount, final ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.size(); + final int s = this.i.size(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.get( x ); + final ItemStack is = this.i.get( x ); if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { if( amount > is.stackSize ) @@ -60,7 +60,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; is.stackSize -= amount; @@ -78,9 +78,9 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination ) { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { @@ -95,7 +95,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; return rv; } @@ -105,12 +105,12 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.size(); + final int s = this.i.size(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.get( x ); + final ItemStack is = this.i.get( x ); if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { if( amount > is.stackSize ) @@ -124,7 +124,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; is.stackSize -= amount; @@ -142,9 +142,9 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { @@ -159,7 +159,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; return rv; } @@ -169,7 +169,7 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { if( toBeAdded == null ) { @@ -180,9 +180,9 @@ public class AdaptorList extends InventoryAdaptor return null; } - ItemStack left = toBeAdded.copy(); + final ItemStack left = toBeAdded.copy(); - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( Platform.isSameItem( is, left ) ) { @@ -196,7 +196,7 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { return null; } @@ -204,7 +204,7 @@ public class AdaptorList extends InventoryAdaptor @Override public boolean containsItems() { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null ) { diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java index 1cd6c7c6..ce0ed7a3 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java @@ -38,15 +38,15 @@ public class AdaptorPlayerHand extends InventoryAdaptor private final EntityPlayer player; - public AdaptorPlayerHand( EntityPlayer player ) + public AdaptorPlayerHand( final EntityPlayer player ) { this.player = player; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -54,7 +54,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemPrecise( filter, hand ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; hand.stackSize -= amount; if( hand.stackSize <= 0 ) @@ -68,10 +68,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -79,7 +79,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemPrecise( filter, hand ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; return result; } @@ -88,9 +88,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -98,7 +98,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; hand.stackSize -= amount; if( hand.stackSize <= 0 ) @@ -112,10 +112,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -123,7 +123,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; return result; } @@ -132,7 +132,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { if( toBeAdded == null ) @@ -152,7 +152,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor return toBeAdded; } - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand != null && !Platform.isSameItemPrecise( toBeAdded, hand ) ) { @@ -175,7 +175,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( newHand.stackSize > newHand.getMaxStackSize() ) { newHand.stackSize = newHand.getMaxStackSize(); - ItemStack B = toBeAdded.copy(); + final ItemStack B = toBeAdded.copy(); B.stackSize -= newHand.stackSize - original; this.player.inventory.setItemStack( newHand ); return B; @@ -186,9 +186,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( toBeSimulated == null ) { return null; @@ -215,7 +215,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( newHand.stackSize > newHand.getMaxStackSize() ) { newHand.stackSize = newHand.getMaxStackSize(); - ItemStack B = toBeSimulated.copy(); + final ItemStack B = toBeSimulated.copy(); B.stackSize -= newHand.stackSize - original; return B; } diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java index 57e79a38..57144fd5 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java @@ -31,7 +31,7 @@ public class AdaptorPlayerInventory implements IInventory private final int min = 0; private final int size = 36; - public AdaptorPlayerInventory( IInventory playerInv, boolean swap ) + public AdaptorPlayerInventory( final IInventory playerInv, final boolean swap ) { if( swap ) @@ -51,25 +51,25 @@ public class AdaptorPlayerInventory implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.src.getStackInSlot( var1 + this.min ); } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { return this.src.decrStackSize( this.min + var1, var2 ); } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return this.src.getStackInSlotOnClosing( this.min + var1 ); } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { this.src.setInventorySlotContents( var1 + this.min, var2 ); } @@ -99,7 +99,7 @@ public class AdaptorPlayerInventory implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return this.src.isUseableByPlayer( var1 ); } @@ -117,7 +117,7 @@ public class AdaptorPlayerInventory implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.src.isItemValidForSlot( i, itemstack ); } diff --git a/src/main/java/appeng/util/inv/IMEAdaptor.java b/src/main/java/appeng/util/inv/IMEAdaptor.java index 84c89ed3..ba184646 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptor.java +++ b/src/main/java/appeng/util/inv/IMEAdaptor.java @@ -43,7 +43,7 @@ public class IMEAdaptor extends InventoryAdaptor final BaseActionSource src; int maxSlots = 0; - public IMEAdaptor( IMEInventory input, BaseActionSource src ) + public IMEAdaptor( final IMEInventory input, final BaseActionSource src ) { this.target = input; this.src = src; @@ -61,18 +61,18 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return this.doRemoveItems( amount, filter, destination, Actionable.MODULATE ); } - public ItemStack doRemoveItems( int amount, ItemStack filter, IInventoryDestination destination, Actionable type ) + public ItemStack doRemoveItems( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type ) { IAEItemStack req = null; if( filter == null ) { - IItemList list = this.getList(); + final IItemList list = this.getList(); if( !list.isEmpty() ) { req = list.getFirstItem(); @@ -100,13 +100,13 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return this.doRemoveItems( amount, filter, destination, Actionable.SIMULATE ); } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { if( filter == null ) { @@ -115,9 +115,9 @@ public class IMEAdaptor extends InventoryAdaptor return this.doRemoveItemsFuzzy( amount, filter, destination, Actionable.MODULATE, fuzzyMode ); } - public ItemStack doRemoveItemsFuzzy( int amount, ItemStack filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode ) + public ItemStack doRemoveItemsFuzzy( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type, final FuzzyMode fuzzyMode ) { - IAEItemStack reqFilter = AEItemStack.create( filter ); + final IAEItemStack reqFilter = AEItemStack.create( filter ); if( reqFilter == null ) { return null; @@ -125,7 +125,7 @@ public class IMEAdaptor extends InventoryAdaptor IAEItemStack out = null; - for( IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) ) + for( final IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) ) { if( req != null ) { @@ -142,7 +142,7 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { if( filter == null ) { @@ -152,12 +152,12 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { - IAEItemStack in = AEItemStack.create( toBeAdded ); + final IAEItemStack in = AEItemStack.create( toBeAdded ); if( in != null ) { - IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src ); + final IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src ); if( out != null ) { return out.getItemStack(); @@ -167,12 +167,12 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { - IAEItemStack in = AEItemStack.create( toBeSimulated ); + final IAEItemStack in = AEItemStack.create( toBeSimulated ); if( in != null ) { - IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src ); + final IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src ); if( out != null ) { return out.getItemStack(); diff --git a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java index ff06f7d6..abff1337 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java +++ b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java @@ -35,7 +35,7 @@ public final class IMEAdaptorIterator implements Iterator private int offset = 0; private boolean hasNext; - public IMEAdaptorIterator( IMEAdaptor parent, IItemList availableItems ) + public IMEAdaptorIterator( final IMEAdaptor parent, final IItemList availableItems ) { this.stack = availableItems.iterator(); this.containerSize = parent.maxSlots; @@ -63,7 +63,7 @@ public final class IMEAdaptorIterator implements Iterator if( this.hasNext ) { - IAEItemStack item = this.stack.next(); + final IAEItemStack item = this.stack.next(); this.slot.setAEItemStack( item ); return this.slot; } diff --git a/src/main/java/appeng/util/inv/IMEInventoryDestination.java b/src/main/java/appeng/util/inv/IMEInventoryDestination.java index bd08144d..89bd0f5e 100644 --- a/src/main/java/appeng/util/inv/IMEInventoryDestination.java +++ b/src/main/java/appeng/util/inv/IMEInventoryDestination.java @@ -32,13 +32,13 @@ public class IMEInventoryDestination implements IInventoryDestination final IMEInventory me; - public IMEInventoryDestination( IMEInventory o ) + public IMEInventoryDestination( final IMEInventory o ) { this.me = o; } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { if( stack == null ) @@ -46,7 +46,7 @@ public class IMEInventoryDestination implements IInventoryDestination return false; } - IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); + final IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); if( failed == null ) { diff --git a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java index c17841fb..d361da08 100644 --- a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java +++ b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java @@ -32,7 +32,7 @@ public class ItemListIgnoreCrafting implements IItemList final IItemList target; - public ItemListIgnoreCrafting( IItemList cla ) + public ItemListIgnoreCrafting( final IItemList cla ) { this.target = cla; } @@ -50,13 +50,13 @@ public class ItemListIgnoreCrafting implements IItemList } @Override - public T findPrecise( T i ) + public T findPrecise( final T i ) { return this.target.findPrecise( i ); } @Override - public Collection findFuzzy( T input, FuzzyMode fuzzy ) + public Collection findFuzzy( final T input, final FuzzyMode fuzzy ) { return this.target.findFuzzy( input, fuzzy ); } @@ -68,19 +68,19 @@ public class ItemListIgnoreCrafting implements IItemList } @Override - public void addStorage( T option ) + public void addStorage( final T option ) { this.target.addStorage( option ); } @Override - public void addCrafting( T option ) + public void addCrafting( final T option ) { // nothing. } @Override - public void addRequestable( T option ) + public void addRequestable( final T option ) { this.target.addRequestable( option ); } diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index 5ee62c4d..9f6b5d85 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -39,7 +39,7 @@ public class ItemSlot return this.itemStack == null ? ( this.aeItemStack == null ? null : ( this.itemStack = this.aeItemStack.getItemStack() ) ) : this.itemStack; } - public void setItemStack( ItemStack is ) + public void setItemStack( final ItemStack is ) { this.aeItemStack = null; this.itemStack = is; @@ -50,7 +50,7 @@ public class ItemSlot return this.aeItemStack == null ? ( this.itemStack == null ? null : ( this.aeItemStack = AEItemStack.create( this.itemStack ) ) ) : this.aeItemStack; } - public void setAEItemStack( IAEItemStack is ) + public void setAEItemStack( final IAEItemStack is ) { this.aeItemStack = is; this.itemStack = null; diff --git a/src/main/java/appeng/util/inv/WrapperBCPipe.java b/src/main/java/appeng/util/inv/WrapperBCPipe.java index 7e759f6b..c4ac15ea 100644 --- a/src/main/java/appeng/util/inv/WrapperBCPipe.java +++ b/src/main/java/appeng/util/inv/WrapperBCPipe.java @@ -37,7 +37,7 @@ public class WrapperBCPipe implements IInventory private final TileEntity ad; private final ForgeDirection dir; - public WrapperBCPipe( TileEntity te, ForgeDirection d ) + public WrapperBCPipe( final TileEntity te, final ForgeDirection d ) { this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); this.ad = te; @@ -51,25 +51,25 @@ public class WrapperBCPipe implements IInventory } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return null; } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return null; } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { @@ -102,7 +102,7 @@ public class WrapperBCPipe implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -120,7 +120,7 @@ public class WrapperBCPipe implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir ); } diff --git a/src/main/java/appeng/util/inv/WrapperChainedInventory.java b/src/main/java/appeng/util/inv/WrapperChainedInventory.java index fb05bfed..ab904384 100644 --- a/src/main/java/appeng/util/inv/WrapperChainedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperChainedInventory.java @@ -38,12 +38,12 @@ public class WrapperChainedInventory implements IInventory private List l; private Map offsets; - public WrapperChainedInventory( IInventory... inventories ) + public WrapperChainedInventory( final IInventory... inventories ) { this.setInventory( inventories ); } - public void setInventory( IInventory... a ) + public void setInventory( final IInventory... a ) { this.l = ImmutableList.copyOf( a ); this.calculateSizes(); @@ -54,9 +54,9 @@ public class WrapperChainedInventory implements IInventory this.offsets = new HashMap(); int offset = 0; - for( IInventory in : this.l ) + for( final IInventory in : this.l ) { - InvOffset io = new InvOffset(); + final InvOffset io = new InvOffset(); io.offset = offset; io.size = in.getSizeInventory(); io.i = in; @@ -72,12 +72,12 @@ public class WrapperChainedInventory implements IInventory this.fullSize = offset; } - public WrapperChainedInventory( List inventories ) + public WrapperChainedInventory( final List inventories ) { this.setInventory( inventories ); } - public void setInventory( List a ) + public void setInventory( final List a ) { this.l = a; this.calculateSizes(); @@ -87,7 +87,7 @@ public class WrapperChainedInventory implements IInventory { if( this.l.size() > 1 ) { - List newOrder = new ArrayList( this.l.size() ); + final List newOrder = new ArrayList( this.l.size() ); newOrder.add( this.l.get( this.l.size() - 1 ) ); for( int x = 0; x < this.l.size() - 1; x++ ) { @@ -97,9 +97,9 @@ public class WrapperChainedInventory implements IInventory } } - public IInventory getInv( int idx ) + public IInventory getInv( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i; @@ -107,9 +107,9 @@ public class WrapperChainedInventory implements IInventory return null; } - public int getInvSlot( int idx ) + public int getInvSlot( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return idx - io.offset; @@ -124,9 +124,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack getStackInSlot( int idx ) + public ItemStack getStackInSlot( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.getStackInSlot( idx - io.offset ); @@ -135,9 +135,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack decrStackSize( int idx, int var2 ) + public ItemStack decrStackSize( final int idx, final int var2 ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.decrStackSize( idx - io.offset, var2 ); @@ -146,9 +146,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack getStackInSlotOnClosing( int idx ) + public ItemStack getStackInSlotOnClosing( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.getStackInSlotOnClosing( idx - io.offset ); @@ -157,9 +157,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public void setInventorySlotContents( int idx, ItemStack var2 ) + public void setInventorySlotContents( final int idx, final ItemStack var2 ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { io.i.setInventorySlotContents( idx - io.offset, var2 ); @@ -183,7 +183,7 @@ public class WrapperChainedInventory implements IInventory { int smallest = 64; - for( IInventory i : this.l ) + for( final IInventory i : this.l ) { smallest = Math.min( smallest, i.getInventoryStackLimit() ); } @@ -194,14 +194,14 @@ public class WrapperChainedInventory implements IInventory @Override public void markDirty() { - for( IInventory i : this.l ) + for( final IInventory i : this.l ) { i.markDirty(); } } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return false; } @@ -217,9 +217,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public boolean isItemValidForSlot( int idx, ItemStack itemstack ) + public boolean isItemValidForSlot( final int idx, final ItemStack itemstack ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.isItemValidForSlot( idx - io.offset, itemstack ); diff --git a/src/main/java/appeng/util/inv/WrapperInvSlot.java b/src/main/java/appeng/util/inv/WrapperInvSlot.java index 3bd37978..03491db8 100644 --- a/src/main/java/appeng/util/inv/WrapperInvSlot.java +++ b/src/main/java/appeng/util/inv/WrapperInvSlot.java @@ -29,17 +29,17 @@ public class WrapperInvSlot private final IInventory inv; - public WrapperInvSlot( IInventory inv ) + public WrapperInvSlot( final IInventory inv ) { this.inv = inv; } - public IInventory getWrapper( int slot ) + public IInventory getWrapper( final int slot ) { return new InternalInterfaceWrapper( this.inv, slot ); } - protected boolean isItemValid( ItemStack itemstack ) + protected boolean isItemValid( final ItemStack itemstack ) { return true; } @@ -50,7 +50,7 @@ public class WrapperInvSlot private final IInventory inv; private final int slot; - public InternalInterfaceWrapper( IInventory target, int slot ) + public InternalInterfaceWrapper( final IInventory target, final int slot ) { this.inv = target; this.slot = slot; @@ -63,25 +63,25 @@ public class WrapperInvSlot } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.inv.getStackInSlot( this.slot ); } @Override - public ItemStack decrStackSize( int i, int num ) + public ItemStack decrStackSize( final int i, final int num ) { return this.inv.decrStackSize( this.slot, num ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.inv.getStackInSlotOnClosing( this.slot ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( this.slot, itemstack ); } @@ -111,7 +111,7 @@ public class WrapperInvSlot } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.inv.isUseableByPlayer( entityplayer ); } @@ -129,7 +129,7 @@ public class WrapperInvSlot } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return WrapperInvSlot.this.isItemValid( itemstack ) && this.inv.isItemValidForSlot( this.slot, itemstack ); } diff --git a/src/main/java/appeng/util/inv/WrapperInventoryRange.java b/src/main/java/appeng/util/inv/WrapperInventoryRange.java index 6a5140a7..f7da9a78 100644 --- a/src/main/java/appeng/util/inv/WrapperInventoryRange.java +++ b/src/main/java/appeng/util/inv/WrapperInventoryRange.java @@ -31,7 +31,7 @@ public class WrapperInventoryRange implements IInventory protected boolean ignoreValidItems = false; int[] slots; - public WrapperInventoryRange( IInventory a, int[] s, boolean ignoreValid ) + public WrapperInventoryRange( final IInventory a, final int[] s, final boolean ignoreValid ) { this.src = a; this.slots = s; @@ -44,7 +44,7 @@ public class WrapperInventoryRange implements IInventory this.ignoreValidItems = ignoreValid; } - public WrapperInventoryRange( IInventory a, int min, int size, boolean ignoreValid ) + public WrapperInventoryRange( final IInventory a, final int min, final int size, final boolean ignoreValid ) { this.src = a; this.slots = new int[size]; @@ -55,12 +55,12 @@ public class WrapperInventoryRange implements IInventory this.ignoreValidItems = ignoreValid; } - public static String concatLines( int[] s, String separator ) + public static String concatLines( final int[] s, final String separator ) { if( s.length > 0 ) { - StringBuilder sb = new StringBuilder(); - for( int value : s ) + final StringBuilder sb = new StringBuilder(); + for( final int value : s ) { if( sb.length() > 0 ) { @@ -80,25 +80,25 @@ public class WrapperInventoryRange implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.src.getStackInSlot( this.slots[var1] ); } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { return this.src.decrStackSize( this.slots[var1], var2 ); } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return this.src.getStackInSlotOnClosing( this.slots[var1] ); } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { this.src.setInventorySlotContents( this.slots[var1], var2 ); } @@ -128,7 +128,7 @@ public class WrapperInventoryRange implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return this.src.isUseableByPlayer( var1 ); } @@ -146,7 +146,7 @@ public class WrapperInventoryRange implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.ignoreValidItems ) { diff --git a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java index 7e695220..bfe66df0 100644 --- a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java @@ -30,7 +30,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I final ISidedInventory side; private final ForgeDirection dir; - public WrapperMCISidedInventory( ISidedInventory a, ForgeDirection d ) + public WrapperMCISidedInventory( final ISidedInventory a, final ForgeDirection d ) { super( a, a.getAccessibleSlotsFromSide( d.ordinal() ), false ); this.side = a; @@ -38,7 +38,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { if( this.canRemoveItemFromSlot( var1, this.getStackInSlot( var1 ) ) ) { @@ -48,7 +48,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.ignoreValidItems ) @@ -65,7 +65,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public boolean canRemoveItemFromSlot( int i, ItemStack is ) + public boolean canRemoveItemFromSlot( final int i, final ItemStack is ) { if( is == null ) { diff --git a/src/main/java/appeng/util/inv/WrapperTEPipe.java b/src/main/java/appeng/util/inv/WrapperTEPipe.java index 5436eca7..ee52bf5f 100644 --- a/src/main/java/appeng/util/inv/WrapperTEPipe.java +++ b/src/main/java/appeng/util/inv/WrapperTEPipe.java @@ -32,7 +32,7 @@ public class WrapperTEPipe implements IInventory final TileEntity ad; final ForgeDirection dir; - public WrapperTEPipe( TileEntity te, ForgeDirection d ) + public WrapperTEPipe( final TileEntity te, final ForgeDirection d ) { this.ad = te; this.dir = d; @@ -45,25 +45,25 @@ public class WrapperTEPipe implements IInventory } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return null; } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return null; } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { // ITE.addItemsToPipe( ad, itemstack, dir ); } @@ -93,7 +93,7 @@ public class WrapperTEPipe implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @@ -111,7 +111,7 @@ public class WrapperTEPipe implements IInventory } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return false; } diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index 0093d342..f323b67e 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -51,7 +51,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu private final Fluid fluid; private IAETagCompound tagCompound; - private AEFluidStack( AEFluidStack is ) + private AEFluidStack( final AEFluidStack is ) { this.fluid = is.fluid; @@ -64,7 +64,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu this.myHash = is.myHash; } - private AEFluidStack( @Nonnull FluidStack is ) + private AEFluidStack( @Nonnull final FluidStack is ) { this.fluid = is.getFluid(); @@ -80,14 +80,14 @@ public final class AEFluidStack extends AEStack implements IAEFlu this.myHash = this.fluid.hashCode() ^ ( this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ) ); } - public static IAEFluidStack loadFluidStackFromNBT( NBTTagCompound i ) + public static IAEFluidStack loadFluidStackFromNBT( final NBTTagCompound i ) { - ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); if( itemstack == null ) { return null; } - AEFluidStack fluid = AEFluidStack.create( itemstack ); + final AEFluidStack fluid = AEFluidStack.create( itemstack ); // fluid.priority = i.getInteger( "Priority" ); fluid.stackSize = i.getLong( "Cnt" ); fluid.setCountRequestable( i.getLong( "Req" ) ); @@ -95,7 +95,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu return fluid; } - public static AEFluidStack create( Object a ) + public static AEFluidStack create( final Object a ) { if( a == null ) { @@ -112,20 +112,20 @@ public final class AEFluidStack extends AEStack implements IAEFlu return null; } - public static IAEFluidStack loadFluidStackFromPacket( ByteBuf data ) throws IOException + public static IAEFluidStack loadFluidStackFromPacket( final ByteBuf data ) throws IOException { - byte mask = data.readByte(); + final byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); - boolean isCraftable = ( mask & 0x40 ) > 0; - boolean hasTagCompound = ( mask & 0x80 ) > 0; + final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + final boolean isCraftable = ( mask & 0x40 ) > 0; + final boolean hasTagCompound = ( mask & 0x80 ) > 0; // don't send this... - NBTTagCompound d = new NBTTagCompound(); + final NBTTagCompound d = new NBTTagCompound(); - byte len2 = data.readByte(); - byte[] name = new byte[len2]; + final byte len2 = data.readByte(); + final byte[] name = new byte[len2]; data.readBytes( name, 0, len2 ); d.setString( "FluidName", new String( name, "UTF-8" ) ); @@ -133,26 +133,26 @@ public final class AEFluidStack extends AEStack implements IAEFlu if( hasTagCompound ) { - int len = data.readInt(); + final int len = data.readInt(); - byte[] bd = new byte[len]; + final byte[] bd = new byte[len]; data.readBytes( bd ); - DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) ); + final DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) ); d.setTag( "tag", CompressedStreamTools.read( di ) ); } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( stackType, data ); - long countRequestable = getPacketValue( countReqType, data ); + final long stackSize = getPacketValue( stackType, data ); + final long countRequestable = getPacketValue( countReqType, data ); - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d ); + final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d ); if( fluidStack == null ) { return null; } - AEFluidStack fluid = AEFluidStack.create( fluidStack ); + final AEFluidStack fluid = AEFluidStack.create( fluidStack ); // fluid.priority = (int) priority; fluid.stackSize = stackSize; fluid.setCountRequestable( countRequestable ); @@ -161,7 +161,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public void add( IAEFluidStack option ) + public void add( final IAEFluidStack option ) { if( option == null ) { @@ -177,7 +177,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public void writeToNBT( NBTTagCompound i ) + public void writeToNBT( final NBTTagCompound i ) { /* * Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department. @@ -226,7 +226,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public boolean fuzzyComparison( Object st, FuzzyMode mode ) + public boolean fuzzyComparison( final Object st, final FuzzyMode mode ) { if( st instanceof FluidStack ) { @@ -250,7 +250,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public IAEFluidStack empty() { - IAEFluidStack dup = this.copy(); + final IAEFluidStack dup = this.copy(); dup.reset(); return dup; } @@ -280,9 +280,9 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public int compareTo( AEFluidStack b ) + public int compareTo( final AEFluidStack b ) { - int diff = this.hashCode() - b.hashCode(); + final int diff = this.hashCode() - b.hashCode(); return diff > 0 ? 1 : ( diff < 0 ? -1 : 0 ); } @@ -293,7 +293,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public boolean equals( Object ia ) + public boolean equals( final Object ia ) { if( ia instanceof AEFluidStack ) { @@ -301,12 +301,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu } else if( ia instanceof FluidStack ) { - FluidStack is = (FluidStack) ia; + final FluidStack is = (FluidStack) ia; if( is.getFluidID() == this.fluid.getID() ) { - NBTTagCompound ta = (NBTTagCompound) this.tagCompound; - NBTTagCompound tb = is.tag; + final NBTTagCompound ta = (NBTTagCompound) this.tagCompound; + final NBTTagCompound tb = is.tag; if( ta == tb ) { return true; @@ -346,25 +346,25 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - void writeIdentity( ByteBuf i ) throws IOException + void writeIdentity( final ByteBuf i ) throws IOException { - byte[] name = this.fluid.getName().getBytes( "UTF-8" ); + final byte[] name = this.fluid.getName().getBytes( "UTF-8" ); i.writeByte( (byte) name.length ); i.writeBytes( name ); } @Override - void readNBT( ByteBuf i ) throws IOException + void readNBT( final ByteBuf i ) throws IOException { if( this.hasTagCompound() ) { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream data = new DataOutputStream( bytes ); CompressedStreamTools.write( (NBTTagCompound) this.tagCompound, data ); - byte[] tagBytes = bytes.toByteArray(); - int size = tagBytes.length; + final byte[] tagBytes = bytes.toByteArray(); + final int size = tagBytes.length; i.writeInt( size ); i.writeBytes( tagBytes ); @@ -374,7 +374,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public FluidStack getFluidStack() { - FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) ); + final FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) ); if( this.tagCompound != null ) { is.tag = this.tagCompound.getNBTTagCompoundCopy(); diff --git a/src/main/java/appeng/util/item/AEItemDef.java b/src/main/java/appeng/util/item/AEItemDef.java index 619eed74..2f77f8be 100644 --- a/src/main/java/appeng/util/item/AEItemDef.java +++ b/src/main/java/appeng/util/item/AEItemDef.java @@ -53,7 +53,7 @@ public class AEItemDef public UniqueIdentifier uniqueID; public OreReference isOre; - public AEItemDef( Item it ) + public AEItemDef( final Item it ) { this.item = it; this.itemID = Item.getIdFromItem( it ); @@ -61,7 +61,7 @@ public class AEItemDef public AEItemDef copy() { - AEItemDef t = new AEItemDef( this.item ); + final AEItemDef t = new AEItemDef( this.item ); t.def = this.def; t.damageValue = this.damageValue; t.displayDamage = this.displayDamage; @@ -72,7 +72,7 @@ public class AEItemDef } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -82,14 +82,14 @@ public class AEItemDef { return false; } - AEItemDef other = (AEItemDef) obj; + final AEItemDef other = (AEItemDef) obj; return other.damageValue == this.damageValue && other.item == this.item && this.tagCompound == other.tagCompound; } - public boolean isItem( ItemStack otherStack ) + public boolean isItem( final ItemStack otherStack ) { // hackery! - int dmg = this.getDamageValueHack( otherStack ); + final int dmg = this.getDamageValueHack( otherStack ); if( this.item == otherStack.getItem() && dmg == this.damageValue ) { @@ -108,7 +108,7 @@ public class AEItemDef return false; } - public int getDamageValueHack( ItemStack is ) + public int getDamageValueHack( final ItemStack is ) { return Items.blaze_rod.getDamage( is ); } diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index b2d57de8..5ef81532 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -53,7 +53,7 @@ public final class AEItemStack extends AEStack implements IAEItemS AEItemDef def; - private AEItemStack( AEItemStack is ) + private AEItemStack( final AEItemStack is ) { this.def = is.def; this.stackSize = is.stackSize; @@ -61,7 +61,7 @@ public final class AEItemStack extends AEStack implements IAEItemS this.setCountRequestable( is.getCountRequestable() ); } - private AEItemStack( ItemStack is ) + private AEItemStack( final ItemStack is ) { if( is == null ) { @@ -97,7 +97,7 @@ public final class AEItemStack extends AEStack implements IAEItemS this.def.displayDamage = is.getItemDamageForDisplay(); this.def.maxDamage = is.getMaxDamage(); - NBTTagCompound tagCompound = is.getTagCompound(); + final NBTTagCompound tagCompound = is.getTagCompound(); if( tagCompound != null ) { this.def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is ); @@ -111,20 +111,20 @@ public final class AEItemStack extends AEStack implements IAEItemS this.def.isOre = OreHelper.INSTANCE.isOre( is ); } - public static IAEItemStack loadItemStackFromNBT( NBTTagCompound i ) + public static IAEItemStack loadItemStackFromNBT( final NBTTagCompound i ) { if( i == null ) { return null; } - ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); if( itemstack == null ) { return null; } - AEItemStack item = AEItemStack.create( itemstack ); + final AEItemStack item = AEItemStack.create( itemstack ); // item.priority = i.getInteger( "Priority" ); item.stackSize = i.getLong( "Cnt" ); item.setCountRequestable( i.getLong( "Req" ) ); @@ -133,7 +133,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Nullable - public static AEItemStack create( ItemStack stack ) + public static AEItemStack create( final ItemStack stack ) { if( stack == null ) { @@ -143,17 +143,17 @@ public final class AEItemStack extends AEStack implements IAEItemS return new AEItemStack( stack ); } - public static IAEItemStack loadItemStackFromPacket( ByteBuf data ) throws IOException + public static IAEItemStack loadItemStackFromPacket( final ByteBuf data ) throws IOException { - byte mask = data.readByte(); + final byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); - boolean isCraftable = ( mask & 0x40 ) > 0; - boolean hasTagCompound = ( mask & 0x80 ) > 0; + final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + final boolean isCraftable = ( mask & 0x40 ) > 0; + final boolean hasTagCompound = ( mask & 0x80 ) > 0; // don't send this... - NBTTagCompound d = new NBTTagCompound(); + final NBTTagCompound d = new NBTTagCompound(); d.setShort( "id", data.readShort() ); d.setShort( "Damage", data.readShort() ); @@ -161,26 +161,26 @@ public final class AEItemStack extends AEStack implements IAEItemS if( hasTagCompound ) { - int len = data.readInt(); + final int len = data.readInt(); - byte[] bd = new byte[len]; + final byte[] bd = new byte[len]; data.readBytes( bd ); - ByteArrayInputStream di = new ByteArrayInputStream( bd ); + final ByteArrayInputStream di = new ByteArrayInputStream( bd ); d.setTag( "tag", CompressedStreamTools.read( new DataInputStream( di ) ) ); } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( stackType, data ); - long countRequestable = getPacketValue( countReqType, data ); + final long stackSize = getPacketValue( stackType, data ); + final long countRequestable = getPacketValue( countReqType, data ); - ItemStack itemstack = ItemStack.loadItemStackFromNBT( d ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( d ); if( itemstack == null ) { return null; } - AEItemStack item = AEItemStack.create( itemstack ); + final AEItemStack item = AEItemStack.create( itemstack ); // item.priority = (int) priority; item.stackSize = stackSize; item.setCountRequestable( countRequestable ); @@ -189,7 +189,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { if( option == null ) { @@ -205,7 +205,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public void writeToNBT( NBTTagCompound i ) + public void writeToNBT( final NBTTagCompound i ) { /* * Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department. @@ -259,11 +259,11 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean fuzzyComparison( Object st, FuzzyMode mode ) + public boolean fuzzyComparison( final Object st, final FuzzyMode mode ) { if( st instanceof IAEItemStack ) { - IAEItemStack o = (IAEItemStack) st; + final IAEItemStack o = (IAEItemStack) st; if( this.sameOre( o ) ) { @@ -274,8 +274,8 @@ public final class AEItemStack extends AEStack implements IAEItemS { if( this.def.item.isDamageable() ) { - ItemStack a = this.getItemStack(); - ItemStack b = o.getItemStack(); + final ItemStack a = this.getItemStack(); + final ItemStack b = o.getItemStack(); try { @@ -289,13 +289,13 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float percentDamageOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + final float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamageOfB = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -307,8 +307,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); + final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } @@ -321,7 +321,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if( st instanceof ItemStack ) { - ItemStack o = (ItemStack) st; + final ItemStack o = (ItemStack) st; OreHelper.INSTANCE.sameOre( this, o ); @@ -329,7 +329,7 @@ public final class AEItemStack extends AEStack implements IAEItemS { if( this.def.item.isDamageable() ) { - ItemStack a = this.getItemStack(); + final ItemStack a = this.getItemStack(); try { @@ -343,13 +343,13 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - float percentDamageOfB = 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); + final float percentDamageOfA = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamageOfB = 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -361,8 +361,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage(); + final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } @@ -385,7 +385,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public IAEItemStack empty() { - IAEItemStack dup = this.copy(); + final IAEItemStack dup = this.copy(); dup.reset(); return dup; } @@ -417,7 +417,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public ItemStack getItemStack() { - ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue ); + final ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue ); if( this.def.tagCompound != null ) { is.setTagCompound( this.def.tagCompound.getNBTTagCompoundCopy() ); @@ -439,13 +439,13 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean sameOre( IAEItemStack is ) + public boolean sameOre( final IAEItemStack is ) { return OreHelper.INSTANCE.sameOre( this, is ); } @Override - public boolean isSameType( IAEItemStack otherStack ) + public boolean isSameType( final IAEItemStack otherStack ) { if( otherStack == null ) { @@ -456,7 +456,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean isSameType( ItemStack otherStack ) + public boolean isSameType( final ItemStack otherStack ) { if( otherStack == null ) { @@ -473,7 +473,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean equals( Object ia ) + public boolean equals( final Object ia ) { if( ia instanceof AEItemStack ) { @@ -482,12 +482,12 @@ public final class AEItemStack extends AEStack implements IAEItemS } else if( ia instanceof ItemStack ) { - ItemStack is = (ItemStack) ia; + final ItemStack is = (ItemStack) ia; if( is.getItem() == this.def.item && is.getItemDamage() == this.def.damageValue ) { - NBTTagCompound ta = this.def.tagCompound; - NBTTagCompound tb = is.getTagCompound(); + final NBTTagCompound ta = this.def.tagCompound; + final NBTTagCompound tb = is.getTagCompound(); if( ta == tb ) { return true; @@ -521,21 +521,21 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public int compareTo( AEItemStack b ) + public int compareTo( final AEItemStack b ) { - int id = this.def.itemID - b.def.itemID; + final int id = this.def.itemID - b.def.itemID; if( id != 0 ) { return id; } - int damageValue = this.def.damageValue - b.def.damageValue; + final int damageValue = this.def.damageValue - b.def.damageValue; if( damageValue != 0 ) { return damageValue; } - int displayDamage = this.def.displayDamage - b.def.displayDamage; + final int displayDamage = this.def.displayDamage - b.def.displayDamage; if( displayDamage != 0 ) { return displayDamage; @@ -544,9 +544,9 @@ public final class AEItemStack extends AEStack implements IAEItemS return ( this.def.tagCompound == b.def.tagCompound ) ? 0 : this.compareNBT( b.def ); } - private int compareNBT( AEItemDef b ) + private int compareNBT( final AEItemDef b ) { - int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) ); + final int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) ); if( nbt == 0 ) { return this.compare( System.identityHashCode( this.def.tagCompound ), System.identityHashCode( b.tagCompound ) ); @@ -554,7 +554,7 @@ public final class AEItemStack extends AEStack implements IAEItemS return nbt; } - private int compare( int l, int m ) + private int compare( final int l, final int m ) { return l < m ? -1 : ( l > m ? 1 : 0 ); } @@ -592,7 +592,7 @@ public final class AEItemStack extends AEStack implements IAEItemS return this.getModName( this.def.uniqueID = GameRegistry.findUniqueIdentifierFor( this.def.item ) ); } - private String getModName( UniqueIdentifier uniqueIdentifier ) + private String getModName( final UniqueIdentifier uniqueIdentifier ) { if( uniqueIdentifier == null ) { @@ -602,10 +602,10 @@ public final class AEItemStack extends AEStack implements IAEItemS return uniqueIdentifier.modId == null ? "** Null" : uniqueIdentifier.modId; } - public IAEItemStack getLow( FuzzyMode fuzzy, boolean ignoreMeta ) + public IAEItemStack getLow( final FuzzyMode fuzzy, final boolean ignoreMeta ) { - AEItemStack bottom = new AEItemStack( this ); - AEItemDef newDef = bottom.def = bottom.def.copy(); + final AEItemStack bottom = new AEItemStack( this ); + final AEItemDef newDef = bottom.def = bottom.def.copy(); if( ignoreMeta ) { @@ -633,7 +633,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); newDef.displayDamage = breakpoint <= this.def.displayDamage ? breakpoint : 0; } @@ -645,10 +645,10 @@ public final class AEItemStack extends AEStack implements IAEItemS return bottom; } - public IAEItemStack getHigh( FuzzyMode fuzzy, boolean ignoreMeta ) + public IAEItemStack getHigh( final FuzzyMode fuzzy, final boolean ignoreMeta ) { - AEItemStack top = new AEItemStack( this ); - AEItemDef newDef = top.def = top.def.copy(); + final AEItemStack top = new AEItemStack( this ); + final AEItemDef newDef = top.def = top.def.copy(); if( ignoreMeta ) { @@ -676,7 +676,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); newDef.displayDamage = this.def.displayDamage < breakpoint ? breakpoint - 1 : this.def.maxDamage + 1; } @@ -694,24 +694,24 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - void writeIdentity( ByteBuf i ) throws IOException + void writeIdentity( final ByteBuf i ) throws IOException { i.writeShort( Item.itemRegistry.getIDForObject( this.def.item ) ); i.writeShort( this.getItemDamage() ); } @Override - void readNBT( ByteBuf i ) throws IOException + void readNBT( final ByteBuf i ) throws IOException { if( this.hasTagCompound() ) { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream data = new DataOutputStream( bytes ); CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data ); - byte[] tagBytes = bytes.toByteArray(); - int size = tagBytes.length; + final byte[] tagBytes = bytes.toByteArray(); + final int size = tagBytes.length; i.writeInt( size ); i.writeBytes( tagBytes ); diff --git a/src/main/java/appeng/util/item/AESharedNBT.java b/src/main/java/appeng/util/item/AESharedNBT.java index 18f07302..838a0291 100644 --- a/src/main/java/appeng/util/item/AESharedNBT.java +++ b/src/main/java/appeng/util/item/AESharedNBT.java @@ -48,13 +48,13 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound private int hash; private IItemComparison comp; - private AESharedNBT( Item itemID, int damageValue ) + private AESharedNBT( final Item itemID, final int damageValue ) { this.item = itemID; this.meta = damageValue; } - public AESharedNBT( int fakeValue ) + public AESharedNBT( final int fakeValue ) { this.item = null; this.meta = 0; @@ -72,14 +72,14 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound /* * Returns an NBT Compound that is used for accelerating comparisons. */ - public static synchronized NBTTagCompound getSharedTagCompound( NBTTagCompound tagCompound, ItemStack s ) + public static synchronized NBTTagCompound getSharedTagCompound( final NBTTagCompound tagCompound, final ItemStack s ) { if( tagCompound.hasNoTags() ) { return null; } - Item item = s.getItem(); + final Item item = s.getItem(); int meta = -1; if( s.getItem() != null && s.isItemStackDamageable() && s.getHasSubtypes() ) { @@ -91,12 +91,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return tagCompound; } - SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound ); + final SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound ); - WeakReference c = SHARED_TAG_COMPOUND.get( sso ); + final WeakReference c = SHARED_TAG_COMPOUND.get( sso ); if( c != null ) { - SharedSearchObject cg = c.get(); + final SharedSearchObject cg = c.get(); if( cg != null ) { return cg.shared; // I don't think I really need to check this @@ -104,7 +104,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound // as its already certain to exist.. } - AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound ); + final AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound ); sso.compound = (NBTTagCompound) sso.compound.copy(); // prevent // modification // of data based @@ -120,25 +120,25 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound /* * returns true if the compound is part of the shared compound system ( and can thus be compared directly ). */ - public static boolean isShared( NBTTagCompound ta ) + public static boolean isShared( final NBTTagCompound ta ) { return ta instanceof AESharedNBT; } - public static AESharedNBT createFromCompound( Item itemID, int damageValue, NBTTagCompound c ) + public static AESharedNBT createFromCompound( final Item itemID, final int damageValue, final NBTTagCompound c ) { - AESharedNBT x = new AESharedNBT( itemID, damageValue ); + final AESharedNBT x = new AESharedNBT( itemID, damageValue ); // c.getTags() - for( Object o : c.func_150296_c() ) + for( final Object o : c.func_150296_c() ) { - String name = (String) o; + final String name = (String) o; x.setTag( name, c.getTag( name ).copy() ); } x.hash = Platform.NBTOrderlessHash( c ); - ItemStack isc = new ItemStack( itemID, 1, damageValue ); + final ItemStack isc = new ItemStack( itemID, 1, damageValue ); isc.setTagCompound( c ); x.comp = AEApi.instance().registries().specialComparison().getSpecialComparison( isc ); @@ -163,7 +163,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound } @Override - public boolean equals( Object par1Obj ) + public boolean equals( final Object par1Obj ) { if( par1Obj instanceof AESharedNBT ) { @@ -172,12 +172,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return super.equals( par1Obj ); } - public boolean matches( Item item, int meta, int orderlessHash ) + public boolean matches( final Item item, final int meta, final int orderlessHash ) { return item == this.item && this.meta == meta && this.hash == orderlessHash; } - public boolean comparePreciseWithRegistry( AESharedNBT tagCompound ) + public boolean comparePreciseWithRegistry( final AESharedNBT tagCompound ) { if( this == tagCompound ) { @@ -192,7 +192,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return false; } - public boolean compareFuzzyWithRegistry( AESharedNBT tagCompound ) + public boolean compareFuzzyWithRegistry( final AESharedNBT tagCompound ) { if( this == tagCompound ) { diff --git a/src/main/java/appeng/util/item/AEStack.java b/src/main/java/appeng/util/item/AEStack.java index 24ee614c..e357ba4b 100644 --- a/src/main/java/appeng/util/item/AEStack.java +++ b/src/main/java/appeng/util/item/AEStack.java @@ -33,7 +33,7 @@ public abstract class AEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack private final Map records = new HashMap(); @Override - public void add( IAEFluidStack option ) + public void add( final IAEFluidStack option ) { if( option == null ) { @@ -57,7 +57,7 @@ public final class FluidList implements IItemList } @Override - public IAEFluidStack findPrecise( IAEFluidStack fluidStack ) + public IAEFluidStack findPrecise( final IAEFluidStack fluidStack ) { if( fluidStack == null ) { @@ -68,7 +68,7 @@ public final class FluidList implements IItemList } @Override - public Collection findFuzzy( IAEFluidStack filter, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEFluidStack filter, final FuzzyMode fuzzy ) { if( filter == null ) { @@ -85,7 +85,7 @@ public final class FluidList implements IItemList } @Override - public void addStorage( IAEFluidStack option ) + public void addStorage( final IAEFluidStack option ) { if( option == null ) { @@ -111,7 +111,7 @@ public final class FluidList implements IItemList */ @Override - public void addCrafting( IAEFluidStack option ) + public void addCrafting( final IAEFluidStack option ) { if( option == null ) { @@ -134,7 +134,7 @@ public final class FluidList implements IItemList } @Override - public void addRequestable( IAEFluidStack option ) + public void addRequestable( final IAEFluidStack option ) { if( option == null ) { @@ -160,7 +160,7 @@ public final class FluidList implements IItemList @Override public IAEFluidStack getFirstItem() { - for( IAEFluidStack stackType : this ) + for( final IAEFluidStack stackType : this ) { return stackType; } @@ -183,18 +183,18 @@ public final class FluidList implements IItemList @Override public void resetStatus() { - for( IAEFluidStack i : this ) + for( final IAEFluidStack i : this ) { i.reset(); } } - private IAEFluidStack getFluidRecord( IAEFluidStack fluid ) + private IAEFluidStack getFluidRecord( final IAEFluidStack fluid ) { return this.records.get( fluid ); } - private IAEFluidStack putFluidRecord( IAEFluidStack fluid ) + private IAEFluidStack putFluidRecord( final IAEFluidStack fluid ) { return this.records.put( fluid, fluid ); } diff --git a/src/main/java/appeng/util/item/ItemList.java b/src/main/java/appeng/util/item/ItemList.java index 8cea8554..6e8585c4 100644 --- a/src/main/java/appeng/util/item/ItemList.java +++ b/src/main/java/appeng/util/item/ItemList.java @@ -42,7 +42,7 @@ public final class ItemList implements IItemList private final Map> records = new IdentityHashMap>(); @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { if( option == null ) { @@ -63,7 +63,7 @@ public final class ItemList implements IItemList } @Override - public IAEItemStack findPrecise( IAEItemStack itemStack ) + public IAEItemStack findPrecise( final IAEItemStack itemStack ) { if( itemStack == null ) { @@ -74,7 +74,7 @@ public final class ItemList implements IItemList } @Override - public Collection findFuzzy( IAEItemStack filter, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEItemStack filter, final FuzzyMode fuzzy ) { if( filter == null ) { @@ -97,7 +97,7 @@ public final class ItemList implements IItemList { final Collection output = new LinkedList(); - for( IAEItemStack is : or.getAEEquivalents() ) + for( final IAEItemStack is : or.getAEEquivalents() ) { output.addAll( this.findFuzzyDamage( (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) ); } @@ -116,7 +116,7 @@ public final class ItemList implements IItemList } @Override - public void addStorage( IAEItemStack option ) + public void addStorage( final IAEItemStack option ) { if( option == null ) { @@ -142,7 +142,7 @@ public final class ItemList implements IItemList */ @Override - public void addCrafting( IAEItemStack option ) + public void addCrafting( final IAEItemStack option ) { if( option == null ) { @@ -165,7 +165,7 @@ public final class ItemList implements IItemList } @Override - public void addRequestable( IAEItemStack option ) + public void addRequestable( final IAEItemStack option ) { if( option == null ) { @@ -191,7 +191,7 @@ public final class ItemList implements IItemList @Override public IAEItemStack getFirstItem() { - for( IAEItemStack stackType : this ) + for( final IAEItemStack stackType : this ) { return stackType; } @@ -204,7 +204,7 @@ public final class ItemList implements IItemList { int size = 0; - for( Map element : this.records.values() ) + for( final Map element : this.records.values() ) { size += element.size(); } @@ -221,13 +221,13 @@ public final class ItemList implements IItemList @Override public void resetStatus() { - for( IAEItemStack i : this ) + for( final IAEItemStack i : this ) { i.reset(); } } - private NavigableMap getItemRecord( Item item ) + private NavigableMap getItemRecord( final Item item ) { NavigableMap itemRecords = this.records.get( item ); @@ -240,12 +240,12 @@ public final class ItemList implements IItemList return itemRecords; } - private IAEItemStack putItemRecord( IAEItemStack itemStack ) + private IAEItemStack putItemRecord( final IAEItemStack itemStack ) { return this.getItemRecord( itemStack.getItem() ).put( itemStack, itemStack ); } - private Collection findFuzzyDamage( AEItemStack filter, FuzzyMode fuzzy, boolean ignoreMeta ) + private Collection findFuzzyDamage( final AEItemStack filter, final FuzzyMode fuzzy, final boolean ignoreMeta ) { final IAEItemStack low = filter.getLow( fuzzy, ignoreMeta ); final IAEItemStack high = filter.getHigh( fuzzy, ignoreMeta ); diff --git a/src/main/java/appeng/util/item/ItemModList.java b/src/main/java/appeng/util/item/ItemModList.java index 0a850f6f..66e0be9f 100644 --- a/src/main/java/appeng/util/item/ItemModList.java +++ b/src/main/java/appeng/util/item/ItemModList.java @@ -33,13 +33,13 @@ public class ItemModList implements IItemContainer final IItemContainer backingStore; final IItemContainer overrides = AEApi.instance().storage().createItemList(); - public ItemModList( IItemContainer backend ) + public ItemModList( final IItemContainer backend ) { this.backingStore = backend; } @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { IAEItemStack over = this.overrides.findPrecise( option ); if( over == null ) @@ -62,9 +62,9 @@ public class ItemModList implements IItemContainer } @Override - public IAEItemStack findPrecise( IAEItemStack i ) + public IAEItemStack findPrecise( final IAEItemStack i ) { - IAEItemStack over = this.overrides.findPrecise( i ); + final IAEItemStack over = this.overrides.findPrecise( i ); if( over == null ) { return this.backingStore.findPrecise( i ); @@ -73,7 +73,7 @@ public class ItemModList implements IItemContainer } @Override - public Collection findFuzzy( IAEItemStack input, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEItemStack input, final FuzzyMode fuzzy ) { return this.overrides.findFuzzy( input, fuzzy ); } diff --git a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java index c65ec676..768fdbb4 100644 --- a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java @@ -31,7 +31,7 @@ public class MeaningfulFluidIterator implements Iterator private final Iterator parent; private T next; - public MeaningfulFluidIterator( Iterator iterator ) + public MeaningfulFluidIterator( final Iterator iterator ) { this.parent = iterator; } diff --git a/src/main/java/appeng/util/item/MeaningfulItemIterator.java b/src/main/java/appeng/util/item/MeaningfulItemIterator.java index 2becf838..94d389cb 100644 --- a/src/main/java/appeng/util/item/MeaningfulItemIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulItemIterator.java @@ -33,7 +33,7 @@ public class MeaningfulItemIterator implements Iterator< private Iterator innerIterater = null; private T next; - public MeaningfulItemIterator( Iterator> iterator ) + public MeaningfulItemIterator( final Iterator> iterator ) { this.parent = iterator; diff --git a/src/main/java/appeng/util/item/OreHelper.java b/src/main/java/appeng/util/item/OreHelper.java index d949094b..165e70d5 100644 --- a/src/main/java/appeng/util/item/OreHelper.java +++ b/src/main/java/appeng/util/item/OreHelper.java @@ -48,7 +48,7 @@ public class OreHelper private final LoadingCache> oreDictCache = CacheBuilder.newBuilder().build( new CacheLoader>() { @Override - public List load( String oreName ) + public List load( final String oreName ) { return OreDictionary.getOres( oreName ); } @@ -63,9 +63,9 @@ public class OreHelper * * @return true if an ore entry exists, false otherwise */ - public OreReference isOre( ItemStack itemStack ) + public OreReference isOre( final ItemStack itemStack ) { - ItemRef ir = new ItemRef( itemStack ); + final ItemRef ir = new ItemRef( itemStack ); if( !this.references.containsKey( ir ) ) { @@ -73,9 +73,9 @@ public class OreHelper final Collection ores = ref.getOres(); final Collection set = ref.getEquivalents(); - Set toAdd = new HashSet(); + final Set toAdd = new HashSet(); - for( String ore : OreDictionary.getOreNames() ) + for( final String ore : OreDictionary.getOreNames() ) { // skip ore if it is a match already or null. if( ore == null || toAdd.contains( ore ) ) @@ -83,7 +83,7 @@ public class OreHelper continue; } - for( ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) ) + for( final ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) ) { if( OreDictionary.itemMatches( oreItem, itemStack, false ) ) { @@ -93,7 +93,7 @@ public class OreHelper } } - for( String ore : toAdd ) + for( final String ore : toAdd ) { set.add( ore ); ores.add( OreDictionary.getOreID( ore ) ); @@ -112,15 +112,15 @@ public class OreHelper return this.references.get( ir ); } - public boolean sameOre( AEItemStack aeItemStack, IAEItemStack is ) + public boolean sameOre( final AEItemStack aeItemStack, final IAEItemStack is ) { - OreReference a = aeItemStack.def.isOre; - OreReference b = aeItemStack.def.isOre; + final OreReference a = aeItemStack.def.isOre; + final OreReference b = aeItemStack.def.isOre; return this.sameOre( a, b ); } - public boolean sameOre( OreReference a, OreReference b ) + public boolean sameOre( final OreReference a, final OreReference b ) { if( a == null || b == null ) { @@ -132,8 +132,8 @@ public class OreHelper return true; } - Collection bOres = b.getOres(); - for( Integer ore : a.getOres() ) + final Collection bOres = b.getOres(); + for( final Integer ore : a.getOres() ) { if( bOres.contains( ore ) ) { @@ -144,17 +144,17 @@ public class OreHelper return false; } - public boolean sameOre( AEItemStack aeItemStack, ItemStack o ) + public boolean sameOre( final AEItemStack aeItemStack, final ItemStack o ) { - OreReference a = aeItemStack.def.isOre; + final OreReference a = aeItemStack.def.isOre; if( a == null ) { return false; } - for( String oreName : a.getEquivalents() ) + for( final String oreName : a.getEquivalents() ) { - for( ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) ) + for( final ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) ) { if( OreDictionary.itemMatches( oreItem, o, false ) ) { @@ -166,7 +166,7 @@ public class OreHelper return false; } - public List getCachedOres( String oreName ) + public List getCachedOres( final String oreName ) { return this.oreDictCache.getUnchecked( oreName ); } @@ -178,7 +178,7 @@ public class OreHelper private final int damage; private final int hash; - ItemRef( ItemStack stack ) + ItemRef( final ItemStack stack ) { this.ref = stack.getItem(); @@ -201,7 +201,7 @@ public class OreHelper } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -211,7 +211,7 @@ public class OreHelper { return false; } - ItemRef other = (ItemRef) obj; + final ItemRef other = (ItemRef) obj; return this.damage == other.damage && this.ref == other.ref; } diff --git a/src/main/java/appeng/util/item/OreReference.java b/src/main/java/appeng/util/item/OreReference.java index d7c64372..d12464b3 100644 --- a/src/main/java/appeng/util/item/OreReference.java +++ b/src/main/java/appeng/util/item/OreReference.java @@ -50,9 +50,9 @@ public class OreReference this.aeOtherOptions = new ArrayList( this.otherOptions.size() ); // SUMMON AE STACKS! - for( String oreName : this.otherOptions ) + for( final String oreName : this.otherOptions ) { - for( ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) ) + for( final ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) ) { if( is.getItem() != null ) { diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index 2926e3de..8bba4fa3 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -33,7 +33,7 @@ public class SharedSearchObject public AESharedNBT shared; NBTTagCompound compound; - public SharedSearchObject( Item itemID, int damageValue, NBTTagCompound tagCompound ) + public SharedSearchObject( final Item itemID, final int damageValue, final NBTTagCompound tagCompound ) { this.def = ( damageValue << Platform.DEF_OFFSET ) | Item.itemRegistry.getIDForObject( itemID ); this.hash = Platform.NBTOrderlessHash( tagCompound ); @@ -47,7 +47,7 @@ public class SharedSearchObject } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -57,7 +57,7 @@ public class SharedSearchObject { return false; } - SharedSearchObject other = (SharedSearchObject) obj; + final SharedSearchObject other = (SharedSearchObject) obj; if( this.def == other.def && this.hash == other.hash ) { return Platform.NBTEqualityTest( this.compound, other.compound ); diff --git a/src/main/java/appeng/util/iterators/AEInvIterator.java b/src/main/java/appeng/util/iterators/AEInvIterator.java index b39f1bd0..796d43e3 100644 --- a/src/main/java/appeng/util/iterators/AEInvIterator.java +++ b/src/main/java/appeng/util/iterators/AEInvIterator.java @@ -32,7 +32,7 @@ public final class AEInvIterator implements Iterator private int counter = 0; - public AEInvIterator( AppEngInternalAEInventory inventory ) + public AEInvIterator( final AppEngInternalAEInventory inventory ) { this.inventory = inventory; this.size = this.inventory.getSizeInventory(); diff --git a/src/main/java/appeng/util/iterators/ChainedIterator.java b/src/main/java/appeng/util/iterators/ChainedIterator.java index 6134d1f1..93f3769f 100644 --- a/src/main/java/appeng/util/iterators/ChainedIterator.java +++ b/src/main/java/appeng/util/iterators/ChainedIterator.java @@ -28,7 +28,7 @@ public final class ChainedIterator implements Iterator private int offset = 0; - public ChainedIterator( T... list ) + public ChainedIterator( final T... list ) { this.list = list; } @@ -42,7 +42,7 @@ public final class ChainedIterator implements Iterator @Override public T next() { - T result = this.list[this.offset]; + final T result = this.list[this.offset]; this.offset++; return result; } diff --git a/src/main/java/appeng/util/iterators/InvIterator.java b/src/main/java/appeng/util/iterators/InvIterator.java index 92eb8a17..7ee8b63f 100644 --- a/src/main/java/appeng/util/iterators/InvIterator.java +++ b/src/main/java/appeng/util/iterators/InvIterator.java @@ -32,7 +32,7 @@ public final class InvIterator implements Iterator private int counter = 0; - public InvIterator( IInventory inventory ) + public InvIterator( final IInventory inventory ) { this.inventory = inventory; this.size = this.inventory.getSizeInventory(); @@ -47,7 +47,7 @@ public final class InvIterator implements Iterator @Override public ItemStack next() { - ItemStack result = this.inventory.getStackInSlot( this.counter ); + final ItemStack result = this.inventory.getStackInSlot( this.counter ); this.counter++; return result; diff --git a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java index 559ea344..d61ec5e2 100644 --- a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java +++ b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java @@ -31,7 +31,7 @@ public final class ProxyNodeIterator implements Iterator { private final Iterator hosts; - public ProxyNodeIterator( Iterator hosts ) + public ProxyNodeIterator( final Iterator hosts ) { this.hosts = hosts; } @@ -45,7 +45,7 @@ public final class ProxyNodeIterator implements Iterator @Override public IGridNode next() { - IGridHost host = this.hosts.next(); + final IGridHost host = this.hosts.next(); return host.getGridNode( ForgeDirection.UNKNOWN ); } diff --git a/src/main/java/appeng/util/iterators/StackToSlotIterator.java b/src/main/java/appeng/util/iterators/StackToSlotIterator.java index 397e483c..50726226 100644 --- a/src/main/java/appeng/util/iterators/StackToSlotIterator.java +++ b/src/main/java/appeng/util/iterators/StackToSlotIterator.java @@ -33,7 +33,7 @@ public class StackToSlotIterator implements Iterator final Iterator is; int x = 0; - public StackToSlotIterator( Iterator is ) + public StackToSlotIterator( final Iterator is ) { this.is = is; } diff --git a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java index 4953d690..bde03441 100644 --- a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java @@ -31,7 +31,7 @@ public class DefaultPriorityList> implements IPartitionLis static final List NULL_LIST = new ArrayList(); @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { return false; } diff --git a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java index bdcd3e9d..9d2d3c47 100644 --- a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java @@ -32,16 +32,16 @@ public class FuzzyPriorityList> implements IPartitionList< final IItemList list; final FuzzyMode mode; - public FuzzyPriorityList( IItemList in, FuzzyMode mode ) + public FuzzyPriorityList( final IItemList in, final FuzzyMode mode ) { this.list = in; this.mode = mode; } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { - Collection out = this.list.findFuzzy( input, this.mode ); + final Collection out = this.list.findFuzzy( input, this.mode ); return out != null && !out.isEmpty(); } diff --git a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java index 4eb746f2..b4baa07e 100644 --- a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java @@ -31,7 +31,7 @@ public final class MergedPriorityList> implements IPartiti private final Collection> positive = new ArrayList>(); private final Collection> negative = new ArrayList>(); - public void addNewList( IPartitionList list, boolean isWhitelist ) + public void addNewList( final IPartitionList list, final boolean isWhitelist ) { if( isWhitelist ) { @@ -44,9 +44,9 @@ public final class MergedPriorityList> implements IPartiti } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { - for( IPartitionList l : this.negative ) + for( final IPartitionList l : this.negative ) { if( l.isListed( input ) ) { @@ -56,7 +56,7 @@ public final class MergedPriorityList> implements IPartiti if( !this.positive.isEmpty() ) { - for( IPartitionList l : this.positive ) + for( final IPartitionList l : this.positive ) { if( l.isListed( input ) ) { diff --git a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java index c34ff151..c4390186 100644 --- a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java +++ b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java @@ -28,13 +28,13 @@ public class PrecisePriorityList> implements IPartitionLis final IItemList list; - public PrecisePriorityList( IItemList in ) + public PrecisePriorityList( final IItemList in ) { this.list = in; } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { return this.list.findPrecise( input ) != null; } diff --git a/src/main/java/appeng/worldgen/MeteoritePlacer.java b/src/main/java/appeng/worldgen/MeteoritePlacer.java index a47283e6..2adeb743 100644 --- a/src/main/java/appeng/worldgen/MeteoritePlacer.java +++ b/src/main/java/appeng/worldgen/MeteoritePlacer.java @@ -92,7 +92,7 @@ public final class MeteoritePlacer this.validSpawn.add( Blocks.snow ); this.validSpawn.add( Blocks.stained_hardened_clay ); - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.invalidSpawn.add( skyStoneBlock ); } @@ -109,20 +109,20 @@ public final class MeteoritePlacer this.type = new Fallout( this.putter, this.skyStoneDefinition ); } - public boolean spawnMeteorite( IMeteoriteWorld w, NBTTagCompound meteoriteBlob ) + public boolean spawnMeteorite( final IMeteoriteWorld w, final NBTTagCompound meteoriteBlob ) { this.settings = meteoriteBlob; - int x = this.settings.getInteger( "x" ); - int y = this.settings.getInteger( "y" ); - int z = this.settings.getInteger( "z" ); + final int x = this.settings.getInteger( "x" ); + final int y = this.settings.getInteger( "y" ); + final int z = this.settings.getInteger( "z" ); this.meteoriteSize = this.settings.getDouble( "real_sizeOfMeteorite" ); this.realCrater = this.settings.getDouble( "realCrater" ); this.squaredMeteoriteSize = this.settings.getDouble( "sizeOfMeteorite" ); this.crater = this.settings.getDouble( "crater" ); - Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) ); + final Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) ); if( blk == Blocks.sand ) { @@ -137,7 +137,7 @@ public final class MeteoritePlacer this.type = new FalloutSnow( w, x, y, z, this.putter, this.skyStoneDefinition ); } - int skyMode = this.settings.getInteger( "skyMode" ); + final int skyMode = this.settings.getInteger( "skyMode" ); // creator if( skyMode > 10 ) @@ -157,15 +157,15 @@ public final class MeteoritePlacer return true; } - private void placeCrater( IMeteoriteWorld w, int x, int y, int z ) + private void placeCrater( final IMeteoriteWorld w, final int x, final int y, final int z ) { - boolean lava = this.settings.getBoolean( "lava" ); + final boolean lava = this.settings.getBoolean( "lava" ); - int maxY = 255; - int minX = w.minX( x - 200 ); - int maxX = w.maxX( x + 200 ); - int minZ = w.minZ( z - 200 ); - int maxZ = w.maxZ( z + 200 ); + final int maxY = 255; + final int minX = w.minX( x - 200 ); + final int maxX = w.maxX( x + 200 ); + final int minZ = w.minZ( z - 200 ); + final int maxZ = w.maxZ( z + 200 ); for( int j = y - 5; j < maxY; j++ ) { @@ -175,11 +175,11 @@ public final class MeteoritePlacer { for( int k = minZ; k < maxZ; k++ ) { - double dx = i - x; - double dz = k - z; - double h = y - this.meteoriteSize + 1 + this.type.adjustCrater(); + final double dx = i - x; + final double dz = k - z; + final double h = y - this.meteoriteSize + 1 + this.type.adjustCrater(); - double distanceFrom = dx * dx + dz * dz; + final double distanceFrom = dx * dx + dz * dz; if( j > h + distanceFrom * 0.02 ) { @@ -199,19 +199,19 @@ public final class MeteoritePlacer } } - for( Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) ) + for( final Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) ) { - Entity e = (Entity) o; + final Entity e = (Entity) o; e.setDead(); } } - private void placeMeteorite( IMeteoriteWorld w, int x, int y, int z ) + private void placeMeteorite( final IMeteoriteWorld w, final int x, final int y, final int z ) { - int meteorXLength = w.minX( x - 8 ); - int meteorXHeight = w.maxX( x + 8 ); - int meteorZLength = w.minZ( z - 8 ); - int meteorZHeight = w.maxZ( z + 8 ); + final int meteorXLength = w.minX( x - 8 ); + final int meteorXHeight = w.maxX( x + 8 ); + final int meteorZLength = w.minZ( z - 8 ); + final int meteorZHeight = w.maxZ( z + 8 ); // spawn meteor for( int i = meteorXLength; i < meteorXHeight; i++ ) @@ -220,13 +220,13 @@ public final class MeteoritePlacer { for( int k = meteorZLength; k < meteorZHeight; k++ ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; if( dx * dx * 0.7 + dy * dy * ( j > y ? 1.4 : 0.8 ) + dz * dz * 0.7 < this.squaredMeteoriteSize ) { - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.putter.put( w, i, j, k, skyStoneBlock ); } @@ -237,15 +237,15 @@ public final class MeteoritePlacer if( AEConfig.instance.isFeatureEnabled( AEFeature.SpawnPressesInMeteorites ) ) { - for( Block skyChestBlock : this.skyChestDefinition.maybeBlock().asSet() ) + for( final Block skyChestBlock : this.skyChestDefinition.maybeBlock().asSet() ) { this.putter.put( w, x, y, z, skyChestBlock ); } - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( te instanceof IInventory ) { - InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, ForgeDirection.UP ); + final InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, ForgeDirection.UP ); int primary = Math.max( 1, (int) ( Math.random() * 4 ) ); @@ -278,25 +278,25 @@ public final class MeteoritePlacer switch( r % 4 ) { case 0: - for( ItemStack calc : materials.calcProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.calcProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 1: - for( ItemStack calc : materials.engProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.engProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 2: - for( ItemStack calc : materials.logicProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.logicProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 3: - for( ItemStack calc : materials.siliconPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.siliconPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } @@ -319,20 +319,20 @@ public final class MeteoritePlacer while( duplicate ); } - int secondary = Math.max( 1, (int) ( Math.random() * 3 ) ); + final int secondary = Math.max( 1, (int) ( Math.random() * 3 ) ); for( int zz = 0; zz < secondary; zz++ ) { switch( (int) ( Math.random() * 1000 ) % 3 ) { case 0: final int amount = (int) ( ( Math.random() * SKYSTONE_SPAWN_LIMIT ) + 1 ); - for( ItemStack skyStoneStack : this.skyStoneDefinition.maybeStack( amount ).asSet() ) + for( final ItemStack skyStoneStack : this.skyStoneDefinition.maybeStack( amount ).asSet() ) { ap.addItems( skyStoneStack ); } break; case 1: - List possibles = new LinkedList(); + final List possibles = new LinkedList(); possibles.addAll( OreDictionary.getOres( "nuggetIron" ) ); possibles.addAll( OreDictionary.getOres( "nuggetCopper" ) ); possibles.addAll( OreDictionary.getOres( "nuggetTin" ) ); @@ -358,14 +358,14 @@ public final class MeteoritePlacer } } - private void decay( IMeteoriteWorld w, int x, int y, int z ) + private void decay( final IMeteoriteWorld w, final int x, final int y, final int z ) { double randomShit = 0; - int meteorXLength = w.minX( x - 30 ); - int meteorXHeight = w.maxX( x + 30 ); - int meteorZLength = w.minZ( z - 30 ); - int meteorZHeight = w.maxZ( z + 30 ); + final int meteorXLength = w.minX( x - 30 ); + final int meteorXHeight = w.maxX( x + 30 ); + final int meteorZLength = w.minZ( z - 30 ); + final int meteorZHeight = w.maxZ( z + 30 ); for( int i = meteorXLength; i < meteorXHeight; i++ ) { @@ -382,27 +382,27 @@ public final class MeteoritePlacer if( blk.isReplaceable( w.getWorld(), i, j, k ) ) { blk = Platform.AIR_BLOCK; - Block blk_b = w.getBlock( i, j + 1, k ); + final Block blk_b = w.getBlock( i, j + 1, k ); if( blk_b != blk ) { - int meta_b = w.getBlockMetadata( i, j + 1, k ); + final int meta_b = w.getBlockMetadata( i, j + 1, k ); w.setBlock( i, j, k, blk_b, meta_b, 3 ); w.setBlock( i, j + 1, k, blk ); } else if( randomShit < 100 * this.crater ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; - double dist = dx * dx + dy * dy + dz * dz; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; + final double dist = dx * dx + dy * dy + dz * dz; - Block xf = w.getBlock( i, j - 1, k ); + final Block xf = w.getBlock( i, j - 1, k ); if( !xf.isReplaceable( w.getWorld(), i, j - 1, k ) ) { - double extraRange = Math.random() * 0.6; - double height = this.crater * ( extraRange + 0.2 ) - Math.abs( dist - this.crater * 1.7 ); + final double extraRange = Math.random() * 0.6; + final double height = this.crater * ( extraRange + 0.2 ) - Math.abs( dist - this.crater * 1.7 ); if( xf != blk && height > 0 && Math.random() > 0.6 ) { @@ -415,14 +415,14 @@ public final class MeteoritePlacer else { // decay. - Block blk_b = w.getBlock( i, j + 1, k ); + final Block blk_b = w.getBlock( i, j + 1, k ); if( blk_b == Platform.AIR_BLOCK ) { if( Math.random() > 0.4 ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; if( dx * dx + dy * dy + dz * dz < this.crater * 1.6 ) { @@ -436,15 +436,15 @@ public final class MeteoritePlacer } } - public double getSqDistance( int x, int z ) + public double getSqDistance( final int x, final int z ) { - int chunkX = this.settings.getInteger( "x" ) - x; - int chunkZ = this.settings.getInteger( "z" ) - z; + final int chunkX = this.settings.getInteger( "x" ) - x; + final int chunkZ = this.settings.getInteger( "z" ) - z; return chunkX * chunkX + chunkZ * chunkZ; } - public boolean spawnMeteorite( IMeteoriteWorld w, int x, int y, int z ) + public boolean spawnMeteorite( final IMeteoriteWorld w, final int x, final int y, final int z ) { if( !w.hasNoSky() ) @@ -521,7 +521,7 @@ public final class MeteoritePlacer } } - int minBLocks = 200; + final int minBLocks = 200; if( validBlocks > minBLocks && realValidBlocks > 80 ) { // we can spawn here! diff --git a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java index c852a484..ec2e0d6a 100644 --- a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java +++ b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java @@ -40,17 +40,17 @@ import appeng.worldgen.meteorite.ChunkOnly; public final class MeteoriteWorldGen implements IWorldGenerator { @Override - public void generate( Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider ) + public void generate( final Random r, final int chunkX, final int chunkZ, final World w, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider ) { if( WorldGenRegistry.INSTANCE.isWorldGenEnabled( WorldGenType.Meteorites, w ) ) { // add new meteorites? if( r.nextFloat() < AEConfig.instance.meteoriteSpawnChance ) { - int x = r.nextInt( 16 ) + ( chunkX << 4 ); - int z = r.nextInt( 16 ) + ( chunkZ << 4 ); + final int x = r.nextInt( 16 ) + ( chunkX << 4 ); + final int z = r.nextInt( 16 ) + ( chunkZ << 4 ); - int depth = 180 + r.nextInt( 20 ); + final int depth = 180 + r.nextInt( 20 ); TickHandler.INSTANCE.addCallable( w, new MeteoriteSpawn( x, depth, z ) ); } else @@ -64,16 +64,16 @@ public final class MeteoriteWorldGen implements IWorldGenerator } } - private boolean tryMeteorite( World w, int depth, int x, int z ) + private boolean tryMeteorite( final World w, int depth, final int x, final int z ) { for( int tries = 0; tries < 20; tries++ ) { - MeteoritePlacer mp = new MeteoritePlacer(); + final MeteoritePlacer mp = new MeteoritePlacer(); if( mp.spawnMeteorite( new ChunkOnly( w, x >> 4, z >> 4 ), x, depth, z ) ) { - int px = x >> 4; - int pz = z >> 4; + final int px = x >> 4; + final int pz = z >> 4; for( int cx = px - 6; cx < px + 6; cx++ ) { @@ -88,7 +88,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator if( WorldData.instance().spawnData().hasGenerated( w.provider.dimensionId, cx, cz ) ) { - MeteoritePlacer mp2 = new MeteoritePlacer(); + final MeteoritePlacer mp2 = new MeteoritePlacer(); mp2.spawnMeteorite( new ChunkOnly( w, cx, cz ), mp.getSettings() ); } } @@ -108,7 +108,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator return false; } - private Iterable getNearByMeteorites( World w, int chunkX, int chunkZ ) + private Iterable getNearByMeteorites( final World w, final int chunkX, final int chunkZ ) { return WorldData.instance().spawnData().getNearByMeteorites( w.provider.dimensionId, chunkX, chunkZ ); } @@ -120,7 +120,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator final int z; final int depth; - public MeteoriteSpawn( int x, int depth, int z ) + public MeteoriteSpawn( final int x, final int depth, final int z ) { this.x = x; this.z = z; @@ -128,23 +128,23 @@ public final class MeteoriteWorldGen implements IWorldGenerator } @Override - public Object call( World world ) throws Exception + public Object call( final World world ) throws Exception { - int chunkX = this.x >> 4; - int chunkZ = this.z >> 4; + final int chunkX = this.x >> 4; + final int chunkZ = this.z >> 4; double minSqDist = Double.MAX_VALUE; // near by meteorites! - for( NBTTagCompound data : MeteoriteWorldGen.this.getNearByMeteorites( world, chunkX, chunkZ ) ) + for( final NBTTagCompound data : MeteoriteWorldGen.this.getNearByMeteorites( world, chunkX, chunkZ ) ) { - MeteoritePlacer mp = new MeteoritePlacer(); + final MeteoritePlacer mp = new MeteoritePlacer(); mp.spawnMeteorite( new ChunkOnly( world, chunkX, chunkZ ), data ); minSqDist = Math.min( minSqDist, mp.getSqDistance( this.x, this.z ) ); } - boolean isCluster = ( minSqDist < 30 * 30 ) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance; + final boolean isCluster = ( minSqDist < 30 * 30 ) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance; if( minSqDist > AEConfig.instance.minMeteoriteDistanceSq || isCluster ) { diff --git a/src/main/java/appeng/worldgen/QuartzWorldGen.java b/src/main/java/appeng/worldgen/QuartzWorldGen.java index d8393d46..dc32f146 100644 --- a/src/main/java/appeng/worldgen/QuartzWorldGen.java +++ b/src/main/java/appeng/worldgen/QuartzWorldGen.java @@ -56,14 +56,14 @@ public final class QuartzWorldGen implements IWorldGenerator } @Override - public void generate( Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider ) + public void generate( final Random r, final int chunkX, final int chunkZ, final World w, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider ) { int seaLevel = w.provider.getAverageGroundLevel() + 1; if( seaLevel < 20 ) { - int x = ( chunkX << 4 ) + 8; - int z = ( chunkZ << 4 ) + 8; + final int x = ( chunkX << 4 ) + 8; + final int z = ( chunkZ << 4 ) + 8; seaLevel = w.getHeightValue( x, z ); } @@ -72,19 +72,19 @@ public final class QuartzWorldGen implements IWorldGenerator return; } - double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; - int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier ); + final double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; + final int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier ); for( int x = 0; x < ( r.nextBoolean() ? scale * 2 : scale ) / 2; ++x ) { - boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; - WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; + final boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; + final WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; 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 cz = chunkZ * 16 + r.nextInt( 22 ); + final int cx = chunkX * 16 + r.nextInt( 22 ); + final int cy = r.nextInt( 40 * seaLevel / 64 ) + r.nextInt( 22 * seaLevel / 64 ) + 12 * seaLevel / 64; + final int cz = chunkZ * 16 + r.nextInt( 22 ); whichOre.generate( w, r, cx, cy, cz ); } } diff --git a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java index e783d74e..695f8705 100644 --- a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java +++ b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java @@ -17,7 +17,7 @@ public class ChunkOnly extends StandardWorld final int cz; int verticalBits = 0; - public ChunkOnly( World w, int cx, int cz ) + public ChunkOnly( final World w, final int cx, final int cz ) { super( w ); this.target = w.getChunkFromChunkCoords( cx, cz ); @@ -26,31 +26,31 @@ public class ChunkOnly extends StandardWorld } @Override - public int minX( int in ) + public int minX( final int in ) { return Math.max( in, this.cx << 4 ); } @Override - public int minZ( int in ) + public int minZ( final int in ) { return Math.max( in, this.cz << 4 ); } @Override - public int maxX( int in ) + public int maxX( final int in ) { return Math.min( in, ( this.cx + 1 ) << 4 ); } @Override - public int maxZ( int in ) + public int maxZ( final int in ) { return Math.min( in, ( this.cz + 1 ) << 4 ); } @Override - public int getBlockMetadata( int x, int y, int z ) + public int getBlockMetadata( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -60,7 +60,7 @@ public class ChunkOnly extends StandardWorld } @Override - public Block getBlock( int x, int y, int z ) + public Block getBlock( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -70,7 +70,7 @@ public class ChunkOnly extends StandardWorld } @Override - public void setBlock( int x, int y, int z, Block blk ) + public void setBlock( final int x, final int y, final int z, final Block blk ) { if( this.range( x, y, z ) ) { @@ -80,7 +80,7 @@ public class ChunkOnly extends StandardWorld } @Override - public void setBlock( int x, int y, int z, Block block, int meta, int flags ) + public void setBlock( final int x, final int y, final int z, final Block block, final int meta, final int flags ) { if( this.range( x, y, z ) ) { @@ -99,7 +99,7 @@ public class ChunkOnly extends StandardWorld } @Override - public boolean range( int x, int y, int z ) + public boolean range( final int x, final int y, final int z ) { return this.cx == ( x >> 4 ) && this.cz == ( z >> 4 ); } diff --git a/src/main/java/appeng/worldgen/meteorite/Fallout.java b/src/main/java/appeng/worldgen/meteorite/Fallout.java index da61a172..e42fb516 100644 --- a/src/main/java/appeng/worldgen/meteorite/Fallout.java +++ b/src/main/java/appeng/worldgen/meteorite/Fallout.java @@ -14,7 +14,7 @@ public class Fallout private final MeteoriteBlockPutter putter; private final IBlockDefinition skyStoneDefinition; - public Fallout( MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public Fallout( final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { this.putter = putter; this.skyStoneDefinition = skyStoneDefinition; @@ -25,9 +25,9 @@ public class Fallout return 0; } - public void getRandomFall( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomFall( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > 0.9 ) { this.putter.put( w, x, y, z, Blocks.stone ); @@ -46,9 +46,9 @@ public class Fallout } } - public void getRandomInset( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomInset( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > 0.9 ) { this.putter.put( w, x, y, z, Blocks.cobblestone ); @@ -63,7 +63,7 @@ public class Fallout } else if( a > 0.6 ) { - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.putter.put( w, x, y, z, skyStoneBlock ); } diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java index 33290a2d..058cc119 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java @@ -18,7 +18,7 @@ public class FalloutCopy extends Fallout private final int meta; private final MeteoriteBlockPutter putter; - public FalloutCopy( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutCopy( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( putter, skyStoneDefinition ); this.putter = putter; @@ -27,9 +27,9 @@ public class FalloutCopy extends Fallout } @Override - public void getRandomFall( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomFall( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > SPECIFIED_BLOCK_THRESHOLD ) { this.putter.put( w, x, y, z, this.block, this.meta ); @@ -40,15 +40,15 @@ public class FalloutCopy extends Fallout } } - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { } @Override - public void getRandomInset( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomInset( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > SPECIFIED_BLOCK_THRESHOLD ) { this.putter.put( w, x, y, z, this.block, this.meta ); diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java index 290880a6..153742fa 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java @@ -12,7 +12,7 @@ public class FalloutSand extends FalloutCopy public static final double GLASS_THRESHOLD = 0.66; private final MeteoriteBlockPutter putter; - public FalloutSand( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutSand( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( w, x, y, z, putter, skyStoneDefinition ); this.putter = putter; @@ -25,7 +25,7 @@ public class FalloutSand extends FalloutCopy } @Override - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { if( a > GLASS_THRESHOLD ) { diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java index 6353f93a..69b73ccd 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java @@ -13,7 +13,7 @@ public class FalloutSnow extends FalloutCopy public static final double ICE_THRESHOLD = 0.5; private final MeteoriteBlockPutter putter; - public FalloutSnow( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutSnow( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( w, x, y, z, putter, skyStoneDefinition ); this.putter = putter; @@ -26,7 +26,7 @@ public class FalloutSnow extends FalloutCopy } @Override - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { if( a > SNOW_THRESHOLD ) { diff --git a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java index f7278e00..c892ae62 100644 --- a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java +++ b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java @@ -8,9 +8,9 @@ import net.minecraft.init.Blocks; public class MeteoriteBlockPutter { - public boolean put( IMeteoriteWorld w, int i, int j, int k, Block blk ) + public boolean put( final IMeteoriteWorld w, final int i, final int j, final int k, final Block blk ) { - Block original = w.getBlock( i, j, k ); + final Block original = w.getBlock( i, j, k ); if( original == Blocks.bedrock || original == blk ) { @@ -21,7 +21,7 @@ public class MeteoriteBlockPutter return true; } - public void put( IMeteoriteWorld w, int i, int j, int k, Block blk, int meta ) + public void put( final IMeteoriteWorld w, final int i, final int j, final int k, final Block blk, final int meta ) { if( w.getBlock( i, j, k ) == Blocks.bedrock ) { diff --git a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java index 7ca02b4a..9c8df169 100644 --- a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java +++ b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java @@ -14,31 +14,31 @@ public class StandardWorld implements IMeteoriteWorld protected final World w; - public StandardWorld( World w ) + public StandardWorld( final World w ) { this.w = w; } @Override - public int minX( int in ) + public int minX( final int in ) { return in; } @Override - public int minZ( int in ) + public int minZ( final int in ) { return in; } @Override - public int maxX( int in ) + public int maxX( final int in ) { return in; } @Override - public int maxZ( int in ) + public int maxZ( final int in ) { return in; } @@ -50,7 +50,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public int getBlockMetadata( int x, int y, int z ) + public int getBlockMetadata( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -60,7 +60,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public Block getBlock( int x, int y, int z ) + public Block getBlock( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -70,7 +70,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public boolean canBlockSeeTheSky( int x, int y, int z ) + public boolean canBlockSeeTheSky( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -80,7 +80,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public TileEntity getTileEntity( int x, int y, int z ) + public TileEntity getTileEntity( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -96,7 +96,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public void setBlock( int x, int y, int z, Block blk ) + public void setBlock( final int x, final int y, final int z, final Block blk ) { if( this.range( x, y, z ) ) { @@ -105,7 +105,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public void setBlock( int x, int y, int z, Block block, int meta, int flags ) + public void setBlock( final int x, final int y, final int z, final Block block, final int meta, final int flags ) { if( this.range( x, y, z ) ) { @@ -119,7 +119,7 @@ public class StandardWorld implements IMeteoriteWorld } - public boolean range( int x, int y, int z ) + public boolean range( final int x, final int y, final int z ) { return true; }