aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-10-02 07:31:08 +0200
committerGitHub <noreply@github.com>2024-10-02 05:31:08 +0000
commit3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3 (patch)
tree107d9d2442891990ef1cdef1d8bb2df6bb96952a /src/main/java/gtPlusPlus
parentbfc7b2b07f72d0903a70791ff96f9c837ddd5ff0 (diff)
downloadGT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.gz
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.bz2
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.zip
Cleanup the codebase (#3311)
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gtPlusPlus')
-rw-r--r--src/main/java/gtPlusPlus/api/objects/Logger.java3
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java10
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java4
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java11
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java12
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java3
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java2
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java2
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java8
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicBlock.java2
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java14
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockCircuitProgrammer.java3
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockFlaskSetter.java3
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockPooCollector.java12
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java10
-rw-r--r--src/main/java/gtPlusPlus/core/client/CustomTextureSet.java4
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java4
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java18
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java2
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java2
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java4
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerCircuitProgrammer.java4
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerFishTrap.java4
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerPestKiller.java11
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerProjectTable.java8
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerSuperJukebox.java4
-rw-r--r--src/main/java/gtPlusPlus/core/container/ContainerVolumetricFlaskSetter.java8
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java6
-rw-r--r--src/main/java/gtPlusPlus/core/gui/beta/GUIIDRegistry.java9
-rw-r--r--src/main/java/gtPlusPlus/core/gui/beta/GUITypes.java2
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUIPestKiller.java8
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUIVolumetricFlaskSetter.java46
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java6
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java6
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/SneakManager.java6
-rw-r--r--src/main/java/gtPlusPlus/core/handler/workbench/WorkbenchCraftingHandler.java32
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java10
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java2
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java22
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryDecayablesChest.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryEggBox.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventorySuperJukebox.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryVolumetricFlaskSetter.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java2
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/ModItems.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java20
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java16
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java3
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java6
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java10
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOld.java4
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java4
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java17
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java4
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java4
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java37
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java10
-rw-r--r--src/main/java/gtPlusPlus/core/item/circuit/GTPPIntegratedCircuitItem.java11
-rw-r--r--src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java6
-rw-r--r--src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java7
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java15
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java3
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java111
-rw-r--r--src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java12
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java34
-rw-r--r--src/main/java/gtPlusPlus/core/lib/VanillaColours.java2
-rw-r--r--src/main/java/gtPlusPlus/core/material/Material.java63
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialGenerator.java19
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialsAlloy.java2
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialsElements.java41
-rw-r--r--src/main/java/gtPlusPlus/core/material/Particle.java4
-rw-r--r--src/main/java/gtPlusPlus/core/material/nuclear/MaterialsFluorides.java70
-rw-r--r--src/main/java/gtPlusPlus/core/material/nuclear/MaterialsNuclides.java110
-rw-r--r--src/main/java/gtPlusPlus/core/material/state/MaterialState.java2
-rw-r--r--src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java2
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java56
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java4
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/common/CI.java14
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java2
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java96
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java14
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java2
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java23
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java5
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java2
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java20
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java46
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java2
-rw-r--r--src/main/java/gtPlusPlus/core/util/Utils.java2
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java14
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/FileUtils.java5
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/StringUtils.java6
-rw-r--r--src/main/java/gtPlusPlus/core/util/math/MathUtils.java31
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java15
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java3
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java159
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java5
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java11
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java3
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java42
-rw-r--r--src/main/java/gtPlusPlus/core/util/recipe/RecipeHashStrat.java5
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java25
-rw-r--r--src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java1
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java3
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java4
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java18
-rw-r--r--src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java8
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java12
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java4
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java4
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java35
-rw-r--r--src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java61
-rw-r--r--src/main/java/gtPlusPlus/nei/LFTRSpargingNEIHandler.java35
-rw-r--r--src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java10
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java6
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java6
-rw-r--r--src/main/java/gtPlusPlus/recipes/RecipeRemovals.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPPBeeDefinition.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPDropType.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPollenType.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPropolisType.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/FRItemRegistry.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/MBItemFrame.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java16
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IGregtechItemContainer.java32
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java68
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItem.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemBase.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemX32.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java16
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java40
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java8
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java78
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java72
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverToggleVisual.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/MachineBlockRenderer.java51
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java27
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERocketFuelGenerator.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java56
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAutoChisel.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTECropHarvestor.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeRocketEngine.java12
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTENuclearReactor.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java8
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java12
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java1
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java1
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/MTESolarHeater.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneCircuitBlock.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTETieredChest.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolAngleGrinder.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolElectricSnips.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelterGTNH.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java38
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/recipe/RecipeIC2.java39
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidEnder.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidPyrotheum.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java3
239 files changed, 1300 insertions, 1827 deletions
diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java
index 6650668894..3ec36aeec1 100644
--- a/src/main/java/gtPlusPlus/api/objects/Logger.java
+++ b/src/main/java/gtPlusPlus/api/objects/Logger.java
@@ -17,8 +17,7 @@ public class Logger {
// Generate GT++ Logger
public static org.apache.logging.log4j.Logger makeLogger() {
- final org.apache.logging.log4j.Logger gtPlusPlusLogger = LogManager.getLogger("GT++");
- return gtPlusPlusLogger;
+ return LogManager.getLogger("GT++");
}
private static final boolean enabled = !ASMConfiguration.debug.disableAllLogging;
diff --git a/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java b/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
index ea12972af4..eb4b3cfd59 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
@@ -10,7 +10,7 @@ import gtPlusPlus.api.objects.Logger;
public class TypeCounter<V> implements Set<V> {
- private Map<String, InternalTypeCounterObject<V>> mInternalMap = new LinkedHashMap<>();
+ private final Map<String, InternalTypeCounterObject<V>> mInternalMap = new LinkedHashMap<>();
private String mHighestValueKey;
private int mHighestValue = 0;
private final Class mClass;
@@ -55,7 +55,7 @@ public class TypeCounter<V> implements Set<V> {
String aKey = aKeyName != null ? aKeyName : arg0.toString();
InternalTypeCounterObject<V> aValue = mInternalMap.get(aKey);
if (aValue == null) {
- aValue = new InternalTypeCounterObject<>((V) arg0);
+ aValue = new InternalTypeCounterObject<>(arg0);
Logger.WARNING("Adding new key to map: " + aKey);
}
aValue.add();
@@ -115,11 +115,7 @@ public class TypeCounter<V> implements Set<V> {
@Override
public boolean remove(Object arg0) {
InternalTypeCounterObject<V> aValue = mInternalMap.remove(arg0.toString());
- if (aValue != null) {
- return true;
- } else {
- return false;
- }
+ return aValue != null;
}
@Override
diff --git a/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java b/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
index 5d99097169..6a14b97e0b 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
@@ -11,8 +11,8 @@ import gregtech.api.objects.XSTR;
public class WeightedCollection<E> implements Map<Integer, E> {
- private NavigableMap<Integer, E> map = new TreeMap<>();
- private Random random;
+ private final NavigableMap<Integer, E> map = new TreeMap<>();
+ private final Random random;
private int total = 0;
public WeightedCollection() {
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
index 13f12503f0..2c93631b4d 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
@@ -15,7 +15,7 @@ public class BTF_FluidTank extends FluidTank {
/**
* Let's replace the Default handling with GT's own handling code, because it's probably better, right?
- *
+ *
* @author Alkalus/GregoriusT
*/
@Override
@@ -132,13 +132,10 @@ public class BTF_FluidTank extends FluidTank {
public FluidStack drain(int maxDrain, boolean doDrain) {
if (this.getDrainableStack() != null && this.canTankBeEmptied()) {
if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack((FluidStack) null);
+ this.setDrainableStack(null);
return null;
} else {
- int used = maxDrain;
- if (this.getDrainableStack().amount < maxDrain) {
- used = this.getDrainableStack().amount;
- }
+ int used = Math.min(this.getDrainableStack().amount, maxDrain);
if (doDrain) {
FluidStack arg9999 = this.getDrainableStack();
@@ -149,7 +146,7 @@ public class BTF_FluidTank extends FluidTank {
.copy();
drained.amount = used;
if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack((FluidStack) null);
+ this.setDrainableStack(null);
}
return drained;
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
index cdbf2c43e2..97ebaeb9ba 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
@@ -75,12 +75,12 @@ public class BTF_Inventory implements ISidedInventory {
if (this.setStackToZeroInsteadOfNull(aIndex)) {
tStack.stackSize = 0;
} else {
- this.setInventorySlotContents(aIndex, (ItemStack) null);
+ this.setInventorySlotContents(aIndex, null);
}
} else {
rStack = tStack.splitStack(aAmount);
if (tStack.stackSize == 0 && !this.setStackToZeroInsteadOfNull(aIndex)) {
- this.setInventorySlotContents(aIndex, (ItemStack) null);
+ this.setInventorySlotContents(aIndex, null);
}
}
}
@@ -143,7 +143,7 @@ public class BTF_Inventory implements ISidedInventory {
@Override
public final boolean hasCustomInventoryName() {
- return mTile != null ? mTile.hasCustomInventoryName() : false;
+ return mTile != null && mTile.hasCustomInventoryName();
}
@Override
@@ -183,11 +183,7 @@ public class BTF_Inventory implements ISidedInventory {
public boolean isEmpty() {
for (int s = 0; s < this.getSizeInventory(); s++) {
ItemStack slot = mInventory[s];
- if (slot == null) {
- continue;
- } else {
- return false;
- }
+ if (slot != null) return false;
}
return true;
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
index 047b5dbeaf..8145a2d3e9 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
@@ -65,8 +65,7 @@ public class BlockPos implements Serializable {
}
public String getUniqueIdentifier() {
- String S = "" + this.dim + "@" + this.xPos + "@" + this.yPos + "@" + this.zPos;
- return S;
+ return this.dim + "@" + this.xPos + "@" + this.yPos + "@" + this.zPos;
}
@Override
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
index a858f5a295..a65edc052b 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
@@ -53,5 +53,5 @@ public abstract class ItemPackage implements RunnableWithInfo<String> {
*/
public boolean onLoadComplete(FMLLoadCompleteEvent event) {
return false;
- };
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
index f5e483b91c..b3824c77da 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
@@ -19,7 +19,7 @@ public class ItemStackData {
mDamage = aStack.getItemDamage();
mStackSize = aStack.stackSize;
mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
- mUniqueDataTag = "" + Item.getIdFromItem(mItem) + "" + mDamage + "" + mStackSize + "" + mNBT.getId();
+ mUniqueDataTag = String.valueOf(Item.getIdFromItem(mItem)) + mDamage + mStackSize + mNBT.getId();
}
public String getUniqueDataIdentifier() {
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
index 867f247b6e..4f61996e08 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
@@ -101,7 +101,7 @@ public class ShapedRecipe implements IRecipeMutableAccess {
aCharSlot++;
aLoggingInfo[aInfoSlot++] = mInfo;
} else {
- aRecipePairs.add(new Pair<>(' ', (ItemStack) null));
+ aRecipePairs.add(new Pair<>(' ', null));
Logger.RECIPE("Storing ' ' with an object of type null");
aChar[aMemSlot++] = ' ';
aLoggingInfo[aInfoSlot++] = "Empty";
@@ -115,8 +115,8 @@ public class ShapedRecipe implements IRecipeMutableAccess {
for (Pair<Character, Object> h : aRecipePairs) {
if (h.getKey() != null) {
- aGridWhole.append(String.valueOf(h.getKey()));
- Logger.RECIPE("Adding '" + String.valueOf(h.getKey()) + "' to aGridWhole.");
+ aGridWhole.append(h.getKey());
+ Logger.RECIPE("Adding '" + h.getKey() + "' to aGridWhole.");
}
}
@@ -194,7 +194,7 @@ public class ShapedRecipe implements IRecipeMutableAccess {
o = ((ItemStack) o).copy();
}
- mVarags2[counter2] = (char) c;
+ mVarags2[counter2] = c;
mVarags2[counter2 + 1] = o;
counter2 += 2;
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
index d39c194dfd..7747deb5da 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -31,7 +31,7 @@ public class BasicBlock extends BlockContainer {
this.setStepSound(soundTypeMetal);
}
- public static enum BlockTypes {
+ public enum BlockTypes {
STANDARD("blockBlock", "pickaxe", soundTypeMetal),
FRAME("blockFrameGt", "wrench", soundTypeMetal),
diff --git a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
index 7e64f19bf3..a85e700db2 100644
--- a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
+++ b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
@@ -7,8 +7,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.boss.EntityDragon;
-import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -73,8 +71,7 @@ public class BlockWitherProof extends Block {
if ((entity == null) || !entity.isEntityAlive()) {
return false;
}
- if ((entity instanceof EntityWither) || (entity instanceof EntityDragon)
- || (entity instanceof IBossDisplayData)) {
+ if (entity instanceof IBossDisplayData) {
return false;
} else {
return super.canEntityDestroy(world, x, y, z, entity);
@@ -109,7 +106,7 @@ public class BlockWitherProof extends Block {
@Override
public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World p_149737_2_, int p_149737_3_,
int p_149737_4_, int p_149737_5_) {
- if (aPlayer != null && aPlayer instanceof EntityPlayerMP) {
+ if (aPlayer instanceof EntityPlayerMP) {
return 1f;
}
return -1f;
@@ -131,10 +128,7 @@ public class BlockWitherProof extends Block {
if ((entity == null) || !entity.isEntityAlive()) {
return;
}
- if ((entity instanceof EntityWither) || (entity instanceof EntityDragon)
- || (entity instanceof IBossDisplayData)) {
- return;
- } else {
+ if (!(entity instanceof IBossDisplayData)) {
super.onEntityCollidedWithBlock(world, x, y, z, entity);
}
}
@@ -147,7 +141,7 @@ public class BlockWitherProof extends Block {
@Override
public boolean canHarvestBlock(EntityPlayer player, int meta) {
- if (player != null && player instanceof EntityPlayerMP) {
+ if (player instanceof EntityPlayerMP) {
return true;
}
return super.canHarvestBlock(player, meta);
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/block/machine/BlockCircuitProgrammer.java
index dcbe41f150..568df08922 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockCircuitProgrammer.java
@@ -147,7 +147,6 @@ public class BlockCircuitProgrammer extends BasicTileBlockWithTooltip {
GTPlusPlus.ID + ":metro/TEXTURE_TECH_PANEL_B", GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_I",
GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_I", GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_I",
GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_I" };
- CubicObject<String>[] aTextureData = new CubicObject[] { new CubicObject<>(aTexData) };
- return aTextureData;
+ return (CubicObject<String>[]) new CubicObject[] { new CubicObject<>(aTexData) };
}
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockFlaskSetter.java b/src/main/java/gtPlusPlus/core/block/machine/BlockFlaskSetter.java
index 5ec07bb9e3..134bbafd6b 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockFlaskSetter.java
@@ -151,7 +151,6 @@ public class BlockFlaskSetter extends BasicTileBlockWithTooltip {
GTPlusPlus.ID + ":metro/TEXTURE_TECH_PANEL_C", GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_H",
GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_H", GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_H",
GTPlusPlus.ID + ":metro/TEXTURE_METAL_PANEL_H" };
- CubicObject<String>[] aTextureData = new CubicObject[] { new CubicObject<>(aTexData) };
- return aTextureData;
+ return (CubicObject<String>[]) new CubicObject[] { new CubicObject<>(aTexData) };
}
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockPooCollector.java b/src/main/java/gtPlusPlus/core/block/machine/BlockPooCollector.java
index 6a371a3284..b7c84ddc8c 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockPooCollector.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockPooCollector.java
@@ -85,13 +85,11 @@ public class BlockPooCollector extends BlockContainer {
} else {
TileEntityBaseFluidCollector tank = (TileEntityBaseFluidCollector) world.getTileEntity(x, y, z);
if (tank != null) {
- Item handItem;
- try {
- handItem = player.getHeldItem()
- .getItem();
- } catch (Throwable t) {
- handItem = null;
- }
+ // Item handItem;
+ // try {
+ // handItem = player.getHeldItem()
+ // .getItem();
+ // } catch (Throwable t) {}
// Fluid container code
/*
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
index be55db80a0..9d6f76ca2c 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
@@ -77,7 +77,7 @@ public class BlockSuperJukebox extends BlockJukebox {
}
final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntitySuperJukebox)) {
+ if (te instanceof TileEntitySuperJukebox) {
player.openGui(GTplusplus.instance, GuiHandler.GUI14, world, x, y, z);
return true;
}
@@ -328,7 +328,7 @@ public class BlockSuperJukebox extends BlockJukebox {
Logger.INFO("b1");
// Select First Record
ItemStack aRecordToPlay;
- if (mValidRecords.size() == 0) {
+ if (mValidRecords.isEmpty()) {
Logger.INFO("bX");
return false;
} else {
@@ -399,8 +399,8 @@ public class BlockSuperJukebox extends BlockJukebox {
ItemStack aRecordToPlay = tileentityjukebox.func_145856_a();
if (aRecordToPlay != null) {
aWorld.playAuxSFX(1005, aX, aY, aZ, 0);
- aWorld.playRecord((String) null, aX, aY, aZ);
- tileentityjukebox.func_145857_a((ItemStack) null);
+ aWorld.playRecord(null, aX, aY, aZ);
+ tileentityjukebox.func_145857_a(null);
this.markDirty();
}
}
@@ -568,7 +568,7 @@ public class BlockSuperJukebox extends BlockJukebox {
@Override
public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
+ return (this.customName != null) && !this.customName.isEmpty();
}
}
}
diff --git a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
index ce4d9a0320..ca9328dba0 100644
--- a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
+++ b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
@@ -4,7 +4,7 @@ import gregtech.api.enums.TextureSet;
public class CustomTextureSet extends TextureSet {
- public static enum TextureSets {
+ public enum TextureSets {
REFINED(),
GEM_A(),
@@ -13,7 +13,7 @@ public class CustomTextureSet extends TextureSet {
private final CustomTextureSet A;
- private TextureSets() {
+ TextureSets() {
A = new CustomTextureSet(
this.name()
.toUpperCase());
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
index 3b5922444d..877fe3886c 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
@@ -12,9 +12,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ModelSickBlaze extends ModelBlaze {
/** The sticks that fly around the Blaze. */
- private ModelRenderer[] blazeSticks = new ModelRenderer[24];
+ private final ModelRenderer[] blazeSticks = new ModelRenderer[24];
- private ModelRenderer blazeHead;
+ private final ModelRenderer blazeHead;
public ModelSickBlaze() {
for (int i = 0; i < this.blazeSticks.length; ++i) {
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
index 689f075703..a32dd2da8f 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
@@ -31,8 +31,7 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
RenderBlocks aRenderer) {
- Block tTileEntity = aBlock;
- if ((tTileEntity instanceof ITexturedBlock)) {
+ if ((aBlock instanceof ITexturedBlock)) {
return renderStandardBlock(
aWorld,
aX,
@@ -40,12 +39,12 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
aZ,
aBlock,
aRenderer,
- new ITexture[][] { ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.DOWN),
- ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.UP),
- ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.NORTH),
- ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.SOUTH),
- ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.WEST),
- ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.EAST) });
+ new ITexture[][] { ((ITexturedBlock) aBlock).getTexture(ForgeDirection.DOWN),
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.UP),
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.NORTH),
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.SOUTH),
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.WEST),
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.EAST) });
}
return false;
}
@@ -556,8 +555,7 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
.getTextureManager()
.getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
}
-
- return (IIcon) iicon;
+ return iicon;
}
IBlockAccess blockAccess = RenderBlocks.getInstance().blockAccess;
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
index 78d4f367eb..a5ab58ef59 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
@@ -23,7 +23,7 @@ public class RenderDecayChest extends TileEntitySpecialRenderer {
private static final ResourceLocation mChestTexture = new ResourceLocation(
GTPlusPlus.ID,
"textures/blocks/TileEntities/DecayablesChest_full.png");
- private ModelDecayChest mChestModel = new ModelDecayChest();
+ private final ModelDecayChest mChestModel = new ModelDecayChest();
public static RenderDecayChest INSTANCE;
public final int mRenderID;
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
index 2c0ed7f562..bc8c3b7bbc 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
@@ -18,7 +18,7 @@ import gtPlusPlus.core.entity.projectile.EntityToxinball;
@SideOnly(Side.CLIENT)
public class RenderToxinball extends Render {
- private float mSize;
+ private final float mSize;
public RenderToxinball(float scale) {
this.mSize = scale;
diff --git a/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java b/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java
index 7e60f95d37..905c1a870b 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java
@@ -10,8 +10,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class CompatIC2 {
- private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
- private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
+ private static final ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
+ private static final ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject(
"ore:cableGt02Copper",
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/container/ContainerCircuitProgrammer.java
index 9afccfb0f4..6e1da7bc61 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerCircuitProgrammer.java
@@ -137,7 +137,7 @@ public class ContainerCircuitProgrammer extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ final Slot var4 = this.inventorySlots.get(par2);
if ((var4 != null) && var4.getHasStack()) {
final ItemStack var5 = var4.getStack();
@@ -153,7 +153,7 @@ public class ContainerCircuitProgrammer extends Container {
*/
if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ var4.putStack(null);
} else {
var4.onSlotChanged();
}
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerFishTrap.java b/src/main/java/gtPlusPlus/core/container/ContainerFishTrap.java
index 1a9344c08c..08b6ee2ebb 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerFishTrap.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerFishTrap.java
@@ -95,7 +95,7 @@ public class ContainerFishTrap extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ final Slot var4 = this.inventorySlots.get(par2);
if ((var4 != null) && var4.getHasStack()) {
final ItemStack var5 = var4.getStack();
@@ -111,7 +111,7 @@ public class ContainerFishTrap extends Container {
*/
if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ var4.putStack(null);
} else {
var4.onSlotChanged();
}
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerPestKiller.java b/src/main/java/gtPlusPlus/core/container/ContainerPestKiller.java
index 6f63a1d04e..546c367401 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerPestKiller.java
@@ -83,10 +83,7 @@ public class ContainerPestKiller extends Container {
@Override
public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
final EntityPlayer aPlayer) {
- boolean fluid = false;
- if (aSlotIndex == 2) {
- fluid = true;
- }
+ boolean fluid = aSlotIndex == 2;
if (!fluid) {
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
} else {
@@ -111,7 +108,7 @@ public class ContainerPestKiller extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ final Slot var4 = this.inventorySlots.get(par2);
if ((var4 != null) && var4.getHasStack()) {
final ItemStack var5 = var4.getStack();
@@ -127,7 +124,7 @@ public class ContainerPestKiller extends Container {
*/
if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ var4.putStack(null);
} else {
var4.onSlotChanged();
}
@@ -148,7 +145,7 @@ public class ContainerPestKiller extends Container {
return super.func_94530_a(p_94530_1_, p_94530_2_);
}
- private class GT_Slot_Render extends Slot {
+ private static class GT_Slot_Render extends Slot {
public final int mSlotIndex;
public boolean mEnabled = true;
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerProjectTable.java b/src/main/java/gtPlusPlus/core/container/ContainerProjectTable.java
index 306c6f0026..05f4182833 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerProjectTable.java
@@ -178,15 +178,11 @@ public class ContainerProjectTable extends Container {
}
public ItemStack getOutputContent() {
- ItemStack output = this.craftResult.getStackInSlot(0);
- if (output != null) {
- return output;
- }
- return null;
+ return this.craftResult.getStackInSlot(0);
}
public ItemStack[] getInputComponents() {
- ItemStack inputs[] = new ItemStack[9];
+ ItemStack[] inputs = new ItemStack[9];
for (int r = 0; r < this.craftMatrix.getSizeInventory(); r++) {
ItemStack temp = this.craftMatrix.getStackInSlot(r);
inputs[r] = temp;
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerSuperJukebox.java b/src/main/java/gtPlusPlus/core/container/ContainerSuperJukebox.java
index 45782f1384..04ea296e35 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerSuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerSuperJukebox.java
@@ -134,7 +134,7 @@ public class ContainerSuperJukebox extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ final Slot var4 = this.inventorySlots.get(par2);
if ((var4 != null) && var4.getHasStack()) {
final ItemStack var5 = var4.getStack();
@@ -150,7 +150,7 @@ public class ContainerSuperJukebox extends Container {
*/
if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ var4.putStack(null);
} else {
var4.onSlotChanged();
}
diff --git a/src/main/java/gtPlusPlus/core/container/ContainerVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/container/ContainerVolumetricFlaskSetter.java
index bf1f8c4133..1a517e6761 100644
--- a/src/main/java/gtPlusPlus/core/container/ContainerVolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/container/ContainerVolumetricFlaskSetter.java
@@ -104,7 +104,7 @@ public class ContainerVolumetricFlaskSetter extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ final Slot var4 = this.inventorySlots.get(par2);
if ((var4 != null) && var4.getHasStack()) {
final ItemStack var5 = var4.getStack();
@@ -120,7 +120,7 @@ public class ContainerVolumetricFlaskSetter extends Container {
*/
if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ var4.putStack(null);
} else {
var4.onSlotChanged();
}
@@ -159,8 +159,8 @@ public class ContainerVolumetricFlaskSetter extends Container {
@Override
public void updateProgressBar(int par1, int par2) {
super.updateProgressBar(par1, par2);
- switch (par1) {
- case 0 -> mCustomValue = (short) par2;
+ if (par1 == 0) {
+ mCustomValue = (short) par2;
}
}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
index a3b2f6f28b..65e2385003 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
@@ -170,9 +170,7 @@ public abstract class EntityToxinball extends EntityFireball {
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
for (this.rotationPitch = (float) (Math.atan2(f1, this.motionY) * 180.0D / Math.PI)
- - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
- ;
- }
+ - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
@@ -241,7 +239,7 @@ public abstract class EntityToxinball extends EntityFireball {
aTag.setShort("zTile", (short) this.entityZ);
aTag.setByte("inTile", (byte) Block.getIdFromBlock(this.block));
aTag.setByte("inGround", (byte) (this.inGround ? 1 : 0));
- aTag.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
+ aTag.setTag("direction", this.newDoubleNBTList(this.motionX, this.motionY, this.motionZ));
}
/**
diff --git a/src/main/java/gtPlusPlus/core/gui/beta/GUIIDRegistry.java b/src/main/java/gtPlusPlus/core/gui/beta/GUIIDRegistry.java
index f6d899d247..fbb34ee5b7 100644
--- a/src/main/java/gtPlusPlus/core/gui/beta/GUIIDRegistry.java
+++ b/src/main/java/gtPlusPlus/core/gui/beta/GUIIDRegistry.java
@@ -12,14 +12,12 @@ public class GUIIDRegistry {
private static final Map<Integer, MUGuild> idMap = new HashMap<>();
private static int nextId = 0;
- static {}
-
private static void registerGuiHandlers(final GUITypes MU_GuiType,
final List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses) {
for (final Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses) {
final MUGuild guiId = new MUGuild(nextId++, MU_GuiType, tileGuiHandlerClass);
classMap.put(tileGuiHandlerClass, guiId);
- idMap.put(Integer.valueOf(guiId.getId()), guiId);
+ idMap.put(guiId.getId(), guiId);
}
}
@@ -29,7 +27,8 @@ public class GUIIDRegistry {
if (guiId == null) {
for (final Map.Entry<Class<? extends IGuiManagerMiscUtils>, MUGuild> classGuiIdEntry : classMap
.entrySet()) {
- if (((Class<?>) classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass)) {
+ if (classGuiIdEntry.getKey()
+ .isAssignableFrom(guiHandlerClass)) {
guiId = classGuiIdEntry.getValue();
break;
}
@@ -42,6 +41,6 @@ public class GUIIDRegistry {
}
public static MUGuild getGuiId(final int id) {
- return idMap.get(Integer.valueOf(id));
+ return idMap.get(id);
}
}
diff --git a/src/main/java/gtPlusPlus/core/gui/beta/GUITypes.java b/src/main/java/gtPlusPlus/core/gui/beta/GUITypes.java
index 124e2fc276..40d0442b59 100644
--- a/src/main/java/gtPlusPlus/core/gui/beta/GUITypes.java
+++ b/src/main/java/gtPlusPlus/core/gui/beta/GUITypes.java
@@ -6,5 +6,5 @@ public enum GUITypes {
Tile,
Entity;
- private GUITypes() {}
+ GUITypes() {}
}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUIPestKiller.java b/src/main/java/gtPlusPlus/core/gui/machine/GUIPestKiller.java
index 0f3e1fc832..e42f6a9da9 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUIPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUIPestKiller.java
@@ -37,7 +37,7 @@ public class GUIPestKiller extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(final int i, final int j) {
if (mTileKiller != null) {
- this.fontRendererObj.drawString(I18n.format(mTileKiller.getInventoryName(), new Object[0]), 4, 6, 4210752);
+ this.fontRendererObj.drawString(I18n.format(mTileKiller.getInventoryName()), 4, 6, 4210752);
drawFluidTank(mTileKiller.getTank(), 134, 35);
}
}
@@ -77,7 +77,7 @@ public class GUIPestKiller extends GuiContainer {
if (aTank != null && aTank.getFluidAmount() > 0) {
aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
// Logger.INFO("Percent = "+aPercentage);
- aFrameHeight = (int) (aPercentage / aDivisor);
+ // aFrameHeight = (int) (aPercentage / aDivisor);
// Logger.INFO("Frame Height = "+aFrameHeight);
}
this.fontRendererObj.drawString("Tier: 0", 4, 18, 4210752);
@@ -99,7 +99,7 @@ public class GUIPestKiller extends GuiContainer {
this.fontRendererObj.drawString("Range: 5x5", 4, 30, 4210752);
this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
this.fontRendererObj.drawString(
- "" + aTile.getTank()
+ aTile.getTank()
.getFluid()
.getLocalizedName(),
4,
@@ -127,7 +127,7 @@ public class GUIPestKiller extends GuiContainer {
this.fontRendererObj.drawString("Range: 9x9", 4, 30, 4210752);
this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
this.fontRendererObj.drawString(
- "" + aTile.getTank()
+ aTile.getTank()
.getFluid()
.getLocalizedName(),
4,
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUIVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/gui/machine/GUIVolumetricFlaskSetter.java
index 3e1a735f7e..8a57b3987f 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUIVolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUIVolumetricFlaskSetter.java
@@ -24,10 +24,10 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
private static final ResourceLocation mGuiTextures = new ResourceLocation(
GTPlusPlus.ID,
"textures/gui/VolumetricFlaskSetter.png");
- private ContainerVolumetricFlaskSetter mContainer;
+ private final ContainerVolumetricFlaskSetter mContainer;
private boolean mIsOpen = false;
private GuiValueField mText;
- private TileEntityVolumetricFlaskSetter mTile;
+ private final TileEntityVolumetricFlaskSetter mTile;
public GUIVolumetricFlaskSetter(ContainerVolumetricFlaskSetter aContainer) {
super(aContainer);
@@ -48,16 +48,16 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int i, final int j) {
super.drawGuiContainerForegroundLayer(i, j);
this.mText.drawTextBox();
- this.fontRendererObj.drawString(I18n.format("container.VolumetricFlaskSetter", new Object[0]), 4, 3, 4210752);
+ this.fontRendererObj.drawString(I18n.format("container.VolumetricFlaskSetter"), 4, 3, 4210752);
int aYVal = 49;
- this.fontRendererObj.drawString(I18n.format("0 = 16l", new Object[0]), 8, aYVal, 4210752);
- this.fontRendererObj.drawString(I18n.format("4 = 576l", new Object[0]), 64, aYVal, 4210752);
- this.fontRendererObj.drawString(I18n.format("1 = 36l", new Object[0]), 8, aYVal += 8, 4210752);
- this.fontRendererObj.drawString(I18n.format("5 = 720l", new Object[0]), 64, aYVal, 4210752);
- this.fontRendererObj.drawString(I18n.format("2 = 144l", new Object[0]), 8, aYVal += 8, 4210752);
- this.fontRendererObj.drawString(I18n.format("6 = 864l", new Object[0]), 64, aYVal, 4210752);
- this.fontRendererObj.drawString(I18n.format("3 = 432l", new Object[0]), 8, aYVal += 8, 4210752);
- this.fontRendererObj.drawString(I18n.format("-> = Custom", new Object[0]), 59, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("0 = 16l"), 8, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("4 = 576l"), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("1 = 36l"), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("5 = 720l"), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("2 = 144l"), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("6 = 864l"), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("3 = 432l"), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("-> = Custom"), 59, aYVal, 4210752);
}
@Override
@@ -127,7 +127,7 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
} else if (par2 == Keyboard.KEY_BACK) {
log("Pressed Backspace.");
String aCurrentText = getText();
- if (aCurrentText.length() > 0) {
+ if (!aCurrentText.isEmpty()) {
this.mText.setText(aCurrentText.substring(0, aCurrentText.length() - 1));
if (getText().length() <= 0) {
setText(0);
@@ -137,14 +137,8 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
} else {
if (isNumber(par2) || isNumber(par1)) {
log("Pressed number.");
- if (this.mText.getText()
- .equals("0")) {
- this.mText.textboxKeyTyped(par1, par2);
- sendUpdateToServer();
- } else {
- this.mText.textboxKeyTyped(par1, par2);
- sendUpdateToServer();
- }
+ this.mText.textboxKeyTyped(par1, par2);
+ sendUpdateToServer();
} else {
log("Pressed unused key.");
super.keyTyped(par1, par2);
@@ -191,7 +185,7 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
}
public void sendUpdateToServer() {
- if (getText().length() > 0) {
+ if (!getText().isEmpty()) {
PacketHandler.sendToServer(new PacketVolumetricFlaskGui(mTile, parse(getText())));
}
}
@@ -211,13 +205,11 @@ public class GUIVolumetricFlaskSetter extends GuiContainer {
this.mText.updateCursorCounter();
// Check TextBox Value is correct
- if (getText().length() > 0) {
+ if (!getText().isEmpty()) {
int aCustomValue = parse(getText());
- int aTileValue = ((ContainerVolumetricFlaskSetter) mContainer).mCustomValue;
- if (mContainer != null) {
- if (aTileValue != aCustomValue) {
- setText(aTileValue);
- }
+ int aTileValue = mContainer.mCustomValue;
+ if (aTileValue != aCustomValue) {
+ setText(aTileValue);
}
}
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
index 36e3b6edd8..7004b3517c 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
@@ -25,10 +25,8 @@ public class DecayableRecipe {
@Override
public boolean equals(Object o) {
if (o instanceof DecayableRecipe i) {
- if (i.mTime == this.mTime && GTUtility.areStacksEqual(mInput, i.mInput)
- && GTUtility.areStacksEqual(mOutput, i.mOutput)) {
- return true;
- }
+ return i.mTime == this.mTime && GTUtility.areStacksEqual(mInput, i.mInput)
+ && GTUtility.areStacksEqual(mOutput, i.mOutput);
}
return false;
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
index 51780fd030..e6133e22db 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
@@ -35,7 +35,7 @@ public class EnderDragonDeathHandler implements IMobExtraInfoProvider {
event.entityLiving.entityDropItem(
MaterialsElements.STANDALONE.DRAGON_METAL.getNugget(aAmount),
MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
+ aCountTotal = aAmount;
}
} else if (mChaoseDragonClass != null && mChaoseDragonClass.isInstance(event.entityLiving)) {
for (int y = 0; y < MathUtils.randInt(100, 200); y++) {
@@ -43,7 +43,7 @@ public class EnderDragonDeathHandler implements IMobExtraInfoProvider {
event.entityLiving.entityDropItem(
MaterialsElements.STANDALONE.DRAGON_METAL.getIngot(aAmount),
MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
+ aCountTotal = aAmount;
}
} else if (event.entityLiving instanceof EntityDragon) {
for (int y = 0; y < MathUtils.randInt(25, 50); y++) {
@@ -51,7 +51,7 @@ public class EnderDragonDeathHandler implements IMobExtraInfoProvider {
event.entityLiving.entityDropItem(
MaterialsElements.STANDALONE.DRAGON_METAL.getNugget(aAmount),
MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
+ aCountTotal = aAmount;
}
}
if (aCountTotal > 0) {
diff --git a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
index 7af831c675..258bca3bff 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
@@ -29,7 +29,7 @@ public class SneakManager {
}
private static String getKey(EntityPlayer aPlayer) {
- return "" + aPlayer.getGameProfile()
+ return aPlayer.getGameProfile()
.getId()
.toString();
}
@@ -113,14 +113,14 @@ public class SneakManager {
return mIsWearingRing;
}
- public static enum State {
+ public enum State {
ON(true),
OFF(false);
private final boolean STATE;
- private State(final boolean State) {
+ State(final boolean State) {
this.STATE = State;
}
diff --git a/src/main/java/gtPlusPlus/core/handler/workbench/WorkbenchCraftingHandler.java b/src/main/java/gtPlusPlus/core/handler/workbench/WorkbenchCraftingHandler.java
index 1d8b2ed68d..4f0023ccb3 100644
--- a/src/main/java/gtPlusPlus/core/handler/workbench/WorkbenchCraftingHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/workbench/WorkbenchCraftingHandler.java
@@ -20,45 +20,39 @@ public class WorkbenchCraftingHandler {
private static final WorkbenchCraftingHandler instance = new WorkbenchCraftingHandler();
private final List<IRecipe> recipes = new ArrayList<>();
- public static final WorkbenchCraftingHandler getInstance() {
+ public static WorkbenchCraftingHandler getInstance() {
return instance;
}
public WorkbenchCraftingHandler() {
// just a example recipe so you know how to add them
- this.addRecipe(
- new ItemStack(Blocks.iron_block),
- new Object[] { "###", "###", "###", Character.valueOf('#'), Items.iron_ingot });
+ this.addRecipe(new ItemStack(Blocks.iron_block), new Object[] { "###", "###", "###", '#', Items.iron_ingot });
// another example Recipe, but shapeless
this.addShapelessRecipe(new ItemStack(Items.cake), new Object[] { Items.stick });
}
- void addRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
- String s = "";
+ void addRecipe(final ItemStack par1ItemStack, final Object[] par2ArrayOfObj) {
+ StringBuilder s = new StringBuilder();
int i = 0;
int j = 0;
int k = 0;
if (par2ArrayOfObj[i] instanceof String[]) {
- final String as[] = (String[]) par2ArrayOfObj[i++];
+ final String[] as = (String[]) par2ArrayOfObj[i++];
for (final String s2 : as) {
k++;
j = s2.length();
- s = (new StringBuilder()).append(s)
- .append(s2)
- .toString();
+ s.append(s2);
}
} else {
while (par2ArrayOfObj[i] instanceof String) {
final String s1 = (String) par2ArrayOfObj[i++];
k++;
j = s1.length();
- s = (new StringBuilder()).append(s)
- .append(s1)
- .toString();
+ s.append(s1);
}
}
@@ -79,13 +73,13 @@ public class WorkbenchCraftingHandler {
hashmap.put(character, itemstack);
}
- final ItemStack aitemstack[] = new ItemStack[j * k];
+ final ItemStack[] aitemstack = new ItemStack[j * k];
for (int i1 = 0; i1 < (j * k); i1++) {
final char c = s.charAt(i1);
- if (hashmap.containsKey(Character.valueOf(c))) {
- aitemstack[i1] = hashmap.get(Character.valueOf(c))
+ if (hashmap.containsKey(c)) {
+ aitemstack[i1] = hashmap.get(c)
.copy();
} else {
aitemstack[i1] = null;
@@ -95,12 +89,10 @@ public class WorkbenchCraftingHandler {
this.recipes.add(new ShapedRecipes(j, k, aitemstack, par1ItemStack));
}
- public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
+ public void addShapelessRecipe(final ItemStack par1ItemStack, final Object[] par2ArrayOfObj) {
final ArrayList<ItemStack> arraylist = new ArrayList<>();
- final Object aobj[] = par2ArrayOfObj;
- final int i = aobj.length;
- for (final Object obj : aobj) {
+ for (final Object obj : par2ArrayOfObj) {
if (obj instanceof ItemStack) {
arraylist.add(((ItemStack) obj).copy());
continue;
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java b/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
index 599ed6b59b..7ac453fc49 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
@@ -4,13 +4,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public abstract interface IGuiManager extends IGuiManagerMiscUtils {
+public interface IGuiManager extends IGuiManagerMiscUtils {
- public abstract ChunkCoordinates getCoordinates();
+ ChunkCoordinates getCoordinates();
- public abstract World getWorld();
+ World getWorld();
- public abstract Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
+ Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
- public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
+ Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
}
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java b/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
index f7f1194b9a..634a71388b 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
@@ -1,4 +1,4 @@
package gtPlusPlus.core.interfaces;
-public abstract interface IGuiManagerMiscUtils {
+public interface IGuiManagerMiscUtils {
}
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java b/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
index b0fa752f3f..df205891ac 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
@@ -8,45 +8,45 @@ public interface IItemBlueprint {
/**
* The inventory size for the blueprint~
*/
- public int INV_SIZE = 9;
+ int INV_SIZE = 9;
/**
* Meta Compatible function to allow meta items to be blueprints
- *
+ *
* @param stack yourMetaItem
* @return true if it is a Blueprint
*/
- public boolean isBlueprint(ItemStack stack);
+ boolean isBlueprint(ItemStack stack);
/**
* Sets the blueprint for this itemstack.
- *
+ *
* @param stack yourMetaItem
* @return true if blueprint is set successfully
*/
- public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output);
+ boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output);
/**
* Sets the name of the recipe/blueprint
- *
+ *
* @param String Blueprint Name
* @return N/A
*/
- public void setBlueprintName(ItemStack stack, String name);
+ void setBlueprintName(ItemStack stack, String name);
/**
* Does this itemstack hold a blueprint?
- *
+ *
* @param stack yourMetaItem
* @return true if is holding a Blueprint
*/
- public boolean hasBlueprint(ItemStack stack);
+ boolean hasBlueprint(ItemStack stack);
/**
* Gets the recipe held by the item
- *
+ *
* @param stack yourMetaItem
* @return the blueprints contents
*/
- public ItemStack[] getBlueprint(ItemStack stack);
+ ItemStack[] getBlueprint(ItemStack stack);
}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
index 180df60e81..ea65338559 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
@@ -104,7 +104,7 @@ public class InventoryCircuitProgrammer implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryDecayablesChest.java b/src/main/java/gtPlusPlus/core/inventories/InventoryDecayablesChest.java
index 6466996cc9..6f6859c536 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryDecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryDecayablesChest.java
@@ -102,7 +102,7 @@ public class InventoryDecayablesChest implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryEggBox.java b/src/main/java/gtPlusPlus/core/inventories/InventoryEggBox.java
index 545988347e..7407115614 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryEggBox.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryEggBox.java
@@ -102,7 +102,7 @@ public class InventoryEggBox implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java b/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
index e4797d67bc..5d059f1883 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
@@ -102,7 +102,7 @@ public class InventoryFishTrap implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java b/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
index b508de1d6d..87d6dd8f49 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
@@ -102,7 +102,7 @@ public class InventoryPestKiller implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventorySuperJukebox.java b/src/main/java/gtPlusPlus/core/inventories/InventorySuperJukebox.java
index 89f733f5ac..d76323fea8 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventorySuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventorySuperJukebox.java
@@ -102,7 +102,7 @@ public class InventorySuperJukebox implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/inventories/InventoryVolumetricFlaskSetter.java
index 0b16011181..fc5cdd1b92 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryVolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryVolumetricFlaskSetter.java
@@ -104,7 +104,7 @@ public class InventoryVolumetricFlaskSetter implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
index 40e848dc3c..56e14d309f 100644
--- a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
+++ b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
@@ -118,7 +118,7 @@ public class InventoryProjectMain implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
index 77bcbd1e35..955ff4d30f 100644
--- a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
+++ b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
@@ -105,7 +105,7 @@ public class InventoryProjectOutput implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
index 24dd053e31..d8dc073d9c 100644
--- a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
+++ b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
@@ -118,7 +118,7 @@ public class InventoryTradeMain implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
index edfbe7602e..767d4ccb1f 100644
--- a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
+++ b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
@@ -105,7 +105,7 @@ public class InventoryTradeOutput implements IInventory {
// 1.7.2+ renamed to hasCustomInventoryName
@Override
public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ return !this.name.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java
index a7fe8ced30..49a22bc8a8 100644
--- a/src/main/java/gtPlusPlus/core/item/ModItems.java
+++ b/src/main/java/gtPlusPlus/core/item/ModItems.java
@@ -582,7 +582,7 @@ public final class ModItems {
// LFTR Control Circuit
itemCircuitLFTR = new CoreItem(
"itemCircuitLFTR",
- "" + EnumChatFormatting.GREEN + "Control Circuit",
+ EnumChatFormatting.GREEN + "Control Circuit",
AddToCreativeTab.tabMisc,
1,
0,
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
index 3ce461ffab..f79b20ccb9 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
@@ -16,7 +16,7 @@ public class BaseItemBurnable extends CoreItem {
super(unlocalizedName, creativeTab, stackSize, maxDmg, description);
this.itemName = displayName;
this.meta = meta;
- if (oredictName != null && !oredictName.equals("")) {
+ if (oredictName != null && !oredictName.isEmpty()) {
registerOrdictionary(oredictName);
}
registerFuel(burnTime);
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 07744c5c2e..ba98bb25b7 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -231,9 +231,7 @@ public class BaseItemComponent extends Item {
}
}
- if ((this.materialName != null) && (this.materialName != "")
- && !this.materialName.equals("")
- && (this.componentMaterial != null)) {
+ if (this.materialName != null && !this.materialName.isEmpty() && (this.componentMaterial != null)) {
if (this.componentMaterial != null) {
if (!this.componentMaterial.vChemicalFormula.contains("?")) {
@@ -255,10 +253,8 @@ public class BaseItemComponent extends Item {
}
if (this.componentType == ComponentTypes.INGOT || this.componentType == ComponentTypes.HOTINGOT) {
- if ((this.materialName != null) && (this.materialName != "")
- && !this.materialName.equals("")
- && this.unlocalName.toLowerCase()
- .contains("hot")) {
+ if (this.unlocalName.toLowerCase()
+ .contains("hot")) {
list.add(
EnumChatFormatting.GRAY + "Warning: "
+ EnumChatFormatting.RED
@@ -269,7 +265,7 @@ public class BaseItemComponent extends Item {
}
} else {
String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
- if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
+ if (aChemicalFormula != null && !aChemicalFormula.isEmpty()) {
list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
}
}
@@ -300,7 +296,6 @@ public class BaseItemComponent extends Item {
super.addInformation(stack, aPlayer, list, bool);
}
- @SuppressWarnings("unchecked")
@Override
public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
final boolean p_77663_5_) {
@@ -325,10 +320,9 @@ public class BaseItemComponent extends Item {
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
- return (Configuration.visual.useGregtechTextures ? true : false);
+ return Configuration.visual.useGregtechTextures;
}
- @SuppressWarnings("unchecked")
@Override
public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
@@ -402,7 +396,7 @@ public class BaseItemComponent extends Item {
}
}
- public static enum ComponentTypes {
+ public enum ComponentTypes {
DUST("Dust", "@ Dust", "dust", OrePrefixes.dust),
DUSTSMALL("DustSmall", "Small Pile of @ Dust", "dustSmall", OrePrefixes.dustSmall),
@@ -434,7 +428,7 @@ public class BaseItemComponent extends Item {
private final String OREDICT_NAME;
private final OrePrefixes a_GT_EQUAL;
- private ComponentTypes(final String LocalName, final String DisplayName, final String OreDictName,
+ ComponentTypes(final String LocalName, final String DisplayName, final String OreDictName,
final OrePrefixes aPrefix) {
this.COMPONENT_NAME = LocalName;
this.DISPLAY_NAME = DisplayName;
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
index 9a4109a1de..fb24fbf2f1 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
@@ -86,7 +86,7 @@ public class BaseItemDamageable extends Item {
@Override
public String getItemStackDisplayName(final ItemStack tItem) {
- if ((this.itemName == null) || this.itemName.equals("")) {
+ if ((this.itemName == null) || this.itemName.isEmpty()) {
return super.getItemStackDisplayName(tItem);
}
return this.itemName;
@@ -101,7 +101,7 @@ public class BaseItemDamageable extends Item {
return true;
}
- public static final long getItemDamage(final ItemStack aStack) {
+ public static long getItemDamage(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("Damage");
@@ -114,7 +114,7 @@ public class BaseItemDamageable extends Item {
return 0L;
}
- public static final boolean setItemDamage(final ItemStack aStack, final long aDamage) {
+ public static boolean setItemDamage(final ItemStack aStack, final long aDamage) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("Damage");
@@ -142,11 +142,7 @@ public class BaseItemDamageable extends Item {
@Override
public boolean showDurabilityBar(ItemStack stack) {
int dmg = (int) getItemDamage(stack);
- if (dmg <= 20) {
- return false;
- } else {
- return true;
- }
+ return dmg > 20;
}
public static ItemStack damageItem(ItemStack item) {
@@ -154,10 +150,8 @@ public class BaseItemDamageable extends Item {
long currentUse = BaseItemDamageable.getItemDamage(item);
if (currentUse >= 0 && currentUse <= 250) {
BaseItemDamageable.setItemDamage(item, currentUse + 1);
- return item;
- } else {
- return item;
}
+ return item;
}
return null;
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
index 8417eba3d1..8c2473aafe 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
@@ -285,8 +285,7 @@ public class BaseItemTickable extends CoreItem {
return 0;
}
double currentDamage = getTicks(null, stack);
- double durabilitypercent = currentDamage / getMaxTicks(stack);
- return durabilitypercent;
+ return currentDamage / getMaxTicks(stack);
}
@SuppressWarnings("unchecked")
diff --git a/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
index b564d60424..0d7710e651 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
@@ -10,7 +10,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemMonsterPlacer;
@@ -58,7 +57,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer {
/**
* Callback for item usage. If the item does something special on right clicking,
- *
+ * <p>
* he will have one of those. Return True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
@Override
@@ -94,7 +93,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer {
/**
* Called whenever this item is equipped and the right mouse button is pressed.
- *
+ * <p>
* Args: itemStack, world, entityPlayer
*/
@Override
@@ -143,7 +142,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer {
/**
* Spawns the creature specified by the egg's type in the location specified by
- *
+ * <p>
* the last three parameters. Parameters: world, entityID, x, y, z.
*/
public Entity spawnEntity(final World parWorld, final double parX, final double parY, final double parZ) {
@@ -162,7 +161,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer {
0.0F);
parWorld.spawnEntityInWorld(this.entityToSpawn);
- this.entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
+ this.entityToSpawn.onSpawnWithEgg(null);
this.entityToSpawn.playLivingSound();
} else {
// DEBUG
diff --git a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index 451a5b1290..e9f1d87ede 100644
--- a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -23,7 +23,7 @@ public class BaseItemCell extends BaseItemComponent {
public BaseItemCell(final Material material) {
super(material, BaseItemComponent.ComponentTypes.CELL);
- this.fluidColour = (short[]) material.getRGBA();
+ this.fluidColour = material.getRGBA();
}
public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa) {
diff --git a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
index 151f3f3860..5d61f36ce3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
+++ b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
@@ -26,7 +26,7 @@ public class BaseItemPlasmaCell extends BaseItemComponent {
public BaseItemPlasmaCell(final Material material) {
super(material, ComponentTypes.PLASMACELL);
- this.fluidColour = (short[]) material.getRGBA();
+ this.fluidColour = material.getRGBA();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index fd52fe78c4..d230115129 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -5,7 +5,7 @@ import gtPlusPlus.core.material.Material;
public class BaseItemDust extends BaseItemComponent {
- private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
+ private final BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
public BaseItemDust(Material aMat) {
this(aMat, true);
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index bcb56795bc..7b3c8cbd28 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -44,7 +44,7 @@ public class BaseItemDustUnique extends Item {
this.setCreativeTab(tabMisc);
this.colour = colour;
this.materialName = materialName;
- if (mChemicalFormula == null || mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")) {
+ if (mChemicalFormula == null || mChemicalFormula.isEmpty() || mChemicalFormula.equals("NullFormula")) {
this.chemicalNotation = StringUtils.subscript(materialName);
} else {
this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
@@ -84,7 +84,7 @@ public class BaseItemDustUnique extends Item {
temp = temp.replace("itemD", "d");
Logger.WARNING("Generating OreDict Name: " + temp);
}
- if ((temp != null) && !temp.equals("")) {
+ if ((temp != null) && !temp.isEmpty()) {
GTOreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
registerComponent();
@@ -144,7 +144,7 @@ public class BaseItemDustUnique extends Item {
if (this.sRadiation > 0) {
list.add(GTPPCore.GT_Tooltip_Radioactive.get());
}
- if (this.chemicalNotation.length() > 0 && !chemicalNotation.equals("")
+ if (!this.chemicalNotation.isEmpty() && !chemicalNotation.isEmpty()
&& !chemicalNotation.equals("NullFormula")) {
list.add(this.chemicalNotation);
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
index cb227a9423..c9377cba27 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
@@ -26,7 +26,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class BaseItemIngotHot extends BaseItemIngot {
private final ItemStack outputIngot;
- private int tickCounter = 0;
+ private final int tickCounter = 0;
private final int tickCounterMax = 200;
private final int mTier;
@@ -66,7 +66,7 @@ public class BaseItemIngotHot extends BaseItemIngot {
public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
final boolean p_77663_5_) {
if (this.componentMaterial != null) {
- if (entityHolding != null && entityHolding instanceof EntityPlayer) {
+ if (entityHolding instanceof EntityPlayer) {
if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
EntityUtils.applyHeatDamageToEntity(1, world, entityHolding);
}
@@ -78,11 +78,7 @@ public class BaseItemIngotHot extends BaseItemIngot {
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
- if (Configuration.visual.useGregtechTextures) {
- return true;
- } else {
- return false;
- }
+ return Configuration.visual.useGregtechTextures;
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOld.java b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOld.java
index 28407a4557..827adb9bc3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOld.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOld.java
@@ -41,7 +41,7 @@ public class BaseItemIngotOld extends Item {
} else if (this.unlocalName.contains("itemHotIngot")) {
temp = this.unlocalName.replace("itemHotIngot", "ingotHot");
}
- if ((temp != null) && !temp.equals("")) {
+ if ((temp != null) && !temp.isEmpty()) {
GTOreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
// this.generateCompressorRecipe();
@@ -80,7 +80,7 @@ public class BaseItemIngotOld extends Item {
}
temp = temp.replace("itemIngot", "block");
Logger.WARNING("Generating OreDict Name: " + temp);
- if ((temp != null) && !temp.equals("")) {
+ if ((temp != null) && !temp.isEmpty()) {
tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
if (tempOutput != null) {
GTValues.RA.stdBuilder()
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
index 240c0851e1..41f3a2bf73 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
@@ -13,21 +13,20 @@ import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.interfaces.ITileTooltip;
public class ItemBlockMeta extends ItemBlockWithMetadata {
private final Block mBlock;
- private HashMap<Integer, ArrayList<String>> aTooltips = new LinkedHashMap<>();
+ private final HashMap<Integer, ArrayList<String>> aTooltips = new LinkedHashMap<>();
public ItemBlockMeta(final Block aBlock) {
super(aBlock, aBlock);
this.mBlock = aBlock;
this.setMaxDamage(0);
this.setHasSubtypes(true);
- if (aBlock instanceof ITileTooltip aTooltip) {
- // aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap());
- }
+ // if (aBlock instanceof ITileTooltip aTooltip) {
+ // aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap());
+ // }
}
@SuppressWarnings({ "unchecked", "rawtypes" })
diff --git a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
index 6c8e0ce81a..7f6f57223d 100644
--- a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
+++ b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
@@ -119,7 +119,7 @@ public class BaseItemMisc extends Item {
// Nothing Fancy here yet.
}
- public static enum MiscTypes {
+ public enum MiscTypes {
POTION("Potion", " Potion", "potion"),
KEY("Key", " Key", "key"),
@@ -133,7 +133,7 @@ public class BaseItemMisc extends Item {
private final String DISPLAY_NAME_SUFFIX;
private final String OREDICT_PREFIX;
- private MiscTypes(final String LocalName, final String DisplayNameSuffix, final String OreDictPrefix) {
+ MiscTypes(final String LocalName, final String DisplayNameSuffix, final String OreDictPrefix) {
this.TYPE = LocalName;
this.DISPLAY_NAME_SUFFIX = DisplayNameSuffix;
this.OREDICT_PREFIX = OreDictPrefix;
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
index 45ba089f15..01294556f7 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
@@ -112,7 +112,7 @@ public class BaseOreComponent extends Item {
@Override
public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list,
final boolean bool) {
- if (this.materialName != null && !this.materialName.equals("")) {
+ if (this.materialName != null && !this.materialName.isEmpty()) {
if (this.componentMaterial != null) {
if (!this.componentMaterial.vChemicalFormula.contains("?")) {
list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
@@ -133,7 +133,7 @@ public class BaseOreComponent extends Item {
}
} else {
String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
- if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
+ if (aChemicalFormula != null && !aChemicalFormula.isEmpty()) {
list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
}
}
@@ -166,10 +166,7 @@ public class BaseOreComponent extends Item {
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
- if (this.componentType.hasOverlay()) {
- return true;
- }
- return false;
+ return this.componentType.hasOverlay();
}
@Override
@@ -209,7 +206,6 @@ public class BaseOreComponent extends Item {
if (renderPass == 1) {
return Utils.rgbtoHexValue(230, 230, 230);
}
- return this.componentColour;
} else {
if (renderPass == 0 && !Configuration.visual.useGregtechTextures) {
return this.componentColour;
@@ -217,8 +213,8 @@ public class BaseOreComponent extends Item {
if (renderPass == 1 && Configuration.visual.useGregtechTextures) {
return Utils.rgbtoHexValue(230, 230, 230);
}
- return this.componentColour;
}
+ return this.componentColour;
}
@Override
@@ -229,7 +225,7 @@ public class BaseOreComponent extends Item {
return this.overlay;
}
- public static enum ComponentTypes {
+ public enum ComponentTypes {
DUST("dust", "", " Dust", true),
DUSTIMPURE("dustImpure", "Impure ", " Dust", true),
@@ -245,8 +241,7 @@ public class BaseOreComponent extends Item {
private final String DISPLAY_NAME;
private final boolean HAS_OVERLAY;
- private ComponentTypes(final String LocalName, final String prefix, final String DisplayName,
- final boolean overlay) {
+ ComponentTypes(final String LocalName, final String prefix, final String DisplayName, final boolean overlay) {
this.COMPONENT_NAME = LocalName;
this.PREFIX = prefix;
this.DISPLAY_NAME = DisplayName;
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
index 0279a396de..d36207c1d1 100644
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
+++ b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
@@ -42,7 +42,7 @@ public class BaseItemPlate_OLD extends Item {
this.setMaxStackSize(64);
this.colour = colour;
this.materialName = materialName;
- if (mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")) {
+ if (mChemicalFormula.isEmpty() || mChemicalFormula.equals("NullFormula")) {
this.chemicalNotation = StringUtils.subscript(materialName);
} else {
this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
@@ -53,7 +53,7 @@ public class BaseItemPlate_OLD extends Item {
if (this.unlocalName.toLowerCase()
.contains("itemplate")) {
temp = this.unlocalName.replace("itemP", "p");
- if ((temp != null) && !temp.equals("")) {
+ if ((temp != null) && !temp.isEmpty()) {
GTOreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
index f1184fb5bb..658ce1a535 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
@@ -29,9 +29,9 @@ public class BaseBauble extends Item implements IBauble {
/**
* Implementation suggestions taken from Botania.
*/
- private BaubleType mThisBauble;
+ private final BaubleType mThisBauble;
- private List<String> damageNegations = new ArrayList<>();
+ private final List<String> damageNegations = new ArrayList<>();
Multimap<String, AttributeModifier> attributes = HashMultimap.create();
public BaseBauble(BaubleType type) {
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
index 01cd0ec0c1..efe18ed70c 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
@@ -135,7 +135,7 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble {
try {
if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
- // Try Iterate Armour Slots of Player
+ // Try To Iterate Armour Slots of Player
if (aPlayer instanceof EntityPlayer) {
// amour
@@ -145,7 +145,7 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble {
continue;
}
if (ChargingHelper.isItemValid(aInvStack)) {
- double aTransferRate = 0;
+ double aTransferRate;
final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
if (electricItem != null) {
aTransferRate = electricItem.getTransferLimit(aInvStack);
@@ -166,28 +166,17 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble {
false);
ElectricItem.manager
.discharge(aBaubleStack, d, mTier, false, true, false);
- // Logger.INFO("Charging " + aInvStack.getDisplayName() + "
- // | " + d + " | "+electricItem.getMaxCharge(aInvStack));
}
- } else {
- // Logger.INFO("5");
}
- } else {
- // Logger.INFO("4");
}
- } else {
- // Logger.INFO("3");
}
- } else {
- // Logger.INFO("1");
}
+
}
}
}
- if (this.getCharge(aBaubleStack) > 0) {
- continue;
- } else {
+ if (!(this.getCharge(aBaubleStack) > 0)) {
break;
}
}
@@ -221,36 +210,22 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble {
.charge(aInvStack, aTransferRate, mTier, false, false);
ElectricItem.manager
.discharge(aBaubleStack, d, mTier, false, true, false);
- // Logger.INFO("Charging " + aInvStack.getDisplayName() + "
- // | " + d + " | "+electricItem.getMaxCharge(aInvStack));
}
- } else {
- // Logger.INFO("5");
}
- } else {
- // Logger.INFO("4");
}
- } else {
- // Logger.INFO("3");
}
- } else {
- // Logger.INFO("1");
}
}
}
}
- if (this.getCharge(aBaubleStack) > 0) {
- continue;
- } else {
+ if (!(this.getCharge(aBaubleStack) > 0)) {
break;
}
}
}
}
- } catch (Throwable t) {
-
- }
+ } catch (Throwable ignored) {}
}
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
index c1a4ae845a..5c587bc4c5 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
@@ -46,10 +46,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
public class AgriculturalChem extends ItemPackage {
- private static boolean aBOP;
- private static boolean aTiCon;
-
- private static ArrayList<FluidStack> mBloodFluids = new ArrayList<>();
+ private static final ArrayList<FluidStack> mBloodFluids = new ArrayList<>();
/**
* Fluids
@@ -294,8 +291,8 @@ public class AgriculturalChem extends ItemPackage {
public AgriculturalChem() {
super();
- aBOP = BiomesOPlenty.isModLoaded();
- aTiCon = TinkerConstruct.isModLoaded();
+ boolean aBOP = BiomesOPlenty.isModLoaded();
+ boolean aTiCon = TinkerConstruct.isModLoaded();
Logger.INFO("Adding Agrochemical content");
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
index 2fc6a2ab88..f89b69ec8b 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
@@ -668,7 +668,7 @@ public class MilledOreProcessing extends ItemPackage {
public boolean addRecipe(ItemStack aInput, ItemStack aOutput1, int[] aChances, int aTime, int aEU) {
aOutput1 = GTOreDictUnificator.get(true, aOutput1);
- ItemStack aOutputs[] = new ItemStack[4];
+ ItemStack[] aOutputs = new ItemStack[4];
for (int i = 0; i < aChances.length; i++) {
aOutputs[i] = aOutput1;
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
index 038a1ea8ce..b548192f47 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
@@ -23,7 +23,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class ItemGenericChemBase extends Item {
- protected final IIcon base[];
+ protected final IIcon[] base;
private final int aMetaSize = 34;
@@ -221,14 +221,10 @@ public class ItemGenericChemBase extends Item {
public boolean showDurabilityBar(ItemStack aStack) {
if (ItemUtils.isMillingBall(aStack)) {
int aDam = getMillingBallDamage(aStack);
- if (aDam > 0) {
- return true;
- }
+ return aDam > 0;
} else if (ItemUtils.isCatalyst(aStack)) {
int aDam = getCatalystDamage(aStack);
- if (aDam > 0) {
- return true;
- }
+ return aDam > 0;
}
return false;
}
diff --git a/src/main/java/gtPlusPlus/core/item/circuit/GTPPIntegratedCircuitItem.java b/src/main/java/gtPlusPlus/core/item/circuit/GTPPIntegratedCircuitItem.java
index e616004ec1..ec5548a9a3 100644
--- a/src/main/java/gtPlusPlus/core/item/circuit/GTPPIntegratedCircuitItem.java
+++ b/src/main/java/gtPlusPlus/core/item/circuit/GTPPIntegratedCircuitItem.java
@@ -72,16 +72,11 @@ public class GTPPIntegratedCircuitItem extends Item implements INetworkUpdatable
try {
aList.add("Configuration == " + aStack.getItemDamage());
aList.add(
- GTLanguageManager.addStringLocalization(
- new StringBuilder().append(getUnlocalizedName())
- .append(".tooltip.0")
- .toString(),
- "Right click to reconfigure"));
+ GTLanguageManager
+ .addStringLocalization(getUnlocalizedName() + ".tooltip.0", "Right click to reconfigure"));
aList.add(
GTLanguageManager.addStringLocalization(
- new StringBuilder().append(getUnlocalizedName())
- .append(".tooltip.1")
- .toString(),
+ getUnlocalizedName() + ".tooltip.1",
"Needs a screwdriver or circuit programming tool"));
} catch (Throwable t) {
t.printStackTrace();
diff --git a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
index 51bff6f12b..1b95cb7af9 100644
--- a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
+++ b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
@@ -19,7 +19,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class ItemDummyResearch extends ItemGenericToken {
- public static enum ASSEMBLY_LINE_RESEARCH {
+ public enum ASSEMBLY_LINE_RESEARCH {
RESEARCH_1_CONTAINMENT("Containment Fields", "Advanced scientific study"),
RESEARCH_2_BASIC_CHEM("Basic Chemistry", "Time to start at the beginning"),
@@ -36,14 +36,14 @@ public class ItemDummyResearch extends ItemGenericToken {
private final String mName;
private final String mDesc;
- private ASSEMBLY_LINE_RESEARCH(String aName, String aDesc) {
+ ASSEMBLY_LINE_RESEARCH(String aName, String aDesc) {
mName = aName;
mDesc = aDesc;
ModItems.itemDummyResearch.register(mName, mDesc);
}
}
- private static Map<String, Integer> mInternalNameToIdMap = new LinkedHashMap<>();
+ private static final Map<String, Integer> mInternalNameToIdMap = new LinkedHashMap<>();
public static ItemStack getResearchStack(ASSEMBLY_LINE_RESEARCH aResearchName, int aStacksize) {
Integer aMeta = mInternalNameToIdMap.get(Utils.sanitizeString(aResearchName.mName));
diff --git a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
index 5c38dde63b..72e74b2d2b 100644
--- a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
+++ b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
@@ -3,6 +3,7 @@ package gtPlusPlus.core.item.food;
import static gregtech.api.enums.Mods.GTPlusPlus;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -304,7 +305,7 @@ public class BaseItemMetaFood extends ItemFood {
public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
try {
String aTooltip = mTooltipMap.get(getMetaKey(aStack));
- if (aTooltip != null && aTooltip.length() > 0) {
+ if (aTooltip != null && !aTooltip.isEmpty()) {
aList.add(aTooltip);
}
} catch (Throwable t) {
@@ -422,10 +423,8 @@ public class BaseItemMetaFood extends ItemFood {
private static ArrayList<String> getOreDictNamesAsArrayList(String... aOreDictNames) {
ArrayList<String> aPackage = new ArrayList<>();
- if (aOreDictNames != null && aOreDictNames.length > 0) {
- for (String aEffect : aOreDictNames) {
- aPackage.add(aEffect);
- }
+ if (aOreDictNames != null) {
+ aPackage.addAll(Arrays.asList(aOreDictNames));
}
return aPackage;
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java b/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
index ee1afdb6bf..2fb6e67cd7 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
@@ -85,7 +85,7 @@ public class ItemBasicScrubberTurbine extends Item {
return true;
}
- public static final long getFilterDamage(final ItemStack aStack) {
+ public static long getFilterDamage(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("BasicTurbine");
@@ -98,7 +98,7 @@ public class ItemBasicScrubberTurbine extends Item {
return 0L;
}
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
+ public static boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("BasicTurbine");
@@ -133,8 +133,7 @@ public class ItemBasicScrubberTurbine extends Item {
}
double currentDamage = getFilterDamage(stack);
double meta = getMaxDurability(stack);
- double durabilitypercent = currentDamage / meta;
- return durabilitypercent;
+ return currentDamage / meta;
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
index c6e0743268..1f1848a90c 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -124,12 +124,11 @@ public class ItemBlueprint extends Item implements IItemBlueprint {
}
public ItemStack writeItemsToNBT(final ItemStack itemStack, final ItemStack[] craftingGrid) {
- final ItemStack[] blueprint = craftingGrid;
if (itemStack.hasTagCompound()) {
final NBTTagCompound nbt = itemStack.getTagCompound();
final NBTTagList list = new NBTTagList();
for (int i = 0; i < INV_SIZE; i++) {
- final ItemStack stack = blueprint[i];
+ final ItemStack stack = craftingGrid[i];
if (stack != null) {
final NBTTagCompound data = new NBTTagCompound();
stack.writeToNBT(data);
@@ -180,7 +179,6 @@ public class ItemBlueprint extends Item implements IItemBlueprint {
if (output != null) {
this.setBlueprintName(stack, output.getDisplayName());
- hasBP = true;
return true;
}
return false;
@@ -227,20 +225,20 @@ public class ItemBlueprint extends Item implements IItemBlueprint {
public boolean createNBT(final ItemStack itemStack) {
if (itemStack.hasTagCompound()) {
if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName")
- .equals("")) {
+ .isEmpty()) {
// No Blueprint and no name Set
Logger.WARNING("No Blueprint and no name Set");
return false;
} else if (itemStack.stackTagCompound.getBoolean("mBlueprint")
&& !itemStack.stackTagCompound.getString("mName")
- .equals("")) {
+ .isEmpty()) {
// Has Blueprint but invalid name set
Logger.WARNING("Has Blueprint but invalid name set");
return false;
} else
if (!itemStack.stackTagCompound.getBoolean("mBlueprint")
&& itemStack.stackTagCompound.getString("mName")
- .equals("")) {
+ .isEmpty()) {
// Has no Blueprint, but strangely has a name
Logger.WARNING("Has no Blueprint, but strangely has a name");
return false;
@@ -289,9 +287,6 @@ public class ItemBlueprint extends Item implements IItemBlueprint {
// o = itemStack.stackTagCompound.getInteger(tagNBT);
break;
}
- if (o != null) {
- return o;
- }
- return null;
+ return o;
}
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java b/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
index 7a0cbe3312..5325f33299 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
@@ -91,11 +91,10 @@ public class ItemGenericToken extends CoreItem {
sizes[1][3] = mRarities.size();
sizes[1][4] = mCustomNameColours.size();
// sizes[1][5] = mIcons.size();
- boolean b = sizes[0][0] > sizes[1][0] && sizes[0][1] > sizes[1][1]
+ return sizes[0][0] > sizes[1][0] && sizes[0][1] > sizes[1][1]
&& sizes[0][2] > sizes[1][2]
&& sizes[0][3] > sizes[1][3]
&& sizes[0][4] > sizes[1][4];
- return b;
}
// Handle Sub items
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index ed9bddfd18..42bdd05aa8 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -288,9 +288,8 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
}
}
}
- if (this.getCharge(baubleStack) <= (this.getMaxCharge(baubleStack) - getTransferLimit(baubleStack))) {
- continue;
- } else {
+ if (!(this.getCharge(baubleStack)
+ <= (this.getMaxCharge(baubleStack) - getTransferLimit(baubleStack)))) {
break;
}
}
@@ -357,7 +356,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
return true;
}
- public static final boolean getShowMessages(final ItemStack aStack) {
+ public static boolean getShowMessages(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT == null) {
if (!createNBT(aStack)) {
@@ -369,7 +368,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
return aNBT.getBoolean("ShowMSG");
}
- public static final boolean setShowMessages(final ItemStack aStack, final boolean aShow) {
+ public static boolean setShowMessages(final ItemStack aStack, final boolean aShow) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT == null) {
if (!createNBT(aStack)) {
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java b/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
index 2b5dd8883f..ac3255251e 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
@@ -36,7 +36,7 @@ public class ItemLavaFilter extends CoreItem {
private boolean setGregtechItemList() {
ItemList.Component_LavaFilter.set(this);
- return ItemList.Component_LavaFilter.get(1) != null ? true : false;
+ return ItemList.Component_LavaFilter.get(1) != null;
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
index 9b4dd86525..2972acd719 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
@@ -91,7 +91,7 @@ public class ItemMagicFeather extends CoreItem {
aBeaconData);
}
}
- return aBeaconData.size() > 0;
+ return !aBeaconData.isEmpty();
}
private static void findSuitableBeacon(EntityPlayer player, Collection<TileEntity> tileEntities,
diff --git a/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java b/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
index c186fccd4b..bb2b98de47 100644
--- a/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
+++ b/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
@@ -14,7 +14,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -58,7 +57,7 @@ public class ItemCustomSpawnEgg extends ItemMonsterPlacer {
aPrimaryColor,
aSecondaryColor,
EnumRarity.common,
- new ArrayList<String>());
+ new ArrayList<>());
}
public static void registerEntityForSpawnEgg(final int aMetaID, String parEntityToSpawnName, int aPrimaryColor,
@@ -84,7 +83,7 @@ public class ItemCustomSpawnEgg extends ItemMonsterPlacer {
/**
* Callback for item usage. If the item does something special on right clicking,
- *
+ * <p>
* he will have one of those. Return True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
@Override
@@ -92,91 +91,87 @@ public class ItemCustomSpawnEgg extends ItemMonsterPlacer {
int par5, int par6, int par7, float par8, float par9, float par10) {
if (par3World.isRemote) {
return true;
- } else {
- Block block = par3World.getBlock(par4, par5, par6);
- par4 += Facing.offsetsXForSide[par7];
- par5 += Facing.offsetsYForSide[par7];
- par6 += Facing.offsetsZForSide[par7];
- double d0 = 0.0D;
-
- if (par7 == 1 && block.getRenderType() == 11) {
- d0 = 0.5D;
- }
-
- Entity entity = spawnEntity(par1ItemStack, par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
+ }
+ Block block = par3World.getBlock(par4, par5, par6);
+ par4 += Facing.offsetsXForSide[par7];
+ par5 += Facing.offsetsYForSide[par7];
+ par6 += Facing.offsetsZForSide[par7];
+ double d0 = 0.0D;
+
+ if (par7 == 1 && block.getRenderType() == 11) {
+ d0 = 0.5D;
+ }
- if (entity != null) {
- if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
+ Entity entity = spawnEntity(par1ItemStack, par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
- if (!par2EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
+ if (entity != null) {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
}
- return true;
+ if (!par2EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
+ }
}
+
+ return true;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed.
- *
+ * <p>
* Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (par2World.isRemote) {
return par1ItemStack;
- } else {
- MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(
- par2World,
- par3EntityPlayer,
- true);
-
- if (movingobjectposition == null) {
- return par1ItemStack;
- } else {
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
- return par1ItemStack;
- }
+ }
+ MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(
+ par2World,
+ par3EntityPlayer,
+ true);
+
+ if (movingobjectposition != null) {
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
+ return par1ItemStack;
+ }
- if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) {
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) {
- return par1ItemStack;
- }
+ return par1ItemStack;
+ }
- if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
- Entity entity = spawnEntity(par1ItemStack, par2World, i, j, k);
+ if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
+ Entity entity = spawnEntity(par1ItemStack, par2World, i, j, k);
- if (entity != null) {
- if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
+ if (entity != null) {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
- if (!par3EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
+ if (!par3EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
}
}
}
-
- return par1ItemStack;
}
+
}
+ return par1ItemStack;
}
/**
* Spawns the creature specified by the egg's type in the location specified by
- *
+ * <p>
* the last three parameters. Parameters: world, entityID, x, y, z.
- *
+ *
* @param par1ItemStack
*/
public Entity spawnEntity(ItemStack par1ItemStack, World parWorld, double parX, double parY, double parZ) {
@@ -196,7 +191,7 @@ public class ItemCustomSpawnEgg extends ItemMonsterPlacer {
MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat() * 360.0F),
0.0F);
parWorld.spawnEntityInWorld(entityToSpawn);
- entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
+ entityToSpawn.onSpawnWithEgg(null);
entityToSpawn.playLivingSound();
} else {
// DEBUG
diff --git a/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java b/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
index 1524418038..5aa0072122 100644
--- a/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
+++ b/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
@@ -71,20 +71,20 @@ public class DustDecayable extends BaseItemTickable {
if (!a1 && !a2) {
if (entityHolding instanceof EntityPlayer) {
- ItemStack replacement = ItemUtils.getSimpleStack(getDecayResult());
// Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+replacement.getDisplayName()+".");
- final ItemStack tempTransform = replacement;
if (iStack.stackSize > 1) {
int u = iStack.stackSize;
- tempTransform.stackSize = u;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ ItemUtils.getSimpleStack(getDecayResult()).stackSize = u;
+ ((EntityPlayer) entityHolding).inventory
+ .addItemStackToInventory((ItemUtils.getSimpleStack(getDecayResult())));
for (int l = 0; l < u; l++) {
((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
}
} else {
- tempTransform.stackSize = 1;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ ItemUtils.getSimpleStack(getDecayResult()).stackSize = 1;
+ ((EntityPlayer) entityHolding).inventory
+ .addItemStackToInventory((ItemUtils.getSimpleStack(getDecayResult())));
((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
}
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java
index a8173571dc..f6533dad8e 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java
@@ -72,12 +72,7 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
if (aStack == null || aPlayer == null || aWorld == null || aWorld.isRemote) {
return false;
}
- if (!aWorld.isRemote && tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) {
- return true;
- } else {
- // return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_);
- return false;
- }
+ return tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ);
}
@Override
@@ -604,11 +599,8 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
return this;
}
- ArrayList<IItemBehaviour<ItemGregtechPump>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
+ ArrayList<IItemBehaviour<ItemGregtechPump>> tList = this.mItemBehaviors
+ .computeIfAbsent((short) aMetaValue, k -> new ArrayList<>(1));
tList.add(aBehavior);
return this;
}
@@ -648,7 +640,6 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
}
if (tRandomData == SubTag.NO_UNIFICATION) {
GTOreDictUnificator.addToBlacklist(rStack);
- continue;
}
}
}
@@ -681,7 +672,6 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
}
if (tUseOreDict) {
GTOreDictUnificator.registerOre(tRandomData, rStack);
- continue;
}
}
}
@@ -733,7 +723,7 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
String fluidname = aFluid.getFluid()
.getName();
int amount = aFluid.amount;
- if (fluidname != null && fluidname.length() > 0 && amount > 0) {
+ if (fluidname != null && !fluidname.isEmpty() && amount > 0) {
NBTUtils.setString(aStack, "mFluid", fluidname);
NBTUtils.setInteger(aStack, "mFluidAmount", amount);
}
@@ -777,8 +767,7 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
.getInteger("mCapacity");
}
int aMeta = this.getCorrectMetaForItemstack(container);
- int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
- return aCapacity;
+ return aMeta == 0 ? 2000 : aMeta == 1 ? 8000 : aMeta == 2 ? 32000 : 128000;
}
public int fill(ItemStack container, FluidStack resource) {
@@ -815,12 +804,7 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
if (aStoredFluid == null) {
Logger.INFO("Pump is empty, filling with tank fluids.");
FluidStack toConsume;
- int amountToConsume = 0;
- if (resource.amount >= aCapacity) {
- amountToConsume = aCapacity;
- } else {
- amountToConsume = resource.amount;
- }
+ int amountToConsume = Math.min(resource.amount, aCapacity);
toConsume = FluidUtils.getFluidStack(resource, amountToConsume);
if (toConsume != null && amountToConsume > 0) {
storeFluid(container, toConsume);
@@ -982,10 +966,8 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
if (discharge(aStack, removal, aTier, true, true, false) > 0) {
didDrain = true;
}
- } else if (aTier == 0) {
- didDrain = true;
} else {
- didDrain = false;
+ didDrain = aTier == 0;
}
if (didDrain) {
@@ -1181,7 +1163,7 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle
} else {
// Rewrite Fluid handling for Vanilla type tanks
- if (!IFluidHandler.class.isInstance(aTileEntity)) {
+ if (!(aTileEntity instanceof IFluidHandler)) {
Logger.INFO("Tile Was not an instance of IFluidHandler.");
return false;
}
diff --git a/src/main/java/gtPlusPlus/core/lib/VanillaColours.java b/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
index 70e7902fbf..b6ba98d424 100644
--- a/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
+++ b/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
@@ -27,7 +27,7 @@ public enum VanillaColours {
private final int r, g, b;
- private VanillaColours(int aR, int aG, int aB) {
+ VanillaColours(int aR, int aG, int aB) {
r = aR;
g = aG;
b = aB;
diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java
index 3dab9bde39..0e69ba88d5 100644
--- a/src/main/java/gtPlusPlus/core/material/Material.java
+++ b/src/main/java/gtPlusPlus/core/material/Material.java
@@ -457,11 +457,13 @@ public class Material {
if (hashSize2 + hashSize >= 9) {
b = String.valueOf(aValueForGen);
} else {
- String c = b;
+ StringBuilder c = new StringBuilder(b);
while (MathUtils.howManyPlaces(hashSize + c.length()) < 9) {
- c = c + c.hashCode();
+ c.append(
+ c.toString()
+ .hashCode());
}
- b = c;
+ b = c.toString();
}
}
@@ -471,7 +473,7 @@ public class Material {
} else {
valueR = a;
}
- short fc[] = new short[3];
+ short[] fc = new short[3];
int aIndex = 0;
for (char gg : valueR.toCharArray()) {
short ui = Short.parseShort("" + gg);
@@ -570,7 +572,7 @@ public class Material {
this.isRadioactive = true;
this.vRadiationLevel = (byte) radiationLevel;
} else {
- if (vMaterialInput.size() > 0) {
+ if (!vMaterialInput.isEmpty()) {
ArrayList<Byte> aDataSet = new ArrayList<>();
for (MaterialStack m : this.vMaterialInput) {
aDataSet.add(m.getStackMaterial().vRadiationLevel);
@@ -1183,11 +1185,8 @@ public class Material {
}
public final boolean hasSolidForm() {
- if (ItemUtils
- .checkForInvalidItems(new ItemStack[] { getDust(1), getBlock(1), getTinyDust(1), getSmallDust(1) })) {
- return true;
- }
- return false;
+ return ItemUtils
+ .checkForInvalidItems(new ItemStack[] { getDust(1), getBlock(1), getTinyDust(1), getSmallDust(1) });
}
public final ItemStack[] getMaterialComposites() {
@@ -1273,16 +1272,18 @@ public class Material {
final long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio);
if (smallestRatio.length > 0) {
- String tempRatioStringThing1 = "";
+ StringBuilder tempRatioStringThing1 = new StringBuilder();
for (long value : tempRatio) {
- tempRatioStringThing1 = tempRatioStringThing1 + value + " : ";
+ tempRatioStringThing1.append(value)
+ .append(" : ");
}
Logger.MATERIALS("Default Ratio: " + tempRatioStringThing1);
- String tempRatioStringThing = "";
+ StringBuilder tempRatioStringThing = new StringBuilder();
int tempSmallestCraftingUseSize = 0;
for (long l : smallestRatio) {
- tempRatioStringThing = tempRatioStringThing + l + " : ";
+ tempRatioStringThing.append(l)
+ .append(" : ");
tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + l);
}
// this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize;
@@ -1299,13 +1300,13 @@ public class Material {
return "";
}
Logger.MATERIALS("===============| Calculating Atomic Formula for " + this.localizedName + " |===============");
- if (!chemSymbol.equals("")) {
+ if (!chemSymbol.isEmpty()) {
return chemSymbol;
}
final ArrayList<MaterialStack> tempInput = this.vMaterialInput;
if (tempInput != null) {
if (!tempInput.isEmpty()) {
- String dummyFormula = "";
+ StringBuilder dummyFormula = new StringBuilder();
final long[] dummyFormulaArray = this.getSmallestRatio(tempInput);
if (dummyFormulaArray != null) {
if (dummyFormulaArray.length >= 1) {
@@ -1329,32 +1330,35 @@ public class Material {
if (aChemFormula.length() > 3
|| StringUtils.uppercaseCount(aChemFormula) > 1) {
- dummyFormula = dummyFormula + "("
- + aChemFormula
- + ")"
- + dummyFormulaArray[e];
+ dummyFormula.append("(")
+ .append(aChemFormula)
+ .append(")")
+ .append(dummyFormulaArray[e]);
} else {
- dummyFormula = dummyFormula + aChemFormula + dummyFormulaArray[e];
+ dummyFormula.append(aChemFormula)
+ .append(dummyFormulaArray[e]);
}
} else if (dummyFormulaArray[e] == 1) {
if (aChemFormula.length() > 3
|| StringUtils.uppercaseCount(aChemFormula) > 1) {
- dummyFormula = dummyFormula + "(" + aChemFormula + ")";
+ dummyFormula.append("(")
+ .append(aChemFormula)
+ .append(")");
} else {
- dummyFormula = dummyFormula + aChemFormula;
+ dummyFormula.append(aChemFormula);
}
} else {
- dummyFormula = dummyFormula + "??";
+ dummyFormula.append("??");
}
} else {
- dummyFormula = dummyFormula + "??";
+ dummyFormula.append("??");
}
} else {
- dummyFormula = dummyFormula + "??";
+ dummyFormula.append("??");
}
}
}
- return StringUtils.subscript(dummyFormula);
+ return StringUtils.subscript(dummyFormula.toString());
// return dummyFormula;
}
Logger.MATERIALS("dummyFormulaArray <= 0");
@@ -1371,7 +1375,7 @@ public class Material {
return isFluidQueued = true;
}
- public static final void generateQueuedFluids() {
+ public static void generateQueuedFluids() {
for (Material m : mMaterialMap) {
if (m.isFluidQueued) {}
}
@@ -1520,8 +1524,7 @@ public class Material {
if (this.mFluid == null) {
return null;
}
- final FluidStack moltenFluid = new FluidStack(this.mFluid, fluidAmount);
- return moltenFluid;
+ return new FluidStack(this.mFluid, fluidAmount);
}
public final boolean setFluid(Fluid aFluid) {
diff --git a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
index 48f52a9f7a..f21c40411f 100644
--- a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -82,10 +82,7 @@ public class MaterialGenerator {
FluidStack rFluidOut, Integer aTime, Integer aEu) {
RecipeGenFluidCanning g = new RecipeGenFluidCanning(false, aEmpty, aFullContainer, aFluidIn, null, null, 0);
- if (g != null && g.valid()) {
- return true;
- }
- return false;
+ return g != null && g.valid();
}
public static void generate(final Material matInfo) {
@@ -116,7 +113,7 @@ public class MaterialGenerator {
}
if (matInfo.getState() == MaterialState.SOLID) {
- if (generateEverything == true) {
+ if (generateEverything) {
if (sRadiation >= 1) {
tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
temp = new BaseItemIngot(matInfo);
@@ -156,7 +153,7 @@ public class MaterialGenerator {
temp = new BaseItemPlateDouble(matInfo);
}
} else if (matInfo.getState() == MaterialState.LIQUID) {
- if (generateEverything == true) {
+ if (generateEverything) {
tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
}
temp = new BaseItemIngot(matInfo);
@@ -197,8 +194,7 @@ public class MaterialGenerator {
return true;
} catch (final Throwable t) {
-
- Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ Logger.MATERIALS(matInfo.getLocalizedName() + " failed to generate.");
return false;
}
}
@@ -304,7 +300,7 @@ public class MaterialGenerator {
new RecipeGenPlasma(matInfo);
} catch (final Throwable t) {
- Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ Logger.MATERIALS(matInfo.getLocalizedName() + " failed to generate.");
}
}
@@ -324,8 +320,7 @@ public class MaterialGenerator {
final String unlocalizedName = matInfo.getUnlocalizedName();
final String materialName = matInfo.getLocalizedName();
- final short[] C = customRGB;
- final Integer Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+ final Integer Colour = Utils.rgbtoHexValue(customRGB[0], customRGB[1], customRGB[2]);
if (Colour == null) {
Logger.DEBUG_MATERIALS("Invalid Material while constructing " + materialName + ".");
@@ -421,7 +416,7 @@ public class MaterialGenerator {
new RecipeGenPlasma(matInfo);
return true;
} catch (final Throwable t) {
- Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ Logger.MATERIALS(matInfo.getLocalizedName() + " failed to generate.");
t.printStackTrace();
return false;
}
diff --git a/src/main/java/gtPlusPlus/core/material/MaterialsAlloy.java b/src/main/java/gtPlusPlus/core/material/MaterialsAlloy.java
index 53017a4d29..6c54c3b545 100644
--- a/src/main/java/gtPlusPlus/core/material/MaterialsAlloy.java
+++ b/src/main/java/gtPlusPlus/core/material/MaterialsAlloy.java
@@ -303,7 +303,7 @@ public final class MaterialsAlloy {
-1,
true, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack(MaterialsElements.getInstance().IRON, 06),
+ new MaterialStack(MaterialsElements.getInstance().IRON, 6),
new MaterialStack(MaterialsElements.getInstance().COBALT, 2),
new MaterialStack(MaterialsElements.getInstance().MOLYBDENUM, 24),
new MaterialStack(MaterialsElements.getInstance().CHROMIUM, 6),
diff --git a/src/main/java/gtPlusPlus/core/material/MaterialsElements.java b/src/main/java/gtPlusPlus/core/material/MaterialsElements.java
index e8cc6ee8f7..c92deae057 100644
--- a/src/main/java/gtPlusPlus/core/material/MaterialsElements.java
+++ b/src/main/java/gtPlusPlus/core/material/MaterialsElements.java
@@ -576,12 +576,13 @@ public final class MaterialsElements {
false,
"Òˆ",
0,
- new MaterialStack[] { new MaterialStack(getInstance().LEAD, 15),
- new MaterialStack(getInstance().MANGANESE, 25), new MaterialStack(getInstance().CARBON, 60) }); // Not
- // a
- // GT
- // Inherited
- // Material
+ new MaterialStack(getInstance().LEAD, 15),
+ new MaterialStack(getInstance().MANGANESE, 25),
+ new MaterialStack(getInstance().CARBON, 60)); // Not
+ // a
+ // GT
+ // Inherited
+ // Material
public static final Material WHITE_METAL = new Material(
"White Metal",
MaterialState.SOLID,
@@ -594,9 +595,10 @@ public final class MaterialsElements {
false,
"Ò‰",
0,
- new MaterialStack[] { new MaterialStack(getInstance().COPPER, 5),
- new MaterialStack(getInstance().ANTIMONY, 10), new MaterialStack(getInstance().PLATINUM, 10),
- new MaterialStack(getInstance().TIN, 75) }); // Not a GT Inherited Material
+ new MaterialStack(getInstance().COPPER, 5),
+ new MaterialStack(getInstance().ANTIMONY, 10),
+ new MaterialStack(getInstance().PLATINUM, 10),
+ new MaterialStack(getInstance().TIN, 75)); // Not a GT Inherited Material
public static final Material GRANITE = new Material(
"Ancient Granite",
@@ -611,15 +613,18 @@ public final class MaterialsElements {
"«»",
0,
false,
- new MaterialStack[] { new MaterialStack(getInstance().OXYGEN, 16),
- new MaterialStack(getInstance().IRON, 10), new MaterialStack(getInstance().SILICONDIOXIDE, 10),
- new MaterialStack(getInstance().ALUMINIUMOXIDE, 6), new MaterialStack(getInstance().POTASSIUM, 6),
- new MaterialStack(getInstance().CALCIUM, 4), new MaterialStack(getInstance().SODIUM, 4),
- new MaterialStack(getInstance().YTTERBIUM, 2) }); // Not
- // a
- // GT
- // Inherited
- // Material
+ new MaterialStack(getInstance().OXYGEN, 16),
+ new MaterialStack(getInstance().IRON, 10),
+ new MaterialStack(getInstance().SILICONDIOXIDE, 10),
+ new MaterialStack(getInstance().ALUMINIUMOXIDE, 6),
+ new MaterialStack(getInstance().POTASSIUM, 6),
+ new MaterialStack(getInstance().CALCIUM, 4),
+ new MaterialStack(getInstance().SODIUM, 4),
+ new MaterialStack(getInstance().YTTERBIUM, 2)); // Not
+ // a
+ // GT
+ // Inherited
+ // Material
public static final Material RUNITE = new Material(
"Runite",
diff --git a/src/main/java/gtPlusPlus/core/material/Particle.java b/src/main/java/gtPlusPlus/core/material/Particle.java
index fefb3f4497..f33a795a07 100644
--- a/src/main/java/gtPlusPlus/core/material/Particle.java
+++ b/src/main/java/gtPlusPlus/core/material/Particle.java
@@ -95,13 +95,13 @@ public class Particle {
UNKNOWN = new Particle(ElementaryGroup.UNKNOWN, "Unknown");
}
- public static enum ElementaryGroup {
+ public enum ElementaryGroup {
QUARK,
LEPTON,
BOSON,
BARYON,
MESON,
- UNKNOWN;
+ UNKNOWN
}
public final ElementaryGroup mParticleType;
diff --git a/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsFluorides.java b/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsFluorides.java
index f3ae16c644..120e42584b 100644
--- a/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsFluorides.java
+++ b/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsFluorides.java
@@ -20,10 +20,10 @@ public class MaterialsFluorides {
false, // Uses Blast furnace?
false, // Generate cells
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().CALCIUM, 16),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 32),
- new MaterialStack(MaterialsElements.getInstance().IRON, 4),
- new MaterialStack(MaterialsElements.getInstance().CARBON, 2) });
+ new MaterialStack(MaterialsElements.getInstance().CALCIUM, 16),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 32),
+ new MaterialStack(MaterialsElements.getInstance().IRON, 4),
+ new MaterialStack(MaterialsElements.getInstance().CARBON, 2));
// ThF4
public static final Material THORIUM_TETRAFLUORIDE = new Material(
@@ -36,8 +36,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().THORIUM232, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4) });
+ new MaterialStack(MaterialsElements.getInstance().THORIUM232, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4));
// ThF6
public static final Material THORIUM_HEXAFLUORIDE = new Material(
@@ -50,9 +50,9 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().THORIUM232, 1),
- new MaterialStack(MaterialsElements.getInstance().THORIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 12) });
+ new MaterialStack(MaterialsElements.getInstance().THORIUM232, 1),
+ new MaterialStack(MaterialsElements.getInstance().THORIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 12));
// UF4
public static final Material URANIUM_TETRAFLUORIDE = new Material(
@@ -65,8 +65,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().URANIUM233, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4) });
+ new MaterialStack(MaterialsElements.getInstance().URANIUM233, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4));
// UF6
public static final Material URANIUM_HEXAFLUORIDE = new Material(
@@ -79,8 +79,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2) });
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2));
// ZrF4
@@ -99,8 +99,8 @@ public class MaterialsFluorides {
-1,
true,
false,
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().ZIRCONIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4) });
+ new MaterialStack(MaterialsElements.getInstance().ZIRCONIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4));
/*
* public static final Material ZIRCONIUM_TETRAFLUORIDE = new Material( "Zirconium Tetrafluoride", //Material Name
@@ -121,8 +121,8 @@ public class MaterialsFluorides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2) });
+ new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2));
// LiF
public static final Material LITHIUM_FLUORIDE = new Material(
@@ -135,8 +135,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().LITHIUM7, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 1) });
+ new MaterialStack(MaterialsElements.getInstance().LITHIUM7, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 1));
// LFTR sub components
@@ -151,9 +151,9 @@ public class MaterialsFluorides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialMisc.AMMONIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().HYDROGEN, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2) });
+ new MaterialStack(MaterialMisc.AMMONIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().HYDROGEN, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2));
// Be(OH)2
public static final Material BERYLLIUM_HYDROXIDE = new Material(
@@ -166,8 +166,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
- new MaterialStack(MaterialMisc.HYDROXIDE, 2) });
+ new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
+ new MaterialStack(MaterialMisc.HYDROXIDE, 2));
// (NH4)2BeF4
public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material(
@@ -180,9 +180,9 @@ public class MaterialsFluorides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialMisc.AMMONIUM, 2),
- new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4) });
+ new MaterialStack(MaterialMisc.AMMONIUM, 2),
+ new MaterialStack(MaterialsElements.getInstance().BERYLLIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 4));
// LFTR Output
public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material(
@@ -195,8 +195,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().NEPTUNIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6) });
+ new MaterialStack(MaterialsElements.getInstance().NEPTUNIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6));
public static final Material TECHNETIUM_HEXAFLUORIDE = new Material(
"Technetium Hexafluoride", // Material Name
@@ -208,8 +208,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().TECHNETIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6) });
+ new MaterialStack(MaterialsElements.getInstance().TECHNETIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6));
public static final Material SELENIUM_HEXAFLUORIDE = new Material(
"Selenium Hexafluoride", // Material Name
@@ -221,8 +221,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().SELENIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6) });
+ new MaterialStack(MaterialsElements.getInstance().SELENIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 6));
public static final Material SODIUM_FLUORIDE = new Material(
"Sodium Fluoride", // Material Name
@@ -234,8 +234,8 @@ public class MaterialsFluorides {
-1, // Neutrons
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().SODIUM, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 1) });
+ new MaterialStack(MaterialsElements.getInstance().SODIUM, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 1));
private static final MaterialsFluorides INSTANCE = new MaterialsFluorides();
diff --git a/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsNuclides.java b/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsNuclides.java
index 8d74ef9ab8..0e5c1592df 100644
--- a/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsNuclides.java
+++ b/src/main/java/gtPlusPlus/core/material/nuclear/MaterialsNuclides.java
@@ -22,8 +22,8 @@ public final class MaterialsNuclides {
StringUtils.subscript(StringUtils.superscript("7") + "Li2BeF4"), // Chemical Formula
4, // Radioactivity Level
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 2),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 2),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1));
public static final Material LiFBeF2ThF4UF4 = new Material(
"LFTR Fuel 3", // Material Name
@@ -38,10 +38,10 @@ public final class MaterialsNuclides {
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4UF4"), // Chemical Formula
5, // Radioactivity Level
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 65),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 28),
- new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 65),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 28),
+ new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1));
public static final Material LiFBeF2ZrF4UF4 = new Material(
"LFTR Fuel 2", // Material Name
@@ -56,10 +56,10 @@ public final class MaterialsNuclides {
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ZrF4UF4"), // Chemical Formula
5, // Radioactivity Level
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 65),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 28),
- new MaterialStack(MaterialsFluorides.ZIRCONIUM_TETRAFLUORIDE, 5),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 2) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 65),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 28),
+ new MaterialStack(MaterialsFluorides.ZIRCONIUM_TETRAFLUORIDE, 5),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 2));
public static final Material LiFBeF2ZrF4U235 = new Material(
"LFTR Fuel 1", // Material Name
@@ -75,10 +75,10 @@ public final class MaterialsNuclides {
// Formula
5, // Radioactivity Level
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 55),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 25),
- new MaterialStack(MaterialsFluorides.ZIRCONIUM_TETRAFLUORIDE, 6),
- new MaterialStack(MaterialsElements.getInstance().URANIUM235, 14) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 55),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 25),
+ new MaterialStack(MaterialsFluorides.ZIRCONIUM_TETRAFLUORIDE, 6),
+ new MaterialStack(MaterialsElements.getInstance().URANIUM235, 14));
// Misc
public static final Material BurntLftrFuel_MK1 = new Material(
@@ -92,10 +92,10 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiBeF2UF4FP"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().LITHIUM, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1) });
+ new MaterialStack(MaterialsElements.getInstance().LITHIUM, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1));
public static final Material BurntLftrFuel_MK2 = new Material(
"Burnt Reactor Fuel II", // Material Name
@@ -108,10 +108,10 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiBeF2UF4FP"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().LITHIUM, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1) });
+ new MaterialStack(MaterialsElements.getInstance().LITHIUM, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1));
// LFTR Core Fluids
public static final Material LiFBeF2UF4FP = new Material(
@@ -125,10 +125,10 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4FP"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1));
public static final Material Sparged_LiFBeF2UF4FP = new Material(
"Helium Sparged U Salt", // Material Name
@@ -141,10 +141,10 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4FP"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().PROTACTINIUM, 1));
public static final Material UF6F2FP = new Material(
"Phosphorous Uranium Hexafluoride (P-UF6)", // Material Name
@@ -157,9 +157,9 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript("UF6F2FP"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.URANIUM_HEXAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 3),
- new MaterialStack(MaterialsElements.getInstance().PHOSPHORUS, 1) });
+ new MaterialStack(MaterialsFluorides.URANIUM_HEXAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 3),
+ new MaterialStack(MaterialsElements.getInstance().PHOSPHORUS, 1));
public static final Material LiFBeF2 = new Material(
"Stable Molten Salt Base", // Material Name
@@ -172,8 +172,8 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1));
public static final Material LiFBeF2UF4 = new Material(
"LFTR Fuel Base", // Material Name
@@ -186,8 +186,8 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(LiFBeF2, 1),
- new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(LiFBeF2, 1),
+ new MaterialStack(MaterialsFluorides.URANIUM_TETRAFLUORIDE, 1));
// LFTR Blanket Fluids
@@ -203,8 +203,8 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFThF4"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1));
// Tier 2 Fuel blanket output
public static final Material LiFBeF2ThF4 = new Material(
@@ -218,9 +218,9 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1));
// Tier 1 Fuel blanket output
public static final Material Sparged_LiFThF4 = new Material(
@@ -234,8 +234,8 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFThF4"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1));
// Tier 2 Fuel blanket output
public static final Material Sparged_LiFBeF2ThF4 = new Material(
@@ -249,9 +249,9 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1) });
+ new MaterialStack(MaterialsFluorides.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(MaterialsFluorides.THORIUM_TETRAFLUORIDE, 1));
public static final Material UF6F2 = new Material(
"Fluorinated Uranium Hexafluoride (F-UF6)", // Material Name
@@ -264,8 +264,8 @@ public final class MaterialsNuclides {
false, // Uses Blast furnace?
StringUtils.subscript("UF6F2"), // Chemical Formula
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsFluorides.URANIUM_HEXAFLUORIDE, 1),
- new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2) });
+ new MaterialStack(MaterialsFluorides.URANIUM_HEXAFLUORIDE, 1),
+ new MaterialStack(MaterialsElements.getInstance().FLUORINE, 2));
// Secondary material is molten metal
public static final Material NAQ_FUEL_T1 = new Material(
@@ -278,8 +278,8 @@ public final class MaterialsNuclides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().NAQUADAH, 2),
- new MaterialStack(MaterialsElements.getInstance().TANTALUM, 3) });
+ new MaterialStack(MaterialsElements.getInstance().NAQUADAH, 2),
+ new MaterialStack(MaterialsElements.getInstance().TANTALUM, 3));
// Secondary material is a plasma
public static final Material NAQ_FUEL_T2 = new Material(
@@ -292,8 +292,8 @@ public final class MaterialsNuclides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().NAQUADAH_ENRICHED, 2),
- new MaterialStack(MaterialsElements.getInstance().TITANIUM, 3) });
+ new MaterialStack(MaterialsElements.getInstance().NAQUADAH_ENRICHED, 2),
+ new MaterialStack(MaterialsElements.getInstance().TITANIUM, 3));
// Secondary material is a plasma
public static final Material NAQ_FUEL_T3 = new Material(
@@ -306,8 +306,8 @@ public final class MaterialsNuclides {
-1,
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
- new MaterialStack[] { new MaterialStack(MaterialsElements.getInstance().NAQUADRIA, 2),
- new MaterialStack(MaterialsElements.getInstance().AMERICIUM, 3) });
+ new MaterialStack(MaterialsElements.getInstance().NAQUADRIA, 2),
+ new MaterialStack(MaterialsElements.getInstance().AMERICIUM, 3));
private static final MaterialsNuclides INSTANCE = new MaterialsNuclides();
diff --git a/src/main/java/gtPlusPlus/core/material/state/MaterialState.java b/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
index 9fb5cde101..174b40be86 100644
--- a/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
+++ b/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
@@ -12,7 +12,7 @@ public enum MaterialState {
private final int STATE;
- private MaterialState(final int State) {
+ MaterialState(final int State) {
this.STATE = State;
}
diff --git a/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java b/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
index ef43795206..0a2ed84079 100644
--- a/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
+++ b/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
@@ -4,5 +4,5 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
public interface AbstractPacket extends IMessage {
- public abstract String getPacketName();
+ String getPacketName();
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java b/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java
index d110124086..a481772961 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java
@@ -474,54 +474,54 @@ public class RecipesGeneral {
CI.component_Plate[9],
ItemList.Hatch_Input_ZPM.get(1),
CI.component_Plate[8],
- GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0]));
+ GregtechItemList.Hatch_Input_Naquadah.get(1L));
if (GTMod.gregtechproxy.mPollution) {
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_LV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_LV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_LV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_LV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_LV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_MV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_MV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_MV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_MV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_MV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_MV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_HV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_HV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_HV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_HV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_HV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_HV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_EV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_EV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_EV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_EV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_EV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_EV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_IV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_IV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_IV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_IV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_IV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_IV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_LuV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_LuV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LuV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_LuV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_LuV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_LuV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_ZPM.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_ZPM.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_ZPM.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_ZPM.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_ZPM.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_ZPM.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_UV.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_UV.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_UV.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_UV.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_UV.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_UV.get(1) });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Hatch_Muffler_Adv_MAX.get(1L, new Object[0]),
+ GregtechItemList.Hatch_Muffler_Adv_MAX.get(1L),
bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_MAX.get(1),
- Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_MAX.get(1) });
+ new Object[] { "M", "P", 'M', ItemList.Hatch_Muffler_MAX.get(1), 'P',
+ GregtechItemList.Pollution_Cleaner_MAX.get(1) });
}
}
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java
index f6091cda68..265cd60f97 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java
@@ -172,7 +172,7 @@ public class RecipesMachines {
// Misc
public static ItemStack INPUT_RCCokeOvenBlock;
- public static final void loadRecipes() {
+ public static void loadRecipes() {
run();
Logger.INFO("Loading Recipes for the Various machine blocks.");
}
@@ -3299,7 +3299,7 @@ public class RecipesMachines {
private static void fakeMachineCasingCovers() {
int aMaxTier = GTValues.VOLTAGE_NAMES.length;
- ItemStack aTier[] = new ItemStack[aMaxTier];
+ ItemStack[] aTier = new ItemStack[aMaxTier];
for (int i = 0; i < aMaxTier; i++) {
aTier[i] = ItemUtils.simpleMetaStack(CoverManager.Cover_Gt_Machine_Casing, i, 7);
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/common/CI.java b/src/main/java/gtPlusPlus/core/recipe/common/CI.java
index addc3df7e4..525c43883c 100644
--- a/src/main/java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/main/java/gtPlusPlus/core/recipe/common/CI.java
@@ -287,18 +287,17 @@ public class CI {
public static String getTieredComponent(OrePrefixes type, int tier) {
Object material = getMaterialFromTier(tier);
if (material != null) {
+ String materialName;
if (material instanceof Materials) {
// return (ItemStack) type.get(material);
- String materialName = ((Materials) material).mDefaultLocalName;
- Logger.INFO("Searching for a component named " + type.name() + materialName);
+ materialName = ((Materials) material).mDefaultLocalName;
// return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
- return (type.name() + materialName);
} else {
- String materialName = (Utils.sanitizeString(((Material) material).getLocalizedName()));
- Logger.INFO("Searching for a component named " + type.name() + materialName);
+ materialName = (Utils.sanitizeString(((Material) material).getLocalizedName()));
// return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
- return (type.name() + materialName);
}
+ Logger.INFO("Searching for a component named " + type.name() + materialName);
+ return (type.name() + materialName);
}
Logger.INFO("[Components] Failed getting a tiered component. " + type.name() + " | " + tier);
return null;
@@ -517,8 +516,7 @@ public class CI {
if (aPrefix == OrePrefixes.liquid) {
int aMatID = (aTier == 0 || aTier == 2 || aTier == 5 || aTier == 8 ? 0
: (aTier == 1 || aTier == 3 || aTier == 6 || aTier == 9 ? 1 : 2));
- ItemStack aCell = aMaster[aMatID][aTier].getCell(aAmount);
- return aCell;
+ return aMaster[aMatID][aTier].getCell(aAmount);
}
if (aPrefix == OrePrefixes.circuit) {
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java b/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
index 03581ef705..eaf8b1b239 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
@@ -18,7 +18,7 @@ public class SlotCraftingNoCollect extends SlotCrafting {
/** The craft matrix inventory linked to this result slot. */
private final IInventory craftMatrix;
/** The player that is using the GUI where this slot resides. */
- private EntityPlayer thePlayer;
+ private final EntityPlayer thePlayer;
/**
* The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset.
*/
diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
index d5d348e0d8..35a569578f 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
@@ -1,5 +1,6 @@
package gtPlusPlus.core.tileentities.base;
+import java.util.Arrays;
import java.util.UUID;
import net.minecraft.block.Block;
@@ -170,9 +171,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean isServerSide() {
if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- return true;
- }
+ return !this.getWorldObj().isRemote;
}
return false;
}
@@ -197,7 +196,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean hasCustomInventoryName() {
- return this.customName != null && !this.customName.equals("");
+ return this.customName != null && !this.customName.isEmpty();
}
@Override
@@ -294,7 +293,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean isValidSlot(int aIndex) {
- return this.canAccessData() ? this.mInventory.isValidSlot(aIndex) : false;
+ return this.canAccessData() && this.mInventory.isValidSlot(aIndex);
}
private final CoverBehavior[] mCoverBehaviors = new CoverBehavior[] { GregTechAPI.sNoBehavior,
@@ -305,35 +304,52 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
protected boolean mReleaseEnergy = false;
protected int[] mAverageEUInput = new int[11], mAverageEUOutput = new int[11];
- private boolean[] mActiveEUInputs = new boolean[] { false, false, false, false, false, false },
- mActiveEUOutputs = new boolean[] { false, false, false, false, false, false };
- private byte[] mSidedRedstone = new byte[] { 15, 15, 15, 15, 15, 15 };
- private int[] mCoverSides = new int[] { 0, 0, 0, 0, 0, 0 }, mCoverData = new int[] { 0, 0, 0, 0, 0, 0 },
- mTimeStatistics = new int[GregTechAPI.TICKS_FOR_LAG_AVERAGING];
+ private final boolean[] mActiveEUInputs = new boolean[] { false, false, false, false, false, false };
+ private final boolean[] mActiveEUOutputs = new boolean[] { false, false, false, false, false, false };
+ private final byte[] mSidedRedstone = new byte[] { 15, 15, 15, 15, 15, 15 };
+ private final int[] mCoverSides = new int[] { 0, 0, 0, 0, 0, 0 };
+ private final int[] mCoverData = new int[] { 0, 0, 0, 0, 0, 0 };
+ private final int[] mTimeStatistics = new int[GregTechAPI.TICKS_FOR_LAG_AVERAGING];
private boolean mHasEnoughEnergy = true;
protected boolean mRunningThroughTick = false;
protected boolean mInputDisabled = false;
protected boolean mOutputDisabled = false;
- private boolean mMuffler = false;
- private boolean mLockUpgrade = false;
- private boolean mActive = false;
+ private final boolean mMuffler = false;
+ private final boolean mLockUpgrade = false;
+ private final boolean mActive = false;
private boolean mRedstone = false;
- private boolean mWorkUpdate = false;
- private boolean mSteamConverter = false;
+ private final boolean mWorkUpdate = false;
+ private final boolean mSteamConverter = false;
private boolean mInventoryChanged = false;
- private boolean mWorks = true;
- private boolean mNeedsUpdate = true;
- private boolean mNeedsBlockUpdate = true;
+ private final boolean mWorks = true;
+ private final boolean mNeedsUpdate = true;
+ private final boolean mNeedsBlockUpdate = true;
private boolean mSendClientData = false;
- private boolean oRedstone = false;
- private boolean mEnergyStateReady = false;
- private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0,
- oTexturePage = 0, oLightValueClient = -1, oLightValue = -1, mLightValue = 0, mOtherUpgrades = 0, mFacing = 0,
- oFacing = 0, mWorkData = 0;
- private int mDisplayErrorCode = 0, oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0, mLagWarningCount = 0;
- private short mID = 0;
+ private final boolean oRedstone = false;
+ private final boolean mEnergyStateReady = false;
+ private final byte mColor = 0;
+ private final byte oColor = 0;
+ private byte mStrongRedstone = 0;
+ private final byte oRedstoneData = 63;
+ private final byte oTextureData = 0;
+ private final byte oUpdateData = 0;
+ private final byte oTexturePage = 0;
+ private final byte oLightValueClient = -1;
+ private final byte oLightValue = -1;
+ private byte mLightValue = 0;
+ private final byte mOtherUpgrades = 0;
+ private final byte mFacing = 0;
+ private final byte oFacing = 0;
+ private final byte mWorkData = 0;
+ private final int mDisplayErrorCode = 0;
+ private final int oX = 0;
+ private final int oY = 0;
+ private final int oZ = 0;
+ private final int mTimeStatisticsIndex = 0;
+ private final int mLagWarningCount = 0;
+ private final short mID = 0;
protected long mTickTimer = 0;
- private long oOutput = 0;
+ private final long oOutput = 0;
private long mAcceptedAmperes = Long.MAX_VALUE;
/**
@@ -393,8 +409,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- return !this.canAccessData() ? false
- : (this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy));
+ return this.canAccessData() && (this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy));
}
@Override
@@ -411,16 +426,14 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean inputEnergyFrom(ForgeDirection side) {
- return side == ForgeDirection.UNKNOWN ? true
- : (!this.isServerSide() ? this.isEnergyInputSide(side)
- : side != ForgeDirection.UNKNOWN && this.mActiveEUInputs[side.ordinal()] && !this.mReleaseEnergy);
+ return side == ForgeDirection.UNKNOWN || (!this.isServerSide() ? this.isEnergyInputSide(side)
+ : side != ForgeDirection.UNKNOWN && this.mActiveEUInputs[side.ordinal()] && !this.mReleaseEnergy);
}
@Override
public boolean outputsEnergyTo(ForgeDirection side) {
- return side == ForgeDirection.UNKNOWN ? true
- : (!this.isServerSide() ? this.isEnergyOutputSide(side)
- : side != ForgeDirection.UNKNOWN && this.mActiveEUOutputs[side.ordinal()] || this.mReleaseEnergy);
+ return side == ForgeDirection.UNKNOWN || (!this.isServerSide() ? this.isEnergyOutputSide(side)
+ : side != ForgeDirection.UNKNOWN && this.mActiveEUOutputs[side.ordinal()] || this.mReleaseEnergy);
}
private boolean isEnergyInputSide(ForgeDirection side) {
@@ -482,9 +495,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
}
protected final void clearTileEntityBuffer() {
- for (int i = 0; i < this.mBufferedTileEntities.length; ++i) {
- this.mBufferedTileEntities[i] = null;
- }
+ Arrays.fill(this.mBufferedTileEntities, null);
}
@Override
@@ -755,22 +766,19 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public final boolean getSky(int aX, int aY, int aZ) {
return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? true
- : this.worldObj.canBlockSeeTheSky(aX, aY, aZ);
+ || this.worldObj.canBlockSeeTheSky(aX, aY, aZ);
}
@Override
public final boolean getOpacity(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? false
- : GTUtility.isOpaqueBlock(this.worldObj, aX, aY, aZ);
+ return (!this.ignoreUnloadedChunks || !this.crossedChunkBorder(aX, aZ) || this.worldObj.blockExists(aX, aY, aZ))
+ && GTUtility.isOpaqueBlock(this.worldObj, aX, aY, aZ);
}
@Override
public final boolean getAir(int aX, int aY, int aZ) {
return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? true
- : GTUtility.isBlockAir(this.worldObj, aX, aY, aZ);
+ || GTUtility.isBlockAir(this.worldObj, aX, aY, aZ);
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
index 4b687f63af..8a85234447 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
@@ -48,9 +48,7 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
public final boolean hasCircuitToConfigure() {
for (ItemStack i : this.getInventory()
.getInventory()) {
- if (i == null) {
- continue;
- } else {
+ if (i != null) {
return true;
}
}
@@ -66,10 +64,7 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
.getInventory()
.clone();
// Check if there is output in slot.
- Boolean hasOutput = false;
- if (aInputs[25] != null) {
- hasOutput = true;
- }
+ boolean hasOutput = aInputs[25] != null;
ArrayList<Integer> aValidSlots = new ArrayList<>();
int aSlotCount = 0;
for (ItemStack i : aInputs) {
@@ -127,7 +122,6 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
}
}
}
- continue;
}
return false;
}
@@ -144,7 +138,7 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
}
this.tickCount++;
}
- } catch (final Throwable t) {}
+ } catch (final Throwable ignored) {}
}
public boolean anyPlayerInRange() {
@@ -283,7 +277,7 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
@Override
public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
+ return (this.customName != null) && !this.customName.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
index a6754b00b0..dd1ea934f8 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
@@ -284,7 +284,7 @@ public class TileEntityDecayablesChest extends TileEntity implements ISidedInven
@Override
public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
+ return (this.customName != null) && !this.customName.isEmpty();
}
/**
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
index fd528c589d..b0d4fb9296 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
@@ -54,17 +54,15 @@ public class TileEntityInfiniteFluid extends TileEntity implements IFluidHandler
fluid = null;
}
- if (this != null) {
- FluidEvent.fireEvent(
- new FluidEvent.FluidDrainingEvent(
- fluid,
- this.getWorldObj(),
- this.xCoord,
- this.yCoord,
- this.zCoord,
- this.tank,
- 0));
- }
+ FluidEvent.fireEvent(
+ new FluidEvent.FluidDrainingEvent(
+ fluid,
+ this.getWorldObj(),
+ this.xCoord,
+ this.yCoord,
+ this.zCoord,
+ this.tank,
+ 0));
}
return stack;
}
@@ -88,8 +86,7 @@ public class TileEntityInfiniteFluid extends TileEntity implements IFluidHandler
needsUpdate = true;
float amount = tank.getFluidAmount();
float capacity = tank.getCapacity();
- float volume = (amount / capacity) * 0.8F;
- return volume;
+ return (amount / capacity) * 0.8F;
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
index 14c337c088..1c5a34e2ca 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
@@ -124,7 +124,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide
.clone();
// Check if there is output in slot.
- Boolean hasOutput = false;
+ boolean hasOutput = false;
if (aInputs[ContainerVolumetricFlaskSetter.SLOT_OUTPUT] != null) {
hasOutput = true;
if (aInputs[ContainerVolumetricFlaskSetter.SLOT_OUTPUT].stackSize >= 16) {
@@ -220,7 +220,6 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide
}
}
}
- continue;
}
return false;
}
@@ -378,7 +377,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide
@Override
public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
+ return (this.customName != null) && !this.customName.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
index 6f0d5fcea2..83a56ff287 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
@@ -93,7 +93,7 @@ public class TileEntityAdvPooCollector extends TileEntityBaseFluidCollector {
} else if (aPooMaker instanceof EntitySheep) {
aPooAmount = MathUtils.randInt(8, 30);
} else {
- if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
+ if (aPooMaker instanceof IAnimals) {
aPooAmount = MathUtils.randInt(5, 35);
} else if (aPooMaker instanceof EntityVillager) {
aPooAmount = MathUtils.randInt(25, 30);
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
index 988268f6e9..cf6ad5b663 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
@@ -73,17 +73,15 @@ public abstract class TileEntityBaseFluidCollector extends TileEntityBase implem
fluid = null;
}
- if (this != null) {
- FluidEvent.fireEvent(
- new FluidEvent.FluidDrainingEvent(
- fluid,
- this.getWorldObj(),
- this.xCoord,
- this.yCoord,
- this.zCoord,
- this.tank,
- 0));
- }
+ FluidEvent.fireEvent(
+ new FluidEvent.FluidDrainingEvent(
+ fluid,
+ this.getWorldObj(),
+ this.xCoord,
+ this.yCoord,
+ this.zCoord,
+ this.tank,
+ 0));
}
return stack;
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
index 08ceed597d..71a4db157a 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
@@ -336,9 +336,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
.getInventory()[0].stackSize < 64) {
int diff = 64 - this.getInventory()
.getInventory()[0].stackSize;
- if (aStack.stackSize <= diff) {
- return true;
- }
+ return aStack.stackSize <= diff;
}
}
return false;
@@ -346,12 +344,8 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
@Override
public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int p_102008_3_) {
- if (this.getInventory()
- .getInventory()[1] == null) {
- return false;
- } else {
- return true;
- }
+ return this.getInventory()
+ .getInventory()[1] != null;
}
public String getCustomName() {
@@ -369,7 +363,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
@Override
public boolean hasCustomInventoryName() {
- return (this.mCustomName != null) && !this.mCustomName.equals("");
+ return (this.mCustomName != null) && !this.mCustomName.isEmpty();
}
@Override
@@ -404,17 +398,15 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
fluid = null;
}
- if (this != null) {
- FluidEvent.fireEvent(
- new FluidEvent.FluidDrainingEvent(
- fluid,
- this.getWorldObj(),
- this.xCoord,
- this.yCoord,
- this.zCoord,
- this.mTank,
- 0));
- }
+ FluidEvent.fireEvent(
+ new FluidEvent.FluidDrainingEvent(
+ fluid,
+ this.getWorldObj(),
+ this.xCoord,
+ this.yCoord,
+ this.zCoord,
+ this.mTank,
+ 0));
}
updateTileEntity();
return stack;
@@ -451,10 +443,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
}
public boolean hasFluidSpace() {
- if (this.mTank.getFluidAmount() <= 1000) {
- return true;
- }
- return false;
+ return this.mTank.getFluidAmount() <= 1000;
}
public boolean drainCell() {
@@ -464,7 +453,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
return false;
}
aInput = aInput.copy();
- if (aInput != null && (this.getStackInSlot(1) == null || this.getStackInSlot(1).stackSize < 64)) {
+ if (this.getStackInSlot(1) == null || this.getStackInSlot(1).stackSize < 64) {
ArrayList<ItemStack> t1Cells = OreDictionary.getOres("cellFormaldehyde");
ArrayList<ItemStack> t2Cells = OreDictionary.getOres("cellHydrogenCyanide");
didFill = addFluid(t1Cells, aInput, FluidUtils.getWildcardFluidStack("formaldehyde", 1000));
@@ -496,11 +485,8 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory,
if (GTUtility.areStacksEqual(a, aInput)) {
if (mTank.getFluid() == null || mTank.getFluid()
.isFluidEqual(aFluidForInput)) {
- boolean didFill = fill(ForgeDirection.UNKNOWN, aFluidForInput, true) > 0;
- return didFill;
+ return fill(ForgeDirection.UNKNOWN, aFluidForInput, true) > 0;
}
- } else {
- continue;
}
}
return false;
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
index 90864d1878..ba7433bfd2 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
@@ -95,7 +95,7 @@ public class TileEntityPooCollector extends TileEntityBaseFluidCollector {
} else if (aPooMaker instanceof EntitySheep) {
aPooAmount = MathUtils.randInt(8, 30);
} else {
- if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
+ if (aPooMaker instanceof IAnimals) {
aPooAmount = MathUtils.randInt(5, 35);
} else {
aPooAmount = MathUtils.randInt(1, 10);
diff --git a/src/main/java/gtPlusPlus/core/util/Utils.java b/src/main/java/gtPlusPlus/core/util/Utils.java
index fb05c6aa10..ee8ff5817a 100644
--- a/src/main/java/gtPlusPlus/core/util/Utils.java
+++ b/src/main/java/gtPlusPlus/core/util/Utils.java
@@ -193,7 +193,7 @@ public class Utils {
.substring(1)
.toUpperCase());
Logger.WARNING(
- "" + Integer.toHexString(0x1000000 | i)
+ Integer.toHexString(0x1000000 | i)
.substring(1)
.toUpperCase());
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
index d5ab990917..f0df1cb2b9 100644
--- a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
@@ -11,26 +11,26 @@ public class ArrayUtils {
public static <V> V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToInsert) {
V[] newArray = Arrays.copyOf(aArray, aArray.length + 1);
- for (int i = 0; i < aIndex; i++) {
- newArray[i] = aArray[i];
+ if (aIndex >= 0) {
+ System.arraycopy(aArray, 0, newArray, 0, aIndex);
}
newArray[aIndex] = aObjectToInsert;
- for (int i = (aIndex + 1); i < newArray.length; i++) {
- newArray[i] = aArray[i - 1];
+ if (newArray.length - (aIndex + 1) >= 0) {
+ System.arraycopy(aArray, aIndex + 1 - 1, newArray, aIndex + 1, newArray.length - (aIndex + 1));
}
return newArray;
}
public static Object[] removeNulls(final Object[] v) {
List<Object> list = new ArrayList<>(Arrays.asList(v));
- list.removeAll(Collections.singleton((Object) null));
- return list.toArray(new Object[list.size()]);
+ list.removeAll(Collections.singleton(null));
+ return list.toArray(new Object[0]);
}
public static ItemStack[] removeNulls(final ItemStack[] v) {
List<ItemStack> list = new ArrayList<>(Arrays.asList(v));
list.removeAll(Collections.singleton((ItemStack) null));
- return list.toArray(new ItemStack[list.size()]);
+ return list.toArray(new ItemStack[0]);
}
public static String toString(Object[] aArray, String string) {
diff --git a/src/main/java/gtPlusPlus/core/util/data/FileUtils.java b/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
index b2e5d04375..7b720e1145 100644
--- a/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
@@ -19,10 +19,7 @@ public class FileUtils {
private static final Charset utf8 = StandardCharsets.UTF_8;
public static boolean doesFileExist(File f) {
- if (f != null && f.exists() && !f.isDirectory()) {
- return true;
- }
- return false;
+ return f != null && f.exists() && !f.isDirectory();
}
public static File createFile(String path, String filename, String extension) {
diff --git a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
index c2a923bb75..b19f6c45fe 100644
--- a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
@@ -75,10 +75,9 @@ public class StringUtils {
return true;
} else if (s.contains(StringUtils.subscript("8"))) {
return true;
- } else if (s.contains(StringUtils.subscript("9"))) {
- return true;
+ } else {
+ return s.contains(StringUtils.subscript("9"));
}
- return false;
}
public static String firstLetterCaps(String data) {
@@ -138,6 +137,7 @@ public class StringUtils {
for (int o = 0; o < aInput.length(); o++) {
if (isSpecialCharacter(aInput.charAt(o))) {
isSpecial = true;
+ break;
}
}
if (isSpecial) {
diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
index 05e238b098..ba2ad0ca41 100644
--- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
@@ -184,10 +184,7 @@ public class MathUtils {
* @return boolean Whether or not it divides evenly.
*/
public static boolean isNumberEven(final long x) {
- if ((x % 2) == 0) {
- return true;
- }
- return false;
+ return x % 2 == 0;
}
/**
@@ -211,7 +208,7 @@ public class MathUtils {
final int randomInt = randInt(1, 5);
final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
- if ((colours.get(randomInt) != null) && (colours.size() > 0)) {
+ if ((colours.get(randomInt) != null) && (!colours.isEmpty())) {
temp = colours.get(randomInt);
} else {
temp = "0F0F0F";
@@ -256,8 +253,7 @@ public class MathUtils {
}
public static int getRgbAsHex(final short[] RGBA) {
- final int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
- return (returnValue == 0) ? 0 : returnValue;
+ return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
}
public static byte safeByte(long number) {
@@ -336,8 +332,7 @@ public class MathUtils {
for (byte i : aDataSet) {
total += i;
}
- byte result = safeByte(total / divisor);
- return result;
+ return safeByte(total / divisor);
}
public static short getShortAverage(short[] aDataSet) {
@@ -365,8 +360,7 @@ public class MathUtils {
for (int i : aDataSet) {
total += i;
}
- int result = safeInt(total / divisor);
- return result;
+ return safeInt(total / divisor);
}
public static long getLongAverage(long[] aDataSet) {
@@ -454,31 +448,26 @@ public class MathUtils {
}
public static byte getSafeByte(Byte b) {
- Byte a = safeCast(b);
- return a;
+ return safeCast(b);
}
public static short getSafeShort(Short b) {
- Short a = safeCast(b);
- return a;
+ return safeCast(b);
}
public static int getSafeInt(Integer b) {
- Integer a = safeCast(b);
- return a;
+ return safeCast(b);
}
public static long getSafeLong(Long b) {
- Long a = safeCast(b);
- return a;
+ return safeCast(b);
}
public static int safeCast_LongToInt(long o) {
if (o > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
} else {
- int i = (int) o;
- return i;
+ return (int) o;
}
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index 95ba020887..8897682942 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -31,7 +31,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
public class FluidUtils {
- private static HashMap<String, Fluid> sFluidCache = new HashMap<>();
+ private static final HashMap<String, Fluid> sFluidCache = new HashMap<>();
public static FluidStack getWater(final int amount) {
return FluidUtils.getFluidStack("water", amount);
@@ -506,7 +506,7 @@ public class FluidUtils {
aGenerateCell);
}
- public static final Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName,
+ public static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName,
final int MeltingPoint, final short[] RGBA, ItemStack dustStack, final ItemStack dustStack2,
final int amountPerItem, final boolean aGenerateCell) {
if (dustStack == null) {
@@ -637,10 +637,7 @@ public class FluidUtils {
if (aFStack5 != null) {
return aFStack5;
}
- if (aFStack6 != null) {
- return aFStack6;
- }
- return null;
+ return aFStack6;
}
public static FluidStack getWildcardFluidStack(Materials aMaterial, int amount) {
@@ -654,11 +651,7 @@ public class FluidUtils {
return aFStack2;
} else if (aFStack3 != null) {
return aFStack3;
- } else if (aFStack4 != null) {
- return aFStack4;
- } else {
- return null;
- }
+ } else return aFStack4;
}
public static FluidStack getAir(int aAmount) {
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
index c8a7ed26da..b690c35199 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
@@ -17,8 +17,7 @@ public class InventoryUtils {
public static void dropInventoryItems(World world, int x, int y, int z, Block block) {
TileEntity tileentity = world.getTileEntity(x, y, z);
- if (tileentity != null && tileentity instanceof IInventory aTileInv
- && ((IInventory) tileentity).getSizeInventory() > 0) {
+ if (tileentity instanceof IInventory aTileInv && ((IInventory) tileentity).getSizeInventory() > 0) {
int aMinSlot = 0;
int aMaxSlot = aTileInv.getSizeInventory() - 1;
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 7b66ffefa1..5b2065558d 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -103,25 +103,16 @@ public class ItemUtils {
if (ItemList.Cell_Empty.hasBeenSet()) {
return ItemList.Cell_Empty.get(i);
}
- final ItemStack temp = GTModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", i, 0);
- return temp != null ? temp : null;
+ return GTModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", i, 0);
}
public static void getItemForOreDict(final String FQRN, final String oreDictName, final String itemName,
final int meta) {
try {
- Item em = null;
final Item em1 = getItemFromFQRN(FQRN);
-
if (em1 != null) {
- em = em1;
- }
-
- if (em != null) {
-
- final ItemStack metaStack = new ItemStack(em, 1, meta);
+ final ItemStack metaStack = new ItemStack(em1, 1, meta);
GTOreDictUnificator.registerOre(oreDictName, metaStack);
-
}
} catch (final NullPointerException e) {
Logger.ERROR(itemName + " not found. [NULL]");
@@ -147,17 +138,9 @@ public class ItemUtils {
final int meta, final int itemstackSize) {
if (MOD) {
try {
- Item em = null;
final Item em1 = getItemFromFQRN(FQRN);
-
if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
+ return new ItemStack(em1, itemstackSize, meta);
}
return null;
} catch (final NullPointerException e) {
@@ -170,17 +153,9 @@ public class ItemUtils {
public static ItemStack simpleMetaStack(final String FQRN, final int meta, final int itemstackSize) {
try {
- Item em = null;
final Item em1 = getItemFromFQRN(FQRN);
- // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
+ return new ItemStack(em1, itemstackSize, meta);
}
return null;
} catch (final NullPointerException e) {
@@ -249,7 +224,7 @@ public class ItemUtils {
if (fqrnSplit.length == 2) {
Logger.INFO("Mod: " + fqrnSplit[0] + ", Item: " + fqrnSplit[1]);
return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
- } else if (fqrnSplit.length == 3 && fqrnSplit[2] != null && fqrnSplit[2].length() > 0) {
+ } else if (fqrnSplit.length == 3 && fqrnSplit[2] != null && !fqrnSplit[2].isEmpty()) {
Logger.INFO("Mod: " + fqrnSplit[0] + ", Item: " + fqrnSplit[1] + ", Meta: " + fqrnSplit[2]);
ItemStack aStack = GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
int aMeta = Integer.parseInt(fqrnSplit[2]);
@@ -282,8 +257,7 @@ public class ItemUtils {
}
if (oredictName.contains("rod")) {
- String s = "stick" + oredictName.substring(3);
- oredictName = s;
+ oredictName = "stick" + oredictName.substring(3);
}
// Banned Materials and replacements for GT5.8 compat.
@@ -471,9 +445,9 @@ public class ItemUtils {
final String unlocalizedName = Utils.sanitizeString(materialName);
final int Colour = material.getRgbAsHex();
final String aChemForm = material.vChemicalFormula;
- final boolean isChemFormvalid = (aChemForm != null && aChemForm.length() > 0);
+ final boolean isChemFormvalid = (aChemForm != null && !aChemForm.isEmpty());
Item[] output = null;
- if (onlyLargeDust == false) {
+ if (!onlyLargeDust) {
output = new Item[] {
new BaseItemDustUnique(
"itemDust" + unlocalizedName,
@@ -514,10 +488,7 @@ public class ItemUtils {
.contains("thorium")) {
sRadiation = 1;
}
- if (sRadiation >= 1) {
- return true;
- }
- return false;
+ return sRadiation >= 1;
}
public static int getRadioactivityLevel(final String materialName) {
@@ -576,14 +547,14 @@ public class ItemUtils {
final GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item);
if (id != null) {
final String modname = (id.modId == null ? id.name : id.modId);
- value = ((id == null) || id.modId.equals("")) ? Minecraft.ID : modname;
+ value = ((id == null) || id.modId.isEmpty()) ? Minecraft.ID : modname;
}
} catch (final Throwable t) {
try {
final UniqueIdentifier t2 = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item));
if (t2 != null) {
final String modname = (t2.modId == null ? t2.name : t2.modId);
- value = ((t2 == null) || t2.modId.equals("")) ? Minecraft.ID : modname;
+ value = ((t2 == null) || t2.modId.isEmpty()) ? Minecraft.ID : modname;
}
} catch (final Throwable t3) {
t3.printStackTrace();
@@ -640,11 +611,7 @@ public class ItemUtils {
String mName = Utils.sanitizeString(mMat.getLocalizedName());
String mItemName = mPrefix.name() + mName;
- ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
- if (gregstack == null) {
- return null;
- }
- return (gregstack);
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
}
public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Materials mMat, int mAmount) {
@@ -710,46 +677,34 @@ public class ItemUtils {
return false;
}
- if (mInputs.length > 0) {
- for (ItemStack stack : mInputs) {
- if (stack != null) {
- if (stack.getItem() != null) {
- if (stack.getItem() == ModItems.AAA_Broken || stack.getItem()
- .getClass() == ModItems.AAA_Broken.getClass()) {
+ for (ItemStack stack : mInputs) {
+ if (stack != null) {
+ if (stack.getItem() != null) {
+ if (stack.getItem() == ModItems.AAA_Broken || stack.getItem()
+ .getClass() == ModItems.AAA_Broken.getClass()) {
+ return false;
+ } else if (stack.getItem() == ModItems.ZZZ_Empty || stack.getItem()
+ .getClass() == ModItems.ZZZ_Empty.getClass()) {
return false;
- } else if (stack.getItem() == ModItems.ZZZ_Empty || stack.getItem()
- .getClass() == ModItems.ZZZ_Empty.getClass()) {
- return false;
- } else {
- continue;
- }
- } else {
- continue;
- }
- } else {
- return false;
+ }
}
+ } else {
+ return false;
}
}
- if (mOutputs.length > 0) {
- for (ItemStack stack : mOutputs) {
- if (stack != null) {
- if (stack.getItem() != null) {
- if (stack.getItem() == ModItems.AAA_Broken || stack.getItem()
- .getClass() == ModItems.AAA_Broken.getClass()) {
+ for (ItemStack stack : mOutputs) {
+ if (stack != null) {
+ if (stack.getItem() != null) {
+ if (stack.getItem() == ModItems.AAA_Broken || stack.getItem()
+ .getClass() == ModItems.AAA_Broken.getClass()) {
+ return false;
+ } else if (stack.getItem() == ModItems.ZZZ_Empty || stack.getItem()
+ .getClass() == ModItems.ZZZ_Empty.getClass()) {
return false;
- } else if (stack.getItem() == ModItems.ZZZ_Empty || stack.getItem()
- .getClass() == ModItems.ZZZ_Empty.getClass()) {
- return false;
- } else {
- continue;
- }
- } else {
- continue;
- }
- } else {
- return false;
+ }
}
+ } else {
+ return false;
}
}
@@ -763,16 +718,23 @@ public class ItemUtils {
}
// ItemStack[] g = organiseInventory(p);
- IInventory aTemp = aInputInventory;
for (int i = 0; i < p.length; ++i) {
for (int j = i + 1; j < p.length; ++j) {
if (p[j] != null && (p[i] == null || GTUtility.areStacksEqual(p[i], p[j]))) {
- GTUtility.moveStackFromSlotAToSlotB(aTemp, aTemp, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ GTUtility.moveStackFromSlotAToSlotB(
+ aInputInventory,
+ aInputInventory,
+ j,
+ i,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
}
}
}
- return aTemp;
+ return aInputInventory;
}
public static String getFluidName(FluidStack aFluid) {
@@ -786,7 +748,7 @@ public class ItemUtils {
}
String aDisplay = null;
try {
- aDisplay = ("" + StatCollector.translateToLocal(
+ aDisplay = (StatCollector.translateToLocal(
aStack.getItem()
.getUnlocalizedNameInefficiently(aStack) + ".name")).trim();
if (aStack.hasTagCompound()) {
@@ -834,21 +796,15 @@ public class ItemUtils {
final Item mItem = aStack.getItem();
final Item aSkookum = ItemUtils.getItemFromFQRN("miscutils:gt.plusplus.metatool.01");
final Class aSkookClass = aSkookum.getClass();
- if (aSkookClass.isInstance(mItem) || mItem instanceof MetaGeneratedTool01
+ return aSkookClass.isInstance(mItem) || mItem instanceof MetaGeneratedTool01
|| mItem instanceof MetaGeneratedGregtechTools
|| mItem instanceof GTMetaTool
- || mItem == aSkookum) {
- return true;
- }
- return false;
+ || mItem == aSkookum;
}
public static boolean isToolScrewdriver(ItemStack aScrewdriver) {
- if (isItemGregtechTool(aScrewdriver)
- && (aScrewdriver.getItemDamage() == 22 || aScrewdriver.getItemDamage() == 150)) {
- return true;
- }
- return false;
+ return isItemGregtechTool(aScrewdriver)
+ && (aScrewdriver.getItemDamage() == 22 || aScrewdriver.getItemDamage() == 150);
}
public static ItemStack[] cleanItemStackArray(ItemStack[] input) {
@@ -900,14 +856,12 @@ public class ItemUtils {
public static boolean isControlCircuit(ItemStack aStack) {
if (aStack != null) {
Item aItem = aStack.getItem();
- if (aItem == CI.getNumberedBioCircuit(0)
+ return aItem == CI.getNumberedBioCircuit(0)
.getItem() || aItem
== GTUtility.getIntegratedCircuit(0)
.getItem()
|| aItem == CI.getNumberedAdvancedCircuit(0)
- .getItem()) {
- return true;
- }
+ .getItem();
}
return false;
}
@@ -997,20 +951,13 @@ public class ItemUtils {
if (GTUtility.areStacksEqual(aStack, GenericChem.mSynchrotronCapableCatalyst, true)) {
return true;
}
- if (GTUtility.areStacksEqual(aStack, GenericChem.mAlgagenicGrowthPromoterCatalyst, true)) {
- return true;
- }
-
- return false;
+ return GTUtility.areStacksEqual(aStack, GenericChem.mAlgagenicGrowthPromoterCatalyst, true);
}
public static boolean isMillingBall(ItemStack aStack) {
if (GTUtility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) {
return true;
}
- if (GTUtility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) {
- return true;
- }
- return false;
+ return GTUtility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true);
}
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 5e75cc2050..33d68711a2 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -196,10 +196,7 @@ public class MaterialUtils {
}
public static boolean hasValidRGBA(final short[] rgba) {
- if (rgba == null || rgba.length < 3 || rgba.length > 4) {
- return false;
- }
- return true;
+ return rgba != null && rgba.length >= 3 && rgba.length <= 4;
}
public static int getTierOfMaterial(final double aMeltingPoint) {
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
index bff2a25386..51be886acd 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
@@ -24,7 +24,7 @@ public class NBTUtils {
public static ItemStack[] readItemsFromNBT(ItemStack itemstack) {
NBTTagCompound tNBT = getNBT(itemstack);
final NBTTagList list = tNBT.getTagList("Items", 10);
- ItemStack inventory[] = new ItemStack[list.tagCount()];
+ ItemStack[] inventory = new ItemStack[list.tagCount()];
for (int i = 0; i < list.tagCount(); i++) {
final NBTTagCompound data = list.getCompoundTagAt(i);
final int slot = data.getInteger("Slot");
@@ -125,10 +125,7 @@ public class NBTUtils {
public static boolean hasKey(ItemStack stack, String key) {
final NBTTagCompound itemData = getNBT(stack);
- if (itemData.hasKey(key)) {
- return true;
- }
- return false;
+ return itemData.hasKey(key);
}
public static boolean createIntegerTagCompound(ItemStack rStack, String tagName, String keyName, int keyValue) {
@@ -144,9 +141,7 @@ public class NBTUtils {
NBTTagCompound aNBT = getNBT(aStack);
if (aNBT != null && hasKey(aStack, tagName)) {
aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT;
- }
+ return aNBT;
}
return null;
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
index 6f50da5eb2..5f639f3739 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
@@ -29,9 +29,8 @@ public class PlayerUtils {
.getClass("thaumcraft.common.lib.FakeThaumcraftPlayer");
public static List<EntityPlayerMP> getOnlinePlayers() {
- final List<EntityPlayerMP> onlinePlayers = MinecraftServer.getServer()
+ return MinecraftServer.getServer()
.getConfigurationManager().playerEntityList;
- return onlinePlayers;
}
public static void messagePlayer(final EntityPlayer P, final String S) {
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
index 792119d1bc..7f70230070 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
@@ -134,7 +134,6 @@ public class RecipeUtils {
if ((is != null) && (is.getItem() == I)) {
items.remove();
Logger.RECIPE("Remove a recipe with " + I.getUnlocalizedName() + " as output.");
- continue;
}
}
Logger.RECIPE("All recipes should be gone?");
@@ -195,10 +194,7 @@ public class RecipeUtils {
return false;
}
// let gregtech handle shapeless recipes.
- if (GTModHandler.addShapelessCraftingRecipe(OutputItem, inputItems)) {
- return true;
- }
- return false;
+ return GTModHandler.addShapelessCraftingRecipe(OutputItem, inputItems);
}
public static boolean generateMortarRecipe(ItemStack aStack, ItemStack aOutput) {
@@ -254,12 +250,8 @@ public class RecipeUtils {
Logger.RECIPE("Using " + validCounter + " valid inputs and " + invalidCounter + " invalid inputs.");
ShapedRecipe r = new ShapedRecipe(aFiltered, mOutput);
- if (r != null && r.mRecipe != null) {
- isValid = true;
- } else {
- isValid = false;
- }
- mRecipe = r != null ? r.mRecipe : null;
+ isValid = r.mRecipe != null;
+ mRecipe = r.mRecipe;
}
@Override
@@ -298,7 +290,7 @@ public class RecipeUtils {
int tList_sS = tList.size();
for (int i = 0; i < tList_sS; ++i) {
- IRecipe tRecipe = (IRecipe) tList.get(i);
+ IRecipe tRecipe = tList.get(i);
if (!aNotRemoveShapelessRecipes
|| !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe)) {
if (aOnlyRemoveNativeHandlers) {
@@ -341,7 +333,7 @@ public class RecipeUtils {
private static boolean addShapedRecipe(Object[] Inputs, ItemStack aOutputStack) {
Object[] Slots = new Object[9];
- String aFullString = "";
+ StringBuilder aFullString = new StringBuilder();
String aFullStringExpanded = "abcdefghi";
for (int i = 0; i < 9; i++) {
@@ -349,23 +341,23 @@ public class RecipeUtils {
if (o instanceof ItemStack) {
Slots[i] = ItemUtils.getSimpleStack((ItemStack) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
+ aFullString.append(aFullStringExpanded.charAt(i));
} else if (o instanceof Item) {
Slots[i] = ItemUtils.getSimpleStack((Item) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
+ aFullString.append(aFullStringExpanded.charAt(i));
} else if (o instanceof Block) {
Slots[i] = ItemUtils.getSimpleStack((Block) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
+ aFullString.append(aFullStringExpanded.charAt(i));
} else if (o instanceof String) {
Slots[i] = o;
- aFullString += aFullStringExpanded.charAt(i);
+ aFullString.append(aFullStringExpanded.charAt(i));
} else if (o instanceof ItemData aData) {
ItemStack aStackFromGT = ItemUtils.getOrePrefixStack(aData.mPrefix, aData.mMaterial.mMaterial, 1);
Slots[i] = aStackFromGT;
- aFullString += aFullStringExpanded.charAt(i);
+ aFullString.append(aFullStringExpanded.charAt(i));
} else if (o == null) {
Slots[i] = null;
- aFullString += " ";
+ aFullString.append(" ");
} else {
Slots[i] = null;
Logger.INFO(
@@ -380,9 +372,9 @@ public class RecipeUtils {
String aRow1 = aFullString.substring(0, 3);
String aRow2 = aFullString.substring(3, 6);
String aRow3 = aFullString.substring(6, 9);
- Logger.RECIPE("" + aRow1);
- Logger.RECIPE("" + aRow2);
- Logger.RECIPE("" + aRow3);
+ Logger.RECIPE(aRow1);
+ Logger.RECIPE(aRow2);
+ Logger.RECIPE(aRow3);
String[] aStringData = new String[] { aRow1, aRow2, aRow3 };
Object[] aDataObject = new Object[19];
@@ -436,11 +428,7 @@ public class RecipeUtils {
public InternalRecipeObject2(ShapedOreRecipe aRecipe) {
mRecipe = aRecipe;
mOutput = aRecipe.getRecipeOutput();
- if (mOutput != null) {
- this.isValid = true;
- } else {
- this.isValid = false;
- }
+ this.isValid = mOutput != null;
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/util/recipe/RecipeHashStrat.java b/src/main/java/gtPlusPlus/core/util/recipe/RecipeHashStrat.java
index 1a730c9cbf..80dd932983 100644
--- a/src/main/java/gtPlusPlus/core/util/recipe/RecipeHashStrat.java
+++ b/src/main/java/gtPlusPlus/core/util/recipe/RecipeHashStrat.java
@@ -58,10 +58,7 @@ public class RecipeHashStrat {
if (!areFluidStackArraysEqual(recipe1.mFluidInputs, recipe2.mFluidInputs)) {
return false;
}
- if (!areFluidStackArraysEqual(recipe1.mFluidOutputs, recipe2.mFluidOutputs)) {
- return false;
- }
- return true;
+ return areFluidStackArraysEqual(recipe1.mFluidOutputs, recipe2.mFluidOutputs);
}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 5dd9f9f426..6bd0ad638d 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -107,26 +107,21 @@ public class ReflectionUtils {
public static boolean setField(final Object object, final Field field, final Object fieldValue) {
if (field == null) return false;
- Class<?> clazz;
+ final Class<?> clazz;
if (object instanceof Class) {
clazz = (Class<?>) object;
} else {
clazz = object.getClass();
}
- while (clazz != null) {
- try {
- final Field field2 = getField(clazz, field.getName());
- if (field2 != null) {
- setFieldValue_Internal(object, field, fieldValue);
- return true;
- }
- } catch (final NoSuchFieldException e) {
- Logger.REFLECTION("setField(" + object + ", " + field.getName() + ") failed.");
- clazz = clazz.getSuperclass();
- } catch (final Exception e) {
- Logger.REFLECTION("setField(" + object + ", " + field.getName() + ") failed.");
- throw new IllegalStateException(e);
+ try {
+ final Field field2 = getField(clazz, field.getName());
+ if (field2 != null) {
+ setFieldValue_Internal(object, field, fieldValue);
+ return true;
}
+ } catch (final Exception e) {
+ Logger.REFLECTION("setField(" + object + ", " + field.getName() + ") failed.");
+ throw new IllegalStateException(e);
}
return false;
}
@@ -161,7 +156,7 @@ public class ReflectionUtils {
*
* Set the value of a field reflectively.
*/
- private static void setFieldValue_Internal(Object owner, Field field, Object value) throws Exception {
+ private static void setFieldValue_Internal(Object owner, Field field, Object value) {
cacheAccessor(field).setValue(owner, value);
}
diff --git a/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java b/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
index 016dfc8c58..38ada55c2e 100644
--- a/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
+++ b/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
@@ -48,7 +48,6 @@ public class MiningExplosion extends Explosion {
/**
* Does the first part of the explosion (destroy blocks)
*/
- @SuppressWarnings("unchecked")
@Override
public void doExplosionA() {
final float f = this.explosionSize;
diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java
index 74fb6c8d54..72732249b0 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java
@@ -36,7 +36,6 @@ public class BiomeEverglades {
static class BiomeGenEverglades extends BiomeGenBase {
- @SuppressWarnings("unchecked")
public BiomeGenEverglades() {
super(Configuration.worldgen.EVERGLADESBIOME_ID);
this.theBiomeDecorator = new CustomBiomeGenerator();
@@ -73,7 +72,7 @@ public class BiomeEverglades {
return 0xF67A14;
}
- @SuppressWarnings({ "unchecked", "unused" })
+ @SuppressWarnings({ "unused" })
private boolean addToMonsterSpawnLists(Class<? extends EntityLiving> EntityClass, int a, int b, int c) {
this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
return true;
diff --git a/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java b/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java
index 4df290b560..18d7151324 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java
@@ -212,9 +212,7 @@ public class CustomBiomeGenerator extends BiomeDecorator {
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0
- && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) {
- ;
- }
+ && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) {}
this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
index 16ad852e75..5afc3dc569 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
@@ -185,9 +185,8 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti
int x = pos.xPos, y = pos.yPos, z = pos.zPos;
Logger.INFO("Trigger");
int blockCount = 0;
- BlockPos portal = pos;
- World par1World = portal.world;
- for (BlockPos side : portal.getSurroundingBlocks()) {
+ World par1World = pos.world;
+ for (BlockPos side : pos.getSurroundingBlocks()) {
Block b = side.getBlockAtPos();
if (b == DimensionEverglades.blockPortalFrame || b == DimensionEverglades.portalBlock) {
blockCount++;
@@ -195,7 +194,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti
}
if (blockCount < 4) {
par1World.setBlockToAir(x, y, z);
- par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0);
+ par1World.scheduleBlockUpdate(x, y, z, pos.getBlockAtPos(), 0);
}
byte b0 = 0;
@@ -205,16 +204,12 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti
b1 = 0;
}
int i1;
- for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {
- ;
- }
+ for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {}
if (par1World.getBlock(x, i1 - 1, z) != DimensionEverglades.blockPortalFrame) {
par1World.setBlockToAir(x, y, z);
} else {
int j1;
- for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {
- ;
- }
+ for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {}
if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == DimensionEverglades.blockPortalFrame) {
boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this;
boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this;
@@ -266,8 +261,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti
&& par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this;
boolean flag4 = flag || flag1;
boolean flag5 = flag2 || flag3;
- return flag4 && par5 == 4 ? true
- : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3));
+ return flag4 && par5 == 4 || (flag4 && par5 == 5 || (flag5 && par5 == 2 || flag5 && par5 == 3));
}
}
diff --git a/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java b/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java
index f49046cd2b..409e3f150a 100644
--- a/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java
+++ b/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java
@@ -36,7 +36,7 @@ import gtPlusPlus.everglades.dimension.DimensionEverglades;
public class ChunkProviderModded implements IChunkProvider {
- private Random rand;
+ private final Random rand;
private NoiseGeneratorOctaves field_147431_j;
private NoiseGeneratorOctaves field_147432_k;
private NoiseGeneratorOctaves field_147429_l;
@@ -53,8 +53,8 @@ public class ChunkProviderModded implements IChunkProvider {
/**
* Reference to the World object.
*/
- private World worldObj;
- private WorldType field_147435_p;
+ private final World worldObj;
+ private final WorldType field_147435_p;
private final double[] field_147434_q;
private final float[] parabolicField;
private double[] stoneNoise = new double[256];
@@ -477,8 +477,6 @@ public class ChunkProviderModded implements IChunkProvider {
}
biomegenbase.decorate(this.worldObj, this.rand, k, l);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
- k += 8;
- l += 8;
MinecraftForge.EVENT_BUS
.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
index 50a7cd547a..bb1916adea 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
@@ -99,12 +99,10 @@ public class WorldGen_GT_Base implements IWorldGenerator {
// generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
default: // Any other dimension
- if (world.provider.dimensionId != xDim) {
- break;
- } else {
+ if (world.provider.dimensionId == xDim) {
generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
- break;
}
+ break;
}
}
@@ -197,7 +195,7 @@ public class WorldGen_GT_Base implements IWorldGenerator {
// Local class to track which orevein seeds must be checked when doing
// chunkified worldgen
- class NearbySeeds {
+ static class NearbySeeds {
public int mX;
public int mZ;
@@ -206,7 +204,7 @@ public class WorldGen_GT_Base implements IWorldGenerator {
this.mX = x;
this.mZ = z;
}
- };
+ }
public static ArrayList<NearbySeeds> seedList = new ArrayList<>();
@@ -530,7 +528,7 @@ public class WorldGen_GT_Base implements IWorldGenerator {
}
// Now process each oreseed vs this requested chunk
- for (; seedList.size() != 0; seedList.remove(0)) {
+ for (; !seedList.isEmpty(); seedList.remove(0)) {
if (debugWorldGen)
GTLog.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ);
worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ);
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
index 46fef6b58c..9153264185 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
@@ -487,9 +487,7 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT {
|| tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, DimensionEverglades.blockSecondaryFiller)
|| tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) {
- if (aWorld.setBlock(aX, aY, aZ, aMetaData, 0, 3)) {
- return true;
- }
+ return aWorld.setBlock(aX, aY, aZ, aMetaData, 0, 3);
}
return false;
}
diff --git a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
index 7e463e194c..e9d021d6fe 100644
--- a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
+++ b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
@@ -135,7 +135,7 @@ public class TeleporterDimensionMod extends Teleporter {
if (flag) {
this.destinationCoordinateCache
.add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
- this.destinationCoordinateKeys.add(Long.valueOf(j1));
+ this.destinationCoordinateKeys.add(j1);
}
double d11 = i + 0.5D;
@@ -457,7 +457,7 @@ public class TeleporterDimensionMod extends Teleporter {
}
}
- public class PortalPosition extends ChunkCoordinates {
+ public static class PortalPosition extends ChunkCoordinates {
/**
* The worldtime at which this PortalPosition was last verified
diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
index d1a621addf..4e1db08533 100644
--- a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
+++ b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
@@ -25,9 +25,9 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
private GenLayer biomeIndexLayer;
/** The BiomeCache object for this world. */
- private BiomeCache biomeCache;
+ private final BiomeCache biomeCache;
/** A list of biomes that the player can spawn in. */
- private List<BiomeGenBase> biomesToSpawnIn;
+ private final List<BiomeGenBase> biomesToSpawnIn;
@SuppressWarnings({ "rawtypes" })
public WorldChunkManagerCustom() {
@@ -80,12 +80,12 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
- crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
- crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(z));
- crashreportcategory.addCrashSection("w", Integer.valueOf(width));
- crashreportcategory.addCrashSection("h", Integer.valueOf(length));
+ crashreportcategory.addCrashSection("biome id", i1);
+ crashreportcategory.addCrashSection("downfalls[] size", listToReuse.length);
+ crashreportcategory.addCrashSection("x", x);
+ crashreportcategory.addCrashSection("z", z);
+ crashreportcategory.addCrashSection("w", width);
+ crashreportcategory.addCrashSection("h", length);
throw new ReportedException(crashreport);
}
}
@@ -125,11 +125,11 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
- crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
- crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
- crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
- crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
+ crashreportcategory.addCrashSection("biomes[] size", par1ArrayOfBiomeGenBase.length);
+ crashreportcategory.addCrashSection("x", par2);
+ crashreportcategory.addCrashSection("z", par3);
+ crashreportcategory.addCrashSection("w", par4);
+ crashreportcategory.addCrashSection("h", par5);
throw new ReportedException(crashreport);
}
}
@@ -159,15 +159,14 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0) {
BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
- return listToReuse;
} else {
int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
for (int i = 0; i < width * length; ++i) {
listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
}
- return listToReuse;
}
+ return listToReuse;
}
/**
@@ -199,9 +198,9 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(y));
- crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("x", x);
+ crashreportcategory.addCrashSection("z", y);
+ crashreportcategory.addCrashSection("radius", z);
crashreportcategory.addCrashSection("allowed", par4List);
throw new ReportedException(crashreport);
}
diff --git a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
index 3563c7a040..5928fe212a 100644
--- a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
@@ -47,19 +47,15 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadTransferRects() {
- this.transferRects
- .add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), getOverlayIdentifier(), new Object[0]));
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), getOverlayIdentifier()));
}
@Override
public void loadCraftingRecipes(ItemStack result) {
- if (result == null || (!DustDecayable.class.isInstance(result.getItem())
- && !BaseItemDustUnique.class.isInstance(result.getItem()))) {
+ if (result == null
+ || (!(result.getItem() instanceof DustDecayable) && !(result.getItem() instanceof BaseItemDustUnique))) {
return;
}
- if (result != null) {
- // Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result));
- }
final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
for (final DecayableRecipe recipe : recipes) {
if (recipe.isValid()) {
@@ -136,16 +132,16 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
if (cost > 0) {
// NEI Strings
- String s = I18n.format("GTPP.nei.info", new Object[] { cost });
- String s0 = I18n.format("GTPP.nei.timetaken", new Object[] { cost });
+ String s = I18n.format("GTPP.nei.info", cost);
+ String s0 = I18n.format("GTPP.nei.timetaken", cost);
// Time Strings
- String s1 = I18n.format("GTPP.time.ticks", new Object[] { cost });
- String s2 = I18n.format("GTPP.time.seconds", new Object[] { cost });
- String s3 = I18n.format("GTPP.time.minutes", new Object[] { cost });
- String s4 = I18n.format("GTPP.time.hours", new Object[] { cost });
- String s5 = I18n.format("GTPP.time.days", new Object[] { cost });
- String s6 = I18n.format("GTPP.time.months", new Object[] { cost });
+ String s1 = I18n.format("GTPP.time.ticks", cost);
+ String s2 = I18n.format("GTPP.time.seconds", cost);
+ String s3 = I18n.format("GTPP.time.minutes", cost);
+ String s4 = I18n.format("GTPP.time.hours", cost);
+ String s5 = I18n.format("GTPP.time.days", cost);
+ String s6 = I18n.format("GTPP.time.months", cost);
int y = 20;
int secs = cost / 20;
@@ -204,8 +200,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> {
- private PositionedStack input;
- private PositionedStack output;
+ private final PositionedStack input;
+ private final PositionedStack output;
public int time;
@Override
@@ -227,16 +223,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
@Override
public int compareTo(CachedRecipe o) {
- boolean b = DecayableRecipeNEI.class.isInstance(o);
- if (b) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) o;
- if (p.time > this.time) {
- return 1;
- } else if (p.time == this.time) {
- return 0;
- } else {
- return -1;
- }
+ if (o instanceof DecayableRecipeNEI p) {
+ return Integer.compare(p.time, this.time);
}
return 0;
}
@@ -244,18 +232,13 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
@Override
public boolean equals(Object obj) {
if (obj != null) {
- if (DecayableRecipeNEI.class.isInstance(obj)) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) obj;
- if (p != null) {
- // Time check first to keep it simple and not unbox the Recipes.
- if (p.time == this.time) {
- ItemStack aInput = p.input.item;
- ItemStack aOutput = p.output.item;
- if (GTUtility.areStacksEqual(aInput, this.input.item, true)) {
- if (GTUtility.areStacksEqual(aOutput, this.output.item, true)) {
- return true;
- }
- }
+ if (obj instanceof DecayableRecipeNEI p) {
+ // Time check first to keep it simple and not unbox the Recipes.
+ if (p.time == this.time) {
+ ItemStack aInput = p.input.item;
+ ItemStack aOutput = p.output.item;
+ if (GTUtility.areStacksEqual(aInput, this.input.item, true)) {
+ return GTUtility.areStacksEqual(aOutput, this.output.item, true);
}
}
}
diff --git a/src/main/java/gtPlusPlus/nei/LFTRSpargingNEIHandler.java b/src/main/java/gtPlusPlus/nei/LFTRSpargingNEIHandler.java
index 2cb6ac62b8..33018f2ce2 100644
--- a/src/main/java/gtPlusPlus/nei/LFTRSpargingNEIHandler.java
+++ b/src/main/java/gtPlusPlus/nei/LFTRSpargingNEIHandler.java
@@ -39,10 +39,7 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
public LFTRSpargingNEIHandler() {
this.transferRects.add(
- new TemplateRecipeHandler.RecipeTransferRect(
- new Rectangle(65, 13, 36, 18),
- this.getOverlayIdentifier(),
- new Object[0]));
+ new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier()));
if (!NEIGTPPConfig.sIsAdded) {
FMLInterModComms.sendRuntimeMessage(
GTValues.GT,
@@ -83,8 +80,7 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
@Override
public void loadTransferRects() {
- this.transferRects
- .add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getOverlayIdentifier(), new Object[0]));
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getOverlayIdentifier()));
}
public List<GasSpargingRecipeNEI> getCache() {
@@ -178,7 +174,7 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
public void drawExtras(int aRecipeIndex) {
final long tEUt = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
final long tDuration = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216);
+ drawText(10, 73, "Total: " + MathUtils.formatNumbers(tDuration * tEUt) + " EU", -16777216);
drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216);
drawText(
10,
@@ -233,7 +229,7 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
return currenttip;
}
- public class FixedPositionedStack extends PositionedStack {
+ public static class FixedPositionedStack extends PositionedStack {
public final int mChance;
public boolean permutated = false;
@@ -444,16 +440,8 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
@Override
public int compareTo(CachedRecipe o) {
- boolean b = GasSpargingRecipeNEI.class.isInstance(o);
- if (b) {
- GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) o;
- if (p.mOutputs.size() > this.mOutputs.size()) {
- return 1;
- } else if (p.mOutputs.size() == this.mOutputs.size()) {
- return 0;
- } else {
- return -1;
- }
+ if (o instanceof GasSpargingRecipeNEI p) {
+ return Integer.compare(p.mOutputs.size(), this.mOutputs.size());
}
return 0;
}
@@ -461,14 +449,9 @@ public class LFTRSpargingNEIHandler extends TemplateRecipeHandler {
@Override
public boolean equals(Object obj) {
if (obj != null) {
- if (GasSpargingRecipeNEI.class.isInstance(obj)) {
- GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) obj;
- if (p != null) {
- if (GTUtility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) {
- if (p.mOutputs.size() == this.mOutputs.size()) {
- return true;
- }
- }
+ if (obj instanceof GasSpargingRecipeNEI p) {
+ if (GTUtility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) {
+ return p.mOutputs.size() == this.mOutputs.size();
}
}
}
diff --git a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
index 2644ffb4ff..3084a67bf5 100644
--- a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
+++ b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
@@ -14,23 +14,23 @@ import org.lwjgl.opengl.GL11;
* Based on crazypants.enderio.gui.IconEIO
*
* @author Original EIO Author
- *
+ * <p>
* This is free and unencumbered software released into the public domain.
- *
+ * <p>
* Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source
* code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
- *
+ * <p>
* In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all
* copyright interest in the software to the public domain. We make this dedication for the benefit of the
* public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt
* act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
- *
+ * <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
- *
+ * <p>
* For more information, please refer to <http://unlicense.org/>
*
* https://github.com/SleepyTrousers/EnderIO/blob/release/1.7.10/2.2/src/main/java/crazypants/render/RenderUtil.java
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index 622ae92281..d871d3bc0c 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -577,10 +577,8 @@ public class BioRecipes {
private static void recipeFermentationBase() {
processFermentationOreDict();
- ArrayList<ItemStack> aFruitVege = mList_Master_FruitVege;
- ArrayList<ItemStack> aSeeds = mList_Master_Seeds;
ArrayList<ItemStack> aMap = OreDictionary.getOres("cropSugarbeet");
- for (ItemStack a : aFruitVege) {
+ for (ItemStack a : mList_Master_FruitVege) {
if (aMap.contains(a)) {
continue;
}
@@ -596,7 +594,7 @@ public class BioRecipes {
}
}
- for (ItemStack a : aSeeds) {
+ for (ItemStack a : mList_Master_Seeds) {
if (ItemUtils.checkForInvalidItems(a)) {
GTValues.RA.stdBuilder()
.itemInputs(getBioChip(3), ItemUtils.getSimpleStack(a, 20))
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
index 29c88ca5f4..ff34483d2f 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
@@ -166,8 +166,6 @@ public class ItemAlgaeBase extends Item implements IAlgalItem {
AlgaeGeneticData y = aItem.getSpeciesData(aFreshAlgae);
aNewTag = y.writeToNBT();
aFreshAlgae.setTagCompound(aNewTag);
- } else {
- aNewTag = aFreshAlgae.getTagCompound();
}
}
return aFreshAlgae;
@@ -193,8 +191,8 @@ public class ItemAlgaeBase extends Item implements IAlgalItem {
int aDam = aStack.getItemDamage();
aTemp = (byte) (aDam == 3 ? 0 : aDam == 4 ? 2 : 1);
aLifespan = (byte) (aDam == 3 ? 1 : aDam == 4 ? 3f : 2f);
- aFert = (float) (aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f);
- aSpeed = (float) (aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f);
+ aFert = aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f;
+ aSpeed = aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f;
aGenes = new AlgaeGeneticData(
true,
diff --git a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java
index e6b7740599..1a5ea35070 100644
--- a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java
+++ b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java
@@ -40,7 +40,7 @@ public class RecipeRemovals {
Item aU;
Collection<GTRecipe> aAssRecipes = RecipeMaps.assemblerRecipes.getAllRecipes();
// 170, 172, 174, 176
- if (aAssRecipes.size() > 0) {
+ if (!aAssRecipes.isEmpty()) {
for (GTRecipe aG : aAssRecipes) {
if (ArrayUtils.isNotEmpty(aG.mOutputs)) {
for (ItemStack aI : aG.mOutputs) {
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
index c3c2f0b6cc..0ee9270c20 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
@@ -14,15 +14,15 @@ import ic2.api.crops.Crops;
/**
* Mostly borrowed from the Crops++ Crop Loader.
- *
+ *
* @author Alkalus
*/
public class LoaderOfTheCrops {
- private static List<Boolean> mHasCropObj = new ArrayList<>();
- private CropCard mCropObj;
+ private static final List<Boolean> mHasCropObj = new ArrayList<>();
+ private final CropCard mCropObj;
private ItemStack mBaseSeed;
- private static List<LoaderOfTheCrops> mCropList = cropLoader();
+ private static final List<LoaderOfTheCrops> mCropList = cropLoader();
public LoaderOfTheCrops(CropCard cropObj) {
this.mCropObj = cropObj;
@@ -57,7 +57,7 @@ public class LoaderOfTheCrops {
List<CropCard> p = new ArrayList<>();
for (LoaderOfTheCrops loaderOfTheCrops : mCropList) {
- p.add(cropUnpackerCC((LoaderOfTheCrops) loaderOfTheCrops));
+ p.add(cropUnpackerCC(loaderOfTheCrops));
}
return p;
@@ -67,7 +67,7 @@ public class LoaderOfTheCrops {
List<ItemStack> p = new ArrayList<>();
for (LoaderOfTheCrops loaderOfTheCrops : mCropList) {
- p.add(cropUnpackerCG((LoaderOfTheCrops) loaderOfTheCrops));
+ p.add(cropUnpackerCG(loaderOfTheCrops));
}
return p;
@@ -77,7 +77,9 @@ public class LoaderOfTheCrops {
List<String> s = new ArrayList<>();
for (int i = 0; i < mCropList.size(); ++i) {
- s.add(((CropCard) cropObjs().get(i)).name());
+ s.add(
+ cropObjs().get(i)
+ .name());
}
return s;
@@ -91,8 +93,8 @@ public class LoaderOfTheCrops {
public static void register() {
for (int i = 0; i < mCropList.size(); ++i) {
- if ((Boolean) mHasCropObj.get(i) && cropObjs().get(i) != null) {
- Crops.instance.registerCrop((CropCard) cropObjs().get(i));
+ if (mHasCropObj.get(i) && cropObjs().get(i) != null) {
+ Crops.instance.registerCrop(cropObjs().get(i));
}
}
}
@@ -102,7 +104,7 @@ public class LoaderOfTheCrops {
for (int i = 0; i < mCropList.size(); ++i) {
if (baseseed.get(i) != null && cropObjs().get(i) != null) {
- Crops.instance.registerBaseSeed((ItemStack) baseseed.get(i), (CropCard) cropObjs().get(i), 1, 1, 1, 1);
+ Crops.instance.registerBaseSeed(baseseed.get(i), cropObjs().get(i), 1, 1, 1, 1);
}
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
index 405c1ef1e1..477684a863 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
@@ -31,7 +31,7 @@ public abstract class BaseCrop extends CropCard implements ICropCardInfo {
@Override
public float dropGainChance() {
- return (float) (Math.pow(0.95D, (double) ((float) this.tier())) * (double) 1f);
+ return (float) Math.pow(0.95D, (float) this.tier());
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
index 171bb9a58c..d73462da60 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
@@ -40,10 +40,6 @@ public class LeavesBase extends BlockLeaves {
Blocks.fire.setFireInfo(this, 80, 150);
}
- private void setVanillaVariable(Object toSet, Object value) {
- toSet = value;
- }
-
@Override
public int quantityDropped(Random p_149745_1_) {
return p_149745_1_.nextInt(20) == 0 ? 1 : 0;
@@ -96,7 +92,8 @@ public class LeavesBase extends BlockLeaves {
.registerIcon(GTPlusPlus.ID + ":" + "trees/" + "leaves/" + "leaves_" + leafType[i][j]);
}
}
- setVanillaVariable(this.field_150129_M, this.leafTextures);
+ // TODO uncomment the line below, I don't want to do it now in case it causes a crash
+ // this.field_150129_M = this.leafTextures;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
index 2cf8ba1fbc..317c61ee63 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
@@ -40,10 +40,6 @@ public abstract class LogBase extends BlockLog {
Blocks.fire.setFireInfo(this, 20, 100);
}
- private void setVanillaVariable(Object toSet, Object value) {
- toSet = value;
- }
-
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@@ -78,8 +74,8 @@ public abstract class LogBase extends BlockLog {
this.textureTop[i] = iIcon
.registerIcon(GTPlusPlus.ID + ":" + "trees/" + "logs/" + "log_" + treeType[i] + "_top");
}
-
- setVanillaVariable(this.field_150167_a, this.textureSide);
- setVanillaVariable(this.field_150166_b, this.textureTop);
+ // TODO uncomment the line below, I don't want to do it now in case it causes a crash
+ // this.field_150167_a = this.textureSide;
+ // this.field_150166_b = this.textureTop;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
index ff5c8770d4..d0728304c4 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
@@ -48,10 +48,6 @@ public class SaplingBase extends BlockSapling {
this.setCreativeTab(AddToCreativeTab.tabBOP);
}
- private void setVanillaVariable(Object toSet, Object value) {
- toSet = value;
- }
-
/**
* Gets the block's texture. Args: side, meta
*/
diff --git a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
index d3ad2efaea..c7207a3b5d 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
@@ -297,14 +297,11 @@ public class WorldGenRainForestTree_Ex extends WorldGenAbstractTree {
return false;
} else if (xDir == xDirMax - 1 && zDir == zDirMin + 1) {
return false;
- } else if (xDir == xDirMax - 1 && zDir == zDirMax - 1) {
- return false;
+ } else {
+ return xDir != xDirMax - 1 || zDir != zDirMax - 1;
}
- return true;
}
- return false;
- } else {
- return false;
}
+ return false;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPPBeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPPBeeDefinition.java
index 6b9c5ae8f2..0154597d09 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPPBeeDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPPBeeDefinition.java
@@ -515,10 +515,7 @@ public enum GTPPBeeDefinition implements IBeeDefinition {
}
private static IAlleleBeeSpecies getSpecies(String name) {
- return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(
- (new StringBuilder()).append("forestry.species")
- .append(name)
- .toString());
+ return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.species" + name);
}
protected abstract void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies);
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPDropType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPDropType.java
index 0ae34d599c..3a4bdc0a3d 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPDropType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPDropType.java
@@ -29,7 +29,7 @@ public enum GTPPDropType {
return GTPP_Bees.sDropMappings.get(aID);
}
- private GTPPDropType(int aID, String aName, boolean aShow, int... aColour) {
+ GTPPDropType(int aID, String aName, boolean aShow, int... aColour) {
this.mID = aID;
this.mName = aName;
this.mNameUnlocal = aName.toLowerCase()
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPollenType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPollenType.java
index 08b8f84dca..2775f26438 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPollenType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPollenType.java
@@ -28,7 +28,7 @@ public enum GTPPPollenType {
return GTPP_Bees.sPollenMappings.get(aID);
}
- private GTPPPollenType(int aID, String aName, boolean aShow, int... aColour) {
+ GTPPPollenType(int aID, String aName, boolean aShow, int... aColour) {
this.mID = aID;
this.mName = aName;
this.mNameUnlocal = aName.toLowerCase()
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPropolisType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPropolisType.java
index f97da9f4df..f68810f3f4 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPropolisType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPPPropolisType.java
@@ -29,7 +29,7 @@ public enum GTPPPropolisType {
return GTPP_Bees.sPropolisMappings.get(aID);
}
- private GTPPPropolisType(int aID, String aName, boolean aShow, int aColour) {
+ GTPPPropolisType(int aID, String aName, boolean aShow, int aColour) {
this.mID = aID;
this.mName = aName;
this.mNameUnlocal = aName.toLowerCase()
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FRItemRegistry.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FRItemRegistry.java
index ab2353cc37..7ded5cc171 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FRItemRegistry.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FRItemRegistry.java
@@ -2,7 +2,7 @@
* Copyright (c) 2011-2014 SirSengir. All rights reserved. This program and the accompanying materials are made
* available under the terms of the GNU Lesser Public License v3 which accompanies this distribution, and is available
* at http://www.gnu.org/licenses/lgpl-3.0.txt
- *
+ * <p>
* Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie,
* MysteriousAges
******************************************************************************/
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MBItemFrame.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MBItemFrame.java
index b196598f43..54b003386e 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MBItemFrame.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MBItemFrame.java
@@ -45,7 +45,7 @@ public class MBItemFrame extends Item implements IHiveFrame {
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.toolTip != "") || !this.toolTip.equals("")) {
+ if (!this.toolTip.isEmpty()) {
list.add(EnumChatFormatting.GRAY + this.toolTip);
}
super.addInformation(stack, aPlayer, list, bool);
@@ -79,10 +79,7 @@ public class MBItemFrame extends Item implements IHiveFrame {
@Override
public boolean hasEffect(final ItemStack par1ItemStack, final int pass) {
- if ((this.rarity_value == EnumRarity.uncommon) || (this.rarity_value == EnumRarity.common)) {
- return false;
- }
- return true;
+ return this.rarity_value != EnumRarity.uncommon && this.rarity_value != EnumRarity.common;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
index 95813e45bd..d1206d5296 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
@@ -184,8 +184,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition {
case GTPP_Bees.GREGTECH -> "gregtech.species" + name;
default -> "forestry.species" + name;
};
- IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
- return ret;
+ return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
}
private void setSpeciesProperties(GTPPAlleleBeeSpecies species2) {
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
index 39af813dec..34d87cb943 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
@@ -73,7 +73,7 @@ public enum GTPP_BranchDefinition {
return Arrays.copyOf(defaultTemplate, defaultTemplate.length);
}
- private final void setBranchProperties(IAllele[] template) {
+ private void setBranchProperties(IAllele[] template) {
this.mBranchProperties.accept(template);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
index 9f82936035..5dc2c4c7da 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -8,6 +8,7 @@ import static gtPlusPlus.core.util.Utils.getTcAspectStack;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -410,9 +411,9 @@ public enum GregtechOrePrefixes {
* at a location where it shouldn't happen.
* <p/>
* Mainly for preventing NullPointer Exceptions and providing Default Values.
- *
+ * <p>
* Unknown Material Components. Dead End Section.
- *
+ * <p>
* Alkalus Range 730-799 & 970-998 (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality,
* aTypes, R, G, B, Alpha, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp,
* aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor
@@ -420,7 +421,7 @@ public enum GregtechOrePrefixes {
*
*/
_NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1,
- Dyes._NULL, Element._NULL, Arrays.asList(getTcAspectStack(TCAspects.VACUOS.name(), 1))),
+ Dyes._NULL, Element._NULL, Collections.singletonList(getTcAspectStack(TCAspects.VACUOS.name(), 1))),
// Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false,
// 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new
@@ -459,7 +460,7 @@ public enum GregtechOrePrefixes {
Arrays.asList(getTcAspectStack(TCAspects.ELECTRUM, 8), getTcAspectStack(TCAspects.MACHINA, 8))),
Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 190, 240, 190, 0, "Superconductor", 0, 0, -1, 0, false,
- false, 1, 1, 1, Dyes.dyeGreen, Arrays.asList(getTcAspectStack(TCAspects.ELECTRUM, 8))),
+ false, 1, 1, 1, Dyes.dyeGreen, Collections.singletonList(getTcAspectStack(TCAspects.ELECTRUM, 8))),
Staballoy(30, TextureSet.SET_ROUGH, 10.0F, 5120, 4, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 66, 0, "Staballoy", 0,
0, 1500, 2800, true, false, 1, 3, 1, Dyes.dyeGreen, 2,
@@ -924,11 +925,12 @@ public enum GregtechOrePrefixes {
aColor);
this.mExtraData = aExtraData;
this.mMaterialList.addAll(aMaterialList);
- this.mChemicalFormula = "";
+ final StringBuilder sb = new StringBuilder();
for (final MaterialStack tMaterial : this.mMaterialList) {
- this.mChemicalFormula += tMaterial.toString();
+ sb.append(tMaterial.toString());
}
- this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
+ this.mChemicalFormula = sb.toString()
+ .replaceAll("_", "-");
int tAmountOfComponents = 0, tMeltingPoint = 0;
for (final MaterialStack tMaterial : this.mMaterialList) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
index 0a116b1b9f..7dd8b429d4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
@@ -5,5 +5,5 @@ public enum GregtechToolDictNames {
craftingToolAngleGrinder,
craftingToolElectricSnips,
craftingToolElectricLighter,
- craftingToolElectricButcherKnife;
+ craftingToolElectricButcherKnife
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java
index 1bc2050eee..743f10aae6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java
@@ -35,6 +35,6 @@ public class ElectricSlotWidget extends SlotWidget {
return false;
}
return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
- || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
+ || (ElectricItem.manager.discharge(stack, Double.NaN, 4, true, true, true) > 0.0D);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IGregtechItemContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IGregtechItemContainer.java
index ea9ab3602a..f8537b1125 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IGregtechItemContainer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IGregtechItemContainer.java
@@ -6,35 +6,35 @@ import net.minecraft.item.ItemStack;
public interface IGregtechItemContainer {
- public Item getItem();
+ Item getItem();
- public Block getBlock();
+ Block getBlock();
- public boolean isStackEqual(Object aStack);
+ boolean isStackEqual(Object aStack);
- public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
+ boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
- public ItemStack get(long aAmount, Object... aReplacements);
+ ItemStack get(long aAmount, Object... aReplacements);
- public ItemStack getWildcard(long aAmount, Object... aReplacements);
+ ItemStack getWildcard(long aAmount, Object... aReplacements);
- public ItemStack getUndamaged(long aAmount, Object... aReplacements);
+ ItemStack getUndamaged(long aAmount, Object... aReplacements);
- public ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
+ ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
- public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
+ ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
- public IGregtechItemContainer set(Item aItem);
+ IGregtechItemContainer set(Item aItem);
- public IGregtechItemContainer set(ItemStack aStack);
+ IGregtechItemContainer set(ItemStack aStack);
- public IGregtechItemContainer registerOre(Object... aOreNames);
+ IGregtechItemContainer registerOre(Object... aOreNames);
- public IGregtechItemContainer registerWildcardAsOre(Object... aOreNames);
+ IGregtechItemContainer registerWildcardAsOre(Object... aOreNames);
- public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
+ ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
- public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
+ ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
- public boolean hasBeenSet();
+ boolean hasBeenSet();
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java
index a68efc4fb8..5f7e4527cd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java
@@ -16,31 +16,31 @@ import gtPlusPlus.xmod.gregtech.api.items.GTMetaItemBase;
public interface IItemBehaviour<E extends Item> {
- public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
+ boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
- public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
- int aSide, float hitX, float hitY, float hitZ);
+ boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide,
+ float hitX, float hitY, float hitZ);
- public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
+ boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
int aSide, float hitX, float hitY, float hitZ);
- public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
+ ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
- public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+ List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
- public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
+ void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
- public boolean isItemStackUsable(E aItem, ItemStack aStack);
+ boolean isItemStackUsable(E aItem, ItemStack aStack);
- public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+ boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
- public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+ ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
- public boolean hasProjectile(GTMetaItemBase aItem, SubTag aProjectileType, ItemStack aStack);
+ boolean hasProjectile(GTMetaItemBase aItem, SubTag aProjectileType, ItemStack aStack);
- public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX,
- double aY, double aZ);
+ EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY,
+ double aZ);
- public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld,
- EntityLivingBase aEntity, float aSpeed);
+ EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity,
+ float aSpeed);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java
index 4c8b1c2391..93b61dc7f0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java
@@ -16,9 +16,9 @@ public interface IOreRecipeRegistrator {
* @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
* @param aStack always != null
*/
- public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName,
+ void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName,
ItemStack aStack);
- public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName,
+ void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName,
ItemStack copyAmount);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java
index 98b446869c..1a61814f55 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java
@@ -26,126 +26,126 @@ public interface IToolStats extends gregtech.api.interfaces.IToolStats {
* Called when aPlayer crafts this Tool
*/
@Override
- public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+ void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
/**
* Called when this gets added to a Tool Item
*/
- public void onStatsAddedToTool(GTMetaTool gregtech_MetaTool, int aID);
+ void onStatsAddedToTool(GTMetaTool gregtech_MetaTool, int aID);
/**
* @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
*/
@Override
- public int getToolDamagePerBlockBreak();
+ int getToolDamagePerBlockBreak();
/**
* @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
*/
@Override
- public int getToolDamagePerDropConversion();
+ int getToolDamagePerDropConversion();
/**
* @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times
* more than normal.
*/
@Override
- public int getToolDamagePerContainerCraft();
+ int getToolDamagePerContainerCraft();
/**
* @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
*/
@Override
- public int getToolDamagePerEntityAttack();
+ int getToolDamagePerEntityAttack();
/**
* @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools
* of this Type. Decreasing is also possible.
*/
@Override
- public int getBaseQuality();
+ int getBaseQuality();
/**
* @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
*/
@Override
- public float getBaseDamage();
+ float getBaseDamage();
/**
* @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
*/
@Override
- public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+ int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
/**
* @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
*/
@Override
- public float getSpeedMultiplier();
+ float getSpeedMultiplier();
/**
* @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
*/
@Override
- public float getMaxDurabilityMultiplier();
+ float getMaxDurabilityMultiplier();
@Override
- public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+ DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
@Override
- public String getMiningSound();
+ String getMiningSound();
@Override
- public String getCraftingSound();
+ String getCraftingSound();
@Override
- public String getEntityHitSound();
+ String getEntityHitSound();
@Override
- public String getBreakingSound();
+ String getBreakingSound();
@Override
- public Enchantment[] getEnchantments(ItemStack aStack);
+ Enchantment[] getEnchantments(ItemStack aStack);
@Override
- public int[] getEnchantmentLevels(ItemStack aStack);
+ int[] getEnchantmentLevels(ItemStack aStack);
/**
* @return If this Tool can be used for blocking Damage like a Sword.
*/
@Override
- public boolean canBlock();
+ boolean canBlock();
/**
* @return If this Tool can be used as an RC Crowbar.
*/
@Override
- public boolean isCrowbar();
+ boolean isCrowbar();
/**
* @return If this Tool can be used as an BC Wrench.
*/
@Override
- public boolean isWrench();
+ boolean isWrench();
/**
* @return If this Tool can be used as Weapon i.e. if that is the main purpose.
*/
@Override
- public boolean isWeapon();
+ boolean isWeapon();
/**
* @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your
* Bow/Gun or something
*/
@Override
- public boolean isRangedWeapon();
+ boolean isRangedWeapon();
/**
* @return If this Tool can be used as Weapon i.e. if that is the main purpose.
*/
@Override
- public boolean isMiningTool();
+ boolean isMiningTool();
/**
* aBlock.getHarvestTool(aMetaData) can return the following Values for example. "axe", "pickaxe", "sword",
@@ -156,7 +156,7 @@ public interface IToolStats extends gregtech.api.interfaces.IToolStats {
* check.
*/
@Override
- public boolean isMinableBlock(Block aBlock, byte aMetaData);
+ boolean isMinableBlock(Block aBlock, byte aMetaData);
/**
* This lets you modify the Drop List, when this type of Tool has been used.
@@ -164,38 +164,36 @@ public interface IToolStats extends gregtech.api.interfaces.IToolStats {
* @return the Amount of modified Items.
*/
@Override
- public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX,
- int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
+ int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY,
+ int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
/**
* @return Returns a broken Version of the Item.
*/
@Override
- public ItemStack getBrokenItem(ItemStack aStack);
+ ItemStack getBrokenItem(ItemStack aStack);
/**
* @return the Damage actually done to the Mob.
*/
@Override
- public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack,
- EntityPlayer aPlayer);
+ float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
/**
* @return the Damage actually done to the Mob.
*/
@Override
- public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack,
- EntityPlayer aPlayer);
+ float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
@Override
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+ IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
@Override
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+ short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
/**
* Called when this gets added to a Tool Item
*/
@Override
- public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID);
+ void onStatsAddedToTool(MetaGeneratedTool aItem, int aID);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItem.java
index c98023bad7..befca0975f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItem.java
@@ -106,7 +106,6 @@ public abstract class GTMetaItem extends GTMetaItemBase {
}
if (tRandomData == SubTag.NO_UNIFICATION) {
GTOreDictUnificator.addToBlacklist(rStack);
- continue;
}
}
}
@@ -140,7 +139,6 @@ public abstract class GTMetaItem extends GTMetaItemBase {
}
if (tUseOreDict) {
GTOreDictUnificator.registerOre(tRandomData, rStack);
- continue;
}
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemBase.java
index 3e7fcf1486..09c6d4467a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemBase.java
@@ -64,11 +64,8 @@ public abstract class GTMetaItemBase extends GTGenericItem
if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
return this;
}
- ArrayList<IItemBehaviour<GTMetaItemBase>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
+ ArrayList<IItemBehaviour<GTMetaItemBase>> tList = this.mItemBehaviors
+ .computeIfAbsent((short) aMetaValue, k -> new ArrayList<>(1));
tList.add(aBehavior);
return this;
}
@@ -278,8 +275,7 @@ public abstract class GTMetaItemBase extends GTGenericItem
EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY);
} else {
aList.add(
- EnumChatFormatting.AQUA + ""
- + GTUtility.formatNumbers(tCharge)
+ EnumChatFormatting.AQUA + GTUtility.formatNumbers(tCharge)
+ " / "
+ GTUtility.formatNumbers(Math.abs(tStats[0]))
+ " EU - Voltage: "
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemX32.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemX32.java
index 31cdac4770..102a3cc0b7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemX32.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/GTMetaItemX32.java
@@ -101,7 +101,7 @@ public abstract class GTMetaItemX32 extends GTMetaItem {
// You have to check for at least these Conditions in every Case! So add a super Call like the following for
// this before executing your Code:
// if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
- return (aPrefix != null) && (aMaterial != null) && aPrefix.doGenerateItem(aMaterial);
+ return aPrefix != null && aPrefix.doGenerateItem(aMaterial);
}
/* ---------- OVERRIDEABLE FUNCTIONS ---------- */
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
index e475037c63..6786fabc31 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
@@ -101,27 +101,27 @@ public class METHatchAirIntake extends MTEHatchFluidGenerator {
aWorld.spawnParticle(
name,
- (double) (xPos + ran1 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran1 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
aWorld.spawnParticle(
name,
- (double) (xPos + ran2 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran2 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
aWorld.spawnParticle(
name,
- (double) (xPos + ran3 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran3 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
index 0043819b23..68396fee78 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
@@ -125,22 +125,16 @@ public class MTEHatchElementalDataOrbHolder extends MTEHatch implements IConfigu
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
Logger.INFO("Checking if we can pull " + aStack.getDisplayName() + " from slot " + aIndex);
- if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
- && side == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
+ return aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
+ && side == getBaseMetaTileEntity().getFrontFacing();
}
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
Logger.INFO("Checking if we can put " + aStack.getDisplayName() + " into slot " + aIndex);
- if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
- && side == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
+ return aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
+ && side == getBaseMetaTileEntity().getFrontFacing();
}
public ArrayList<ItemStack> getInventory() {
@@ -154,7 +148,7 @@ public class MTEHatchElementalDataOrbHolder extends MTEHatch implements IConfigu
public ItemStack getOrbByCircuit() {
ItemStack aCirc = getBaseMetaTileEntity().getStackInSlot(getCircuitSlot());
- if (aCirc != null && ItemUtils.isControlCircuit(aCirc)) {
+ if (ItemUtils.isControlCircuit(aCirc)) {
int slot = aCirc.getItemDamage() - 1; // slots are 0 indexed but there's no 0 circuit
if (slot < getBaseMetaTileEntity().getSizeInventory() - 1) {
return getBaseMetaTileEntity().getStackInSlot(slot);
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
index 3a5640cd88..9eafd09a10 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
@@ -9,7 +9,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -58,14 +57,12 @@ public abstract class MTEHatchFluidGenerator extends MTEHatchInput {
@Override
public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GTRenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) };
+ return new ITexture[] { aBaseTexture, new GTRenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER) };
}
@Override
public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GTRenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) };
+ return new ITexture[] { aBaseTexture, new GTRenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER) };
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
index 2cf1ed3efe..dd38f1ab26 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
@@ -299,8 +299,8 @@ public class MTEHatchMufflerAdvanced extends MTEHatchMuffler implements IAddGreg
float zSpd;
if (aDir.offsetY == -1) {
float temp = GTPPCore.RANDOM.nextFloat() * 2.0F * GTPPCore.PI;
- xSpd = (float) Math.sin((double) temp) * 0.1F;
- zSpd = (float) Math.cos((double) temp) * 0.1F;
+ xSpd = (float) Math.sin(temp) * 0.1F;
+ zSpd = (float) Math.cos(temp) * 0.1F;
} else {
xSpd = (float) aDir.offsetX * (0.1F + 0.2F * GTPPCore.RANDOM.nextFloat());
zSpd = (float) aDir.offsetZ * (0.1F + 0.2F * GTPPCore.RANDOM.nextFloat());
@@ -309,34 +309,34 @@ public class MTEHatchMufflerAdvanced extends MTEHatchMuffler implements IAddGreg
if (chk1) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran1 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran1 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
if (chk2) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran2 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran2 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
if (chk3) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran3 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran3 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
index e95cea2762..a87d992139 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
@@ -38,7 +38,7 @@ public class MTEHatchSuperBusInput extends MTEHatchInputBus {
@Override
public String[] getDescription() {
- return new String[] { "Item Input for Multiblocks", "" + getSlots(this.mTier) + " Slots",
+ return new String[] { "Item Input for Multiblocks", getSlots(this.mTier) + " Slots",
GTPPCore.GT_Tooltip.get() };
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
index 09c3dd6efb..ee40ffdbe8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
@@ -106,8 +106,7 @@ public class MTEHatchTurbine extends MTEHatch {
public boolean hasTurbine() {
ItemStack aStack = this.mInventory[0];
- boolean aIsValid = MTELargerTurbineBase.isValidTurbine(aStack);
- return aIsValid;
+ return MTELargerTurbineBase.isValidTurbine(aStack);
}
public ItemStack getTurbine() {
@@ -194,15 +193,10 @@ public class MTEHatchTurbine extends MTEHatch {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (this.mHasController) {
if (aTick % 20 == 0) {
- if (isControllerActive()) {
- this.getBaseMetaTileEntity()
- .setActive(true);
- } else {
- this.getBaseMetaTileEntity()
- .setActive(false);
- }
+ this.getBaseMetaTileEntity()
+ .setActive(isControllerActive());
}
- } else if (!this.mHasController && this.mControllerLocation != null) {
+ } else if (this.mControllerLocation != null) {
// Weird Invalid State
if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
// Valid
@@ -224,7 +218,7 @@ public class MTEHatchTurbine extends MTEHatch {
}
public MTELargerTurbineBase getController() {
- if (this.mHasController && this.mControllerLocation != null && this.mControllerLocation.length() > 0) {
+ if (this.mHasController && this.mControllerLocation != null && !this.mControllerLocation.isEmpty()) {
BlockPos p = BlockPos.generateBlockPos(mControllerLocation);
if (p != null) {
// Logger.INFO(p.getLocationString());
@@ -246,10 +240,7 @@ public class MTEHatchTurbine extends MTEHatch {
}
public boolean canSetNewController() {
- if ((mControllerLocation != null && mControllerLocation.length() > 0) || this.mHasController) {
- return false;
- }
- return true;
+ return (mControllerLocation == null || mControllerLocation.isEmpty()) && !this.mHasController;
}
public boolean setController(BlockPos aPos) {
@@ -395,7 +386,7 @@ public class MTEHatchTurbine extends MTEHatch {
aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove.");
}
} else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) {
- if (mControllerLocation != null && mControllerLocation.length() > 0) {
+ if (mControllerLocation != null && !mControllerLocation.isEmpty()) {
if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
if (PlayerUtils.isCreative(aPlayer)
|| GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
index 6a501a2531..5d0bc5c554 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
@@ -110,18 +110,14 @@ public class MTEHatchTurbineProvider extends MTEHatchInputBus {
public boolean isItemStackTurbine(ItemStack aStack) {
if (aStack.getItem() instanceof MetaGeneratedTool) {
- if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) {
- return true;
- }
+ return aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176;
}
return false;
}
public boolean isItemStackScrewdriver(ItemStack aStack) {
if (aStack.getItem() instanceof MetaGeneratedTool) {
- if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) {
- return true;
- }
+ return aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150;
}
return false;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
index 686589b38a..0ea35495fa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import net.minecraft.inventory.IInventory;
-
import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.Scrollable;
@@ -68,8 +66,8 @@ public class MTESuperBusOutput extends MTEHatchOutputBus {
if (this.mInventory[j] != null && (this.mInventory[i] == null
|| GTUtility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) {
GTUtility.moveStackFromSlotAToSlotB(
- (IInventory) this.getBaseMetaTileEntity(),
- (IInventory) this.getBaseMetaTileEntity(),
+ this.getBaseMetaTileEntity(),
+ this.getBaseMetaTileEntity(),
j,
i,
(byte) 64,
@@ -83,10 +81,9 @@ public class MTESuperBusOutput extends MTEHatchOutputBus {
@Override
public String[] getDescription() {
- String[] aDesc = new String[] { "Item Output for Multiblocks", "" + getSlots(this.mTier) + " Slots",
+ return new String[] { "Item Output for Multiblocks", getSlots(this.mTier) + " Slots",
"Left click with data stick to save filter config", "Right click with data stick to load filter config",
GTPPCore.GT_Tooltip.get() };
- return aDesc;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
index b969227977..df55649bb5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
@@ -139,7 +139,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
public String[] getInfoData() {
ArrayList<String> mInfo = new ArrayList<>();
if (!this.getMetaName()
- .equals("")) {
+ .isEmpty()) {
mInfo.add(this.getMetaName());
}
@@ -148,11 +148,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (extra == null) {
extra = new String[0];
}
- if (extra.length > 0) {
- for (String s : extra) {
- mInfo.add(s);
- }
- }
+ mInfo.addAll(Arrays.asList(extra));
long seconds = (this.mTotalRunTime / 20);
int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
@@ -183,20 +179,18 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.GREEN
- + Long.toString(storedEnergy)
+ EnumChatFormatting.GREEN.toString() + storedEnergy
+ EnumChatFormatting.RESET
+ " EU / "
+ EnumChatFormatting.YELLOW
- + Long.toString(maxEnergy)
+ + maxEnergy
+ EnumChatFormatting.RESET
+ " EU"));
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.YELLOW
- + Long.toString(getMaxInputVoltage())
+ EnumChatFormatting.YELLOW.toString() + getMaxInputVoltage()
+ EnumChatFormatting.RESET
+ " EU/t(*2A) "
+ StatCollector.translateToLocal("GTPP.machines.tier")
@@ -211,12 +205,11 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + " In Dynamos:");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.GREEN
- + Long.toString(storedEnergy)
+ EnumChatFormatting.GREEN.toString() + storedEnergy
+ EnumChatFormatting.RESET
+ " EU / "
+ EnumChatFormatting.YELLOW
- + Long.toString(maxEnergy)
+ + maxEnergy
+ EnumChatFormatting.RESET
+ " EU"));
}
@@ -242,7 +235,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
+ StatCollector.translateToLocal("GTPP.multiblock.efficiency")
+ ": "
+ EnumChatFormatting.YELLOW
- + Float.toString(mEfficiency / 100.0F)
+ + mEfficiency / 100.0F
+ EnumChatFormatting.RESET
+ " %");
@@ -270,11 +263,11 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(
"Total Time Since Built: " + EnumChatFormatting.DARK_GREEN
- + Integer.toString(weeks)
+ + weeks
+ EnumChatFormatting.RESET
+ " Weeks, "
+ EnumChatFormatting.DARK_GREEN
- + Integer.toString(days)
+ + days
+ EnumChatFormatting.RESET
+ " Days, ");
mInfo.add(
@@ -282,17 +275,16 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
+ EnumChatFormatting.RESET
+ " Hours, "
+ EnumChatFormatting.DARK_GREEN
- + Long.toString(minutes)
+ + minutes
+ EnumChatFormatting.RESET
+ " Minutes, "
+ EnumChatFormatting.DARK_GREEN
- + Long.toString(second)
+ + second
+ EnumChatFormatting.RESET
+ " Seconds.");
- mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime));
+ mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + this.mTotalRunTime);
- String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]);
- return mInfo2;
+ return mInfo.toArray(new String[0]);
}
public int getPollutionReductionForAllMufflers() {
@@ -409,10 +401,8 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public boolean isMachineRunning() {
- boolean aRunning = this.getBaseMetaTileEntity()
+ return this.getBaseMetaTileEntity()
.isActive();
- // log("Queried Multiblock is currently running: "+aRunning);
- return aRunning;
}
@Override
@@ -423,19 +413,16 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatchOutputBattery> localIterator = this.mDischargeHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatch> localIterator = this.mTecTechDynamoHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatch> localIterator = this.mTecTechEnergyHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
@@ -465,7 +452,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public ItemStack findItemInInventory(ItemStack aSearchStack) {
- if (aSearchStack != null && this.mInputBusses.size() > 0) {
+ if (aSearchStack != null && !this.mInputBusses.isEmpty()) {
for (MTEHatchInputBus bus : this.mInputBusses) {
if (bus != null) {
for (ItemStack uStack : bus.mInventory) {
@@ -513,8 +500,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public boolean checkHatch() {
- return mMaintenanceHatches.size() <= 1
- && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true);
+ return mMaintenanceHatches.size() <= 1 && (this.getPollutionPerSecond(null) <= 0 || !mMufflerHatches.isEmpty());
}
@Override
@@ -610,8 +596,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (aTileEntity == null) {
return null;
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- return aMetaTileEntity;
+ return aTileEntity.getMetaTileEntity();
}
@Override
@@ -782,28 +767,27 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (aTileEntity == null) {
return false;
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity instanceof MTEHatchInput || aMetaTileEntity instanceof MTEHatchInputBus
- || aMetaTileEntity instanceof MteHatchSteamBusInput) {
- if (aMetaTileEntity instanceof MTEHatchInput) {
- ((MTEHatchInput) aMetaTileEntity).mRecipeMap = null;
- ((MTEHatchInput) aMetaTileEntity).mRecipeMap = aMap;
+ if (aTileEntity instanceof MTEHatchInput || aTileEntity instanceof MTEHatchInputBus
+ || aTileEntity instanceof MteHatchSteamBusInput) {
+ if (aTileEntity instanceof MTEHatchInput) {
+ ((MTEHatchInput) aTileEntity).mRecipeMap = null;
+ ((MTEHatchInput) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Hatch to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Hatch.");
}
- } else if (aMetaTileEntity instanceof MTEHatchInputBus) {
- ((MTEHatchInputBus) aMetaTileEntity).mRecipeMap = null;
- ((MTEHatchInputBus) aMetaTileEntity).mRecipeMap = aMap;
+ } else if (aTileEntity instanceof MTEHatchInputBus) {
+ ((MTEHatchInputBus) aTileEntity).mRecipeMap = null;
+ ((MTEHatchInputBus) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Bus.");
}
} else {
- ((MteHatchSteamBusInput) aMetaTileEntity).mRecipeMap = null;
- ((MteHatchSteamBusInput) aMetaTileEntity).mRecipeMap = aMap;
+ ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = null;
+ ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
@@ -997,8 +981,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
}
// Do Super
- boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, side, aX, aY, aZ);
- return aSuper;
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, side, aX, aY, aZ);
}
public boolean onPlungerRightClick(EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) {
@@ -1371,8 +1354,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
() -> StatCollector.translateToLocal("GTPP.multiblock.specialvalue") + ": "
+ EnumChatFormatting.RED
+ getLastRecipeEU()
- + EnumChatFormatting.RESET
- + "")
+ + EnumChatFormatting.RESET)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(
widget -> mMachine && getLastRecipeEU() != 0
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
index 6387624a1c..ed6432a58f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
@@ -225,7 +225,7 @@ public abstract class MTEBoilerBase extends MTEBasicTank {
}
if ((aTick % 10L) == 0L) {
if (this.mTemperature > 100) {
- if ((this.mFluid == null) || (!GTModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ if ((!GTModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
this.mHadNoWater = true;
} else {
if (this.mHadNoWater) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
index ae5e653de0..40678f203f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
@@ -232,7 +232,7 @@ public abstract class MTERocketFuelGeneratorBase extends MTEBasicTank implements
if ((tFluidAmountToUse > 0)
&& aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1);
- this.mFluid.amount -= (int) aSafeFloor;
+ this.mFluid.amount -= aSafeFloor;
PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
index b626bcc8ba..8cf42533c7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
@@ -211,7 +211,7 @@ public abstract class MTEHatchNbtConsumable extends MTEHatch implements IAddGreg
// Then Move stack to Usage slots
for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
if (mInventory[i] == null) {
- if ((aFoundMatching && aAllowMultiOfSameTypeInUsageSlots) || !aFoundMatching) {
+ if (!aFoundMatching || aAllowMultiOfSameTypeInUsageSlots) {
mInventory[i] = aStackToMove;
aDidSet = true;
Logger.INFO("Moving new stack to usage slots.");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
index 2cafd18a39..ea5e46a534 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
@@ -51,9 +51,7 @@ public class GregtechItemData {
}
}
this.mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY;
- for (int i = 0; i < this.mByProducts.length; i++) {
- this.mByProducts[i] = tByProducts[i];
- }
+ System.arraycopy(tByProducts, 0, this.mByProducts, 0, this.mByProducts.length);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
index 32f1f127d0..087e4fb056 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
@@ -15,7 +15,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlocksAbstract {
- private static HashMap<Integer, Integer> sMaterialMapping = new HashMap<>();
+ private static final HashMap<Integer, Integer> sMaterialMapping = new HashMap<>();
public GregtechMetaCasingBlocksPipeGearbox() {
super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", MaterialCasings.INSTANCE);
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
index 128e9c95d7..8208147236 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
@@ -13,43 +13,43 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.MT
public class TexturesGrinderMultiblock {
- private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE1");
- private static CustomIcon GT8_1 = new CustomIcon("iconsets/Grinder/GRINDER1");
- private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE2");
- private static CustomIcon GT8_2 = new CustomIcon("iconsets/Grinder/GRINDER2");
- private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE3");
- private static CustomIcon GT8_3 = new CustomIcon("iconsets/Grinder/GRINDER3");
- private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE4");
- private static CustomIcon GT8_4 = new CustomIcon("iconsets/Grinder/GRINDER4");
- private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
- private static CustomIcon GT8_5 = new CustomIcon("iconsets/Grinder/GRINDER5");
- private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE6");
- private static CustomIcon GT8_6 = new CustomIcon("iconsets/Grinder/GRINDER6");
- private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE7");
- private static CustomIcon GT8_7 = new CustomIcon("iconsets/Grinder/GRINDER7");
- private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE8");
- private static CustomIcon GT8_8 = new CustomIcon("iconsets/Grinder/GRINDER8");
- private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE9");
- private static CustomIcon GT8_9 = new CustomIcon("iconsets/Grinder/GRINDER9");
+ private static final CustomIcon GT8_1_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE1");
+ private static final CustomIcon GT8_1 = new CustomIcon("iconsets/Grinder/GRINDER1");
+ private static final CustomIcon GT8_2_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE2");
+ private static final CustomIcon GT8_2 = new CustomIcon("iconsets/Grinder/GRINDER2");
+ private static final CustomIcon GT8_3_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE3");
+ private static final CustomIcon GT8_3 = new CustomIcon("iconsets/Grinder/GRINDER3");
+ private static final CustomIcon GT8_4_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE4");
+ private static final CustomIcon GT8_4 = new CustomIcon("iconsets/Grinder/GRINDER4");
+ private static final CustomIcon GT8_5_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
+ private static final CustomIcon GT8_5 = new CustomIcon("iconsets/Grinder/GRINDER5");
+ private static final CustomIcon GT8_6_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE6");
+ private static final CustomIcon GT8_6 = new CustomIcon("iconsets/Grinder/GRINDER6");
+ private static final CustomIcon GT8_7_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE7");
+ private static final CustomIcon GT8_7 = new CustomIcon("iconsets/Grinder/GRINDER7");
+ private static final CustomIcon GT8_8_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE8");
+ private static final CustomIcon GT8_8 = new CustomIcon("iconsets/Grinder/GRINDER8");
+ private static final CustomIcon GT8_9_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE9");
+ private static final CustomIcon GT8_9 = new CustomIcon("iconsets/Grinder/GRINDER9");
- private static CustomIcon frontFace_0 = (GT8_1);
- private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
- private static CustomIcon frontFace_1 = (GT8_2);
- private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
- private static CustomIcon frontFace_2 = (GT8_3);
- private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
- private static CustomIcon frontFace_3 = (GT8_4);
- private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
- private static CustomIcon frontFace_4 = (GT8_5);
- private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
- private static CustomIcon frontFace_5 = (GT8_6);
- private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
- private static CustomIcon frontFace_6 = (GT8_7);
- private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
- private static CustomIcon frontFace_7 = (GT8_8);
- private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
- private static CustomIcon frontFace_8 = (GT8_9);
- private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
+ private static final CustomIcon frontFace_0 = (GT8_1);
+ private static final CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static final CustomIcon frontFace_1 = (GT8_2);
+ private static final CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static final CustomIcon frontFace_2 = (GT8_3);
+ private static final CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static final CustomIcon frontFace_3 = (GT8_4);
+ private static final CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static final CustomIcon frontFace_4 = (GT8_5);
+ private static final CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static final CustomIcon frontFace_5 = (GT8_6);
+ private static final CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static final CustomIcon frontFace_6 = (GT8_7);
+ private static final CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static final CustomIcon frontFace_7 = (GT8_8);
+ private static final CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static final CustomIcon frontFace_8 = (GT8_9);
+ private static final CustomIcon frontFaceActive_8 = (GT8_9_Active);
CustomIcon[] GRINDER = new CustomIcon[] { frontFace_0, frontFace_1, frontFace_2, frontFace_3, frontFace_4,
frontFace_5, frontFace_6, frontFace_7, frontFace_8 };
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
index dea287fde6..e0acc6666d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
@@ -383,16 +383,12 @@ public class LargeTurbineTextureHandler {
public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) {
boolean aVal = true;
- IGregTechTileEntity aTile;
- if (tTileEntity instanceof IGregTechTileEntity) {
- aTile = (IGregTechTileEntity) tTileEntity;
- if (aTile != null) {
- final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
- if (aMetaTileEntity != null && aMetaTileEntity instanceof MTEHatchTurbine) {
- aVal = ((MTEHatchTurbine) aMetaTileEntity).getBaseMetaTileEntity()
- .isActive();
- // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
- }
+ if (tTileEntity instanceof IGregTechTileEntity aTile) {
+ final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
+ if (aMetaTileEntity instanceof MTEHatchTurbine) {
+ aVal = aMetaTileEntity.getBaseMetaTileEntity()
+ .isActive();
+ // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
}
}
return aVal;
@@ -401,7 +397,7 @@ public class LargeTurbineTextureHandler {
public static MTEHatchTurbine isTurbineHatch(final IGregTechTileEntity aTileEntity) {
if (aTileEntity != null) {
final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity != null && aMetaTileEntity instanceof MTEHatchTurbine) {
+ if (aMetaTileEntity instanceof MTEHatchTurbine) {
return (MTEHatchTurbine) aMetaTileEntity;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverToggleVisual.java
index 2ba532d11f..891035f7ac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverToggleVisual.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverToggleVisual.java
@@ -31,8 +31,7 @@ public class CoverToggleVisual extends CoverBehavior {
BlockPos aPos = new BlockPos(
aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord()));
- String s = aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + side.name();
- return s;
+ return aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + side.name();
} catch (Throwable t) {}
XSTR x = new XSTR();
return "ERROR." + x.getSeed() + x.hashCode() + x.nextDouble() + ".ID";
@@ -168,10 +167,10 @@ public class CoverToggleVisual extends CoverBehavior {
public static boolean getConnectionState(String aKey) {
Integer b = sConnectionStateForEntityMap.get(aKey);
// Logger.INFO("Get State: "+b+" | "+aKey);
- return b != null ? b == VALUE_ON : false;
+ return b != null && b == VALUE_ON;
}
- public static final boolean getCoverConnections(final ItemStack aStack) {
+ public static boolean getCoverConnections(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("CustomCoverMeta");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
index 773bf0127e..4ef2838542 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
@@ -46,7 +46,7 @@ public class FlotationRecipeHandler {
}
public static ItemStack findMilledStack(ItemStack[] aInputs) {
- if (aInputs == null || aInputs.length <= 0) {
+ if (aInputs == null) {
return null;
}
for (ItemStack aStack : aInputs) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
index 03a4ace32f..35de0d8cea 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
@@ -25,7 +25,7 @@ public class TesseractHelper {
*/
// Checks if a Generator is owned by a player.
- public static final boolean isGeneratorOwnedByPlayer(EntityPlayer player, MTETesseractGenerator generator) {
+ public static boolean isGeneratorOwnedByPlayer(EntityPlayer player, MTETesseractGenerator generator) {
if (player == null) {
Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]");
return false;
@@ -50,7 +50,7 @@ public class TesseractHelper {
}
// Saves A Generator to the Players UUID map along with the Freq.
- public static final boolean setGeneratorOwnershipByPlayer(EntityPlayer player, int freq,
+ public static boolean setGeneratorOwnershipByPlayer(EntityPlayer player, int freq,
MTETesseractGenerator generator) {
if (player == null) {
return false;
@@ -82,7 +82,7 @@ public class TesseractHelper {
}
// Gets Generator based on Frequency.
- public static final MTETesseractGenerator getGeneratorByFrequency(EntityPlayer player, int freq) {
+ public static MTETesseractGenerator getGeneratorByFrequency(EntityPlayer player, int freq) {
if (player == null) {
return null;
}
@@ -107,7 +107,7 @@ public class TesseractHelper {
}
// Remove Tesseract Generator
- public static final boolean removeGenerator(EntityPlayer player, int frequency) {
+ public static boolean removeGenerator(EntityPlayer player, int frequency) {
if (player == null) {
return false;
}
@@ -129,7 +129,7 @@ public class TesseractHelper {
*/
// Checks if a Terminal is owned by a player.
- public static final boolean isTerminalOwnedByPlayer(EntityPlayer player, MTETesseractTerminal generator) {
+ public static boolean isTerminalOwnedByPlayer(EntityPlayer player, MTETesseractTerminal generator) {
if (player == null) {
return false;
}
@@ -148,8 +148,7 @@ public class TesseractHelper {
}
// Saves A Terminal to the Players UUID map along with the Freq.
- public static final boolean setTerminalOwnershipByPlayer(EntityPlayer player, int freq,
- MTETesseractTerminal generator) {
+ public static boolean setTerminalOwnershipByPlayer(EntityPlayer player, int freq, MTETesseractTerminal generator) {
if (player == null) {
return false;
}
@@ -178,7 +177,7 @@ public class TesseractHelper {
}
// Gets Terminal based on Frequency.
- public static final MTETesseractTerminal getTerminalByFrequency(EntityPlayer player, int freq) {
+ public static MTETesseractTerminal getTerminalByFrequency(EntityPlayer player, int freq) {
if (player == null) {
return null;
}
@@ -200,7 +199,7 @@ public class TesseractHelper {
}
// Remove Tesseract Terminal
- public static final boolean removeTerminal(EntityPlayer player, int frequency) {
+ public static boolean removeTerminal(EntityPlayer player, int frequency) {
if (player == null) {
return false;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
index a6cd63ca19..76b0ca91ea 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
@@ -18,7 +18,6 @@ import org.apache.commons.lang3.StringUtils;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTechAPI;
import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GTMultiTexture;
import gregtech.api.objects.GTRenderedTexture;
import gtPlusPlus.api.objects.Logger;
@@ -74,7 +73,7 @@ public class MetaCustomCoverItem extends Item {
}
GregTechAPI.registerCover(
thisStack,
- new GTMultiTexture(new ITexture[] { new GTRenderedTexture(mTextures[i]) }),
+ new GTMultiTexture(new GTRenderedTexture(mTextures[i])),
new CoverToggleVisual());
}
}
@@ -112,7 +111,7 @@ public class MetaCustomCoverItem extends Item {
return true;
}
- public static final long getCoverDamage(final ItemStack aStack) {
+ public static long getCoverDamage(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("CustomCoverMeta");
@@ -125,7 +124,7 @@ public class MetaCustomCoverItem extends Item {
return 0L;
}
- public static final boolean setCoverDamage(final ItemStack aStack, final long aDamage) {
+ public static boolean setCoverDamage(final ItemStack aStack, final long aDamage) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("CustomCoverMeta");
@@ -137,7 +136,7 @@ public class MetaCustomCoverItem extends Item {
return false;
}
- public static final boolean getCoverConnections(final ItemStack aStack) {
+ public static boolean getCoverConnections(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("CustomCoverMeta");
@@ -150,7 +149,7 @@ public class MetaCustomCoverItem extends Item {
return false;
}
- public static final boolean setCoverConnections(final ItemStack aStack, final boolean aConnections) {
+ public static boolean setCoverConnections(final ItemStack aStack, final boolean aConnections) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("CustomCoverMeta");
@@ -169,19 +168,14 @@ public class MetaCustomCoverItem extends Item {
}
double currentDamage = getCoverDamage(stack);
double meta = stack.getItemDamage() == 0 ? 50 : 2500;
- double durabilitypercent = currentDamage / meta;
- return durabilitypercent;
+ return currentDamage / meta;
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (KeyboardUtils.isShiftKeyDown()) {
boolean con = getCoverConnections(stack);
- if (con) {
- setCoverConnections(stack, false);
- } else {
- setCoverConnections(stack, true);
- }
+ setCoverConnections(stack, !con);
}
return stack;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
index be7a0f1c99..5a1bb0eba5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
@@ -16,7 +16,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
public class Behaviour_Choocher extends BehaviourNone {
- private boolean isWrench = true;
+ private final boolean isWrench = true;
private final BehaviourWrench wrench = new BehaviourWrench(150);
private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250);
private final String mTooltip1 = GTLanguageManager
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
index f63da57f1c..4196d399a1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
@@ -68,9 +68,7 @@ public class Behaviour_Prospecting_Ex extends BehaviourProspecting {
int tY = aY;
int tZ = aZ;
int tMetaID = 0;
- final int tQuality = ((aItem instanceof MetaGeneratedTool)
- ? ((MetaGeneratedTool) aItem).getHarvestLevel(aStack, "")
- : 0) * 3;
+ final int tQuality = ((aItem instanceof MetaGeneratedTool) ? aItem.getHarvestLevel(aStack, "") : 0) * 3;
int i = 0;
for (final int j = 6 + tQuality; i < j; i++) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/MachineBlockRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/MachineBlockRenderer.java
index 7ce7002738..e39a6fcbba 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/MachineBlockRenderer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/MachineBlockRenderer.java
@@ -232,21 +232,19 @@ public class MachineBlockRenderer extends GTRendererBlock {
RenderBlocks aRenderer) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof ITexturedTileEntity
- ? renderStandardBlock(
- aWorld,
- aX,
- aY,
- aZ,
- aBlock,
- aRenderer,
- new ITexture[][] { GTMethodHelper.getTexture(tTileEntity, aBlock, DOWN),
- GTMethodHelper.getTexture(tTileEntity, aBlock, UP),
- GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.NORTH),
- GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.SOUTH),
- GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.WEST),
- GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.EAST) })
- : false;
+ return tTileEntity instanceof ITexturedTileEntity && renderStandardBlock(
+ aWorld,
+ aX,
+ aY,
+ aZ,
+ aBlock,
+ aRenderer,
+ new ITexture[][] { GTMethodHelper.getTexture(tTileEntity, aBlock, DOWN),
+ GTMethodHelper.getTexture(tTileEntity, aBlock, UP),
+ GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.NORTH),
+ GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.SOUTH),
+ GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.WEST),
+ GTMethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.EAST) });
}
public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
@@ -1220,22 +1218,13 @@ public class MachineBlockRenderer extends GTRendererBlock {
public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID,
RenderBlocks aRenderer) {
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return aTileEntity == null ? false
- : (aTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null
- && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity()
- .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)
- ? true
- : (aTileEntity instanceof IPipeRenderedTileEntity
- ? renderPipeBlock(
- aWorld,
- aX,
- aY,
- aZ,
- aBlock,
- (IPipeRenderedTileEntity) aTileEntity,
- aRenderer)
- : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer)));
+ return aTileEntity != null && (aTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null
+ && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity()
+ .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)
+ || (aTileEntity instanceof IPipeRenderedTileEntity
+ ? renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) aTileEntity, aRenderer)
+ : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer)));
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java
index 05150c8478..73233b7938 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java
@@ -391,7 +391,9 @@ public class MTEElectricAutoWorkbench extends MTEBasicTank implements IAddGregte
tTempStack.stackSize = 1;
tRecipe[0] = tTempStack;
tOutput = GTOreDictUnificator.get(true, tTempStack);
- if (tOutput != null && GTUtility.areStacksEqual(tOutput, tTempStack)) tOutput = null;
+ if (GTUtility.areStacksEqual(tOutput, tTempStack)) {
+ tOutput = null;
+ }
if (tOutput == null) {
tRecipe[0] = null;
if (mInventory[18] == null) {
@@ -552,7 +554,7 @@ public class MTEElectricAutoWorkbench extends MTEBasicTank implements IAddGregte
mInventory[28] = GTUtility.copy(tOutput);
ArrayList<ItemStack> tList = recipeContent(tRecipe), tContent = benchContent();
- if (tList.size() > 0 && tContent.size() > 0) {
+ if (!tList.isEmpty() && !tContent.isEmpty()) {
boolean success = (mMode == 6 || mMode == 7 || mInventory[17] == null);
for (byte i = 0; i < tList.size() && success; i++) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java
index 08db4e19be..a48bcdace4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java
@@ -196,13 +196,10 @@ public class MTETesseractGenerator extends MTEBasicTank {
.getOwnerName() != null
&& !this.getBaseMetaTileEntity()
.getOwnerName()
- .equals("")) {
+ .isEmpty()) {
if (this.getBaseMetaTileEntity()
.getOwnerName()
- .toLowerCase()
- .equals(
- aPlayer.getDisplayName()
- .toLowerCase())) {
+ .equalsIgnoreCase(aPlayer.getDisplayName())) {
this.mOwner = PlayerUtils.getPlayersUUIDByName(
this.getBaseMetaTileEntity()
.getOwnerName());
@@ -684,8 +681,8 @@ public class MTETesseractGenerator extends MTEBasicTank {
&& (this.getBaseMetaTileEntity()
.decreaseStoredEnergyUnits(this.mNeededEnergy, false))) {
// Utils.LOG_WARNING("Can Work & Has Energy");
- if ((getGeneratorEntity(Integer.valueOf(this.mFrequency)) == null)
- || (!getGeneratorEntity(Integer.valueOf(this.mFrequency)).isValidTesseractGenerator(null, true))) {
+ if ((getGeneratorEntity(this.mFrequency) == null)
+ || (!getGeneratorEntity(this.mFrequency).isValidTesseractGenerator(null, true))) {
// Utils.LOG_WARNING("storing TE I think to mFreq map?");
TesseractHelper.setGeneratorOwnershipByPlayer(
PlayerUtils.getPlayerOnServerFromUUID(mOwner),
@@ -693,7 +690,7 @@ public class MTETesseractGenerator extends MTEBasicTank {
this);
}
} else {
- if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
+ if (getGeneratorEntity(this.mFrequency) == this) {
Logger.WARNING("this gen == mFreq on map - do block update");
TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
this.getBaseMetaTileEntity()
@@ -701,7 +698,7 @@ public class MTETesseractGenerator extends MTEBasicTank {
}
this.isWorking = 0;
}
- if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
+ if (getGeneratorEntity(this.mFrequency) == this) {
// Utils.LOG_WARNING("mFreq == this - do work related things");
if (this.isWorking < 20) {
this.isWorking = ((byte) (this.isWorking + 1));
@@ -789,21 +786,11 @@ public class MTETesseractGenerator extends MTEBasicTank {
}
private MTETesseractGenerator getGeneratorEntity() {
- MTETesseractGenerator thisGenerator = TesseractHelper
- .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
- if (thisGenerator != null) {
- return thisGenerator;
- }
- return null;
+ return TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
}
private MTETesseractGenerator getGeneratorEntity(int frequency) {
- MTETesseractGenerator thisGenerator = TesseractHelper
- .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency);
- if (thisGenerator != null) {
- return thisGenerator;
- }
- return null;
+ return TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency);
}
@Override
@@ -812,7 +799,7 @@ public class MTETesseractGenerator extends MTEBasicTank {
.getOwnerName() != null
&& !this.getBaseMetaTileEntity()
.getOwnerName()
- .equals("")) {
+ .isEmpty()) {
this.mOwner = PlayerUtils.getPlayersUUIDByName(
this.getBaseMetaTileEntity()
.getOwnerName());
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java
index c34a2ca41b..1935129e32 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java
@@ -149,13 +149,10 @@ public class MTETesseractTerminal extends MTEBasicTank {
.getOwnerName() != null
&& !this.getBaseMetaTileEntity()
.getOwnerName()
- .equals("")) {
+ .isEmpty()) {
if (this.getBaseMetaTileEntity()
.getOwnerName()
- .toLowerCase()
- .equals(
- aPlayer.getDisplayName()
- .toLowerCase())) {
+ .equalsIgnoreCase(aPlayer.getDisplayName())) {
this.mOwner = PlayerUtils.getPlayersUUIDByName(
this.getBaseMetaTileEntity()
.getOwnerName());
@@ -194,11 +191,7 @@ public class MTETesseractTerminal extends MTEBasicTank {
}
PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
if (this.getTesseract(this.mFrequency, false) != null) {
- PlayerUtils.messagePlayer(
- aPlayer,
- new StringBuilder().append(EnumChatFormatting.GREEN)
- .append(" (Connected)")
- .toString());
+ PlayerUtils.messagePlayer(aPlayer, EnumChatFormatting.GREEN + " (Connected)");
}
}
} else if (aPlayer.getUniqueID()
@@ -250,9 +243,7 @@ public class MTETesseractTerminal extends MTEBasicTank {
aPlayer,
"Frequency: " + this.mFrequency
+ (this.getTesseract(this.mFrequency, false) == null ? ""
- : new StringBuilder().append(EnumChatFormatting.GREEN)
- .append(" (Connected)")
- .toString()));
+ : EnumChatFormatting.GREEN + " (Connected)"));
}
} else if (aPlayer.getUniqueID()
.compareTo(this.mOwner) != 0) {
@@ -275,10 +266,8 @@ public class MTETesseractTerminal extends MTEBasicTank {
return null;
}
if (rTesseract.mFrequency != aFrequency) {
- TesseractHelper.setTerminalOwnershipByPlayer(
- PlayerUtils.getPlayerOnServerFromUUID(mOwner),
- Integer.valueOf(aFrequency),
- null);
+ TesseractHelper
+ .setTerminalOwnershipByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency, null);
return null;
}
if (!rTesseract.isValidTesseractGenerator(
@@ -539,7 +528,7 @@ public class MTETesseractTerminal extends MTEBasicTank {
this.getBaseMetaTileEntity()
.decreaseStoredEnergyUnits(128, false);
}
- } else if (this.mDidWork == true) {
+ } else if (this.mDidWork) {
this.mDidWork = false;
this.getBaseMetaTileEntity()
.issueBlockUpdate();
@@ -623,7 +612,7 @@ public class MTETesseractTerminal extends MTEBasicTank {
.getOwnerName() != null
&& !this.getBaseMetaTileEntity()
.getOwnerName()
- .equals("")) {
+ .isEmpty()) {
this.mOwner = PlayerUtils.getPlayersUUIDByName(
this.getBaseMetaTileEntity()
.getOwnerName());
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java
index e84f4763cf..e1fc5c57f0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java
@@ -27,7 +27,7 @@ public class MTEGeothermalGenerator extends MTEBasicGenerator {
public int mEfficiency;
public MTEGeothermalGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]);
+ super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel");
this.setEfficiency();
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
index 9b51724b35..9f70912cad 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
@@ -169,7 +169,7 @@ public class MTERTGenerator extends MTEBasicGenerator {
}
public MTERTGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires RTG Pellets", new ITexture[0]);
+ super(aID, aName, aNameRegional, aTier, "Requires RTG Pellets");
}
private byte getTier() {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERocketFuelGenerator.java
index 48c3a63007..3565ac831b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERocketFuelGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERocketFuelGenerator.java
@@ -21,7 +21,7 @@ public class MTERocketFuelGenerator extends MTERocketFuelGeneratorBase {
public int mEfficiency;
public MTERocketFuelGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels", new ITexture[0]);
+ super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels");
}
public MTERocketFuelGenerator(final String aName, final int aTier, final String[] aDescription,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java
index 49c9523612..d499093247 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java
@@ -27,7 +27,7 @@ public class MTESemiFluidGenerator extends MTEBasicGenerator {
public int mEfficiency;
public MTESemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires semifluid Fuel", new ITexture[0]);
+ super(aID, aName, aNameRegional, aTier, "Requires semifluid Fuel");
this.mEfficiency = 100 - (this.mTier * 5);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java
index 6988d2f43b..438fe6a536 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java
@@ -68,14 +68,14 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
"Making sure you don't live in Gwalior - Uses 2A",
3,
0,
- new ITexture[] { new GTRenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
- new GTRenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB),
- new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
- new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab),
- new GTRenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast),
- new GTRenderedTexture(TexturesGtBlock.Overlay_Machine_Vent),
- new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
- new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) });
+ new GTRenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
+ new GTRenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_Machine_Vent),
+ new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
+ new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB));
mPollutionEnabled = GTMod.gregtechproxy.mPollution;
}
@@ -264,8 +264,7 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
Logger.INFO("mOptimalAirFlow[1]:" + mOptimalAirFlow);
// Calculate The Voltage we are running
- long tVoltage = drainEU;
- byte tTier = (byte) Math.max(1, GTUtility.getTier(tVoltage));
+ byte tTier = (byte) Math.max(1, GTUtility.getTier(drainEU));
// Check Sides for Air,
// More air means more pollution processing.
@@ -295,15 +294,8 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
Logger.INFO("mCurrentPollution[4]:" + mCurrentPollution);
Logger.INFO("mCurrentPollution[5]:" + reduction);
- if (reduction <= mCurrentPollution) {
- // Clean some Air.
- toRemove = reduction;
- } else {
- // Makes sure we don't get negative pollution.
- toRemove = mCurrentPollution;
- }
-
- toRemove = toRemove / 2;
+
+ toRemove = Math.min(reduction, mCurrentPollution) / 2;
Logger.INFO("mCurrentPollution[6]:" + toRemove);
// We are good to clean
@@ -391,21 +383,13 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
mCurrentChunkPollution += getPollutionInChunk(r);
}
}
- if (mCurrentChunkPollution > 0) {
- mHasPollution = true;
- } else {
- mHasPollution = false;
- }
+ mHasPollution = mCurrentChunkPollution > 0;
return mCurrentChunkPollution;
}
public int getPollutionInChunk(Chunk aChunk) {
int mCurrentChunkPollution = PollutionUtils.getPollution(aChunk);
- if (mCurrentChunkPollution > 0) {
- mHasPollution = true;
- } else {
- mHasPollution = false;
- }
+ mHasPollution = mCurrentChunkPollution > 0;
return mCurrentChunkPollution;
}
@@ -573,9 +557,8 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
public boolean removePollution(int toRemove) {
- if (this == null || this.getBaseMetaTileEntity() == null
- || this.getBaseMetaTileEntity()
- .getWorld() == null) {
+ if (this.getBaseMetaTileEntity() == null || this.getBaseMetaTileEntity()
+ .getWorld() == null) {
return false;
}
@@ -740,10 +723,8 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
if (aStack.getItem() instanceof ItemBasicScrubberTurbine) {
return true;
}
- if (aStack.getItem() instanceof MetaGeneratedTool && aStack.getItemDamage() >= 170
- && aStack.getItemDamage() <= 179) {
- return true;
- }
+ return aStack.getItem() instanceof MetaGeneratedTool && aStack.getItemDamage() >= 170
+ && aStack.getItemDamage() <= 179;
}
}
return false;
@@ -765,8 +746,7 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine {
@Override
public String[] getInfoData() {
- ArrayList<String> aTooltipSuper = new ArrayList<>();
- aTooltipSuper.addAll(Arrays.asList(super.getInfoData()));
+ ArrayList<String> aTooltipSuper = new ArrayList<>(Arrays.asList(super.getInfoData()));
int mAirSides = getFreeSpaces();
int reduction = 0;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAutoChisel.java
index 6cdc97130b..b4f69323f4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAutoChisel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAutoChisel.java
@@ -40,14 +40,14 @@ public class MTEAutoChisel extends MTEBasicMachine {
"Chisels things, Gregtech style",
1,
1,
- new ITexture[] { new GTRenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
- new GTRenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB),
- new GTRenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE),
- new GTRenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER),
- new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
- new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab),
- new GTRenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
- new GTRenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) });
+ new GTRenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
+ new GTRenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB),
+ new GTRenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE),
+ new GTRenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
+ new GTRenderedTexture(TexturesGtBlock.Overlay_MatterFab),
+ new GTRenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
+ new GTRenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB));
}
public MTEAutoChisel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
@@ -90,8 +90,8 @@ public class MTEAutoChisel extends MTEBasicMachine {
@Override
protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
- return hasValidCache(aStack, this.getSpecialSlot(), false) ? true
- : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, side, aStack) && hasChiselResults(aStack);
+ return hasValidCache(aStack, this.getSpecialSlot(), false)
+ || super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, side, aStack) && hasChiselResults(aStack);
}
// lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
@@ -108,7 +108,7 @@ public class MTEAutoChisel extends MTEBasicMachine {
// lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
private static boolean hasChiselResults(ItemStack from) {
List<ItemStack> results = getItemsForChiseling(from);
- return results.size() > 0;
+ return !results.isEmpty();
}
private static List<ItemStack> getItemsForChiseling(ItemStack aStack) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTECropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTECropHarvestor.java
index 9788abcf0c..f1f129606f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTECropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTECropHarvestor.java
@@ -164,7 +164,7 @@ public class MTECropHarvestor extends MTEBasicTank {
};
}
- private HashSet<ICropTile> mCropCache = new HashSet<>();
+ private final HashSet<ICropTile> mCropCache = new HashSet<>();
private boolean mInvalidCache = false;
public boolean doesInventoryHaveSpace() {
@@ -213,7 +213,7 @@ public class MTECropHarvestor extends MTEBasicTank {
for (int x = (-aSide); x <= aSide; x++) {
for (int z = (-aSide); z <= aSide; z++) {
TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z);
- if (tTileEntity != null && tTileEntity instanceof ICropTile tCrop) {
+ if (tTileEntity instanceof ICropTile tCrop) {
this.mCropCache.add(tCrop);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java
index 2521fb703f..0226214c44 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java
@@ -22,10 +22,10 @@ public class MTEPollutionCreator extends GTPPMetaTileEntity {
int mCurrentPollution;
int mAveragePollution;
- int mAveragePollutionArray[] = new int[10];
+ int[] mAveragePollutionArray = new int[10];
private int mArrayPos = 0;
private int mTickTimer = 0;
- private int mSecondTimer = 0;
+ private final int mSecondTimer = 0;
public MTEPollutionCreator(final int aID, final String aName, final String aNameRegional, final int aTier,
final String aDescription, final int aSlotCount) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java
index 747663f4cb..87e18931b5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java
@@ -24,10 +24,10 @@ public class MTEPollutionDetector extends GTPPMetaTileEntity {
int mCurrentPollution;
int mAveragePollution;
- int mAveragePollutionArray[] = new int[10];
+ int[] mAveragePollutionArray = new int[10];
private int mArrayPos = 0;
private int mTickTimer = 0;
- private int mSecondTimer = 0;
+ private final int mSecondTimer = 0;
private long mRedstoneLevel = 0;
public MTEPollutionDetector(final int aID, final String aName, final String aNameRegional, final int aTier,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java
index 1535140115..739a098331 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java
@@ -323,9 +323,7 @@ public class MTEWirelessCharger extends GTPPMetaTileEntity {
@Override
public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
+ aBaseMetaTileEntity.isClientSide();
return true;
}
@@ -449,18 +447,14 @@ public class MTEWirelessCharger extends GTPPMetaTileEntity {
super.onFirstTick(aBaseMetaTileEntity);
}
- private Map<String, UUID> mWirelessChargingMap = new HashMap<>();
- private Map<String, UUID> mLocalChargingMap = new HashMap<>();
+ private final Map<String, UUID> mWirelessChargingMap = new HashMap<>();
+ private final Map<String, UUID> mLocalChargingMap = new HashMap<>();
private boolean isValidPlayer(EntityPlayer aPlayer) {
BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity();
if (mLocked || (aTile != null && aTile.privateAccess())) {
- if (aPlayer.getUniqueID()
- .equals(getBaseMetaTileEntity().getOwnerUuid())) {
- return true;
- } else {
- return false;
- }
+ return aPlayer.getUniqueID()
+ .equals(getBaseMetaTileEntity().getOwnerUuid());
}
return true;
}
@@ -579,11 +573,10 @@ public class MTEWirelessCharger extends GTPPMetaTileEntity {
int[] objectArray1 = new int[] { objectA.xPos, objectA.yPos, objectA.zPos };
int[] objectArray2 = new int[] { objectB.xPos, objectB.yPos, objectB.zPos };
- final double distance = Math.sqrt(
+ return Math.sqrt(
(objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0])
+ (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1])
+ (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2]));
- return distance;
}
@Override
@@ -636,7 +629,7 @@ public class MTEWirelessCharger extends GTPPMetaTileEntity {
PlayerUtils.messagePlayer(aPlayer, "Players with access:");
for (String name : this.getLocalMap()
.keySet()) {
- PlayerUtils.messagePlayer(aPlayer, "" + name);
+ PlayerUtils.messagePlayer(aPlayer, name);
}
} else {
@@ -644,7 +637,7 @@ public class MTEWirelessCharger extends GTPPMetaTileEntity {
PlayerUtils.messagePlayer(aPlayer, "Players with access:");
for (String name : this.getLongRangeMap()
.keySet()) {
- PlayerUtils.messagePlayer(aPlayer, "" + name);
+ PlayerUtils.messagePlayer(aPlayer, name);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java
index 40a497fa06..d68fe3f8c7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java
@@ -195,7 +195,7 @@ public class MTEIndustrialChisel extends GTPPMultiBlockBase<MTEIndustrialChisel>
// lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
private static boolean hasChiselResults(ItemStack from) {
List<ItemStack> results = getItemsForChiseling(from);
- return results.size() > 0;
+ return !results.isEmpty();
}
private static List<ItemStack> getItemsForChiseling(ItemStack aStack) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java
index eb7e6baa9c..8b63f34edb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java
@@ -62,7 +62,7 @@ public class MTEIndustrialDehydrator extends GTPPMultiBlockBase<MTEIndustrialDeh
implements ISurvivalConstructable {
private static int CASING_TEXTURE_ID;
- private static String mCasingName = "Vacuum Casing";
+ private static final String mCasingName = "Vacuum Casing";
private HeatingCoilLevel mHeatingCapacity;
private boolean mDehydratorMode = false;
private int mCasing;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java
index 8d543b7bcc..563b844574 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java
@@ -72,7 +72,7 @@ public class MTEIndustrialVacuumFreezer extends GTPPMultiBlockBase<MTEIndustrial
@Override
public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (IMetaTileEntity) new MTEIndustrialVacuumFreezer(this.mName);
+ return new MTEIndustrialVacuumFreezer(this.mName);
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java
index 0df9417f32..5634b5f1d6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java
@@ -256,9 +256,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi
if (!aEntities.isEmpty()) {
for (EntityLivingBase aFoundEntity : aEntities) {
if (aFoundEntity instanceof EntityPlayer aPlayer) {
- if (PlayerUtils.isCreative(aPlayer) || !PlayerUtils.canTakeDamage(aPlayer)) {
- continue;
- } else {
+ if (!PlayerUtils.isCreative(aPlayer) && PlayerUtils.canTakeDamage(aPlayer)) {
if (aFoundEntity.getHealth() > 0) {
EntityUtils.doDamage(aFoundEntity, mIsaMillDamageSource, getPlayerDamageValue(aPlayer, 10));
if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java
index 4c313a3be3..6952dd5c24 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java
@@ -264,7 +264,7 @@ public class MTECyclotron extends GTPPMultiBlockBase<MTECyclotron> implements IS
@Override
public boolean onRunningTick(ItemStack aStack) {
- if (this.mOutputBusses.size() > 0) {
+ if (!this.mOutputBusses.isEmpty()) {
for (MTEHatchOutputBus g : this.mOutputBusses) {
if (g != null) {
for (ItemStack s : g.mInventory) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java
index a241238e42..32ea79cc55 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java
@@ -152,7 +152,7 @@ public class MTEElementalDuplicator extends GTPPMultiBlockBase<MTEElementalDupli
.build(),
buildHatchAdder(MTEElementalDuplicator.class)
.hatchClass(MTEHatchElementalDataOrbHolder.class)
- .shouldReject(x -> x.mReplicatorDataOrbHatches.size() >= 1)
+ .shouldReject(x -> !x.mReplicatorDataOrbHatches.isEmpty())
.adder(MTEElementalDuplicator::addDataOrbHatch)
.casingIndex(getCasingTextureIndex())
.dot(1)
@@ -172,7 +172,7 @@ public class MTEElementalDuplicator extends GTPPMultiBlockBase<MTEElementalDupli
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasing = 0;
boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0);
- if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() != 0)
+ if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && !this.mOutputHatches.isEmpty())
|| this.mEnergyHatches.size() != 1
|| this.mReplicatorDataOrbHatches.size() != 1) {
return false;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java
index f4e9bac434..bbcbfc1322 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java
@@ -276,7 +276,7 @@ public class MTEFrothFlotationCell extends GTPPMultiBlockBase<MTEFrothFlotationC
@Override
public boolean isRecipeLockingEnabled() {
- return lockedMaterialName != null && !lockedMaterialName.equals("");
+ return lockedMaterialName != null && !lockedMaterialName.isEmpty();
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java
index c3bf843fd3..ee62f45ef8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java
@@ -144,7 +144,7 @@ public class MTEIndustrialRockBreaker extends GTPPMultiBlockBase<MTEIndustrialRo
boolean aCheckPiece = checkPiece(mName, 1, 3, 0);
boolean aCasingCount = mCasing >= 9;
boolean aCheckHatch = checkHatch();
- log("" + aCheckPiece + ", " + aCasingCount + ", " + aCheckHatch);
+ log(aCheckPiece + ", " + aCasingCount + ", " + aCheckHatch);
return aCheckPiece && aCasingCount && aCheckHatch;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeRocketEngine.java
index f2ddecb687..b9e1d7858c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeRocketEngine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeRocketEngine.java
@@ -132,8 +132,8 @@ public class MTELargeRocketEngine extends GTPPMultiBlockBase<MTELargeRocketEngin
@Override
public IStructureDefinition<MTELargeRocketEngine> getStructureDefinition() {
- if (this.STRUCTURE_DEFINITION == null) {
- this.STRUCTURE_DEFINITION = StructureDefinition.<MTELargeRocketEngine>builder()
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<MTELargeRocketEngine>builder()
.addShape(
this.mName,
transpose(
@@ -161,7 +161,7 @@ public class MTELargeRocketEngine extends GTPPMultiBlockBase<MTELargeRocketEngin
.addElement('M', Muffler.newAny(getCasingTextureIndex(), 3))
.build();
}
- return this.STRUCTURE_DEFINITION;
+ return STRUCTURE_DEFINITION;
}
@Override
@@ -182,7 +182,7 @@ public class MTELargeRocketEngine extends GTPPMultiBlockBase<MTELargeRocketEngin
this.mAllDynamoHatches.clear();
this.mAirIntakes.clear();
return checkPiece(this.mName, 1, 1, 0) && this.mCasing >= 64 - 48
- && this.mAirIntakes.size() >= 1
+ && !this.mAirIntakes.isEmpty()
&& checkHatch();
}
@@ -270,7 +270,7 @@ public class MTELargeRocketEngine extends GTPPMultiBlockBase<MTELargeRocketEngin
// reset fuel ticks in case it does not reset when it stops
if (this.freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0) this.freeFuelTicks = 0;
- if (tFluids.size() > 0 && getRecipeMap() != null) {
+ if (!tFluids.isEmpty() && getRecipeMap() != null) {
if (this.mRuntime % 72 == 0) {
if (!consumeCO2()) {
this.freeFuelTicks = 0;
@@ -375,7 +375,7 @@ public class MTELargeRocketEngine extends GTPPMultiBlockBase<MTELargeRocketEngin
if (aEU <= 0) {
return true;
}
- if (this.mAllDynamoHatches.size() > 0) {
+ if (!this.mAllDynamoHatches.isEmpty()) {
return addEnergyOutputMultipleDynamos(aEU, true);
}
return false;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTENuclearReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTENuclearReactor.java
index 3da77cf783..31caefe8f2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTENuclearReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTENuclearReactor.java
@@ -261,7 +261,7 @@ public class MTENuclearReactor extends GTPPMultiBlockBase<MTENuclearReactor> imp
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasing = 0;
if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) {
- if ((mOutputHatches.size() >= 3 || canDumpFluidToME()) && mInputHatches.size() >= 1
+ if ((mOutputHatches.size() >= 3 || canDumpFluidToME()) && !mInputHatches.isEmpty()
&& mDynamoHatches.size() == 4
&& mMufflerHatches.size() == 4) {
this.turnCasingActive(false);
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java
index f7f992e191..9b28387849 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java
@@ -175,7 +175,7 @@ public class MTERefinery extends GTPPMultiBlockBase<MTERefinery> implements ISur
mCasing = 0;
if (checkPiece(mName, 1, 7, 0) && mCasing >= 7) {
if (this.mInputHatches.size() >= 2 && this.mInputHatches.size() <= 4
- && this.mOutputHatches.size() >= 1
+ && !this.mOutputHatches.isEmpty()
&& this.mOutputHatches.size() <= 2
&& this.mMufflerHatches.size() == 1
&& this.mMaintenanceHatches.size() == 1
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java
index 085cb1b784..31ed44d5a3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java
@@ -281,8 +281,8 @@ public class MTESolarTower extends GTPPMultiBlockBase<MTESolarTower> implements
boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4;
if (!aAllCasings || !aAllStructure
|| mMaintenanceHatches.size() != 1
- || mInputHatches.size() < 1
- || mOutputHatches.size() < 1) {
+ || mInputHatches.isEmpty()
+ || mOutputHatches.isEmpty()) {
log(
"Bad Hatches - Solar Heaters: " + mSolarHeaters.size()
+ ", Maint: "
@@ -486,7 +486,7 @@ public class MTESolarTower extends GTPPMultiBlockBase<MTESolarTower> implements
// log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
}
}
- return mSolarHeaters.size() > 0;
+ return !mSolarHeaters.isEmpty();
}
private boolean addSolarHeater(IGregTechTileEntity aTileEntity, int a) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java
index bb5754bef7..5478014c62 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java
@@ -266,8 +266,7 @@ public class MTETreeFarm extends GTPPMultiBlockBase<MTETreeFarm> implements ISur
* In previous versions, a saw used to go in the controller slot. We do not want an update to stop processing of
* a machine set up like this. Instead, a sapling is placed in this slot at the start of the next operation.
*/
- if (aStack.getItem() instanceof MetaGeneratedTool01) return true;
- return false;
+ return aStack.getItem() instanceof MetaGeneratedTool01;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java
index 49e9878bec..6b266908ce 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java
@@ -183,8 +183,8 @@ public class MTEAlgaePondBase extends GTPPMultiBlockBase<MTEAlgaePondBase> imple
if (checkPiece(mName, 4, 2, 0) && mCasing >= 64
&& checkMeta > 0
- && mInputHatches.size() >= 1
- && mOutputBusses.size() >= 1) {
+ && !mInputHatches.isEmpty()
+ && !mOutputBusses.isEmpty()) {
mLevel = checkMeta - 1;
for (MTEHatchInput inputHatch : mInputHatches) {
if (inputHatch.mTier < mLevel) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java
index a6794809ef..1e5d1bb9ea 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java
@@ -80,7 +80,7 @@ public class MTEChemicalPlant extends GTPPMultiBlockBase<MTEChemicalPlant> imple
private int mPipeCasingTier = 0;
private int mCoilTier = 0;
private HeatingCoilLevel checkCoil;
- private int[] checkCasing = new int[8];
+ private final int[] checkCasing = new int[8];
private int checkMachine;
private int checkPipe;
private int maxTierOfHatch;
@@ -114,10 +114,8 @@ public class MTEChemicalPlant extends GTPPMultiBlockBase<MTEChemicalPlant> imple
if (!mTieredBlockRegistry.containsKey(aTier)) {
return 10;
}
- int aCasingID = mTieredBlockRegistry.get(aTier)
+ return mTieredBlockRegistry.get(aTier)
.getValue_3();
- // Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier);
- return aCasingID;
}
@Override
@@ -216,7 +214,7 @@ public class MTEChemicalPlant extends GTPPMultiBlockBase<MTEChemicalPlant> imple
.dot(1)
.build(),
buildHatchAdder(MTEChemicalPlant.class).hatchClass(MTEHatchCatalysts.class)
- .shouldReject(t -> t.mCatalystBuses.size() >= 1)
+ .shouldReject(t -> !t.mCatalystBuses.isEmpty())
.adder(MTEChemicalPlant::addChemicalPlantList)
.casingIndex(getCasingTextureID())
.dot(1)
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java
index 93ec17e6ea..1e44eb95c3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java
@@ -25,7 +25,6 @@ import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;
import gregtech.api.util.TurbineStatCalculator;
-@SuppressWarnings("deprecation")
public class MTELargeTurbineGas extends MTELargerTurbineBase {
private static final HashSet<Fluid> BLACKLIST = new HashSet<>();
@@ -110,7 +109,7 @@ public class MTELargeTurbineGas extends MTELargerTurbineBase {
@Override
long fluidIntoPower(ArrayList<FluidStack> aFluids, TurbineStatCalculator turbine) {
- if (aFluids.size() >= 1) {
+ if (!aFluids.isEmpty()) {
int tEU = 0;
int actualOptimalFlow = 0;
FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process.
@@ -153,15 +152,12 @@ public class MTELargeTurbineGas extends MTELargerTurbineBase {
if (totalFlow <= 0) return 0;
tEU = GTUtility.safeInt((long) totalFlow * fuelValue);
- if (totalFlow == actualOptimalFlow) {
- tEU = GTUtility.safeInt(
- (long) (tEU * (isLooseMode() ? turbine.getLooseGasEfficiency() : turbine.getGasEfficiency())));
- } else {
+ if (totalFlow != actualOptimalFlow) {
float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow);
tEU *= efficiency;
- tEU = GTUtility.safeInt(
- (long) (tEU * (isLooseMode() ? turbine.getLooseGasEfficiency() : turbine.getGasEfficiency())));
}
+ tEU = GTUtility
+ .safeInt((long) (tEU * (isLooseMode() ? turbine.getLooseGasEfficiency() : turbine.getGasEfficiency())));
return tEU;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java
index 25650fad08..5fbcb237fd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java
@@ -14,7 +14,6 @@ import gregtech.api.util.TurbineStatCalculator;
import gtPlusPlus.core.lib.GTPPCore;
import gtPlusPlus.core.util.math.MathUtils;
-@SuppressWarnings("deprecation")
public class MTELargeTurbineSHSteam extends MTELargerTurbineBase {
public boolean achievement = false;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java
index 0de134950c..beeaa2726b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java
@@ -14,7 +14,6 @@ import gregtech.api.util.GTModHandler;
import gregtech.api.util.TurbineStatCalculator;
import gtPlusPlus.core.util.math.MathUtils;
-@SuppressWarnings("deprecation")
public class MTELargeTurbineSteam extends MTELargerTurbineBase {
private float water;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java
index dc2f105bbb..fa9d60fb11 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java
@@ -214,11 +214,11 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
log("Structure Check: " + aStructure);
if (mTurbineRotorHatches.size() != 12 || mMaintenanceHatches.size() != 1
- || (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1)
+ || (mDynamoHatches.isEmpty() && mTecTechDynamoHatches.isEmpty())
|| (requiresMufflers() && mMufflerHatches.size() != 4)
- || mInputBusses.size() < 1
- || mInputHatches.size() < 1
- || (requiresOutputHatch() && mOutputHatches.size() < 1)) {
+ || mInputBusses.isEmpty()
+ || mInputHatches.isEmpty()
+ || (requiresOutputHatch() && mOutputHatches.isEmpty())) {
log(
"Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size()
+ ", Maint: "
@@ -406,7 +406,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
for (MTEHatchInputBus aInputBus : this.mInputBusses) {
for (int slot = aInputBus.getSizeInventory() - 1; slot >= 0; slot--) {
ItemStack aStack = aInputBus.getStackInSlot(slot);
- if (aStack != null && GTUtility.areStacksEqual(aStack, aTurbine)) {
+ if (GTUtility.areStacksEqual(aStack, aTurbine)) {
aStack.stackSize -= aTurbine.stackSize;
updateSlots();
endRecipeProcessing();
@@ -421,7 +421,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
public @NotNull CheckRecipeResult checkProcessing() {
try {
ArrayList<MTEHatchTurbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
- if (aEmptyTurbineRotorHatches.size() > 0) {
+ if (!aEmptyTurbineRotorHatches.isEmpty()) {
hatch: for (MTEHatchTurbine aHatch : aEmptyTurbineRotorHatches) {
ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
for (ItemStack aTurbineItem : aTurbines) {
@@ -436,7 +436,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
}
}
- if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
+ if (!getEmptyTurbineAssemblies().isEmpty() || !areAllTurbinesTheSame()) {
stopMachine(ShutDownReasonRegistry.NO_TURBINE);
return CheckRecipeResultRegistry.NO_TURBINE_FOUND;
}
@@ -448,7 +448,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
TurbineStatCalculator turbine = new TurbineStatCalculator((MetaGeneratedTool) aStack.getItem(), aStack);
- if (tFluids.size() > 0) {
+ if (!tFluids.isEmpty()) {
if (baseEff == 0 || optFlow == 0
|| counter >= 512
|| this.getBaseMetaTileEntity()
@@ -606,7 +606,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
.toLowerCase()
.contains("steam");
- String[] ret = new String[] {
+ return new String[] {
// 8 Lines available for information panels
tRunning + ": "
+ EnumChatFormatting.RED
@@ -649,7 +649,6 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
+ GTUtility.formatNumbers(mPollutionReduction)
+ EnumChatFormatting.RESET
+ " %" };
- return ret;
}
@Override
@@ -794,7 +793,7 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT
if (aEU <= 0) {
return true;
}
- if (this.mAllDynamoHatches.size() > 0) {
+ if (!this.mAllDynamoHatches.isEmpty()) {
return addEnergyOutputMultipleDynamos(aEU, true);
}
return false;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java
index 3385125bb7..4f3626e7cd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java
@@ -23,7 +23,6 @@ import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchTurbine;
-@SuppressWarnings("deprecation")
public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
public MTELargerTurbinePlasma(int aID, String aName, String aNameRegional) {
@@ -92,7 +91,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
try {
ArrayList<MTEHatchTurbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
- if (aEmptyTurbineRotorHatches.size() > 0) {
+ if (!aEmptyTurbineRotorHatches.isEmpty()) {
hatch: for (MTEHatchTurbine aHatch : aEmptyTurbineRotorHatches) {
ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
for (ItemStack aTurbineItem : aTurbines) {
@@ -107,7 +106,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
}
}
- if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
+ if (!getEmptyTurbineAssemblies().isEmpty() || !areAllTurbinesTheSame()) {
stopMachine(ShutDownReasonRegistry.NO_TURBINE);
return CheckRecipeResultRegistry.NO_TURBINE_FOUND;
}
@@ -122,7 +121,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
ArrayList<FluidStack> tFluids = getStoredFluids();
- if (tFluids.size() > 0) {
+ if (!tFluids.isEmpty()) {
if (baseEff == 0 || optFlow == 0
|| counter >= 512
|| this.getBaseMetaTileEntity()
@@ -169,7 +168,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
// formula:
// EU/t = EU/t * MIN(1, ( ( (FuelValue / 200) ^ 2 ) / EUPerTurbine))
int fuelValue = 0;
- if (tFluids.size() > 0) {
+ if (!tFluids.isEmpty()) {
fuelValue = getFuelValue(new FluidStack(tFluids.get(0), 0));
}
float magicValue = (fuelValue * 0.005f) * (fuelValue * 0.005f);
@@ -181,7 +180,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
// Magic numbers: can always change by at least 200 eu/s, but otherwise by at most 20 percent of the
// difference in power level (per second)
// This is how much the turbine can actually change during this tick
- int maxChangeAllowed = Math.max(200, GTUtility.safeInt((long) Math.abs(difference) / 5));
+ int maxChangeAllowed = Math.max(200, GTUtility.safeInt(Math.abs(difference) / 5));
if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed
// change
@@ -209,7 +208,7 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
}
long fluidIntoPower(ArrayList<FluidStack> aFluids, TurbineStatCalculator turbine) {
- if (aFluids.size() >= 1) {
+ if (!aFluids.isEmpty()) {
int tEU = 0;
int actualOptimalFlow = 0;
@@ -255,18 +254,12 @@ public class MTELargerTurbinePlasma extends MTELargerTurbineBase {
if (totalFlow <= 0) return 0;
tEU = GTUtility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow));
- if (totalFlow == actualOptimalFlow) {
- tEU = GTUtility.safeInt(
- (long) ((isLooseMode() ? turbine.getLoosePlasmaEfficiency() : turbine.getPlasmaEfficiency())
- * tEU));
- } else {
+ if (totalFlow != actualOptimalFlow) {
double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow);
-
tEU = (int) (tEU * efficiency);
- tEU = GTUtility.safeInt(
- (long) ((isLooseMode() ? turbine.getLoosePlasmaEfficiency() : turbine.getPlasmaEfficiency())
- * tEU));
}
+ tEU = GTUtility.safeInt(
+ (long) ((isLooseMode() ? turbine.getLoosePlasmaEfficiency() : turbine.getPlasmaEfficiency()) * tEU));
return tEU;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
index f392bff171..241b970ae8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
@@ -81,7 +81,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMult
public class GregtechMetaTileEntity_PowerSubStationController
extends GTPPMultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> implements ISurvivalConstructable {
- private static enum TopState {
+ private enum TopState {
MayBeTop,
Top,
NotTop
@@ -99,7 +99,7 @@ public class GregtechMetaTileEntity_PowerSubStationController
private final int ENERGY_TAX = 5;
private int mCasing;
- private int[] cellCount = new int[6];
+ private final int[] cellCount = new int[6];
private TopState topState = TopState.MayBeTop;
private static IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null;
@@ -212,17 +212,13 @@ public class GregtechMetaTileEntity_PowerSubStationController
}
public static int getMaxHatchTier(int aCellTier) {
- switch (aCellTier) {
- case 9 -> {
- return GTValues.VOLTAGE_NAMES[9].equals("Ultimate High Voltage") ? 15 : 9;
- }
- default -> {
- if (aCellTier < 4) {
- return 0;
- } else {
- return aCellTier;
- }
- }
+ if (aCellTier == 9) {
+ return GTValues.VOLTAGE_NAMES[9].equals("Ultimate High Voltage") ? 15 : 9;
+ }
+ if (aCellTier < 4) {
+ return 0;
+ } else {
+ return aCellTier;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/MTESolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/MTESolarHeater.java
index 64925c9bb1..45721139bb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/MTESolarHeater.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/MTESolarHeater.java
@@ -266,7 +266,7 @@ public class MTESolarHeater extends MTETieredMachineBlock {
}
public boolean canSeeSky() {
- if (this.getBaseMetaTileEntity()
+ return this.getBaseMetaTileEntity()
.getWorld()
.canBlockSeeTheSky(
this.getBaseMetaTileEntity()
@@ -274,17 +274,14 @@ public class MTESolarHeater extends MTETieredMachineBlock {
this.getBaseMetaTileEntity()
.getYCoord() + 1,
this.getBaseMetaTileEntity()
- .getZCoord())) {
- return true;
- }
- return false;
+ .getZCoord());
}
public boolean setSolarTower(MTESolarTower aTowerTile) {
if (!hasSolarTower()) {
this.mTX = aTowerTile.getBaseMetaTileEntity()
.getXCoord();
- this.mTY = (int) aTowerTile.getBaseMetaTileEntity()
+ this.mTY = aTowerTile.getBaseMetaTileEntity()
.getYCoord();
this.mTZ = aTowerTile.getBaseMetaTileEntity()
.getZCoord();
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneCircuitBlock.java
index 20cd569e24..fceebe62d3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneCircuitBlock.java
@@ -46,7 +46,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class MTERedstoneCircuitBlock extends MTERedstoneBase implements IRedstoneCircuitBlock, IAddUIWidgets {
- public int mGate = 0, mGateData[] = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
+ public int mGate = 0;
+ public int[] mGateData = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
public boolean bOutput = true;
public MTERedstoneCircuitBlock(int aID) {
@@ -159,8 +160,7 @@ public class MTERedstoneCircuitBlock extends MTERedstoneBase implements IRedston
public void switchGateForward(boolean aShift) {
try {
Set<Integer> tKeys = GregTechAPI.sCircuitryBehaviors.keySet();
- ArrayList<Integer> tList = new ArrayList<>();
- tList.addAll(tKeys);
+ ArrayList<Integer> tList = new ArrayList<>(tKeys);
if (tList.size() <= 0) return;
Collections.sort(tList);
if (!GregTechAPI.sCircuitryBehaviors.containsKey(mGate)) mGate = tList.get(0);
@@ -177,8 +177,7 @@ public class MTERedstoneCircuitBlock extends MTERedstoneBase implements IRedston
public void switchGateBackward(boolean aShift) {
try {
Set<Integer> tKeys = GregTechAPI.sCircuitryBehaviors.keySet();
- ArrayList<Integer> tList = new ArrayList<>();
- tList.addAll(tKeys);
+ ArrayList<Integer> tList = new ArrayList<>(tKeys);
if (tList.size() <= 0) return;
Collections.sort(tList);
if (!GregTechAPI.sCircuitryBehaviors.containsKey(mGate)) mGate = tList.get(0);
@@ -324,7 +323,7 @@ public class MTERedstoneCircuitBlock extends MTERedstoneBase implements IRedston
if (sCoversItems.isEmpty()) {
initCovers();
}
- return sCoversItems.get(Integer.valueOf(aStack));
+ return sCoversItems.get(aStack);
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTETieredChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTETieredChest.java
index 423a71c3e1..51e5431da0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTETieredChest.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTETieredChest.java
@@ -39,8 +39,7 @@ public class MTETieredChest extends MTETieredMachineBlock implements IAddUIWidge
aNameRegional,
aTier,
3,
- "This Chest stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items",
- new ITexture[0]);
+ "This Chest stores " + (int) (Math.pow(6.0D, aTier) * mStorageFactor) + " Items");
}
public MTETieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
@@ -151,7 +150,7 @@ public class MTETieredChest extends MTETieredMachineBlock implements IAddUIWidge
@Override
public int getMaxItemCount() {
- return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D);
+ return (int) (Math.pow(6.0D, this.mTier) * mStorageFactor - 128.0D);
}
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolAngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolAngleGrinder.java
index 196bc2a5bb..f65b3162f8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolAngleGrinder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolAngleGrinder.java
@@ -28,7 +28,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
public class ToolAngleGrinder extends GTTool {
public static final List<String> mEffectiveList = Arrays
- .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" });
+ .asList(EntityIronGolem.class.getName(), "EntityTowerGuardian");
@Override
public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack,
@@ -134,7 +134,7 @@ public class ToolAngleGrinder extends GTTool {
@Override
public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead ? TexturesGtTools.ANGLE_GRINDER : ItemIcons.POWER_UNIT_HV);
+ return aIsToolHead ? TexturesGtTools.ANGLE_GRINDER : ItemIcons.POWER_UNIT_HV;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolElectricSnips.java
index 78675f70d5..08b691f3e8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolElectricSnips.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/ToolElectricSnips.java
@@ -65,7 +65,7 @@ public class ToolElectricSnips extends ToolWireCutter {
@Override
public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead ? TexturesGtTools.ELECTRIC_SNIPS : ItemIcons.POWER_UNIT_MV);
+ return aIsToolHead ? TexturesGtTools.ELECTRIC_SNIPS : ItemIcons.POWER_UNIT_MV;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java
index c64c846541..37ef0edc66 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java
@@ -223,8 +223,7 @@ public class RecipeGenBlastSmelter extends RecipeGenBase {
M.getComposites()
.get(irc)
.getDustStack(r))) {
- final int xr = r;
- if ((xr > 0) && (xr <= 100)) {
+ if (r > 0 && r <= 100) {
final int mathmatics = (r * 1000);
componentsFluid = FluidUtils.getFluidStack(
M.getComposites()
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelterGTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelterGTNH.java
index a78b517268..8e92843e18 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelterGTNH.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelterGTNH.java
@@ -24,8 +24,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class RecipeGenBlastSmelterGTNH {
- private static Map<String, FluidStack> mCachedIngotToFluidRegistry = new HashMap<>();
- private static Map<String, String> mCachedHotToColdRegistry = new HashMap<>();
+ private static final Map<String, FluidStack> mCachedIngotToFluidRegistry = new HashMap<>();
+ private static final Map<String, String> mCachedHotToColdRegistry = new HashMap<>();
private static synchronized void setIngotToFluid(final ItemStackData stack, final FluidStack fluid) {
if (stack != null && fluid != null) {
@@ -40,29 +40,25 @@ public class RecipeGenBlastSmelterGTNH {
}
private static synchronized FluidStack getFluidFromIngot(final ItemStackData ingot) {
- ItemStackData h = ingot;
- if (mCachedIngotToFluidRegistry.containsKey(h.getUniqueDataIdentifier())) {
+ if (mCachedIngotToFluidRegistry.containsKey(ingot.getUniqueDataIdentifier())) {
Logger.MACHINE_INFO("[ABS] mCachedIngotToFluidRegistry contains Output Ingot.");
- return mCachedIngotToFluidRegistry.get(h.getUniqueDataIdentifier());
+ return mCachedIngotToFluidRegistry.get(ingot.getUniqueDataIdentifier());
}
- if (mCachedHotToColdRegistry.containsKey(h.getUniqueDataIdentifier())) {
+ if (mCachedHotToColdRegistry.containsKey(ingot.getUniqueDataIdentifier())) {
Logger.MACHINE_INFO("[ABS] mCachedHotToColdRegistry contains Output Ingot.");
- return mCachedIngotToFluidRegistry.get(mCachedHotToColdRegistry.get(h.getUniqueDataIdentifier()));
+ return mCachedIngotToFluidRegistry.get(mCachedHotToColdRegistry.get(ingot.getUniqueDataIdentifier()));
}
Logger.MACHINE_INFO("[ABS] Neither Cache contains Output Ingot.");
return null;
}
- private static boolean isValid(final ItemStack[] inputs, final ItemStack outputs[], final FluidStack[] fluidIn,
+ private static boolean isValid(final ItemStack[] inputs, final ItemStack[] outputs, final FluidStack[] fluidIn,
final FluidStack fluidOut) {
- if (inputs != null && outputs != null
+ return inputs != null && outputs != null
&& fluidIn != null
&& fluidOut != null
&& inputs.length > 0
- && outputs.length > 0) {
- return true;
- }
- return false;
+ && outputs.length > 0;
}
public static synchronized boolean generateGTNHBlastSmelterRecipesFromEBFList() {
@@ -152,7 +148,6 @@ public class RecipeGenBlastSmelterGTNH {
// continue to next recipe if the Temp is too high.
if (special > 3600) {
Logger.MACHINE_INFO("[ABS] Skipping ABS addition for GTNH due to temp.");
- continue;
} else {
FluidStack mMoltenStack = null;
int mMoltenCount = 0;
@@ -188,7 +183,7 @@ public class RecipeGenBlastSmelterGTNH {
aTempList.add(recipeItem);
}
- inputs = aTempList.toArray(new ItemStack[aTempList.size()]);
+ inputs = aTempList.toArray(new ItemStack[0]);
int inputLength = inputs.length;
// If no circuit was found, increase array length by 1 to add circuit at newInput[0]
if (!circuitFound) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java
index a334fd7de4..58aeed46d7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java
@@ -39,7 +39,7 @@ public class RecipeGenFluidCanning implements Runnable {
private static boolean mHasRun = false;
- private static HashSet<RecipeGenFluidCanning> mCache = new HashSet<>();
+ private static final HashSet<RecipeGenFluidCanning> mCache = new HashSet<>();
private static void addRunnableToRecipeCache(RecipeGenFluidCanning r) {
if (mHasRun) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java
index 352217ff95..31d097ab71 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java
@@ -76,9 +76,9 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase {
*/
// Process Dust
- if (componentMap.size() > 0 && componentMap.size() <= 6) {
- ItemStack mInternalOutputs[] = new ItemStack[6];
- int mChances[] = new int[6];
+ if (!componentMap.isEmpty() && componentMap.size() <= 6) {
+ ItemStack[] mInternalOutputs = new ItemStack[6];
+ int[] mChances = new int[6];
int mCellCount = 0;
int mTotalCount = 0;
@@ -168,9 +168,7 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase {
internalOutputs.removeIf(Objects::isNull);
int[] chances = new int[internalOutputs.size()];
- for (int i = 0; i < internalOutputs.size(); i++) {
- chances[i] = mChances[i];
- }
+ System.arraycopy(mChances, 0, chances, 0, internalOutputs.size());
ItemStack[] inputs;
if (emptyCell == null) {
@@ -195,8 +193,8 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase {
"[Issue][Electrolyzer] " + material.getLocalizedName()
+ " is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
- ItemStack mInternalOutputs[] = new ItemStack[9];
- int mChances[] = new int[9];
+ ItemStack[] mInternalOutputs = new ItemStack[9];
+ int[] mChances = new int[9];
int mCellCount = 0;
int mTotalCount = 0;
@@ -284,9 +282,7 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase {
List<ItemStack> internalOutputs = new ArrayList<>(Arrays.asList(mInternalOutputs));
internalOutputs.removeIf(Objects::isNull);
int[] chances = new int[internalOutputs.size()];
- for (int i = 0; i < internalOutputs.size(); i++) {
- chances[i] = mChances[i];
- }
+ System.arraycopy(mChances, 0, chances, 0, internalOutputs.size());
ItemStack[] inputs;
if (emptyCell == null) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java
index c8c1d28547..eb3d27e009 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java
@@ -74,8 +74,8 @@ public class RecipeGenOre extends RecipeGenBase {
Material bonusA = null; // Ni
Material bonusB = null; // Tin
- if (material.getComposites()
- .size() >= 1
+ if (!material.getComposites()
+ .isEmpty()
&& material.getComposites()
.get(0) != null) {
bonusA = material.getComposites()
@@ -89,9 +89,7 @@ public class RecipeGenOre extends RecipeGenBase {
// Setup Bonuses
ArrayList<Material> aMatComp = new ArrayList<>();
- for (Material j : MaterialUtils.getCompoundMaterialsRecursively(material)) {
- aMatComp.add(j);
- }
+ aMatComp.addAll(MaterialUtils.getCompoundMaterialsRecursively(material));
if (aMatComp.size() < 3) {
while (aMatComp.size() < 3) {
@@ -374,10 +372,10 @@ public class RecipeGenOre extends RecipeGenBase {
if (!disableOptional) {
// Process Dust
- if (componentMap.size() > 0 && componentMap.size() <= 6) {
+ if (!componentMap.isEmpty() && componentMap.size() <= 6) {
- ItemStack mInternalOutputs[] = new ItemStack[6];
- int mChances[] = new int[6];
+ ItemStack[] mInternalOutputs = new ItemStack[6];
+ int[] mChances = new int[6];
int mCellCount = 0;
int mTotalCount = 0;
@@ -466,9 +464,7 @@ public class RecipeGenOre extends RecipeGenBase {
List<ItemStack> internalOutputs = new ArrayList<>(Arrays.asList(mInternalOutputs));
internalOutputs.removeIf(Objects::isNull);
int[] chances = new int[internalOutputs.size()];
- for (int i = 0; i < internalOutputs.size(); i++) {
- chances[i] = mChances[i];
- }
+ System.arraycopy(mChances, 0, chances, 0, internalOutputs.size());
ItemStack[] inputs;
if (emptyCell == null) {
inputs = new ItemStack[] { mainDust };
@@ -490,8 +486,8 @@ public class RecipeGenOre extends RecipeGenBase {
"[Issue][Electrolyzer] " + material.getLocalizedName()
+ " is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
- ItemStack mInternalOutputs[] = new ItemStack[9];
- int mChances[] = new int[9];
+ ItemStack[] mInternalOutputs = new ItemStack[9];
+ int[] mChances = new int[9];
int mCellCount = 0;
int mTotalCount = 0;
@@ -582,9 +578,7 @@ public class RecipeGenOre extends RecipeGenBase {
List<ItemStack> internalOutputs = new ArrayList<>(Arrays.asList(mInternalOutputs));
internalOutputs.removeIf(Objects::isNull);
int[] chances = new int[internalOutputs.size()];
- for (int i = 0; i < internalOutputs.size(); i++) {
- chances[i] = mChances[i];
- }
+ System.arraycopy(mChances, 0, chances, 0, internalOutputs.size());
ItemStack[] inputs;
if (emptyCell == null) {
@@ -607,8 +601,7 @@ public class RecipeGenOre extends RecipeGenBase {
+ " x"
+ mainDust.stackSize
+ ", "
- + (emptyCell == null ? "No Cells"
- : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize));
+ + (emptyCell == null ? "No Cells" : emptyCell.getDisplayName() + " x" + emptyCell.stackSize));
Logger.MATERIALS("Outputs " + ItemUtils.getArrayStackNames(mInternalOutputs));
Logger.MATERIALS("Time: " + ((int) Math.max(material.getMass() * 4L * 1, 1)));
Logger.MATERIALS("EU: " + tVoltageMultiplier);
@@ -654,7 +647,6 @@ public class RecipeGenOre extends RecipeGenBase {
null,
matDust);
- final ItemStack normalDust = matDust;
final ItemStack smallDust = material.getSmallDust(1);
final ItemStack tinyDust = material.getTinyDust(1);
@@ -668,28 +660,28 @@ public class RecipeGenOre extends RecipeGenBase {
tinyDust,
tinyDust,
tinyDust,
- normalDust)) {
+ matDust)) {
Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
} else {
Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
}
if (RecipeUtils
- .addShapedRecipe(normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) {
+ .addShapedRecipe(matDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) {
Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success");
} else {
Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed");
}
if (RecipeUtils
- .addShapedRecipe(smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) {
+ .addShapedRecipe(smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, matDust)) {
Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
} else {
Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
}
if (RecipeUtils
- .addShapedRecipe(null, normalDust, null, null, null, null, null, null, null, material.getSmallDust(4))) {
+ .addShapedRecipe(null, matDust, null, null, null, null, null, null, null, material.getSmallDust(4))) {
Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
} else {
Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java
index 63812e2e6e..68011ace71 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java
@@ -86,7 +86,7 @@ public class RecipeGenRecycling implements Runnable {
.getDisplayName());
validCounter++;
}
- Pair<OrePrefixes, ItemStack> temp3[] = new Pair[validCounter];
+ Pair<OrePrefixes, ItemStack>[] temp3 = new Pair[validCounter];
int temp4 = 0;
for (Pair<OrePrefixes, ItemStack> r : mValidPairs) {
if (r == null) {
@@ -250,8 +250,10 @@ public class RecipeGenRecycling implements Runnable {
}
return GTUtility.copyAmount(
aAmount,
- new Object[] { GTOreDictUnificator.getName2StackMap()
- .get(aName.toString()), getFirstOre(aName, aAmount), aReplacement });
+ GTOreDictUnificator.getName2StackMap()
+ .get(aName.toString()),
+ getFirstOre(aName, aAmount),
+ aReplacement);
}
public static ItemStack getFirstOre(final Object aName, final long aAmount) {
@@ -320,7 +322,6 @@ public class RecipeGenRecycling implements Runnable {
}
public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, final int amount) {
- String mTemp = oredictName;
// Banned Materials and replacements for GT5.8 compat.
@@ -329,7 +330,7 @@ public class RecipeGenRecycling implements Runnable {
return ItemUtils.getSimpleStack(Items.clay_ball, amount);
}
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(mTemp);
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
if (!oreDictList.isEmpty()) {
final ItemStack returnValue = oreDictList.get(0)
.copy();
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java
index 97445915f2..3fd856e801 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java
@@ -37,8 +37,7 @@ public class RecipeGenShapedCrafting extends RecipeGenBase {
if (material.getPlate(1) != null && material.getIngot(1) != null) GTModHandler.addCraftingRecipe(
material.getPlate(1),
GTModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GTModHandler.RecipeBits.BUFFERED,
- new Object[] { "h", "B", "I", Character.valueOf('I'), material.getIngot(1), Character.valueOf('B'),
- material.getIngot(1) });
+ new Object[] { "h", "B", "I", 'I', material.getIngot(1), 'B', material.getIngot(1) });
if (ItemUtils.checkForInvalidItems(material.getPlate(1))
&& ItemUtils.checkForInvalidItems(material.getIngot(1)))
@@ -53,8 +52,7 @@ public class RecipeGenShapedCrafting extends RecipeGenBase {
GTModHandler.addCraftingRecipe(
material.getPlateDouble(1),
GTModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GTModHandler.RecipeBits.BUFFERED,
- new Object[] { "I", "B", "h", Character.valueOf('I'), material.getPlate(1), Character.valueOf('B'),
- material.getPlate(1) });
+ new Object[] { "I", "B", "h", 'I', material.getPlate(1), 'B', material.getPlate(1) });
if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))
&& ItemUtils.checkForInvalidItems(material.getPlate(1)))
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java
index 4689bb5042..0ec27e6cee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java
@@ -95,7 +95,7 @@ public class RecipeLoaderAlgaeFarm {
false,
aInputs,
aOutputs,
- (Object) null,
+ null,
new int[] {},
new FluidStack[] { GTValues.NF },
new FluidStack[] { GTValues.NF },
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
index 9e2e29a7fc..948a918071 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
@@ -91,47 +91,47 @@ public class GregtechBufferDynamos {
GregtechItemList.Hatch_Buffer_Dynamo_ULV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_ULV, 'T', CI.getTieredCircuit(0), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Lead) });
+ OrePrefixes.cableGt04.get(Materials.Lead) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_LV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_LV, 'T', CI.getTieredCircuit(1), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Tin) });
+ OrePrefixes.cableGt04.get(Materials.Tin) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_MV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_MV, 'T', CI.getTieredCircuit(2), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.AnyCopper) });
+ OrePrefixes.cableGt04.get(Materials.AnyCopper) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_HV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_HV, 'T', CI.getTieredCircuit(3), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Gold) });
+ OrePrefixes.cableGt04.get(Materials.Gold) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_EV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_EV, 'T', CI.getTieredCircuit(4), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Aluminium) });
+ OrePrefixes.cableGt04.get(Materials.Aluminium) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_IV, 'T', CI.getTieredCircuit(5), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Tungsten) });
+ OrePrefixes.cableGt04.get(Materials.Tungsten) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_LuV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_LuV, 'T', CI.getTieredCircuit(6), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.VanadiumGallium) });
+ OrePrefixes.cableGt04.get(Materials.VanadiumGallium) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_ZPM.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_ZPM, 'T', CI.getTieredCircuit(7), 'C',
- OrePrefixes.cableGt04.get((Object) Materials.Naquadah) });
+ OrePrefixes.cableGt04.get(Materials.Naquadah) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_UV.get(1L),
bitsd,
new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_UV, 'T', CI.getTieredCircuit(8), 'C',
- OrePrefixes.wireGt12.get((Object) Materials.NaquadahAlloy) });
+ OrePrefixes.wireGt12.get(Materials.NaquadahAlloy) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L),
bitsd,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
index b331479028..c65d4109ee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -743,23 +743,23 @@ public class GregtechConduits {
Logger.WARNING(
"Generated pipeTiny from " + materialName
+ "? "
- + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null) ? true : false));
+ + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null));
Logger.WARNING(
"Generated pipeSmall from " + materialName
+ "? "
- + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null) ? true : false));
+ + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null));
Logger.WARNING(
"Generated pipeNormal from " + materialName
+ "? "
- + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null) ? true : false));
+ + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null));
Logger.WARNING(
"Generated pipeLarge from " + materialName
+ "? "
- + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null) ? true : false));
+ + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null));
Logger.WARNING(
"Generated pipeHuge from " + materialName
+ "? "
- + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null) ? true : false));
+ + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null));
int eut = (int) (8 * vMulti);
@@ -877,8 +877,7 @@ public class GregtechConduits {
String tName = aName.toString();
if (GTUtility.isStringInvalid(tName)) return false;
ArrayList<ItemStack> tList = GTOreDictUnificator.getOres(tName);
- for (ItemStack itemStack : tList)
- if (GTUtility.areStacksEqual((ItemStack) itemStack, aStack, true)) return false;
+ for (ItemStack itemStack : tList) if (GTUtility.areStacksEqual(itemStack, aStack, true)) return false;
OreDictionary.registerOre(tName, GTUtility.copyAmount(1L, new Object[] { aStack }));
return true;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
index 6dd9c7170c..a6c3b51673 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -110,70 +110,70 @@ public class GregtechEnergyBuffer {
1).getStackForm(1L));
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_ULV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_ULV, 'W', OrePrefixes.wireGt08.get(Materials.Lead), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_LV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_LV, 'W', OrePrefixes.wireGt08.get(Materials.Tin), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_MV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_MV, 'W', OrePrefixes.wireGt08.get(Materials.AnyCopper), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_HV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_HV, 'W', OrePrefixes.wireGt08.get(Materials.Gold), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_EV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_EV, 'W', OrePrefixes.wireGt08.get(Materials.Aluminium), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_IV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_IV, 'W', OrePrefixes.wireGt08.get(Materials.Tungsten), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_LuV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_LuV, 'W', OrePrefixes.wireGt08.get(Materials.Osmium), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_ZPM, 'W', OrePrefixes.wireGt08.get(Materials.Osmium), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_UV.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
new Object[] { "WTW", "WMW", 'M', ItemList.Hull_UV, 'W', OrePrefixes.wireGt08.get(Materials.Osmium), 'T',
GregtechOreDictNames.buffer_core });
GTModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
+ GregtechItemList.Energy_Buffer_1by1_MAX.get(1L),
GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE
| GTModHandler.RecipeBits.BUFFERED,
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
index 82daf41c90..27e43f5a43 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
@@ -85,9 +85,8 @@ public class CustomKineticRotor extends Item implements IKineticRotor {
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
info.add(
- StatCollector.translateToLocalFormatted(
- "ic2.itemrotor.wind.info",
- new Object[] { this.minWindStrength, this.maxWindStrength }));
+ StatCollector
+ .translateToLocalFormatted("ic2.itemrotor.wind.info", this.minWindStrength, this.maxWindStrength));
GearboxType type = null;
if (Minecraft.getMinecraft().currentScreen != null
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/recipe/RecipeIC2.java b/src/main/java/gtPlusPlus/xmod/ic2/recipe/RecipeIC2.java
index dc7a87d4dd..0329950577 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/recipe/RecipeIC2.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/recipe/RecipeIC2.java
@@ -57,20 +57,20 @@ public class RecipeIC2 {
public static String ring_T3 = "ringChrome";
public static String ring_T4 = "ringOsmiridium";
- private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_1.getItem());
- private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_2.getItem());
- private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_3.getItem());
- private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_4.getItem());
+ private static final ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_1.getItem());
+ private static final ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_2.getItem());
+ private static final ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_3.getItem());
+ private static final ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2Items.rotor_Blade_Material_4.getItem());
- private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_1.getItem());
- private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_2.getItem());
- private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_3.getItem());
- private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_4.getItem());
+ private static final ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_1.getItem());
+ private static final ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_2.getItem());
+ private static final ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_3.getItem());
+ private static final ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2Items.shaft_Material_4.getItem());
- private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_1.getItem());
- private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_2.getItem());
- private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_3.getItem());
- private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_4.getItem());
+ private static final ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_1.getItem());
+ private static final ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_2.getItem());
+ private static final ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_3.getItem());
+ private static final ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2Items.rotor_Material_4.getItem());
private static boolean checkForEnderIO() {
if (!EnderIO.isModLoaded()) {
@@ -151,23 +151,20 @@ public class RecipeIC2 {
GregtechItemList.Shape_Extruder_WindmillShaft.get(1L),
GTModHandler.RecipeBits.BUFFERED | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE,
- new Object[] { "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.DarkSteel), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.DarkSteel) });
+ new Object[] { "hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Rod, 'X',
+ OrePrefixes.plate.get(Materials.DarkSteel), 'S', OrePrefixes.screw.get(Materials.DarkSteel) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Shape_Extruder_WindmillShaft.get(1L),
GTModHandler.RecipeBits.BUFFERED | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE,
- new Object[] { "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.TungstenSteel), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.TungstenSteel) });
+ new Object[] { "hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Rod, 'X',
+ OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel) });
GTModHandler.addCraftingRecipe(
GregtechItemList.Shape_Extruder_WindmillShaft.get(1L),
GTModHandler.RecipeBits.BUFFERED | GTModHandler.RecipeBits.NOT_REMOVABLE
| GTModHandler.RecipeBits.REVERSIBLE,
- new Object[] { "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.Molybdenum), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.Molybdenum) });
+ new Object[] { "hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Rod, 'X',
+ OrePrefixes.plate.get(Materials.Molybdenum), 'S', OrePrefixes.screw.get(Materials.Molybdenum) });
Logger.INFO("Added recipe item for GT5 Extruder: Shaft Shape");
// Shaft Recipes
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
index 2d6a4ab3dd..782eda60c6 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
@@ -91,7 +91,7 @@ public class ThreadAspectScanner extends Thread {
if (item.getHasSubtypes()) {
List q1 = new ArrayList();
item.getSubItems(item, item.getCreativeTab(), q1);
- if (q1 != null && q1.size() > 0) {
+ if (q1 != null && !q1.isEmpty()) {
for (int e = 0; e < q1.size(); e++) {
ItemStack check = ItemUtils.simpleMetaStack(item, e, 1);
if (check != null) {
@@ -124,9 +124,7 @@ public class ThreadAspectScanner extends Thread {
for (ItemStack stack : group) {
thaumcraft.api.aspects.AspectList a = thaumcraft.common.lib.crafting.ThaumcraftCraftingManager
.getObjectTags(stack);
- if (a == null) {
- continue;
- } else {
+ if (a != null) {
ArrayList<Pair<String, Integer>> aspectPairs = new ArrayList<>();
for (thaumcraft.api.aspects.Aspect c : a.getAspectsSortedAmount()) {
if (c != null) {
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidEnder.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidEnder.java
index 1f7c1fec93..98b0912497 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidEnder.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidEnder.java
@@ -17,7 +17,7 @@ import gtPlusPlus.xmod.thermalfoundation.fluid.TFFluids;
public class TFBlockFluidEnder extends BlockFluidCoFHBase {
public static final Material materialFluidEnder = new MaterialLiquid(MapColor.greenColor);
- private static boolean effect = true;
+ private static final boolean effect = true;
public TFBlockFluidEnder() {
super(GTPlusPlus.ID, TFFluids.fluidEnder, materialFluidEnder, "ender");
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidPyrotheum.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidPyrotheum.java
index 1014667355..ebefa49ecd 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidPyrotheum.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TFBlockFluidPyrotheum.java
@@ -52,13 +52,8 @@ public class TFBlockFluidPyrotheum extends BlockFluidInteractive {
for (int i = 0; i < 8; i++) {
this.addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
}
- final String str1 = "Fluid.Pyrotheum";
- String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
effect = true;
-
- str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
enableSourceFall = true;
-
return true;
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
index 103a44e665..4933039264 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
@@ -20,7 +20,7 @@ import gtPlusPlus.xmod.tinkers.util.TinkersUtils;
public class BaseTinkersMaterial {
- private static HashMap<String, Integer> aInternalMaterialIdMap = new HashMap<>();
+ private static final HashMap<String, Integer> aInternalMaterialIdMap = new HashMap<>();
private static int aNextFreeID;
public final String mLocalName;
@@ -179,8 +179,7 @@ public class BaseTinkersMaterial {
TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144));
if (aMelt <= 3600) {
ItemStack ingotcast = TinkersUtils.getPattern(1);
- TinkersUtils
- .addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144 * 9), (ItemStack) null, true, 100);
+ TinkersUtils.addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144 * 9), null, true, 100);
TinkersUtils
.addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50);
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
index 7c48f1bd74..ff182aa641 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
@@ -6,7 +6,6 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.TierEU;
@@ -77,7 +76,7 @@ public class TinkersDryingRecipe {
.removeTag("frypanKill");
if (input.getTagCompound()
.hasNoTags()) {
- input.setTagCompound((NBTTagCompound) null);
+ input.setTagCompound(null);
}
}
return ItemStack.areItemStacksEqual(this.input, input);