aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglowredman <35727266+glowredman@users.noreply.github.com>2023-09-23 13:06:01 +0200
committerGitHub <noreply@github.com>2023-09-23 13:06:01 +0200
commit5b5a1a8234e419ade32a0bcd31898267a84508e9 (patch)
treec5ac5ab5d97b4ee37b78fff09e9747dd5e65abac /src
parentdc756ba0c56c754513ec5eecfb6aef51bc8e2ee6 (diff)
downloadGT5-Unofficial-5b5a1a8234e419ade32a0bcd31898267a84508e9.tar.gz
GT5-Unofficial-5b5a1a8234e419ade32a0bcd31898267a84508e9.tar.bz2
GT5-Unofficial-5b5a1a8234e419ade32a0bcd31898267a84508e9.zip
Cleanup (#354)
* Fix most `@SuppressWarnings` * Update buildscript * Remove dead code * Add missing `@Override` annotations * Deobfuscate parameters * Collapse switch statements * Fix * Combine nested if statements in else block to else if * Reduce indentation when possible * Convert to switch when reasonable * Extract increment/decrement from statement * Pull up assignment * Simplify lambda expression and method reference syntax * Deduplicate code - Factorize operands - Replace (X && Y) || (!X && Z) by X ? Y : Z - Use '==' or '^' on booleans - Merge conditions of if/else if/else that have the same blocks - Pull down common code from if/else statement - Single 'if' statement rather than duplicate blocks that fall through - Remove redundant end of block with jump statement - Remove redundant if condition - Pull out a duplicate 'if' from an if/else * Use pattern matching for instanceof * Convert String concatenation to Text Block * Convert to switch expression where possible * Use diamond operator * Convert to enhanced 'for' loops * Always use 'this' qualifier * Convert fields into local variables if the use is only local * Use String.replace() instead of String.replaceAll() when possible * Avoid Object.equals() or String.equalsIgnoreCase() on null objects * Remove unnecessary casts * Push down negation * Remove redundant super() call in constructor * Remove overridden assignment * Remove redundant modifiers * Raise embedded if into parent if * Create array with curly brrackets when possible * Remove variable assignment before return * Remove unnecessary parentheses * spotlessApply (#355) Co-authored-by: GitHub GTNH Actions <> * Update dependencies.gradle * Update dependencies.gradle * Update dependencies.gradle * sa+deps * add back GG mod in dep file * Make requested changes --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Former-commit-id: 11b283613ab93b60bf0e52aad99dbcaf9ace3a1f
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java52
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java30
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java75
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java42
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java23
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java42
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java99
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java229
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java52
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java26
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java29
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java41
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java27
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java84
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java119
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java90
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java97
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java117
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java71
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java96
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java43
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java32
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java156
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java80
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java100
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java76
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java155
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java117
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java33
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java27
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java23
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java56
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java32
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java86
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java94
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java220
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java149
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java40
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java128
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java131
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java89
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java267
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java100
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java595
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java103
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java121
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java27
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java65
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java79
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java31
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java116
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java44
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java34
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java42
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java247
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java114
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java47
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java88
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java60
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java30
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java16
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java19
167 files changed, 2944 insertions, 3633 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java
index f13035b5c9..fc09d943bc 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java
@@ -17,7 +17,7 @@ import static gregtech.api.enums.Mods.Gendustry;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
-import java.awt.*;
+import java.awt.Color;
import net.minecraft.item.EnumRarity;
import net.minecraftforge.fluids.FluidRegistry;
@@ -28,13 +28,13 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA;
import com.github.bartimaeusnek.bartworks.util.BioData;
import com.github.bartimaeusnek.bartworks.util.BioPlasmid;
+import gregtech.api.enums.FluidState;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TierEU;
-import gregtech.api.objects.GT_Fluid;
+import gregtech.api.fluid.GT_FluidFactory;
import gregtech.api.util.GT_Utility;
-@SuppressWarnings("ALL")
public final class BioObjectAdder {
/**
@@ -50,7 +50,7 @@ public final class BioObjectAdder {
EnumRarity rarity, boolean breedable) {
if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1)
return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable);
- else new Exception(
+ new Exception(
"Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!")
.printStackTrace();
return null;
@@ -70,7 +70,7 @@ public final class BioObjectAdder {
boolean breedable) {
if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1)
return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable);
- else new Exception(
+ new Exception(
"Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!")
.printStackTrace();
return null;
@@ -168,15 +168,12 @@ public final class BioObjectAdder {
for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
if (B.getFluidNotSet()) {
B.setFluid(
- new GT_Fluid(
- B.getName().replaceAll(" ", "").toLowerCase() + "fluid",
- "molten.autogenerated",
- new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(),
- (short) B.getColor().getGreen() }));
-
- if (!FluidRegistry.registerFluid(B.getFluid())) {
- new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace();
- }
+ GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid")
+ .withTextureName("molten.autogenerated")
+ .withColorRGBA(
+ new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(),
+ (short) B.getColor().getGreen() })
+ .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid());
GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10))
.fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java
index 35c12e1cae..ba1308c427 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java
@@ -24,7 +24,6 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA;
import com.github.bartimaeusnek.bartworks.util.BioData;
import com.github.bartimaeusnek.bartworks.util.BioPlasmid;
-@SuppressWarnings("ALL")
public final class BioObjectGetter {
public static BioCulture getBioCulture(String aName) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java
index b456f8d562..527b62bae3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java
@@ -24,7 +24,6 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture;
import gregtech.api.enums.Materials;
-@SuppressWarnings("ALL")
public final class BioRecipeAdder {
public static final int STANDART = 0;
@@ -108,6 +107,7 @@ public final class BioRecipeAdder {
* @param exactSv if the recipe needs EXACTLY the Sv or can use less...
* @return
*/
+ @Deprecated
public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture,
@Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration,
@Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java
index fdfb020919..4084f485ab 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java
@@ -34,7 +34,6 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_ModHandler;
-@SuppressWarnings("ALL")
public final class BioVatLogicAdder {
public static class RadioHatch {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java
index 4100b17760..698c28fbf7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java
@@ -31,7 +31,7 @@ public interface ITileHasDifferentTextureSides {
@SideOnly(Side.CLIENT)
default IIcon getTextureForSide(int side, int meta) {
- return getTextureForSide(ForgeDirection.values()[side], meta);
+ return this.getTextureForSide(ForgeDirection.values()[side], meta);
}
@SideOnly(Side.CLIENT)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java
index 60202e102e..05877f42e0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java
@@ -38,7 +38,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.versioning.ArtifactVersion;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
-@SuppressWarnings("ALL")
public class BWCore extends DummyModContainer {
public static final String BWCORE_NAME = "BartWorks ASM Core";
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java
index 86480db53c..8d3fe4876c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java
@@ -39,7 +39,6 @@ public class BWCoreStaticReplacementMethodes {
RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new);
}
- @SuppressWarnings("ALL")
public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) {
int i = 0;
ItemStack itemstack = null;
@@ -72,45 +71,40 @@ public class BWCoreStaticReplacementMethodes {
return new ItemStack(itemstack.getItem(), 1, i1);
- } else {
-
- IRecipe iPossibleRecipe = null;
- AccessPriorityList<IRecipe> cache = RECENTLYUSEDRECIPES.get();
- Iterator<AccessPriorityListNode<IRecipe>> it = cache.nodeIterator();
-
- while (it.hasNext()) {
- AccessPriorityListNode<IRecipe> recipeNode = it.next();
- iPossibleRecipe = recipeNode.getELEMENT();
+ }
+ IRecipe iPossibleRecipe = null;
+ AccessPriorityList<IRecipe> cache = RECENTLYUSEDRECIPES.get();
+ Iterator<AccessPriorityListNode<IRecipe>> it = cache.nodeIterator();
- if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue;
+ while (it.hasNext()) {
+ AccessPriorityListNode<IRecipe> recipeNode = it.next();
+ iPossibleRecipe = recipeNode.getELEMENT();
- cache.addPrioToNode(recipeNode);
- return iPossibleRecipe.getCraftingResult(inventoryCrafting);
- }
+ if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue;
- ItemStack stack = null;
+ cache.addPrioToNode(recipeNode);
+ return iPossibleRecipe.getCraftingResult(inventoryCrafting);
+ }
- HashSet<IRecipe> recipeSet = new NonNullWrappedHashSet<>();
- List recipeList = CraftingManager.getInstance().getRecipeList();
+ HashSet<IRecipe> recipeSet = new NonNullWrappedHashSet<>();
+ List<IRecipe> recipeList = CraftingManager.getInstance().getRecipeList();
- for (int k = 0; k < recipeList.size(); k++) {
- IRecipe r = (IRecipe) recipeList.get(k);
- if (r.matches(inventoryCrafting, world)) recipeSet.add(r);
- }
+ for (IRecipe r : recipeList) {
+ if (r.matches(inventoryCrafting, world)) recipeSet.add(r);
+ }
- Object[] arr = recipeSet.toArray();
+ Object[] arr = recipeSet.toArray();
- if (arr.length == 0) return null;
+ if (arr.length == 0) return null;
- IRecipe recipe = (IRecipe) arr[0];
- stack = recipe.getCraftingResult(inventoryCrafting);
+ IRecipe recipe = (IRecipe) arr[0];
+ ItemStack stack = recipe.getCraftingResult(inventoryCrafting);
- if (arr.length != 1) return stack;
+ if (arr.length != 1) return stack;
- if (stack != null) cache.addLast(recipe);
+ if (stack != null) cache.addLast(recipe);
- return stack;
- }
+ return stack;
}
private BWCoreStaticReplacementMethodes() {}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java
index 1605192572..794fd2881f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java
@@ -85,7 +85,7 @@ public class BWCoreTransformer implements IClassTransformer {
nu.add(instruction);
if (instruction.getOpcode() == INVOKEVIRTUAL) {
MethodInsnNode invokevirtual = (MethodInsnNode) instruction;
- if (invokevirtual.name.equals("addVis")) {
+ if ("addVis".equals(invokevirtual.name)) {
AbstractInsnNode beginning = method.instructions.get(j - 7);
LabelNode label = new LabelNode();
nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0));
@@ -133,7 +133,6 @@ public class BWCoreTransformer implements IClassTransformer {
String name_deObfs = "canDoRainSnowIce";
String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z";
- String dsc_Obfs = "(Lapx;)Z";
for (int i = 0; i < methods.size(); i++) {
if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) {
BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Removing!");
@@ -142,12 +141,7 @@ public class BWCoreTransformer implements IClassTransformer {
}
}
BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!");
- MethodNode nu = new MethodNode(
- ACC_PUBLIC,
- name_deObfs,
- /* obfs ? dsc_Obfs : */ dsc_deObfs,
- null,
- new String[0]);
+ MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, dsc_deObfs, null, new String[0]);
InsnList insnList = new InsnList();
insnList.add(new InsnNode(ICONST_0));
insnList.add(new InsnNode(IRETURN));
@@ -168,7 +162,7 @@ public class BWCoreTransformer implements IClassTransformer {
for (int i = 0; i < methods.size(); i++) {
if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src)
&& ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) {
- BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!");
+ BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!");
MethodNode toPatch = methods.get(i);
InsnList insnList = new InsnList();
insnList.add(new InsnNode(ACONST_NULL));
@@ -192,7 +186,7 @@ public class BWCoreTransformer implements IClassTransformer {
for (MethodNode toPatch : methods) {
if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src)
&& ASMUtils.isCorrectMethod(toPatch, dsc_universal)) {
- BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!");
+ BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!");
InsnList nu = new InsnList();
LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() };
@@ -311,7 +305,7 @@ public class BWCoreTransformer implements IClassTransformer {
for (int i = 0; i < methods.size(); i++) {
if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src)
&& ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) {
- BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!");
+ BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!");
methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i)));
break scase;
}
@@ -325,7 +319,7 @@ public class BWCoreTransformer implements IClassTransformer {
String name_deObfs = "getNewNoise";
for (MethodNode toPatch : methods) {
if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) {
- BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!");
+ BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!");
LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() };
InsnList nu = new InsnList();
// if (x < -28675) x %= -28675;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
index bb9a40934f..c104d09f3a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
@@ -29,7 +29,7 @@ public class GuiHandler implements IGuiHandler {
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- if (SideReference.Side.Client) {} else return getServerGuiElement(ID, player, world, x, y, z);
+ if (!SideReference.Side.Client) return this.getServerGuiElement(ID, player, world, x, y, z);
return null;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index cf88fe51bb..e4a73d1996 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -80,20 +80,17 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
-@SuppressWarnings("ALL")
-@Mod(
- modid = MainMod.MOD_ID,
- name = MainMod.NAME,
- version = API_REFERENCE.VERSION,
- dependencies = "required-after:IC2; " + "required-after:gregtech; "
- + "after:berriespp; "
- + "after:tectech; "
- + "after:GalacticraftMars; "
- + "after:GalacticraftCore; "
- + "after:Forestry; "
- + "after:ProjRed|Illumination; "
- + "after:RandomThings; "
- + "before:miscutils; ")
+@Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = API_REFERENCE.VERSION, dependencies = """
+ required-after:IC2;\
+ required-after:gregtech;\
+ after:berriespp;\
+ after:tectech;\
+ after:GalacticraftMars;\
+ after:GalacticraftCore;\
+ after:Forestry;\
+ after:ProjRed|Illumination;\
+ after:RandomThings;\
+ before:miscutils;""")
public final class MainMod {
public static final String NAME = "BartWorks";
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java
index 4c59aa38ef..a23020e787 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java
@@ -29,19 +29,16 @@ class TooltipCache {
static boolean put(ItemStack itemStack, List<String> tooltip) {
Pair<Integer, Short> p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage());
- if (TooltipCache.cache.containsKey(p)) return false;
-
- if (!tooltip.isEmpty()) {
- StringBuilder sb = new StringBuilder();
- for (String s : tooltip) {
- sb.append(s);
- sb.append(System.lineSeparator());
- }
- char[] rettype = sb.toString().toCharArray();
- return TooltipCache.cache.put(p, rettype) == rettype;
- } else {
+ if (TooltipCache.cache.containsKey(p) || tooltip.isEmpty()) {
return false;
}
+ StringBuilder sb = new StringBuilder();
+ for (String s : tooltip) {
+ sb.append(s);
+ sb.append(System.lineSeparator());
+ }
+ char[] rettype = sb.toString().toCharArray();
+ return TooltipCache.cache.put(p, rettype) == rettype;
}
static List<String> getTooltip(ItemStack itemStack) {
@@ -52,10 +49,4 @@ class TooltipCache {
}
return Arrays.asList(new String(toTest).split(System.lineSeparator()));
}
-
- private static void checkSize() {
- if (TooltipCache.cache.size() > Short.MAX_VALUE * 2) {
- TooltipCache.cache.clear();
- }
- }
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java
index 1c004ec151..2b7e686814 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java
@@ -67,8 +67,8 @@ public class TooltipEventHandler {
UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem()));
if (UI != null) {
for (ModContainer modContainer : Loader.instance().getModList()) {
- if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID)
- || UI.modId.equals("BWCore"))
+ if (MainMod.MOD_ID.equals(UI.modId) || BartWorksCrossmod.MOD_ID.equals(UI.modId)
+ || "BWCore".equals(UI.modId))
break;
if (UI.modId.equals(modContainer.getModId())) {
tooAdd.add(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java
index ccacef6c3f..188c0c9e69 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java
@@ -38,7 +38,8 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator {
this.name = StatCollector.translateToLocal("tile.BWRotorBlock.0.name");
}
- protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
+ @Override
+ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj
.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374);
if (this.container.base.checkrotor()) {
@@ -58,8 +59,8 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator {
this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374);
if (this.container.base.guiisoverload()) {
GuiTooltipHelper.drawAreaTooltip(
- p_146979_1_ - this.guiLeft,
- p_146979_2_ - this.guiTop,
+ mouseX - this.guiLeft,
+ mouseY - this.guiTop,
StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"),
44,
27,
@@ -76,6 +77,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator {
}
}
+ @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor3f(0.5f, 0.25f, 0.07f);
this.mc.getTextureManager()
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java
index 4b5923fd23..bb48e4067e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java
@@ -18,7 +18,7 @@ import gregtech.api.GregTech_API;
public class BW_EICPistonVisualizer extends EntityFX {
public BW_EICPistonVisualizer(World world, int x, int y, int z, int age) {
- super(world, (double) x, ((double) y), (double) z);
+ super(world, x, y, z);
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
@@ -43,9 +43,9 @@ public class BW_EICPistonVisualizer extends EntityFX {
// Look at nearby block for correct tiered block to use
Pair<Block, Integer> tieredBlock;
if (this.worldObj != null) {
- int nX = (int) posX;
- int nY = (int) posY + 1;
- int nZ = (int) posZ;
+ int nX = (int) this.posX;
+ int nY = (int) this.posY + 1;
+ int nZ = (int) this.posZ;
Block neighborBlock = this.worldObj.getBlock(nX, nY, nZ);
int neighborMeta = this.worldObj.getBlockMetadata(nX, nY, nZ);
tieredBlock = Pair.of(neighborBlock, neighborMeta);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java
index 4a6561f9ef..363de0eda7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java
@@ -50,9 +50,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer {
|| aType == IItemRenderer.ItemRenderType.INVENTORY
|| aType == IItemRenderer.ItemRenderType.EQUIPPED
|| aType == IItemRenderer.ItemRenderType.ENTITY;
- } else {
- return false;
}
+ return false;
}
@Override
@@ -60,9 +59,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer {
IItemRenderer.ItemRendererHelper aHelper) {
if (GT_Utility.isStackInvalid(aStack)) {
return false;
- } else {
- return aType == IItemRenderer.ItemRenderType.ENTITY;
}
+ return aType == IItemRenderer.ItemRenderType.ENTITY;
}
@Override
@@ -85,7 +83,7 @@ public class BW_GT_ItemRenderer implements IItemRenderer {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
GL11.glBlendFunc(770, 771);
- if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
+ if (IItemRenderer.ItemRenderType.INVENTORY.equals(type)) {
if (aMetaData < CircuitImprintLoader.reverseIDs)
GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
else {
@@ -102,24 +100,22 @@ public class BW_GT_ItemRenderer implements IItemRenderer {
-1.0F);
}
}
- } else {
- if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D(
- Tessellator.instance,
- tIcon.getMaxU(),
- tIcon.getMinV(),
- tIcon.getMinU(),
- tIcon.getMaxV(),
- tIcon.getIconWidth(),
- tIcon.getIconHeight(),
- 0.0625F);
- }
+ } else if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D(
+ Tessellator.instance,
+ tIcon.getMaxU(),
+ tIcon.getMinV(),
+ tIcon.getMinU(),
+ tIcon.getMaxV(),
+ tIcon.getIconWidth(),
+ tIcon.getIconHeight(),
+ 0.0625F);
IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
if (tOverlay != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
GL11.glBlendFunc(770, 771);
- if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
+ if (IItemRenderer.ItemRenderType.INVENTORY.equals(type)) {
GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
ItemRenderer.renderItemIn2D(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java
index 894d15cf4c..6e1bffcd08 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java
@@ -76,9 +76,9 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler
return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED;
}
}
- return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block)
+ return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block
? RendererSwitchingColorFluid.LIGHT_Y_POS
- : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED);
+ : block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED;
}
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
@@ -86,7 +86,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler
@SideOnly(Side.CLIENT)
public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
- if ((!(block instanceof BioFluidBlock))) return false;
+ if (!(block instanceof BioFluidBlock)) return false;
Tessellator tessellator = Tessellator.instance;
Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId);
Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat);
@@ -94,15 +94,15 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler
int r, g, b;
if (rgb != null) {
- r = (rgb >> 16) & 0xFF;
- g = (rgb >> 8) & 0xFF;
+ r = rgb >> 16 & 0xFF;
+ g = rgb >> 8 & 0xFF;
b = rgb & 0xFF;
} else {
r = 0;
g = 0;
b = 255;
}
- float red = ((float) r) / 255f, green = ((float) g) / 255f, blue = ((float) b) / 255f;
+ float red = r / 255f, green = g / 255f, blue = b / 255f;
BlockFluidBase blockFluidBase = (BlockFluidBase) block;
boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase;
@@ -237,35 +237,40 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler
if (renderer.renderAllFaces || renderSides[side]) {
rendered = true;
double dHeight1, dHeight2, dXcoord1, dXcoord2, dZcoord1, dZcoord2;
- if (side == 0) {
- dHeight1 = heightNW;
- dHeight2 = heightNE;
- dXcoord1 = x;
- dXcoord2 = x + 1;
- dZcoord1 = z + RendererSwitchingColorFluid.RENDER_OFFSET;
- dZcoord2 = z + RendererSwitchingColorFluid.RENDER_OFFSET;
- } else if (side == 1) {
- dHeight1 = heightSE;
- dHeight2 = heightSW;
- dXcoord1 = x + 1;
- dXcoord2 = x;
- dZcoord1 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
- dZcoord2 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
- } else if (side == 2) {
- dHeight1 = heightSW;
- dHeight2 = heightNW;
- dXcoord1 = x + RendererSwitchingColorFluid.RENDER_OFFSET;
- dXcoord2 = x + RendererSwitchingColorFluid.RENDER_OFFSET;
- dZcoord1 = z + 1;
- dZcoord2 = z;
- } else {
- dHeight1 = heightNE;
- dHeight2 = heightSE;
- dXcoord1 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
- dXcoord2 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
- dZcoord1 = z;
- dZcoord2 = z + 1;
- }
+ dZcoord2 = switch (side) {
+ case 0 -> {
+ dHeight1 = heightNW;
+ dHeight2 = heightNE;
+ dXcoord1 = x;
+ dXcoord2 = x + 1;
+ dZcoord1 = z + RendererSwitchingColorFluid.RENDER_OFFSET;
+ yield z + RendererSwitchingColorFluid.RENDER_OFFSET;
+ }
+ case 1 -> {
+ dHeight1 = heightSE;
+ dHeight2 = heightSW;
+ dXcoord1 = x + 1;
+ dXcoord2 = x;
+ dZcoord1 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
+ yield z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
+ }
+ case 2 -> {
+ dHeight1 = heightSW;
+ dHeight2 = heightNW;
+ dXcoord1 = x + RendererSwitchingColorFluid.RENDER_OFFSET;
+ dXcoord2 = x + RendererSwitchingColorFluid.RENDER_OFFSET;
+ dZcoord1 = z + 1;
+ yield z;
+ }
+ default -> {
+ dHeight1 = heightNE;
+ dHeight2 = heightSE;
+ dXcoord1 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
+ dXcoord2 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET;
+ dZcoord1 = z;
+ yield z + 1;
+ }
+ };
float u1Flow = iconFlow.getInterpolatedU(0.0);
float u2Flow = iconFlow.getInterpolatedU(8.0);
float v1Flow = iconFlow.getInterpolatedV((1.0 - dHeight1) * 16.0 * 0.5);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java
index 3dccd88475..1a00d16d85 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java
@@ -78,8 +78,7 @@ public class BW_Blocks extends Block {
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for (int i = 0; i < this.textureNames.length; i++) {
list.add(new ItemStack(item, 1, i));
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java
index 8bd57edaf9..a2f5e520b9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java
@@ -173,7 +173,7 @@ public class BW_GlasBlocks extends BW_Blocks {
@Override
public int getRenderType() {
if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID;
- else return 0;
+ return 0;
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java
index 16688fbc33..337db90324 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java
@@ -165,7 +165,7 @@ public class BW_GlasBlocks2 extends BW_Blocks {
@Override
public int getRenderType() {
if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID;
- else return 0;
+ return 0;
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java
index 2cfc787a1d..07db82fcb2 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java
@@ -60,8 +60,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
}
@Override
- public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_,
- float p_149727_7_, float p_149727_8_, float p_149727_9_) {
+ public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX,
+ float subY, float subZ) {
if (worldObj.isRemote) {
return false;
}
@@ -84,7 +84,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
if (!player.isSneaking()) {
if (tile instanceof IHasGui) {
return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile);
- } else if (tile instanceof ITileWithModularUI) {
+ }
+ if (tile instanceof ITileWithModularUI) {
if (!worldObj.isRemote) {
UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z);
}
@@ -94,10 +95,10 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
return false;
}
+ @Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
TileEntity tile = world.getTileEntity(x, y, z);
- if (tile instanceof IWrenchable && itemStack != null) {
- IWrenchable tile2 = (IWrenchable) tile;
+ if (tile instanceof IWrenchable tile2 && itemStack != null) {
int meta = itemStack.getItemDamage();
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
if (entity != null) {
@@ -136,14 +137,14 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
- if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) {
- try {
- return ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).getTextureForSide(side, meta);
- } catch (InstantiationException | IllegalAccessException e) {
- e.printStackTrace();
- return super.getIcon(side, meta);
- }
- } else return super.getIcon(side, meta);
+ if (!ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) return super.getIcon(side, meta);
+ try {
+ return ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance())
+ .getTextureForSide(side, meta);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return super.getIcon(side, meta);
+ }
}
@Override
@@ -151,18 +152,19 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
public void registerBlockIcons(IIconRegister par1IconRegister) {
if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) {
try {
- ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).registerBlockIcons(par1IconRegister);
- } catch (InstantiationException | IllegalAccessException e) {
+ ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance())
+ .registerBlockIcons(par1IconRegister);
+ } catch (Exception e) {
e.printStackTrace();
}
} else super.registerBlockIcons(par1IconRegister);
}
@Override
- public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ public TileEntity createNewTileEntity(World worldIn, int meta) {
try {
- return this.tileEntity.newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ return this.tileEntity.getConstructor().newInstance();
+ } catch (Exception e) {
e.printStackTrace();
}
return null;
@@ -187,8 +189,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
public String[] getInfoData() {
if (ITileAddsInformation.class.isAssignableFrom(this.tileEntity)) {
try {
- return ((ITileAddsInformation) this.tileEntity.newInstance()).getInfoData();
- } catch (InstantiationException | IllegalAccessException e) {
+ return ((ITileAddsInformation) this.tileEntity.getConstructor().newInstance()).getInfoData();
+ } catch (Exception e) {
e.printStackTrace();
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java
index 22b14db261..a7b39dcee3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java
@@ -64,8 +64,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer {
}
@Override
- public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_,
- float p_149727_7_, float p_149727_8_, float p_149727_9_) {
+ public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX,
+ float subY, float subZ) {
if (worldObj.isRemote) {
return true;
}
@@ -73,20 +73,19 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer {
TileEntity tile = worldObj.getTileEntity(x, y, z);
if (tile instanceof IHasGui) {
return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile);
- } else if (tile instanceof ITileWithModularUI) {
- if (!worldObj.isRemote) {
- UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z);
- }
+ }
+ if (tile instanceof ITileWithModularUI && !worldObj.isRemote) {
+ UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z);
}
}
return false;
}
+ @Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
TileEntity tile = world.getTileEntity(x, y, z);
- if (tile instanceof IWrenchable && itemStack != null) {
- IWrenchable tile2 = (IWrenchable) tile;
+ if (tile instanceof IWrenchable tile2 && itemStack != null) {
int meta = itemStack.getItemDamage();
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
if (entity != null) {
@@ -116,8 +115,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for (int i = 0; i < this.textureNames.length; i++) {
list.add(new ItemStack(item, 1, i));
}
@@ -154,10 +152,10 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer {
}
@Override
- public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ public TileEntity createNewTileEntity(World worldIn, int meta) {
try {
- return this.tileEntityArray[p_149915_2_].newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ return this.tileEntityArray[meta].getConstructor().newInstance();
+ } catch (Exception e) {
e.printStackTrace();
}
return null;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java
index fa984b8ee9..a5ad7625f9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java
@@ -38,9 +38,10 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider
this.textureName = "gregtech:fluids/fluid.molten.autogenerated";
}
+ @Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_) {
- FluidLoader.autogenIIcon = this.blockIcon = p_149651_1_.registerIcon(this.getTextureName());
+ public void registerBlockIcons(IIconRegister reg) {
+ FluidLoader.autogenIIcon = this.blockIcon = reg.registerIcon(this.getTextureName());
}
@Override
@@ -58,6 +59,7 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider
return 0;
}
+ @Override
public int getRenderType() {
return FluidLoader.renderID;
}
@@ -74,18 +76,18 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider
@Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
+ public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) {
return FluidLoader.autogenIIcon;
}
@Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
+ public IIcon getIcon(int side, int meta) {
return FluidLoader.autogenIIcon;
}
@Override
- public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ public TileEntity createNewTileEntity(World worldIn, int meta) {
return new BWTileEntityDimIDBridge();
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java
index c294bcbabc..0434a5d974 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java
@@ -29,44 +29,42 @@ public class ChangeConfig extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "bwcfg <NameOfVariable> <newValue>";
}
@Override
@SuppressWarnings("rawtypes")
- public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
+ public void processCommand(ICommandSender sender, String[] args) {
try {
- Field f = ConfigHandler.class.getField(p_71515_2_[0]);
+ Field f = ConfigHandler.class.getField(args[0]);
Class c = f.getType();
if (c.equals(int.class)) {
int l;
try {
- l = Integer.parseInt(p_71515_2_[1]);
+ l = Integer.parseInt(args[1]);
} catch (NumberFormatException e) {
- p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!"));
+ sender.addChatMessage(new ChatComponentText("you need to enter a number!"));
return;
}
f.setInt(null, l);
} else if (c.equals(long.class)) {
long l;
try {
- l = Long.parseLong(p_71515_2_[1]);
+ l = Long.parseLong(args[1]);
} catch (NumberFormatException e) {
- p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!"));
+ sender.addChatMessage(new ChatComponentText("you need to enter a number!"));
return;
}
f.setLong(null, l);
} else if (c.equals(boolean.class)) {
- if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1"))
- f.setBoolean(null, true);
- else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0"))
- f.setBoolean(null, false);
+ if ("true".equalsIgnoreCase(args[1]) || "1".equalsIgnoreCase(args[1])) f.setBoolean(null, true);
+ else if ("false".equalsIgnoreCase(args[1]) || "0".equalsIgnoreCase(args[1])) f.setBoolean(null, false);
else {
- p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false"));
+ sender.addChatMessage(new ChatComponentText("booleans need to be set to true or false"));
}
}
- p_71515_1_.addChatMessage(new ChatComponentText("Set " + p_71515_2_[0] + " to " + p_71515_2_[1]));
+ sender.addChatMessage(new ChatComponentText("Set " + args[0] + " to " + args[1]));
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
index 138542bd4b..7afe07beb0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
@@ -27,13 +27,13 @@ public class ClearCraftingCache extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "bwclr";
}
@Override
- public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
+ public void processCommand(ICommandSender sender, String[] args) {
BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes();
- p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared "));
+ sender.addChatMessage(new ChatComponentText("Recipe Cache cleared "));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java
index e3dd2d13c5..341044c498 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java
@@ -26,12 +26,12 @@ public class GetWorkingDirectory extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "bwgwd";
}
@Override
- public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
- p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath()));
+ public void processCommand(ICommandSender sender, String[] args) {
+ sender.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath()));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java
index 1646b8e750..28d840ac55 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java
@@ -21,7 +21,6 @@ import java.io.IOException;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.item.crafting.CraftingManager;
-import net.minecraft.item.crafting.IRecipe;
public class PrintRecipeListToFile extends CommandBase {
@@ -31,20 +30,19 @@ public class PrintRecipeListToFile extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "prltf <FilePath>";
}
@Override
- @SuppressWarnings("unchecked")
- public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
- File file = new File(p_71515_2_[0]);
+ public void processCommand(ICommandSender sender, String[] args) {
+ File file = new File(args[0]);
try {
BufferedWriter fw = new BufferedWriter(new FileWriter(file));
CraftingManager.getInstance().getRecipeList().forEach(e -> {
try {
- fw.write(e.toString() + " = " + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n");
+ fw.write(e.toString() + " = " + e.getRecipeOutput().getDisplayName() + "\n");
} catch (IOException ex) {
ex.printStackTrace();
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java
index 35cdae5bbc..4bbb719501 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java
@@ -25,13 +25,13 @@ public class RunGC extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "bwgc";
}
@Override
- public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
+ public void processCommand(ICommandSender sender, String[] args) {
Runtime.getRuntime().gc();
- p_71515_1_.addChatMessage(new ChatComponentText("Ran GC!"));
+ sender.addChatMessage(new ChatComponentText("Ran GC!"));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
index ece4708722..2def53c24e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
@@ -26,19 +26,19 @@ public class SummonRuin extends CommandBase {
}
@Override
- public String getCommandUsage(ICommandSender p_71518_1_) {
+ public String getCommandUsage(ICommandSender sender) {
return "SummonRuin <x> <z>";
}
@Override
- public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) {
+ public void processCommand(ICommandSender iCommandSender, String[] args) {
try {
new MapGenRuins.RuinsBase().generate(
iCommandSender.getEntityWorld(),
iCommandSender.getEntityWorld().rand,
- Integer.parseInt(p_71515_2_[0]),
+ Integer.parseInt(args[0]),
256,
- Integer.parseInt(p_71515_2_[1]));
+ Integer.parseInt(args[1]));
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
index 46e63a89ec..e710f15df7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
@@ -98,7 +98,7 @@ public class ConfigHandler {
615, 625, 635, 645, 655, 665, 675 }, };
private static int[][][] defaultMetasForTiers = { METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE,
METAFORTIERS_MACHINE };
- private static final String[] VOLTAGE_NAMES = new String[] { "High Pressure Steam", "Low Voltage", "Medium Voltage",
+ private static final String[] VOLTAGE_NAMES = { "High Pressure Steam", "Low Voltage", "Medium Voltage",
"High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage",
"Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage",
"Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" };
@@ -147,7 +147,7 @@ public class ConfigHandler {
"This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.",
-1,
VOLTAGE_NAMES.length).getInt(5);
- ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier);
+ ConfigHandler.cutoffTier = ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier;
ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c
.get(
"System",
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java
index 33876e557c..b3791b51d6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java
@@ -61,8 +61,7 @@ public class BW_ItemBlocks extends ItemBlock {
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage());
if (tier >= 0) {
aList.add(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java
index 8a3ec95073..62f8b0e666 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java
@@ -42,13 +42,12 @@ public class BW_SimpleWindMeter extends Item {
@Override
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister p_94581_1_) {
- this.itemIcon = p_94581_1_.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter");
+ public void registerIcons(IIconRegister register) {
+ this.itemIcon = register.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter");
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) {
+ public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List<String> list, boolean p_77624_4_) {
super.addInformation(itemStack, entityPlayer, list, p_77624_4_);
list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name"));
list.add(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java
index ce55f220b4..fd875785a7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java
@@ -66,13 +66,14 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor {
this.itemTex = itemTex;
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex);
}
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) {
+ @Override
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> info, boolean b) {
info.add(
StatCollector
.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2]));
@@ -85,14 +86,14 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor {
info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]);
info.add(
StatCollector.translateToLocal("tooltip.rotor.1.name") + " "
- + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100)
+ + (this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100
+ "/"
- + (this.getMaxDamageEx() / 100));
+ + this.getMaxDamageEx() / 100);
info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff);
info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed);
info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor);
if (type != null) {
- info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))));
+ info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)));
}
info.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
@@ -128,11 +129,11 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor {
}
public int getSpeed() {
- return speed;
+ return this.speed;
}
public float getmRotor() {
- return mRotor;
+ return this.mRotor;
}
public void setDamageForStack(ItemStack stack, int advDmg) {
@@ -160,6 +161,6 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor {
}
public void damageItemStack(ItemStack stack, int Dmg) {
- setDamageForStack(stack, getDamageOfStack(stack) + Dmg);
+ this.setDamageForStack(stack, this.getDamageOfStack(stack) + Dmg);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java
index ebe2c0fa43..7eaea5c3a7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java
@@ -73,8 +73,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
if (aStack != null && aStack.getTagCompound() != null) aList.add(
StatCollector.translateToLocal("tooltip.cp.0.name") + " "
@@ -94,8 +93,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) {
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (this.getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -163,10 +161,10 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
@Override
public void putStack(ItemStack stack) {
- if (isLVCircuit(stack)) {
- stack = createRealCircuit(0);
+ if (Circuit_Programmer.this.isLVCircuit(stack)) {
+ stack = Circuit_Programmer.this.createRealCircuit(0);
}
- ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(getSlotIndex(), stack);
+ ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(this.getSlotIndex(), stack);
this.onSlotChanged();
}
});
@@ -174,7 +172,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
ItemStack initialStack = null;
NBTTagCompound tag = heldStack.getTagCompound();
if (tag != null && tag.getBoolean(NBT_KEY_HAS_CHIP)) {
- initialStack = createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG));
+ initialStack = this.createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG));
}
circuitSlotWidget.getMcSlot().putStack(initialStack);
@@ -193,17 +191,17 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
tag2.setBoolean(NBT_KEY_HAS_CHIP, false);
}
heldItem.setTagCompound(tag2);
- }).setFilter(stack -> isProgrammedCircuit(stack) || isLVCircuit(stack))
+ }).setFilter(stack -> this.isProgrammedCircuit(stack) || this.isLVCircuit(stack))
.setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(122, 60));
for (int i = 0; i < 24; i++) {
final int index = i;
builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
if (circuitSlotWidget.getMcSlot().getHasStack()
- && isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) {
- circuitSlotWidget.getMcSlot().putStack(createRealCircuit(index + 1));
+ && this.isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) {
+ circuitSlotWidget.getMcSlot().putStack(this.createRealCircuit(index + 1));
}
- }).setPos(32 + (i % 12) * 18, 21 + (i / 12) * 18).setSize(18, 18));
+ }).setPos(32 + i % 12 * 18, 21 + i / 12 * 18).setSize(18, 18));
}
return builder.build();
@@ -219,7 +217,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem
private boolean isLVCircuit(ItemStack stack) {
return BW_Util.checkStackAndPrefix(stack)
- && GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.circuit)
+ && OrePrefixes.circuit.equals(GT_OreDictUnificator.getAssociation(stack).mPrefix)
&& GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(Materials.Basic);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java
index 7d3327761c..81b80f2ed7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java
@@ -49,8 +49,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
@@ -61,6 +60,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM
return aStack;
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister aIconRegister) {
this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack");
@@ -76,7 +76,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM
@Override
public void putStack(ItemStack stack) {
- onSlotChanged();
+ this.onSlotChanged();
}
}).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS).setPos(79, 16)).widget(
new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT).setSize(17, 17)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java
index 5207a345c1..d099fa6131 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java
@@ -59,7 +59,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem {
public GT_Rockcutter_Item(int aTier) {
super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks);
this.mTier = aTier;
- this.multi = (int) Math.pow(10, (this.mTier - 1));
+ this.multi = (int) Math.pow(10, this.mTier - 1);
GT_Rockcutter_Item.mineableBlocks = new HashSet<>();
this.maxStackSize = 1;
this.mCharge = 10000 * this.multi;
@@ -71,13 +71,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem {
this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]);
}
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]);
aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
- public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ @Override
+ public void onUpdate(ItemStack aStack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) {
if (!ElectricItem.manager.canUse(aStack, 500 * this.multi)) {
if (aStack.isItemEnchanted()) {
aStack.getTagCompound().removeTag("ench");
@@ -87,12 +88,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem {
}
}
+ @Override
public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_,
int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
ElectricItem.manager.use(aStack, 0, aPlayer);
return false;
}
+ @Override
public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6,
EntityLivingBase var7) {
ElectricItem.manager.use(var1, 0, var7);
@@ -115,9 +118,9 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem {
|| mineableBlocks.contains(par1Block);
}
+ @Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) {
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (this.getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -159,11 +162,13 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem {
return this.mTransfer;
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.icon = iconRegister.registerIcon("bartworks:GT_Rockcutter");
}
+ @Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1) {
return this.icon;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java
index 0c05642998..bc07762505 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java
@@ -61,15 +61,14 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem {
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name"));
aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
+ @Override
public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) {
- if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) {
- EntityLiving tTarget = (EntityLiving) aTarget;
+ if (aTarget instanceof EntityLiving tTarget && ElectricItem.manager.canUse(aStack, 9000000)) {
ElectricItem.manager.use(aStack, 9000000, aPlayer);
for (int i = 1; i < 5; ++i) {
if (tTarget.getEquipmentInSlot(i) != null
@@ -81,9 +80,9 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem {
return true;
}
+ @Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) {
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (this.getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -130,11 +129,13 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem {
return this.mTransfer;
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.icon = iconRegister.registerIcon("bartworks:GT_Teslastaff");
}
+ @Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1) {
return this.icon;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java
index cc7977b5cc..a4712dc36a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java
@@ -28,13 +28,13 @@ public class LabModule extends SimpleSubItemClass {
this.setCreativeTab(MainMod.BIO_TAB);
}
- public String getUnlocalizedName(ItemStack p_77667_1_) {
- return "labModule." + super.getUnlocalizedName(p_77667_1_);
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return "labModule." + super.getUnlocalizedName(stack);
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List<String> aList, boolean p_77624_4_) {
aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name"));
super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java
index e8632c574c..b18029411f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java
@@ -46,15 +46,11 @@ public class LabParts extends SimpleSubItemClass {
if (itemStack == null || itemStack.getTagCompound() == null) return EnumRarity.common;
- switch (itemStack.getItemDamage()) {
- case 0:
- return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity"));
- case 1:
- case 2:
- return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity"));
- default:
- return EnumRarity.common;
- }
+ return switch (itemStack.getItemDamage()) {
+ case 0 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity"));
+ case 1, 2 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity"));
+ default -> EnumRarity.common;
+ };
}
@Override
@@ -70,8 +66,7 @@ public class LabParts extends SimpleSubItemClass {
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) {
+ public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List<String> list, boolean b) {
if (itemStack == null) return;
if (itemStack.getTagCompound() == null) {
@@ -129,17 +124,17 @@ public class LabParts extends SimpleSubItemClass {
}
@Override
- @SuppressWarnings("unchecked")
- public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
+ public void getSubItems(Item item, CreativeTabs creativeTabs, List<ItemStack> list) {
list.addAll(getAllPetriDishes());
list.addAll(getAllDNASampleFlasks());
list.addAll(getAllPlasmidCells());
super.getSubItems(item, creativeTabs, list);
}
+ @Override
public String getUnlocalizedName(ItemStack itemStack) {
if (itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null)
- return "filled.item." + this.tex[itemStack.getItemDamage()].replaceAll("/", ".");
+ return "filled.item." + this.tex[itemStack.getItemDamage()].replace('/', '.');
return super.getUnlocalizedName(itemStack);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
index bd192efbe5..e31e23d47c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
@@ -27,6 +27,7 @@ public class SimpleIconItem extends Item {
this.tex = tex;
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java
index 346f9e84c7..8d5b239a75 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java
@@ -41,6 +41,7 @@ public class SimpleSubItemClass extends Item {
this.setCreativeTab(MainMod.BWT);
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = new IIcon[this.tex.length];
@@ -50,29 +51,28 @@ public class SimpleSubItemClass extends Item {
}
@Override
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List<String> aList, boolean p_77624_4_) {
super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
@Override
- @SuppressWarnings("unchecked")
- public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) {
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List<ItemStack> p_150895_3_) {
for (int i = 0; i < this.tex.length; i++) {
p_150895_3_.add(new ItemStack(p_150895_1_, 1, i));
}
}
+ @Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int p_77617_1_) {
if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_];
- else return this.itemIcon[0];
+ return this.itemIcon[0];
}
- public String getUnlocalizedName(ItemStack p_77667_1_) {
- if (p_77667_1_.getItemDamage() < this.tex.length)
- return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", ".");
- else return "WrongDamageItemDestroyIt";
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ if (stack.getItemDamage() < this.tex.length) return "item." + this.tex[stack.getItemDamage()].replace('/', '.');
+ return "WrongDamageItemDestroyIt";
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java
index f9f3ea3c64..e3804b8a50 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java
@@ -33,7 +33,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable {
1);
}
- private static final ItemStack[] circuits = new ItemStack[] { ItemList.Circuit_ExoticProcessor.get(1),
+ private static final ItemStack[] circuits = { ItemList.Circuit_ExoticProcessor.get(1),
ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1),
ItemList.Circuit_Wetwaremainframe.get(1) };
@@ -129,30 +129,30 @@ public class ElectricImplosionCompressorRecipes implements Runnable {
20 * 4,
(int) TierEU.RECIPE_MAX);
- addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes();
+ this.addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes();
}
private void addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes() {
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2);
- addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2);
+ this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1);
}
private void addWhiteDwarfMagnetoEICRecipe(final OrePrefixes part, final int multiplier,
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
index 418a299f5c..6f4b237473 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
@@ -14,11 +14,11 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
import static gregtech.api.enums.Mods.Gendustry;
+import static gregtech.api.enums.Mods.GregTech;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
-import java.awt.*;
-import java.util.Arrays;
+import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@@ -36,11 +36,12 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.FluidState;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TierEU;
-import gregtech.api.objects.GT_Fluid;
-import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.fluid.GT_FluidFactory;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Item_98;
@@ -57,30 +58,27 @@ public class FluidLoader {
public static Fluid fulvicAcid, heatedfulvicAcid, Kerogen;
public static void run() {
- FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId();
- short[] rgb = new short[3];
- Arrays.fill(rgb, (short) 255);
- FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb);
- FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20));
- FluidLoader.heatedfulvicAcid = FluidLoader
- .createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720);
- FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85));
- FluidLoader.BioLabFluidMaterials = new Fluid[] {
- new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] { 125, 50, 170, 0 }),
- new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] { 240, 200, 125, 0 }),
- new GT_Fluid("Penicillin", "molten.autogenerated", new short[] { 255, 255, 255, 0 }),
- new GT_Fluid("Polymerase", "molten.autogenerated", new short[] { 110, 180, 110, 0 }), };
-
- FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length];
- for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) {
- FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]);
- }
-
- GT_MetaGenerated_Item_98.FluidCell[] fluidCells = new GT_MetaGenerated_Item_98.FluidCell[] {
- GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION,
- GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, };
+ renderID = RenderingRegistry.getNextAvailableRenderId();
+ ff = new Fluid("BWfakeFluid");
+ GregTech_API.sGTBlockIconload.add(
+ () -> ff.setIcons(
+ GregTech_API.sBlockIcons
+ .registerIcon(GregTech.getResourcePath("fluids", "fluid.molten.autogenerated"))));
+ fulvicAcid = createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20));
+ heatedfulvicAcid = createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720);
+ Kerogen = createAndRegisterFluid("Kerogen", new Color(85, 85, 85));
+ BioLabFluidMaterials = new Fluid[] { createAndRegisterFluid("FluorecentdDNA", new Color(125, 50, 170)),
+ createAndRegisterFluid("EnzymesSollution", new Color(240, 200, 125)),
+ createAndRegisterFluid("Penicillin", new Color(255, 255, 255)),
+ createAndRegisterFluid("Polymerase", new Color(110, 180, 110)) };
+
+ BioLabFluidCells = new ItemStack[BioLabFluidMaterials.length];
+
+ GT_MetaGenerated_Item_98.FluidCell[] fluidCells = { GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA,
+ GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, GT_MetaGenerated_Item_98.FluidCell.PENICILLIN,
+ GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, };
for (int i = 0; i < fluidCells.length; i++) {
- FluidLoader.BioLabFluidCells[i] = fluidCells[i].get();
+ BioLabFluidCells[i] = fluidCells[i].get();
}
FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100)
@@ -88,24 +86,22 @@ public class FluidLoader {
for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
if (B.isBreedable()) {
B.setFluid(
- new GT_Fluid(
- B.getName().replaceAll(" ", "").toLowerCase() + "fluid",
- "molten.autogenerated",
- new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(),
- (short) B.getColor().getGreen() }));
- FluidRegistry.registerFluid(B.getFluid());
- GT_LanguageManager
- .addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid");
+ GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid")
+ .withTextureName("molten.autogenerated")
+ .withColorRGBA(
+ new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(),
+ (short) B.getColor().getGreen() })
+ .withLocalizedName(B.getLocalisedName() + " Fluid")
+ .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid());
GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10))
.fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS)
.eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes);
-
}
}
- FluidLoader.bioFluidBlock = new BioFluidBlock();
- GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock");
+ bioFluidBlock = new BioFluidBlock();
+ GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock");
GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge");
if (SideReference.Side.Client) {
RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance);
@@ -114,25 +110,18 @@ public class FluidLoader {
}
public static Fluid createAndRegisterFluid(String Name, Color color) {
- Fluid f = new GT_Fluid(
- Name,
- "molten.autogenerated",
- new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
- (short) color.getAlpha() });
- GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name);
- FluidRegistry.registerFluid(f);
- return f;
+ return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated")
+ .withColorRGBA(
+ new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
+ (short) color.getAlpha() })
+ .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid();
}
public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) {
- Fluid f = new GT_Fluid(
- Name,
- "molten.autogenerated",
- new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
- (short) color.getAlpha() });
- GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name);
- f.setTemperature(temperature);
- FluidRegistry.registerFluid(f);
- return f;
+ return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated")
+ .withColorRGBA(
+ new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
+ (short) color.getAlpha() })
+ .withStateAndTemperature(FluidState.LIQUID, temperature).buildAndRegister().asFluid();
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
index 48e178bc73..50f5fa6b76 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
@@ -283,15 +283,15 @@ public class ItemRegistry {
"Electric Implosion Compressor").getStackForm(1L);
// EIC depend on neutronium block to pass on structure updates
- int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2);
+ int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | 1 << 2;
GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask);
// Also spacetime, transcendent metal, and universium
- bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal9, 0) | (1 << 3) | (1 << 4) | (1 << 8);
+ bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal9, 0) | 1 << 3 | 1 << 4 | 1 << 8;
GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal9, bitmask);
// Also infinity
- bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | (1 << 1);
+ bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | 1 << 1;
GregTech_API.registerMachineBlock(LudicrousBlocks.resource_block, bitmask);
ItemRegistry.THTR = new GT_TileEntity_THTR(
@@ -422,31 +422,34 @@ public class ItemRegistry {
for (int amps = 32; amps <= 128; amps += 32) {
for (int tier = 4; tier < 8; tier++) {
TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox(
- startID++,
+ startID,
GT_Values.VN[tier] + "_LPLaser_Converter_" + amps,
GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter",
tier,
amps).getStackForm(1L);
+ startID++;
}
}
for (int amps = 32; amps <= 128; amps += 32) {
for (int tier = 4; tier < 8; tier++) {
TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch(
- startID++,
+ startID,
GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps,
GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch",
tier,
amps).getStackForm(1L);
+ startID++;
}
}
for (int amps = 32; amps <= 128; amps += 32) {
for (int tier = 4; tier < 8; tier++) {
TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo(
- startID++,
+ startID,
GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps,
GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch",
tier,
amps).getStackForm(1L);
+ startID++;
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java
index 41fc6c8a23..9a3ade059e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java
@@ -42,9 +42,8 @@ public class RadioHatchMaterialLoader {
}
}
- Materials[] spacialMaterial = new Materials[] { Materials.Naquadah, Materials.NaquadahEnriched,
- Materials.Naquadria };
- int[] spacialValue = new int[] { 130, 140, 150 };
+ Materials[] spacialMaterial = { Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria };
+ int[] spacialValue = { 130, 140, 150 };
for (int i = 0; i < spacialMaterial.length; i++) {
if (GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1) != null)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
index 3b145cad5e..0cba765189 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
@@ -30,7 +30,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.stream.Collectors;
+import java.util.Set;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -45,7 +45,6 @@ import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import com.github.bartimaeusnek.bartworks.util.Pair;
import com.github.bartimaeusnek.bartworks.util.StreamUtils;
import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
@@ -109,7 +108,7 @@ public class StaticRecipeChangeLoaders {
public static void fixEnergyRequirements() {
GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(StreamUtils::filterVisualMaps)
.forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> {
- for (int i = 0; i < (VN.length - 1); i++) {
+ for (int i = 0; i < VN.length - 1; i++) {
if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i)
&& gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) {
gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i);
@@ -217,15 +216,14 @@ public class StaticRecipeChangeLoaders {
recipe.mOutputs[i] = GT_Utility
.copyAmount(recipe.mOutputs[i].stackSize, replacement);
}
- if (recipe.mSpecialItems instanceof ItemStack) {
- ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems;
+ if (recipe.mSpecialItems instanceof ItemStack specialItemStack) {
if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue;
if (removal) {
iterator.remove();
continue nextRecipe;
}
recipe.mSpecialItems = GT_Utility
- .copyAmount((specialItemStack).stackSize, replacement);
+ .copyAmount(specialItemStack.stackSize, replacement);
}
}
}
@@ -235,7 +233,6 @@ public class StaticRecipeChangeLoaders {
}
}
- @SuppressWarnings("ALL")
private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) {
if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) {
try {
@@ -245,52 +242,52 @@ public class StaticRecipeChangeLoaders {
Materials.Empty.getCells(1));
Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData");
f.setAccessible(true);
+ @SuppressWarnings("unchecked")
Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData> sFilledContainerToData = (Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData>) f
.get(null);
- HashSet torem = new HashSet<>();
+ Set<Map.Entry<GT_ItemStack, FluidContainerRegistry.FluidContainerData>> toremFilledContainerToData = new HashSet<>();
ItemStack toReplace = null;
for (Map.Entry<GT_ItemStack, FluidContainerRegistry.FluidContainerData> entry : sFilledContainerToData
.entrySet()) {
final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId;
- if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) continue;
+ if (MainMod.MOD_ID.equals(MODID) || BartWorksCrossmod.MOD_ID.equals(MODID)) continue;
if (entry.getValue().fluid.equals(data.fluid)
&& !entry.getValue().filledContainer.equals(data.filledContainer)) {
toReplace = entry.getValue().filledContainer;
- torem.add(entry);
+ toremFilledContainerToData.add(entry);
}
}
- sFilledContainerToData.entrySet().removeAll(torem);
- torem.clear();
+ sFilledContainerToData.entrySet().removeAll(toremFilledContainerToData);
+ Set<GT_Recipe> toremRecipeList = new HashSet<>();
if (toReplace != null) {
for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
- torem.clear();
+ toremRecipeList.clear();
for (GT_Recipe recipe : map.mRecipeList) {
- for (int i = 0; i < recipe.mInputs.length; i++) {
- if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) {
- torem.add(recipe);
+ for (ItemStack mInput : recipe.mInputs) {
+ if (GT_Utility.areStacksEqual(mInput, toReplace)) {
+ toremRecipeList.add(recipe);
// recipe.mInputs[i] = data.filledContainer;
}
}
- for (int i = 0; i < recipe.mOutputs.length; i++) {
- if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) {
- torem.add(recipe);
+ for (ItemStack mOutput : recipe.mOutputs) {
+ if (GT_Utility.areStacksEqual(mOutput, toReplace)) {
+ toremRecipeList.add(recipe);
// recipe.mOutputs[i] = data.filledContainer;
if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes
- && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer)
+ && GT_Utility.areStacksEqual(mOutput, data.filledContainer)
&& !recipe.mFluidInputs[0].equals(data.fluid)) {
- torem.add(recipe);
+ toremRecipeList.add(recipe);
// recipe.mOutputs[i] = data.filledContainer;
}
}
}
- if (recipe.mSpecialItems instanceof ItemStack) {
- if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) {
- torem.add(recipe);
- // recipe.mSpecialItems = data.filledContainer;
- }
+ if (recipe.mSpecialItems instanceof ItemStack
+ && GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) {
+ toremRecipeList.add(recipe);
+ // recipe.mSpecialItems = data.filledContainer;
}
}
- map.mRecipeList.removeAll(torem);
+ map.mRecipeList.removeAll(toremRecipeList);
}
}
GT_Utility.addFluidContainerData(data);
@@ -301,12 +298,11 @@ public class StaticRecipeChangeLoaders {
}
private static void runUnficationDeleter(Werkstoff werkstoff) {
- if (werkstoff.getType() == Werkstoff.Types.ELEMENT) {
- if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) {
- werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip());
- Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>();
- Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial());
- }
+ if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null
+ && Element.get(werkstoff.getToolTip()) != Element._NULL) {
+ werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip());
+ Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>();
+ Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial());
}
for (OrePrefixes prefixes : OrePrefixes.values()) if (werkstoff.hasItemType(prefixes)) {
@@ -319,12 +315,11 @@ public class StaticRecipeChangeLoaders {
}
private static void runMaterialLinker(Werkstoff werkstoff) {
- if (werkstoff.getType() == Werkstoff.Types.ELEMENT) {
- if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) {
- werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip());
- Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>();
- Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial());
- }
+ if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null
+ && Element.get(werkstoff.getToolTip()) != Element._NULL) {
+ werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip());
+ Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>();
+ Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial());
}
for (OrePrefixes prefixes : OrePrefixes.values())
@@ -379,14 +374,13 @@ public class StaticRecipeChangeLoaders {
if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0)
&& (whitelistForEBFNoGasRecipeDontCheckItemData.stream()
.anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput))
- || (BW_Util.checkStackAndPrefix(recipe.mInputs[i])
+ || BW_Util.checkStackAndPrefix(recipe.mInputs[i])
&& BW_Util.checkStackAndPrefix(baseRe.mInputs[i])
&& GT_OreDictUnificator
.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(
GT_OreDictUnificator.getAssociation(
baseRe.mInputs[i]).mMaterial.mMaterial)
- && GT_Utility
- .areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])))) {
+ && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) {
toAdd.add(recipe.mOutputs[0]);
repToAdd.put(tag, recipe);
continue recipeLoop;
@@ -399,9 +393,8 @@ public class StaticRecipeChangeLoaders {
}
private static int transformEBFGasRecipeTime(int originalDuration, long originalGasProtons, long newGasProtons) {
- double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D)
- - (double) newGasProtons;
- return Math.max(1, (int) ((double) originalDuration / 200D * Math.max(200D + protonTerm, 1D)));
+ double protonTerm = originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - newGasProtons;
+ return Math.max(1, (int) (originalDuration / 200D * Math.max(200D + protonTerm, 1D)));
}
private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Materials newGas) {
@@ -409,9 +402,8 @@ public class StaticRecipeChangeLoaders {
double originalEbfMul = gtEbfGasRecipeTimeMultipliers.get(originalGas);
if (newEbfMul < 0.0D || originalEbfMul < 0.0D) {
return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getProtons());
- } else {
- return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul));
}
+ return Math.max(1, (int) (recipe.mDuration * newEbfMul / originalEbfMul));
}
private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) {
@@ -422,9 +414,8 @@ public class StaticRecipeChangeLoaders {
recipe.mDuration,
originalGas.getProtons(),
newGas.getStats().getProtons());
- } else {
- return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul));
}
+ return Math.max(1, (int) (recipe.mDuration * newEbfMul / originalEbfMul));
}
private static int transformEBFNoGasRecipeTime(GT_Recipe recipe, Materials originalGas) {
@@ -439,8 +430,7 @@ public class StaticRecipeChangeLoaders {
int gasAmount = Math.max(
1,
(int) Math.round(
- (double) recipe.mFluidInputs[0].amount
- * gtEbfGasRecipeConsumptionMultipliers.get(newGas)));
+ recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas)));
if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1
&& recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) {
// preserve original recipe owner
@@ -484,7 +474,7 @@ public class StaticRecipeChangeLoaders {
int gasAmount = Math.max(
1,
(int) Math.round(
- (double) recipe.mFluidInputs[0].amount
+ recipe.mFluidInputs[0].amount
* newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier()));
if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1
&& recipe.mFluidInputs[0]
@@ -535,10 +525,12 @@ public class StaticRecipeChangeLoaders {
&& !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack)
&& !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) {
if (BW_Util.checkStackAndPrefix(stack))
- circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix
- .equals(OrePrefixes.dustSmall) ? 4
- : GT_OreDictUnificator.getAssociation(stack).mPrefix
- .equals(OrePrefixes.dustTiny) ? 9 : 1);
+ circuitConfiguration = (byte) (OrePrefixes.dustSmall
+ .equals(GT_OreDictUnificator.getAssociation(stack).mPrefix)
+ ? 4
+ : OrePrefixes.dustTiny.equals(
+ GT_OreDictUnificator.getAssociation(stack).mPrefix) ? 9
+ : 1);
inputs.add(stack);
}
inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration));
@@ -635,130 +627,9 @@ public class StaticRecipeChangeLoaders {
}
private static boolean checkForExplosives(ItemStack input) {
- return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt))
+ return GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt))
|| GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))
|| GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L))
- || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L)));
- }
-
- private static int getBlastLogic(GT_Recipe recipe) {
- int ret = 0;
-
- for (ItemStack stack : recipe.mInputs) {
- if (stack != null) {
- ret += Math.max(stack.stackSize, 1);
- }
- }
-
- while (ret > 14) {
- ret /= 10;
- }
-
- if (recipe.mFluidInputs.length != 0) ret += 10;
-
- return ret;
- }
-
- private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe,
- Pair<Integer, Integer> counts) {
- if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes)
- return getChemicalLogic(recipe, counts);
- else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) return getBlastLogic(recipe);
- throw new NoSuchMethodError("Could not find a Supported Method for " + gt_recipe_map.mUnlocalizedName);
- }
-
- private static int getChemicalLogic(GT_Recipe recipe, Pair<Integer, Integer> counts) {
- Pair<Integer, Integer> toSet;
-
- if (counts.getKey() == 0 || counts.getValue() == 0)
- toSet = new Pair<>(Math.max(recipe.mFluidOutputs.length, recipe.mOutputs.length), 0);
- else if (counts.getValue() > 2) toSet = new Pair<>(counts.getKey() + counts.getValue(), 1);
- else toSet = counts;
-
- return toSet.getValue() * 10 + toSet.getKey();
- }
-
- private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap,
- Map<GT_Recipe, Pair<Integer, Integer>> mapGtRecipeCounts) {
- mapGtRecipeCounts.forEach(
- (recipe, counts) -> StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts));
-
- gtRecipeMap.mRecipeList.clear();
- gtRecipeMap.mRecipeList.addAll(mapGtRecipeCounts.keySet());
-
- fixRecipeClashes(gtRecipeMap);
- }
-
- private static void fixRecipeClashes(GT_Recipe.GT_Recipe_Map gtRecipeMap) {
- boolean hasClashes;
- do {
- hasClashes = false;
- gtRecipeMap.reInit();
- for (GT_Recipe re : gtRecipeMap.mRecipeList) {
- if (gtRecipeMap.findRecipe(null, false, Long.MAX_VALUE, re.mFluidInputs, re.mInputs) != re) {
- hasClashes = true;
- fixRecipeCircuitClashes(re);
- }
- }
- } while (hasClashes);
- }
-
- private static void fixRecipeCircuitClashes(GT_Recipe recipe) {
- for (int i = 0; i < recipe.mInputs.length; i++) {
- if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), recipe.mInputs[i])) {
- int nudmg = recipe.mInputs[i].getItemDamage() + 1 > 24 ? 1 : recipe.mInputs[i].getItemDamage() + 1;
- recipe.mInputs[i].setItemDamage(nudmg);
- }
- }
- }
-
- private static Map<GT_Recipe.GT_Recipe_Map, Map<GT_Recipe, Pair<Integer, Integer>>> getRecipesByCircuitID(
- GT_Recipe.GT_Recipe_Map[] ref) {
- return Arrays.stream(ref).collect(
- Collectors.toMap(
- k -> k,
- k -> getArrayListMultiMapFromRecipeList(gatherNoCircuitRecipes(new HashSet<>(k.mRecipeList)))));
- }
-
- private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe,
- Pair<Integer, Integer> counts) {
- ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class);
- ItemStack[] nu = Arrays.copyOf(old, old.length + 1);
-
- nu[old.length] = GT_Utility.getIntegratedCircuit( // Max 24, Min 1
- Math.min(Math.max(getLogicFuntion(gt_recipe_map, recipe, counts), 1), 24));
- recipe.mInputs = nu;
-
- return recipe;
- }
-
- @SuppressWarnings("unchecked")
- private static Collection<GT_Recipe> gatherNoCircuitRecipes(Collection<GT_Recipe> mRecipeList) {
- Collection<GT_Recipe> newColl;
- try {
- newColl = (Collection<GT_Recipe>) mRecipeList.getClass().newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
- newColl = new HashSet<>();
- }
-
- recipeloop: for (GT_Recipe r : mRecipeList) {
- for (int i = 0; i < r.mInputs.length; i++)
- if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) {
- continue recipeloop;
- }
- newColl.add(r);
- }
-
- return newColl;
- }
-
- private static Map<GT_Recipe, Pair<Integer, Integer>> getArrayListMultiMapFromRecipeList(
- Collection<GT_Recipe> mRecipeList) {
- return mRecipeList.stream().collect(
- Collectors.toMap(
- recipe -> recipe,
- recipe -> new Pair<>(
- (int) Arrays.stream(recipe.mInputs).filter(Objects::nonNull).count(),
- (int) Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).count())));
+ || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java
index 833c3c647a..4b676367cf 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java
@@ -173,7 +173,6 @@ public class Assembler implements Runnable {
ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter)
.fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount))
.duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes);
-
GT_Values.RA.stdBuilder()
.itemInputs(
new ItemStack(
@@ -182,6 +181,21 @@ public class Assembler implements Runnable {
ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()),
WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens),
GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8),
+ emitters[i].get(2 * (j + 1)),
+ sensors[i].get(2 * (j + 1)),
+ ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)))
+ .itemOutputs(converter).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount))
+ .noFluidOutputs().duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption)
+ .addTo(sAssemblerRecipes);
+
+ GT_Values.RA.stdBuilder()
+ .itemInputs(
+ new ItemStack(
+ ItemRegistry.TecTechPipeEnergyLowPower.getItem(),
+ (j + 1) * 16,
+ ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()),
+ WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens),
+ GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8),
sensors[i].get(2 * (j + 1)),
ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)))
.itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount))
@@ -191,7 +205,7 @@ public class Assembler implements Runnable {
.itemInputs(
new ItemStack(
ItemRegistry.TecTechPipeEnergyLowPower.getItem(),
- ((j + 1) * 16),
+ (j + 1) * 16,
ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()),
WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens),
GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8),
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java
index c36b0a6127..3ee15f52da 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java
@@ -443,12 +443,12 @@ public class CraftingRecipes implements Runnable {
for (int i = 3; i < GT_Values.VN.length - 1; i++) {
// 12625
- BioLab2[(i - 3)] = new GT_MetaTileEntity_BioLab(
+ BioLab2[i - 3] = new GT_MetaTileEntity_BioLab(
ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i,
"bw.biolab" + GT_Values.VN[i],
GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"),
i).getStackForm(1L);
- RadioHatch2[(i - 3)] = new GT_MetaTileEntity_RadioHatch(
+ RadioHatch2[i - 3] = new GT_MetaTileEntity_RadioHatch(
ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i,
"bw.radiohatch" + GT_Values.VN[i],
GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"),
@@ -456,21 +456,21 @@ public class CraftingRecipes implements Runnable {
try {
ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L);
GT_ModHandler.addCraftingRecipe(
- BioLab2[(i - 3)],
+ BioLab2[i - 3],
RecipeLoader.BITSD,
new Object[] { "PFP", "WCW", "OGO", 'F',
- GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[(i - 3)], 1L), 'W',
- GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[(i - 3)], 1L), 'P',
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[i - 3], 1L), 'W',
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[i - 3], 1L), 'P',
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O',
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G',
- "circuit" + circuits2[(i - 3)], 'C', machinehull });
+ "circuit" + circuits2[i - 3], 'C', machinehull });
GT_ModHandler.addCraftingRecipe(
- RadioHatch2[(i - 3)],
+ RadioHatch2[i - 3],
RecipeLoader.BITSD,
new Object[] { "DPD", "DCD", "DKD", 'D',
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull,
- 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[(i - 3)], 1L), 'P',
- Pistons2[(i - 3)] });
+ 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[i - 3], 1L), 'P',
+ Pistons2[i - 3] });
} catch (ArrayIndexOutOfBoundsException ignored) {
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java
index 14dcd3006c..e5ae3c8994 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java
@@ -34,6 +34,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.server.FMLServerHandler;
import gregtech.api.enums.GT_Values;
import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
import gregtech.api.net.IGT_NetworkHandler;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler;
@@ -44,73 +45,77 @@ import io.netty.handler.codec.MessageToMessageCodec;
/*
* Original GT File slightly Modified
*/
-@SuppressWarnings("ALL")
+@SuppressWarnings("deprecation")
@ChannelHandler.Sharable
-public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler {
+public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet_New> implements IGT_NetworkHandler {
private final EnumMap<Side, FMLEmbeddedChannel> mChannel;
- private final GT_Packet[] mSubChannels;
+ private final GT_Packet_New[] mSubChannels;
public BW_Network() {
this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared());
- this.mSubChannels = new GT_Packet[] { new RendererPacket(), new CircuitProgrammerPacket(),
+ this.mSubChannels = new GT_Packet_New[] { new RendererPacket(), new CircuitProgrammerPacket(),
new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), new EICPacket() };
}
- protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception {
+ @Override
+ protected void encode(ChannelHandlerContext aContext, GT_Packet_New aPacket, List<Object> aOutput)
+ throws Exception {
aOutput.add(
new FMLProxyPacket(
Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(),
- (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get()));
+ aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get()));
}
+ @Override
protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput)
throws Exception {
ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array());
aOutput.add(this.mSubChannels[aData.readByte()].decode(aData));
}
+ @Override
public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) {
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET)
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET)
.set(FMLOutboundHandler.OutboundTarget.PLAYER);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS)
- .set(aPlayer);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket);
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer);
+ this.mChannel.get(Side.SERVER).writeAndFlush(aPacket);
}
public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) {
for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) {
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET)
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET)
.set(FMLOutboundHandler.OutboundTarget.PLAYER);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS)
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS)
.set(world.getPlayerEntityByName(name));
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket);
+ this.mChannel.get(Side.SERVER).writeAndFlush(aPacket);
}
}
+ @Override
public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) {
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET)
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET)
.set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS)
- .set(aPosition);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket);
+ this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition);
+ this.mChannel.get(Side.SERVER).writeAndFlush(aPacket);
}
+ @Override
public void sendToServer(@Nonnull GT_Packet aPacket) {
- ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET)
+ this.mChannel.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET)
.set(FMLOutboundHandler.OutboundTarget.TOSERVER);
- ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket);
+ this.mChannel.get(Side.CLIENT).writeAndFlush(aPacket);
}
+ @Override
public void sendPacketToAllPlayersInRange(World aWorld, @Nonnull GT_Packet aPacket, int aX, int aZ) {
if (!aWorld.isRemote) {
for (Object tObject : aWorld.playerEntities) {
- if (!(tObject instanceof EntityPlayerMP)) {
+ if (!(tObject instanceof EntityPlayerMP tPlayer)) {
break;
}
- EntityPlayerMP tPlayer = (EntityPlayerMP) tObject;
Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ);
if (tPlayer.getServerForPlayer().getPlayerManager()
.isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) {
@@ -121,11 +126,12 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet>
}
@Sharable
- static final class HandlerShared extends SimpleChannelInboundHandler<GT_Packet> {
+ static final class HandlerShared extends SimpleChannelInboundHandler<GT_Packet_New> {
HandlerShared() {}
- protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception {
+ @Override
+ protected void channelRead0(ChannelHandlerContext ctx, GT_Packet_New aPacket) throws Exception {
EntityPlayer aPlayer = GT_Values.GT.getThePlayer();
aPacket.process(aPlayer == null ? null : GT_Values.GT.getThePlayer().worldObj);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java
index a53cd1128a..0ab6e42e91 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java
@@ -13,8 +13,6 @@
package com.github.bartimaeusnek.bartworks.common.net;
-import java.nio.ByteBuffer;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -26,9 +24,10 @@ import net.minecraftforge.common.DimensionManager;
import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer;
import com.google.common.io.ByteArrayDataInput;
-import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
+import io.netty.buffer.ByteBuf;
-public class CircuitProgrammerPacket extends GT_Packet {
+public class CircuitProgrammerPacket extends GT_Packet_New {
private int dimID, playerID;
private byte chipCfg;
@@ -52,20 +51,17 @@ public class CircuitProgrammerPacket extends GT_Packet {
}
@Override
- public byte[] encode() {
- return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID)
- .put(8, (this.hasChip ? this.chipCfg : -1)).array();
+ public void encode(ByteBuf aOut) {
+ aOut.writeInt(this.dimID).writeInt(this.playerID).writeByte(this.hasChip ? this.chipCfg : -1);
}
@Override
- public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) {
- byte[] ret = new byte[9];
- byteArrayDataInput.readFully(ret);
+ public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) {
return new CircuitProgrammerPacket(
- ByteBuffer.wrap(ret).getInt(0),
- ByteBuffer.wrap(ret).getInt(4),
- ByteBuffer.wrap(ret).get(8) > -1,
- ByteBuffer.wrap(ret).get(8));
+ byteArrayDataInput.readInt(),
+ byteArrayDataInput.readInt(),
+ byteArrayDataInput.readByte() > -1,
+ byteArrayDataInput.readByte());
}
@Override
@@ -73,7 +69,7 @@ public class CircuitProgrammerPacket extends GT_Packet {
World w = DimensionManager.getWorld(this.dimID);
if (w != null && w.getEntityByID(this.playerID) instanceof EntityPlayer) {
ItemStack stack = ((EntityPlayer) w.getEntityByID(this.playerID)).getHeldItem();
- if ((stack != null) && (stack.stackSize > 0)) {
+ if (stack != null && stack.stackSize > 0) {
Item item = stack.getItem();
if (item instanceof Circuit_Programmer) {
NBTTagCompound nbt = stack.getTagCompound();
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java
index 95a79e9344..621cc3fe4f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java
@@ -35,10 +35,10 @@ public class EICPacket extends GT_Packet_New {
@Override
public void encode(ByteBuf aOut) {
- aOut.writeInt(coords.x);
- aOut.writeInt(coords.y);
- aOut.writeInt(coords.z);
- aOut.writeBoolean(bool);
+ aOut.writeInt(this.coords.x);
+ aOut.writeInt(this.coords.y);
+ aOut.writeInt(this.coords.z);
+ aOut.writeBoolean(this.bool);
}
@Override
@@ -49,11 +49,12 @@ public class EICPacket extends GT_Packet_New {
@Override
public void process(IBlockAccess aWorld) {
if (SideReference.Side.Client) {
- TileEntity te = aWorld.getTileEntity(coords.x, coords.y, coords.z);
+ TileEntity te = aWorld.getTileEntity(this.coords.x, this.coords.y, this.coords.z);
if (!(te instanceof IGregTechTileEntity)) return;
IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity();
if (!(mte instanceof GT_TileEntity_ElectricImplosionCompressor)) return;
- if (bool && !((IGregTechTileEntity) te).hasMufflerUpgrade()) ((IGregTechTileEntity) te).addMufflerUpgrade();
+ if (this.bool && !((IGregTechTileEntity) te).hasMufflerUpgrade())
+ ((IGregTechTileEntity) te).addMufflerUpgrade();
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java
index 38fdf5ee9f..631021a299 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java
@@ -24,9 +24,10 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block
import com.github.bartimaeusnek.bartworks.util.MurmurHash3;
import com.google.common.io.ByteArrayDataInput;
-import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
+import io.netty.buffer.ByteBuf;
-public class MetaBlockPacket extends GT_Packet {
+public class MetaBlockPacket extends GT_Packet_New {
int x;
short y;
@@ -51,27 +52,23 @@ public class MetaBlockPacket extends GT_Packet {
}
@Override
- public byte[] encode() {
+ public void encode(ByteBuf aOut) {
int hash = MurmurHash3.murmurhash3_x86_32(
ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(),
0,
12,
31);
- return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash)
- .array();
+ aOut.writeInt(this.x).writeInt(this.z).writeShort(this.y).writeShort(this.meta).writeInt(hash);
}
@Override
- public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) {
- byte[] tmp = new byte[16];
- byteArrayDataInput.readFully(tmp);
- ByteBuffer buff = ByteBuffer.wrap(tmp);
- this.x = buff.getInt();
- this.z = buff.getInt();
- this.y = buff.getShort();
- this.meta = buff.getShort();
+ public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) {
+ this.x = byteArrayDataInput.readInt();
+ this.z = byteArrayDataInput.readInt();
+ this.y = byteArrayDataInput.readShort();
+ this.meta = byteArrayDataInput.readShort();
MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta);
- if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(
+ if (byteArrayDataInput.readInt() != MurmurHash3.murmurhash3_x86_32(
ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(),
0,
12,
@@ -86,10 +83,10 @@ public class MetaBlockPacket extends GT_Packet {
public void process(IBlockAccess iBlockAccess) {
if (iBlockAccess != null) {
TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z);
- if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) {
+ if (tTileEntity instanceof BW_MetaGenerated_Block_TE) {
((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData = this.meta;
}
- if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) {
+ if (iBlockAccess instanceof World && ((World) iBlockAccess).isRemote) {
((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java
index 5e03bf53d5..3ae70af18b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java
@@ -13,7 +13,6 @@
package com.github.bartimaeusnek.bartworks.common.net;
-import java.nio.ByteBuffer;
import java.util.HashSet;
import net.minecraft.world.IBlockAccess;
@@ -22,9 +21,10 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import com.github.bartimaeusnek.bartworks.util.Pair;
import com.google.common.io.ByteArrayDataInput;
-import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
+import io.netty.buffer.ByteBuf;
-public class OreDictCachePacket extends GT_Packet {
+public class OreDictCachePacket extends GT_Packet_New {
private HashSet<Pair<Integer, Short>> hashSet = new HashSet<>();
@@ -43,15 +43,16 @@ public class OreDictCachePacket extends GT_Packet {
}
@Override
- public byte[] encode() {
+ public void encode(ByteBuf aOut) {
int size = this.hashSet.size();
- ByteBuffer buff = ByteBuffer.allocate(4 + size * 4 + size * 2).putInt(size);
- for (Pair<Integer, Short> p : this.hashSet) buff.putInt(p.getKey()).putShort(p.getValue());
- return buff.array();
+ aOut.writeInt(size);
+ for (Pair<Integer, Short> p : this.hashSet) {
+ aOut.writeInt(p.getKey()).writeShort(p.getValue());
+ }
}
@Override
- public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) {
+ public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) {
int size = byteArrayDataInput.readInt();
for (int i = 0; i < size; i++) {
this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(), byteArrayDataInput.readShort()));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java
index c1dce75908..952a3eeeb3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java
@@ -13,8 +13,6 @@
package com.github.bartimaeusnek.bartworks.common.net;
-import java.nio.ByteBuffer;
-
import net.minecraft.world.IBlockAccess;
import com.github.bartimaeusnek.bartworks.API.SideReference;
@@ -24,9 +22,10 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
import com.github.bartimaeusnek.bartworks.util.Coords;
import com.google.common.io.ByteArrayDataInput;
-import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
+import io.netty.buffer.ByteBuf;
-public class RendererPacket extends GT_Packet {
+public class RendererPacket extends GT_Packet_New {
private Coords coords;
private int integer;
@@ -49,36 +48,26 @@ public class RendererPacket extends GT_Packet {
}
@Override
- public byte[] encode() {
+ public void encode(ByteBuf aOut) {
- byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE);
- byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE);
- byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE);
+ byte r = (byte) ((this.integer >> 16 & 0xFF) + Byte.MIN_VALUE);
+ byte g = (byte) ((this.integer >> 8 & 0xFF) + Byte.MIN_VALUE);
+ byte b = (byte) ((this.integer & 0xFF) + Byte.MIN_VALUE);
byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25
+ this.coords.z % 25
+ this.coords.wID % 25
+ this.integer % 25
+ this.removal);
- return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z)
- .putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum)
- .array();
+ aOut.writeInt(this.coords.x).writeShort(this.coords.y).writeInt(this.coords.z).writeInt(this.coords.wID)
+ .writeByte(r).writeByte(g).writeByte(b).writeByte(this.removal).writeByte(checksum);
}
@Override
- public GT_Packet decode(ByteArrayDataInput dataInput) {
-
- byte[] buffer = new byte[19];
- dataInput.readFully(buffer);
-
- this.coords = new Coords(
- ByteBuffer.wrap(buffer).getInt(0),
- ByteBuffer.wrap(buffer).getShort(4),
- ByteBuffer.wrap(buffer).getInt(6),
- ByteBuffer.wrap(buffer).getInt(10));
- int[] rgb = { ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE,
- ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE };
- this.integer = BW_ColorUtil.getColorFromRGBArray(rgb);
- this.removal = ByteBuffer.wrap(buffer).get(17);
+ public GT_Packet_New decode(ByteArrayDataInput dataInput) {
+ this.coords = new Coords(dataInput.readInt(), dataInput.readShort(), dataInput.readInt(), dataInput.readInt());
+ this.integer = BW_ColorUtil.getColorFromRGBArray(
+ new int[] { dataInput.readUnsignedByte(), dataInput.readUnsignedByte(), dataInput.readUnsignedByte() });
+ this.removal = dataInput.readByte();
byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25
+ this.coords.z % 25
@@ -86,7 +75,7 @@ public class RendererPacket extends GT_Packet {
+ this.integer % 25
+ this.removal);
- if (checksum != ByteBuffer.wrap(buffer).get(18)) {
+ if (checksum != dataInput.readByte()) {
MainMod.LOGGER.error("BW Packet was corrupted or modified!");
return null;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java
index 84c3ba8939..3a6734d568 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java
@@ -19,9 +19,10 @@ import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.google.common.io.ByteArrayDataInput;
-import gregtech.api.net.GT_Packet;
+import gregtech.api.net.GT_Packet_New;
+import io.netty.buffer.ByteBuf;
-public class ServerJoinedPackage extends GT_Packet {
+public class ServerJoinedPackage extends GT_Packet_New {
private byte config;
@@ -41,12 +42,12 @@ public class ServerJoinedPackage extends GT_Packet {
}
@Override
- public byte[] encode() {
- return new byte[] { this.config };
+ public void encode(ByteBuf aOut) {
+ aOut.writeByte(this.config);
}
@Override
- public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) {
+ public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) {
this.config = byteArrayDataInput.readByte();
return this;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java
index a437dc8285..5db8989d0c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java
@@ -29,6 +29,7 @@ public class BW_RotorBlock extends TileEntityWindKineticGenerator {
return super.getKuOutput();
}
+ @Override
public int getKuOutput() {
return 0;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java
index a04d70f6aa..9d6c03be7d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java
@@ -33,7 +33,7 @@ import com.github.bartimaeusnek.bartworks.util.Coords;
public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation {
- private static final ForgeDirection[] allowed_directions = new ForgeDirection[] { DOWN, WEST, EAST, SOUTH, NORTH };
+ private static final ForgeDirection[] allowed_directions = { DOWN, WEST, EAST, SOUTH, NORTH };
private PriorityQueue<Coords> breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y));
private boolean wasInited = false;
@@ -47,26 +47,26 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem
}
public void initEntity() {
- if (wasInited) return;
- breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord));
- wasInited = true;
+ if (this.wasInited) return;
+ this.breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord));
+ this.wasInited = true;
}
@Override
public void updateEntity() {
- initEntity();
- Coords current = breadthFirstQueue.poll();
+ this.initEntity();
+ Coords current = this.breadthFirstQueue.poll();
if (current == null) return;
- setFluidBlock(current);
+ this.setFluidBlock(current);
for (ForgeDirection allowed_direction : allowed_directions) {
- addBlockToQueue(current, allowed_direction);
+ this.addBlockToQueue(current, allowed_direction);
}
}
@Override
public void writeToNBT(NBTTagCompound tag) {
super.writeToNBT(tag);
- tag.setBoolean("init", wasInited);
+ tag.setBoolean("init", this.wasInited);
int[] x = new int[this.breadthFirstQueue.size()];
int[] y = new int[this.breadthFirstQueue.size()];
@@ -97,15 +97,16 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem
}
private void setFluidBlock(Coords current) {
- if (!checkForAir(current)) return;
- if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) return;
+ if (!this.checkForAir(current) || this.tank.drain(1000, false) == null
+ || this.tank.drain(1000, false).amount != 1000)
+ return;
FluidStack stack = this.tank.drain(1000, true);
- worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2);
+ this.worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2);
}
private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) {
Coords side = current.getCoordsFromSide(allowed_direction);
- if (checkForAir(side)) breadthFirstQueue.add(side);
+ if (this.checkForAir(side)) this.breadthFirstQueue.add(side);
}
private boolean checkForAir(Coords coords) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java
index c977453f68..98932b8d72 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java
@@ -64,30 +64,30 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
public ItemStack fakestack = new ItemStack(Blocks.water);
@Override
- public void writeToNBT(NBTTagCompound p_145841_1_) {
+ public void writeToNBT(NBTTagCompound compound) {
NBTTagCompound subItemStack = new NBTTagCompound();
if (this.fuelstack != null) {
this.fuelstack.writeToNBT(subItemStack);
}
- p_145841_1_.setTag("ItemStack", subItemStack);
+ compound.setTag("ItemStack", subItemStack);
NBTTagCompound subFluidStack = new NBTTagCompound();
this.outputstack.writeToNBT(subFluidStack);
- p_145841_1_.setTag("FluidStack", subFluidStack);
- p_145841_1_.setInteger("fuel", this.fuel);
- p_145841_1_.setInteger("maxfuel", this.maxfuel);
- p_145841_1_.setByte("tick", this.tick);
- super.writeToNBT(p_145841_1_);
+ compound.setTag("FluidStack", subFluidStack);
+ compound.setInteger("fuel", this.fuel);
+ compound.setInteger("maxfuel", this.maxfuel);
+ compound.setByte("tick", this.tick);
+ super.writeToNBT(compound);
}
@Override
- public void readFromNBT(NBTTagCompound p_145839_1_) {
- this.tick = p_145839_1_.getByte("tick");
- this.fuel = p_145839_1_.getInteger("fuel");
- this.maxfuel = p_145839_1_.getInteger("maxfuel");
- this.outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack"));
- if (!p_145839_1_.getCompoundTag("ItemStack").equals(new NBTTagCompound()))
- this.fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack"));
- super.readFromNBT(p_145839_1_);
+ public void readFromNBT(NBTTagCompound compound) {
+ this.tick = compound.getByte("tick");
+ this.fuel = compound.getInteger("fuel");
+ this.maxfuel = compound.getInteger("maxfuel");
+ this.outputstack = FluidStack.loadFluidStackFromNBT(compound.getCompoundTag("FluidStack"));
+ if (!compound.getCompoundTag("ItemStack").equals(new NBTTagCompound()))
+ this.fuelstack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("ItemStack"));
+ super.readFromNBT(compound);
}
private boolean checkPreUpdate() {
@@ -111,7 +111,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
++this.tick;
--this.fuel;
if (this.tick % 20 == 0) {
- if (this.outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec))
+ if (this.outputstack.amount <= 8000 - ConfigHandler.mbWaterperSec)
this.outputstack.amount += ConfigHandler.mbWaterperSec;
this.tick = 0;
}
@@ -122,14 +122,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
public void updateEntity() {
if (this.worldObj.isRemote) return;
- pushWaterToAdjacentTiles();
- fakestack.setStackDisplayName(outputstack.amount + "L Water");
- if (checkPreUpdate()) return;
+ this.pushWaterToAdjacentTiles();
+ this.fakestack.setStackDisplayName(this.outputstack.amount + "L Water");
+ if (this.checkPreUpdate()) return;
- fixUnderlflow();
- handleRefuel();
- handleWaterGeneration();
- causePollution();
+ this.fixUnderlflow();
+ this.handleRefuel();
+ this.handleWaterGeneration();
+ this.causePollution();
}
private void pushWaterToAdjacentTiles() {
@@ -141,20 +141,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
this.yCoord + direction.offsetY,
this.zCoord + direction.offsetZ))
.ifPresent(te -> {
- if (te instanceof IFluidHandler) {
- IFluidHandler tank = (IFluidHandler) te;
+ if (te instanceof IFluidHandler tank) {
if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) {
- int drainage;
- if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false))
- > 0) {
+ int drainage = tank.fill(direction.getOpposite(), this.outputstack, false);
+ if (drainage > 0) {
tank.fill(direction.getOpposite(), this.outputstack, true);
this.drain(drainage, true);
}
}
- } else if (te instanceof IFluidTank) {
- IFluidTank tank = (IFluidTank) te;
- int drainage;
- if ((drainage = tank.fill(this.outputstack, false)) > 0) {
+ } else if (te instanceof IFluidTank tank) {
+ int drainage = tank.fill(this.outputstack, false);
+ if (drainage > 0) {
tank.fill(this.outputstack, true);
this.drain(drainage, true);
}
@@ -192,9 +189,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
}
@Override
- public ItemStack getStackInSlot(int p_70301_1_) {
- if (p_70301_1_ == 0) return this.fuelstack;
- else return this.fakestack;
+ public ItemStack getStackInSlot(int slotIn) {
+ if (slotIn == 0) return this.fuelstack;
+ return this.fakestack;
}
@Override
@@ -207,14 +204,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
}
@Override
- public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ public ItemStack getStackInSlotOnClosing(int index) {
return null;
}
@Override
- public void setInventorySlotContents(int slot, ItemStack p_70299_2_) {
- if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = p_70299_2_;
- else this.fakestack = p_70299_2_;
+ public void setInventorySlotContents(int slot, ItemStack stack) {
+ if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = stack;
+ else this.fakestack = stack;
}
@Override
@@ -233,7 +230,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
}
@Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ public boolean isUseableByPlayer(EntityPlayer player) {
return true;
}
@@ -244,9 +241,8 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
public void closeInventory() {}
@Override
- public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
- return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0
- && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT;
+ public boolean isItemValidForSlot(int index, ItemStack stack) {
+ return TileEntityFurnace.getItemBurnTime(stack) > 0 && index == BW_TileEntity_HeatedWaterPump.FUELSLOT;
}
@Override
@@ -362,7 +358,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
new SlotWidget(invWrapper, 0).setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0)
.setPos(55, 52))
.widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)).widget(
- new ProgressBar().setProgress(() -> (float) fuel / maxfuel)
+ new ProgressBar().setProgress(() -> (float) this.fuel / this.maxfuel)
.setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14).setDirection(ProgressBar.Direction.UP)
.setPos(56, 36).setSize(14, 14));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java
index 32f214a941..d91b790596 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java
@@ -85,8 +85,8 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank
}
@Override
- public void writeToNBT(NBTTagCompound p_145841_1_) {
- super.writeToNBT(p_145841_1_);
+ public void writeToNBT(NBTTagCompound compound) {
+ super.writeToNBT(compound);
NBTTagList lInternalTank = new NBTTagList();
@@ -99,7 +99,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank
lInternalTank.appendTag(entry);
}
}
- p_145841_1_.setTag("InternalTank", lInternalTank);
+ compound.setTag("InternalTank", lInternalTank);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
index 2203b89aa8..3433464b49 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
@@ -151,7 +151,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
tt.addMachineType("Bacterial Vat").addInfo("Controller block for the Bacterial Vat")
.addInfo("For maximum efficiency boost keep the Output Hatch always half filled!").addSeparator()
.beginStructureBlock(5, 4, 5, false).addController("Front bottom center")
- .addCasingInfo("Clean Stainless Steel Casings", 19)
+ .addCasingInfoMin("Clean Stainless Steel Casings", 19, false)
.addOtherStructurePart("Glass", "Hollow two middle layers", 2)
.addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass")
.addStructureInfo("Some Recipes need more advanced Glass Types").addMaintenanceHatch("Any casing", 1)
@@ -218,9 +218,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private int calcMod(double x) {
- double y = (((double) this.getOutputCapacity()) / 2D), z = ConfigHandler.bioVatMaxParallelBonus;
+ double y = this.getOutputCapacity() / 2D, z = ConfigHandler.bioVatMaxParallelBonus;
- int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z));
+ int ret = MathUtils.ceilInt((-1D / y * Math.pow(x - y, 2D) + y) / y * z);
return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus);
}
@@ -231,23 +231,23 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
@NotNull
@Override
protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) {
- if (!BW_Util.areStacksEqualOrNull((ItemStack) recipe.mSpecialItems, getControllerSlot()))
+ if (!BW_Util.areStacksEqualOrNull(
+ (ItemStack) recipe.mSpecialItems,
+ GT_TileEntity_BioVat.this.getControllerSlot()))
return CheckRecipeResultRegistry.NO_RECIPE;
int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(recipe.mSpecialValue);
- mNeededSievert = conditions[3];
+ GT_TileEntity_BioVat.this.mNeededSievert = conditions[3];
- if (mGlassTier < conditions[0]) {
+ if (GT_TileEntity_BioVat.this.mGlassTier < conditions[0]) {
return CheckRecipeResultRegistry.insufficientMachineTier(conditions[0]);
}
if (conditions[2] == 0) {
- if (mSievert < mNeededSievert) {
- return ResultWrongSievert.insufficientSievert(mNeededSievert);
- }
- } else {
- if (mSievert != conditions[3]) {
- return ResultWrongSievert.wrongSievert(conditions[3]);
+ if (GT_TileEntity_BioVat.this.mSievert < GT_TileEntity_BioVat.this.mNeededSievert) {
+ return ResultWrongSievert.insufficientSievert(GT_TileEntity_BioVat.this.mNeededSievert);
}
+ } else if (GT_TileEntity_BioVat.this.mSievert != conditions[3]) {
+ return ResultWrongSievert.wrongSievert(conditions[3]);
}
return CheckRecipeResultRegistry.SUCCESSFUL;
@@ -261,14 +261,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
return result;
}
// We already made sure the recipe runs. Now the vat looks for as many "parallels" as it can do
- mExpectedMultiplier = getExpectedMultiplier(lastRecipe.getFluidOutput(0), true);
- mTimes = 1;
- for (int i = 1; i < mExpectedMultiplier; i++) {
- if (depleteInput(lastRecipe.mFluidInputs[0])) {
- mTimes++;
+ GT_TileEntity_BioVat.this.mExpectedMultiplier = GT_TileEntity_BioVat.this
+ .getExpectedMultiplier(this.lastRecipe.getFluidOutput(0), true);
+ GT_TileEntity_BioVat.this.mTimes = 1;
+ for (int i = 1; i < GT_TileEntity_BioVat.this.mExpectedMultiplier; i++) {
+ if (GT_TileEntity_BioVat.this.depleteInput(this.lastRecipe.mFluidInputs[0])) {
+ GT_TileEntity_BioVat.this.mTimes++;
}
}
- this.outputFluids[0].amount *= mTimes;
+ this.outputFluids[0].amount *= GT_TileEntity_BioVat.this.mTimes;
return result;
}
};
@@ -277,7 +278,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
@Override
protected void setupProcessingLogic(ProcessingLogic logic) {
super.setupProcessingLogic(logic);
- logic.setSpecialSlotItem(getControllerSlot());
+ logic.setSpecialSlotItem(this.getControllerSlot());
}
public FluidStack getStoredFluidOutputs() {
@@ -289,16 +290,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) {
if (aTileEntity == null) {
return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null || !(aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch)) {
+ return false;
} else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) {
- ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex);
- return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity);
- } else {
- return false;
- }
+ ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex);
+ return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity);
}
}
@@ -308,7 +306,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
this.mGlassTier = 0;
this.mCasing = 0;
- if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false;
return this.mCasing >= 19 && this.mRadHatches.size() <= 1
&& this.mOutputHatches.size() == 1
@@ -341,8 +339,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) {
- int xDir = getXDir();
- int zDir = getZDir();
+ int xDir = this.getXDir();
+ int zDir = this.getZDir();
GT_TileEntity_BioVat.staticColorMap.remove(
new Coords(
@@ -392,10 +390,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
if (!aWorld.isRemote) {
for (Object tObject : aWorld.playerEntities) {
- if (!(tObject instanceof EntityPlayerMP)) {
+ if (!(tObject instanceof EntityPlayerMP tPlayer)) {
break;
}
- EntityPlayerMP tPlayer = (EntityPlayerMP) tObject;
Chunk tChunk = aWorld.getChunkFromBlockCoords(
this.getBaseMetaTileEntity().getXCoord(),
this.getBaseMetaTileEntity().getZCoord());
@@ -413,9 +410,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private void placeFluid() {
- isVisibleFluid = true;
- int xDir = getXDir();
- int zDir = getZDir();
+ this.isVisibleFluid = true;
+ int xDir = this.getXDir();
+ int zDir = this.getZDir();
this.height = this.reCalculateHeight();
if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) {
for (int y = 0; y < this.height; y++) {
@@ -437,7 +434,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private void removeFluid(int xDir, int zDir) {
- isVisibleFluid = false;
+ this.isVisibleFluid = false;
for (int x = -1; x < 2; x++) {
for (int y = 1; y < 3; y++) {
@@ -468,9 +465,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private int reCalculateHeight() {
- return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1)
- ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2)
- : 1);
+ return this.reCalculateFluidAmmount() > this.getCapacity() / 4 - 1
+ ? this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2
+ : 1;
}
public void doAllVisualThings() {
@@ -478,8 +475,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
if (this.mMachine) {
ItemStack aStack = this.mInventory[1];
BioCulture lCulture = null;
- int xDir = getXDir();
- int zDir = getZDir();
+ int xDir = this.getXDir();
+ int zDir = this.getZDir();
if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) {
this.check_Chunk();
@@ -496,8 +493,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
this.height = this.reCalculateHeight();
if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) {
- if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate
- && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) {
+ if (!BW_Util.areStacksEqualOrNull(aStack, this.mStack) || this.needsVisualUpdate
+ && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) {
for (int x = -1; x < 2; x++) {
for (int y = 1; y < this.height; y++) {
for (int z = -1; z < 2; z++) {
@@ -541,11 +538,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert)
this.mOutputFluids = null;
}
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mMaxProgresstime <= 0) {
- this.mTimes = 0;
- this.mMaxProgresstime = 0;
- }
+ if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime <= 0) {
+ this.mTimes = 0;
+ this.mMaxProgresstime = 0;
}
}
@@ -567,13 +562,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
@Override
public void onRemoval() {
- if (isVisibleFluid) {
- int xDir = getXDir();
- int zDir = getZDir();
- removeFluid(xDir, zDir);
- sendRenderPackets(xDir, zDir);
+ if (this.isVisibleFluid) {
+ int xDir = this.getXDir();
+ int zDir = this.getZDir();
+ this.removeFluid(xDir, zDir);
+ this.sendRenderPackets(xDir, zDir);
} else if (this.getBaseMetaTileEntity().getWorld().getWorldTime() % 20 == 7) {
- sendRenderPackets();
+ this.sendRenderPackets();
}
super.onRemoval();
@@ -588,9 +583,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
}
private void sendRenderPackets() {
- int xDir = getXDir();
- int zDir = getZDir();
- sendRenderPackets(xDir, zDir);
+ int xDir = this.getXDir();
+ int zDir = this.getZDir();
+ this.sendRenderPackets(xDir, zDir);
}
private void sendRenderPackets(int xDir, int zDir) {
@@ -656,7 +651,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
@Override
public void construct(ItemStack itemStack, boolean b) {
- buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0);
}
@Override
@@ -668,13 +663,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa
// here we must check the machine is well-formed as otherwise getExpectedMultiplier might error out!
infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": "
+ EnumChatFormatting.GREEN
- + (mMachine ? (mMaxProgresstime <= 0 ? getExpectedMultiplier(null, false) : mExpectedMultiplier) * 100
+ + (this.mMachine
+ ? (this.mMaxProgresstime <= 0 ? this.getExpectedMultiplier(null, false)
+ : this.mExpectedMultiplier) * 100
: -1)
+ EnumChatFormatting.RESET
+ " %";
infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": "
+ EnumChatFormatting.GREEN
- + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100
+ + (this.mMaxProgresstime <= 0 ? 0 : this.mTimes) * 100
+ EnumChatFormatting.RESET
+ " %";
return infoData;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
index 28cc85941f..e3543a5332 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
@@ -117,6 +117,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends
return STRUCTURE_DEFINITION;
}
+ @Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Circuit Assembler").addInfo("Controller block for the Circuit Assembly Line")
@@ -191,7 +192,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public void loadNBTData(NBTTagCompound aNBT) {
this.type = aNBT.getCompoundTag("Type");
- imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type));
+ this.imprintedItemName = GT_LanguageManager
+ .getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type));
super.loadNBTData(aNBT);
}
@@ -220,12 +222,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@NotNull
@Override
public CheckRecipeResult checkProcessing() {
- if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(getControllerSlot()))
+ if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(this.getControllerSlot()))
return SimpleCheckRecipeResult.ofFailure("no_imprint");
- if (imprintedItemName == null || imprintedStack == null) {
- imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0);
- imprintedStack.setTagCompound(type);
- imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(imprintedStack);
+ if (this.imprintedItemName == null || this.imprintedStack == null) {
+ this.imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0);
+ this.imprintedStack.setTagCompound(this.type);
+ this.imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(this.imprintedStack);
}
return super.checkProcessing();
}
@@ -233,7 +235,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
protected void setupProcessingLogic(ProcessingLogic logic) {
super.setupProcessingLogic(logic);
- logic.setSpecialSlotItem(imprintedStack);
+ logic.setSpecialSlotItem(this.imprintedStack);
}
@Override
@@ -244,8 +246,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public ArrayList<ItemStack> getStoredInputs() {
ArrayList<ItemStack> rList = new ArrayList<>();
- for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
- tHatch.mRecipeMap = getRecipeMap();
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
+ tHatch.mRecipeMap = this.getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) {
@@ -262,19 +264,18 @@ public class GT_TileEntity_CircuitAssemblyLine extends
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
+ return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
} else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- } else {
- return false;
- }
+ return false;
}
}
@@ -282,17 +283,14 @@ public class GT_TileEntity_CircuitAssemblyLine extends
public boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null || !(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)) {
+ return false;
} else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- } else {
- return false;
- }
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
+ return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
}
}
@@ -325,15 +323,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public String[] getInfoData() {
- if (infoDataBuffer != null) return infoDataBuffer;
+ if (this.infoDataBuffer != null) return this.infoDataBuffer;
String[] oldInfo = super.getInfoData();
- infoDataBuffer = new String[oldInfo.length + 1];
- System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length);
- infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " "
+ this.infoDataBuffer = new String[oldInfo.length + 1];
+ System.arraycopy(oldInfo, 0, this.infoDataBuffer, 0, oldInfo.length);
+ this.infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " "
+ EnumChatFormatting.YELLOW
- + getTypeForDisplay();
- return infoDataBuffer;
+ + this.getTypeForDisplay();
+ return this.infoDataBuffer;
}
@Override
@@ -351,12 +349,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
}
+ @Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
if (!this.checkPiece(STRUCTURE_PIECE_FIRST, 0, 0, 0)) {
return false;
- } else {
- return this.checkMachine(true) || this.checkMachine(false);
}
+ return this.checkMachine(true) || this.checkMachine(false);
}
private boolean checkMachine(boolean leftToRight) {
@@ -384,14 +382,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int built;
- built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true);
+ built = this.survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true);
if (built >= 0) return built;
int tLength = Math.min(stackSize.stackSize + 1, 7);
for (int i = 1; i < tLength; ++i) {
- built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true);
+ built = this
+ .survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true);
if (built >= 0) return built;
}
return -1;
@@ -413,7 +412,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
super.addUIWidgets(builder, buildContext);
- builder.widget(new FakeSyncWidget.StringSyncer(() -> imprintedItemName, val -> imprintedItemName = val));
+ builder.widget(
+ new FakeSyncWidget.StringSyncer(() -> this.imprintedItemName, val -> this.imprintedItemName = val));
}
@Override
@@ -428,7 +428,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends
@Override
public boolean isRecipeLockingEnabled() {
- return imprintedItemName != null && !imprintedItemName.equals("");
+ return this.imprintedItemName != null && !"".equals(this.imprintedItemName);
}
@Override
@@ -447,7 +447,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
- String imprintedWith = getTypeForDisplay();
+ String imprintedWith = this.getTypeForDisplay();
if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java
index 532a3af1ff..c125d4150e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java
@@ -94,7 +94,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase {
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- String casings = getCasingBlockItem().get(0).getDisplayName();
+ String casings = this.getCasingBlockItem().get(0).getDisplayName();
tt.addMachineType("Geothermal Heat Pump").addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t")
.addInfo("Has 4 Modes, use the Screwdriver to change them:");
if (ConfigHandler.DEHPDirectSteam) {
@@ -110,14 +110,16 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase {
} else {
tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract")
.addInfo("Explodes when it runs out of Coolant").addInfo(
- "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20
+ "Heats up " + (long) (this.mTier * 24 * (double) GT_TileEntity_DEHP.nulearHeatMod) * 20
+ "L/s Coolant(minus 10% per Maintenance Problem)");
}
tt.addSeparator().beginStructureBlock(3, 7, 3, false).addController("Front bottom")
.addOtherStructurePart(casings, "form the 3x1x3 Base")
.addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)")
- .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top")
- .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing")
+ .addOtherStructurePart(
+ this.getFrameMaterial().mName + " Frame Boxes",
+ "Each pillar's side and 1x3x1 on top")
+ .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing")
.addInputBus("Mining Pipes, optional, any base casing").addInputHatch("Any base casing")
.addOutputHatch("Any base casing").toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS);
return tt;
@@ -191,6 +193,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase {
super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ);
}
+ @Override
protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
int yHead, int oldYHead) {
if (this.mMode == 3) {
@@ -202,53 +205,51 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase {
return true;
}
- if (tryLowerPipeState(false) != 0) {
- if (this.waitForPipes()) {
- return false;
- } else {
- if (this.mMode == 0) this.mMode = 1;
- if (ConfigHandler.DEHPDirectSteam) {
- if (this.mMode == 1) {
- long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L);
- long waterConsume = ((steamProduced + 160) / 160);
-
- if (this.getWaterFromHatches(false) - waterConsume > 0) {
- this.consumeFluid(FluidRegistry.WATER, waterConsume);
- this.addOutput(GT_ModHandler.getSteam(steamProduced));
- } else {
- this.explodeMultiblock();
- return false;
- }
- } else if (this.mMode == 2) {
- long steamProduced = (this.mTier * 300 * 2L * this.mEfficiency / 10000L);
- long waterConsume = ((steamProduced + 160) / 160);
-
- if (this.getWaterFromHatches(true) - waterConsume > 0) {
- this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume);
- this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced));
- } else {
- this.explodeMultiblock();
- return false;
- }
- }
+ if (this.tryLowerPipeState(false) == 0) {
+ return true;
+ }
+ if (this.waitForPipes()) {
+ return false;
+ }
+ if (this.mMode == 0) {
+ this.mMode = 1;
+ }
+ if (ConfigHandler.DEHPDirectSteam) {
+ if (this.mMode == 1) {
+ long steamProduced = this.mTier * 600 * 2L * this.mEfficiency / 10000L;
+ long waterConsume = (steamProduced + 160) / 160;
+
+ if (this.getWaterFromHatches(false) - waterConsume > 0) {
+ this.consumeFluid(FluidRegistry.WATER, waterConsume);
+ this.addOutput(GT_ModHandler.getSteam(steamProduced));
} else {
- if (this.mMode == 1 || this.mMode == 2) {
- long coolantConverted = (long) (this.mTier * 24
- * ((double) GT_TileEntity_DEHP.nulearHeatMod)
- * this.mEfficiency
- / 10000L);
- if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) {
- this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted);
- this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted));
- } else {
- this.explodeMultiblock();
- return false;
- }
- }
+ this.explodeMultiblock();
+ return false;
+ }
+ } else if (this.mMode == 2) {
+ long steamProduced = this.mTier * 300 * 2L * this.mEfficiency / 10000L;
+ long waterConsume = (steamProduced + 160) / 160;
+
+ if (this.getWaterFromHatches(true) - waterConsume > 0) {
+ this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume);
+ this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced));
+ } else {
+ this.explodeMultiblock();
+ return false;
}
}
- } else {
- return true;
+ } else if (this.mMode == 1 || this.mMode == 2) {
+ long coolantConverted = (long) (this.mTier * 24
+ * (double) GT_TileEntity_DEHP.nulearHeatMod
+ * this.mEfficiency
+ / 10000L);
+ if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) {
+ this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted);
+ this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted));
+ } else {
+ this.explodeMultiblock();
+ return false;
+ }
}
return true;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
index cd76fc7470..51683d2376 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
@@ -81,7 +81,6 @@ public class GT_TileEntity_ElectricImplosionCompressor
private final ArrayList<ChunkCoordinates> chunkCoordinates = new ArrayList<>(5);
private int mBlockTier = 0;
private int mCasing;
- private int mMaxHatchTier = 0;
public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -141,13 +140,13 @@ public class GT_TileEntity_ElectricImplosionCompressor
}
private Pair<Block, Integer> getTier(ItemStack trigger) {
- return tiers.get(Math.min(Math.max(trigger.stackSize, 1), tiers.size()) - 1);
+ return this.tiers.get(Math.min(Math.max(trigger.stackSize, 1), this.tiers.size()) - 1);
}
@Override
public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z,
ItemStack itemStack) {
- Pair<Block, Integer> tier = getTier(itemStack);
+ Pair<Block, Integer> tier = this.getTier(itemStack);
if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, tier.getKey(), tier.getValue());
return true;
}
@@ -155,7 +154,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
@Override
public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y,
int z, ItemStack itemStack) {
- Pair<Block, Integer> tier = getTier(itemStack);
+ Pair<Block, Integer> tier = this.getTier(itemStack);
if (te.piston) world.setBlock(x, y, z, tier.getKey(), tier.getValue(), 3);
else world.setBlockToAir(x, y, z);
return true;
@@ -175,14 +174,16 @@ public class GT_TileEntity_ElectricImplosionCompressor
}).build();
public static List<Pair<Block, Integer>> getAllBlockTiers() {
- return new ArrayList<Pair<Block, Integer>>() {
+ return new ArrayList<>() {
+
+ private static final long serialVersionUID = 8171991663102417651L;
{
- add(Pair.of(GregTech_API.sBlockMetal5, 2));
- add(Pair.of(LudicrousBlocks.resource_block, 1));
- add(Pair.of(GregTech_API.sBlockMetal9, 4));
- add(Pair.of(GregTech_API.sBlockMetal9, 3));
- add(Pair.of(GregTech_API.sBlockMetal9, 8));
+ this.add(Pair.of(GregTech_API.sBlockMetal5, 2));
+ this.add(Pair.of(LudicrousBlocks.resource_block, 1));
+ this.add(Pair.of(GregTech_API.sBlockMetal9, 4));
+ this.add(Pair.of(GregTech_API.sBlockMetal9, 3));
+ this.add(Pair.of(GregTech_API.sBlockMetal9, 8));
}
};
@@ -198,28 +199,27 @@ public class GT_TileEntity_ElectricImplosionCompressor
}
if (block == GregTech_API.sBlockMetal5 && meta == 2) {
return 1; // Neutronium
- } else if (block == LudicrousBlocks.resource_block && meta == 1) {
+ }
+ if (block == LudicrousBlocks.resource_block && meta == 1) {
return 2; // Infinity
- } else if (block == GregTech_API.sBlockMetal9) {
- switch (meta) {
- case 4: // Transcendent Metal
- return 3;
- case 3: // SpaceTime
- return 4;
- case 8: // Universium
- return 5;
- }
}
-
+ if (block == GregTech_API.sBlockMetal9) {
+ return switch (meta) {
+ case 4 -> 3; // Transcendent Metal
+ case 3 -> 4; // SpaceTime
+ case 8 -> 5; // Universium
+ default -> -1;
+ };
+ }
return -1;
}
private void setBlockTier(int tier) {
- mBlockTier = tier;
+ this.mBlockTier = tier;
}
private int getBlockTier() {
- return mBlockTier;
+ return this.mBlockTier;
}
@Override
@@ -242,7 +242,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
.addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium")
.addInfo("Minimum allowed energy hatch tier is one below recipe tier")
.addInfo("Supports " + TT + " energy hatches").addSeparator().beginStructureBlock(3, 9, 3, false)
- .addController("Front 3rd layer center").addCasingInfo("Solid Steel Machine Casing", 8)
+ .addController("Front 3rd layer center").addCasingInfoMin("Solid Steel Machine Casing", 8, false)
.addStructureInfo("Casings can be replaced with Explosion Warning Signs")
.addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8")
.addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8")
@@ -266,32 +266,33 @@ public class GT_TileEntity_ElectricImplosionCompressor
@Override
protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) {
// For overclocking we'll allow all power to be used
- return super.createOverclockCalculator(recipe).setEUt(getMaxInputEu()).setAmperage(1);
+ return super.createOverclockCalculator(recipe)
+ .setEUt(GT_TileEntity_ElectricImplosionCompressor.this.getMaxInputEu()).setAmperage(1);
}
- }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(mBlockTier - 1, 0)));
+ }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(this.mBlockTier - 1, 0)));
}
@Override
protected void setProcessingLogicPower(ProcessingLogic logic) {
- long amperage = getMaxInputAmps();
- long voltage = getAverageInputVoltage();
+ long amperage = this.getMaxInputAmps();
+ long voltage = this.getAverageInputVoltage();
// We allow one OC, if there is enough amperage, no matter which type of hatch is used
logic.setAvailableVoltage(amperage >= 4 ? voltage * 4 : voltage);
logic.setAvailableAmperage(amperage >= 4 ? amperage / 4 : amperage);
}
private void updateChunkCoordinates() {
- chunkCoordinates.clear();
+ this.chunkCoordinates.clear();
for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) {
- if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) {
- int[] abc = new int[] { x, -2, z + 1 };
- int[] xyz = new int[] { 0, 0, 0 };
+ if (Math.abs(x) != 1 || Math.abs(z) != 1) {
+ int[] abc = { x, -2, z + 1 };
+ int[] xyz = { 0, 0, 0 };
this.getExtendedFacing().getWorldOffset(abc, xyz);
xyz[0] += this.getBaseMetaTileEntity().getXCoord();
xyz[1] += this.getBaseMetaTileEntity().getYCoord();
xyz[2] += this.getBaseMetaTileEntity().getZCoord();
- chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2]));
+ this.chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2]));
}
}
}
@@ -299,7 +300,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
@Override
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
super.onFirstTick(aBaseMetaTileEntity);
- updateChunkCoordinates();
+ this.updateChunkCoordinates();
}
@Override
@@ -307,7 +308,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
super.onPostTick(aBaseMetaTileEntity, aTick);
if (pistonEnabled && aBaseMetaTileEntity.isActive() && aTick % 20 == 0) {
- if (aBaseMetaTileEntity.isClientSide()) animatePiston(aBaseMetaTileEntity);
+ if (aBaseMetaTileEntity.isClientSide()) this.animatePiston(aBaseMetaTileEntity);
else if (aBaseMetaTileEntity.hasMufflerUpgrade()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange(
aBaseMetaTileEntity.getWorld(),
new EICPacket(
@@ -325,7 +326,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
public void setExtendedFacing(ExtendedFacing newExtendedFacing) {
super.setExtendedFacing(newExtendedFacing); // Will call stopMachine
- updateChunkCoordinates();
+ this.updateChunkCoordinates();
}
@Override
@@ -333,6 +334,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
return true;
}
+ @Override
public void stopMachine() {
this.resetPiston();
super.stopMachine();
@@ -344,8 +346,8 @@ public class GT_TileEntity_ElectricImplosionCompressor
if (!aBaseMetaTileEntity.isServerSide()) return;
if (!this.piston) {
List<Pair<Block, Integer>> tiers = getAllBlockTiers();
- Pair<Block, Integer> tieredBlock = tiers.get(Math.min(mBlockTier, tiers.size()) - 1);
- chunkCoordinates.forEach(c -> {
+ Pair<Block, Integer> tieredBlock = tiers.get(Math.min(this.mBlockTier, tiers.size()) - 1);
+ this.chunkCoordinates.forEach(c -> {
// Don't replace real blocks in case user has placed something (e.g. tier upgrade)
if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) {
aBaseMetaTileEntity.getWorld()
@@ -361,7 +363,7 @@ public class GT_TileEntity_ElectricImplosionCompressor
IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
if (!aBaseMetaTileEntity.isServerSide()) return;
if (this.piston) {
- chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ));
+ this.chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ));
this.piston = !this.piston;
}
}
@@ -369,19 +371,19 @@ public class GT_TileEntity_ElectricImplosionCompressor
private void animatePiston(IGregTechTileEntity aBaseMetaTileEntity) {
if (!aBaseMetaTileEntity.getWorld().isRemote) return;
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient(
+ if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient(
sound,
10,
1f,
1f,
- chunkCoordinates.get(0).posX,
- chunkCoordinates.get(0).posY,
- chunkCoordinates.get(0).posZ);
- spawnVisualPistonBlocks(
+ this.chunkCoordinates.get(0).posX,
+ this.chunkCoordinates.get(0).posY,
+ this.chunkCoordinates.get(0).posZ);
+ this.spawnVisualPistonBlocks(
aBaseMetaTileEntity.getWorld(),
- chunkCoordinates.get(2).posX,
- chunkCoordinates.get(2).posY,
- chunkCoordinates.get(2).posZ,
+ this.chunkCoordinates.get(2).posX,
+ this.chunkCoordinates.get(2).posY,
+ this.chunkCoordinates.get(2).posZ,
10);
}
@@ -406,23 +408,22 @@ public class GT_TileEntity_ElectricImplosionCompressor
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) {
this.mCasing = 0;
- this.mMaxHatchTier = 0;
- setBlockTier(0);
- boolean isOK = checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0);
+ int mMaxHatchTier = 0;
+ this.setBlockTier(0);
+ boolean isOK = this.checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0);
- List<GT_MetaTileEntity_Hatch> energyHatches = getExoticAndNormalEnergyHatchList();
+ List<GT_MetaTileEntity_Hatch> energyHatches = this.getExoticAndNormalEnergyHatchList();
for (GT_MetaTileEntity_Hatch hatch : energyHatches) {
mMaxHatchTier = Math.max(mMaxHatchTier, hatch.mTier);
}
isOK = isOK && this.mMaintenanceHatches.size() == 1 && energyHatches.size() >= 1;
if (isOK) {
- activatePiston();
+ this.activatePiston();
return true;
- } else {
- resetPiston();
- return false;
}
+ this.resetPiston();
+ return false;
}
@Override
@@ -468,13 +469,13 @@ public class GT_TileEntity_ElectricImplosionCompressor
@Override
public void construct(ItemStack itemStack, boolean b) {
- buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
- if (mMachine) return -1;
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true);
+ if (this.mMachine) return -1;
+ return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
index bc825fbdbf..8e6bcc85d9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
@@ -181,7 +181,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
"Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)")
.addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 1 hour")
.addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center")
- .addCasingInfo("Europium Reinforced Radiation Proof Casings", 500)
+ .addCasingInfoMin("Europium Reinforced Radiation Proof Casings", 500, false)
.addStructureInfo("Corners and the 2 touching blocks are air (cylindric)")
.addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2)
.addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1)
@@ -197,19 +197,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece("main", stackSize, hintsOnly, 5, 11, 0);
+ this.buildPiece("main", stackSize, hintsOnly, 5, 11, 0);
}
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) {
this.mCasing = 0;
- return (checkPiece("main", 5, 11, 0) && this.mCasing >= 500
+ return this.checkPiece("main", 5, 11, 0) && this.mCasing >= 500
&& this.mMaintenanceHatches.size() == 1
&& this.mInputHatches.size() > 0
&& this.mOutputHatches.size() > 0
&& this.mInputBusses.size() > 0
&& this.mOutputBusses.size() > 0
- && this.mEnergyHatches.size() > 0);
+ && this.mEnergyHatches.size() > 0;
}
@Override
@@ -248,13 +248,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
if (this.fuelsupply < maxcapacity) {
- startRecipeProcessing();
+ this.startRecipeProcessing();
for (ItemStack itemStack : this.getStoredInputs()) {
int type = -1;
- if (itemStack == null) continue;
- if (itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue;
+ if (itemStack == null || itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue;
int damage = HTGRMaterials.aHTGR_Materials.getDamage(itemStack);
- if (!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1))
+ if ((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL != HTGRMaterials.USABLE_FUEL_INDEX + 1)
continue; // is fuel
type = damage / HTGRMaterials.MATERIALS_PER_FUEL;
if (this.fueltype == -1) this.fueltype = type;
@@ -264,7 +263,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
itemStack.stackSize -= toget;
updateneeded = true;
}
- endRecipeProcessing();
+ this.endRecipeProcessing();
}
if (updateneeded) this.updateSlots();
}
@@ -281,36 +280,36 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
return false;
}
- if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false;
+ if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false;
double eff = Math.min(Math.pow((double) this.fuelsupply / (double) mincapacity, 2D), 100D) / 100D
- - ((double) (getIdealStatus() - getRepairStatus()) / 10D);
+ - (this.getIdealStatus() - this.getRepairStatus()) / 10D;
if (eff <= 0) return false;
- int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.025D * eff);
+ int toReduce = MathUtils.floorInt(this.fuelsupply * 0.025D * eff);
final int originalToReduce = toReduce;
int burnedballs = toReduce / 64;
if (burnedballs > 0) toReduce -= burnedballs * 64;
- int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX;
+ int meta = this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL + HTGRMaterials.BURNED_OUT_FUEL_INDEX;
- ItemStack[] toOutput = new ItemStack[] { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta),
+ ItemStack[] toOutput = { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta),
new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) };
- if (!canOutputAll(toOutput)) return false;
+ if (!this.canOutputAll(toOutput)) return false;
this.fuelsupply -= originalToReduce;
this.mOutputItems = toOutput;
// this.updateSlots(); // not needed ?
- this.coolanttaking = (int) (4000D * (((this.fueltype * 0.5D) + 1)) * eff);
+ this.coolanttaking = (int) (4000D * (this.fueltype * 0.5D + 1) * eff);
this.mEfficiency = (int) (eff * 10000D);
this.mEfficiencyIncrease = 0;
this.mEUt = -powerUsage;
- this.mMaxProgresstime = (int) (72000 * (1d - (eff / 2d)));
+ this.mMaxProgresstime = (int) (72000 * (1d - eff / 2d));
return true;
}
@@ -318,11 +317,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
@Override
public boolean onRunningTick(ItemStack aStack) {
- runningtick++;
+ this.runningtick++;
if (this.empty) {
- if (emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0) {
- emptyticksnodiff++;
+ if (this.emptyticksnodiff > 20 && this.emptyticksnodiff % 20 != 0) {
+ this.emptyticksnodiff++;
return true;
}
if (this.HeliumSupply > 0) {
@@ -333,7 +332,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
ItemStack iStack = new ItemStack(
HTGRMaterials.aHTGR_Materials,
this.fuelsupply,
- (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX);
+ HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype + HTGRMaterials.USABLE_FUEL_INDEX);
boolean storedAll = false;
for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
if (!isValidMetaTileEntity(tHatch)) continue;
@@ -343,10 +342,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
if (!storedAll) {
- if (this.fuelsupply == iStack.stackSize) emptyticksnodiff++;
+ if (this.fuelsupply == iStack.stackSize) this.emptyticksnodiff++;
else {
this.fuelsupply = iStack.stackSize;
- emptyticksnodiff = 0;
+ this.emptyticksnodiff = 0;
}
} else {
this.fuelsupply = 0;
@@ -357,13 +356,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
return true;
}
// USE DA POWAH
- if (!drainEnergyInput(-mEUt)) {
- criticalStopMachine();
+ if (!this.drainEnergyInput(-this.mEUt)) {
+ this.criticalStopMachine();
return false;
}
- if (runningtick % 20 == 0) {
- int takecoolant = coolanttaking;
+ if (this.runningtick % 20 == 0) {
+ int takecoolant = this.coolanttaking;
int drainedamount = 0;
for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
@@ -378,7 +377,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
- if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount));
+ if (drainedamount > 0) this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount));
this.updateSlots();
@@ -420,12 +419,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
+ GT_Utility.formatNumbers(this.mMaxProgresstime / 20)
+ "s",
"Fuel type:",
- (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"),
+ this.fueltype == -1 ? "NONE" : "TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish + ")",
"Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:",
GT_Utility.formatNumbers(this.HeliumSupply) + "L / "
+ GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED)
+ "L",
- "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", "Problems:",
+ "Coolant:", GT_Utility.formatNumbers(this.coolanttaking) + "L/s", "Problems:",
String.valueOf(this.getIdealStatus() - this.getRepairStatus()) };
}
@@ -479,7 +478,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- if (tooltip.containsKey(getDamage(p_77624_1_))) aList.add(tooltip.get(getDamage(p_77624_1_)));
+ if (this.tooltip.containsKey(this.getDamage(p_77624_1_)))
+ aList.add(this.tooltip.get(this.getDamage(p_77624_1_)));
aList.add("Material for High Temperature Gas-cooled Reactor");
super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
}
@@ -532,7 +532,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
- public static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"),
+ public static final Base_[] sHTGR_Bases = { new Base_("HTGRFuelMixture", "HTGR fuel mixture"),
new Base_("BISOPebbleCompound", "BISO pebble compound"),
new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"),
new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"),
@@ -540,7 +540,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
public static final int MATERIALS_PER_FUEL = sHTGR_Bases.length;
static final int USABLE_FUEL_INDEX = 4;
static final int BURNED_OUT_FUEL_INDEX = 5;
- public static final Fuel_[] sHTGR_Fuel = new Fuel_[] {
+ public static final Fuel_[] sHTGR_Fuel = {
new Fuel_(
"Thorium",
"Thorium",
@@ -586,7 +586,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
new LangEntry_(
"item." + sHTGR_Materials[i] + ".name",
base.sEnglish + " (" + fuel.sEnglish + ")"));
- if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null
+ if ((i + 1) % MATERIALS_PER_FUEL == USABLE_FUEL_INDEX + 1 && fuel.tooltip != null
&& !fuel.tooltip.isEmpty())
tooltip.put(i, fuel.tooltip);
i++;
@@ -603,7 +603,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
public static void register_fake_THR_Recipes() {
int i = 0;
- for (Fuel_ fuel : sHTGR_Fuel) {
+ for (@SuppressWarnings("unused")
+ Fuel_ fuel : sHTGR_Fuel) {
fakeRecipeMap.addFakeRecipe(
false,
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
index 04eb969a8c..113a9023a7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
@@ -70,7 +70,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
private static final ITexture[][] iTextures = new ITexture[4][1];
public ConnectedBlocksChecker connectedcells;
public final ItemStack[] circuits = new ItemStack[5];
- private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(circuits) {
+ private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(this.circuits) {
@Override
public int getSlotLimit(int slot) {
@@ -100,7 +100,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
@Override
public long maxEUStore() {
- return (this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0) ? Long.MAX_VALUE - 1 : this.mStorage;
+ return this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0 ? Long.MAX_VALUE - 1 : this.mStorage;
}
@Override
@@ -179,6 +179,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
return e.toArray(new String[0]);
}
+ @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister aBlockIconRegister) {
@@ -216,7 +217,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
int aColorIndex, boolean aActive, boolean aRedstone) {
- ITexture[] ret = new ITexture[0];
+ ITexture[] ret = {};
if (this.isClientSide()) {
@@ -251,15 +252,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
- public ItemStack getStackInSlot(int p_70301_1_) {
- if (p_70301_1_ > 1) return this.circuits[(p_70301_1_ - 2)];
- return this.mInventory[p_70301_1_];
+ public ItemStack getStackInSlot(int slotIn) {
+ if (slotIn > 1) return this.circuits[slotIn - 2];
+ return this.mInventory[slotIn];
}
@Override
- public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
- if (p_70299_1_ < 2) this.mInventory[p_70299_1_] = p_70299_2_;
- else this.circuits[(p_70299_1_ - 2)] = p_70299_2_;
+ public void setInventorySlotContents(int index, ItemStack stack) {
+ if (index < 2) this.mInventory[index] = stack;
+ else this.circuits[index - 2] = stack;
}
@Override
@@ -278,20 +279,17 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ public boolean isUseableByPlayer(EntityPlayer player) {
return true;
}
@Override
- public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ public boolean isItemValidForSlot(int index, ItemStack stack) {
- switch (p_94041_1_) {
- case 0:
- case 1:
- return true;
- default:
- return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem());
- }
+ return switch (index) {
+ case 0, 1 -> true;
+ default -> stack != null && stack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem());
+ };
}
@Override
@@ -386,8 +384,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
}
this.mEfficiency = this.getMaxEfficiency(null);
- this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1
- || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1
+ this.mStorage = ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1
+ || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0 ? Long.MAX_VALUE - 1
: ConfigHandler.energyPerCell * this.connectedcells.hashset.size();
this.mMaxProgresstime = 1;
this.mProgresstime = 0;
@@ -407,7 +405,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
if (finishedTime - startingTime > 5000000) MainMod.LOGGER.warn(
"LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime)
+ "ns / "
- + ((finishedTime - startingTime) / 1000000)
+ + (finishedTime - startingTime) / 1000000
+ "ms) Owner:"
+ this.getBaseMetaTileEntity().getOwnerName()
+ " Check at x:"
@@ -456,29 +454,30 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(118, 67))
- .widget(new SlotWidget(new BaseSlot(inventoryHandler, 1) {
+ .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 1) {
@Override
public int getSlotStackLimit() {
return 1;
}
- }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13))
- .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) {
+ }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13))
+ .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 0) {
@Override
public int getSlotStackLimit() {
return 1;
}
- }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER).setPos(127, 49));
+ }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER)
+ .setPos(127, 49));
for (int i = 0; i < 4; i++) {
builder.widget(
- new SlotWidget(circuitsInventoryHandler, i)
- .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT)
- .setPos(151, 4 + i * 18));
+ new SlotWidget(this.circuitsInventoryHandler, i).setBackground(
+ this.getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(151, 4 + i * 18));
}
final DynamicPositionedColumn screenElements = new DynamicPositionedColumn();
- drawTexts(screenElements);
+ this.drawTexts(screenElements);
builder.widget(screenElements);
builder.widget(
@@ -486,8 +485,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
.widget(
new ProgressBar()
.setProgress(
- () -> (float) getBaseMetaTileEntity().getStoredEU()
- / getBaseMetaTileEntity().getEUCapacity())
+ () -> (float) this.getBaseMetaTileEntity().getStoredEU()
+ / this.getBaseMetaTileEntity().getEUCapacity())
.setDirection(ProgressBar.Direction.RIGHT)
.setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116).setPos(8, 73)
.setSize(116, 5));
@@ -498,40 +497,39 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
screenElements
.widget(
- TextWidget
- .dynamicString(
- () -> "EU: " + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU()))
- .setDefaultColor(COLOR_TEXT_WHITE.get()))
+ TextWidget.dynamicString(
+ () -> "EU: " + GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU()))
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()))
.widget(
TextWidget.dynamicString(
- () -> "MAX: " + (getBaseMetaTileEntity().isActive()
- ? GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage())
+ () -> "MAX: " + (this.getBaseMetaTileEntity().isActive()
+ ? GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage())
+ String.valueOf(ConfigHandler.energyPerCell).substring(1)
: Integer.toString(0)))
- .setDefaultColor(COLOR_TEXT_WHITE.get()))
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()))
.widget(
TextWidget
.dynamicString(
- () -> "MAX EU/t IN: "
- + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputVoltage()))
- .setDefaultColor(COLOR_TEXT_WHITE.get()))
+ () -> "MAX EU/t IN: " + GT_Utility
+ .formatNumbers(this.getBaseMetaTileEntity().getInputVoltage()))
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()))
.widget(
TextWidget
.dynamicString(
- () -> "EU/t OUT: "
- + GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage()))
- .setDefaultColor(COLOR_TEXT_WHITE.get()))
+ () -> "EU/t OUT: " + GT_Utility
+ .formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage()))
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()))
.widget(
TextWidget
.dynamicString(
- () -> "AMP/t IN/OUT: "
- + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputAmperage()))
- .setDefaultColor(COLOR_TEXT_WHITE.get()))
+ () -> "AMP/t IN/OUT: " + GT_Utility
+ .formatNumbers(this.getBaseMetaTileEntity().getInputAmperage()))
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()))
.widget(
new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB())
- .setEnabled(widget -> maxEUStore() >= Long.MAX_VALUE - 1))
+ .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1))
.widget(
new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB())
- .setEnabled(widget -> !getBaseMetaTileEntity().isActive()));
+ .setEnabled(widget -> !this.getBaseMetaTileEntity().isActive()));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
index 49e175a136..6c8f5e8b76 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
@@ -98,8 +98,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) {
if (world.isAirBlock(x, y, z)) return true;
TileEntity tileEntity = world.getTileEntity(x, y, z);
- if (tileEntity == null) return true;
- if (!(tileEntity instanceof IGregTechTileEntity)) return true;
+ if (tileEntity == null || !(tileEntity instanceof IGregTechTileEntity)) return true;
IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo
|| mte instanceof GT_MetaTileEntity_Hatch_Energy) {
@@ -108,7 +107,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
== intier + (te.upstep ? te.mTiers : -te.mTiers)) {
te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX);
return true;
- } else return false;
+ }
+ return false;
}
return true;
}
@@ -135,7 +135,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
.addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)")
.addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)").addSeparator()
.beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false).addController("Front bottom center")
- .addCasingInfo("MV Machine Casing", 0)
+ .addCasingInfoMin("MV Machine Casing", 0, false)
.addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed")
.addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks")
.addMaintenanceHatch("Any bottom layer casing", 1).addEnergyHatch("Any bottom layer casing", 1)
@@ -177,10 +177,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
}
return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(
- this.getInputTier() * 2
- * this.mEnergyHatches.size()
- * (long) this.mEfficiency
- / this.getMaxEfficiency(null));
+ this.getInputTier() * 2 * this.mEnergyHatches.size() * this.mEfficiency / this.getMaxEfficiency(null));
}
public boolean onRunningTickTabbedMode() {
@@ -188,11 +185,11 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
for (GT_MetaTileEntity_Hatch_Dynamo E : this.mDynamoHatches) {
for (GT_MetaTileEntity_Hatch_Energy I : this.mEnergyHatches) {
- long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0;
+ long vtt = I.getEUVar() >= V[E.mTier] / 2 && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0;
if (vtt == 0) continue;
- long vtp = E.getEUVar() + (vtt);
+ long vtp = E.getEUVar() + vtt;
long avt = Math.min(vtp, E.maxEUStore());
E.setEUVar(avt);
I.setEUVar(I.getEUVar() - vtt);
@@ -202,16 +199,18 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
return ret;
}
+ @Override
public long getInputTier() {
if (this.mEnergyHatches.size() > 0)
return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage());
- else return 0L;
+ return 0L;
}
+ @Override
public long getOutputTier() {
if (this.mDynamoHatches.size() > 0)
return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage());
- else return 0L;
+ return 0L;
}
@Override
@@ -240,9 +239,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
this.upstep = this.mode % 2 == 0;
boolean tapmode = this.mode > 1;
- if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false;
-
- if (this.mEnergyHatches.size() == 0) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0) || this.mEnergyHatches.size() == 0) return false;
byte intier = this.mEnergyHatches.get(0).mTier;
for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) if (in.mTier != intier) return false;
@@ -251,13 +248,13 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
for (mHeight = 1; mHeight <= 8; mHeight++) {
if (tapmode) {
this.mTiers = mHeight;
- if (!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break;
- } else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break;
+ if (!this.checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break;
+ } else if (!this.checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break;
}
- if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false;
this.mTiers = mHeight - 1;
- if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false;
+ if (this.mDynamoHatches.size() == 0 || this.mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false;
byte outtier = this.mDynamoHatches.get(0).mTier;
for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) {
@@ -331,11 +328,11 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl
else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage());
int mHeight = Math.min(itemStack.stackSize, 8);
boolean tapmode = this.mode > 1;
- buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0);
+ this.buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0);
for (int i = 0; i < mHeight; i++) {
- if (tapmode) buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1);
- else buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0);
+ if (tapmode) this.buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1);
+ else this.buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0);
}
- buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0);
+ this.buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java
index 0bec36aca3..89f27cf41e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java
@@ -152,7 +152,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
.addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency")
.addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t")
.addInfo("One Operation takes 9 hours").addSeparator().beginStructureBlock(11, 12, 11, true)
- .addController("Front bottom center").addCasingInfo("Radiation Proof Casings", 500)
+ .addController("Front bottom center").addCasingInfoMin("Radiation Proof Casings", 500, false)
.addStructureInfo("Corners and the 2 touching blocks are air (cylindric)")
.addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2)
.addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1)
@@ -168,19 +168,19 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 5, 11, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 5, 11, 0);
}
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) {
this.mCasing = 0;
- return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500
+ return this.checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500
&& this.mMaintenanceHatches.size() == 1
&& this.mInputHatches.size() > 0
&& this.mOutputHatches.size() > 0
&& this.mInputBusses.size() > 0
&& this.mOutputBusses.size() > 0
- && this.mEnergyHatches.size() > 0);
+ && this.mEnergyHatches.size() > 0;
}
@Override
@@ -217,7 +217,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
if (this.fuelsupply < maxcapacity) {
- startRecipeProcessing();
+ this.startRecipeProcessing();
for (ItemStack itemStack : this.getStoredInputs()) {
if (GT_Utility.areStacksEqual(
itemStack,
@@ -228,7 +228,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
this.fuelsupply += toget;
}
}
- endRecipeProcessing();
+ this.endRecipeProcessing();
this.updateSlots();
}
}
@@ -245,14 +245,14 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
return false;
}
- if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false;
+ if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false;
- double eff = Math.min(
- Math.pow((double) (this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1,
- 100D) / 100D - ((double) (getIdealStatus() - getRepairStatus()) / 10D);
+ double eff = Math
+ .min(Math.pow((this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, 100D)
+ / 100D - (this.getIdealStatus() - this.getRepairStatus()) / 10D;
if (eff <= 0D) return false;
- int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff);
+ int toReduce = MathUtils.floorInt(this.fuelsupply * 0.005D * eff);
final int originalToReduce = toReduce;
int burnedballs = toReduce / 64;
@@ -260,9 +260,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX;
- ItemStack[] toOutput = new ItemStack[] { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta),
+ ItemStack[] toOutput = { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta),
new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) };
- if (!canOutputAll(toOutput)) return false;
+ if (!this.canOutputAll(toOutput)) return false;
this.fuelsupply -= originalToReduce;
this.mOutputItems = toOutput;
@@ -291,7 +291,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
if (!super.onRunningTick(aStack)) return false;
- int takecoolant = coolanttaking;
+ int takecoolant = this.coolanttaking;
int drainedamount = 0;
for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
@@ -306,7 +306,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
}
}
- if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount));
+ if (drainedamount > 0) this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount));
this.updateSlots();
@@ -352,7 +352,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase
GT_Utility.formatNumbers(this.HeliumSupply) + "L / "
+ GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED)
+ "L",
- "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t",
+ "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : this.coolanttaking) + "L/t",
"Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) };
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java
index 3137d91e4e..26d7ed3d01 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java
@@ -32,6 +32,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityDispenser;
@@ -74,7 +75,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.modularui.IGetTitleColor;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
-import gregtech.api.objects.XSTR;
+import gregtech.api.objects.ItemData;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_OreDictUnificator;
@@ -89,7 +90,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
private static final IIconContainer[] iIconContainers = new IIconContainer[2];
private static final ITexture[] iTextures = new ITexture[3];
- private static final XSTR localRandomInstance = new XSTR();
private BW_RotorBlock rotorBlock;
private int mDoor = 0;
private int mHardenedClay = 0;
@@ -137,13 +137,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
@Override
public boolean check(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x,
int y, int z) {
- return delegate.check(gt_tileEntity_windmill, world, x, y, z);
+ return this.delegate.check(gt_tileEntity_windmill, world, x, y, z);
}
@Override
public boolean spawnHint(GT_TileEntity_Windmill gt_tileEntity_windmill, World world,
int x, int y, int z, ItemStack trigger) {
- return delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger);
+ return this.delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger);
}
})))
.addElement('b', ofBlock(Blocks.brick_block, 0))
@@ -195,7 +195,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
.addInfo("The structure is too complex!")
.addInfo("Follow the StructureLib hologram projector to build the main structure.").addSeparator()
.beginStructureBlock(7, 12, 7, false).addController("Front bottom center")
- .addCasingInfo("Hardened Clay block", 40).addOtherStructurePart("Dispenser", "Any Hardened Clay block")
+ .addCasingInfoMin("Hardened Clay block", 40, false)
+ .addOtherStructurePart("Dispenser", "Any Hardened Clay block")
.addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block")
.addStructureHint("Primitive Kinetic Shaftbox", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS);
return tt;
@@ -211,7 +212,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower();
- if (!rotorBlock.rotorSlot.isEmpty()) this.setRotorDamage(rotorBlock, this.rotorBlock.getGrindPower());
+ if (!this.rotorBlock.rotorSlot.isEmpty()) this.setRotorDamage(this.rotorBlock, this.rotorBlock.getGrindPower());
return this.rotorBlock.getGrindPower() > 0;
}
@@ -228,47 +229,51 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
private float[] multiplierRecipe(ItemStack itemStack) {
// will return max and min value of the multiplier, the average of these is used to calculate the multiplier.
- if (itemStack.getItem().equals(Items.wheat)) return new float[] { 1.13f, 1.5f };
- else if (itemStack.getItem().equals(Items.bone)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin))
+ final Item item = itemStack.getItem();
+ if (item == Items.wheat) {
+ return new float[] { 1.13f, 1.5f };
+ }
+ final Block block = Block.getBlockFromItem(item);
+ if (item == Items.bone || block == Blocks.glowstone || block == Blocks.pumpkin) {
return new float[] { 0.8f, 1f };
- else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)
- || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2))
+ }
+ if (block == Blocks.gravel || block == Blocks.cobblestone
+ || block == Blocks.stone
+ || block == Blocks.sandstone
+ || block == Blocks.clay
+ || block == Blocks.hardened_clay
+ || block == Blocks.stained_hardened_clay
+ || block == Blocks.wool
+ || block == Blocks.netherrack
+ || block == Blocks.log
+ || block == Blocks.log2) {
return new float[] { 1f, 1.5f };
- else if (GT_OreDictUnificator.getAssociation(itemStack) == null
- || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null
- || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null
- || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null
- || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null)
+ }
+ final ItemData association = GT_OreDictUnificator.getAssociation(itemStack);
+ final OrePrefixes prefix = association == null ? null : association.mPrefix;
+ if (prefix == null || association.mMaterial == null
+ || association.mMaterial.mMaterial == null
+ || association.mMaterial.mMaterial.getDust(1) == null) {
return new float[] { 1f, 1f };
- else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreBlackgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix))
+ }
+ if (OrePrefixes.ore == prefix || OrePrefixes.oreNetherrack == prefix
+ || OrePrefixes.oreEndstone == prefix
+ || OrePrefixes.oreBlackgranite == prefix
+ || OrePrefixes.oreRedgranite == prefix
+ || OrePrefixes.oreMarble == prefix
+ || OrePrefixes.oreBasalt == prefix) {
return new float[] { 0.5f, 1f };
- else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
- || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix))
+ }
+ if (OrePrefixes.stone == prefix || OrePrefixes.stoneBricks == prefix
+ || OrePrefixes.stoneChiseled == prefix
+ || OrePrefixes.stoneCobble == prefix
+ || OrePrefixes.stoneCracked == prefix
+ || OrePrefixes.stoneMossy == prefix
+ || OrePrefixes.stoneMossyBricks == prefix
+ || OrePrefixes.stoneSmooth == prefix
+ || OrePrefixes.cobblestone == prefix) {
return new float[] { 1f, 1.5f };
+ }
return new float[] { 1f, 1f };
}
@@ -294,13 +299,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
}
this.updateSlots();
this.mOutputItems[0] = tRecipe.getOutput(0);
- float[] mRecipe = multiplierRecipe(itemStack);
+ float[] mRecipe = this.multiplierRecipe(itemStack);
float multiper = Math.min(
mRecipe[1],
Math.max(
mRecipe[0],
- 2f * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1)))
- * OutputMultiplier(rotorBlock)
+ 2f * (float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))
+ * this.OutputMultiplier(this.rotorBlock)
* (mRecipe[0] + mRecipe[1])));
int amount = (int) Math.floor(multiper * (this.mOutputItems[0].stackSize * this.mMulti));
@@ -315,16 +320,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
ItemStack tmp = this.mOutputItems[0].copy();
tmp.stackSize = amount;
splitStacks.add(tmp);
- mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]);
+ this.mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]);
}
- this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / getSpeed(rotorBlock);
+ this.mMaxProgresstime = tRecipe.mDuration * 2 * 100 * this.mMulti / this.getSpeed(this.rotorBlock);
this.mMulti = 16;
return true;
}
@Override
public void stopMachine() {
- getBaseMetaTileEntity().disableWorking();
+ this.getBaseMetaTileEntity().disableWorking();
}
public boolean addDispenserToOutputSet(TileEntity aTileEntity) {
@@ -343,7 +348,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
return false;
}
- @SuppressWarnings("ALL")
@Override
public boolean addOutput(ItemStack aStack) {
if (GT_Utility.isStackInvalid(aStack)) return false;
@@ -363,11 +367,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) {
aStack = null;
return true;
- } else {
- tHatch.setInventorySlotContents(i, null);
- aStack = null;
- return false;
}
+ tHatch.setInventorySlotContents(i, null);
+ aStack = null;
+ return false;
}
}
}
@@ -381,9 +384,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
this.mDoor = 0;
this.mHardenedClay = 0;
- if (!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false;
-
- if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0) || this.tileEntityDispensers.isEmpty()
+ || this.mDoor > 2
+ || this.mHardenedClay < 40)
+ return false;
this.mWrench = true;
this.mScrewdriver = true;
@@ -512,13 +516,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
@Override
public void construct(ItemStack itemStack, boolean b) {
- buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
- if (mMachine) return -1;
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, env, false, true);
+ if (this.mMachine) return -1;
+ return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, env, false, true);
}
public float OutputMultiplier(BW_RotorBlock rotorBlock) {
@@ -563,13 +567,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
@Override
public int getTitleColor() {
- return COLOR_TITLE_WHITE.get();
+ return this.COLOR_TITLE_WHITE.get();
}
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
- new SlotWidget(inventoryHandler, 1).setBackground(getGUITextureSet().getItemSlot()).setPos(59, 35))
+ new SlotWidget(this.inventoryHandler, 1).setBackground(this.getGUITextureSet().getItemSlot())
+ .setPos(59, 35))
.widget(new DrawableWidget() {
private static final int DIVIDER = 125;
@@ -577,24 +582,27 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
@Override
public void onScreenUpdate() {
super.onScreenUpdate();
- if (mMaxProgresstime > 0) {
+ if (GT_TileEntity_Windmill.this.mMaxProgresstime > 0) {
if (System.currentTimeMillis() / DIVIDER % 40 == 30)
- setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]);
+ this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]);
else if (System.currentTimeMillis() / DIVIDER % 40 == 20)
- setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]);
+ this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]);
else if (System.currentTimeMillis() / DIVIDER % 40 == 10)
- setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]);
+ this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]);
else if (System.currentTimeMillis() / DIVIDER % 40 == 0)
- setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]);
+ this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]);
} else {
- setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY);
+ this.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY);
}
}
}.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY).setPos(85, 27).setSize(32, 32))
- .widget(new FakeSyncWidget.IntegerSyncer(() -> mMaxProgresstime, val -> mMaxProgresstime = val))
+ .widget(
+ new FakeSyncWidget.IntegerSyncer(
+ () -> this.mMaxProgresstime,
+ val -> this.mMaxProgresstime = val))
.widget(
new ItemDrawable(
- () -> mMachine && !getBaseMetaTileEntity().isActive()
+ () -> this.mMachine && !this.getBaseMetaTileEntity().isActive()
? GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
GT_MetaGenerated_Tool_01.SOFTMALLET,
1,
@@ -604,12 +612,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock
: null).asWidget().setPos(66, 66))
.widget(
new FakeSyncWidget.BooleanSyncer(
- () -> getBaseMetaTileEntity().isActive(),
- val -> getBaseMetaTileEntity().setActive(val)))
+ () -> this.getBaseMetaTileEntity().isActive(),
+ val -> this.getBaseMetaTileEntity().setActive(val)))
.widget(
new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setMaxWidth(150)
- .setEnabled(widget -> !mMachine).setPos(92, 22))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
+ .setDefaultColor(this.COLOR_TEXT_WHITE.get()).setMaxWidth(150)
+ .setEnabled(widget -> !this.mMachine).setPos(92, 22))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> this.mMachine, val -> this.mMachine = val));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
index 5178a3f759..bf80c80a11 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
@@ -174,8 +174,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
.addInfo(
"For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)")
.addInfo("Additionally gives +100K for every tier past MV")
- .addPollutionAmount(20 * getPollutionPerTick(null)).addSeparator().beginStructureBlock(15, 20, 15, true)
- .addController("3rd layer center").addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false)
+ .addPollutionAmount(20 * this.getPollutionPerTick(null)).addSeparator()
+ .beginStructureBlock(15, 20, 15, true).addController("3rd layer center")
+ .addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false)
.addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)")
.addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15")
.addStructureInfo("The glass tier limits the Energy Input tier")
@@ -195,31 +196,30 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
super.loadNBTData(aNBT);
this.glassTier = aNBT.getByte("glasTier");
if (!aNBT.hasKey(INPUT_SEPARATION_NBT_KEY)) {
- inputSeparation = aNBT.getBoolean("isBussesSeparate");
+ this.inputSeparation = aNBT.getBoolean("isBussesSeparate");
}
if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) {
- batchMode = aNBT.getBoolean("mUseMultiparallelMode");
+ this.batchMode = aNBT.getBoolean("mUseMultiparallelMode");
}
}
@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
- if (aPlayer.isSneaking()) {
- batchMode = !batchMode;
- if (batchMode) {
- GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
- } else {
- GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
- }
- return true;
- } else {
- inputSeparation = !inputSeparation;
+ if (!aPlayer.isSneaking()) {
+ this.inputSeparation = !this.inputSeparation;
GT_Utility.sendChatToPlayer(
aPlayer,
- StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation);
+ StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + this.inputSeparation);
return true;
}
+ this.batchMode = !this.batchMode;
+ if (this.batchMode) {
+ GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
+ }
+ return true;
}
@Override
@@ -241,7 +241,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setByte("glasTier", glassTier);
+ aNBT.setByte("glasTier", this.glassTier);
}
@Override
@@ -255,7 +255,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- return mPollutionOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ return this.mPollutionOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
}
return false;
}
@@ -264,7 +264,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
protected String[] getExtendedInfoData() {
return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": "
+ EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mHeatingCapacity)
+ + GT_Utility.formatNumbers(this.mHeatingCapacity)
+ EnumChatFormatting.RESET
+ " K" };
}
@@ -277,12 +277,14 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
@Override
protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) {
return super.createOverclockCalculator(recipe).setRecipeHeat(recipe.mSpecialValue)
- .setMultiHeat(mHeatingCapacity).setHeatOC(true).setHeatDiscount(true);
+ .setMultiHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity).setHeatOC(true)
+ .setHeatDiscount(true);
}
@Override
protected @Nonnull CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) {
- return recipe.mSpecialValue <= mHeatingCapacity ? CheckRecipeResultRegistry.SUCCESSFUL
+ return recipe.mSpecialValue <= GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity
+ ? CheckRecipeResultRegistry.SUCCESSFUL
: CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue);
}
}.setMaxParallel(ConfigHandler.megaMachinesMax);
@@ -300,24 +302,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece("main", stackSize, hintsOnly, 7, 17, 0);
+ this.buildPiece("main", stackSize, hintsOnly, 7, 17, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
- glassTier = 0;
- setCoilLevel(HeatingCoilLevel.None);
- return survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true);
+ this.glassTier = 0;
+ this.setCoilLevel(HeatingCoilLevel.None);
+ return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true);
}
public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
- mCoilLevel = aCoilLevel;
+ this.mCoilLevel = aCoilLevel;
}
public HeatingCoilLevel getCoilLevel() {
- return mCoilLevel;
+ return this.mCoilLevel;
}
@Override
@@ -325,7 +327,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
if (aLiquid == null) return false;
FluidStack tLiquid = aLiquid.copy();
boolean isOutputPollution = false;
- for (FluidStack pollutionFluidStack : pollutionFluidStacks) {
+ for (FluidStack pollutionFluidStack : this.pollutionFluidStacks) {
if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue;
isOutputPollution = true;
@@ -335,7 +337,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
if (isOutputPollution) {
tOutputHatches = this.mPollutionOutputHatches;
int pollutionReduction = 0;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
if (!isValidMetaTileEntity(tHatch)) continue;
pollutionReduction = 100 - tHatch.calculatePollutionReduction(100);
break;
@@ -350,30 +352,28 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
@Override
public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
this.mHeatingCapacity = 0;
- glassTier = 0;
+ this.glassTier = 0;
- setCoilLevel(HeatingCoilLevel.None);
+ this.setCoilLevel(HeatingCoilLevel.None);
this.mPollutionOutputHatches.clear();
- if (!checkPiece("main", 7, 17, 0)) return false;
-
- if (getCoilLevel() == HeatingCoilLevel.None) return false;
-
- if (mMaintenanceHatches.size() != 1) return false;
+ if (!this.checkPiece("main", 7, 17, 0) || this.getCoilLevel() == HeatingCoilLevel.None
+ || this.mMaintenanceHatches.size() != 1)
+ return false;
- if (glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) {
+ if (this.glassTier < 8) {
+ for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
- if (glassTier < hatch.mTier) {
+ if (this.glassTier < hatch.mTier) {
return false;
}
}
}
- this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(getMaxInputEu()) - 2);
+ this.mHeatingCapacity = (int) this.getCoilLevel().getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2);
return true;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
index 52f5d55f23..68c8a7804b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
@@ -116,7 +116,7 @@ public class GT_TileEntity_MegaChemicalReactor
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) {
- batchMode = aNBT.getBoolean("mUseMultiparallelMode");
+ this.batchMode = aNBT.getBoolean("mUseMultiparallelMode");
}
}
@@ -124,8 +124,8 @@ public class GT_TileEntity_MegaChemicalReactor
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
if (aPlayer.isSneaking()) {
- batchMode = !batchMode;
- if (batchMode) {
+ this.batchMode = !this.batchMode;
+ if (this.batchMode) {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
} else {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
@@ -142,31 +142,30 @@ public class GT_TileEntity_MegaChemicalReactor
@Override
public void construct(ItemStack aStack, boolean aHintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true);
+ return this
+ .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true);
}
// -------------- TEC TECH COMPAT ----------------
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- glassTier = 0;
+ this.glassTier = 0;
- if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0) || this.mMaintenanceHatches.size() != 1) return false;
- if (mMaintenanceHatches.size() != 1) return false;
-
- if (glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) {
+ if (this.glassTier < 8) {
+ for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
- if (glassTier < hatch.mTier) {
+ if (this.glassTier < hatch.mTier) {
return false;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java
index 913d706c50..343a06cece 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java
@@ -168,21 +168,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
t.mTopState = 1;
// hatch adder
TileEntity tileEntity = world.getTileEntity(x, y, z);
- if (tileEntity instanceof IGregTechTileEntity) {
- IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity;
- if (t.addLayerOutputHatch(entity, CASING_INDEX)) {
- t.onTopLayerFound(false);
- return true;
- }
+ if (tileEntity instanceof IGregTechTileEntity entity
+ && t.addLayerOutputHatch(entity, CASING_INDEX)) {
+ t.onTopLayerFound(false);
+ return true;
}
// block adder
if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4
&& world.getBlockMetadata(x, y, z) == 1) {
t.onTopLayerFound(true);
return true;
- } else {
- return false;
}
+ return false;
}).build();
}
@@ -208,27 +205,27 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
}
protected void onCasingFound() {
- mCasing++;
+ this.mCasing++;
}
protected int getCurrentLayerOutputHatchCount() {
- return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0
- : mOutputHatchesByLayer.get(mHeight - 1).size();
+ return this.mOutputHatchesByLayer.size() < this.mHeight || this.mHeight <= 0 ? 0
+ : this.mOutputHatchesByLayer.get(this.mHeight - 1).size();
}
protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null || aTileEntity.isDead()
|| !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output))
return false;
- while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>());
+ while (this.mOutputHatchesByLayer.size() < this.mHeight) this.mOutputHatchesByLayer.add(new ArrayList<>());
GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
tHatch.updateTexture(aBaseCasingIndex);
- return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch);
+ return this.mOutputHatchesByLayer.get(this.mHeight - 1).add(tHatch);
}
protected void onTopLayerFound(boolean aIsCasing) {
- mTopLayerFound = true;
- if (aIsCasing) onCasingFound();
+ this.mTopLayerFound = true;
+ if (aIsCasing) this.onCasingFound();
}
@Override
@@ -277,63 +274,58 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
// reset
- mOutputHatchesByLayer.forEach(List::clear);
- mHeight = 1;
- mTopLayerFound = false;
- mTopState = -1;
+ this.mOutputHatchesByLayer.forEach(List::clear);
+ this.mHeight = 1;
+ this.mTopLayerFound = false;
+ this.mTopState = -1;
// check base
- if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false;
// check each layer
- while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) {
- if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty())
+ while (this.mHeight < 12 && this.checkPiece(STRUCTURE_PIECE_LAYER, 7, this.mHeight * 5, 0)
+ && !this.mTopLayerFound) {
+ if (this.mOutputHatchesByLayer.size() < this.mHeight
+ || this.mOutputHatchesByLayer.get(this.mHeight - 1).isEmpty())
// layer without output hatch
return false;
- mTopState = -1;
+ this.mTopState = -1;
// not top
- mHeight++;
+ this.mHeight++;
}
// validate final invariants...
- return mCasing >= 75 * mHeight + 10 && mHeight >= 2 && mTopLayerFound && mMaintenanceHatches.size() == 1;
+ return this.mCasing >= 75 * this.mHeight + 10 && this.mHeight >= 2
+ && this.mTopLayerFound
+ && this.mMaintenanceHatches.size() == 1;
}
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 7, 0, 0);
+ this.buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 7, 0, 0);
int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
for (int i = 1; i < tTotalHeight - 1; i++) {
- buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 7, 5 * i, 0);
+ this.buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 7, 5 * i, 0);
}
- buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 7, 5 * (tTotalHeight - 1), 0);
+ this.buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 7, 5 * (tTotalHeight - 1), 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
- mHeight = 0;
- int built = survivialBuildPiece(
- STRUCTURE_PIECE_BASE,
- stackSize,
- 7,
- 0,
- 0,
- realBudget,
- source,
- actor,
- false,
- true);
+ this.mHeight = 0;
+ int built = this
+ .survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true);
if (built >= 0) return built;
int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
for (int i = 1; i < tTotalHeight - 1; i++) {
- mHeight = i;
- built = survivialBuildPiece(
+ this.mHeight = i;
+ built = this.survivialBuildPiece(
STRUCTURE_PIECE_LAYER,
stackSize,
7,
- 5 * mHeight,
+ 5 * this.mHeight,
0,
realBudget,
source,
@@ -342,12 +334,12 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
true);
if (built >= 0) return built;
}
- mHeight = tTotalHeight - 1;
- return survivialBuildPiece(
+ this.mHeight = tTotalHeight - 1;
+ return this.survivialBuildPiece(
STRUCTURE_PIECE_TOP_HINT,
stackSize,
7,
- 5 * mHeight,
+ 5 * this.mHeight,
0,
realBudget,
source,
@@ -360,7 +352,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) {
- batchMode = aNBT.getBoolean("mUseMultiparallelMode");
+ this.batchMode = aNBT.getBoolean("mUseMultiparallelMode");
}
}
@@ -368,8 +360,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
if (aPlayer.isSneaking()) {
- batchMode = !batchMode;
- if (batchMode) {
+ this.batchMode = !this.batchMode;
+ if (this.batchMode) {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
} else {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
@@ -386,16 +378,16 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock
@Override
protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
- for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) {
+ for (int i = 0; i < mOutputFluids2.length && i < this.mOutputHatchesByLayer.size(); i++) {
FluidStack tStack = mOutputFluids2[i].copy();
- if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true))
- dumpFluid(mOutputHatchesByLayer.get(i), tStack, false);
+ if (!dumpFluid(this.mOutputHatchesByLayer.get(i), tStack, true))
+ dumpFluid(this.mOutputHatchesByLayer.get(i), tStack, false);
}
}
@Override
public List<? extends IFluidStore> getFluidOutputSlots(FluidStack[] toOutput) {
- return this.getFluidOutputSlotsByLayer(toOutput, mOutputHatchesByLayer);
+ return this.getFluidOutputSlotsByLayer(toOutput, this.mOutputHatchesByLayer);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java
index 8850df1d3b..e666047839 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java
@@ -49,7 +49,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
protected long[] getCurrentInfoData() {
long storedEnergy = 0, maxEnergy = 0;
- for (GT_MetaTileEntity_Hatch hatch : getExoticAndNormalEnergyHatchList()) {
+ for (GT_MetaTileEntity_Hatch hatch : this.getExoticAndNormalEnergyHatchList()) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) {
storedEnergy += hatch.getBaseMetaTileEntity().getStoredEU();
maxEnergy += hatch.getBaseMetaTileEntity().getEUCapacity();
@@ -68,7 +68,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
}
}
- long[] ttHatches = getCurrentInfoData();
+ long[] ttHatches = this.getCurrentInfoData();
long storedEnergy = ttHatches[0];
long maxEnergy = ttHatches[1];
@@ -79,13 +79,13 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
}
}
- long nominalV = getMaxInputEu();
+ long nominalV = this.getMaxInputEu();
String tName = BW_Util.getTierNameFromVoltage(nominalV);
- if (tName.equals("MAX+")) tName = EnumChatFormatting.OBFUSCATED + "MAX+";
+ if ("MAX+".equals(tName)) tName = EnumChatFormatting.OBFUSCATED + "MAX+";
- String[] extendedInfo = getExtendedInfoData();
+ String[] extendedInfo = this.getExtendedInfoData();
- String[] baseInfo = new String[] {
+ String[] baseInfo = {
StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ EnumChatFormatting.GREEN
+ GT_Utility.formatNumbers(this.mProgresstime / 20)
@@ -114,7 +114,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
+ GT_Utility.formatNumbers(this.getMaxInputVoltage())
+ EnumChatFormatting.RESET
+ " EU/t(*"
- + GT_Utility.formatNumbers(getMaxInputAmps())
+ + GT_Utility.formatNumbers(this.getMaxInputAmps())
+ "A) = "
+ EnumChatFormatting.YELLOW
+ GT_Utility.formatNumbers(nominalV)
@@ -131,7 +131,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
+ StatCollector.translateToLocal("GT5U.multiblock.efficiency")
+ ": "
+ EnumChatFormatting.YELLOW
- + (float) this.mEfficiency / 100.0F
+ + this.mEfficiency / 100.0F
+ EnumChatFormatting.RESET
+ " %",
StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
@@ -171,7 +171,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
@Override
protected void setProcessingLogicPower(ProcessingLogic logic) {
- logic.setAvailableVoltage(getMaxInputEu());
+ logic.setAvailableVoltage(this.getMaxInputEu());
logic.setAvailableAmperage(1);
}
@@ -220,7 +220,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M
@Override
public PlaceResult survivalPlaceBlock(T o, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) {
- if (check(o, world, x, y, z)) return PlaceResult.SKIP;
+ if (this.check(o, world, x, y, z)) return PlaceResult.SKIP;
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return PlaceResult.REJECT;
world.setBlock(x, y, z, Blocks.air, 0, 2);
return PlaceResult.ACCEPT;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
index 01f351014e..e31b3563ff 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
@@ -189,52 +189,53 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {
+ @Override
@Nonnull
public CheckRecipeResult process() {
- setEuModifier(1.0F - Math.min(0.1F * (heatLevel.getTier() + 1), 0.5F));
+ this.setEuModifier(
+ 1.0F - Math.min(0.1F * (GT_TileEntity_MegaOilCracker.this.heatLevel.getTier() + 1), 0.5F));
return super.process();
}
}.setMaxParallel(ConfigHandler.megaMachinesMax);
}
public HeatingCoilLevel getCoilLevel() {
- return heatLevel;
+ return this.heatLevel;
}
public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
- heatLevel = aCoilLevel;
+ this.heatLevel = aCoilLevel;
}
@Override
public void construct(ItemStack aStack, boolean aHintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 6, 6, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 6, 6, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true);
+ return this
+ .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true);
}
// -------------- TEC TECH COMPAT ----------------
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- glassTier = 0;
- mInputOnSide = -1;
- mOutputOnSide = -1;
- mMiddleInputHatches.clear();
+ this.glassTier = 0;
+ this.mInputOnSide = -1;
+ this.mOutputOnSide = -1;
+ this.mMiddleInputHatches.clear();
- if (!checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0) || this.mMaintenanceHatches.size() != 1) return false;
- if (mMaintenanceHatches.size() != 1) return false;
-
- if (glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) {
+ if (this.glassTier < 8) {
+ for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
- if (glassTier < hatch.mTier) {
+ if (this.glassTier < hatch.mTier) {
return false;
}
}
@@ -252,25 +253,25 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
return false;
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- if (mInputOnSide == 1) {
+ if (this.mInputOnSide == 1) {
return false;
}
- mInputOnSide = 0;
- mOutputOnSide = 1;
+ this.mInputOnSide = 0;
+ this.mOutputOnSide = 1;
GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
tHatch.updateTexture(aBaseCasingIndex);
- tHatch.mRecipeMap = getRecipeMap();
- return mInputHatches.add(tHatch);
+ tHatch.mRecipeMap = this.getRecipeMap();
+ return this.mInputHatches.add(tHatch);
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- if (mOutputOnSide == 1) {
+ if (this.mOutputOnSide == 1) {
return false;
}
- mInputOnSide = 1;
- mOutputOnSide = 0;
+ this.mInputOnSide = 1;
+ this.mOutputOnSide = 0;
GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity;
tHatch.updateTexture(aBaseCasingIndex);
- return mOutputHatches.add(tHatch);
+ return this.mOutputHatches.add(tHatch);
}
return false;
}
@@ -284,25 +285,25 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
return false;
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- if (mInputOnSide == 0) {
+ if (this.mInputOnSide == 0) {
return false;
}
- mInputOnSide = 1;
- mOutputOnSide = 0;
+ this.mInputOnSide = 1;
+ this.mOutputOnSide = 0;
GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
tHatch.updateTexture(aBaseCasingIndex);
- tHatch.mRecipeMap = getRecipeMap();
- return mInputHatches.add(tHatch);
+ tHatch.mRecipeMap = this.getRecipeMap();
+ return this.mInputHatches.add(tHatch);
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- if (mOutputOnSide == 0) {
+ if (this.mOutputOnSide == 0) {
return false;
}
- mInputOnSide = 0;
- mOutputOnSide = 1;
+ this.mInputOnSide = 0;
+ this.mOutputOnSide = 1;
GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity;
tHatch.updateTexture(aBaseCasingIndex);
- return mOutputHatches.add(tHatch);
+ return this.mOutputHatches.add(tHatch);
}
return false;
}
@@ -315,11 +316,10 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
if (aMetaTileEntity == null) {
return false;
}
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input tHatch) {
tHatch.updateTexture(aBaseCasingIndex);
- tHatch.mRecipeMap = getRecipeMap();
- return mMiddleInputHatches.add(tHatch);
+ tHatch.mRecipeMap = this.getRecipeMap();
+ return this.mMiddleInputHatches.add(tHatch);
}
return false;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java
index 40d42f6598..1243bae84d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java
@@ -149,7 +149,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Vacuum Freezer").addInfo("Controller Block for the Mega Vacuum Freezer")
.addInfo("Cools hot ingots and cells").addSeparator().beginStructureBlock(15, 15, 15, true)
- .addController("Front center").addCasingInfo("Frost Proof Machine Casing", 900)
+ .addController("Front center").addCasingInfoMin("Frost Proof Machine Casing", 900, false)
.addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1).addInputHatch("Any casing", 1)
.addOutputHatch("Any casing", 1).addInputBus("Any casing", 1).addOutputBus("Any casing", 1)
.toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS);
@@ -163,14 +163,15 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc
@Override
public void construct(ItemStack aStack, boolean aHintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0);
+ this.buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
+ if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true);
+ return this
+ .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true);
}
@Override
@@ -182,7 +183,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) {
- batchMode = aNBT.getBoolean("mUseMultiparallelMode");
+ this.batchMode = aNBT.getBoolean("mUseMultiparallelMode");
}
}
@@ -190,8 +191,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
if (aPlayer.isSneaking()) {
- batchMode = !batchMode;
- if (batchMode) {
+ this.batchMode = !this.batchMode;
+ if (this.batchMode) {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
} else {
GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
@@ -211,7 +212,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
this.mCasing = 0;
- if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false;
+ if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false;
return this.mMaintenanceHatches.size() == 1 && this.mCasing >= 900;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java
index daccb55d6f..3686f59246 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java
@@ -60,22 +60,26 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene
return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
}
+ @Override
public ITexture[] getFront(byte aColor) {
return new ITexture[] { super.getFront(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL),
Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
}
+ @Override
public ITexture[] getBack(byte aColor) {
return new ITexture[] { super.getBack(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public ITexture[] getBottom(byte aColor) {
return new ITexture[] { super.getBottom(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public ITexture[] getTop(byte aColor) {
return new ITexture[] { super.getTop(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL),
@@ -86,27 +90,32 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene
.glow().build() };
}
+ @Override
public ITexture[] getSides(byte aColor) {
return new ITexture[] { super.getSides(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public ITexture[] getFrontActive(byte aColor) {
return new ITexture[] { super.getFrontActive(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL),
Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
}
+ @Override
public ITexture[] getBackActive(byte aColor) {
return new ITexture[] { super.getBackActive(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public ITexture[] getBottomActive(byte aColor) {
return new ITexture[] { super.getBottomActive(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public ITexture[] getTopActive(byte aColor) {
return new ITexture[] { super.getTopActive(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL),
@@ -117,15 +126,18 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene
.glow().build() };
}
+ @Override
public ITexture[] getSidesActive(byte aColor) {
return new ITexture[] { super.getSidesActive(aColor)[0],
TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) };
}
+ @Override
public boolean isOutputFacing(ForgeDirection side) {
return side == this.getBaseMetaTileEntity().getFrontFacing();
}
+ @Override
public String[] getDescription() {
return new String[] { StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"),
StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"),
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java
index 6830042f80..4e01fca2a0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java
@@ -160,29 +160,30 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
int damage = this.getSpecialSlot().getItemDamage();
switch (damage) {
case DNA_EXTRACTION_MODULE:
- if (GT_Utility.isStackValid(this.mInventory[getInputSlot()])
- && this.mInventory[getInputSlot()].getItem() instanceof LabParts
- && this.mInventory[getInputSlot()].getItemDamage() == 0
- && this.mInventory[getInputSlot()].getTagCompound() != null
+ if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()])
+ && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts
+ && this.mInventory[this.getInputSlot()].getItemDamage() == 0
+ && this.mInventory[this.getInputSlot()].getTagCompound() != null
&& // checks if it is a Culture
- GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1])
- && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts
- && this.mInventory[getInputSlot() + 1].getItemDamage() == 1
- && this.mInventory[getInputSlot() + 1].getTagCompound() == null
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2])
- && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts
- && this.mInventory[getInputSlot() + 2].getItemDamage() == 3
- && GT_Utility
- .areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1))
+ GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1])
+ && this.mInventory[this.getInputSlot() + 1].getItem() instanceof LabParts
+ && this.mInventory[this.getInputSlot() + 1].getItemDamage() == 1
+ && this.mInventory[this.getInputSlot() + 1].getTagCompound() == null
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2])
+ && this.mInventory[this.getInputSlot() + 2].getItem() instanceof LabParts
+ && this.mInventory[this.getInputSlot() + 2].getItemDamage() == 3
+ && GT_Utility.areStacksEqual(
+ this.mInventory[this.getInputSlot() + 3],
+ Materials.Ethanol.getCells(1))
&& this.mFluid != null
&& this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000))
&& this.mFluid.amount >= 1000) {
- NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound()
+ NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound()
.getCompoundTag("DNA");
if (DNABioDataTag == null) return super.checkRecipe(skipOC);
BioData cultureDNABioData = BioData.getBioDataFromName(
- this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA")
+ this.mInventory[this.getInputSlot()].getTagCompound().getCompoundTag("DNA")
.getString("Name"));
if (cultureDNABioData == null) return super.checkRecipe(skipOC);
@@ -190,8 +191,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < 4; i++) {
- if (this.mInventory[getInputSlot() + i] != null)
- this.mInventory[getInputSlot() + i].stackSize--;
+ if (this.mInventory[this.getInputSlot() + i] != null)
+ this.mInventory[this.getInputSlot() + i].stackSize--;
}
this.mFluid.amount -= 1000;
@@ -209,26 +210,27 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
}
break;
case PCR_THERMOCYCLE_MODULE: {
- if (GT_Utility.isStackValid(this.mInventory[getInputSlot()])
- && this.mInventory[getInputSlot()].getItem() instanceof LabParts
- && this.mInventory[getInputSlot()].getItemDamage() == 1
- && this.mInventory[getInputSlot()].getTagCompound() != null
+ if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()])
+ && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts
+ && this.mInventory[this.getInputSlot()].getItemDamage() == 1
+ && this.mInventory[this.getInputSlot()].getTagCompound() != null
&& // checks if it is a Culture
- GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3])
- && GT_Utility
- .areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1])
+ GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 1],
+ this.mInventory[this.getInputSlot() + 3],
+ ItemList.Tool_DataOrb.get(1L))
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1])
+ && GT_Utility.areStacksEqual(
+ this.mInventory[this.getInputSlot() + 1],
FluidLoader.BioLabFluidCells[0])
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2])
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 2],
+ this.mInventory[this.getInputSlot() + 2],
FluidLoader.BioLabFluidCells[3])
&& this.mFluid != null
&& this.mFluid.isFluidEqual(dnaFluid)
&& this.mFluid.amount >= 1000) {
- NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound();
+ NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound();
if (DNABioDataTag == null) return super.checkRecipe(skipOC);
BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name"));
if (cultureDNABioData == null) return super.checkRecipe(skipOC);
@@ -237,8 +239,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < 4; i++) {
- if (this.mInventory[getInputSlot() + i] != null)
- this.mInventory[getInputSlot() + i].stackSize--;
+ if (this.mInventory[this.getInputSlot() + i] != null)
+ this.mInventory[this.getInputSlot() + i].stackSize--;
}
this.mFluid.amount -= 1000;
@@ -264,34 +266,38 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
ItemStack inp2 = ItemList.Tool_DataOrb.get(1L);
Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample");
Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName());
- if (GT_Utility.isStackValid(this.mInventory[getInputSlot()])
- && GT_Utility
- .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()])
- && // checks if it is a Culture
- GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1])
+ if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility
+ .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[this.getInputSlot()]) && // checks
+ // if
+ // it
+ // is
+ // a
+ // Culture
+ GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 1],
+ this.mInventory[this.getInputSlot() + 1],
BioItemList.getPlasmidCell(null))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2])
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 2],
+ this.mInventory[this.getInputSlot() + 2],
ItemList.Tool_DataOrb.get(1L),
true)
- && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample")
- && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty()))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3])
- && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2)
+ && "DNA Sample"
+ .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 2]))
+ && !Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2]).isEmpty()
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3])
+ && GT_Utility.areStacksEqual(this.mInventory[this.getInputSlot() + 3], inp2)
&& this.mFluid != null
&& this.mFluid.isFluidEqual(dnaFluid)
- && (this.mFluid.amount >= 1000)) {
- BioData cultureDNABioData = BioData
- .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]));
+ && this.mFluid.amount >= 1000) {
+ BioData cultureDNABioData = BioData.getBioDataFromName(
+ Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2]));
if (cultureDNABioData == null) return super.checkRecipe(skipOC);
if (this.mTier < 1 + rTier + cultureDNABioData.getTier())
return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < 2; i++) {
- if (this.mInventory[getInputSlot() + i] != null)
- this.mInventory[getInputSlot() + i].stackSize--;
+ if (this.mInventory[this.getInputSlot() + i] != null)
+ this.mInventory[this.getInputSlot() + i].stackSize--;
}
this.mFluid.amount -= 1000;
if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) {
@@ -307,32 +313,32 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
}
break;
case TRANSFORMATION_MODULE: {
- if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility
- .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true)
- && this.mInventory[getInputSlot()].getTagCompound() != null
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1])
+ if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility
+ .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null), true)
+ && this.mInventory[this.getInputSlot()].getTagCompound() != null
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 1],
+ this.mInventory[this.getInputSlot() + 1],
BioItemList.getPlasmidCell(null),
true)
- && this.mInventory[getInputSlot() + 1].getTagCompound() != null
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2])
+ && this.mInventory[this.getInputSlot() + 1].getTagCompound() != null
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 2],
+ this.mInventory[this.getInputSlot() + 2],
FluidLoader.BioLabFluidCells[2])
&& this.mFluid != null
&& this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000))
&& this.mFluid.amount >= 1000) {
BioData cultureDNABioData = BioData
- .getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound());
+ .getBioDataFromNBTTag(this.mInventory[this.getInputSlot() + 1].getTagCompound());
BioCulture bioCulture = BioCulture
- .getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound());
+ .getBioCultureFromNBTTag(this.mInventory[this.getInputSlot()].getTagCompound());
if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC);
if (this.mTier < 3 + rTier + cultureDNABioData.getTier())
return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < 3; i++) {
- if (this.mInventory[getInputSlot() + i] != null)
- this.mInventory[getInputSlot() + i].stackSize--;
+ if (this.mInventory[this.getInputSlot() + i] != null)
+ this.mInventory[this.getInputSlot() + i].stackSize--;
}
this.mFluid.amount -= 1000;
bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData));
@@ -351,32 +357,33 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
ItemStack Outp = ItemList.Tool_DataOrb.get(1L);
Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample");
- if (GT_Utility.isStackValid(this.mInventory[getInputSlot()])
+ if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility
+ .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null))
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1])
&& GT_Utility
- .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1])
- && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2])
+ .areStacksEqual(this.mInventory[this.getInputSlot() + 1], BioItemList.getOther(4))
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 2],
+ this.mInventory[this.getInputSlot() + 2],
ItemList.Circuit_Chip_Stemcell.get(2L))
- && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3])
+ && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3])
&& GT_Utility.areStacksEqual(
- this.mInventory[getInputSlot() + 3],
+ this.mInventory[this.getInputSlot() + 3],
ItemList.Tool_DataOrb.get(1L),
true)
- && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample")
+ && "DNA Sample"
+ .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 3]))
&& this.mFluid.isFluidEqual(dnaFluid)
- && (this.mFluid.amount >= 8000)) {
+ && this.mFluid.amount >= 8000) {
- BioData cultureDNABioData = BioData
- .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3]));
+ BioData cultureDNABioData = BioData.getBioDataFromName(
+ Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 3]));
if (cultureDNABioData == null) return super.checkRecipe(skipOC);
if (this.mTier < 3 + rTier + cultureDNABioData.getTier())
return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < 3; i++) {
- if (this.mInventory[getInputSlot() + i] != null)
- this.mInventory[getInputSlot() + i].stackSize--;
+ if (this.mInventory[this.getInputSlot() + i] != null)
+ this.mInventory[this.getInputSlot() + i].stackSize--;
}
this.mFluid.amount -= 8000;
if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
index 2f4811270f..0597999155 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
@@ -63,12 +63,11 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull {
if (!aPlayer.isSneaking()) {
--this.aAmps;
if (this.aAmps < 0) this.aAmps = this.maxAmps;
- GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps);
} else {
++this.aAmps;
if (this.aAmps > this.maxAmps) this.aAmps = 0;
- GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps);
}
+ GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps);
}
@Override
@@ -104,7 +103,7 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull {
if (meta > ConfigHandler.IDOffset + GT_Values.VN.length
&& meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2)
return 2L;
- else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2
+ if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2
&& meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3)
return 4L;
else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3
@@ -119,6 +118,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull {
else return 0L;
}
+ @Override
+ @SuppressWarnings("deprecation")
public String[] getDescription() {
return ArrayUtils.addAll(
this.mDescriptionArray,
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
index f2345fce09..167a3a4758 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
@@ -40,31 +40,37 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans
super(aName, aTier, aDescription, aTextures);
}
+ @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_EnergyDistributor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
}
+ @Override
public long maxEUInput() {
return GT_Values.V[this.mTier];
}
+ @Override
public long maxEUOutput() {
return GT_Values.V[this.mTier];
}
+ @Override
public long maxAmperesOut() {
return 320;
}
+ @Override
public long maxAmperesIn() {
return 320;
}
@Override
public long maxEUStore() {
- return 512L + (GT_Values.V[this.mTier] * 320L);
+ return 512L + GT_Values.V[this.mTier] * 320L;
}
+ @Override
public String[] getDescription() {
return new String[] { StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"),
StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " "
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
index f709ece0b6..33589f45f6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
@@ -90,7 +90,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " "
+ (aTier - 2)
+ " "
- + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name")
+ + (aTier - 2 >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name")
: StatCollector.translateToLocal("tooltip.bw.kg.0.name")),
StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"),
BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() });
@@ -108,12 +108,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
}
public int getSievert() {
- return this.sievert - MathUtils.ceilInt((float) this.sievert / 100f * (float) this.coverage);
+ return this.sievert - MathUtils.ceilInt(this.sievert / 100f * this.coverage);
}
public short[] getColorForGUI() {
if (this.colorForGUI != null) return this.colorForGUI;
- return colorForGUI = new short[] { 0xFA, 0xFA, 0xFF };
+ return this.colorForGUI = new short[] { 0xFA, 0xFA, 0xFF };
}
public byte getMass() {
@@ -159,29 +159,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity());
+ BaseMetaTileEntity myMetaTileEntity = (BaseMetaTileEntity) this.getBaseMetaTileEntity();
if (myMetaTileEntity.isServerSide()) {
if (this.mass > 0) {
++this.timer;
}
- if (this.mass > 0) {
- if (this.decayTime == 0 || (this.decayTime > 0 && this.timer % this.decayTime == 0)) {
- this.mass--;
- if (this.mass == 0) {
- this.material = StatCollector.translateToLocal("tooltip.bw.empty.name");
- this.sievert = 0;
- }
- this.timer = 1;
+ if (this.mass > 0 && (this.decayTime == 0 || this.decayTime > 0 && this.timer % this.decayTime == 0)) {
+ this.mass--;
+ if (this.mass == 0) {
+ this.material = StatCollector.translateToLocal("tooltip.bw.empty.name");
+ this.sievert = 0;
}
+ this.timer = 1;
}
- if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) {
- if (this.sievert > 0) {
- sendLoopStart((byte) 1);
- myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer;
- }
+ if (myMetaTileEntity.mTickTimer > myMetaTileEntity.mLastSoundTick + ticksBetweenSounds
+ && this.sievert > 0) {
+ this.sendLoopStart((byte) 1);
+ myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer;
}
if (this.mass == 0) {
@@ -190,14 +187,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
if (lStack == null) {
this.colorForGUI = new short[] { 0x37, 0x37, 0x37 };
return;
+ }
+ ItemData itemData = GT_OreDictUnificator.getAssociation(lStack);
+ if (itemData != null) {
+ Materials mat = itemData.mMaterial.mMaterial;
+ this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] };
} else {
- ItemData itemData = GT_OreDictUnificator.getAssociation(lStack);
- if (itemData != null) {
- Materials mat = itemData.mMaterial.mMaterial;
- this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] };
- } else {
- this.colorForGUI = new short[] { 0x37, 0x37, 0x37 };
- }
+ this.colorForGUI = new short[] { 0x37, 0x37, 0x37 };
}
if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) {
@@ -211,7 +207,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
this.sievert = this.lastRecipe.mEUt;
this.material = this.lastUsedItem.getDisplayName();
lStack.stackSize--;
- updateSlots();
+ this.updateSlots();
} else {
this.lastRecipe = null;
}
@@ -223,7 +219,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
false,
Integer.MAX_VALUE - 7,
null,
- mInventory[0]);
+ this.mInventory[0]);
if (this.lastRecipe == null) {
this.lastFail = true;
this.lastUsedItem = this.mInventory[0] == null ? null : this.mInventory[0].copy();
@@ -240,7 +236,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
this.sievert = this.lastRecipe.mEUt;
this.material = lStack.getDisplayName();
lStack.stackSize--;
- updateSlots();
+ this.updateSlots();
}
}
}
@@ -271,7 +267,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
+ "/"
+ (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60
+ StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") };
- else return new String[] {
+ return new String[] {
StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " "
+ StatCollector.translateToLocal("tooltip.bw.empty.name"),
StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0",
@@ -283,6 +279,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
return true;
}
+ @Override
public boolean isFacingValid(ForgeDirection facing) {
return true;
}
@@ -349,12 +346,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
buildContext.addSyncedWindow(RADIATION_SHUTTER_WINDOW_ID, this::createShutterWindow);
- getBaseMetaTileEntity().add1by1Slot(builder);
+ this.getBaseMetaTileEntity().add1by1Slot(builder);
builder.widget(
new DrawableWidget().setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER).setPos(61, 9)
.setSize(56, 24))
.widget(
- new ProgressBar().setProgress(() -> getSievert() / 148f).setDirection(Direction.RIGHT)
+ new ProgressBar().setProgress(() -> this.getSievert() / 148f).setDirection(Direction.RIGHT)
.setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24).setPos(65, 13).setSize(48, 16))
.widget(
new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE).setPos(124, 18)
@@ -363,9 +360,19 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
@Override
public void draw(float partialTicks) {
- if (decayTime > 0) {
- int height = MathUtils.ceilInt(48 * ((decayTime - timer % decayTime) / (float) decayTime));
- new Rectangle().setColor(Color.argb(colorForGUI[0], colorForGUI[1], colorForGUI[2], 255))
+ if (GT_MetaTileEntity_RadioHatch.this.decayTime > 0) {
+ int height = MathUtils.ceilInt(
+ 48 * ((GT_MetaTileEntity_RadioHatch.this.decayTime
+ - GT_MetaTileEntity_RadioHatch.this.timer
+ % GT_MetaTileEntity_RadioHatch.this.decayTime)
+ / (float) GT_MetaTileEntity_RadioHatch.this.decayTime));
+ new Rectangle()
+ .setColor(
+ Color.argb(
+ GT_MetaTileEntity_RadioHatch.this.colorForGUI[0],
+ GT_MetaTileEntity_RadioHatch.this.colorForGUI[1],
+ GT_MetaTileEntity_RadioHatch.this.colorForGUI[2],
+ 255))
.draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks);
}
}
@@ -373,32 +380,31 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
() -> Collections.singletonList(
StatCollector.translateToLocalFormatted(
"tooltip.tile.radhatch.10.name",
- timer <= 1 ? 0 : (decayTime - timer) / 20,
- timer <= 1 ? 0 : decayTime / 20)))
+ this.timer <= 1 ? 0 : (this.decayTime - this.timer) / 20,
+ this.timer <= 1 ? 0 : this.decayTime / 20)))
.setPos(124, 18).setSize(16, 48)
.attachSyncer(
- new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val),
+ new FakeSyncWidget.LongSyncer(() -> this.decayTime, val -> this.decayTime = val),
builder,
(widget, val) -> widget.notifyTooltipChange())
.attachSyncer(
- new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val),
+ new FakeSyncWidget.LongSyncer(() -> this.timer, val -> this.timer = val),
builder,
(widget, val) -> widget.notifyTooltipChange()))
- .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[0], val -> colorForGUI[0] = val))
- .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[1], val -> colorForGUI[1] = val))
- .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[2], val -> colorForGUI[2] = val))
+ .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[0], val -> this.colorForGUI[0] = val))
+ .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[1], val -> this.colorForGUI[1] = val))
+ .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[2], val -> this.colorForGUI[2] = val))
.widget(
new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER).setPos(120, 14)
.setSize(24, 56))
.widget(
TextWidget.dynamicString(
- () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass))
+ () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", this.mass))
.setTextAlignment(Alignment.Center).setPos(65, 62))
.widget(
- TextWidget
- .dynamicString(
- () -> StatCollector
- .translateToLocalFormatted("BW.NEI.display.radhatch.0", getSievert()))
+ TextWidget.dynamicString(
+ () -> StatCollector
+ .translateToLocalFormatted("BW.NEI.display.radhatch.0", this.getSievert()))
.setTextAlignment(Alignment.Center).setPos(60, 72))
.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
if (!widget.isClient()) {
@@ -416,25 +422,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem
private ModularWindow createShutterWindow(EntityPlayer player) {
ModularWindow.Builder builder = ModularWindow.builder(176, 107);
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
- builder.setGuiTint(getGUIColorization());
+ builder.setGuiTint(this.getGUIColorization());
- builder.widget(new TextWidget("Radiation Shutter Control").setDefaultColor(COLOR_TITLE.get()).setPos(10, 9))
+ builder.widget(
+ new TextWidget("Radiation Shutter Control").setDefaultColor(this.COLOR_TITLE.get()).setPos(10, 9))
.widget(
new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME).setPos(14, 27)
.setSize(55, 54))
.widget(
- new DrawableWidget()
- .setDrawable(
- () -> coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null)
+ new DrawableWidget().setDrawable(
+ () -> this.coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null)
.setPos(16, 29).setSize(51, 50).attachSyncer(
new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage),
builder,
- (widget, val) -> widget.setPos(16, 29 + coverage / 2)
- .setSize(51, 50 - coverage / 2)))
+ (widget, val) -> widget.setPos(16, 29 + this.coverage / 2)
+ .setSize(51, 50 - this.coverage / 2)))
.widget(
- new TextFieldWidget().setSetterInt(val -> coverage = val.byteValue())
- .setGetterInt(() -> (int) coverage).setNumbers(0, 100).setTextColor(Color.WHITE.dark(1))
- .setOnScrollNumbers(1, 5, 50).setTextAlignment(Alignment.CenterLeft)
+ new TextFieldWidget().setSetterInt(val -> this.coverage = val.byteValue())
+ .setGetterInt(() -> (int) this.coverage).setNumbers(0, 100)
+ .setTextColor(Color.WHITE.dark(1)).setOnScrollNumbers(1, 5, 50)
+ .setTextAlignment(Alignment.CenterLeft)
.setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2))
.setPos(86, 27).setSize(30, 12))
.widget(ButtonWidget.closeWindowButton(true).setPos(176 - 15, 3));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java
index dc41d12cf7..51a73c1533 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java
@@ -90,21 +90,18 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin
@Override
public void saveNBTData(NBTTagCompound nbtTagCompound) {}
+ @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
final ForgeDirection side = ForgeDirection.EAST;
if (aBaseMetaTileEntity.inputEnergyFrom(side)) {
TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side);
- if (!(tTileEntity instanceof IBasicEnergyContainer)) {
- this.powered = false;
- return;
- }
- IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity;
- if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L)) {
+ if (!(tTileEntity instanceof IBasicEnergyContainer tileAtSide)) {
this.powered = false;
return;
}
- if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) {
+ if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L)
+ || !tileAtSide.decreaseStoredEnergyUnits(4, false)) {
this.powered = false;
return;
}
@@ -117,6 +114,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin
}
}
+ @Override
public long maxEUInput() {
return GT_Values.V[this.mTier];
}
@@ -131,6 +129,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin
return this.powered ? 1L : 0;
}
+ @Override
public long maxEUOutput() {
return this.powered ? GT_Values.V[this.mTier] : 0;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java
index 3113991fd0..bcac09fde6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java
@@ -40,16 +40,18 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler {
}
}
+ @Override
public TemplateRecipeHandler newInstance() {
return new BW_NEI_BioLabHandler(this.mRecipeMap);
}
+ @Override
public void loadCraftingRecipes(ItemStack aResult) {
if (aResult != null && aResult.getItem() instanceof LabParts
&& aResult.getItemDamage() < 3
&& aResult.getTagCompound() != null) {
- for (CachedDefaultRecipe recipe : getCache())
- if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) arecipes.add(recipe);
+ for (CachedDefaultRecipe recipe : this.getCache())
+ if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) this.arecipes.add(recipe);
} else {
super.loadCraftingRecipes(aResult);
}
@@ -60,8 +62,8 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler {
if (aResult != null && aResult.getItem() instanceof LabParts
&& aResult.getItemDamage() < 3
&& aResult.getTagCompound() != null) {
- for (CachedDefaultRecipe recipe : getCache())
- if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) arecipes.add(recipe);
+ for (CachedDefaultRecipe recipe : this.getCache())
+ if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) this.arecipes.add(recipe);
} else {
super.loadUsageRecipes(aResult);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
index e377a5d91b..a7b170961d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
@@ -49,13 +49,13 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
}
private void loadLabPartRecipes(ItemStack aResult) {
- for (CachedDefaultRecipe recipe : getCache()) {
+ for (CachedDefaultRecipe recipe : this.getCache()) {
// dirty way of finding the special slot item
// see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot
for (PositionedStack stack : recipe.mInputs) {
- if (stack.relx == 120 && stack.rely == 52) {
- if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) arecipes.add(recipe);
- }
+ if (stack.relx == 120 && stack.rely == 52
+ && NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack)))
+ this.arecipes.add(recipe);
}
}
}
@@ -65,7 +65,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
if (aResult != null && aResult.getItem() instanceof LabParts
&& aResult.getItemDamage() < 3
&& aResult.getTagCompound() != null) {
- loadLabPartRecipes(aResult);
+ this.loadLabPartRecipes(aResult);
} else {
super.loadUsageRecipes(aResult);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
index ad99e50626..703074d07d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
@@ -69,7 +69,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
- if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) {
+ if ("quickanddirtyneihandler".equalsIgnoreCase(outputId)) {
HashSet<ItemStack> result = new HashSet<>();
Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore))
.forEach(w -> result.add(w.get(OrePrefixes.ore)));
@@ -83,7 +83,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
this.arecipes.clear();
this.arecipes.addAll(hashSet);
}
- if (outputId.equals("item")) {
+ if ("item".equals(outputId)) {
this.loadCraftingRecipes((ItemStack) results[0]);
HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes);
this.arecipes.clear();
@@ -93,7 +93,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
@Override
public void drawExtras(int recipe) {
- if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe)) {
+ if (recipe < this.arecipes.size() && this.arecipes.get(recipe) instanceof CachedOreRecipe) {
CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe);
if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null
@@ -131,11 +131,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false);
GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false);
GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false);
- } else {
- if (cachedOreRecipe.worldGen != null) {
- GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false);
- GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false);
- }
+ } else if (cachedOreRecipe.worldGen != null) {
+ GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false);
+ GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false);
}
}
super.drawExtras(recipe);
@@ -145,11 +143,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(ItemStack result) {
Block ore = Block.getBlockFromItem(result.getItem());
if (ore instanceof BW_MetaGenerated_Ores) {
- BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream()
- .filter(
- l -> !(ore instanceof BW_MetaGenerated_SmallOres)
- || !(l.getClass().equals(BW_WorldGenRoss128b.class)
- || l.getClass().equals(BW_WorldGenRoss128ba.class)))
+ BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream().filter(
+ l -> !(ore instanceof BW_MetaGenerated_SmallOres) || !l.getClass().equals(BW_WorldGenRoss128b.class)
+ && !l.getClass().equals(BW_WorldGenRoss128ba.class))
.forEach(
l -> this.arecipes
.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres)));
@@ -187,9 +183,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> ret = new ArrayList<>();
int x = 0;
- for (int i = 0; i < (small ? 1 : 4); i++) {
+ for (int i = 0; i < (this.small ? 1 : 4); i++) {
x += 20;
- ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12));
+ ret.add(new PositionedStack(this.worldGen.getStacks().get(i), x, 12));
}
return ret;
}
@@ -197,14 +193,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof CachedOreRecipe)) return false;
- CachedOreRecipe that = (CachedOreRecipe) o;
- return Objects.equals(worldGen, that.worldGen);
+ if (!(o instanceof CachedOreRecipe that)) return false;
+ return Objects.equals(this.worldGen, that.worldGen);
}
@Override
public int hashCode() {
- return worldGen.hashCode();
+ return this.worldGen.hashCode();
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
index 7231995517..7445946828 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
@@ -45,9 +45,9 @@ public class ServerEventHandler {
// FMLCommonHandler.instance().bus()
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) {
- if (event == null || !(event.player instanceof EntityPlayerMP)) return;
-
- if (event.player.worldObj.getTotalWorldTime() % 20 != 0) return;
+ if (event == null || !(event.player instanceof EntityPlayerMP)
+ || event.player.worldObj.getTotalWorldTime() % 20 != 0)
+ return;
boolean replace = false;
ItemStack toReplace = null;
@@ -70,17 +70,16 @@ public class ServerEventHandler {
}
toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize);
break loop;
- } else {
- for (String s : e.getADDITIONAL_OREDICT()) {
- if (oreDictName.contains(s)) {
- String prefix = oreDictName.replace(s, "");
- OrePrefixes prefixes = OrePrefixes.getPrefix(prefix);
- if (prefixes == null) {
- continue;
- }
- toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize);
- break loop;
+ }
+ for (String s : e.getADDITIONAL_OREDICT()) {
+ if (oreDictName.contains(s)) {
+ String prefix = oreDictName.replace(s, "");
+ OrePrefixes prefixes = OrePrefixes.getPrefix(prefix);
+ if (prefixes == null) {
+ continue;
}
+ toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize);
+ break loop;
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java
index 651bf98047..24402ac369 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java
@@ -37,38 +37,37 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks {
super(par1);
}
+ @Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ) {
return false;
}
+ @Override
public String getUnlocalizedName(ItemStack aStack) {
return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
}
+ @Override
public String getItemStackDisplayName(ItemStack aStack) {
Block block = Block.getBlockFromItem(aStack.getItem());
- if (block != null) {
- if (block instanceof BW_MetaGenerated_Blocks) {
- int aMetaData = aStack.getItemDamage();
- Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData);
- if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff;
- return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName
- .replace("%material", werkstoff.getLocalizedName());
- }
+ if (block instanceof BW_MetaGenerated_Blocks metaBlock) {
+ int aMetaData = aStack.getItemDamage();
+ Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData);
+ if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff;
+ return metaBlock.blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName());
}
- return GT_LanguageManager.getTranslation(getUnlocalizedName(aStack) + ".name");
+ return GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".name");
}
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) {
if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) {
return;
}
if (aList == null) {
- aList = new ArrayList<String>();
+ aList = new ArrayList<>();
}
Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage());
if (werkstoff != null) {
@@ -88,6 +87,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks {
}
}
+ @Override
public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side,
float hitX, float hitY, float hitZ, int aMeta) {
short tDamage = (short) this.getDamage(aStack);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
index ca8b06151d..fef152ec40 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
@@ -83,18 +83,17 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks
@Override
public String getUnlocalizedName() {
- if (_prefixes == OrePrefixes.blockCasing) return "bw.werkstoffblockscasing.01";
- else if (_prefixes == OrePrefixes.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01";
+ if (this._prefixes == OrePrefixes.blockCasing) return "bw.werkstoffblockscasing.01";
+ if (this._prefixes == OrePrefixes.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01";
return "";
}
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
+ public void getSubBlocks(Item aItem, CreativeTabs aTab, List<ItemStack> aList) {
Werkstoff.werkstoffHashSet.stream()
.filter(
- pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL)
+ pMaterial -> Werkstoff.Types.BIOLOGICAL.equals(pMaterial.getType())
&& pMaterial.hasGenerationFeature(OrePrefixes.blockCasing)
|| pMaterial.doesOreDictedItemExists(OrePrefixes.plate)
&& pMaterial.doesOreDictedItemExists(OrePrefixes.screw)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java
index b53bd71e4b..9f1b197b8d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java
@@ -36,7 +36,7 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B
public ITexture[] getTexture(Block aBlock, ForgeDirection side) {
if (SideReference.Side.Client) {
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
+ if (aMaterial != null) {
TextureSet set = aMaterial.getTexSet();
ITexture aIconSet = TextureFactory.of(
PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasingAdvanced)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java
index fda24e869b..f23fc3a912 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java
@@ -36,7 +36,7 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE
public ITexture[] getTexture(Block aBlock, ForgeDirection side) {
if (SideReference.Side.Client) {
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
+ if (aMaterial != null) {
TextureSet set = aMaterial.getTexSet();
ITexture aIconSet = TextureFactory.of(
PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasing)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java
index cb876af9bc..ee322c5634 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java
@@ -40,13 +40,13 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity {
public BW_MetaGeneratedFrames(int aID, String aName, String aNameRegional, Werkstoff aMaterial) {
super(aID, aName, aNameRegional, 0);
- mMaterial = aMaterial;
+ this.mMaterial = aMaterial;
- GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1));
+ GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, this.getStackForm(1));
GT_ModHandler.addCraftingRecipe(
- getStackForm(2),
+ this.getStackForm(2),
RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick) });
+ new Object[] { "SSS", "SwS", "SSS", 'S', this.mMaterial.get(OrePrefixes.stick) });
RA.stdBuilder()
.itemInputs(
@@ -57,7 +57,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity {
private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) {
super(aName, 0);
- mMaterial = aMaterial;
+ this.mMaterial = aMaterial;
}
@Override
@@ -129,10 +129,12 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity {
return false;
}
+ @Override
public int connect(ForgeDirection side) {
return 0;
}
+ @Override
public void disconnect(ForgeDirection side) {
/* Do nothing */
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java
index 7383b41b54..f4bf46dbe0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java
@@ -26,7 +26,7 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE {
@Override
public ITexture[] getTexture(Block aBlock, ForgeDirection side) {
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
+ if (aMaterial != null) {
ITexture aIconSet = TextureFactory
.of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA());
return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet };
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java
index ed3285eaa0..de4dbb1cbc 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java
@@ -31,6 +31,7 @@ import gregtech.api.util.GT_Utility;
public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE {
+ @Override
public ArrayList<ItemStack> getDrops(int aFortune) {
ArrayList<ItemStack> rList = new ArrayList<>();
Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial();
@@ -100,7 +101,7 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE {
if (tSelector.size() > 0) {
int i = 0;
- for (int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) {
+ for (int j = Math.max(1, aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0); i < j; ++i) {
rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size()))));
}
}
@@ -118,7 +119,7 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE {
@Override
public ITexture[] getTexture(Block aBlock, ForgeDirection side) {
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
+ if (aMaterial != null) {
ITexture aIconSet = TextureFactory
.of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA());
return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet };
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java
index 7492512e75..5aba6c84a1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java
@@ -32,15 +32,18 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT
public short mMetaData;
+ @Override
public boolean canUpdate() {
return false;
}
+ @Override
public void readFromNBT(NBTTagCompound aNBT) {
super.readFromNBT(aNBT);
this.mMetaData = aNBT.getShort("m");
}
+ @Override
public void writeToNBT(NBTTagCompound aNBT) {
aNBT.setShort("m", this.mMetaData);
super.writeToNBT(aNBT);
@@ -64,7 +67,7 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT
rList.add(new ItemStack(Blocks.cobblestone, 1, 0));
return rList;
}
- rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData));
+ rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData));
return rList;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java
index ad850c2c5f..c9dd83db6c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java
@@ -50,11 +50,11 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer {
this.setResistance(5.0F);
this.setBlockTextureName("stone");
this.setCreativeTab(metaTab);
- _prefixes = types;
- if (_prefixes != null) {
+ this._prefixes = types;
+ if (this._prefixes != null) {
this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization(
- "bw.blocktype." + _prefixes,
- _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost);
+ "bw.blocktype." + this._prefixes,
+ this._prefixes.mLocalizedMaterialPre + "%material" + this._prefixes.mLocalizedMaterialPost);
}
Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff);
}
@@ -69,7 +69,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer {
@SideOnly(Side.CLIENT)
public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() {
- return (BW_MetaGenerated_Block_TE) createNewTileEntity(null, 0);
+ return (BW_MetaGenerated_Block_TE) this.createNewTileEntity(null, 0);
}
protected abstract void doRegistrationStuff(Werkstoff w);
@@ -79,19 +79,22 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer {
return "pickaxe";
}
+ @Override
protected boolean canSilkHarvest() {
return false;
}
+ @Override
public int getRenderType() {
if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType();
return BW_Renderer_Block_Ores.INSTANCE.mRenderID;
}
+ @Override
public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof BW_MetaGenerated_Block_TE))) {
- return ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData;
+ if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) {
+ return metaTE.mMetaData;
}
return 0;
}
@@ -106,18 +109,20 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer {
return true;
}
+ @Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
TileEntity tTileEntity = world.getTileEntity(x, y, z);
- if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) {
- mTemporaryTileEntity.set((BW_MetaGenerated_Block_TE) tTileEntity);
+ if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) {
+ mTemporaryTileEntity.set(metaTE);
}
super.breakBlock(world, x, y, z, block, meta);
}
+ @Override
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) {
- return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune);
+ if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) {
+ return metaTE.getDrops(aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
index fde9c8e9ee..7f9a3196dd 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
@@ -84,20 +84,21 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
}
}
+ @Override
public boolean onEntityItemUpdate(EntityItem aItemEntity) {
if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure
|| this.orePrefixes == OrePrefixes.crushed) {
int aDamage = aItemEntity.getEntityItem().getItemDamage();
- if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) {
+ if (aDamage >= 0 && !aItemEntity.worldObj.isRemote) {
Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage);
- if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) {
+ if (aMaterial != null && aMaterial != Werkstoff.default_null_Werkstoff) {
int tX = MathHelper.floor_double(aItemEntity.posX);
int tY = MathHelper.floor_double(aItemEntity.posY);
int tZ = MathHelper.floor_double(aItemEntity.posZ);
Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ);
byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ);
- if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) {
- if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) {
+ if (tBlock == Blocks.cauldron && tMetaData > 0) {
+ if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) {
aItemEntity.setEntityItemStack(
WerkstoffLoader.getCorrespondingItemStack(
OrePrefixes.dust,
@@ -105,9 +106,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
aItemEntity.getEntityItem().stackSize));
aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3);
return true;
- }
- } else {
- if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) {
+ } else {
aItemEntity.setEntityItemStack(
WerkstoffLoader.getCorrespondingItemStack(
OrePrefixes.crushedPurified,
@@ -124,8 +123,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
}
@Override
- @SuppressWarnings("unchecked")
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ protected void addAdditionalToolTips(List<String> aList, ItemStack aStack, EntityPlayer aPlayer) {
if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) {
aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify"));
}
@@ -159,13 +157,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
int aMetaData = aStack.getItemDamage();
Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData);
if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff;
- return itemTypeLocalizedName.replace("%material", werkstoff.getLocalizedName());
+ return this.itemTypeLocalizedName.replace("%material", werkstoff.getLocalizedName());
}
@Override
public IIconContainer getIconContainer(int aMetaData) {
if (werkstoffHashMap.get((short) aMetaData) == null) return null;
- if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData);
+ if (this.orePrefixes.mTextureIndex == -1) return this.getIconContainerBartWorks(aMetaData);
return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex];
}
@@ -177,8 +175,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List<ItemStack> aList) {
for (Werkstoff werkstoff : werkstoffHashSet) {
if (werkstoff != null && werkstoff.hasItemType(this.orePrefixes)) {
ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID());
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java
index 36d7eb46fc..08251573b3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java
@@ -42,9 +42,10 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost);
}
+ @Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
- if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return;
+ if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GT_ModHandler.addValuableOre(this, w.getmID(), 1);
}
}
@@ -57,26 +58,22 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
Block tBlock = aWorld.getBlock(aX, aY, aZ);
Block tOreBlock = WerkstoffLoader.BWOres;
- if (aMetaData < 0 || tBlock == Blocks.air && !air) {
+ if (aMetaData < 0 || tBlock == Blocks.air && !air
+ || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) {
return false;
- } else {
-
- if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) {
- return false;
- }
- final int aaY = aY;
- if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) {
- return false;
- }
-
- aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof BW_MetaGeneratedOreTE) {
- ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData;
- }
+ }
+ final int aaY = aY;
+ if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) {
+ return false;
+ }
- return true;
+ aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof BW_MetaGeneratedOreTE metaTE) {
+ metaTE.mMetaData = (short) aMetaData;
}
+
+ return true;
}
@Override
@@ -85,10 +82,11 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
}
@Override
- public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
+ public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) {
return Blocks.stone.getIcon(0, 0);
}
+ @Override
public int getHarvestLevel(int metadata) {
return 3;
}
@@ -99,26 +97,12 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
}
@Override
- @SuppressWarnings("unchecked")
- public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
+ public void getSubBlocks(Item aItem, CreativeTabs aTab, List<ItemStack> aList) {
for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) {
- if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore)
- && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) {
+ if (tMaterial != null && tMaterial.hasItemType(OrePrefixes.ore)
+ && (tMaterial.getGenerationFeatures().blacklist & 0x8) == 0) {
aList.add(new ItemStack(aItem, 1, tMaterial.getmID()));
}
}
}
-
- @SuppressWarnings("unused")
- private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ) {
- for (int x = -1; x <= 1; x++) {
- for (int y = -1; y <= 1; y++) {
- for (int z = -1; z <= 1; z++) {
- if (x == 0 && y == 0 && z == 0) continue;
- if (aWorld.getBlock(aX + x, aY + y, aZ + z).isAir(aWorld, aX + x, aY + y, aZ + z)) return true;
- }
- }
- }
- return false;
- }
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java
index 54825526de..fc6b757361 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java
@@ -37,7 +37,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores {
@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
- if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return;
+ if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GT_ModHandler.addValuableOre(this, w.getmID(), 1);
}
}
@@ -55,25 +55,21 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores {
Block tBlock = aWorld.getBlock(aX, aY, aZ);
Block tOreBlock = WerkstoffLoader.BWSmallOres;
- if (aMetaData < 0 || tBlock == Blocks.air && !air) {
+ if (aMetaData < 0 || tBlock == Blocks.air && !air
+ || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) {
return false;
- } else {
-
- if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) {
- return false;
- }
- final int aaY = aY;
- if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) {
- return false;
- }
-
- aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof BW_MetaGeneratedOreTE) {
- ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData;
- }
+ }
+ final int aaY = aY;
+ if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) {
+ return false;
+ }
- return true;
+ aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof BW_MetaGeneratedOreTE metaTE) {
+ metaTE.mMetaData = (short) aMetaData;
}
+
+ return true;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java
index bfcfbc0e8b..f82b90863a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java
@@ -31,7 +31,7 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T
public ITexture[] getTexture(Block aBlock, ForgeDirection side) {
if (SideReference.Side.Client) {
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
+ if (aMaterial != null) {
TextureSet set = aMaterial.getTexSet();
ITexture aIconSet = TextureFactory.of(
set.mTextures[PrefixTextureLinker.blockTexMap
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java
index 9c7d251688..8e149391cd 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java
@@ -51,13 +51,12 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks {
}
@Override
- public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
+ public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) {
return Blocks.iron_block.getIcon(0, 0);
}
@Override
- @SuppressWarnings("unchecked")
- public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
+ public void getSubBlocks(Item aItem, CreativeTabs tab, List<ItemStack> aList) {
Werkstoff.werkstoffHashSet.stream()
.filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot))
.map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())).forEach(aList::add);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java
index 67bfa6c0af..3315bfea4c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java
@@ -40,86 +40,88 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer {
@Override
public IItemContainer set(Item aItem) {
- mHasNotBeenSet = false;
+ this.mHasNotBeenSet = false;
if (aItem == null) return this;
ItemStack aStack = new ItemStack(aItem, 1, 0);
- mStack = GT_Utility.copyAmount(1, aStack);
+ this.mStack = GT_Utility.copyAmount(1, aStack);
return this;
}
@Override
public IItemContainer set(ItemStack aStack) {
- mHasNotBeenSet = false;
- mStack = GT_Utility.copyAmount(1, aStack);
+ this.mHasNotBeenSet = false;
+ this.mStack = GT_Utility.copyAmount(1, aStack);
return this;
}
@Override
public Item getItem() {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return null;
- return mStack.getItem();
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return null;
+ return this.mStack.getItem();
}
@Override
public Block getBlock() {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- return GT_Utility.getBlockFromItem(getItem());
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ return GT_Utility.getBlockFromItem(this.getItem());
}
@Override
public final boolean hasBeenSet() {
- return !mHasNotBeenSet;
+ return !this.mHasNotBeenSet;
}
@Override
public boolean isStackEqual(Object aStack) {
- return isStackEqual(aStack, false, false);
+ return this.isStackEqual(aStack, false, false);
}
@Override
public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
if (GT_Utility.isStackInvalid(aStack)) return false;
- return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
+ return GT_Utility
+ .areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT);
}
@Override
public ItemStack get(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack));
}
@Override
public ItemStack getWildcard(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(this.mStack));
}
@Override
public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack));
}
@Override
public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility
+ .copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack));
}
@Override
public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
+ ItemStack rStack = this.get(1, aReplacements);
if (GT_Utility.isStackInvalid(rStack)) return null;
rStack.setStackDisplayName(aDisplayName);
return GT_Utility.copyAmount(aAmount, rStack);
@@ -127,7 +129,7 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer {
@Override
public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
+ ItemStack rStack = this.get(1, aReplacements);
if (GT_Utility.isStackInvalid(rStack)) return null;
GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
return GT_Utility.copyAmount(aAmount, rStack);
@@ -135,25 +137,25 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer {
@Override
public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack));
}
@Override
public IItemContainer registerOre(Object... aOreNames) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, this.get(1));
return this;
}
@Override
public IItemContainer registerWildcardAsOre(Object... aOreNames) {
- if (mHasNotBeenSet)
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
+ if (this.mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1));
return this;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
index 69c66b9474..11200e95c9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
@@ -92,7 +92,6 @@ public class BW_Meta_Items {
BW_Util.CLEANROOM));
}
- @SuppressWarnings("deprecation")
public void addNewCircuit(int aTier, int aID, String aName) {
String additionalOreDictData = "";
@@ -147,7 +146,7 @@ public class BW_Meta_Items {
ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID, aName, tooltip, aTier);
- GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ", ""), tStack);
+ GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replace(" ", ""), tStack);
}
public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook {
@@ -159,7 +158,7 @@ public class BW_Meta_Items {
public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier) {
CircuitImprintLoader.bwCircuitTagMap.put(
new CircuitData(
- BW_Util.getMachineVoltageFromTier(Math.min(1, (tier - 2))),
+ BW_Util.getMachineVoltageFromTier(Math.min(1, tier - 2)),
tier > 2 ? BW_Util.CLEANROOM : 0,
(byte) tier),
new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, aID));
@@ -185,8 +184,7 @@ public class BW_Meta_Items {
}
@Override
- @SuppressWarnings("unchecked")
- public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List<ItemStack> aList) {
if (aCreativeTab == this.getCreativeTab())
for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()) {
ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, 0);
@@ -196,6 +194,7 @@ public class BW_Meta_Items {
super.getSubItems(var1, aCreativeTab, aList);
}
+ @Override
@SideOnly(Side.CLIENT)
public final void registerIcons(IIconRegister aIconRegister) {
@@ -230,8 +229,7 @@ public class BW_Meta_Items {
}
@Override
- @SuppressWarnings("unchecked")
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ protected void addAdditionalToolTips(List<String> aList, ItemStack aStack, EntityPlayer aPlayer) {
if (aStack.getItemDamage() == 0) if (aStack.getTagCompound() != null
&& CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null)
aList.add(
@@ -303,10 +301,8 @@ public class BW_Meta_Items {
Object tRandomData;
for (var9 = 0; var9 < var8; ++var9) {
tRandomData = var7[var9];
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- }
+ if (tRandomData instanceof SubTag && tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
}
}
@@ -351,9 +347,9 @@ public class BW_Meta_Items {
return rStack;
}
+ @Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List<ItemStack> aList) {
int j = this.mEnabledItems.length();
for (int i = 0; i < j; ++i) {
@@ -366,8 +362,7 @@ public class BW_Meta_Items {
}
@Override
- @SuppressWarnings("unchecked")
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ protected void addAdditionalToolTips(List<String> aList, ItemStack aStack, EntityPlayer aPlayer) {
super.addAdditionalToolTips(aList, aStack, aPlayer);
aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get());
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java
index da02250010..49fba31ec8 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java
@@ -32,10 +32,8 @@ public class CircuitData {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof CircuitData)) return false;
- CircuitData that = (CircuitData) o;
- if (this.getaVoltage() != that.getaVoltage()) return false;
- if (this.getaSpecial() != that.getaSpecial()) return false;
+ if (!(o instanceof CircuitData that)) return false;
+ if (this.getaVoltage() != that.getaVoltage() || this.getaSpecial() != that.getaSpecial()) return false;
return this.getaTier() == that.getaTier();
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
index 91ac70820f..9d8675406f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
@@ -60,7 +60,6 @@ public class CircuitImprintLoader {
private static final HashSet<GT_Recipe> ORIGINAL_CAL_RECIPES = new HashSet<>();
private static final HashSet<GT_Recipe> MODIFIED_CAL_RECIPES = new HashSet<>();
- @SuppressWarnings({ "unused", "RedundantSuppression" })
public static void run() {
HashSet<GT_Recipe> toRem = new HashSet<>();
HashSet<GT_Recipe> toAdd = new HashSet<>();
@@ -112,24 +111,13 @@ public class CircuitImprintLoader {
if (newRecipe != null)
BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe);
addCutoffRecipeToSets(toRem, toAdd, circuitRecipe);
- } else {
- if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe);
- }
+ } else if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe);
}
}
- @Deprecated
- private static String getTypeFromOreDict(ItemStack[] outputs) {
- int[] oreIDS = OreDictionary.getOreIDs(outputs[0]);
-
- if (oreIDS.length < 1) return "";
-
- return OreDictionary.getOreName(oreIDS[0]);
- }
-
private static boolean isCircuitOreDict(ItemStack item) {
return BW_Util.isTieredCircuit(item)
- || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray"));
+ || BW_Util.getOreNames(item).stream().anyMatch(s -> "circuitPrimitiveArray".equals(s));
}
private static void exchangeRecipesInList(HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd) {
@@ -310,8 +298,8 @@ public class CircuitImprintLoader {
BW_Util.getMachineVoltageFromTier(
BW_Util.getCircuitTierFromOreDictName(
OreDictionary.getOreName(
- (OreDictionary.getOreIDs(stack) != null
- && OreDictionary.getOreIDs(stack).length > 0)
+ OreDictionary.getOreIDs(stack) != null
+ && OreDictionary.getOreIDs(stack).length > 0
? OreDictionary.getOreIDs(stack)[0]
: -1))));
GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java
index 7babb0d3c1..5da0462d82 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java
@@ -148,7 +148,7 @@ public class CircuitPartLoader implements Runnable {
ArrayList<String> toolTip = new ArrayList<>();
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
single.getItem().addInformation(single.get(1).copy(), null, toolTip, true);
- String tt = (toolTip.size() > 0 ? toolTip.get(0) : "");
+ String tt = toolTip.size() > 0 ? toolTip.get(0) : "";
// tt += "Internal Name = "+single;
String localised = GT_LanguageManager
.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java
index 0de9abaa4f..08b3968251 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java
@@ -57,37 +57,36 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
for (int i = 0; i < Materials.values().length; i++) {
ItemStack tStack = new ItemStack(this, 1, i);
Materials material = Materials.values()[i];
- if (((material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten)
- || ((material.getFluid(1) == null && material.getGas(1) == null)
- && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
+ if (material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten
+ || material.getFluid(1) == null && material.getGas(1) == null
+ && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))
continue;
- if (OreDictionary
- .doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) {
- hiddenThings.add(i);
+ if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""))) {
+ this.hiddenThings.add(i);
continue;
}
GT_OreDictUnificator
- .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack);
+ .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""), tStack);
}
if (noSubIDMaterials != null) {
- hasList = true;
+ this.hasList = true;
// materialloop:
for (int i = 0; i < noSubIDMaterials.size(); i++) {
ItemStack tStack = new ItemStack(this, 1, i + 1001);
Materials w = noSubIDMaterials.get(i);
- if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten)
- || ((w.getFluid(1) == null && w.getGas(1) == null)
- && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
+ if (w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten
+ || w.getFluid(1) == null && w.getGas(1) == null
+ && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))
continue;
- if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) {
- hiddenThings.add(i);
+ if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""))) {
+ this.hiddenThings.add(i);
continue;
}
GT_OreDictUnificator
- .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack);
+ .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""), tStack);
}
}
}
@@ -95,20 +94,19 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
private Materials getMaterial(ItemStack is) {
if (is == null || is.getItem() != this) return null;
final int meta = is.getItemDamage();
- return getMaterialFromMeta(meta);
+ return this.getMaterialFromMeta(meta);
}
@Override
public String getItemStackDisplayName(ItemStack aStack) {
- Materials material = getMaterial(aStack);
+ Materials material = this.getMaterial(aStack);
if (material == null) material = Materials._NULL;
- return material.getLocalizedNameForItem(itemTypeLocalizedName);
+ return material.getLocalizedNameForItem(this.itemTypeLocalizedName);
}
- @SuppressWarnings("unchecked")
@Override
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- Materials material = getMaterial(aStack);
+ protected void addAdditionalToolTips(List<String> aList, ItemStack aStack, EntityPlayer aPlayer) {
+ Materials material = this.getMaterial(aStack);
if (material != null) {
String tooltip = material.getToolTip();
if (tooltip != null && !tooltip.isEmpty()) {
@@ -120,13 +118,12 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
@Override
public IIconContainer getIconContainer(int aMetaData) {
- if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData);
- Materials material = getMaterialFromMeta(aMetaData);
+ if (this.orePrefixes.mTextureIndex == -1) return this.getIconContainerBartWorks(aMetaData);
+ Materials material = this.getMaterialFromMeta(aMetaData);
if (material != null) {
return material.mIconSet.mTextures[this.orePrefixes.mTextureIndex];
- } else {
- return null;
}
+ return null;
}
@Override
@@ -137,7 +134,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
if (iconLink == null) return null;
- Materials material = getMaterialFromMeta(aMetaData);
+ Materials material = this.getMaterialFromMeta(aMetaData);
if (material == null || material.mIconSet == null) return null;
@@ -146,63 +143,61 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
@Override
public IIcon getIconFromDamage(int aMetaData) {
- return getIcon(aMetaData, 0);
+ return this.getIcon(aMetaData, 0);
}
@Override
public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) {
- return getMaterialFromMeta(aMetaData).renderer;
+ return this.getMaterialFromMeta(aMetaData).renderer;
}
public Materials getMaterialFromMeta(int aMetaData) {
- if (aMetaData > 1000 && hasList) {
+ if (aMetaData > 1000 && this.hasList) {
return NoMetaValue.get(aMetaData - 1001);
- } else {
- if (aMetaData < 0 || aMetaData >= Materials.values().length) {
- return null;
- }
- return Materials.values()[aMetaData];
}
+ if (aMetaData < 0 || aMetaData >= Materials.values().length) {
+ return null;
+ }
+ return Materials.values()[aMetaData];
}
@Override
@SideOnly(Side.CLIENT)
- @SuppressWarnings("unchecked")
- public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List<ItemStack> aList) {
for (int i = 0; i < Materials.values().length; i++) {
Materials w = Materials.values()[i];
- if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0
+ if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0
&& Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0)
continue;
- else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten)
- || ((w.getFluid(1) == null && w.getGas(1) == null)
- && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
+ if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten
+ || w.getFluid(1) == null && w.getGas(1) == null
+ && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle))
continue;
- else if (hiddenThings.contains(i)) continue;
+ else if (this.hiddenThings.contains(i)) continue;
aList.add(new ItemStack(this, 1, i));
}
- if (hasList) for (int i = 0; i < NoMetaValue.size(); i++) {
+ if (this.hasList) for (int i = 0; i < NoMetaValue.size(); i++) {
Materials w = NoMetaValue.get(i);
- if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0
+ if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0
&& Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0)
continue;
- else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten)
- || ((w.getFluid(1) == null && w.getGas(1) == null)
- && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
+ if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten
+ || w.getFluid(1) == null && w.getGas(1) == null
+ && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle))
continue;
- else if (hiddenThings.contains(i)) continue;
+ else if (this.hiddenThings.contains(i)) continue;
aList.add(new ItemStack(this, 1, i + 1001));
}
}
@Override
public short[] getColorForGUI(ItemStack aStack) {
- return getMaterial(aStack).mRGBa;
+ return this.getMaterial(aStack).mRGBa;
}
@Override
public String getNameForGUI(ItemStack aStack) {
- return getMaterial(aStack).mDefaultLocalName;
+ return this.getMaterial(aStack).mDefaultLocalName;
}
@Override
@@ -210,9 +205,10 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
@Override
public short[] getRGBa(ItemStack aStack) {
- return getMaterial(aStack).mRGBa;
+ return this.getMaterial(aStack).mRGBa;
}
+ @Override
public boolean onEntityItemUpdate(EntityItem aItemEntity) {
return false;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java
index 0cfc062fb9..c4838905e1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java
@@ -69,15 +69,15 @@ public class GTMetaItemEnhancer {
.duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes);
}
- if (m.getFluid(1) == null && m.getGas(1) == null) continue;
- if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue;
+ if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName))
+ continue;
addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i, true);
// addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false);
}
for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) {
Materials m = NoMetaValue.get(i);
- if (m.getFluid(1) == null && m.getGas(1) == null) continue;
- if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue;
+ if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName))
+ continue;
addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i + 1001, true);
// addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java
index 8883e72e61..f0da014b02 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java
@@ -554,7 +554,7 @@ public class PlatinumSludgeOverHaul {
if (GT_Utility.isStackValid(realEntry.getKey())
&& BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) {
ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey());
- if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny))
+ if (!dust.equals(association.mPrefix) && !dustTiny.equals(association.mPrefix)
|| !association.mMaterial.mMaterial.equals(Materials.Platinum))
if (GT_Utility.isStackValid(realEntry.getValue())
&& BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) {
@@ -587,8 +587,8 @@ public class PlatinumSludgeOverHaul {
maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes
|| map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes
- || map.mUnlocalizedName.equals("gt.recipe.eyeofharmony")
- || map.mUnlocalizedName.equals("gtpp.recipe.quantumforcesmelter"))
+ || "gt.recipe.eyeofharmony".equals(map.mUnlocalizedName)
+ || "gtpp.recipe.quantumforcesmelter".equals(map.mUnlocalizedName))
continue;
HashSet<GT_Recipe> toDel = new HashSet<>();
recipeloop: for (GT_Recipe recipe : map.mRecipeList) {
@@ -596,112 +596,97 @@ public class PlatinumSludgeOverHaul {
for (int i = 0; i < recipe.mFluidOutputs.length; i++) {
if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop;
- else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes)
+ if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes)
|| map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) {
- if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility
- .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) {
- recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000);
- recipe.reloadOwner();
- } else
- if (GT_Utility
- .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) {
- recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000);
- recipe.reloadOwner();
- } else
- if (GT_Utility.areFluidsEqual(
- Materials.Osmium.getMolten(1),
- recipe.mFluidOutputs[i])) {
- recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000);
- recipe.reloadOwner();
- }
- } else {
- if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility
- .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility
- .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- else if (GT_Utility
- .areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i]))
- toDel.add(recipe);
- }
+ if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])
+ || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]))
+ toDel.add(recipe);
+ else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) {
+ recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000);
+ recipe.reloadOwner();
+ } else
+ if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) {
+ recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000);
+ recipe.reloadOwner();
+ } else
+ if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) {
+ recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000);
+ recipe.reloadOwner();
+ }
+ } else if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])
+ || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])
+ || GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])
+ || GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i]))
+ toDel.add(recipe);
+ else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i]))
+ toDel.add(recipe);
}
for (int i = 0; i < recipe.mOutputs.length; i++) {
if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue;
- if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i])
+ if ((BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i])
|| BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i])
- || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) {
- if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) {
- for (int j = 0; j < recipe.mInputs.length; j++)
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop;
- int amount = recipe.mOutputs[i].stackSize * 2;
- recipe.mOutputs[i] = LeachResidue.get(dust, amount);
- recipe.reloadOwner();
- }
+ || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i]))
+ && !BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) {
+ for (ItemStack mInput : recipe.mInputs)
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
+ int amount = recipe.mOutputs[i].stackSize * 2;
+ recipe.mOutputs[i] = LeachResidue.get(dust, amount);
+ recipe.reloadOwner();
}
- if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i])
+ if ((BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i])
|| BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i])
- || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) {
- if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) {
- for (int j = 0; j < recipe.mInputs.length; j++)
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop;
- int amount = recipe.mOutputs[i].stackSize * 2;
- recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount);
- recipe.reloadOwner();
- }
+ || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i]))
+ && !BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) {
+ for (ItemStack mInput : recipe.mInputs)
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
+ int amount = recipe.mOutputs[i].stackSize * 2;
+ recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount);
+ recipe.reloadOwner();
}
if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue;
// Pt
if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Platinum)) {
- for (int j = 0; j < recipe.mInputs.length; j++) {
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop;
+ for (ItemStack mInput : recipe.mInputs) {
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
}
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) {
+ if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustImpure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustPure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2);
recipe.reloadOwner();
- } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) {
+ } else if (dustSmall.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2);
recipe.reloadOwner();
- } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) {
+ } else if (dustTiny.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2);
recipe.reloadOwner();
}
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Palladium)) {
- for (int j = 0; j < recipe.mInputs.length; j++) {
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop;
+ for (ItemStack mInput : recipe.mInputs) {
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
}
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustImpure)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustPure)) {
+ if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustImpure
+ .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustPure.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4);
recipe.reloadOwner();
- } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustSmall)) {
+ } else if (dustSmall
+ .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4);
recipe.reloadOwner();
} else
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustTiny)) {
+ if (dustTiny
+ .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4);
@@ -710,27 +695,26 @@ public class PlatinumSludgeOverHaul {
} else
if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Osmium)) {
- for (int j = 0; j < recipe.mInputs.length; j++) {
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j]))
- continue recipeloop;
+ for (ItemStack mInput : recipe.mInputs) {
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
}
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustImpure)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustPure)) {
+ if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustImpure.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustPure.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount);
recipe.reloadOwner();
- } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustSmall)) {
+ } else if (dustSmall
+ .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(IrOsLeachResidue.get(dustSmall), amount);
recipe.reloadOwner();
} else
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustTiny)) {
+ if (dustTiny.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(IrOsLeachResidue.get(dustTiny), amount);
@@ -739,27 +723,27 @@ public class PlatinumSludgeOverHaul {
} else
if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Iridium)) {
- for (int j = 0; j < recipe.mInputs.length; j++) {
- if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j]))
- continue recipeloop;
+ for (ItemStack mInput : recipe.mInputs) {
+ if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
}
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustImpure)
- || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustPure)) {
+ if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustImpure.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
+ || dustPure.equals(
+ GT_OreDictUnificator
+ .getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount);
recipe.reloadOwner();
- } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustSmall)) {
+ } else if (dustSmall.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(IrLeachResidue.get(dustSmall), amount);
recipe.reloadOwner();
} else
- if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix
- .equals(dustTiny)) {
+ if (dustTiny.equals(
+ GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) {
int amount = recipe.mOutputs[i].stackSize;
recipe.mOutputs[i] = BW_Util
.setStackSize(IrLeachResidue.get(dustTiny), amount);
@@ -808,8 +792,8 @@ public class PlatinumSludgeOverHaul {
private static void setnewMaterialInRecipe(Object obj) {
String inputName = "output";
String inputItemName = "input";
- if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)) {
- if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) {
+ if (!(obj instanceof ShapedOreRecipe) && !(obj instanceof ShapelessOreRecipe)) {
+ if (obj instanceof ShapedRecipes || obj instanceof ShapelessRecipes) {
inputName = "recipeOutput";
inputItemName = "recipeItems";
} else if (GTPlusPlus.isModLoaded()) {
@@ -892,21 +876,19 @@ public class PlatinumSludgeOverHaul {
}
for (Object stack : stacks) {
- if (stack instanceof ItemStack) {
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack))
- return true;
- }
+ if (stack instanceof ItemStack
+ && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack))
+ return true;
}
boolean allSame = false;
for (Object stack : stacks) {
- if (stack instanceof ItemStack) {
- allSame = BW_Util.checkStackAndPrefix((ItemStack) stack)
- && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat);
- } else {
+ if (!(stack instanceof ItemStack)) {
allSame = false;
break;
}
+ allSame = BW_Util.checkStackAndPrefix((ItemStack) stack)
+ && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat);
if (!allSame) break;
}
return allSame;
@@ -915,13 +897,10 @@ public class PlatinumSludgeOverHaul {
}
private static boolean isInBlackList(ItemStack stack) {
- if (stack == null) return true;
-
- if (stack.getItem() instanceof BW_MetaGenerated_Items) return true;
-
- if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) return true;
-
- if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true;
+ if (stack == null || stack.getItem() instanceof BW_MetaGenerated_Items
+ || MainMod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId)
+ || BartWorksCrossmod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId))
+ return true;
if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(NewHorizonsCoreMod.ID)
&& !stack.getUnlocalizedName().contains("dust")
@@ -938,8 +917,8 @@ public class PlatinumSludgeOverHaul {
if (stack.getItem() instanceof GT_Generic_Item) {
if (!BW_Util.checkStackAndPrefix(stack)) return false;
- return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST)
- .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix))
+ return !Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST)
+ .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)
|| Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST)
.contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial);
}
@@ -947,9 +926,8 @@ public class PlatinumSludgeOverHaul {
if (GTPlusPlus.isModLoaded()) {
try {
if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent")
- .isAssignableFrom(stack.getItem().getClass())
- && !(stack.getUnlocalizedName().contains("dust")
- || stack.getUnlocalizedName().contains("Dust")))
+ .isAssignableFrom(stack.getItem().getClass()) && !stack.getUnlocalizedName().contains("dust")
+ && !stack.getUnlocalizedName().contains("Dust"))
return true;
if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular")
.isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass()))
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
index a71bfe8b92..5d6e82a929 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
@@ -60,17 +60,18 @@ import gregtech.api.interfaces.ISubTagContainer;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
-@SuppressWarnings("ALL")
public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public static final LinkedHashSet<Werkstoff> werkstoffHashSet = new LinkedHashSet<>();
public static final LinkedHashMap<Short, Werkstoff> werkstoffHashMap = new LinkedHashMap<>();
public static final LinkedHashMap<String, Werkstoff> werkstoffNameHashMap = new LinkedHashMap<>();
- public static final Map<String, String> modNameOverrides = new HashMap() {
+ public static final Map<String, String> modNameOverrides = new HashMap<>() {
+
+ private static final long serialVersionUID = 6399917619058898648L;
{
- put(GalaxySpace.ID, DARK_PURPLE + "GalaxySpace");
+ this.put(GalaxySpace.ID, DARK_PURPLE + "GalaxySpace");
}
};
@@ -139,7 +140,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
materials.mIconSet,
(List) materials.mOreByProducts,
new Pair<>(materials, 1));
- if (!(mID > 31_766 && mID <= 32_767)) throw new IllegalArgumentException();
+ if (mID <= 31_766 || mID > 32_767) throw new IllegalArgumentException();
this.stats.mass = materials.getMass();
this.stats.protons = materials.getProtons();
this.stats.meltingPoint = materials.mMeltingPoint;
@@ -160,6 +161,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
Pair<ISubTagContainer, Integer>... contents) {
@@ -174,6 +176,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
Pair<ISubTagContainer, Integer>... contents) {
@@ -188,6 +191,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
@@ -203,6 +207,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
@@ -218,6 +223,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
@@ -234,6 +240,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
@@ -242,12 +249,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.mOreByProducts.addAll(oreByProduct);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
Pair<ISubTagContainer, Integer>... contents) {
this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
@@ -256,6 +265,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.mOreByProducts.addAll(oreByProduct);
}
+ @SafeVarargs
public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type,
Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet,
Pair<ISubTagContainer, Integer>... contents) {
@@ -282,7 +292,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1)
this.toolTip += "(" + getFormula((Materials) p.getKey())
+ ")"
- + (BW_Util.subscriptNumber(p.getValue()));
+ + BW_Util.subscriptNumber(p.getValue());
else this.toolTip += getFormula((Materials) p.getKey())
+ (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
}
@@ -290,17 +300,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1)
this.toolTip += "(" + getFormula((Werkstoff) p.getKey())
+ ")"
- + (BW_Util.subscriptNumber(p.getValue()));
+ + BW_Util.subscriptNumber(p.getValue());
else this.toolTip += getFormula((Werkstoff) p.getKey())
+ (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
}
- } else {
- if (p.getKey() instanceof Materials) {
- this.toolTip += getFormula((Materials) p.getKey())
- + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
- } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey())
+ } else if (p.getKey() instanceof Materials) {
+ this.toolTip += getFormula((Materials) p.getKey())
+ (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
- }
+ } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey())
+ + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
}
} else this.toolTip = toolTip;
@@ -368,7 +376,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
Werkstoff.werkstoffHashMap.put(this.mID, this);
Werkstoff.werkstoffNameHashMap.put(this.defaultName, this);
- this.owner = getMaterialOwner();
+ this.owner = this.getMaterialOwner();
}
private static String getFormula(Materials material) {
@@ -380,23 +388,24 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public Werkstoff addAdditionalOreDict(String s) {
- ADDITIONAL_OREDICT.add(s);
+ this.ADDITIONAL_OREDICT.add(s);
return this;
}
public HashSet<String> getADDITIONAL_OREDICT() {
- return ADDITIONAL_OREDICT;
+ return this.ADDITIONAL_OREDICT;
}
public void setTCAspects(Pair<Object, Integer>... pAspectsArr) {
this.stats.mTC_Aspects = pAspectsArr;
}
+ @SuppressWarnings("unchecked")
public Pair<Object, Integer>[] getTCAspects(int ratio) {
if (this.stats.mTC_Aspects == null) {
HashSet<TC_Aspects.TC_AspectStack> tc_aspectStacks = new HashSet<>();
HashSet<Pair<Object, Integer>> set = new HashSet<>();
- for (Pair p : this.getContents().getValue()) {
+ for (Pair<?, ?> p : this.getContents().getValue()) {
if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects);
if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects()));
}
@@ -414,7 +423,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public List<TC_Aspects.TC_AspectStack> getGTWrappedTCAspects() {
final List<TC_Aspects.TC_AspectStack> ret = new ArrayList<>();
- Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> {
+ Arrays.stream(this.getTCAspects()).forEach(objectIntegerPair -> {
try {
new TC_Aspects.TC_AspectStack(
TC_Aspects.valueOf(
@@ -448,7 +457,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
case MIXTURE:
case BIOLOGICAL: {
for (int i = 0; i < this.CONTENTS.toArray().length; i++) {
- ret += ((Pair<ISubTagContainer, Integer>) this.CONTENTS.toArray()[i]).getValue();
+ ret += (int) this.CONTENTS.toArray(new Pair[0])[i].getValue();
}
break;
}
@@ -491,12 +500,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public String getLocalizedName() {
return GT_LanguageManager.addStringLocalization(
String.format("bw.werkstoff.%05d.name", this.mID),
- defaultName,
+ this.defaultName,
!GregTech_API.sPostloadFinished);
}
public String getVarName() {
- return this.defaultName.replaceAll(" ", "");
+ return this.defaultName.replace(" ", "");
}
public String getToolTip() {
@@ -506,7 +515,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public String getLocalizedToolTip() {
return GT_LanguageManager.addStringLocalization(
String.format("bw.werkstoff.%05d.tooltip", this.mID),
- toolTip,
+ this.toolTip,
!GregTech_API.sPostloadFinished);
}
@@ -579,31 +588,28 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public byte getToolQuality() {
- return this.stats
- .getQualityOverride() > 0
- ? this.stats.getQualityOverride()
- : (byte) ((15f * (((float) this.getStats().getProtons() / 188f)
- + (float) this.getStats().getMeltingPoint() / 10801f))
- / (float) this.getContents().getKey());
+ return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride()
+ : (byte) (15f * (this.getStats().getProtons() / 188f + this.getStats().getMeltingPoint() / 10801f)
+ / (float) this.getContents().getKey());
}
public float getToolSpeed() {
return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride()
: Math.max(
1f,
- 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint()
- + (float) this.getStats().getProtons())
+ 2f * (-this.getStats().getMass() + 0.1f * this.getStats().getMeltingPoint()
+ + this.getStats().getProtons())
* 0.1f
/ (float) this.getContents().getKey()
* 0.1f
- * (float) this.getToolQuality());
+ * this.getToolQuality());
}
public int getDurability() {
return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride()
- : (int) (this.stats.durMod
- * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass())
- / (float) this.getContents().getKey()));
+ : (int) (this.stats.durMod * (0.01f * this.getStats().getMeltingPoint()
+ * this.getStats().getMass()
+ / (float) this.getContents().getKey()));
}
/**
@@ -631,7 +637,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public String getOwner() {
- return owner;
+ return this.owner;
}
private String getMaterialOwner() {
@@ -656,15 +662,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
UNDEFINED;
public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) {
- switch (T) {
- case COMPOUND:
- case BIOLOGICAL:
- return new Werkstoff.Stats().setElektrolysis(true);
- case MIXTURE:
- return new Werkstoff.Stats().setCentrifuge(true);
- default:
- return new Werkstoff.Stats();
- }
+ return switch (T) {
+ case COMPOUND, BIOLOGICAL -> new Werkstoff.Stats().setElektrolysis(true);
+ case MIXTURE -> new Werkstoff.Stats().setCentrifuge(true);
+ default -> new Werkstoff.Stats();
+ };
}
}
@@ -750,7 +752,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public void setExtension() {
- isExtension = !isExtension;
+ this.isExtension = !this.isExtension;
}
public static int getPrefixDataRaw(OrePrefixes prefixes) {
@@ -759,7 +761,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public boolean isExtension() {
- return isExtension;
+ return this.isExtension;
}
// public byte toGenerateSecondary = 0b0000000;
@@ -809,19 +811,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
@Deprecated
public Werkstoff.GenerationFeatures removeGems() {
- if (this.hasGems()) this.toGenerate = (long) (this.toGenerate ^ 0b100);
+ if (this.hasGems()) this.toGenerate = this.toGenerate ^ 0b100;
return this;
}
@Deprecated
public Werkstoff.GenerationFeatures removeDusts() {
- if (this.hasDusts()) this.toGenerate = (long) (this.toGenerate ^ 0b1);
+ if (this.hasDusts()) this.toGenerate = this.toGenerate ^ 0b1;
return this;
}
@Deprecated
public Werkstoff.GenerationFeatures removeOres() {
- if (this.hasOres()) this.toGenerate = (long) (this.toGenerate ^ 0b1000);
+ if (this.hasOres()) this.toGenerate = this.toGenerate ^ 0b1000;
return this;
}
@@ -886,7 +888,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public Werkstoff.GenerationFeatures onlyDust() {
- this.toGenerate = (long) (0b1);
+ this.toGenerate = 0b1;
return this;
}
@@ -894,17 +896,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
* Automatically adds Simple Metal Working Items
*/
public Werkstoff.GenerationFeatures addMetalItems() {
- this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0b10);
+ this.toGenerate = this.addSimpleMetalWorkingItems().toGenerate | 0b10;
return this;
}
public Werkstoff.GenerationFeatures disable() {
- this.toGenerate = (long) (0);
+ this.toGenerate = 0;
return this;
}
public Werkstoff.GenerationFeatures addCells() {
- this.toGenerate = (long) (this.toGenerate | 0b10000);
+ this.toGenerate = this.toGenerate | 0b10000;
return this;
}
@@ -919,7 +921,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public Werkstoff.GenerationFeatures addMolten() {
- this.toGenerate = (long) (this.toGenerate | 0b1000000);
+ this.toGenerate = this.toGenerate | 0b1000000;
return this;
}
@@ -927,17 +929,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
* Automatically adds Simple Metal Working Items
*/
public Werkstoff.GenerationFeatures addGems() {
- this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0x4);
+ this.toGenerate = this.addSimpleMetalWorkingItems().toGenerate | 0x4;
return this;
}
public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() {
- this.toGenerate = (long) (this.toGenerate | 0b10000000);
+ this.toGenerate = this.toGenerate | 0b10000000;
return this;
}
public Werkstoff.GenerationFeatures addCasings() {
- this.toGenerate = (long) (this.toGenerate | 0x382);
+ this.toGenerate = this.toGenerate | 0x382;
return this;
}
@@ -947,22 +949,22 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() {
- this.toGenerate = (long) (this.toGenerate | 0x100);
+ this.toGenerate = this.toGenerate | 0x100;
return this;
}
public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() {
- this.toGenerate = (long) (this.toGenerate | 0x200);
+ this.toGenerate = this.toGenerate | 0x200;
return this;
}
public Werkstoff.GenerationFeatures addPrefix(OrePrefixes prefixes) {
- this.toGenerate = (long) (this.toGenerate | this.getPrefixDataRaw(prefixes));
+ this.toGenerate = this.toGenerate | getPrefixDataRaw(prefixes);
return this;
}
public Werkstoff.GenerationFeatures removePrefix(OrePrefixes prefixes) {
- this.toGenerate = (long) (this.toGenerate ^ this.getPrefixDataRaw(prefixes));
+ this.toGenerate = this.toGenerate ^ getPrefixDataRaw(prefixes);
return this;
}
}
@@ -1027,7 +1029,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public int getDurOverride() {
- return durOverride;
+ return this.durOverride;
}
public Werkstoff.Stats setDurOverride(int durOverride) {
@@ -1036,7 +1038,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public float getSpeedOverride() {
- return speedOverride;
+ return this.speedOverride;
}
public Werkstoff.Stats setSpeedOverride(float speedOverride) {
@@ -1045,7 +1047,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public byte getQualityOverride() {
- return qualityOverride;
+ return this.qualityOverride;
}
public Werkstoff.Stats setQualityOverride(byte qualityOverride) {
@@ -1068,7 +1070,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
float durMod = 1f;
public float getDurMod() {
- return durMod;
+ return this.durMod;
}
public void setDurMod(float durMod) {
@@ -1097,14 +1099,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof Werkstoff.Stats)) return false;
+ if (!(o instanceof Werkstoff.Stats that)) return false;
- Werkstoff.Stats that = (Werkstoff.Stats) o;
-
- if (this.boilingPoint != that.boilingPoint) return false;
- if (this.meltingPoint != that.meltingPoint) return false;
- if (this.mass != that.mass) return false;
- if (this.protons != that.protons) return false;
+ if (this.boilingPoint != that.boilingPoint || this.meltingPoint != that.meltingPoint
+ || this.mass != that.mass
+ || this.protons != that.protons)
+ return false;
if (this.neutrons != that.neutrons) return false;
if (this.electrons != that.electrons) return false;
if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false;
@@ -1159,7 +1159,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
byte enchantmentlvl = 3;
public byte getEnchantmentlvl() {
- return enchantmentlvl;
+ return this.enchantmentlvl;
}
public Werkstoff.Stats setEnchantmentlvl(byte enchantmentlvl) {
@@ -1193,7 +1193,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public int getMeltingVoltage() {
- return meltingVoltage;
+ return this.meltingVoltage;
}
public boolean isElektrolysis() {
@@ -1223,9 +1223,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public FluidState getFluidState() {
if ((this.quality & 0x40) != 0) {
return FluidState.GAS;
- } else {
- return FluidState.LIQUID;
}
+ return FluidState.LIQUID;
}
public Werkstoff.Stats setGas(boolean gas) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
index 23c0331b9a..b9855ab1a3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
@@ -139,7 +139,7 @@ import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.RecipeOutput;
import ic2.api.recipe.Recipes;
-@SuppressWarnings({ "unchecked", "deprecation" })
+@SuppressWarnings("deprecation")
public class WerkstoffLoader {
private WerkstoffLoader() {}
@@ -169,7 +169,7 @@ public class WerkstoffLoader {
} catch (NullPointerException | IllegalArgumentException ignored) {}
// add tiberium
- Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false);
+ EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false);
bottle.mDefaultStackSize = 1;
Werkstoff.GenerationFeatures.initPrefixLogic();
@@ -1440,7 +1440,7 @@ public class WerkstoffLoader {
if (ret != null) return ret;
}
if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID());
- else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID());
+ if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID());
else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID());
else if (orePrefixes == OrePrefixes.blockCasing)
return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID());
@@ -1453,7 +1453,7 @@ public class WerkstoffLoader {
public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) {
ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount);
if (stack != null) return stack;
- else MainMod.LOGGER.catching(
+ MainMod.LOGGER.catching(
Level.ERROR,
new Exception(
"NO SUCH ITEM! " + orePrefixes
@@ -1478,9 +1478,9 @@ public class WerkstoffLoader {
MainMod.LOGGER.info(
"Making Meta Items for BW Materials took " + (timepost - timepre)
+ "ns/"
- + ((timepost - timepre) / 1000000)
+ + (timepost - timepre) / 1000000
+ "ms/"
- + ((timepost - timepre) / 1000000000)
+ + (timepost - timepre) / 1000000000
+ "s!");
}
@@ -1491,12 +1491,12 @@ public class WerkstoffLoader {
ProgressManager.ProgressBar progressBar = ProgressManager
.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1);
DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre));
- Integer[] clsArr = new Integer[0];
+ Integer[] clsArr = {};
int size = 0;
if (BetterLoadingScreen.isModLoaded()) clsArr = CLSCompat.initCls();
- IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { new ToolLoader(), new DustLoader(),
- new GemLoader(), new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(),
+ IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(),
+ new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(),
new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(),
new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() };
@@ -1536,14 +1536,15 @@ public class WerkstoffLoader {
MainMod.LOGGER.info(
"Loading Processing Recipes for BW Materials took " + (timepost - timepre)
+ "ns/"
- + ((timepost - timepre) / 1000000)
+ + (timepost - timepre) / 1000000
+ "ms/"
- + ((timepost - timepre) / 1000000000)
+ + (timepost - timepre) / 1000000000
+ "s!");
registered = true;
}
}
+ @SuppressWarnings("unchecked")
private static void addSubTags() {
WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability);
WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed);
@@ -1590,7 +1591,8 @@ public class WerkstoffLoader {
if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) {
W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM);
break;
- } else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Iron) {
+ }
+ if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Iron) {
W.add(SubTag.ELECTROMAGNETIC_SEPERATION_IRON);
break;
} else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Gold) {
@@ -1649,12 +1651,13 @@ public class WerkstoffLoader {
&& (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0
&& OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) {
DebugLog.log(
- "Found: " + (p + werkstoff.getVarName())
+ "Found: " + p
+ + werkstoff.getVarName()
+ " in GT material system, disable and reroute my Items to that, also add a Tooltip.");
werkstoff.getGenerationFeatures().setBlacklist(p);
}
- WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal
- | werkstoff.getGenerationFeatures().toGenerate);
+ WerkstoffLoader.toGenerateGlobal = WerkstoffLoader.toGenerateGlobal
+ | werkstoff.getGenerationFeatures().toGenerate;
}
DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal);
if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) {
@@ -1781,8 +1784,8 @@ public class WerkstoffLoader {
}
private static void runGTItemDataRegistrator() {
- IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { new BridgeMaterialsLoader(),
- new AssociationLoader(), new CasingRegistrator() };
+ IWerkstoffRunnable[] registrations = { new BridgeMaterialsLoader(), new AssociationLoader(),
+ new CasingRegistrator() };
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
for (IWerkstoffRunnable registration : registrations) {
registration.run(werkstoff);
@@ -1821,6 +1824,7 @@ public class WerkstoffLoader {
* used for the miners mostly removing this hacky material from the materials map instantly. we only need the item
* data.
*/
+ @SuppressWarnings("unchecked")
private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() {
Map<String, Materials> MATERIALS_MAP = null;
@@ -1855,7 +1859,7 @@ public class WerkstoffLoader {
Set<Map.Entry<IRecipeInput, RecipeOutput>> remset = new HashSet<>();
for (Map.Entry<IRecipeInput, RecipeOutput> curr : Recipes.macerator.getRecipes().entrySet()) {
if (curr.getKey() instanceof RecipeInputOreDict) {
- if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) {
+ if ("oreNULL".equalsIgnoreCase(((RecipeInputOreDict) curr.getKey()).input)) {
remset.add(curr);
}
for (ItemStack stack : curr.getValue().items) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
index 0d3fdc2f58..b7387653b2 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
@@ -79,10 +79,10 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb;
public class AdditionalRecipes {
- private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance
- .getMappingsFor((byte) 2));
- private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance
- .getMappingsFor((byte) 1));
+ private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = (BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance
+ .getMappingsFor((byte) 2);
+ private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = (BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance
+ .getMappingsFor((byte) 1);
private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0);
private static void runBWRecipes() {
@@ -458,7 +458,7 @@ public class AdditionalRecipes {
new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 36) },
null,
(i + 1) * 750,
- BW_Util.getMachineVoltageFromTier((i + 1)),
+ BW_Util.getMachineVoltageFromTier(i + 1),
CLEANROOM));
}
// IV-LuV
@@ -478,7 +478,7 @@ public class AdditionalRecipes {
new FluidStack[] { new FluidStack(solderIndalloy, (i + 1) * 36) },
null,
(i + 1) * 750,
- BW_Util.getMachineVoltageFromTier((i + 1)),
+ BW_Util.getMachineVoltageFromTier(i + 1),
CLEANROOM));
}
// ZPM
@@ -486,7 +486,7 @@ public class AdditionalRecipes {
new BWRecipes.DynamicGTRecipe(
false,
new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3),
- WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)),
+ WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1),
BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 3),
ItemList.Circuit_Parts_DiodeASMD.get((7 + 6) * 4),
ItemList.Circuit_Parts_CapacitorASMD.get((7 + 6) * 4),
@@ -504,7 +504,7 @@ public class AdditionalRecipes {
new BWRecipes.DynamicGTRecipe(
false,
new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3),
- WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)),
+ WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1),
BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 3),
ItemList.Circuit_Parts_DiodeASMD.get((8 + 6) * 4),
ItemList.Circuit_Parts_CapacitorASMD.get((8 + 6) * 4),
@@ -523,7 +523,7 @@ public class AdditionalRecipes {
new BWRecipes.DynamicGTRecipe(
false,
new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3),
- WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)),
+ WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1),
BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3),
ItemList.Circuit_Parts_DiodeXSMD.get((i + 6) * 4),
ItemList.Circuit_Parts_CapacitorXSMD.get((i + 6) * 4),
@@ -648,7 +648,7 @@ public class AdditionalRecipes {
Materials werkstoffBridgeMaterial = null;
boolean aElementSet = false;
for (Element e : Element.values()) {
- if (e.toString().equals("Uuo")) {
+ if ("Uuo".equals(e.toString())) {
werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial()
: new Materials(
-1,
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java
index f31945f154..03b9315c11 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java
@@ -48,13 +48,11 @@ public class AspectLoader implements IWerkstoffRunnable {
werkstoff.getTCAspects(
enabledOrePrefixes == OrePrefixes.ore ? 1
: (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)));
- } else if (enabledOrePrefixes.mMaterialAmount >= 0L) {
- if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes)))
- // noinspection unchecked
- ThaumcraftHandler.AspectAdder.addAspectViaBW(
- werkstoff.get(enabledOrePrefixes),
- new Pair<>(TC_Aspects.PERDITIO.mAspect, 1));
- }
+ } else if (enabledOrePrefixes.mMaterialAmount >= 0L
+ && Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes)))
+ ThaumcraftHandler.AspectAdder.addAspectViaBW(
+ werkstoff.get(enabledOrePrefixes),
+ new Pair<>(TC_Aspects.PERDITIO.mAspect, 1));
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java
index cb8ce95b4d..7942554934 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java
@@ -40,11 +40,11 @@ public class CasingLoader implements IWerkstoffRunnable {
if (werkstoff == BW_GT_MaterialReference.Wood /* || werkstoff == BW_GT_MaterialReference.WoodSealed */) {
addCasingRecipes(werkstoff, plank);
} else {
- if (!(werkstoff.hasGenerationFeature(blockCasing) && werkstoff.doesOreDictedItemExists(plate)
- && werkstoff.doesOreDictedItemExists(screw)
- && werkstoff.doesOreDictedItemExists(gearGtSmall)
- && werkstoff.doesOreDictedItemExists(gearGt)
- && werkstoff.doesOreDictedItemExists(plateDouble)))
+ if (!werkstoff.hasGenerationFeature(blockCasing) || !werkstoff.doesOreDictedItemExists(plate)
+ || !werkstoff.doesOreDictedItemExists(screw)
+ || !werkstoff.doesOreDictedItemExists(gearGtSmall)
+ || !werkstoff.doesOreDictedItemExists(gearGt)
+ || !werkstoff.doesOreDictedItemExists(plateDouble))
return;
addCasingRecipes(werkstoff, plateDouble);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java
index 1d8f8678a2..3382697708 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java
@@ -127,7 +127,7 @@ public class CellLoader implements IWerkstoffRunnable {
stOutputs.add(
((Werkstoff) container.getKey()).get(
dust,
- (tracker.get(container.getKey()).getKey() + container.getValue())));
+ tracker.get(container.getKey()).getKey() + container.getValue()));
stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
}
}
@@ -218,7 +218,7 @@ public class CellLoader implements IWerkstoffRunnable {
}
- if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
+ if (Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
Materials werkstoffBridgeMaterial = null;
boolean ElementSet = false;
for (Element e : Element.values()) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java
index 4909461018..23a1576eb4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java
@@ -50,7 +50,7 @@ public class CrushedLoader implements IWerkstoffRunnable {
if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return;
if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) {
- if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
+ if (Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10));
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10));
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
index 48d37851e4..74a2d78414 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
@@ -70,104 +70,80 @@ public class DustLoader implements IWerkstoffRunnable {
|| werkstoff.getGenerationFeatures().hasChemicalRecipes()) {
for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue()
.toArray(new Pair[0])) {
- if (container.getKey() instanceof Materials) {
- if ((((Materials) container.getKey()).getGas(0) != null
- || ((Materials) container.getKey()).getFluid(0) != null
- || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID)
- && ((Materials) container.getKey()).getDust(0) == null) {
- FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue());
+ final ISubTagContainer key = container.getKey();
+ final int value = container.getValue();
+ if (key instanceof Materials materialKey) {
+ if ((materialKey.getGas(0) != null || materialKey.getFluid(0) != null
+ || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) {
+ FluidStack tmpFl = materialKey.getGas(1000L * value);
if (tmpFl == null || tmpFl.getFluid() == null) {
- tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue());
+ tmpFl = materialKey.getFluid(1000L * value);
}
flOutputs.add(tmpFl);
if (flOutputs.size() > 1) {
- if (!tracker.containsKey(container.getKey())) {
- stOutputs.add(((Materials) container.getKey()).getCells(container.getValue()));
- tracker.put(
- container.getKey(),
- new Pair<>(container.getValue(), stOutputs.size() - 1));
+ if (!tracker.containsKey(key)) {
+ stOutputs.add(materialKey.getCells(value));
+ tracker.put(key, new Pair<>(value, stOutputs.size() - 1));
} else {
- stOutputs.add(
- ((Materials) container.getKey()).getCells(
- tracker.get(container.getKey()).getKey() + container.getValue()));
- stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
+ stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value));
+ stOutputs.remove(tracker.get(key).getValue() + 1);
}
- cells += container.getValue();
+ cells += value;
}
} else {
- if (((Materials) container.getKey()).getDust(container.getValue()) == null) {
- if (((Materials) container.getKey()).getCells(container.getValue()) != null
- && (((Materials) container.getKey()).getMolten(0) != null
- || ((Materials) container.getKey()).getSolid(0) != null)) {
- FluidStack tmpFl = ((Materials) container.getKey())
- .getMolten(1000L * container.getValue());
- if (tmpFl == null || tmpFl.getFluid() == null) {
- tmpFl = ((Materials) container.getKey()).getSolid(1000L * container.getValue());
- }
- flOutputs.add(tmpFl);
- if (flOutputs.size() > 1) {
- if (!tracker.containsKey(container.getKey())) {
- stOutputs.add(
- ((Materials) container.getKey()).getCells(container.getValue()));
- tracker.put(
- container.getKey(),
- new Pair<>(container.getValue(), stOutputs.size() - 1));
- } else {
- stOutputs.add(
- ((Materials) container.getKey()).getCells(
- tracker.get(container.getKey()).getKey()
- + container.getValue()));
- stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
- }
- cells += container.getValue();
+ if (materialKey.getDust(value) == null) {
+ if (materialKey.getCells(value) == null
+ || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null)
+ continue;
+ FluidStack tmpFl = materialKey.getMolten(1000L * value);
+ if (tmpFl == null || tmpFl.getFluid() == null) {
+ tmpFl = materialKey.getSolid(1000L * value);
+ }
+ flOutputs.add(tmpFl);
+ if (flOutputs.size() > 1) {
+ if (!tracker.containsKey(key)) {
+ stOutputs.add(materialKey.getCells(value));
+ tracker.put(key, new Pair<>(value, stOutputs.size() - 1));
+ } else {
+ stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value));
+ stOutputs.remove(tracker.get(key).getValue() + 1);
}
- } else continue;
+ cells += value;
+ }
}
- if (!tracker.containsKey(container.getKey())) {
- stOutputs.add(((Materials) container.getKey()).getDust(container.getValue()));
- tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1));
+ if (!tracker.containsKey(key)) {
+ stOutputs.add(materialKey.getDust(value));
+ tracker.put(key, new Pair<>(value, stOutputs.size() - 1));
} else {
- stOutputs.add(
- ((Materials) container.getKey()).getDust(
- tracker.get(container.getKey()).getKey() + container.getValue()));
- stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
+ stOutputs.add(materialKey.getDust(tracker.get(key).getKey() + value));
+ stOutputs.remove(tracker.get(key).getValue() + 1);
}
}
- } else if (container.getKey() instanceof Werkstoff) {
- if (((Werkstoff) container.getKey()).getStats().isGas()
- || ((Werkstoff) container.getKey()).hasItemType(cell)) {
- FluidStack tmpFl = ((Werkstoff) container.getKey())
- .getFluidOrGas(1000 * container.getValue());
+ } else if (key instanceof Werkstoff werkstoffKey) {
+ if (werkstoffKey.getStats().isGas() || werkstoffKey.hasItemType(cell)) {
+ FluidStack tmpFl = werkstoffKey.getFluidOrGas(1000 * value);
if (tmpFl == null || tmpFl.getFluid() == null) {
- tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue());
+ tmpFl = werkstoffKey.getFluidOrGas(1000 * value);
}
flOutputs.add(tmpFl);
if (flOutputs.size() > 1) {
- if (!tracker.containsKey(container.getKey())) {
- stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue()));
- tracker.put(
- container.getKey(),
- new Pair<>(container.getValue(), stOutputs.size() - 1));
+ if (!tracker.containsKey(key)) {
+ stOutputs.add(werkstoffKey.get(cell, value));
+ tracker.put(key, new Pair<>(value, stOutputs.size() - 1));
} else {
- stOutputs.add(
- ((Werkstoff) container.getKey()).get(
- cell,
- tracker.get(container.getKey()).getKey() + container.getValue()));
- stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
+ stOutputs.add(werkstoffKey.get(cell, tracker.get(key).getKey() + value));
+ stOutputs.remove(tracker.get(key).getValue() + 1);
}
- cells += container.getValue();
+ cells += value;
}
} else {
- if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue;
- if (!tracker.containsKey(container.getKey())) {
- stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue()));
- tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1));
+ if (!werkstoffKey.hasItemType(dust)) continue;
+ if (!tracker.containsKey(key)) {
+ stOutputs.add(werkstoffKey.get(dust, value));
+ tracker.put(key, new Pair<>(value, stOutputs.size() - 1));
} else {
- stOutputs.add(
- ((Werkstoff) container.getKey()).get(
- dust,
- (tracker.get(container.getKey()).getKey() + container.getValue())));
- stOutputs.remove(tracker.get(container.getKey()).getValue() + 1);
+ stOutputs.add(werkstoffKey.get(dust, tracker.get(key).getKey() + value));
+ stOutputs.remove(tracker.get(key).getValue() + 1);
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java
index 912452d490..d57ee89da8 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java
@@ -51,6 +51,7 @@ import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.enums.TierEU;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
@@ -61,7 +62,7 @@ public class GemLoader implements IWerkstoffRunnable {
public void run(Werkstoff werkstoff) {
if (werkstoff.hasItemType(gem)) {
if (werkstoff.getGenerationFeatures().hasSifterRecipes()
- || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) {
+ || werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust)) {
GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block))
.duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes);
@@ -172,12 +173,15 @@ public class GemLoader implements IWerkstoffRunnable {
.itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).duration(2 * MINUTES)
.eut(TierEU.RECIPE_LV).addTo(sLatheRecipes);
+ final ITexture texture = TextureFactory.of(
+ Textures.BlockIcons.MACHINE_CASINGS[2][0],
+ TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false));
GregTech_API.registerCover(
werkstoff.get(lens),
- TextureFactory.of(
- Textures.BlockIcons.MACHINE_CASINGS[2][0],
- TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)),
- new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex));
+ texture,
+ new gregtech.common.covers.GT_Cover_Lens(
+ BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex,
+ texture));
GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3))
.duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java
index 4fb6adc378..8e1aa3bd59 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java
@@ -107,7 +107,6 @@ public class MoltenCellLoader implements IWerkstoffRunnable {
GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).fluidOutputs(werkstoff.getMolten(72))
.duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes);
-
}
if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) {
@@ -175,11 +174,10 @@ public class MoltenCellLoader implements IWerkstoffRunnable {
}
- if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()) {
- if (!werkstoff.hasItemType(plateDouble)) {
- return;
- }
+ if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()
+ && !werkstoff.hasItemType(plateDouble)) {
// No multiple plate molds
+ return;
}
// Tank "Recipe"
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
index 46f546319d..79d74219a3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
@@ -73,75 +73,74 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable {
1,
null);
for (OrePrefixes prefixes : values()) {
- if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) {
- if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
- if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
- boolean ElementSet = false;
- for (Element e : Element.values()) {
- if (e.toString().equals(werkstoff.getToolTip())) {
- if (e.mLinkedMaterials.size() > 0) break;
- werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null
- ? werkstoff.getBridgeMaterial()
- : Materials.get(werkstoff.getVarName()) != Materials._NULL
- ? Materials.get(werkstoff.getVarName())
- : new Materials(
- -1,
- werkstoff.getTexSet(),
- werkstoff.getToolSpeed(),
- werkstoff.getDurability(),
- werkstoff.getToolQuality(),
- 0,
- werkstoff.getRGBA()[0],
- werkstoff.getRGBA()[1],
- werkstoff.getRGBA()[2],
- werkstoff.getRGBA()[3],
- werkstoff.getVarName(),
- werkstoff.getDefaultName(),
- 0,
- 0,
- werkstoff.getStats().getMeltingPoint(),
- werkstoff.getStats().getMeltingPoint(),
- werkstoff.getStats().isBlastFurnace(),
- false,
- 0,
- 1,
- 1,
- null);
- werkstoffBridgeMaterial.mElement = e;
- e.mLinkedMaterials = new ArrayList<>();
- e.mLinkedMaterials.add(werkstoffBridgeMaterial);
- if (werkstoff.hasItemType(dust)) {
- GT_OreDictUnificator
- .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false);
- GT_OreDictUnificator
- .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true);
- }
- ElementSet = true;
- break;
+ if (prefixes != cell || !Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
+ if (prefixes == dust && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())
+ && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
+ boolean ElementSet = false;
+ for (Element e : Element.values()) {
+ if (e.toString().equals(werkstoff.getToolTip())) {
+ if (e.mLinkedMaterials.size() > 0) break;
+ werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null
+ ? werkstoff.getBridgeMaterial()
+ : Materials.get(werkstoff.getVarName()) != Materials._NULL
+ ? Materials.get(werkstoff.getVarName())
+ : new Materials(
+ -1,
+ werkstoff.getTexSet(),
+ werkstoff.getToolSpeed(),
+ werkstoff.getDurability(),
+ werkstoff.getToolQuality(),
+ 0,
+ werkstoff.getRGBA()[0],
+ werkstoff.getRGBA()[1],
+ werkstoff.getRGBA()[2],
+ werkstoff.getRGBA()[3],
+ werkstoff.getVarName(),
+ werkstoff.getDefaultName(),
+ 0,
+ 0,
+ werkstoff.getStats().getMeltingPoint(),
+ werkstoff.getStats().getMeltingPoint(),
+ werkstoff.getStats().isBlastFurnace(),
+ false,
+ 0,
+ 1,
+ 1,
+ null);
+ werkstoffBridgeMaterial.mElement = e;
+ e.mLinkedMaterials = new ArrayList<>();
+ e.mLinkedMaterials.add(werkstoffBridgeMaterial);
+ if (werkstoff.hasItemType(dust)) {
+ GT_OreDictUnificator
+ .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false);
+ GT_OreDictUnificator
+ .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true);
}
+ ElementSet = true;
+ break;
}
- if (!ElementSet) {
- continue;
- }
+ }
+ if (!ElementSet) {
+ continue;
+ }
- if (werkstoff.hasItemType(dust)) {
- ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L);
- Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan");
- Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip());
- GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
- false,
- new BWRecipes.DynamicGTRecipe(
- false,
- new ItemStack[] { werkstoff.get(prefixes) },
- new ItemStack[] { scannerOutput },
- ItemList.Tool_DataOrb.get(1L),
- null,
- null,
- null,
- (int) (werkstoffBridgeMaterial.getMass() * 8192L),
- 30,
- 0));
- }
+ if (werkstoff.hasItemType(dust)) {
+ ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L);
+ Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan");
+ Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip());
+ GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
+ false,
+ new BWRecipes.DynamicGTRecipe(
+ false,
+ new ItemStack[] { werkstoff.get(prefixes) },
+ new ItemStack[] { scannerOutput },
+ ItemList.Tool_DataOrb.get(1L),
+ null,
+ null,
+ null,
+ (int) (werkstoffBridgeMaterial.getMass() * 8192L),
+ 30,
+ 0));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java
index 6bb0da9300..bd3b30a95a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java
@@ -60,8 +60,8 @@ public class OreDictHandler {
(short) tmp.getItemDamage());
GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem());
if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem()));
- if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID)
- && !UI.modId.equals("BWCore")) {
+ if (!MainMod.MOD_ID.equals(UI.modId) && !BartWorksCrossmod.MOD_ID.equals(UI.modId)
+ && !"BWCore".equals(UI.modId)) {
OreDictHandler.cacheNonBW.add(p2);
}
}
@@ -70,14 +70,15 @@ public class OreDictHandler {
}
public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount) {
- if (OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")) != null) {
- Pair<Integer, Short> p = OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", ""));
+ if (OreDictHandler.cache.get(prefixes + elementName.replace(" ", "")) != null) {
+ Pair<Integer, Short> p = OreDictHandler.cache.get(prefixes + elementName.replace(" ", ""));
return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue());
- } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).isEmpty()) {
+ }
+ if (!OreDictionary.getOres(prefixes + elementName.replace(" ", "")).isEmpty()) {
ItemStack tmp = GT_OreDictUnificator
- .get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).get(0).copy()).copy();
+ .get(OreDictionary.getOres(prefixes + elementName.replace(" ", "")).get(0).copy()).copy();
OreDictHandler.cache.put(
- prefixes + elementName.replaceAll(" ", ""),
+ prefixes + elementName.replace(" ", ""),
new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()));
tmp.stackSize = amount;
return tmp;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
index 1efa707f2d..0590b522ca 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
@@ -138,26 +138,26 @@ public abstract class BW_OreLayer extends GT_Worldgen {
int i;
if (this.mSecondaryMeta > 0) {
for (i = tMinY - 1; i < tMinY + 2; ++i) {
- if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
+ if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false);
}
}
}
- if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
+ if (this.mBetweenMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
wasPlaced = this
.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false);
}
if (this.mPrimaryMeta > 0) {
for (i = tMinY + 3; i < tMinY + 6; ++i) {
- if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
+ if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false);
}
}
}
- if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) {
+ if (this.mSporadicMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) {
wasPlaced = this
.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false);
}
@@ -174,10 +174,10 @@ public abstract class BW_OreLayer extends GT_Worldgen {
private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) {
if (aRandom.nextInt(
- Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0)
- return true;
- if (aRandom.nextInt(
- Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)
+ Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0
+ || aRandom.nextInt(
+ Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity))
+ == 0)
return true;
return false;
}
@@ -187,10 +187,10 @@ public abstract class BW_OreLayer extends GT_Worldgen {
TileEntity te = aWorld.getTileEntity(aX, aY, aZ);
if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) return true;
- if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0)
- || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0)
- || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0)
- || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) {
+ if (aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0
+ || aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0
+ || aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0
+ || aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0) {
return isSmallOre
? BW_MetaGenerated_SmallOres.setOreBlock(
aWorld,
@@ -216,52 +216,49 @@ public abstract class BW_OreLayer extends GT_Worldgen {
}
public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block) {
- if (!GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) {
- aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
- Block tBlock = aWorld.getBlock(aX, aY, aZ);
- Block tOreBlock = GregTech_API.sBlockOres1;
- if (aMetaData < 0 || tBlock == Blocks.air) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) return true;
+ aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
+ Block tBlock = aWorld.getBlock(aX, aY, aZ);
+ Block tOreBlock = GregTech_API.sBlockOres1;
+ if (aMetaData < 0 || tBlock == Blocks.air) {
+ return false;
+ } else {
+ if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) {
return false;
- } else {
- if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) {
- return false;
- }
- aMetaData += 5000;
- aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof GT_TileEntity_Ores) {
- ((GT_TileEntity_Ores) tTileEntity).mMetaData = (short) aMetaData;
- }
- return true;
}
- } else return true;
+ aMetaData += 5000;
+ aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0);
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof GT_TileEntity_Ores ore) {
+ ore.mMetaData = (short) aMetaData;
+ }
+ return true;
+ }
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof BW_OreLayer)) return false;
-
- BW_OreLayer that = (BW_OreLayer) o;
-
- if (bwOres != that.bwOres) return false;
- if (mMinY != that.mMinY) return false;
- if (mWeight != that.mWeight) return false;
- if (mDensity != that.mDensity) return false;
- if (mSize != that.mSize) return false;
- if (mMaxY != that.mMaxY) return false;
- if (mPrimaryMeta != that.mPrimaryMeta) return false;
- if (mSecondaryMeta != that.mSecondaryMeta) return false;
- if (mBetweenMeta != that.mBetweenMeta) return false;
- return mSporadicMeta == that.mSporadicMeta;
+ if (!(o instanceof BW_OreLayer that)) return false;
+
+ if (this.bwOres != that.bwOres || this.mMinY != that.mMinY
+ || this.mWeight != that.mWeight
+ || this.mDensity != that.mDensity)
+ return false;
+ if (this.mSize != that.mSize) return false;
+ if (this.mMaxY != that.mMaxY) return false;
+ if (this.mPrimaryMeta != that.mPrimaryMeta) return false;
+ if (this.mSecondaryMeta != that.mSecondaryMeta) return false;
+ if (this.mBetweenMeta != that.mBetweenMeta) return false;
+ return this.mSporadicMeta == that.mSporadicMeta;
}
@Override
public int hashCode() {
return MurmurHash3.murmurhash3_x86_32(
- ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize)
- .putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta)
- .putInt(mSporadicMeta).array(),
+ ByteBuffer.allocate(37).put(this.bwOres).putInt(this.mMinY).putInt(this.mWeight).putInt(this.mDensity)
+ .putInt(this.mSize).putInt(this.mMaxY).putInt(this.mPrimaryMeta).putInt(this.mSecondaryMeta)
+ .putInt(this.mBetweenMeta).putInt(this.mSporadicMeta).array(),
0,
37,
31);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java
index ac4f909e5c..983a3b653c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java
@@ -81,7 +81,7 @@ public class BW_WordGenerator implements IWorldGenerator {
XSTR fmlRandom = new XSTR(worldSeed);
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
- long chunkSeed = (xSeed * xChunk + zSeed * zChunk) ^ worldSeed;
+ long chunkSeed = xSeed * xChunk + zSeed * zChunk ^ worldSeed;
fmlRandom.setSeed(chunkSeed);
return new XSTR(fmlRandom.nextInt());
}
@@ -96,10 +96,10 @@ public class BW_WordGenerator implements IWorldGenerator {
if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk)
&& this.surroundingChunksLoaded(xCenter, zCenter)) {
BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk);
- if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) {
+ if (BW_OreLayer.sWeight > 0 && BW_OreLayer.sList.size() > 0) {
boolean temp = true;
int tRandomWeight;
- for (int i = 0; (i < 256) && (temp); i++) {
+ for (int i = 0; i < 256 && temp; i++) {
tRandomWeight = random.nextInt(BW_OreLayer.sWeight);
for (BW_OreLayer tWorldGen : BW_OreLayer.sList) {
if (!tWorldGen.isGenerationAllowed(this.mWorld, this.mDimensionType, this.mDimensionType))
@@ -120,7 +120,7 @@ public class BW_WordGenerator implements IWorldGenerator {
this.mChunkGenerator,
this.mChunkProvider);
++attempts;
- } while ((!placed) && attempts < 25);
+ } while (!placed && attempts < 25);
temp = false;
break;
} catch (Throwable e) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java
index 27ece0dee7..f043be21b1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java
@@ -60,6 +60,7 @@ import gregtech.api.interfaces.ISubTagContainer;
public class BW_WorldGenRoss128b extends BW_OreLayer {
+ @Override
public Block getDefaultBlockToReplace() {
return Blocks.stone;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java
index fb806ccf18..e94e7b6e71 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java
@@ -39,9 +39,9 @@ import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.objects.XSTR;
import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
-@SuppressWarnings({ "ALL" })
public abstract class MapGenRuins extends WorldGenerator {
+ @SuppressWarnings("unchecked")
protected Pair<Block, Integer>[][] ToBuildWith = new Pair[4][0];
@Override
@@ -49,6 +49,7 @@ public abstract class MapGenRuins extends WorldGenerator {
return false;
}
+ @SuppressWarnings("unchecked")
protected void setFloorBlocks(int[] metas, Block... blocks) {
this.ToBuildWith[0] = new Pair[metas.length];
for (int i = 0; i < metas.length; i++) {
@@ -56,6 +57,7 @@ public abstract class MapGenRuins extends WorldGenerator {
}
}
+ @SuppressWarnings("unchecked")
protected void setWallBlocks(int[] metas, Block... blocks) {
this.ToBuildWith[1] = new Pair[metas.length];
for (int i = 0; i < metas.length; i++) {
@@ -63,6 +65,7 @@ public abstract class MapGenRuins extends WorldGenerator {
}
}
+ @SuppressWarnings("unchecked")
protected void setRoofBlocks(int[] metas, Block... blocks) {
this.ToBuildWith[2] = new Pair[metas.length];
for (int i = 0; i < metas.length; i++) {
@@ -70,6 +73,7 @@ public abstract class MapGenRuins extends WorldGenerator {
}
}
+ @SuppressWarnings("unchecked")
protected void setMiscBlocks(int[] metas, Block... blocks) {
this.ToBuildWith[3] = new Pair[metas.length];
for (int i = 0; i < metas.length; i++) {
@@ -123,7 +127,7 @@ public abstract class MapGenRuins extends WorldGenerator {
protected TileEntity reSetGTTileEntity(IGregTechTileEntity bte, World worldObj, int x, int y, int z, int meta) {
worldObj.removeTileEntity(x, y, z);
this.setBlock(worldObj, x, y, z, Blocks.air, 0);
- return setGTMachineBlock(worldObj, x, y, z, meta);
+ return this.setGTMachineBlock(worldObj, x, y, z, meta);
}
protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) {
@@ -143,12 +147,12 @@ public abstract class MapGenRuins extends WorldGenerator {
try {
GT_Runnable_MachineBlockUpdate.setDisabled();
} catch (Throwable ignored) {}
- setGTMachineBlock(worldObj, x, y, z, meta);
+ this.setGTMachineBlock(worldObj, x, y, z, meta);
BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z);
BTE.setOwnerName(ownerName);
BTE.setFrontFacing(facing);
BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z);
- checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0);
+ this.checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0);
try {
GT_Runnable_MachineBlockUpdate.setEnabled();
} catch (Throwable ignored) {}
@@ -158,8 +162,9 @@ public abstract class MapGenRuins extends WorldGenerator {
ForgeDirection facing, int depth) {
if (depth < 25) {
if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) {
- redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing);
- checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth++);
+ this.redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing);
+ this.checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth);
+ depth++;
}
} else {
worldObj.removeTileEntity(x, y, z);
@@ -169,7 +174,7 @@ public abstract class MapGenRuins extends WorldGenerator {
private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName,
ForgeDirection facing) {
- reSetGTTileEntity(BTE, worldObj, x, y, z, meta);
+ this.reSetGTTileEntity(BTE, worldObj, x, y, z, meta);
BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z);
BTE.setOwnerName(ownerName);
BTE.setFrontFacing(facing);
@@ -179,10 +184,10 @@ public abstract class MapGenRuins extends WorldGenerator {
try {
GT_Runnable_MachineBlockUpdate.setDisabled();
} catch (Throwable ignored) {}
- BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta);
+ BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) this.setGTMachineBlock(worldObj, x, y, z, meta);
MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity();
BTE.mConnections |= (byte) (1 << (byte) 4);
- BTE.mConnections |= (byte) (1 << (ForgeDirection.getOrientation(4).getOpposite().ordinal()));
+ BTE.mConnections |= (byte) (1 << ForgeDirection.getOrientation(4).getOpposite().ordinal());
BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1);
if (BPE != null) {
BTE.mConnections |= (byte) (1 << (byte) 2);
@@ -243,9 +248,13 @@ public abstract class MapGenRuins extends WorldGenerator {
rand,
5,
this.ToBuildWith[3][0]);
- } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) {
- if (dy == 1) this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1);
- if (dy == 2) this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8);
+ } else if (dx == 0 && dz == -5 && (dy == 1 || dy == 2)) {
+ if (dy == 1) {
+ this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1);
+ }
+ if (dy == 2) {
+ this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8);
+ }
} else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) {
this.setRandomBlockWAirChance(
worldObj,
@@ -255,16 +264,19 @@ public abstract class MapGenRuins extends WorldGenerator {
rand,
25,
this.ToBuildWith[1]);
- if (dy == 2) {
- if (rand.nextInt(100) < 12) if (useColor) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 2,
- z + dz,
- rand,
- 25,
- new Pair<>(Blocks.stained_glass_pane, colored));
- else this.setRandomBlockWAirChance(
+ if (dy == 2 && rand.nextInt(100) < 12) {
+ if (useColor) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 2,
+ z + dz,
+ rand,
+ 25,
+ new Pair<>(Blocks.stained_glass_pane, colored));
+ }
+ } else {
+ this.setRandomBlockWAirChance(
worldObj,
x + dx,
y + dy,
@@ -349,83 +361,113 @@ public abstract class MapGenRuins extends WorldGenerator {
}
}
}
- } else if (dy == 4) {
- if (Math.abs(dx) == 5) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 4,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[2]);
- else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + dy,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[1]);
- } else if (dy == 5) {
- if (Math.abs(dx) == 4) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 5,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[2]);
- else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + dy,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[1]);
- } else if (dy == 6) {
- if (Math.abs(dx) == 3) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 6,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[2]);
- else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + dy,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[1]);
- } else if (dy == 7) {
- if (Math.abs(dx) == 2) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 7,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[2]);
- else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + dy,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[1]);
- } else if (dy == 8) {
- if (Math.abs(dx) == 1 || Math.abs(dx) == 0) this.setRandomBlockWAirChance(
- worldObj,
- x + dx,
- y + 8,
- z + dz,
- rand,
- 25,
- this.ToBuildWith[2]);
+ } else switch (dy) {
+ case 4:
+ if (Math.abs(dx) == 5) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 4,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[2]);
+ break;
+ }
+ if (Math.abs(dz) == 5 && Math.abs(dx) < 5) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + dy,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[1]);
+ }
+ break;
+ case 5:
+ if (Math.abs(dx) == 4) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 5,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[2]);
+ break;
+ }
+ if (Math.abs(dz) == 5 && Math.abs(dx) < 4) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + dy,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[1]);
+ }
+ break;
+ case 6:
+ if (Math.abs(dx) == 3) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 6,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[2]);
+ break;
+ }
+ if (Math.abs(dz) == 5 && Math.abs(dx) < 3) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + dy,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[1]);
+ }
+ break;
+ case 7:
+ if (Math.abs(dx) == 2) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 7,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[2]);
+ break;
+ }
+ if (Math.abs(dz) == 5 && Math.abs(dx) < 2) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + dy,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[1]);
+ }
+ break;
+ case 8:
+ if (Math.abs(dx) == 1 || Math.abs(dx) == 0) {
+ this.setRandomBlockWAirChance(
+ worldObj,
+ x + dx,
+ y + 8,
+ z + dz,
+ rand,
+ 25,
+ this.ToBuildWith[2]);
+ }
+ break;
+ default:
+ break;
}
}
}
@@ -434,19 +476,22 @@ public abstract class MapGenRuins extends WorldGenerator {
int dy = 1;
int dz = 3;
for (int dx = 2; dx > -5; dx--) {
- if (set < toSet) {
- if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) {
- short meta = GT_WorldgenUtil.getMachine(secureRandom, tier);
- this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, ForgeDirection.UP);
-
- set++;
- treeinaRow = 0;
- lastset = true;
- } else {
- lastset = rand.nextBoolean();
- if (lastset) treeinaRow++;
+ if (set >= toSet) {
+ break tosetloop;
+ }
+ if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) {
+ short meta = GT_WorldgenUtil.getMachine(secureRandom, tier);
+ this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, ForgeDirection.UP);
+
+ set++;
+ treeinaRow = 0;
+ lastset = true;
+ } else {
+ lastset = rand.nextBoolean();
+ if (lastset) {
+ treeinaRow++;
}
- } else break tosetloop;
+ }
}
}
return true;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index a2ed19b776..a628c1ffb6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -234,20 +234,14 @@ public class BWRecipes {
* @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine
*/
public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) {
- switch (machine) {
- case 0:
- return sBiolab;
- case 1:
- return sBacteriaVat;
- case 2:
- return sAcidGenFuels;
- case 3:
- return sCircuitAssemblyLineMap;
- case 4:
- return sRadHatch;
- default:
- return null;
- }
+ return switch (machine) {
+ case 0 -> this.sBiolab;
+ case 1 -> this.sBacteriaVat;
+ case 2 -> this.sAcidGenFuels;
+ case 3 -> this.sCircuitAssemblyLineMap;
+ case 4 -> this.sRadHatch;
+ default -> null;
+ };
}
public static long calcDecayTicks(int x) {
@@ -255,12 +249,12 @@ public class BWRecipes {
if (x == 43) ret = 5000;
else if (x == 61) ret = 4500;
else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D);
- else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D)));
+ else ret = MathUtils.ceilLong(8000D * Math.tanh(-x / 65D) + 8000D);
return ret;
}
public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) {
- return sRadHatch.addRecipe(
+ return this.sRadHatch.addRecipe(
new DynamicGTRecipe(
false,
new ItemStack[] { item },
@@ -276,7 +270,7 @@ public class BWRecipes {
}
public boolean addRadHatch(ItemStack item, int radioLevel, int amount, int time, short[] rgba) {
- return sRadHatch.addRecipe(
+ return this.sRadHatch.addRecipe(
new DynamicGTRecipe(
false,
new ItemStack[] { item },
@@ -293,7 +287,7 @@ public class BWRecipes {
public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -310,7 +304,7 @@ public class BWRecipes {
public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances,
FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
new ItemStack[] { BioItemList.getPetriDish(null), aInput },
@@ -327,7 +321,7 @@ public class BWRecipes {
public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances,
FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
new ItemStack[] { BioItemList.getPetriDish(null), aInput },
@@ -345,7 +339,7 @@ public class BWRecipes {
@Deprecated
public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -363,7 +357,7 @@ public class BWRecipes {
@Deprecated
public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -381,7 +375,7 @@ public class BWRecipes {
@Deprecated
public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -399,7 +393,7 @@ public class BWRecipes {
@Deprecated
public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -417,7 +411,7 @@ public class BWRecipes {
@Deprecated
public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances,
FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return sBiolab.addRecipe(
+ return this.sBiolab.addRecipe(
new DynamicGTRecipe(
true,
aInputs,
@@ -440,7 +434,7 @@ public class BWRecipes {
aSievert += calculateSv(material);
aSievert = aSievert << 6;
aSievert = aSievert | glasTier;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -458,7 +452,6 @@ public class BWRecipes {
public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs,
FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv,
@Nonnegative int glasTier, int aSpecialValue, boolean exactSv) {
- byte gTier = (byte) glasTier;
int aSievert = 0;
if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv;
aSievert = aSievert << 1;
@@ -466,8 +459,8 @@ public class BWRecipes {
aSievert = aSievert << 2;
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
- aSievert = aSievert | gTier;
- return sBacteriaVat.addRecipe(
+ aSievert = aSievert | glasTier;
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -496,7 +489,7 @@ public class BWRecipes {
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
aSievert = aSievert | gTier;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -520,7 +513,7 @@ public class BWRecipes {
aSievert = aSievert << 1;
aSievert = aSievert | (exactSv ? 1 : 0);
aSievert = aSievert << 6;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -547,7 +540,7 @@ public class BWRecipes {
aSievert = aSievert << 2;
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -569,7 +562,7 @@ public class BWRecipes {
FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) {
int aSievert = 0;
aSievert = aSievert | glasTier;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -589,7 +582,7 @@ public class BWRecipes {
*/
public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture,
FluidStack[] aFluidOutputs, int aDuration, int aEUt) {
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
false,
aInputs,
@@ -617,7 +610,7 @@ public class BWRecipes {
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
aSievert = aSievert | gTier;
- return sBacteriaVat.addRecipe(
+ return this.sBacteriaVat.addRecipe(
new BacteriaVatRecipe(
true,
aInputs,
@@ -758,6 +751,7 @@ public class BWRecipes {
aNEIAllowed);
}
+ @Override
protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe,
boolean aHidden) {
aRecipe.mHidden = aHidden;
@@ -768,30 +762,29 @@ public class BWRecipes {
if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids
&& aRecipe.mInputs.length < this.mMinimalInputItems) {
return null;
- } else {
- return aCheckForCollisions && isthere != null
- && BW_Util.areStacksEqualOrNull(
- (ItemStack) isthere.mSpecialItems,
- (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe);
}
+ return aCheckForCollisions && isthere != null
+ && BW_Util
+ .areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems)
+ ? null
+ : this.add(aRecipe);
}
public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) {
- if (VanillaGT) return addRecipe(aRecipe, true, false, false);
- else return addRecipe(aRecipe);
+ if (VanillaGT) return this.addRecipe(aRecipe, true, false, false);
+ return this.addRecipe(aRecipe);
}
+ @Override
public GT_Recipe addRecipe(GT_Recipe aRecipe) {
if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(
aRecipe.mInputs[aRecipe.mInputs.length - 1],
GT_Utility.getIntegratedCircuit(32767)))
return aRecipe;
- else {
- ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1);
- nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length);
- aRecipe.mInputs = nu1;
- }
+ ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1);
+ nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length);
+ aRecipe.mInputs = nu1;
if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) {
ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1);
int i = 9 + nu.length;
@@ -875,7 +868,7 @@ public class BWRecipes {
aNEISpecialValuePost,
aShowVoltageAmperageInNEI,
aNEIAllowed);
- setSpecialSlotSensitive(true);
+ this.setSpecialSlotSensitive(true);
}
}
@@ -899,12 +892,10 @@ public class BWRecipes {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe)) return false;
-
- BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o;
+ if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe that)) return false;
- if (!Objects.equals(this.result, that.result)) return false;
- if (!Objects.equals(this.charToStackMap, that.charToStackMap)) return false;
+ if (!Objects.equals(this.result, that.result) || !Objects.equals(this.charToStackMap, that.charToStackMap))
+ return false;
// Probably incorrect - comparing Object[] arrays with Arrays.equals
return Arrays.equals(this.shape, that.shape);
}
@@ -913,8 +904,7 @@ public class BWRecipes {
public int hashCode() {
int result1 = this.result != null ? this.result.hashCode() : 0;
result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0);
- result1 = 31 * result1 + Arrays.hashCode(this.shape);
- return result1;
+ return 31 * result1 + Arrays.hashCode(this.shape);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
index 580f6f7793..5989c1b6d9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
@@ -26,7 +26,7 @@ public class BW_ColorUtil {
public static byte getDarknessFromColor(short[] rgba, int index) {
int g = rgba[index];
if (g >= 0 && g < 64) return 0;
- else if (g >= 64 && g < 160) return 1;
+ if (g >= 64 && g < 160) return 1;
else if (g >= 160 && g < 223) return 2;
else if (g >= 233 && g <= 255) return 3;
return 4;
@@ -81,7 +81,8 @@ public class BW_ColorUtil {
return Dyes._NULL;
}
return Dyes.dyePink;
- } else if (isGrenScale(tmp)) {
+ }
+ if (isGrenScale(tmp)) {
if (isCyanScale(tmp)) {
if (rgba[2] + 40 < rgba[1]) switch (getDarknessFromColor(rgba, 0)) {
case 0:
@@ -151,17 +152,17 @@ public class BW_ColorUtil {
public static boolean isBlueScale(short[] rgba) {
rgba = correctCorlorArray(rgba);
- return (rgba[2] * 2) >= (rgba[1] + rgba[0]);
+ return rgba[2] * 2 >= rgba[1] + rgba[0];
}
public static boolean isGrenScale(short[] rgba) {
rgba = correctCorlorArray(rgba);
- return (rgba[1] * 2) >= (rgba[0] + rgba[2]);
+ return rgba[1] * 2 >= rgba[0] + rgba[2];
}
public static boolean isRedScale(short[] rgba) {
rgba = correctCorlorArray(rgba);
- return (rgba[0] * 2) >= (rgba[1] + rgba[2]);
+ return rgba[0] * 2 >= rgba[1] + rgba[2];
}
public static boolean isGrayScale(short[] rgba, int magin) {
@@ -203,15 +204,15 @@ public class BW_ColorUtil {
}
public static short[] splitColorToRBGArray(int rgb) {
- return new short[] { (short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF) };
+ return new short[] { (short) (rgb >> 16 & 0xFF), (short) (rgb >> 8 & 0xFF), (short) (rgb & 0xFF) };
}
public static int getColorFromRGBArray(short[] color) {
- return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff);
+ return (color[0] & 0x0ff) << 16 | (color[1] & 0x0ff) << 8 | color[2] & 0x0ff;
}
public static int getColorFromRGBArray(int[] color) {
- return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff);
+ return (color[0] & 0x0ff) << 16 | (color[1] & 0x0ff) << 8 | color[2] & 0x0ff;
}
public static String getColorForTier(int tier) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
index 1db1293f2f..69438bff91 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
@@ -78,7 +78,6 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Shaped_Recipe;
import gregtech.api.util.GT_Utility;
-@SuppressWarnings({ "unused", "RedundantSuppression" })
public class BW_Util {
public static final int STANDART = 0;
@@ -110,10 +109,10 @@ public class BW_Util {
int newTime = recipe.mDuration;
int newVoltage = recipe.mEUt;
if (tier < oldTier) {
- newTime <<= (oldTier - tier);
+ newTime <<= oldTier - tier;
newVoltage >>= 2 * (oldTier - tier);
} else {
- newTime >>= (tier - oldTier);
+ newTime >>= tier - oldTier;
newVoltage <<= 2 * (tier - oldTier);
}
recipe.mEUt = newVoltage;
@@ -125,40 +124,19 @@ public class BW_Util {
char[] chars = b.toCharArray();
char[] nu = new char[chars.length];
for (int i = 0; i < chars.length; i++) {
- switch (chars[i]) {
- case '0':
- nu[i] = '₀';
- continue;
- case '1':
- nu[i] = '₁';
- continue;
- case '2':
- nu[i] = '₂';
- continue;
- case '3':
- nu[i] = '₃';
- continue;
- case '4':
- nu[i] = '₄';
- continue;
- case '5':
- nu[i] = '₅';
- continue;
- case '6':
- nu[i] = '₆';
- continue;
- case '7':
- nu[i] = '₇';
- continue;
- case '8':
- nu[i] = '₈';
- continue;
- case '9':
- nu[i] = '₉';
- continue;
- default:
- nu[i] = chars[i];
- }
+ nu[i] = switch (chars[i]) {
+ case '0' -> '\u2080';
+ case '1' -> '\u2081';
+ case '2' -> '\u2082';
+ case '3' -> '\u2083';
+ case '4' -> '\u2084';
+ case '5' -> '\u2085';
+ case '6' -> '\u2086';
+ case '7' -> '\u2087';
+ case '8' -> '\u2088';
+ case '9' -> '\u2089';
+ default -> chars[i];
+ };
}
return new String(nu);
}
@@ -167,37 +145,19 @@ public class BW_Util {
char[] chars = Long.toString(b.longValue()).toCharArray();
char[] nu = new char[chars.length];
for (int i = 0; i < chars.length; i++) {
- switch (chars[i]) {
- case '0':
- nu[i] = '₀';
- continue;
- case '1':
- nu[i] = '₁';
- continue;
- case '2':
- nu[i] = '₂';
- continue;
- case '3':
- nu[i] = '₃';
- continue;
- case '4':
- nu[i] = '₄';
- continue;
- case '5':
- nu[i] = '₅';
- continue;
- case '6':
- nu[i] = '₆';
- continue;
- case '7':
- nu[i] = '₇';
- continue;
- case '8':
- nu[i] = '₈';
- continue;
- case '9':
- nu[i] = '₉';
- }
+ nu[i] = switch (chars[i]) {
+ case '0' -> '\u2080';
+ case '1' -> '\u2081';
+ case '2' -> '\u2082';
+ case '3' -> '\u2083';
+ case '4' -> '\u2084';
+ case '5' -> '\u2085';
+ case '6' -> '\u2086';
+ case '7' -> '\u2087';
+ case '8' -> '\u2088';
+ case '9' -> '\u2089';
+ default -> chars[i];
+ };
}
return new String(nu);
}
@@ -206,40 +166,19 @@ public class BW_Util {
char[] chars = b.toCharArray();
char[] nu = new char[chars.length];
for (int i = 0; i < chars.length; i++) {
- switch (chars[i]) {
- case '0':
- nu[i] = '⁰';
- continue;
- case '1':
- nu[i] = '¹';
- continue;
- case '2':
- nu[i] = '²';
- continue;
- case '3':
- nu[i] = '³';
- continue;
- case '4':
- nu[i] = '⁴';
- continue;
- case '5':
- nu[i] = '⁵';
- continue;
- case '6':
- nu[i] = '⁶';
- continue;
- case '7':
- nu[i] = '⁷';
- continue;
- case '8':
- nu[i] = '⁸';
- continue;
- case '9':
- nu[i] = '⁹';
- continue;
- default:
- nu[i] = chars[i];
- }
+ nu[i] = switch (chars[i]) {
+ case '0' -> '\u2070';
+ case '1' -> '\u2071';
+ case '2' -> '\u00B2';
+ case '3' -> '\u00B3';
+ case '4' -> '\u2074';
+ case '5' -> '\u2075';
+ case '6' -> '\u2076';
+ case '7' -> '\u2077';
+ case '8' -> '\u2078';
+ case '9' -> '\u2079';
+ default -> chars[i];
+ };
}
return new String(nu);
}
@@ -248,46 +187,38 @@ public class BW_Util {
char[] chars = Long.toString(b.longValue()).toCharArray();
char[] nu = new char[chars.length];
for (int i = 0; i < chars.length; i++) {
- switch (chars[i]) {
- case '0':
- nu[i] = '⁰';
- continue;
- case '1':
- nu[i] = '¹';
- continue;
- case '2':
- nu[i] = '²';
- continue;
- case '3':
- nu[i] = '³';
- continue;
- case '4':
- nu[i] = '⁴';
- continue;
- case '5':
- nu[i] = '⁵';
- continue;
- case '6':
- nu[i] = '⁶';
- continue;
- case '7':
- nu[i] = '⁷';
- continue;
- case '8':
- nu[i] = '⁸';
- continue;
- case '9':
- nu[i] = '⁹';
- }
+ nu[i] = switch (chars[i]) {
+ case '0' -> '\u2070';
+ case '1' -> '\u2071';
+ case '2' -> '\u00B2';
+ case '3' -> '\u00B3';
+ case '4' -> '\u2074';
+ case '5' -> '\u2075';
+ case '6' -> '\u2076';
+ case '7' -> '\u2077';
+ case '8' -> '\u2078';
+ case '9' -> '\u2079';
+ default -> chars[i];
+ };
}
return new String(nu);
}
public static byte specialToByte(int aSpecialValue) {
byte special = 0;
- if (aSpecialValue == (LOWGRAVITY)) special = 1;
- else if (aSpecialValue == (CLEANROOM)) special = 2;
- else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) special = 3;
+ switch (aSpecialValue) {
+ case LOWGRAVITY:
+ special = 1;
+ break;
+ case CLEANROOM:
+ special = 2;
+ break;
+ case LOWGRAVITY | CLEANROOM:
+ special = 3;
+ break;
+ default:
+ break;
+ }
return special;
}
@@ -316,8 +247,8 @@ public class BW_Util {
if (pair.getMaterials().equals(materials)) return pair.getSievert();
}
return (int) (materials.getProtons() == 43L
- ? (materials.equals(Materials.NaquadahEnriched) ? 140
- : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43)
+ ? materials.equals(Materials.NaquadahEnriched) ? 140
+ : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43
: materials.getProtons());
}
@@ -397,7 +328,7 @@ public class BW_Util {
@Deprecated
public static int getMachineVoltageFromTier(int tier) {
- return (int) (30 * Math.pow(4, (tier - 1)));
+ return (int) (30 * Math.pow(4, tier - 1));
}
public static long getTierVoltage(int tier) {
@@ -405,7 +336,7 @@ public class BW_Util {
}
public static long getTierVoltage(byte tier) {
- return 8L << (2 * tier);
+ return 8L << 2 * tier;
}
public static byte getTier(long voltage) {
@@ -420,7 +351,7 @@ public class BW_Util {
public static String getTierName(byte tier) {
if (VN.length - 1 <= tier) return "MAX+";
- else return VN[tier];
+ return VN[tier];
}
public static String getTierNameFromVoltage(long voltage) {
@@ -428,7 +359,7 @@ public class BW_Util {
}
public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) {
- return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2);
+ return aStack1 == null && aStack2 == null || GT_Utility.areStacksEqual(aStack1, aStack2);
}
public static boolean areStacksEqualOrEachNull(ItemStack aStack1, ItemStack aStack2) {
@@ -436,9 +367,9 @@ public class BW_Util {
}
public static byte getByteFromRarity(EnumRarity rarity) {
- if (rarity.equals(EnumRarity.uncommon)) return 1;
- else if (rarity.equals(EnumRarity.epic)) return 2;
- else if (rarity.equals(EnumRarity.rare)) return 3;
+ if (EnumRarity.uncommon.equals(rarity)) return 1;
+ if (EnumRarity.epic.equals(rarity)) return 2;
+ else if (EnumRarity.rare.equals(rarity)) return 3;
return 0;
}
@@ -447,34 +378,16 @@ public class BW_Util {
*/
@Deprecated
public static byte getTierFromGlasMeta(int meta) {
- byte ret;
- switch (meta) {
- case 1:
- ret = 4;
- break;
- case 2:
- case 12:
- ret = 5;
- break;
- case 3:
- ret = 6;
- break;
- case 4:
- ret = 7;
- break;
- case 5:
- ret = 8;
- break;
- case 13:
- ret = 9;
- break;
- case 14:
- ret = 10;
- break;
- default:
- ret = 3;
- }
- return ret;
+ return switch (meta) {
+ case 1 -> 4;
+ case 2, 12 -> 5;
+ case 3 -> 6;
+ case 4 -> 7;
+ case 5 -> 8;
+ case 13 -> 9;
+ case 14 -> 10;
+ default -> 3;
+ };
}
/**
@@ -502,7 +415,7 @@ public class BW_Util {
byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage));
if (mTier == 0) {
// Long time calculation
- long xMaxProgresstime = ((long) aDuration) << 1;
+ long xMaxProgresstime = (long) aDuration << 1;
if (xMaxProgresstime > Integer.MAX_VALUE - 1) {
// make impossible if too long
base.mEUt = Integer.MAX_VALUE - 1;
@@ -580,215 +493,12 @@ public class BW_Util {
}
public static EnumRarity getRarityFromByte(byte b) {
- switch (b) {
- case 1:
- return EnumRarity.uncommon;
- case 2:
- return EnumRarity.rare;
- case 3:
- return EnumRarity.epic;
- default:
- return EnumRarity.common;
- }
- }
-
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) {
- return BW_Util.check_layer(
- aBaseMetaTileEntity,
- radius,
- yLevel,
- height,
- block,
- dmg,
- offset,
- false,
- insideCheck,
- inside,
- dmginside,
- aBaseCasingIndex);
- }
-
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, int aBaseCasingIndex) {
- return BW_Util
- .check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex);
- }
-
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) {
- return BW_Util.check_layer(
- aBaseMetaTileEntity,
- radius,
- yLevel,
- height,
- block,
- dmg,
- offset,
- controllerLayer,
- false,
- aBaseCasingIndex);
- }
-
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) {
- return BW_Util.check_layer(
- aBaseMetaTileEntity,
- radius,
- yLevel,
- height,
- block,
- dmg,
- offset,
- controllerLayer,
- freeCorners,
- false,
- block,
- dmg,
- true,
- aBaseCasingIndex);
- }
-
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside,
- int aBaseCasingIndex) {
- return BW_Util.check_layer(
- aBaseMetaTileEntity,
- radius,
- yLevel,
- height,
- block,
- dmg,
- offset,
- controllerLayer,
- false,
- insideCheck,
- inside,
- dmginside,
- true,
- aBaseCasingIndex);
- }
-
- /**
- * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter
- * @param radius the radius of the layer
- * @param yLevel the starting y level of the Layer, referenced to the Multiblock
- * @param height the height of the Layers, referenced to the Multiblock
- * @param block the block for the walls
- * @param offset the offset in most cases should be the same as the radius
- * @param controllerLayer if the layer contains the controller
- * @param freeCorners if the corners should be checked
- * @param insideCheck if the inside should be empty/filled
- * @param inside which block should be inside
- * @param allowHatches if hatches are allowed in this Layer
- * @param aBaseCasingIndex the Index for the hatches texture
- * @return if the layer check was completed
- */
- public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height,
- Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck,
- Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) {
- int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offset;
- int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offset;
- for (int x = -radius; x <= radius; x++) {
- for (int y = yLevel; y < height; y++) {
- for (int z = -radius; z <= radius; z++) {
- if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue;
- if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue;
- boolean b = Math.abs(x) < radius && Math.abs(z) != radius;
- if (insideCheck && b) {
- if (!(inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z)
- : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside))
- && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside
- || dmginside > (-1))) {
- if (!(allowHatches
- && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addDynamoToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity
- .getMetaTileEntity())
- .addEnergyInputToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(
- xDir + x,
- y,
- zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity
- .getMetaTileEntity())
- .addMaintenanceToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(
- xDir + x,
- y,
- zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity
- .getMetaTileEntity())
- .addMufflerToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(
- xDir + x,
- y,
- zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity
- .getMetaTileEntity())
- .addInputToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(
- xDir + x,
- y,
- zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity
- .getMetaTileEntity())
- .addOutputToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(
- xDir + x,
- y,
- zDir + z),
- aBaseCasingIndex)))) {
- return false;
- }
- }
- }
- if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block)
- && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) {
- if (!(allowHatches
- && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addDynamoToMachineList(
- aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addEnergyInputToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addMaintenanceToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addMufflerToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addInputToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)
- || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity())
- .addOutputToMachineList(
- aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + x, y, zDir + z),
- aBaseCasingIndex)))) {
- return false;
- }
- }
- }
- }
- }
- return true;
+ return switch (b) {
+ case 1 -> EnumRarity.uncommon;
+ case 2 -> EnumRarity.rare;
+ case 3 -> EnumRarity.epic;
+ default -> EnumRarity.common;
+ };
}
public static List<Byte> getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel,
@@ -799,8 +509,8 @@ public class BW_Util {
for (int x = -radius; x <= radius; x++) {
for (int y = yLevel; y < height; y++) {
for (int z = -radius; z <= radius; z++) {
- if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue;
- if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue;
+ if (freeCorners && Math.abs(x) == radius && Math.abs(z) == radius) continue;
+ if (controllerLayer && xDir + x == 0 && zDir + z == 0) continue;
final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius;
if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z));
if (!inside) {
@@ -813,43 +523,24 @@ public class BW_Util {
}
public static byte getCircuitTierFromOreDictName(String name) {
- switch (name) {
- case "circuitPrimitive":
- return 0;
- case "circuitBasic":
- return 1;
- case "circuitGood":
- return 2;
- case "circuitAdvanced":
- return 3;
- case "circuitData":
- return 4;
- case "circuitElite":
- return 5;
- case "circuitMaster":
- return 6;
- case "circuitUltimate":
- return 7;
- case "circuitSuperconductor":
- return 8;
- case "circuitInfinite":
- return 9;
- case "circuitBio":
- return 10;
- case "circuitNano":
- case "circuitOptical":
- return 11;
- case "circuitPiko":
- case "circuitExotic":
- return 12;
- case "circuitQuantum":
- case "circuitCosmic":
- return 13;
- case "circuitTranscendent":
- return 14;
- default:
- return -1;
- }
+ return switch (name) {
+ case "circuitPrimitive" -> 0;
+ case "circuitBasic" -> 1;
+ case "circuitGood" -> 2;
+ case "circuitAdvanced" -> 3;
+ case "circuitData" -> 4;
+ case "circuitElite" -> 5;
+ case "circuitMaster" -> 6;
+ case "circuitUltimate" -> 7;
+ case "circuitSuperconductor" -> 8;
+ case "circuitInfinite" -> 9;
+ case "circuitBio" -> 10;
+ case "circuitNano", "circuitOptical" -> 11;
+ case "circuitPiko", "circuitExotic" -> 12;
+ case "circuitQuantum", "circuitCosmic" -> 13;
+ case "circuitTranscendent" -> 14;
+ default -> -1;
+ };
}
public static byte getCircuitTierFromItemStack(ItemStack stack) {
@@ -874,14 +565,12 @@ public class BW_Util {
return ret;
}
- private static Block bw_realglasRef;
-
public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) {
byte boroTier = BorosilicateGlass.getTier(block, meta);
if (boroTier != -1) return boroTier;
- if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4;
+ if ("blockAlloyGlass".equals(block.getUnlocalizedName())) return 4;
if (block.equals(Blocks.glass)) return 3;
@@ -896,7 +585,7 @@ public class BW_Util {
public static <T> IStructureElement<T> ofGlassTiered(byte mintier, byte maxtier, byte notset,
BiConsumer<T, Byte> setter, Function<T, Byte> getter, int aDots) {
- return new IStructureElement<T>() {
+ return new IStructureElement<>() {
private final IStructureElement<T> placementDelegate = BorosilicateGlass
.ofBoroGlass(notset, mintier, maxtier, setter, getter);
@@ -906,10 +595,8 @@ public class BW_Util {
if (world.isAirBlock(x, y, z)) return false;
byte glasstier = BW_Util
.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z));
- if (glasstier == 0) return false; // is not a glass ?
- if (glasstier == notset) return false;
- if (glasstier < mintier) return false;
- if (glasstier > maxtier) return false;
+ // is not a glass ?
+ if (glasstier == 0 || glasstier == notset || glasstier < mintier || glasstier > maxtier) return false;
if (getter.apply(te) == notset) setter.accept(te, glasstier);
return getter.apply(te) == glasstier;
}
@@ -922,22 +609,22 @@ public class BW_Util {
@Override
public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return placementDelegate.placeBlock(t, world, x, y, z, trigger);
+ return this.placementDelegate.placeBlock(t, world, x, y, z, trigger);
}
@Override
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) {
- return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env);
+ return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env);
}
};
}
public static <T> IStructureElement<T> ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) {
- return new IStructureElement<T>() {
+ return new IStructureElement<>() {
private final IStructureElement<T> placementDelegate = BorosilicateGlass
- .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, (v1) -> (byte) 0);
+ .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, v1 -> (byte) 0);
@Override
public boolean check(T te, World world, int x, int y, int z) {
@@ -956,13 +643,13 @@ public class BW_Util {
@Override
public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return placementDelegate.placeBlock(t, world, x, y, z, trigger);
+ return this.placementDelegate.placeBlock(t, world, x, y, z, trigger);
}
@Override
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) {
- return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env);
+ return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env);
}
};
}
@@ -1002,7 +689,6 @@ public class BW_Util {
aRecipe);
}
- @SuppressWarnings({ "rawtypes", "unchecked" })
public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded,
int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT,
boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput,
@@ -1017,13 +703,20 @@ public class BW_Util {
boolean tThereWasARecipe = false;
for (byte i = 0; i < aRecipe.length; i++) {
- if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1);
- else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name();
- else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack
- || aRecipe[i] instanceof ItemData
- || aRecipe[i] instanceof String
- || aRecipe[i] instanceof Character))
+ if (aRecipe[i] instanceof IItemContainer itemContainer) {
+ aRecipe[i] = itemContainer.get(1);
+ continue;
+ }
+ if (aRecipe[i] instanceof Enum<?>enum_) {
+ aRecipe[i] = enum_.name();
+ continue;
+ }
+ if (aRecipe[i] != null && !(aRecipe[i] instanceof ItemStack)
+ && !(aRecipe[i] instanceof ItemData)
+ && !(aRecipe[i] instanceof String)
+ && !(aRecipe[i] instanceof Character)) {
aRecipe[i] = aRecipe[i].toString();
+ }
}
try {
@@ -1035,8 +728,9 @@ public class BW_Util {
ArrayList<Object> tRecipeList = new ArrayList<>(Arrays.asList(aRecipe));
- while (aRecipe[idx] instanceof String) {
- StringBuilder s = new StringBuilder((String) aRecipe[idx++]);
+ while (aRecipe[idx] instanceof String string) {
+ StringBuilder s = new StringBuilder(string);
+ idx++;
shape.append(s);
while (s.length() < 3) s.append(" ");
if (s.length() > 3) throw new IllegalArgumentException();
@@ -1176,7 +870,10 @@ public class BW_Util {
if (aReversible && aResult != null) {
ItemData[] tData = new ItemData[9];
int x = -1;
- for (char chr : shape.toString().toCharArray()) tData[++x] = tItemDataMap.get(chr);
+ for (char chr : shape.toString().toCharArray()) {
+ x++;
+ tData[x] = tItemDataMap.get(chr);
+ }
if (GT_Utility.arrayContainsNonNull(tData))
GT_OreDictUnificator.addItemData(aResult, new ItemData(tData));
}
@@ -1185,7 +882,8 @@ public class BW_Util {
ItemStack[] tRecipe = new ItemStack[9];
int x = -1;
for (char chr : shape.toString().toCharArray()) {
- tRecipe[++x] = tItemStackMap.get(chr);
+ x++;
+ tRecipe[x] = tItemStackMap.get(chr);
if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W)
Items.feather.setDamage(tRecipe[x], 0);
}
@@ -1213,7 +911,8 @@ public class BW_Util {
IRecipe tRecipe = tList.get(i);
if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue;
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) {
- tList.remove(i--);
+ tList.remove(i);
+ i--;
tList_sS = tList.size();
tThereWasARecipe = true;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java
index c260b6d681..3a9edb71f0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java
@@ -170,7 +170,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
}
public BioCulture setPlasmid(BioPlasmid plasmid) {
- return checkForExisting(
+ return this.checkForExisting(
new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable));
}
@@ -191,7 +191,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
}
public BioCulture setdDNA(BioDNA dDNA) {
- return checkForExisting(
+ return this.checkForExisting(
new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable));
}
@@ -203,8 +203,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (o == null || this.getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
+ if (o == null || this.getClass() != o.getClass() || !super.equals(o)) return false;
BioCulture culture = (BioCulture) o;
return this.isBreedable() == culture.isBreedable() && Objects.equals(this.getColor(), culture.getColor())
&& Objects.equals(this.getPlasmid(), culture.getPlasmid())
@@ -218,7 +217,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
ByteBuffer.allocate(17)
.putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31))
.putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID)
- .put((byte) (isBreedable() ? 1 : 0)).array(),
+ .put((byte) (this.isBreedable() ? 1 : 0)).array(),
0,
17,
31);
@@ -226,7 +225,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
@Override
public short[] getRGBA() {
- return new short[] { (short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(),
- (short) getColor().getAlpha() };
+ return new short[] { (short) this.getColor().getRed(), (short) this.getColor().getGreen(),
+ (short) this.getColor().getBlue(), (short) this.getColor().getAlpha() };
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java
index c1c6431daf..22edd60170 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java
@@ -46,6 +46,6 @@ public class BioDNA extends BioData {
@Override
public String toString() {
- return "BioDNA{" + "name='" + name + '\'' + ", ID=" + ID + '}';
+ return "BioDNA{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}';
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java
index 854bc4afba..d88ffc3aa3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java
@@ -100,9 +100,9 @@ public class BioData {
if (o == null || this.getClass() != o.getClass()) return false;
BioData bioData = (BioData) o;
return this.getID() == bioData.getID()
- || (this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier()
+ || this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier()
&& Objects.equals(this.getName(), bioData.getName())
- && this.getRarity() == bioData.getRarity());
+ && this.getRarity() == bioData.getRarity();
}
@Override
@@ -127,7 +127,7 @@ public class BioData {
@Override
public String toString() {
- return "BioData{" + "name='" + name + '\'' + ", ID=" + ID + '}';
+ return "BioData{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}';
}
public EnumRarity getRarity() {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java
index 47f94bb389..0d40d9deca 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java
@@ -46,6 +46,6 @@ public class BioPlasmid extends BioData {
@Override
public String toString() {
- return "BioPlasmid{" + "name='" + name + '\'' + ", ID=" + ID + '}';
+ return "BioPlasmid{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}';
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java
index 48aaf70b6b..d35489a151 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java
@@ -16,7 +16,6 @@ package com.github.bartimaeusnek.bartworks.util;
import java.util.HashSet;
import net.minecraft.block.Block;
-import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
@@ -51,36 +50,36 @@ public class ConnectedBlocksChecker {
int wID = w.provider.dimensionId;
- byte sides = check_sourroundings(w, x, y, z, b);
+ byte sides = this.check_sourroundings(w, x, y, z, b);
- if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) {
+ if ((sides | 0b111011) == 0b111111 && !this.hashset.contains(new Coords(x + 1, y, z, wID))) {
ret++;
- ret += get_connected(w, x + 1, y, z, b);
+ ret += this.get_connected(w, x + 1, y, z, b);
}
- if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) {
+ if ((sides | 0b110111) == 0b111111 && !this.hashset.contains(new Coords(x - 1, y, z, wID))) {
ret++;
- ret += get_connected(w, x - 1, y, z, b);
+ ret += this.get_connected(w, x - 1, y, z, b);
}
- if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) {
+ if ((sides | 0b101111) == 0b111111 && !this.hashset.contains(new Coords(x, y, z + 1, wID))) {
ret++;
- ret += get_connected(w, x, y, z + 1, b);
+ ret += this.get_connected(w, x, y, z + 1, b);
}
- if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) {
+ if ((sides | 0b011111) == 0b111111 && !this.hashset.contains(new Coords(x, y, z - 1, wID))) {
ret++;
- ret += get_connected(w, x, y, z - 1, b);
+ ret += this.get_connected(w, x, y, z - 1, b);
}
- if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) {
+ if ((sides | 0b111110) == 0b111111 && !this.hashset.contains(new Coords(x, y + 1, z, wID))) {
ret++;
- ret += get_connected(w, x, y + 1, z, b);
+ ret += this.get_connected(w, x, y + 1, z, b);
}
- if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) {
+ if ((sides | 0b111101) == 0b111111 && !this.hashset.contains(new Coords(x, y - 1, z, wID))) {
ret++;
- ret += get_connected(w, x, y - 1, z, b);
+ ret += this.get_connected(w, x, y - 1, z, b);
}
return ret;
@@ -91,9 +90,9 @@ public class ConnectedBlocksChecker {
byte ret = 0;
int wID = w.provider.dimensionId;
- if (hashset.contains(new Coords(x, y, z, wID))) return ret;
+ if (this.hashset.contains(new Coords(x, y, z, wID))) return ret;
- hashset.add(new Coords(x, y, z, wID));
+ this.hashset.add(new Coords(x, y, z, wID));
if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100);
@@ -115,58 +114,60 @@ public class ConnectedBlocksChecker {
int wID = w.provider.dimensionId;
Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID);
- for (Coords C : hashset) {
+ for (Coords C : this.hashset) {
if (GT) {
- TileEntity t;
- t = w.getTileEntity(C.x, C.y + 1, C.z);
- if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y - 1, C.z);
- if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x + 1, C.y, C.z);
- if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x - 1, C.y, C.z);
- if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y, C.z + 1);
- if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y, C.z - 1);
- if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
} else {
- if (n == w.getBlockMetadata(C.x, C.y + 1, C.z)
- && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller))
- return true;
- if (n == w.getBlockMetadata(C.x, C.y - 1, C.z)
- && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller))
+ if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)
+ || n == w.getBlockMetadata(C.x, C.y - 1, C.z)
+ && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x + 1, C.y, C.z)
- && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller))
+ && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x - 1, C.y, C.z)
- && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller))
+ && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x, C.y, C.z + 1)
- && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller))
+ && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x, C.y, C.z - 1)
- && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller))
+ && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) {
return true;
+ }
}
}
return false;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java
index eb5dd0b17d..7dee6f3f98 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java
@@ -18,7 +18,6 @@ import java.util.LinkedList;
import java.util.Queue;
import net.minecraft.block.Block;
-import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -34,45 +33,45 @@ public class ConnectedBlocksCheckerIteration {
private final Queue<Coords> kwoe = new LinkedList<>();
public long get_connected(World w, int x, int y, int z, Block b) {
- kwoe.add(new Coords(x, y, z, w.provider.dimensionId));
- hashset.add(new Coords(x, y, z, w.provider.dimensionId));
- while (!kwoe.isEmpty()) {
- Coords tocheck = kwoe.poll();
+ this.kwoe.add(new Coords(x, y, z, w.provider.dimensionId));
+ this.hashset.add(new Coords(x, y, z, w.provider.dimensionId));
+ while (!this.kwoe.isEmpty()) {
+ Coords tocheck = this.kwoe.poll();
int wID = w.provider.dimensionId;
- checked.add(tocheck);
+ this.checked.add(tocheck);
Coords c;
- if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID))
&& w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
- if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID))
&& w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
- if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID))
&& w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
- if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID))
&& w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
- if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID))
&& w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
- if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID))
+ if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID))
&& w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) {
- kwoe.add(c);
- hashset.add(c);
+ this.kwoe.add(c);
+ this.hashset.add(c);
}
}
- return hashset.size();
+ return this.hashset.size();
}
public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT) {
@@ -80,58 +79,60 @@ public class ConnectedBlocksCheckerIteration {
int wID = w.provider.dimensionId;
Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID);
- for (Coords C : hashset) {
+ for (Coords C : this.hashset) {
if (GT) {
- TileEntity t;
- t = w.getTileEntity(C.x, C.y + 1, C.z);
- if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y - 1, C.z);
- if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x + 1, C.y, C.z);
- if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x - 1, C.y, C.z);
- if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)
+ && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y, C.z + 1);
- if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
- t = w.getTileEntity(C.x, C.y, C.z - 1);
- if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) {
- if (t instanceof IGregTechTileEntity)
- if (((IGregTechTileEntity) t).getMetaTileID() == n) return true;
+ if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)
+ && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE
+ && gtTE.getMetaTileID() == n) {
+ return true;
}
} else {
- if (n == w.getBlockMetadata(C.x, C.y + 1, C.z)
- && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller))
- return true;
- if (n == w.getBlockMetadata(C.x, C.y - 1, C.z)
- && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller))
+ if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)
+ || n == w.getBlockMetadata(C.x, C.y - 1, C.z)
+ && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x + 1, C.y, C.z)
- && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller))
+ && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x - 1, C.y, C.z)
- && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller))
+ && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x, C.y, C.z + 1)
- && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller))
+ && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) {
return true;
+ }
if (n == w.getBlockMetadata(C.x, C.y, C.z - 1)
- && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller))
+ && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) {
return true;
+ }
}
}
return false;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java
index b1ece2651f..f8c33dd8e9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java
@@ -33,22 +33,15 @@ public class Coords {
}
public Coords getCoordsFromSide(ForgeDirection direction) {
- switch (direction) {
- case UP:
- return new Coords(this.x, this.y + 1, this.z, this.wID);
- case DOWN:
- return new Coords(this.x, this.y - 1, this.z, this.wID);
- case WEST:
- return new Coords(this.x - 1, this.y, this.z, this.wID);
- case EAST:
- return new Coords(this.x + 1, this.y, this.z, this.wID);
- case NORTH:
- return new Coords(this.x, this.y, this.z - 1, this.wID);
- case SOUTH:
- return new Coords(this.x, this.y, this.z + 1, this.wID);
- default:
- throw new UnsupportedOperationException("This is impossible.");
- }
+ return switch (direction) {
+ case UP -> new Coords(this.x, this.y + 1, this.z, this.wID);
+ case DOWN -> new Coords(this.x, this.y - 1, this.z, this.wID);
+ case WEST -> new Coords(this.x - 1, this.y, this.z, this.wID);
+ case EAST -> new Coords(this.x + 1, this.y, this.z, this.wID);
+ case NORTH -> new Coords(this.x, this.y, this.z - 1, this.wID);
+ case SOUTH -> new Coords(this.x, this.y, this.z + 1, this.wID);
+ default -> throw new UnsupportedOperationException("This is impossible.");
+ };
}
@Override
@@ -81,6 +74,6 @@ public class Coords {
@Override
public String toString() {
- return x + "," + y + "," + z + "," + wID;
+ return this.x + "," + this.y + "," + this.z + "," + this.wID;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java
index b3cbc9351f..e8f4330ed3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java
@@ -62,13 +62,13 @@ public class MathUtils {
}
public static byte clamp(byte amount, byte min, byte max) {
- byte inner = (amount <= max) ? amount : max;
- return (min >= inner) ? min : inner;
+ byte inner = amount <= max ? amount : max;
+ return min >= inner ? min : inner;
}
public static short clamp(short amount, short min, short max) {
- short inner = (amount <= max) ? amount : max;
- return (min >= inner) ? min : inner;
+ short inner = amount <= max ? amount : max;
+ return min >= inner ? min : inner;
}
public static int clamp(int amount, int min, int max) {
@@ -88,23 +88,23 @@ public class MathUtils {
}
public static <T extends Comparable<T>> T clamp(T val, T min, T max) {
- return (val.compareTo(min) < 0) ? min : (val.compareTo(max) > 0) ? max : val;
+ return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val;
}
public static int wrap(int input, int bound) {
- return (((input % bound) + bound) % bound);
+ return (input % bound + bound) % bound;
}
public static long wrap(long input, long bound) {
- return (((input % bound) + bound) % bound);
+ return (input % bound + bound) % bound;
}
public static double wrap(double input, double bound) {
- return (((input % bound) + bound) % bound);
+ return (input % bound + bound) % bound;
}
public static float wrap(float input, float bound) {
- return (((input % bound) + bound) % bound);
+ return (input % bound + bound) % bound;
}
public static float tanh(float x) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java
index 30b7ff76a0..e230d43415 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java
@@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.util;
public final class MurmurHash3 {
- public static final int fmix32(int h) {
+ public static int fmix32(int h) {
h ^= h >>> 16;
h *= 0x85ebca6b;
h ^= h >>> 13;
@@ -22,7 +22,7 @@ public final class MurmurHash3 {
return h;
}
- public static final long fmix64(long k) {
+ public static long fmix64(long k) {
k ^= k >>> 33;
k *= 0xff51afd7ed558ccdL;
k ^= k >>> 33;
@@ -34,15 +34,15 @@ public final class MurmurHash3 {
/**
* Gets a long from a byte buffer in little endian byte order.
*/
- public static final long getLongLittleEndian(byte[] buf, int offset) {
- return ((long) buf[offset + 7] << 56) // no mask needed
- | ((buf[offset + 6] & 0xffL) << 48)
- | ((buf[offset + 5] & 0xffL) << 40)
- | ((buf[offset + 4] & 0xffL) << 32)
- | ((buf[offset + 3] & 0xffL) << 24)
- | ((buf[offset + 2] & 0xffL) << 16)
- | ((buf[offset + 1] & 0xffL) << 8)
- | ((buf[offset] & 0xffL)); // no shift needed
+ public static long getLongLittleEndian(byte[] buf, int offset) {
+ return (long) buf[offset + 7] << 56 // no mask needed
+ | (buf[offset + 6] & 0xffL) << 48
+ | (buf[offset + 5] & 0xffL) << 40
+ | (buf[offset + 4] & 0xffL) << 32
+ | (buf[offset + 3] & 0xffL) << 24
+ | (buf[offset + 2] & 0xffL) << 16
+ | (buf[offset + 1] & 0xffL) << 8
+ | buf[offset] & 0xffL; // no shift needed
}
/**
@@ -58,15 +58,13 @@ public final class MurmurHash3 {
for (int i = offset; i < roundedEnd; i += 4) {
// little endian load order
- int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8)
- | ((data[i + 2] & 0xff) << 16)
- | (data[i + 3] << 24);
+ int k1 = data[i] & 0xff | (data[i + 1] & 0xff) << 8 | (data[i + 2] & 0xff) << 16 | data[i + 3] << 24;
k1 *= c1;
- k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
+ k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15);
k1 *= c2;
h1 ^= k1;
- h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13);
+ h1 = h1 << 13 | h1 >>> 19; // ROTL32(h1,13);
h1 = h1 * 5 + 0xe6546b64;
}
@@ -81,9 +79,9 @@ public final class MurmurHash3 {
k1 |= (data[roundedEnd + 1] & 0xff) << 8;
// fallthrough
case 1:
- k1 |= (data[roundedEnd] & 0xff);
+ k1 |= data[roundedEnd] & 0xff;
k1 *= c1;
- k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
+ k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15);
k1 *= c2;
h1 ^= k1;
}
@@ -121,7 +119,8 @@ public final class MurmurHash3 {
int nBytes = 0; // length in UTF8 bytes
while (pos < end) {
- int code = data.charAt(pos++);
+ int code = data.charAt(pos);
+ pos++;
if (code < 0x80) {
k2 = code;
bits = 8;
@@ -137,20 +136,20 @@ public final class MurmurHash3 {
* shift = 0; nBytes += 4; k1 = 0; } else { k1 |= code << shift; shift += 8; } continue;
***/
} else if (code < 0x800) {
- k2 = (0xC0 | (code >> 6)) | ((0x80 | (code & 0x3F)) << 8);
+ k2 = 0xC0 | code >> 6 | (0x80 | code & 0x3F) << 8;
bits = 16;
} else if (code < 0xD800 || code > 0xDFFF || pos >= end) {
// we check for pos>=end to encode an unpaired surrogate as 3 bytes.
- k2 = (0xE0 | (code >> 12)) | ((0x80 | ((code >> 6) & 0x3F)) << 8) | ((0x80 | (code & 0x3F)) << 16);
+ k2 = 0xE0 | code >> 12 | (0x80 | code >> 6 & 0x3F) << 8 | (0x80 | code & 0x3F) << 16;
bits = 24;
} else {
// surrogate pair
// int utf32 = pos < end ? (int) data.charAt(pos++) : 0;
- int utf32 = (int) data.charAt(pos++);
- utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF);
- k2 = (0xff & (0xF0 | (utf32 >> 18))) | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8
- | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16
- | (0x80 | (utf32 & 0x3F)) << 24;
+ int utf32 = data.charAt(pos++);
+ utf32 = (code - 0xD7C0 << 10) + (utf32 & 0x3FF);
+ k2 = 0xff & (0xF0 | utf32 >> 18) | (0x80 | utf32 >> 12 & 0x3F) << 8
+ | (0x80 | utf32 >> 6 & 0x3F) << 16
+ | (0x80 | utf32 & 0x3F) << 24;
bits = 32;
}
@@ -164,17 +163,17 @@ public final class MurmurHash3 {
// mix after we have a complete word
k1 *= c1;
- k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
+ k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15);
k1 *= c2;
h1 ^= k1;
- h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13);
+ h1 = h1 << 13 | h1 >>> 19; // ROTL32(h1,13);
h1 = h1 * 5 + 0xe6546b64;
shift -= 32;
// unfortunately, java won't let you shift 32 bits off, so we need to check for 0
if (shift != 0) {
- k1 = k2 >>> (bits - shift); // bits used == bits - newshift
+ k1 = k2 >>> bits - shift; // bits used == bits - newshift
} else {
k1 = 0;
}
@@ -186,7 +185,7 @@ public final class MurmurHash3 {
if (shift > 0) {
nBytes += shift >> 3;
k1 *= c1;
- k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
+ k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15);
k1 *= c2;
h1 ^= k1;
}
@@ -253,13 +252,13 @@ public final class MurmurHash3 {
case 10:
k2 |= (key[roundedEnd + 9] & 0xffL) << 8;
case 9:
- k2 |= (key[roundedEnd + 8] & 0xffL);
+ k2 |= key[roundedEnd + 8] & 0xffL;
k2 *= c2;
k2 = Long.rotateLeft(k2, 33);
k2 *= c1;
h2 ^= k2;
case 8:
- k1 = ((long) key[roundedEnd + 7]) << 56;
+ k1 = (long) key[roundedEnd + 7] << 56;
case 7:
k1 |= (key[roundedEnd + 6] & 0xffL) << 48;
case 6:
@@ -273,7 +272,7 @@ public final class MurmurHash3 {
case 2:
k1 |= (key[roundedEnd + 1] & 0xffL) << 8;
case 1:
- k1 |= (key[roundedEnd] & 0xffL);
+ k1 |= key[roundedEnd] & 0xffL;
k1 *= c1;
k1 = Long.rotateLeft(k1, 31);
k1 *= c2;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java
index 3d0edb9bc0..8e2e69c495 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java
@@ -161,52 +161,49 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
j2 = 1;
k2 = 0;
} // X Y Z order
- else if (x0 >= z0) {
- i1 = 1;
- j1 = 0;
- k1 = 0;
- i2 = 1;
- j2 = 0;
- k2 = 1;
- } // X Z Y order
else {
- i1 = 0;
- j1 = 0;
- k1 = 1;
+ if (x0 >= z0) {
+ i1 = 1;
+ j1 = 0;
+ k1 = 0;
+ } // X Z Y order
+ else {
+ i1 = 0;
+ j1 = 0;
+ k1 = 1;
+ }
i2 = 1;
j2 = 0;
k2 = 1;
} // Z X Y order
- } else { // x0<y0
- if (y0 < z0) {
- i1 = 0;
- j1 = 0;
- k1 = 1;
- i2 = 0;
- j2 = 1;
- k2 = 1;
- } // Z Y X order
- else if (x0 < z0) {
- i1 = 0;
- j1 = 1;
- k1 = 0;
- i2 = 0;
- j2 = 1;
- k2 = 1;
- } // Y Z X order
- else {
- i1 = 0;
- j1 = 1;
- k1 = 0;
- i2 = 1;
- j2 = 1;
- k2 = 0;
- } // Y X Z order
- }
- // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z),
- // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and
- // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where
- // c = 1/6.
+ } else if (y0 < z0) {
+ i1 = 0;
+ j1 = 0;
+ k1 = 1;
+ i2 = 0;
+ j2 = 1;
+ k2 = 1;
+ } // Z Y X order
+ else if (x0 < z0) {
+ i1 = 0;
+ j1 = 1;
+ k1 = 0;
+ i2 = 0;
+ j2 = 1;
+ k2 = 1;
+ } // Y Z X order
+ else {
+ i1 = 0;
+ j1 = 1;
+ k1 = 0;
+ i2 = 1;
+ j2 = 1;
+ k2 = 0;
+ } // Y X Z order
+ // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z),
+ // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and
+ // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where
+ // c = 1/6.
double x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords
double y1 = y0 - j1 + G3;
double z1 = z0 - k1 + G3;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java
index 7d33e56286..a51ca06a9b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java
@@ -20,6 +20,7 @@ import java.util.Optional;
public class NonNullWrappedHashMap<K, V> extends HashMap<K, V> {
+ private static final long serialVersionUID = 46345163103910175L;
private V defaultValue;
public NonNullWrappedHashMap(int initialCapacity, float loadFactor, V defaultValue) {
@@ -43,7 +44,7 @@ public class NonNullWrappedHashMap<K, V> extends HashMap<K, V> {
@Override
public V get(Object key) {
- return getOrDefault(key, defaultValue);
+ return this.getOrDefault(key, this.defaultValue);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java
index 1a96a3fd7b..5490c4bdaf 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java
@@ -18,12 +18,11 @@ import java.util.HashSet;
public class NonNullWrappedHashSet<E> extends HashSet<E> {
- public NonNullWrappedHashSet() {
- super();
- }
+ private static final long serialVersionUID = 8377161849188229010L;
+
+ public NonNullWrappedHashSet() {}
public NonNullWrappedHashSet(Collection<? extends E> c) {
- super();
this.addAll(c);
}
@@ -35,11 +34,13 @@ public class NonNullWrappedHashSet<E> extends HashSet<E> {
super(initialCapacity);
}
+ @Override
public boolean add(E e) {
if (e != null) return super.add(e);
return false;
}
+ @Override
public boolean addAll(Collection<? extends E> c) {
boolean wasChanged = false;
for (E element : c) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java
index 8f34837f9a..5f7104f958 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java
@@ -45,7 +45,7 @@ public class Pair<A, B> implements Map.Entry<A, B> {
@Override
public int hashCode() {
return MurmurHash3.murmurhash3_x86_32(
- ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(),
+ ByteBuffer.allocate(8).putInt(this.pair[0].hashCode()).putInt(this.pair[1].hashCode()).array(),
0,
8,
31);
@@ -53,18 +53,18 @@ public class Pair<A, B> implements Map.Entry<A, B> {
@Override
public A getKey() {
- return (A) pair[0];
+ return (A) this.pair[0];
}
@Override
public B getValue() {
- return (B) pair[1];
+ return (B) this.pair[1];
}
@Override
public B setValue(Object value) {
- pair[1] = value;
- return (B) pair[1];
+ this.pair[1] = value;
+ return (B) this.pair[1];
}
public Pair<A, B> copyWithNewValue(B value) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
index 9f3df5d175..dc6863b562 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
@@ -101,10 +101,9 @@ public class RecipeFinderForParallel {
tInputItem.stackSize -= tCompressedItemRecipe.get(tItem);
i.remove();
break;
- } else {
- tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize);
- tInputItem.stackSize = 0;
}
+ tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize);
+ tInputItem.stackSize = 0;
}
}
} else {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java
index 6acd417840..7d3af3eb35 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java
@@ -32,17 +32,14 @@ public class ResultWrongSievert implements CheckRecipeResult {
@Override
public String getDisplayString() {
- switch (type) {
- case EXACTLY:
- return StatCollector.translateToLocalFormatted(
- "GT5U.gui.text.wrong_sievert_exactly",
- GT_Utility.formatNumbers(required));
- case MINIMUM:
- return StatCollector.translateToLocalFormatted(
- "GT5U.gui.text.wrong_sievert_min",
- GT_Utility.formatNumbers(required));
- }
- return "";
+ return switch (this.type) {
+ case EXACTLY -> StatCollector.translateToLocalFormatted(
+ "GT5U.gui.text.wrong_sievert_exactly",
+ GT_Utility.formatNumbers(this.required));
+ case MINIMUM -> StatCollector.translateToLocalFormatted(
+ "GT5U.gui.text.wrong_sievert_min",
+ GT_Utility.formatNumbers(this.required));
+ };
}
@Override
@@ -52,22 +49,22 @@ public class ResultWrongSievert implements CheckRecipeResult {
@Override
public void encode(PacketBuffer buffer) {
- buffer.writeVarIntToBuffer(required);
- buffer.writeVarIntToBuffer(type.ordinal());
+ buffer.writeVarIntToBuffer(this.required);
+ buffer.writeVarIntToBuffer(this.type.ordinal());
}
@Override
public void decode(PacketBuffer buffer) {
- required = buffer.readVarIntFromBuffer();
- type = NeededSievertType.values()[buffer.readVarIntFromBuffer()];
+ this.required = buffer.readVarIntFromBuffer();
+ this.type = NeededSievertType.values()[buffer.readVarIntFromBuffer()];
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (o == null || this.getClass() != o.getClass()) return false;
ResultWrongSievert that = (ResultWrongSievert) o;
- return required == that.required;
+ return this.required == that.required;
}
/**
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java
index 25da35d027..6cbd1793ef 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java
@@ -23,37 +23,36 @@ import java.util.Spliterator;
import org.apache.commons.lang3.NotImplementedException;
-@SuppressWarnings("ALL")
public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
transient int size = 0;
transient AccessPriorityListNode<E> head;
transient AccessPriorityListNode<E> tail;
- public static AccessPriorityList create() {
- return new AccessPriorityList();
+ public static <E> AccessPriorityList<E> create() {
+ return new AccessPriorityList<>();
}
public AccessPriorityList() {}
@Override
public void addFirst(E t) {
- final AccessPriorityListNode<E> first = head;
+ final AccessPriorityListNode<E> first = this.head;
final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(null, t, first);
- head = newNode;
- if (first == null) tail = newNode;
+ this.head = newNode;
+ if (first == null) this.tail = newNode;
else first.setBefore(newNode);
- size++;
+ this.size++;
}
@Override
public void addLast(E t) {
- final AccessPriorityListNode<E> last = tail;
+ final AccessPriorityListNode<E> last = this.tail;
final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(last, t, null);
- tail = newNode;
- if (last == null) head = newNode;
+ this.tail = newNode;
+ if (last == null) this.head = newNode;
else last.setNext(newNode);
- size++;
+ this.size++;
}
@Override
@@ -68,10 +67,10 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public E removeFirst() {
- E first = head.getELEMENT();
- AccessPriorityListNode<E> node = head;
- head = node.getNext();
- head.setBefore(null);
+ E first = this.head.getELEMENT();
+ AccessPriorityListNode<E> node = this.head;
+ this.head = node.getNext();
+ this.head.setBefore(null);
node.destroy();
node = null;
this.size--;
@@ -80,10 +79,10 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public E removeLast() {
- E last = tail.getELEMENT();
- AccessPriorityListNode<E> node = tail;
- tail = node.getBefore();
- tail.setNext(null);
+ E last = this.tail.getELEMENT();
+ AccessPriorityListNode<E> node = this.tail;
+ this.tail = node.getBefore();
+ this.tail.setNext(null);
node.destroy();
node = null;
this.size--;
@@ -102,22 +101,22 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public E getFirst() {
- return peekFirst();
+ return this.peekFirst();
}
@Override
public E getLast() {
- return peekLast();
+ return this.peekLast();
}
@Override
public E peekFirst() {
- return head != null ? head.getELEMENT() : null;
+ return this.head != null ? this.head.getELEMENT() : null;
}
@Override
public E peekLast() {
- return tail != null ? tail.getELEMENT() : null;
+ return this.tail != null ? this.tail.getELEMENT() : null;
}
@Override
@@ -132,12 +131,12 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public int size() {
- return size;
+ return this.size;
}
@Override
public boolean isEmpty() {
- return size == 0;
+ return this.size == 0;
}
@Override
@@ -147,42 +146,42 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public Iterator<E> iterator() {
- return new AccessPriorityListIterators.AccessPriorityListIterator<>(head);
+ return new AccessPriorityListIterators.AccessPriorityListIterator<>(this.head);
}
public Iterator<AccessPriorityListNode<E>> nodeIterator() {
- return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(head);
+ return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(this.head);
}
@Override
public Iterator<E> descendingIterator() {
- return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail);
+ return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(this.tail);
}
@Override
public Object[] toArray() {
- Object[] ret = new Object[size];
+ Object[] ret = new Object[this.size];
int index = 0;
- for (Iterator<E> it = iterator(); it.hasNext(); index++) ret[index] = it.next();
+ for (Iterator<E> it = this.iterator(); it.hasNext(); index++) ret[index] = it.next();
return ret;
}
@Override
public <T> T[] toArray(T[] a) {
- T[] ret = (T[]) new Object[size];
+ T[] ret = (T[]) new Object[this.size];
int index = 0;
- for (Iterator<T> it = (Iterator<T>) iterator(); it.hasNext(); index++) ret[index] = it.next();
+ for (Iterator<T> it = (Iterator<T>) this.iterator(); it.hasNext(); index++) ret[index] = it.next();
return ret;
}
@Override
public boolean add(E e) {
- addLast(e);
+ this.addLast(e);
return true;
}
private void moveNodeUp(AccessPriorityListNode<E> node) {
- if (node == head || node.getBefore() == null) return;
+ if (node == this.head || node.getBefore() == null) return;
final AccessPriorityListNode<E> before = node.getBefore();
final AccessPriorityListNode<E> beforeBefore = before.getBefore();
final AccessPriorityListNode<E> next = node.getNext();
@@ -193,7 +192,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
// <0,1,2> <1,2,3> N<0,3,4> <3,4,5>
if (beforeBefore != null) beforeBefore.setNext(node);
- else head = node;
+ else this.head = node;
// <0,1,3> <1,2,3> N<0,3,4> <3,4,5>
before.setBefore(node);
@@ -203,7 +202,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
// <0,1,3> <3,2,4> N<0,3,4> <3,4,5>
if (next != null) next.setBefore(before);
- else tail = before;
+ else this.tail = before;
// <0,1,3> N<0,3,4> <3,2,4> <2,4,5>
node.setNext(before);
@@ -211,15 +210,14 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
}
AccessPriorityListNode<E> getNode(int index) {
- if (index <= (size / 2)) {
- AccessPriorityListNode<E> x = head;
+ if (index <= this.size / 2) {
+ AccessPriorityListNode<E> x = this.head;
for (int i = 0; i < index; i++) x = x.getNext();
return x;
- } else {
- AccessPriorityListNode<E> x = tail;
- for (int i = size - 1; i > index; i--) x = x.getBefore();
- return x;
}
+ AccessPriorityListNode<E> x = this.tail;
+ for (int i = this.size - 1; i > index; i--) x = x.getBefore();
+ return x;
}
@Override
@@ -228,7 +226,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
}
private boolean isValidIndex(int index) {
- if (index >= 0 && index < size) return true;
+ if (index >= 0 && index < this.size) return true;
throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!");
}
@@ -239,7 +237,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public E poll() {
- return removeFirst();
+ return this.removeFirst();
}
@Override
@@ -249,17 +247,17 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public E peek() {
- return getFirst();
+ return this.getFirst();
}
@Override
public void push(E e) {
- addFirst(e);
+ this.addFirst(e);
}
@Override
public E pop() {
- return removeFirst();
+ return this.removeFirst();
}
@Override
@@ -300,8 +298,8 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public void clear() {
- if (tail != null) {
- AccessPriorityListNode<E> node = tail;
+ if (this.tail != null) {
+ AccessPriorityListNode<E> node = this.tail;
while (node.getBefore() != null) {
node.setNext(null);
node.setPriority(0L);
@@ -315,33 +313,33 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
}
public void addPrioToNode(AccessPriorityListNode<E> node) {
- addPrioToNode(node, 1L);
+ this.addPrioToNode(node, 1L);
}
public void addPrioToNode(AccessPriorityListNode<E> node, long prio) {
long current = node.getPriority();
- if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0))
+ if (current == Long.MAX_VALUE || current > 0 && prio > 0 && prio + current < 0)
node.setPriority(Long.MAX_VALUE);
else node.setPriority(current + prio);
while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) {
- moveNodeUp(node);
+ this.moveNodeUp(node);
}
}
public void addPrioToNode(int index, long prio) {
- if (!isValidIndex(index)) return;
- AccessPriorityListNode<E> node = getNode(index);
- addPrioToNode(node, prio);
+ if (!this.isValidIndex(index)) return;
+ AccessPriorityListNode<E> node = this.getNode(index);
+ this.addPrioToNode(node, prio);
}
public void addPrioToNode(int index) {
- addPrioToNode(index, 1L);
+ this.addPrioToNode(index, 1L);
}
@Override
public E get(int index) {
- if (!isValidIndex(index)) return null;
- AccessPriorityListNode<E> node = getNode(index);
+ if (!this.isValidIndex(index)) return null;
+ AccessPriorityListNode<E> node = this.getNode(index);
return node.getELEMENT();
}
@@ -372,7 +370,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
@Override
public ListIterator<E> listIterator() {
- return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head, tail, false);
+ return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this.head, this.tail, false);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java
index dc826caa6d..bf3883e69f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java
@@ -32,51 +32,51 @@ public class AccessPriorityListIterators {
boolean reverse) {
this.head = head;
this.tail = tail;
- current = reverse ? tail : head;
+ this.current = reverse ? tail : head;
this.reverse = reverse;
}
public AccessPriorityListListIterator(AccessPriorityList<E> list, int index) {
this.head = list.head;
this.tail = list.tail;
- current = list.getNode(index);
- counter = index;
+ this.current = list.getNode(index);
+ this.counter = index;
}
@Override
public boolean hasNext() {
- return reverse ? head != current : tail != current;
+ return this.reverse ? this.head != this.current : this.tail != this.current;
}
@Override
public E next() {
- counter++;
- E ret = current.getELEMENT();
- current = current.getNext();
+ this.counter++;
+ E ret = this.current.getELEMENT();
+ this.current = this.current.getNext();
return ret;
}
@Override
public boolean hasPrevious() {
- return !reverse ? head != current : tail != current;
+ return !this.reverse ? this.head != this.current : this.tail != this.current;
}
@Override
public E previous() {
- counter--;
- E ret = current.getELEMENT();
- current = current.getBefore();
+ this.counter--;
+ E ret = this.current.getELEMENT();
+ this.current = this.current.getBefore();
return ret;
}
@Override
public int nextIndex() {
- return counter + 1;
+ return this.counter + 1;
}
@Override
public int previousIndex() {
- return counter - 1;
+ return this.counter - 1;
}
@Override
@@ -106,13 +106,13 @@ public class AccessPriorityListIterators {
@Override
public boolean hasNext() {
- return current != null;
+ return this.current != null;
}
@Override
public E next() {
- E ret = current.getELEMENT();
- current = current.getNext();
+ E ret = this.current.getELEMENT();
+ this.current = this.current.getNext();
return ret;
}
}
@@ -128,13 +128,13 @@ public class AccessPriorityListIterators {
@Override
public boolean hasNext() {
- return current != null;
+ return this.current != null;
}
@Override
public E next() {
- E ret = current.getELEMENT();
- current = current.getBefore();
+ E ret = this.current.getELEMENT();
+ this.current = this.current.getBefore();
return ret;
}
}
@@ -150,13 +150,13 @@ public class AccessPriorityListIterators {
@Override
public boolean hasNext() {
- return current != null;
+ return this.current != null;
}
@Override
public AccessPriorityListNode<E> next() {
- AccessPriorityListNode<E> ret = current;
- current = current.getNext();
+ AccessPriorityListNode<E> ret = this.current;
+ this.current = this.current.getNext();
return ret;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java
index 94bf309ef9..72b266917f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java
@@ -15,7 +15,7 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist;
public class AccessPriorityListNode<E> {
- public static final AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null);
+ public static final AccessPriorityListNode<?> EMPTY_NODE = new AccessPriorityListNode<>(null);
private final E ELEMENT;
private long priority = Long.MIN_VALUE;
@@ -23,12 +23,12 @@ public class AccessPriorityListNode<E> {
private AccessPriorityListNode<E> before;
public AccessPriorityListNode(E element) {
- ELEMENT = element;
+ this.ELEMENT = element;
}
public AccessPriorityListNode(AccessPriorityListNode<E> before, E element, AccessPriorityListNode<E> next) {
this.ELEMENT = element;
- connect(next, before);
+ this.connect(next, before);
}
public void connect(AccessPriorityListNode<E> next, AccessPriorityListNode<E> before) {
@@ -37,11 +37,11 @@ public class AccessPriorityListNode<E> {
}
public E getELEMENT() {
- return ELEMENT;
+ return this.ELEMENT;
}
public long getPriority() {
- return priority;
+ return this.priority;
}
public void setPriority(long priority) {
@@ -49,7 +49,7 @@ public class AccessPriorityListNode<E> {
}
public AccessPriorityListNode<E> getNext() {
- return next;
+ return this.next;
}
public void setNext(AccessPriorityListNode<E> next) {
@@ -57,7 +57,7 @@ public class AccessPriorityListNode<E> {
}
public AccessPriorityListNode<E> getBefore() {
- return before;
+ return this.before;
}
public void setBefore(AccessPriorityListNode<E> before) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java
index d331b95e16..d797e68d8a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java
@@ -20,20 +20,20 @@ import java.util.function.Function;
public class FlowerSet<T> implements Set<T> {
- public FlowerSet(int petals, Function<FlowerNode, Integer> comparerison) {
+ public FlowerSet(int petals, Function<FlowerNode<T>, Integer> comparerison) {
this.petals = petals;
this.comparerison = comparerison;
}
final int petals;
- final Function<FlowerNode, Integer> comparerison;
+ final Function<FlowerNode<T>, Integer> comparerison;
- public static FlowerSet createBase64(Function<FlowerNode, Integer> comparerison) {
- return new FlowerSet(64, comparerison);
+ public static <U> FlowerSet<U> createBase64(Function<FlowerNode<U>, Integer> comparerison) {
+ return new FlowerSet<>(64, comparerison);
}
- public static FlowerSet createHexflower(Function<FlowerNode, Integer> comparerison) {
- return new FlowerSet(16, comparerison);
+ public static <U> FlowerSet<U> createHexflower(Function<FlowerNode<U>, Integer> comparerison) {
+ return new FlowerSet<>(16, comparerison);
}
@Override
@@ -103,39 +103,43 @@ public class FlowerSet<T> implements Set<T> {
private final FlowerSet<V> map;
final V value;
- final FlowerNode[] links;
+ final FlowerNode<V>[] links;
+ @SuppressWarnings("unchecked")
public FlowerNode(V value, FlowerSet<V> map) {
this.value = value;
this.map = map;
- links = new FlowerNode[map.petals];
+ this.links = new FlowerNode[map.petals];
}
private static final int DEPTH = 20480;
- public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) {
+ public void TryToSetSingleNode(FlowerNode<V> node, FlowerNode<V> toset, int place, int depth) {
if (depth > DEPTH) throw new IllegalStateException("Recursive Call went too deep.");
if (node.links[place] == null) node.links[place] = toset;
- else TryToSetSingleNode(node.links[place], toset, place, depth++);
+ else {
+ this.TryToSetSingleNode(node.links[place], toset, place, depth);
+ depth++;
+ }
}
- public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) {
+ public void TryToSetSingleNode(FlowerNode<V> node, FlowerNode<V> toset, int place) {
if (node.links[place] == null) node.links[place] = toset;
- else TryToSetSingleNode(node.links[place], toset, place, 0);
+ else this.TryToSetSingleNode(node.links[place], toset, place, 0);
}
@SafeVarargs
public final void SetUpLinks(FlowerNode<V>... links) {
for (FlowerNode<V> node : links) {
- int place = map.comparerison.apply(node);
- TryToSetSingleNode(this, node, place);
+ int place = this.map.comparerison.apply(node);
+ this.TryToSetSingleNode(this, node, place);
}
}
}
static class Functions {
- public static Function<FlowerNode, Integer> HashBasedFunction() {
+ public static <V> Function<FlowerNode<V>, Integer> HashBasedFunction() {
return function -> function.hashCode() % function.map.petals;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
index 7f3239a7eb..3aaea22017 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
@@ -40,14 +40,16 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
modid = BartWorksCrossmod.MOD_ID,
name = BartWorksCrossmod.NAME,
version = BartWorksCrossmod.VERSION,
- dependencies = "required-after:IC2; " + "required-after:gregtech; "
- + "required-after:bartworks;"
- + "after:GalacticraftMars; "
- + "after:GalacticraftCore; "
- + "after:Micdoodlecore; "
- + "after:miscutils; "
- + "after:EMT; "
- + "after:tectech; ")
+ dependencies = """
+ required-after:IC2;\
+ required-after:gregtech;\
+ required-after:bartworks;\
+ after:GalacticraftMars;\
+ after:GalacticraftCore;\
+ after:Micdoodlecore;\
+ after:miscutils;\
+ after:EMT;\
+ after:tectech;""")
public class BartWorksCrossmod {
public static final String NAME = "BartWorks Mod Additions";
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java
index 9ead533077..a5f4dfa079 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java
@@ -42,13 +42,12 @@ import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
-@SuppressWarnings({ "unchecked", "rawtypes", "unused" })
public class RadioHatchCompat {
- private static Class intf;
- private static Class materialClass;
- private static Class enu;
- private static Class materialStackClass;
+ private static Class<?> intf;
+ private static Class<?> materialClass;
+ private static Class<?> enu;
+ private static Class<?> materialStackClass;
private static Field isRadioactive;
private static Field f;
@@ -96,8 +95,8 @@ public class RadioHatchCompat {
Object[] arr = RadioHatchCompat.enu.getEnumConstants();
for (Object o : arr) {
if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break;
- else if (o.toString().equalsIgnoreCase("ROD")) RadioHatchCompat.rod = o;
- else if (o.toString().equalsIgnoreCase("RODLONG")) RadioHatchCompat.longRod = o;
+ if ("ROD".equalsIgnoreCase(o.toString())) RadioHatchCompat.rod = o;
+ else if ("RODLONG".equalsIgnoreCase(o.toString())) RadioHatchCompat.longRod = o;
}
} catch (NoSuchFieldException | ClassNotFoundException e) {
@@ -105,11 +104,14 @@ public class RadioHatchCompat {
}
}
+ @SuppressWarnings("unchecked")
public static void run() {
DebugLog.log("Starting Generation of missing GT++ rods/longrods");
try {
- Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod");
- Class longrodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong");
+ Class<? extends Item> rodclass = (Class<? extends Item>) Class
+ .forName("gtPlusPlus.core.item.base.rods.BaseItemRod");
+ Class<? extends Item> longrodclass = (Class<? extends Item>) Class
+ .forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong");
Constructor<? extends Item> c1 = rodclass.getConstructor(RadioHatchCompat.materialClass);
Constructor<? extends Item> c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass);
Field cOwners = GameData.class.getDeclaredField("customOwners");
@@ -125,11 +127,11 @@ public class RadioHatchCompat {
for (ModContainer container : Loader.instance().getModList()) {
if (gtpp != null && bartworks != null) break;
- else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) bartworks = container;
+ if (BartWorksCrossmod.MOD_ID.equalsIgnoreCase(container.getModId())) bartworks = container;
else if (container.getModId().equalsIgnoreCase(GTPlusPlus.ID)) gtpp = container;
}
- for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) {
+ for (Object mats : (Set<?>) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) {
if (RadioHatchCompat.isRadioactive.getBoolean(mats)) {
if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) {
@@ -194,19 +196,19 @@ public class RadioHatchCompat {
byte amount;
final Object m;
- private static ArrayList getMaterialInput(Object GTPPMaterial) throws IllegalAccessException {
+ private static ArrayList<?> getMaterialInput(Object GTPPMaterial) throws IllegalAccessException {
Object ret = RadioHatchCompat.vMaterialInput.get(GTPPMaterial);
- return ret instanceof ArrayList ? (ArrayList) ret : new ArrayList();
+ return ret instanceof ArrayList ? (ArrayList<?>) ret : new ArrayList<>();
}
private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException {
return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty();
}
- private static List getElemets(Object GTPPMaterial) throws IllegalAccessException {
- ArrayList elements = new ArrayList();
- Queue toCheck = new LinkedList();
- ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial);
+ private static List<?> getElemets(Object GTPPMaterial) throws IllegalAccessException {
+ ArrayList<Object> elements = new ArrayList<>();
+ Queue<Object> toCheck = new LinkedList<>();
+ ArrayList<?> materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial);
if (materialInputs.isEmpty()) return Collections.singletonList(GTPPMaterial);
for (Object materialStack : materialInputs) {
if (!RadioHatchCompat.GTPPRadAdapter.isElement(RadioHatchCompat.stackMaterial.get(materialStack)))
@@ -222,10 +224,10 @@ public class RadioHatchCompat {
private static Integer calulateRad(Object m) {
int ret = 0;
try {
- List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m);
+ List<?> pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m);
for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj))
- ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter
- .clampToZero(RadioHatchCompat.protons.getLong(materialObj)));
+ ret += RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter
+ .clampToZero(RadioHatchCompat.protons.getLong(materialObj));
else ret += RadioHatchCompat.radlevel.getByte(m);
} catch (IllegalAccessException e) {
e.printStackTrace();
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java
index 3d1a265b80..1b55aee240 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java
@@ -79,7 +79,7 @@ public class CLSCompat {
long time = System.currentTimeMillis();
if (time - lastUpdate >= MINIMAL_UPDATE_INTERVAL) {
try {
- displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000);
+ displayProgress.invoke(null, werkstoff.getDefaultName(), (float) size / 10000);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java
index c6b4656953..b56d33a5dd 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java
@@ -26,7 +26,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -66,16 +65,15 @@ import gregtech.common.GT_Worldgen_GT_Ore_Layer;
import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase;
-@SuppressWarnings("ALL")
public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase {
private static ArrayListMultimap<Integer, Pair<Pair<Integer, Boolean>, Float>> extraDropsDimMap = ArrayListMultimap
.create();
- private static FluidStack[] NOBLE_GASSES = new FluidStack[] { WerkstoffLoader.Neon.getFluidOrGas(1),
+ private static FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1),
WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1),
WerkstoffLoader.Oganesson.getFluidOrGas(1) };
- private HashMap<Pair<Integer, Boolean>, Float> dropmap = null;
+ private Map<Pair<Integer, Boolean>, Float> dropmap = null;
private float totalWeight;
private int multiplier = 1;
@@ -106,24 +104,24 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
public GT_TileEntity_VoidMiner_Base(int aID, String aName, String aNameRegional, int tier) {
super(aID, aName, aNameRegional);
- TIER_MULTIPLIER = (byte) Math.max(tier, 1);
+ this.TIER_MULTIPLIER = (byte) Math.max(tier, 1);
}
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setBoolean("mBlacklist", mBlacklist);
+ aNBT.setBoolean("mBlacklist", this.mBlacklist);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- mBlacklist = aNBT.getBoolean("mBlacklist");
+ this.mBlacklist = aNBT.getBoolean("mBlacklist");
}
public GT_TileEntity_VoidMiner_Base(String aName, int tier) {
super(aName);
- TIER_MULTIPLIER = (byte) tier;
+ this.TIER_MULTIPLIER = (byte) tier;
}
@Override
@@ -156,21 +154,20 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
int yHead, int oldYHead) {
// if the dropmap has never been initialised or if the dropmap is empty
- if (dropmap == null || totalWeight == 0) calculateDropMap();
+ if (this.dropmap == null || this.totalWeight == 0) this.calculateDropMap();
- if (totalWeight != 0.f) {
- handleFluidConsumption();
- handleOutputs();
+ if (this.totalWeight != 0.f) {
+ this.handleFluidConsumption();
+ this.handleOutputs();
return true;
- } else {
- stopMachine();
- return false;
}
+ this.stopMachine();
+ return false;
}
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
- String casings = getCasingBlockItem().get(0).getDisplayName();
+ String casings = this.getCasingBlockItem().get(0).getDisplayName();
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Miner").addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()])
@@ -178,7 +175,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
.addInfo(
"Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.")
.addInfo(
- "Will output " + (2 * TIER_MULTIPLIER)
+ "Will output " + 2 * this.TIER_MULTIPLIER
+ " Ores per Second depending on the Dimension it is build in")
.addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist")
.addInfo("Use a screwdriver to toggle Whitelist/Blacklist")
@@ -186,8 +183,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
.beginStructureBlock(3, 7, 3, false).addController("Front bottom")
.addOtherStructurePart(casings, "form the 3x1x3 Base")
.addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)")
- .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top")
- .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing")
+ .addOtherStructurePart(
+ this.getFrameMaterial().mName + " Frame Boxes",
+ "Each pillar's side and 1x3x1 on top")
+ .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing")
.addInputBus("Mining Pipes or Ores, optional, any base casing")
.addInputHatch("Optional noble gas, any base casing").addOutputBus("Any base casing")
.toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS);
@@ -215,23 +214,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private Predicate<GT_Worldgen_GT_Ore_Layer> makeOreLayerPredicate() {
World world = this.getBaseMetaTileEntity().getWorld();
- switch (world.provider.dimensionId) {
- case -1:
- return gt_worldgen -> gt_worldgen.mNether;
- case 0:
- return gt_worldgen -> gt_worldgen.mOverworld;
- case 1:
- return gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid;
- case 7:
- /*
- * explicitely giving different dim numbers so it default to false in the config, keeping compat with
- * the current worldgen config
- */
-
- return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7);
- default:
- throw new IllegalStateException();
- }
+ return switch (world.provider.dimensionId) {
+ case -1 -> gt_worldgen -> gt_worldgen.mNether;
+ case 0 -> gt_worldgen -> gt_worldgen.mOverworld;
+ case 1 -> gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid;
+ /*
+ * explicitely giving different dim numbers so it default to false in the config, keeping compat with the
+ * current worldgen config
+ */
+ case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7);
+ default -> throw new IllegalStateException();
+ };
}
/**
@@ -241,22 +234,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private Predicate<GT_Worldgen_GT_Ore_SmallPieces> makeSmallOresPredicate() {
World world = this.getBaseMetaTileEntity().getWorld();
- switch (world.provider.dimensionId) {
- case -1:
- return gt_worldgen -> gt_worldgen.mNether;
- case 0:
- return gt_worldgen -> gt_worldgen.mOverworld;
- case 1:
- return gt_worldgen -> gt_worldgen.mEnd;
- case 7:
- /*
- * explicitely giving different dim numbers so it default to false in the config, keeping compat with
- * the current worldgen config
- */
- return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7);
- default:
- throw new IllegalStateException();
- }
+ return switch (world.provider.dimensionId) {
+ case -1 -> gt_worldgen -> gt_worldgen.mNether;
+ case 0 -> gt_worldgen -> gt_worldgen.mOverworld;
+ case 1 -> gt_worldgen -> gt_worldgen.mEnd;
+ /*
+ * explicitely giving different dim numbers so it default to false in the config, keeping compat with the
+ * current worldgen config
+ */
+ case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7);
+ default -> throw new IllegalStateException();
+ };
}
/**
@@ -267,15 +255,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* @param value the non normalised weight
*/
private void addDrop(Pair<Integer, Boolean> key, float value) {
- final ItemStack ore = getOreItemStack(key);
+ final ItemStack ore = this.getOreItemStack(key);
if (ConfigHandler.voidMinerBlacklist.contains(
String.format(
"%s:%d",
GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(),
ore.getItemDamage())))
return;
- if (!dropmap.containsKey(key)) dropmap.put(key, value);
- else dropmap.put(key, dropmap.get(key) + value);
+ if (!this.dropmap.containsKey(key)) this.dropmap.put(key, value);
+ else this.dropmap.put(key, this.dropmap.get(key) + value);
}
/**
@@ -286,10 +274,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
private void getDropsVanillaVeins(Predicate<GT_Worldgen_GT_Ore_Layer> oreLayerPredicate) {
GT_Worldgen_GT_Ore_Layer.sList.stream()
.filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> {
- addDrop(new Pair<>((int) element.mPrimaryMeta, false), (float) element.mWeight);
- addDrop(new Pair<>((int) element.mSecondaryMeta, false), (float) element.mWeight);
- addDrop(new Pair<>((int) element.mSporadicMeta, false), (element.mWeight / 8f));
- addDrop(new Pair<>((int) element.mBetweenMeta, false), (element.mWeight / 8f));
+ this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight);
+ this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight);
+ this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f);
+ this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f);
});
}
@@ -301,7 +289,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
private void getDropsVanillaSmallOres(Predicate<GT_Worldgen_GT_Ore_SmallPieces> smallOresPredicate) {
GT_Worldgen_GT_Ore_SmallPieces.sList.stream()
.filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen))
- .forEach(element -> addDrop(new Pair<>((int) element.mMeta, false), (float) element.mAmount));
+ .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount));
}
/**
@@ -310,26 +298,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* @param finalDef ModDimensionDef corresponding to the target dim
*/
private void getDropsOreVeinsSpace(ModDimensionDef finalDef) {
- Set space = GalacticGreg.oreVeinWorldgenList.stream()
+ GalacticGreg.oreVeinWorldgenList.stream()
.filter(
- gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space
- && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef))
- .collect(Collectors.toSet());
-
- space.forEach(element -> {
- addDrop(
- new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false),
- (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight);
- addDrop(
- new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false),
- (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight);
- addDrop(
- new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta, false),
- (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f));
- addDrop(
- new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta, false),
- (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f));
- });
+ gt_worldgen -> gt_worldgen.mEnabled
+ && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace
+ && oreLayerSpace.isEnabledForDim(finalDef))
+ .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).forEach(element -> {
+ this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight);
+ this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight);
+ this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f);
+ this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f);
+ });
}
/**
@@ -338,15 +317,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* @param finalDef ModDimensionDef corresponding to the target dim
*/
private void getDropsSmallOreSpace(ModDimensionDef finalDef) {
- Set space = GalacticGreg.smallOreWorldgenList.stream().filter(
- gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space
- && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef))
- .collect(Collectors.toSet());
-
- space.forEach(
- element -> addDrop(
- new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false),
- (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount));
+ GalacticGreg.smallOreWorldgenList.stream()
+ .filter(
+ gt_worldgen -> gt_worldgen.mEnabled
+ && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace
+ && oreSmallPiecesSpace.isEnabledForDim(finalDef))
+ .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen)
+ .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount));
}
/**
@@ -357,8 +334,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
private Pair<Integer, Boolean> getOreDamage() {
float curentWeight = 0.f;
while (true) {
- float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight;
- for (Map.Entry<Pair<Integer, Boolean>, Float> entry : dropmap.entrySet()) {
+ float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight;
+ for (Map.Entry<Pair<Integer, Boolean>, Float> entry : this.dropmap.entrySet()) {
curentWeight += entry.getValue();
if (randomnumber < curentWeight) return entry.getKey();
}
@@ -375,7 +352,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
for (int i = 0; i < NOBLE_GASSES.length; i++) {
FluidStack ng = NOBLE_GASSES[i];
if (ng.isFluidEqual(s)) {
- multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i + 2) : (i + 1)));
+ this.multiplier = this.TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? i + 2 : i + 1));
return s;
}
}
@@ -404,8 +381,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* handler for the fluid consumption
*/
private void handleFluidConsumption() {
- FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier();
- if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER;
+ FluidStack storedNobleGas = this.getNobleGasInputAndSetMultiplier();
+ if (storedNobleGas == null || !this.consumeNobleGas(storedNobleGas)) this.multiplier = this.TIER_MULTIPLIER;
}
/**
@@ -414,12 +391,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* @param aID dim id of Ross128b or Ross128ba
*/
private void getDropMapRoss(int aID) {
- Consumer<BW_OreLayer> addToList = makeAddToList();
+ Consumer<BW_OreLayer> addToList = this.makeAddToList();
BW_OreLayer.sList.stream()
.filter(
gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer
&& gt_worldgen.isGenerationAllowed(null, aID, 0))
- .collect(Collectors.toSet()).forEach(addToList);
+ .forEach(addToList);
}
/**
@@ -431,8 +408,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
return element -> {
List<Pair<Integer, Boolean>> data = element.getStacksRawData();
for (int i = 0; i < data.size(); i++) {
- if (i < data.size() - 2) addDrop(data.get(i), (float) element.mWeight);
- else addDrop(data.get(i), (element.mWeight / 8f));
+ if (i < data.size() - 2) this.addDrop(data.get(i), element.mWeight);
+ else this.addDrop(data.get(i), element.mWeight / 8f);
}
};
}
@@ -459,13 +436,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer<BW_OreLayer> addToList) {
try {
- Set space = GalacticGreg.oreVeinWorldgenList.stream()
+ GalacticGreg.oreVeinWorldgenList.stream()
.filter(
- gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space
- && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef))
- .collect(Collectors.toSet());
-
- space.forEach(addToList);
+ gt_worldgen -> gt_worldgen.mEnabled
+ && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace
+ && oreLayerSpace.isEnabledForDim(finalDef))
+ .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen).forEach(addToList);
} catch (NullPointerException ignored) {}
}
@@ -476,18 +452,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private void addSmallOresBartworks(ModDimensionDef finalDef) {
try {
- Set space = GalacticGreg.smallOreWorldgenList.stream()
+ GalacticGreg.smallOreWorldgenList.stream()
.filter(
- gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space
- && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef))
- .collect(Collectors.toSet());
-
- space.forEach(
- element -> addDrop(
- new Pair<>(
- ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta,
- ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0),
- (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity));
+ gt_worldgen -> gt_worldgen.mEnabled
+ && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace
+ && smallOreSpace.isEnabledForDim(finalDef))
+ .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).forEach(
+ element -> this
+ .addDrop(new Pair<>(element.mPrimaryMeta, element.bwOres != 0), element.mDensity));
} catch (NullPointerException ignored) {}
}
@@ -498,15 +470,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private void handleExtraDrops(int id) {
Optional.ofNullable(getExtraDropsDimMap().get(id))
- .ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue())));
+ .ifPresent(e -> e.forEach(f -> this.addDrop(f.getKey(), f.getValue())));
}
/**
* Computes the total weight for normalisation
*/
private void calculateTotalWeight() {
- totalWeight = 0.0f;
- dropmap.values().forEach(f -> totalWeight += f);
+ this.totalWeight = 0.0f;
+ this.dropmap.values().forEach(f -> this.totalWeight += f);
}
/**
@@ -516,25 +488,25 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
*/
private void handleModDimDef(int id) {
// vanilla dims or TF
- if ((id <= 1 && id >= -1) || id == 7) {
- getDropsVanillaVeins(makeOreLayerPredicate());
- getDropsVanillaSmallOres(makeSmallOresPredicate());
+ if (id <= 1 && id >= -1 || id == 7) {
+ this.getDropsVanillaVeins(this.makeOreLayerPredicate());
+ this.getDropsVanillaSmallOres(this.makeSmallOresPredicate());
// ross dims
} else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) {
- getDropMapRoss(id);
+ this.getDropMapRoss(id);
// other space dims
} else {
- Optional.ofNullable(makeModDimDef()).ifPresent(def -> {
+ Optional.ofNullable(this.makeModDimDef()).ifPresent(def -> {
// normal space dim
- getDropsOreVeinsSpace(def);
- getDropsSmallOreSpace(def);
+ this.getDropsOreVeinsSpace(def);
+ this.getDropsSmallOreSpace(def);
// BW space dim
- Consumer<BW_OreLayer> addToList = makeAddToList();
- addOresVeinsBartworks(def, addToList);
- addSmallOresBartworks(def);
+ Consumer<BW_OreLayer> addToList = this.makeAddToList();
+ this.addOresVeinsBartworks(def, addToList);
+ this.addSmallOresBartworks(def);
});
}
}
@@ -544,24 +516,23 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
* totalweight for normalisation
*/
private void calculateDropMap() {
- dropmap = new HashMap<>();
+ this.dropmap = new HashMap<>();
int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId;
- handleModDimDef(id);
- handleExtraDrops(id);
- calculateTotalWeight();
+ this.handleModDimDef(id);
+ this.handleExtraDrops(id);
+ this.calculateTotalWeight();
}
/**
* Output logic of the VM
*/
private void handleOutputs() {
- Pair<Integer, Boolean> stats = getOreDamage();
final List<ItemStack> inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre)
.collect(Collectors.toList());
- final ItemStack output = getOreItemStack(stats);
+ final ItemStack output = this.getOreItemStack(this.getOreDamage());
if (inputOres.size() == 0
- || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output)))
- || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))))
+ || this.mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))
+ || !this.mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output)))
this.addOutput(output);
this.updateSlots();
}
@@ -576,13 +547,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri
private ItemStack getOreItemStack(Pair<Integer, Boolean> stats) {
return new ItemStack(
stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1,
- multiplier,
+ this.multiplier,
stats.getKey());
}
@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mBlacklist = !mBlacklist;
- GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (mBlacklist ? "Blacklist" : "Whitelist"));
+ this.mBlacklist = !this.mBlacklist;
+ GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (this.mBlacklist ? "Blacklist" : "Whitelist"));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java
index c502437fc7..c9cff6cd9e 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java
@@ -25,18 +25,10 @@ import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons;
public class PlanetsHelperClass {
public static EntityLanderBase getLanderType(EntityPlayerMP player) {
- EntityLanderBase elb;
- switch (ConfigHandler.landerType) {
- case 1:
- elb = new EntityLander(player);
- break;
- case 2:
- elb = new EntityLandingBalloons(player);
- break;
- default:
- elb = new EntityEntryPod(player);
- break;
- }
- return elb;
+ return switch (ConfigHandler.landerType) {
+ case 1 -> new EntityLander(player);
+ case 2 -> new EntityLandingBalloons(player);
+ default -> new EntityEntryPod(player);
+ };
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java
index 4031e2491b..b6fa575b5c 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java
@@ -57,7 +57,7 @@ public class UniversalTeleportType implements ITeleportType {
@Override
public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) {
if (ridingAutoRocket) return;
- if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) {
+ if (player != null && GCPlayerStats.get(player).teleportCooldown <= 0) {
if (player.capabilities.isFlying) {
player.capabilities.isFlying = false;
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java
index e7693159de..77877011cd 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java
@@ -32,7 +32,6 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody;
import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry;
import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas;
-@SuppressWarnings({ "unused", "RedundantSuppression" })
public final class BWAtmosphereManager {
private static final Map<Integer, Integer[]> COEFFICIENT_MAP = new HashMap<>();
@@ -82,7 +81,7 @@ public final class BWAtmosphereManager {
}
private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) {
- if (gas.equals(IAtmosphericGas.CO2)) {
+ if (IAtmosphericGas.CO2.equals(gas)) {
BWAtmosphereManager.addGasToWorld(
worldID,
Materials.CarbonDioxide,
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java
index 02acd6c031..c84ef4528b 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java
@@ -25,6 +25,7 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
@@ -59,13 +60,14 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate {
}
@Override
- @SuppressWarnings("rawtypes")
- public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) {
+ public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_,
+ int p_73155_4_) {
return null;
}
+ @Override
public Chunk provideChunk(int p_73154_1_, int p_73154_2_) {
- this.rand.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L);
+ this.rand.setSeed(p_73154_1_ * 341873128712L + p_73154_2_ * 132897987541L);
Block[] ablock = new Block[65536];
byte[] abyte = new byte[65536];
this.func_147424_a(p_73154_1_, p_73154_2_, ablock);
@@ -111,7 +113,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate {
if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) {
long i1 = this.rand.nextLong() / 2L * 2L + 1L;
long j1 = this.rand.nextLong() / 2L * 2L + 1L;
- this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed());
+ this.rand.setSeed(p_73153_2_ * i1 + p_73153_3_ * j1 ^ this.worldObj.getSeed());
}
MinecraftForge.EVENT_BUS
@@ -126,8 +128,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate {
y1 = this.rand.nextInt(256);
z1 = l + this.rand.nextInt(16) + 8;
int rni = this.rand.nextInt(8);
- if (rni == 0) (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1);
- else if (rni == 4) (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1);
+ if (rni == 0) new WorldGenLakes(Blocks.ice).generate(this.worldObj, this.rand, x1, y1, z1);
+ else if (rni == 4) new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, x1, y1, z1);
}
if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean
&& biomegenbase != BiomeGenBase.river
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java
index a0eaf06d46..7a0c9a743c 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java
@@ -33,6 +33,7 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace {
return true;
}
+ @Override
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float cy, float noidea) {
float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F;
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java
index 51b19bf5c1..12668f59e1 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java
@@ -48,8 +48,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
this.worldObj = world;
}
+ @Override
public Chunk provideChunk(int cx, int cz) {
- this.rand.setSeed((long) cx * 341873128712L + (long) cz * 132897987541L);
+ this.rand.setSeed(cx * 341873128712L + cz * 132897987541L);
Block[] ids = new Block[65536];
byte[] meta = new byte[65536];
Arrays.fill(ids, Blocks.air);
@@ -64,6 +65,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
return Chunk;
}
+ @Override
public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {}
@Override
@@ -83,17 +85,18 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
final BartsNoise noiseGen2 = new BartsNoise(2, 0.01F, 1D, System.nanoTime());
final BartsNoise noiseGen3 = new BartsNoise(2, 0.002F, 1D, System.nanoTime());
+ @Override
public void generateTerrain(int chunkX, int chunkZ, Block[] idArray, byte[] metaArray) {
for (int x = 0; x < 16; ++x) {
for (int z = 0; z < 16; ++z) {
- double d = noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16);
- double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16);
- double d3 = noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16);
+ double d = this.noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16);
+ double d2 = this.noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16);
+ double d3 = this.noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16);
double yDev = d * 4 + d2 * 2 + d3;
for (int y = 0; y < 128; ++y) {
- if ((double) y < 60.0D + yDev) {
+ if (y < 60.0D + yDev) {
idArray[this.getIndex(x, y, z)] = this.lowerBlockID;
int var10001 = this.getIndex(x, y, z);
metaArray[var10001] = 4;
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java
index a69222d2b9..171d149986 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java
@@ -57,7 +57,7 @@ public class Ross128SolarSystem {
Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128);
Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System);
- Ross128SolarSystem.Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f);
+ Ross128SolarSystem.Ross128b.setRingColorRGB(0x9F / 255f, 0x8A / 255f, 0x79 / 255f);
Ross128SolarSystem.Ross128b.setPhaseShift(1.25F);
Ross128SolarSystem.Ross128b.setBodyIcon(
new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png"));
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java
deleted file mode 100644
index fa0dedaaa7..0000000000
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
- * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial
- * portions of the Software. 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 OR COPYRIGHT HOLDERS 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.
- */
-
-package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import micdoodle8.mods.galacticraft.core.GalacticraftCore;
-
-public class DysonSwarmSunReplacement extends MetaTileEntity {
-
- private static boolean wasBuild;
- private static long dysonObjs;
- private static long swarmControllers;
-
- public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- super(aID, aBasicName, aRegionalName, aInvSlotCount);
- }
-
- private DysonSwarmSunReplacement(String aName, int aInvSlotCount) {
- super(aName, aInvSlotCount);
- }
-
- public void toggle() {
- ResourceLocation resourceLocation = wasBuild
- ? new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")
- : new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png");
- GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(resourceLocation);
- wasBuild = !wasBuild;
-
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 2;
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- ++swarmControllers;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- toggle();
- return super.onRightclick(aBaseMetaTileEntity, aPlayer);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
- return new DysonSwarmSunReplacement(this.mName, this.mInventory.length);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound nbtTagCompound) {
- nbtTagCompound.setLong("dysonObjs", dysonObjs);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound nbtTagCompound) {
- dysonObjs = Math.max(dysonObjs, nbtTagCompound.getLong("dysonObjs"));
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- aBaseMetaTileEntity
- .increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true);
- }
-
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side,
- ItemStack itemStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side,
- ItemStack itemStack) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- return new String[0];
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing,
- int colorIndex, boolean b3, boolean b4) {
- return new ITexture[0];
- }
-}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java
deleted file mode 100644
index 1bdcc942ba..0000000000
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
- * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial
- * portions of the Software. 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 OR COPYRIGHT HOLDERS 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.
- */
-
-package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity;
-
-import cpw.mods.fml.common.event.FMLInitializationEvent;
-import cpw.mods.fml.common.event.FMLPostInitializationEvent;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-
-public class GalaxySpaceProxy {
-
- private GalaxySpaceProxy() {}
-
- public static void postInit(FMLPostInitializationEvent e) {}
-
- public static void preInit(FMLPreInitializationEvent e) {}
-
- private static void serverpreInit(FMLPreInitializationEvent e) {}
-
- private static void clientpreInit(FMLPreInitializationEvent e) {}
-
- private static void commonpreInit(FMLPreInitializationEvent e) {}
-
- public static void init(FMLInitializationEvent e) {}
-
- private static void serverInit(FMLInitializationEvent e) {}
-
- private static void clientInit(FMLInitializationEvent e) {}
-
- private static void commonInit(FMLInitializationEvent e) {}
-
- private static void serverPostInit(FMLPostInitializationEvent e) {}
-
- private static void clientPostInit(FMLPostInitializationEvent e) {}
-
- private static void commonPostInit(FMLPostInitializationEvent e) {}
-}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java
index 997eb597e7..469c23b065 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java
@@ -57,8 +57,8 @@ public class TileEntity_GTDataServer extends TileEntity
@Callback
public Object[] listData(Context context, Arguments args) {
Set<String> ret = new HashSet<>();
- for (Map.Entry<Long, GT_NBT_DataBase> entry : OrbDataBase.entrySet()) {
- ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " + entry.getValue().getmDataTitle());
+ for (Map.Entry<Long, GT_NBT_DataBase> entry : this.OrbDataBase.entrySet()) {
+ ret.add(entry.getValue().getId() + Long.MAX_VALUE + ". " + entry.getValue().getmDataTitle());
}
return ret.toArray(new String[0]);
}
@@ -78,41 +78,39 @@ public class TileEntity_GTDataServer extends TileEntity
if (this.TickTimer++ % 20 != 0) return;
if (this.isServerSide()) {
- if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1))) {
- if (this.mItems[0].hasTagCompound()) {
- if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) {
- this.OrbDataBase.put(
- GT_NBT_DataBase.getMaxID(),
- new GT_NBT_DataBase(
- Behaviour_DataOrb.getDataName(this.mItems[0]),
- Behaviour_DataOrb.getDataTitle(this.mItems[0]),
- this.mItems[0].getTagCompound()));
- } else {
- long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound());
- this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id));
- }
+ if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1))
+ && this.mItems[0].hasTagCompound()) {
+ if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) {
+ this.OrbDataBase.put(
+ GT_NBT_DataBase.getMaxID(),
+ new GT_NBT_DataBase(
+ Behaviour_DataOrb.getDataName(this.mItems[0]),
+ Behaviour_DataOrb.getDataTitle(this.mItems[0]),
+ this.mItems[0].getTagCompound()));
+ } else {
+ long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound());
+ this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id));
}
}
- if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1))) {
- if (this.mItems[0].hasTagCompound()) {
-
- String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]);
- String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]);
- short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]);
- byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1);
-
- String title = data == 1 ? bookTitle
- : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data";
- String name = data == 1 ? "eBook"
- : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data";
- if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) {
- this.OrbDataBase.put(
- GT_NBT_DataBase.getMaxID(),
- new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound()));
- } else {
- long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound());
- this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id));
- }
+ if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1))
+ && this.mItems[0].hasTagCompound()) {
+
+ String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]);
+ String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]);
+ short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]);
+ byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1);
+
+ String title = data == 1 ? bookTitle
+ : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data";
+ String name = data == 1 ? "eBook"
+ : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data";
+ if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) {
+ this.OrbDataBase.put(
+ GT_NBT_DataBase.getMaxID(),
+ new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound()));
+ } else {
+ long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound());
+ this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id));
}
}
}
@@ -147,24 +145,24 @@ public class TileEntity_GTDataServer extends TileEntity
}
@Override
- public ItemStack getStackInSlot(int p_70301_1_) {
- return p_70301_1_ == 0 ? this.mItems[0] : this.mItems[1];
+ public ItemStack getStackInSlot(int slotIn) {
+ return slotIn == 0 ? this.mItems[0] : this.mItems[1];
}
@Override
- public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ public ItemStack decrStackSize(int index, int count) {
return null;
}
@Override
- public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ public ItemStack getStackInSlotOnClosing(int index) {
return null;
}
@Override
- public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
- if (p_70299_1_ > 1 || p_70299_1_ < 0) return;
- this.mItems[p_70299_1_] = p_70299_2_;
+ public void setInventorySlotContents(int index, ItemStack stack) {
+ if (index > 1 || index < 0) return;
+ this.mItems[index] = stack;
}
@Override
@@ -183,7 +181,7 @@ public class TileEntity_GTDataServer extends TileEntity
}
@Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ public boolean isUseableByPlayer(EntityPlayer player) {
return true;
}
@@ -194,7 +192,7 @@ public class TileEntity_GTDataServer extends TileEntity
public void closeInventory() {}
@Override
- public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
- return p_94041_1_ == 0;
+ public boolean isItemValidForSlot(int index, ItemStack stack) {
+ return index == 0;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java
index 360ccff458..35315b677c 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java
@@ -25,7 +25,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-@SuppressWarnings({ "unused", "RedundantSuppression" })
public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo {
ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnergyHatches = new ArrayList<>();
@@ -39,29 +38,28 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo {
super(aName);
}
+ @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
return new TT_TileEntity_ManualTrafo(this.mName);
}
+ @Override
public boolean addEnergyOutput(long aEU) {
if (aEU <= 0L) {
return true;
- } else {
- return mTTDynamos.size() > 0
- || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true);
}
+ return this.mTTDynamos.size() > 0
+ || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true);
}
+ @Override
public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
int injected = 0;
long totalOutput = 0L;
long aFirstVoltageFound = -1L;
boolean aFoundMixedDynamos = false;
- Iterator<GT_MetaTileEntity_Hatch_Dynamo> var10 = this.mDynamoHatches.iterator();
-
long aVoltage;
- while (var10.hasNext()) {
- GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next();
+ for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : this.mDynamoHatches) {
if (aDynamo == null) {
return false;
}
@@ -82,38 +80,38 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo {
if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) {
this.explodeMultiblock();
return false;
- } else {
- Iterator<GT_MetaTileEntity_Hatch_Dynamo> var17 = this.mDynamoHatches.iterator();
+ }
+ Iterator<GT_MetaTileEntity_Hatch_Dynamo> var17 = this.mDynamoHatches.iterator();
- while (true) {
- GT_MetaTileEntity_Hatch_Dynamo aDynamo;
- do {
- if (!var17.hasNext()) {
- return injected > 0;
- }
+ while (true) {
+ GT_MetaTileEntity_Hatch_Dynamo aDynamo;
+ do {
+ if (!var17.hasNext()) {
+ return injected > 0;
+ }
- aDynamo = var17.next();
- } while (!isValidMetaTileEntity(aDynamo));
+ aDynamo = var17.next();
+ } while (!isValidMetaTileEntity(aDynamo));
- long leftToInject = aEU - (long) injected;
- aVoltage = aDynamo.maxEUOutput();
- int aAmpsToInject = (int) (leftToInject / aVoltage);
- int aRemainder = (int) (leftToInject - (long) aAmpsToInject * aVoltage);
- int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
+ long leftToInject = aEU - injected;
+ aVoltage = aDynamo.maxEUOutput();
+ int aAmpsToInject = (int) (leftToInject / aVoltage);
+ int aRemainder = (int) (leftToInject - aAmpsToInject * aVoltage);
+ int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
- for (int i = 0; i < ampsOnCurrentHatch; ++i) {
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false);
- }
+ for (int i = 0; i < ampsOnCurrentHatch; ++i) {
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false);
+ }
- injected = (int) ((long) injected + aVoltage * (long) ampsOnCurrentHatch);
- if (aRemainder > 0 && (long) ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false);
- injected += aRemainder;
- }
+ injected = (int) (injected + aVoltage * ampsOnCurrentHatch);
+ if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false);
+ injected += aRemainder;
}
}
}
+ @Override
public boolean drainEnergyInput(long aEU) {
if (aEU > 0L) {
{
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java
index 2dd621b2b8..9166424a43 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java
@@ -32,7 +32,6 @@ import gregtech.api.util.GT_OreDictUnificator;
public class TecTechResearchLoader {
- @SuppressWarnings("deprecation")
public static void runResearches() {
Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null
? FluidRegistry.getFluid("molten.indalloy140")
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java
index 0307cbf171..ae19e8d635 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java
@@ -52,7 +52,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel
}
default long getTotalPower() {
- return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - (this.getAMPERES() / 20);
+ return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - this.getAMPERES() / 20;
}
default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) {
@@ -73,42 +73,44 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel
return;
}
- if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver()
+ if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isReceiver()
&& opposite == tGTTileEntity.getFrontFacing()) {
- if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput()
- || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) {
+ if (this.maxEUOutput() > lowPowerLaser.maxEUInput()
+ || this.getAMPERES() > lowPowerLaser.getAMPERES()) {
aMetaTileEntity.doExplosion(this.maxEUOutput());
this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput());
return;
}
- if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) {
+ if (this.maxEUOutput() == lowPowerLaser.maxEUInput()) {
long diff = Math.min(
this.getAMPERES() * 20L * this.maxEUOutput(),
Math.min(
- ((LowPowerLaser) aMetaTileEntity).maxEUStore()
+ lowPowerLaser.maxEUStore()
- aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(),
aBaseMetaTileEntity.getStoredEU()));
this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff);
- ((LowPowerLaser) aMetaTileEntity)
- .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff);
+ lowPowerLaser.setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff);
}
return;
}
- if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel())
+ if ((!(aMetaTileEntity instanceof LowPowerLaser lowPowerLaser) || !lowPowerLaser.isTunnel())
&& !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) {
return;
}
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) {
- if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy tePipeEnergy) {
+ if (tePipeEnergy.connectionCount < 2) {
return;
}
+ tePipeEnergy.markUsed();
+ return;
+ }
- ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed();
- } else if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) {
- if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) return;
+ if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isTunnel()
+ && !lowPowerLaser.isConnectedCorrectly(front)) {
+ return;
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java
index b65b72c525..e1f69d8c05 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java
@@ -56,7 +56,7 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_
@Override
public long getAMPERES() {
- return AMPERES;
+ return this.AMPERES;
}
@Override
@@ -93,12 +93,12 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_
@Override
public void saveNBTData(NBTTagCompound nbtTagCompound) {
- Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", AMPERES));
+ Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", this.AMPERES));
}
@Override
public void loadNBTData(NBTTagCompound nbtTagCompound) {
- Optional.ofNullable(nbtTagCompound).ifPresent(tag -> AMPERES = tag.getLong("AMPERES"));
+ Optional.ofNullable(nbtTagCompound).ifPresent(tag -> this.AMPERES = tag.getLong("AMPERES"));
}
@Override
@@ -148,6 +148,6 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_
@Override
public long maxEUStore() {
- return 512L + GT_Values.V[this.mTier + 1] * 24L * AMPERES;
+ return 512L + GT_Values.V[this.mTier + 1] * 24L * this.AMPERES;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
index 1fccb4dd28..d2e1c3aa52 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
@@ -53,12 +53,12 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase
@Override
public long maxAmperesOut() {
- return !this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES : 0;
+ return !this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES : 0;
}
@Override
public long maxAmperesIn() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES + (AMPERES / 4) : 0;
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES + this.AMPERES / 4 : 0;
}
@Override
@@ -68,7 +68,7 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase
@Override
public String getAlternativeModeText() {
- return isReceiver() ? "Set to receiving mode" : "Set to sending mode";
+ return this.isReceiver() ? "Set to receiving mode" : "Set to sending mode";
}
@Override
@@ -101,7 +101,7 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase
if (aBaseMetaTileEntity.isServerSide()) {
aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork());
- byte Tick = (byte) ((int) (aTick % 20L));
+ byte Tick = (byte) (int) (aTick % 20L);
if (16 == Tick) {
if (aBaseMetaTileEntity.getStoredEU() > 0L) {
this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.AMPERES);
@@ -109,10 +109,10 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase
this.setEUVar(0L);
}
}
- if (this.getBaseMetaTileEntity().isAllowedToWork())
- if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) {
- this.moveAroundLowPower(aBaseMetaTileEntity);
- }
+ if (this.getBaseMetaTileEntity().isAllowedToWork()
+ && aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) {
+ this.moveAroundLowPower(aBaseMetaTileEntity);
+ }
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
index 570d4592c4..d2c9d888af 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
@@ -83,13 +83,11 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- byte Tick = (byte) ((int) (aTick % 20L));
- if (16 == Tick) {
- if (aBaseMetaTileEntity.getStoredEU() > 0L) {
- this.setEUVar(aBaseMetaTileEntity.getStoredEU() - (long) this.Amperes);
- if (aBaseMetaTileEntity.getStoredEU() < 0L) {
- this.setEUVar(0L);
- }
+ byte Tick = (byte) (int) (aTick % 20L);
+ if (16 == Tick && aBaseMetaTileEntity.getStoredEU() > 0L) {
+ this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.Amperes);
+ if (aBaseMetaTileEntity.getStoredEU() < 0L) {
+ this.setEUVar(0L);
}
}
if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) {
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java
index 053a7b04ad..63978c55df 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java
@@ -138,7 +138,6 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca
@Override
@Deprecated
- @SuppressWarnings("deprecation")
public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage,
ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
return 0L;
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java
index 0a6b9d1cca..04e65781d6 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java
@@ -20,10 +20,12 @@ import vexatos.tgregworks.reference.Config;
modid = MaterialsInjector.MOD_ID,
name = MaterialsInjector.NAME,
version = MaterialsInjector.VERSION,
- dependencies = "required-after:IC2; " + "required-after:gregtech; "
- + "required-after:bartworks;"
- + "before:TGregworks;"
- + "before:miscutils; ")
+ dependencies = """
+ required-after:IC2;\
+ required-after:gregtech;\
+ required-after:bartworks;\
+ before:TGregworks;\
+ before:miscutils;""")
public class MaterialsInjector {
public static final String NAME = "BartWorks Mod Additions - TGregworks Container";
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java
index fcc45f069f..5dfada8a82 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java
@@ -39,6 +39,7 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer {
super(aName, aTier, aDescription, aTextures, aSlotCount);
}
+ @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
@@ -63,10 +64,12 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer {
return ThaumcraftHandler.isWand(aStack);
}
+ @Override
public int getInventoryStackLimit() {
return 1;
}
+ @Override
public long[] getStoredEnergy() {
boolean scaleOverflow = false;
boolean storedOverflow = false;
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java
index f4db85e1ef..7aca6b05b7 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java
@@ -14,7 +14,6 @@
package com.github.bartimaeusnek.crossmod.thaumcraft.util;
import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.minecraft.item.ItemStack;
@@ -27,14 +26,13 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
import gregtech.api.enums.TC_Aspects;
-@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
public class ThaumcraftHandler {
private ThaumcraftHandler() {}
private static Integer taintBiomeID;
private static Integer magicalForestBiomeID;
- private static Class mWandInterface;
+ private static Class<?> mWandInterface;
static {
try {
@@ -84,8 +82,8 @@ public class ThaumcraftHandler {
public static class AspectAdder {
- public static Class mAspectListClass;
- public static Class mAspectClass;
+ public static Class<?> mAspectListClass;
+ public static Class<?> mAspectClass;
public static Method registerObjectTag;
public static Method addToList;
public static Method getName;
@@ -129,11 +127,12 @@ public class ThaumcraftHandler {
}
}
+ @SafeVarargs
public static void addAspectViaBW(ItemStack stack, Pair<Object, Integer>... aspectPair) {
if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) return;
try {
- Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance();
- for (Pair a : aspectPair) {
+ Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance();
+ for (Pair<Object, Integer> a : aspectPair) {
if (API_ConfigValues.debugLog) DebugLog.log(
"Stack:" + stack.getDisplayName()
+ " Damage:"
@@ -145,18 +144,18 @@ public class ThaumcraftHandler {
ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue());
}
ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList);
- } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
+ } catch (Exception e) {
e.printStackTrace();
}
}
public static void addAspectViaGT(ItemStack stack, TC_Aspects.TC_AspectStack... tc_aspectStacks) {
try {
- Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance();
+ Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance();
for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) ThaumcraftHandler.AspectAdder.addToList
.invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount);
ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList);
- } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
+ } catch (Exception e) {
e.printStackTrace();
}
}