aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2020-05-27 12:53:54 +0200
committerGitHub <noreply@github.com>2020-05-27 12:53:54 +0200
commit3997e9f86243bef67175609a6093fe6668cf5ed7 (patch)
treed2b9c7838dcfeb3b5693a73e84cbd7731e36647a
parent067e6c04b2416f73cb08698a245fd8c275e9258d (diff)
downloadGT5-Unofficial-3997e9f86243bef67175609a6093fe6668cf5ed7.tar.gz
GT5-Unofficial-3997e9f86243bef67175609a6093fe6668cf5ed7.tar.bz2
GT5-Unofficial-3997e9f86243bef67175609a6093fe6668cf5ed7.zip
Update to v13
* Added VoidMinerWIP Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + Added a function to BWOreLayers + Made the voidminer actually WORK somewhat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + added recipes + made the void miner consume noble gasses to boost output + refactored code by quite a lot + added newest GT Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added GalacticGreg lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added localisation of achivements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTLib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTlib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Several fixes + Fixed BioVat + Added some Debug Commands + Changed Void Miner logic Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + removed Experimental ThreadedLoader + moved LoaderCalls into LoaderReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + moved FMLCommonHandler.instance().get(Effective)Side() into SideReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * made radio hatch compat call static Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made More Stuff static + improved flow control Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added more Block-Recipes +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * api changes + fixed void miner not consuming energy + Made API standalone (mostly) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made OrePrefixes lookups NullSecure Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed a typo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * LICENSE update Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added Config for Metas and Tiers for Ross + fixed GT++ compability Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Fixed ConfigHandler initiating GTValues during coremod startup + Fixed MegaEBF sometimes overflowing Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * change recipes for Void Miner using Ore Drill Tier 6 bump gt dependencie and version * update code chicken core and gt version * Added VoidMiner Tiers + Added Recipes for Void Miners Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed VoidMiner Output Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added void miner localisation for achievements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed NPE Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made Void Miner Times in Assembly Line more reasonable Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed fermentation recipes in biovat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added a force shutdown, due to licensing of GT++ Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed Glass Checked + buffed Oganesson + made LoadItemContainers static + removed force shutdown Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Update WerkstoffLoader.java * Fix imports import cpw.mods.fml.common.Loader was missing * Redid CLS support Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Some new featues + Added Multiblock Updateability to BW Blocks + Added Pollution to WaterPump + Added new Windmill GUI + Refactored Windmill a bit Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added animation to windmill Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * add gt to libs folder to let jenkins build (cherry picked from commit 12f6dae5e2233b533bce1cf6b0c29e9e85a60a0b) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Various Development (#75) + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Block changes2 (#77) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Redid LuV Osmiridium Replacer + version increase + deleted old lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Unified usage of .hasItemType instead of bitshifts/ .getGenerationFeatures().hasXY() + removed a wrong cast + fixed textures + cleaned up code + removed *some* duplicate recipes for tool items + increased version, increased api version Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed voidminer + fixed MEBF not working with LAZORS or Multi Amp hatches below UV-Glas + fixed LAZORS not exploding when they recive too much Amp lasers * Redid Radio Hatch Stuffs ~~~ + ItemStacks finally work properly + Forbid insertion of a non-Rad-Material + Version increase * fixes + disabled circuit unification + removed unused decoratePlanet on Ross128ba + changed "splitStack" to "setStackSize" + renamed "WorldProviderRoss128Ba" to "WorldProviderRoss128ba" * Math update + Added specialised functions for floor ceil wrap and clamp + Replaced old function calls + LowPower Pipes now have the IC2 glass fibre texture + fixed overflow on the AccessPriorityList + fixed "NOSUCHITEM rod" error + suppressed some warnings + version increase * Fixed Burned Out THTR Stuff * Had the wrong version number Co-authored-by: Dream-Master <dream-master@gmx.net> Co-authored-by: jackowski626 <jf@wikiera.net> Former-commit-id: 3dce197579f950aa9c2e450e446e03c74b41dc83
-rw-r--r--.gitignore3
-rw-r--r--LICENSE2
-rw-r--r--build.gradle25
-rw-r--r--build.properties8
-rw-r--r--libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id1
-rw-r--r--libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id1
-rw-r--r--libs/gregtech-5.09.32-dev.jar.REMOVED.git-id1
-rw-r--r--libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id1
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCore.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java (renamed from src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java)15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java103
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java88
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java37
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java46
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java16
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java25
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java452
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java45
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java23
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java21
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java21
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java45
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java45
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java70
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java34
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java44
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java81
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java56
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java210
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java39
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java559
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java80
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java104
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java61
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java319
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java442
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java110
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java51
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java (renamed from src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java)4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java40
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java41
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java23
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java31
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java19
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java95
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java32
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java84
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java308
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java1077
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java276
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java72
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java238
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java144
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java68
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java85
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java54
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java62
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java26
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java157
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java (renamed from src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java)7
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java (renamed from src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java)18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java26
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java108
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java387
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java124
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java (renamed from src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java)9
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java89
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java68
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java148
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java116
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java148
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java144
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java95
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java78
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java113
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java30
-rw-r--r--src/main/resources/assets/bartworks/lang/de_DE.lang11
-rw-r--r--src/main/resources/assets/bartworks/lang/en_US.lang9
-rw-r--r--src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.pngbin1094 -> 4857 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png)bin211 -> 211 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png)bin207 -> 207 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png)bin228 -> 228 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png)bin227 -> 227 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png)bin207 -> 207 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png)bin205 -> 205 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png)bin207 -> 207 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png)bin203 -> 203 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png)bin211 -> 211 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png)bin208 -> 208 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png)bin209 -> 209 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png)bin207 -> 207 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png)bin206 -> 206 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png)bin202 -> 202 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png)bin227 -> 227 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png)bin226 -> 226 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png)bin186 -> 186 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png)bin182 -> 182 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png)bin188 -> 188 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png)bin183 -> 183 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png)bin177 -> 177 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png)bin182 -> 182 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png)bin187 -> 187 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png)bin180 -> 180 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png)bin186 -> 186 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png (renamed from src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png)bin184 -> 184 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.pngbin0 -> 266 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.pngbin0 -> 346 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.pngbin0 -> 258 bytes
-rw-r--r--src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.pngbin0 -> 291 bytes
158 files changed, 5866 insertions, 2483 deletions
diff --git a/.gitignore b/.gitignore
index 4d09b92927..1801f4555b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,7 +41,8 @@ hs_err_pid*
!/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar
!/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar
!/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar
-!/libs/gregtech-5.09.32-dev.jar
+!/libs/gregtech-5.09.33.32-dev.jar
+!/libs/GalacticGreg-1.7.10-1.0.3.jar
SetupWorkspaces.bat
SetupDevWorkspaces.bat
Idea.bat
diff --git a/LICENSE b/LICENSE
index ab602974d2..b94f54c82c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018
+Copyright (c) 2018-2020
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/build.gradle b/build.gradle
index decc7f2518..3e1ffaa99c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,6 +30,28 @@ idea{
}
}
+/*
+ * 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.
+ */
+
import de.undercouch.gradle.tasks.download.Download
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -157,6 +179,9 @@ jar {
task apiJar(type: Jar){
from(sourceSets.main.output) {
include 'com/github/bartimaeusnek/bartworks/API/**'
+ include 'com/github/bartimaeusnek/bartworks/util/**'
+ include 'com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class'
+ include 'com/github/bartimaeusnek/crossmod/thaumcraft/util/**'
}
classifier = 'API'
}
diff --git a/build.properties b/build.properties
index 28cb48a532..0c2cf1116f 100644
--- a/build.properties
+++ b/build.properties
@@ -22,11 +22,11 @@
mc_version=1.7.10
majorUpdate=0
minorUpdate=5
-buildNumber=12
-APIVersion=8
+buildNumber=13
+APIVersion=11
ic2.version=2.2.828-experimental
-gregtech.version=5.09.32.36
-gregtech.jenkinsbuild=143
+gregtech.version=5.09.33.38
+gregtech.jenkinsbuild=454
applecore.version=1.7.10-3.1.1
galacticraft.version=1.7-3.0.12.504
enderio.version=1.7.10-2.3.0.429_beta
diff --git a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id
deleted file mode 100644
index ffef551870..0000000000
--- a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-848964ad2a6250cb5adc79bde00136058f994d99 \ No newline at end of file
diff --git a/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id
new file mode 100644
index 0000000000..ad85afb9bc
--- /dev/null
+++ b/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id
@@ -0,0 +1 @@
+edbdb613c8251af1451312d5dc7a4ee99c66b13f \ No newline at end of file
diff --git a/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id
deleted file mode 100644
index 4fa1e5f1b5..0000000000
--- a/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-44c5cd845f848818d656a41ae2aacb83fa5275db \ No newline at end of file
diff --git a/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id
new file mode 100644
index 0000000000..ecf897dd93
--- /dev/null
+++ b/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id
@@ -0,0 +1 @@
+1d948ce2fb4969a62ea55a6bc396d61f209cd52a \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
index 578b768652..6592da592f 100644
--- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -29,7 +29,6 @@ import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.versioning.ArtifactVersion;
@@ -60,11 +59,11 @@ public class BWCore extends DummyModContainer {
@Subscribe
public void preInit(FMLPreInitializationEvent event) {
- shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0];
- shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1];
- shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3];
+ shouldTransform[0] = ConfigHandler.enabledPatches[0];
+ shouldTransform[1] = ConfigHandler.enabledPatches[1];
+ shouldTransform[3] = ConfigHandler.enabledPatches[3];
shouldTransform[4] = true;
- shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5];
+ shouldTransform[5] = ConfigHandler.enabledPatches[5];
shouldTransform[6] = ConfigHandler.enabledPatches[6];
//shouldTransform[6] = true;
BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java
index 4f7d83bcf6..3839d28038 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -20,14 +20,9 @@
* SOFTWARE.
*/
-package com.github.bartimaeusnek.bartworks.common.loaders;
-
-public class LoaderRegistry implements Runnable {
-
- @Override
- public void run() {
- ItemRegistry.run();
- new RecipeLoader().run();
- }
+package com.github.bartimaeusnek.bartworks.API;
+public class API_ConfigValues {
+ //One-Side-Only
+ public static boolean debugLog = true;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java
index f9fcd4bd37..74c6a7c778 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -19,7 +19,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-
package com.github.bartimaeusnek.bartworks.API;
public final class API_REFERENCE {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java
index 9c55b47440..909489a0c6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -28,15 +28,15 @@ import net.minecraftforge.fluids.FluidStack;
public final class AcidGenFuelAdder {
- public static boolean addLiquidFuel(Materials M, int burn) {
- return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn) != null;
+ public static void addLiquidFuel(Materials M, int burn) {
+ ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn);
}
- public static boolean addLiquidFuel(FluidStack fluidStack, int burn) {
- return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn) != null;
+ public static void addLiquidFuel(FluidStack fluidStack, int burn) {
+ ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn);
}
- public static boolean addMoltenFuel(Materials M, int burn) {
- return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn) != null;
+ public static void addMoltenFuel(Materials M, int burn) {
+ ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn);
}
}
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 1035ab7d5c..c8806d269b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture;
import com.github.bartimaeusnek.bartworks.util.BioDNA;
import com.github.bartimaeusnek.bartworks.util.BioData;
import com.github.bartimaeusnek.bartworks.util.BioPlasmid;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.objects.GT_Fluid;
@@ -163,7 +162,7 @@ public final class BioObjectAdder {
* If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this.
*/
public static void regenerateBioFluids() {
- FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
+ FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
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()}));
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 b38fc86344..11ebdccb3d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -83,6 +83,8 @@ public final class BioObjectGetter {
return BioObjectGetter.convertDataToDNA(BioObjectGetter.convertBioPlasmidToData(bioPlasmid));
}
+ //UNSAFE needs to be reworked!
+
public static Collection<ItemStack> getAllPetriDishes() {
return BioItemList.getAllPetriDishes();
}
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 7e17d323e6..91e6b64e15 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,8 +22,13 @@
package com.github.bartimaeusnek.bartworks.API;
-import com.github.bartimaeusnek.bartworks.MainMod;
+import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
+import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
+import gregtech.api.util.GT_ModHandler;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@@ -41,25 +46,113 @@ public final class BioVatLogicAdder {
public static class RadioHatch {
+ public static void runBasicItemIntegration() {
+ giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_1.get(1), Materials.Thorium, 3);
+ giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_2.get(1), Materials.Thorium, 6);
+ giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_4.get(1), Materials.Thorium, 12);
+
+ giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_1.get(1), Materials.Naquadah, 3);
+ giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_2.get(1), Materials.Naquadah, 6);
+ giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_4.get(1), Materials.Naquadah, 12);
+
+ giveItemStackRadioHatchAbilites(ItemList.Moxcell_1.get(1), Materials.Plutonium, 3);
+ giveItemStackRadioHatchAbilites(ItemList.Moxcell_2.get(1), Materials.Plutonium, 6);
+ giveItemStackRadioHatchAbilites(ItemList.Moxcell_4.get(1), Materials.Plutonium, 12);
+
+ giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_1.get(1), Materials.Uranium, 3);
+ giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_2.get(1), Materials.Uranium, 6);
+ giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12);
+
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3);
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6);
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12);
+
+ giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3);
+ giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6);
+ giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12);
+
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96);
+
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_1.get(1), Materials.Thorium, 3, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_2.get(1), Materials.Thorium, 6, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_4.get(1), Materials.Thorium, 12, 10);
+
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_1.get(1), Materials.Naquadah, 3, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_2.get(1), Materials.Naquadah, 6, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10);
+
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXSimpledepleted",1), Materials.Plutonium, 3, 10);
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXDualdepleted",1), Materials.Plutonium, 6, 10);
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXQuaddepleted",1), Materials.Plutonium, 12, 10);
+
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumSimpledepleted",1), Materials.Uranium, 3, 10);
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumDualdepleted",1), Materials.Uranium, 6, 10);
+ giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumQuaddepleted",1), Materials.Uranium, 12, 10);
+
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3, 10);
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6, 10);
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12, 10);
+
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10);
+ giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10);
+
+ giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10);
+ }
+
private static final HashSet<BioVatLogicAdder.MaterialSvPair> MaSv = new HashSet<>();
private static final HashMap<ItemStack, Integer> IsSv = new HashMap<>();
+ private static final HashMap<ItemStack, Integer> IsKg = new HashMap<>();
+ private static final HashMap<ItemStack, short[]> IsColor = new HashMap<>();
public static HashSet<BioVatLogicAdder.MaterialSvPair> getMaSv() {
return RadioHatch.MaSv;
}
+ public static HashMap<ItemStack, Integer> getIsKg() {
+ return IsKg;
+ }
+
public static HashMap<ItemStack, Integer> getIsSv() {
return RadioHatch.IsSv;
}
- public static void setOverrideSvForMaterial(Materials m, Integer sv) {
+ public static HashMap<ItemStack, short[]> getIsColor() {
+ return IsColor;
+ }
+
+ public static void setOverrideSvForMaterial(Materials m, int sv) {
MaSv.add(new BioVatLogicAdder.MaterialSvPair(m, sv));
}
- public static void giveItemStackRadioHatchAbilites(ItemStack stack, Integer sv) {
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv) {
IsSv.put(stack, sv);
}
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials) {
+ IsSv.put(stack, BW_Util.calculateSv(materials));
+ }
+
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv, int kg) {
+ IsSv.put(stack, sv);
+ IsKg.put(stack, kg);
+ }
+
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials, int kg) {
+ giveItemStackRadioHatchAbilites(stack, BW_Util.calculateSv(materials), kg);
+ IsColor.put(stack, materials.getRGBA());
+ }
+
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials, int kg, int divider) {
+ giveItemStackRadioHatchAbilites(stack, BW_Util.calculateSv(materials) / divider, kg);
+ IsColor.put(stack, materials.getRGBA());
+ }
+
+ public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv, int kg, short[] color) {
+ giveItemStackRadioHatchAbilites(stack, sv, kg);
+ IsColor.put(stack, color);
+ }
+
public static int MaxSV = 150;
public static int getMaxSv() {
@@ -94,7 +187,7 @@ public final class BioVatLogicAdder {
if (ret)
BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier);
else
- MainMod.LOGGER.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!");
+ new IllegalArgumentException("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace();
block = null;
return ret;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java
new file mode 100644
index 0000000000..16ec04b43e
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java
@@ -0,0 +1,88 @@
+/*
+ * 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.bartworks.API;
+
+import cpw.mods.fml.common.Loader;
+
+/**
+ * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP!
+ */
+public class LoaderReference {
+ private LoaderReference(){}
+
+ public static boolean Natura;
+ public static boolean RandomThings;
+ public static boolean TConstruct;
+ public static boolean chisel;
+ public static boolean Railcraft;
+ public static boolean Ztones;
+ public static boolean witchery;
+ public static boolean GalaxySpace;
+ public static boolean GalacticraftCore;
+ public static boolean GalacticraftMars;
+ public static boolean Thaumcraft;
+ public static boolean miscutils;
+ public static boolean tectech;
+ public static boolean ExtraUtilities;
+ public static boolean RWG;
+ public static boolean galacticgreg;
+ public static boolean gendustry;
+ public static boolean croploadcore;
+ public static boolean Forestry;
+ public static boolean berriespp;
+ public static boolean dreamcraft;
+ public static boolean BloodArsenal;
+ public static boolean Botany;
+ public static boolean EnderIO;
+ public static boolean HardcoreEnderExpension;
+ public static boolean betterloadingscreen;
+
+ public static void init() {
+ Natura = Loader.isModLoaded("Natura");
+ RandomThings = Loader.isModLoaded("RandomThings");
+ TConstruct = Loader.isModLoaded("TConstruct");
+ chisel = Loader.isModLoaded("chisel");
+ Railcraft = Loader.isModLoaded("Railcraft");
+ Ztones = Loader.isModLoaded("Ztones");
+ witchery = Loader.isModLoaded("witchery");
+ GalaxySpace = Loader.isModLoaded("GalaxySpace");
+ GalacticraftCore = Loader.isModLoaded("GalacticraftCore");
+ GalacticraftMars = Loader.isModLoaded("GalacticraftMars");
+ Thaumcraft = Loader.isModLoaded("Thaumcraft");
+ miscutils = Loader.isModLoaded("miscutils");
+ tectech = Loader.isModLoaded("tectech");
+ ExtraUtilities = Loader.isModLoaded("ExtraUtilities");
+ RWG = Loader.isModLoaded("RWG");
+ galacticgreg = Loader.isModLoaded("galacticgreg");
+ gendustry = Loader.isModLoaded("gendustry");
+ croploadcore = Loader.isModLoaded("croploadcore");
+ Forestry = Loader.isModLoaded("Forestry");
+ berriespp = Loader.isModLoaded("berriespp");
+ dreamcraft = Loader.isModLoaded("dreamcraft");
+ BloodArsenal = Loader.isModLoaded("BloodArsenal");
+ Botany = Loader.isModLoaded("Botany");
+ EnderIO = Loader.isModLoaded("EnderIO");
+ HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension");
+ betterloadingscreen = Loader.isModLoaded("betterloadingscreen");
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java
new file mode 100644
index 0000000000..8a753938bf
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java
@@ -0,0 +1,37 @@
+/*
+ * 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.bartworks.API;
+
+import cpw.mods.fml.common.FMLCommonHandler;
+
+public class SideReference {
+
+ public static class EffectiveSide {
+ public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer();
+ public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient();
+ }
+ public static class Side {
+ public static final boolean Server = FMLCommonHandler.instance().getSide().isServer();
+ public static final boolean Client = FMLCommonHandler.instance().getSide().isClient();
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java
new file mode 100644
index 0000000000..468885d454
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.bartworks.API;
+
+import gregtech.api.interfaces.ISubTagContainer;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class VoidMinerDropAdder {
+
+ private static Method getExtraDropsDimMap;
+
+ static {
+ try {
+ getExtraDropsDimMap = Class.forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base").getMethod("addMatierialToDimensionList",int.class, ISubTagContainer.class, float.class);
+ } catch (NoSuchMethodException | ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) throws InvocationTargetException, IllegalAccessException {
+ getExtraDropsDimMap.invoke(null, dimID, material, chance);
+ }
+
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java
index 1dc575bd5a..bb3400512c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -27,8 +27,17 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
public final class WerkstoffAPI {
@SuppressWarnings("rawtypes")
- public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
- Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader");
+ static Class w;
+
+ static {
+ try {
+ w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader");
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException {
return (Werkstoff) w.getField(aName).get(null);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java
index 7efe2af842..9eabdee449 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -24,24 +24,18 @@ package com.github.bartimaeusnek.bartworks.API;
import java.util.HashSet;
-public final class WerkstoffAdderRegistry implements Runnable {
+public final class WerkstoffAdderRegistry {
- private static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry();
- private final HashSet<Runnable> toRun = new HashSet<>();
+ private static final HashSet<Runnable> toRun = new HashSet<>();
private WerkstoffAdderRegistry() {
}
- public static WerkstoffAdderRegistry getINSTANCE() {
- return INSTANCE;
- }
-
public static void addWerkstoffAdder(Runnable adder) {
- INSTANCE.toRun.add(adder);
+ toRun.add(adder);
}
- @Override
- public final void run() {
+ public static void run() {
for (Runnable r : toRun)
r.run();
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java
new file mode 100644
index 0000000000..78f721e950
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API")
+package com.github.bartimaeusnek.bartworks.API;
+
+import cpw.mods.fml.common.API; \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
index 6e46f1dbab..63fb597213 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,6 +22,7 @@
package com.github.bartimaeusnek.bartworks;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_HeatedWaterPump;
import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel;
import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer;
@@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWa
import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch;
import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer;
import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.IGuiHandler;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.EntityPlayer;
@@ -60,7 +60,7 @@ public class GuiHandler implements IGuiHandler {
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- if (FMLCommonHandler.instance().getSide().isClient()) {
+ if (SideReference.Side.Client) {
switch (ID) {
case 0:
return new GT_GUIContainer_Destructopack(player.inventory);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 9d83e88b57..33b47fd6a9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -23,71 +23,47 @@
package com.github.bartimaeusnek.bartworks;
-import com.github.bartimaeusnek.bartworks.API.API_REFERENCE;
-import com.github.bartimaeusnek.bartworks.API.BioObjectAdder;
-import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
+import com.github.bartimaeusnek.bartworks.API.*;
import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler;
import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab;
import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab;
import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab;
import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker;
-import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig;
-import com.github.bartimaeusnek.bartworks.common.commands.ClearCraftingCache;
-import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile;
-import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
-import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader;
-import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader;
-import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks;
-import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry;
+import com.github.bartimaeusnek.bartworks.common.loaders.*;
import com.github.bartimaeusnek.bartworks.common.net.BW_Network;
import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler;
-import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
-import com.github.bartimaeusnek.bartworks.system.log.STFUGTPPLOG;
import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader;
import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader;
import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul;
-import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
-import com.github.bartimaeusnek.bartworks.util.BWRecipes;
-import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import com.github.bartimaeusnek.bartworks.util.StreamUtils;
-import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
-import com.google.common.collect.ArrayListMultimap;
+import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
+import com.github.bartimaeusnek.bartworks.util.log.STFUGTPPLOG;
import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
-import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.*;
+import java.util.Map;
import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted;
-import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap;
-import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*;
+import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes;
import static gregtech.api.enums.GT_Values.VN;
+@SuppressWarnings("unused")
@Mod(
modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION,
dependencies = "required-after:IC2; "
@@ -96,6 +72,7 @@ import static gregtech.api.enums.GT_Values.VN;
+ "after:GalacticraftMars; "
+ "after:GalacticraftCore; "
+ "after:Forestry; "
+ + "before:miscutils; "
)
public final class MainMod {
public static final String NAME = "BartWorks";
@@ -120,72 +97,68 @@ public final class MainMod {
MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!");
}
- if (Loader.isModLoaded("miscutils") && ConfigHandler.GTppLogDisabler) {
- try {
- Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true);
- FieldUtils.removeFinalModifier(loggerField, true);
- loggerField.set(null, (Logger) new STFUGTPPLOG());
- } catch (IllegalAccessException | ClassNotFoundException e) {
- e.printStackTrace();
- }
+ LoaderReference.init(); //Check for ALL the mods.
+
+ if (LoaderReference.miscutils && ConfigHandler.GTppLogDisabler) {
+ STFUGTPPLOG.replaceLogger();
}
- if (Loader.isModLoaded("dreamcraft"))
+ if (LoaderReference.dreamcraft)
ConfigHandler.GTNH = true;
ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH;
- if (ConfigHandler.debugLog) {
+ if (API_ConfigValues.debugLog) {
try {
- new DebugLog(preinit);
+ DebugLog.initDebugLog(preinit);
} catch (IOException e) {
e.printStackTrace();
}
}
+ if (ConfigHandler.newStuff) {
+ WerkstoffLoader.setUp();
+ }
+
if (ConfigHandler.GTNH)
MainMod.LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE.");
if (ConfigHandler.BioLab) {
- BioCultureLoader bioCultureLoader = new BioCultureLoader();
- bioCultureLoader.run();
+ BioCultureLoader.run();
}
if (ConfigHandler.newStuff) {
- INSTANCE.init();
Werkstoff.init();
GregTech_API.sAfterGTPostload.add(new CircuitPartLoader());
- if (FMLCommonHandler.instance().getSide().isClient())
- new PrefixTextureLinker();
+ if (SideReference.Side.Client)
+ GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker());
}
}
@Mod.EventHandler
public void init(FMLInitializationEvent init) {
- if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips)
+ if (SideReference.Side.Client && ConfigHandler.tooltips)
MinecraftForge.EVENT_BUS.register(new TooltipEventHandler());
ServerEventHandler serverEventHandler = new ServerEventHandler();
- if (FMLCommonHandler.instance().getSide().isServer()) {
+ if (SideReference.Side.Server) {
MinecraftForge.EVENT_BUS.register(serverEventHandler);
}
FMLCommonHandler.instance().bus().register(serverEventHandler);
if (ConfigHandler.BioLab)
- new BioLabLoader().run();
+ BioLabLoader.run();
if (ConfigHandler.newStuff) {
- if (ConfigHandler.experimentalThreadedLoader)
- new ThreadedLoader().runInit();
- else
- INSTANCE.runInit();
+ WerkstoffLoader.runInit();
}
- new LoaderRegistry().run();
+ ItemRegistry.run();
+ RecipeLoader.run();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent postinit) {
NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH);
if (ConfigHandler.BioLab) {
- new GTNHBlocks().run();
+ GTNHBlocks.run();
for (Map.Entry<BioVatLogicAdder.BlockMetaPair, Byte> pair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) {
GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte()));
}
@@ -193,30 +166,14 @@ public final class MainMod {
BioObjectAdder.regenerateBioFluids();
if (ConfigHandler.newStuff) {
- if (ConfigHandler.experimentalThreadedLoader)
- new ThreadedLoader().run();
- else
- INSTANCE.run();
- localiseAchievements();
+ WerkstoffLoader.run();
+ LocalisationLoader.localiseAll();
}
}
- private static void localiseAchievements(){
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?");
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!");
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!");
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!");
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?");
- GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no...");
- GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute");
- }
-
@Mod.EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
- event.registerServerCommand(new SummonRuin());
- event.registerServerCommand(new ChangeConfig());
- event.registerServerCommand(new PrintRecipeListToFile());
- event.registerServerCommand(new ClearCraftingCache());
+ RegisterServerCommands.registerAll(event);
}
@Mod.EventHandler
@@ -227,349 +184,36 @@ public final class MainMod {
@Mod.EventHandler
public void onModLoadingComplete(FMLLoadCompleteEvent event) {
removeIC2Recipes();
- MainMod.addElectricImplosionCompressorRecipes();
+ StaticRecipeChangeLoaders.addElectricImplosionCompressorRecipes();
PlatinumSludgeOverHaul.replacePureElements();
runOnServerStarted();
- MainMod.unificationRecipeEnforcer();
+ StaticRecipeChangeLoaders.unificationRecipeEnforcer();
}
private static boolean recipesAdded;
- public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes) {
+ public static void runOnPlayerJoined(boolean classicMode, boolean disableExtraGasRecipes) {
OreDictHandler.adaptCacheForWorld();
CircuitImprintLoader.run();
-
+ BioVatLogicAdder.RadioHatch.runBasicItemIntegration();
if (!recipesAdded) {
- if (!extraGasRecipes) {
- ArrayListMultimap<SubTag, GT_Recipe> toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS);
- HashSet<ItemStack> noGas = MainMod.getNoGasItems(toChange);
- MainMod.editRecipes(toChange, noGas);
- }
+ if (!disableExtraGasRecipes)
+ StaticRecipeChangeLoaders.addEBFGasRecipes();
+
if (classicMode)
- new DownTierLoader().run();
-// removeDuplicateRecipes();
+ DownTierLoader.run();
+
+ //StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification();
+
recipesAdded = true;
}
- fixEnergyRequirements();
+ StaticRecipeChangeLoaders.fixEnergyRequirements();
+ //StaticRecipeChangeLoaders.synchroniseCircuitUseMulti();
//Accept recipe map changes into Buffers
GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit);
}
- private 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++) {
- if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) {
- gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i);
- }
- }
- }));
- }
-
- private static void unificationRecipeEnforcer() {
- for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
- if (werkstoff.getGenerationFeatures().enforceUnification) {
- if (werkstoff.contains(NOBLE_GAS)) {
- String name = werkstoff.getFluidOrGas(1).getFluid().getName();
- String wrongname = "molten." + name;
- FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname, 1);
- if (wrongNamedFluid != null) {
- for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
- for (GT_Recipe recipe : map.mRecipeList) {
- for (int i = 0; i < recipe.mFluidInputs.length; i++) {
- if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) {
- Collection<GT_Recipe> col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid());
- map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid());
- map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col);
- recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount);
- map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName());
- }
- }
- for (int i = 0; i < recipe.mFluidOutputs.length; i++) {
- if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) {
- recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount);
- }
- }
- }
- }
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0));
- }
- }
- HashSet<String> oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT());
- oreDictNames.add(werkstoff.getVarName());
- MainMod.runMoltenUnificationEnfocement(werkstoff);
- MainMod.runUnficationDeleter(werkstoff);
- for (String s : oreDictNames)
- for (OrePrefixes prefixes : OrePrefixes.values()) {
- if (OreDictionary.getOres(prefixes + s).size() > 1) {
- for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) {
- ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j);
- ItemStack replacement = werkstoff.get(prefixes);
- if (GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null)
- continue;
- if (toReplace != null) {
- for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
- HashSet<GT_Recipe> toRem = new HashSet<>();
- for (GT_Recipe recipe : map.mRecipeList) {
- boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes);
- for (int i = 0; i < recipe.mInputs.length; i++) {
- if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) {
- if (removal)
- toRem.add(recipe);
- else {
- int amount = recipe.mInputs[i].stackSize;
- recipe.mInputs[i] = replacement.splitStack(amount);
- }
- }
- }
- for (int i = 0; i < recipe.mOutputs.length; i++) {
- if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) {
- if (removal)
- toRem.add(recipe);
- else {
- int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = replacement.splitStack(amount);
- }
- }
- }
- if (recipe.mSpecialItems instanceof ItemStack) {
- if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) {
- if (removal)
- toRem.add(recipe);
- else {
- int amount = ((ItemStack) recipe.mSpecialItems).stackSize;
- recipe.mSpecialItems = replacement.splitStack(amount);
- }
- }
- }
- }
- map.mRecipeList.removeAll(toRem);
- }
- }
- }
- }
- }
- }
- }
- }
-
- @SuppressWarnings("ALL")
- private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) {
- if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) {
- try {
- FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1));
- Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData");
- f.setAccessible(true);
- Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData> sFilledContainerToData = (Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData>) f.get(null);
- HashSet torem = 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 (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) {
- toReplace = entry.getValue().filledContainer;
- torem.add(entry);
- }
- }
- sFilledContainerToData.entrySet().removeAll(torem);
- torem.clear();
- if (toReplace != null) {
- for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
- torem.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);
- // 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);
- // recipe.mOutputs[i] = data.filledContainer;
- if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) {
- torem.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;
- }
- }
- }
- map.mRecipeList.removeAll(torem);
- }
- }
- GT_Utility.addFluidContainerData(data);
- } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
- e.printStackTrace();
- }
- }
- }
-
- private static void runUnficationDeleter(Werkstoff werkstoff) {
- if (werkstoff.getType() == Werkstoff.Types.ELEMENT) {
- if (werkstoff.getBridgeMaterial() != 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.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) {
- GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true);
- for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) {
- GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false);
- GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes);
- }
- }
- }
-
- private static ArrayListMultimap<SubTag, GT_Recipe> getRecipesToChange(SubTag... GasTags) {
- Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator();
- ArrayListMultimap<SubTag, GT_Recipe> toAdd = ArrayListMultimap.create();
- while (it.hasNext()) {
- GT_Recipe recipe = it.next();
- if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
- String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
- Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1));
- if (mat != Materials._NULL) {
- for (SubTag tag : GasTags) {
- if (mat.contains(tag)) {
- DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0]));
- toAdd.put(tag, recipe);
- }
- }
- }
- }
- }
- return toAdd;
- }
-
- private static HashSet<ItemStack> getNoGasItems(ArrayListMultimap<SubTag, GT_Recipe> base) {
- Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator();
- HashSet<ItemStack> toAdd = new HashSet<>();
- ArrayListMultimap<SubTag, GT_Recipe> repToAdd = ArrayListMultimap.create();
- while (it.hasNext()) {
- GT_Recipe recipe = it.next();
- for (SubTag tag : base.keySet())
- recipeLoop:
- for (GT_Recipe baseRe : base.get(tag)) {
- if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length)
- for (int i = 0; i < recipe.mInputs.length; i++) {
- if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && 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])) {
- toAdd.add(recipe.mOutputs[0]);
- repToAdd.put(tag, recipe);
- continue recipeLoop;
- }
- }
- }
- }
- base.putAll(repToAdd);
- return toAdd;
- }
-
- private static void editRecipes(ArrayListMultimap<SubTag, GT_Recipe> base, HashSet<ItemStack> noGas) {
- if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName()))
- return;
- HashSet<GT_Recipe> toAdd = new HashSet<>();
- for (SubTag GasTag : base.keySet()) {
- for (GT_Recipe recipe : base.get(GasTag)) {
- if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
- String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
- Materials mat = Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1));
- if (mat != Materials._NULL) {
- for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) {
- if (!werkstoff.contains(GasTag))
- continue;
- int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons())));
- toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue));
- }
- for (Materials materials : Materials.values()) {
- if (!materials.contains(GasTag))
- continue;
- int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons())));
- toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue));
- }
- for (ItemStack is : noGas) {
- byte circuitConfiguration = 1;
- if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) {
- ArrayList<ItemStack> inputs = new ArrayList<>(recipe.mInputs.length);
- for (ItemStack stack : recipe.mInputs)
- if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !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);
- inputs.add(stack);
- }
- inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration));
- toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue));
- break;
- }
- }
- }
- }
- }
- GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag));
- }
- HashSet<GT_Recipe> duplicates = new HashSet<>();
- for (GT_Recipe recipe : toAdd) {
- for (GT_Recipe recipe2 : toAdd) {
- if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length)
- continue;
- boolean isSame = true;
- for (int i = 0; i < recipe.mInputs.length; i++) {
- if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i]))
- isSame = false;
- }
- for (int i = 0; i < recipe.mFluidInputs.length; i++) {
- if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i]))
- isSame = false;
- }
- if (isSame)
- duplicates.add(recipe2);
- }
- }
- toAdd.removeAll(duplicates);
- toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add);
- }
-
- @SuppressWarnings("ALL")
- private static void addElectricImplosionCompressorRecipes() {
- if (eicMap == null) {
- eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true);
- GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0));
- }
- }
-
- private static boolean checkForExplosives(ItemStack input) {
- 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 void removeDuplicateRecipes(){
-// GT_Recipe.GT_Recipe_Map.sMappings.forEach(
-// gt_recipe_map -> {
-// HashSet<Integer> mappings = new HashSet<>();
-// HashSet<GT_Recipe> dupes = new HashSet<>();
-// gt_recipe_map.mRecipeList.forEach(
-// recipe -> {
-// if (mappings.contains(BW_Util.getRecipeHash(recipe)))
-// dupes.add(recipe);
-// mappings.add(BW_Util.getRecipeHash(recipe));
-// }
-// );
-// gt_recipe_map.mRecipeList.removeAll(dupes);
-// }
-// );
-// }
-
} \ No newline at end of file
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 14a146e01a..59e9ee2782 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
@@ -26,10 +26,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
class TooltipCache {
private static final HashMap<Pair<Integer, Short>, char[]> cache = new HashMap<>();
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java
index 69ec8349b9..77d290504f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,49 +23,62 @@
package com.github.bartimaeusnek.bartworks.client.gui;
import com.github.bartimaeusnek.bartworks.MainMod;
+import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_Container_MultiMachine;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_LanguageManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
-public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine {
+public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine {
- public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(aInventoryPlayer, aTileEntity, aName, null);
+ public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new BW_Container_Windmill(aInventoryPlayer, aTileEntity), "");
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
if (!(this.mContainer instanceof GT_Container_MultiMachine))
return;
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0)
+ if ((this.mContainer.mDisplayErrorCode & 64) != 0)
this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255);
}
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+
+ private static final int DIVIDER = 125;
+ private byte last = 0;
+
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- GL11.glColor3f(0.5f, 0.25f, 0.07f);
this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_Windmill.png"));
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
if (this.mContainer.mMaxProgressTime > 0) {
- this.drawTexturedModalRect(x + 152, y + 5, 176, 0, 16, 15);
- this.drawTexturedModalRect(x + 53, y + 63, 176, 16, 13, 17);
+ if (System.currentTimeMillis() / DIVIDER % 40 == 30)
+ this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 96), 32, 32);
+ else if (System.currentTimeMillis() / DIVIDER % 40 == 20)
+ this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 64), 32, 32);
+ else if (System.currentTimeMillis() / DIVIDER % 40 == 10)
+ this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 32), 32, 32);
+ else if (System.currentTimeMillis() / DIVIDER % 40 == 0)
+ this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 0), 32, 32);
+ else
+ this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32);
}
- if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
- if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) {
- GL11.glColor3f(1f, 1f, 1f);
- this.drawTexturedModalRect(x + 66, y + 66, 176, 33, 15, 15);
+ //Soft Mallet
+ if (this.mContainer.mDisplayErrorCode == 0) {
+ if (this.mContainer.mActive == 0) {
+ this.drawTexturedModalRect(x + 66, y + 66, 176, 128, 15, 15);
}
}
-
-
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
index 58e4cc0c12..cfa0180442 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
@@ -61,7 +61,7 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine
this.drawTexturedModalRect(124, 18, 124, 18, 16, 48);
}
GL11.glColor3f(1f, 1f, 1f);
- this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) MathUtils.ceil(48 * (rem / maxT)));
+ this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT)));
this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java
index af08a21524..8918c09901 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -25,27 +25,28 @@ package com.github.bartimaeusnek.bartworks.client.textures;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
import gregtech.api.enums.Textures;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.Map;
@SideOnly(Side.CLIENT)
public class PrefixTextureLinker implements Runnable {
- public static HashMap<OrePrefixes, HashMap<TextureSet, Textures.ItemIcons.CustomIcon>> texMap = new HashMap<>();
- {
- GregTech_API.sBeforeGTLoad.add(this);
+ public static Map<OrePrefixes, HashMap<TextureSet, Textures.ItemIcons.CustomIcon>> texMap = new HashMap<>();
+ public static Map<TextureSet, Short> blockTexMap = new HashMap<>();
+
+ private static void fillBlockTexMap() {
+ blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4);
}
- @Override
- public void run() {
+ private static void fillItemTexMap() {
Arrays.stream(OrePrefixes.values())
.filter(prefixes -> prefixes != OrePrefixes.rod
- && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0)
+ && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0)
.forEach(prefixes -> {
HashMap<TextureSet, Textures.ItemIcons.CustomIcon> curr = new HashMap<>();
Arrays.stream(TextureSet.class.getFields())
@@ -63,4 +64,10 @@ public class PrefixTextureLinker implements Runnable {
texMap.put(prefixes, curr);
});
}
+
+ @Override
+ public void run() {
+ fillItemTexMap();
+ fillBlockTexMap();
+ }
}
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 9a1f342b3c..24f3aad588 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks;
import com.github.bartimaeusnek.bartworks.MainMod;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -35,6 +36,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
import java.util.List;
@@ -52,6 +54,7 @@ public class BW_Blocks extends Block {
this.name = name;
this.textureNames = texture;
this.setCreativeTab(MainMod.GT2);
+ GregTech_API.registerMachineBlock(this, -1);
}
public BW_Blocks(String name, String[] texture, CreativeTabs tabs) {
@@ -61,6 +64,7 @@ public class BW_Blocks extends Block {
this.name = name;
this.textureNames = texture;
this.setCreativeTab(tabs);
+ GregTech_API.registerMachineBlock(this, -1);
}
public BW_Blocks(String name, String[] texture, CreativeTabs tabs, Material material) {
@@ -70,6 +74,7 @@ public class BW_Blocks extends Block {
this.name = name;
this.textureNames = texture;
this.setCreativeTab(tabs);
+ GregTech_API.registerMachineBlock(this, -1);
}
@Override
@@ -102,6 +107,20 @@ public class BW_Blocks extends Block {
}
@Override
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
public String getUnlocalizedName() {
return this.name;
}
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 195d1afb6d..3661d8e3d7 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,8 +22,8 @@
package com.github.bartimaeusnek.bartworks.common.blocks;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
@@ -93,13 +93,17 @@ public class BW_GlasBlocks extends BW_Blocks {
this.connectedTexture = new IIcon[16];
for (int i = 0; i < this.textureNames.length; i++) {
this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]);
+ String[] splitname = this.textureNames[0].split(":");
for (int j = 0; j < 16; j++) {
- this.connectedTexture[j] = par1IconRegister.registerIcon(this.textureNames[0] + "_" + j);
+ this.connectedTexture[j] = par1IconRegister.registerIcon(
+ splitname[0]
+ + ":connectedTex/"
+ + splitname[1] + '/'
+ + splitname[1] + '_' + j);
}
}
}
-
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) {
@@ -182,7 +186,7 @@ public class BW_GlasBlocks extends BW_Blocks {
@Override
public int getRenderType() {
- if (!this.fake && FMLCommonHandler.instance().getSide().isClient())
+ if (!this.fake && SideReference.Side.Client)
return RendererGlasBlock.RID;
else
return 0;
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 b1aeb18a54..1cb8106399 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
import ic2.core.IHasGui;
@@ -63,6 +64,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
this.setCreativeTab(MainMod.BWT);
this.setBlockName(blockName);
this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName);
+ GregTech_API.registerMachineBlock(this, -1);
}
@Override
@@ -120,9 +122,13 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
- TileEntity t = world.getTileEntity(x,y,z);
- if (t instanceof ITileDropsContent){
- int[] dropSlots = ((ITileDropsContent)t).getDropSlots();
+ if (GregTech_API.isMachineBlock(this, world.getBlockMetadata(x, y, z))) {
+ GregTech_API.causeMachineUpdate(world, x, y, z);
+ }
+
+ TileEntity t = world.getTileEntity(x, y, z);
+ if (t instanceof ITileDropsContent) {
+ int[] dropSlots = ((ITileDropsContent) t).getDropSlots();
for (int dropSlot : dropSlots) {
if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null)
world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot)));
@@ -194,4 +200,11 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI
}
return new String[0];
}
+
+ @Override
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
}
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 d3091afb56..a49fbc5ae4 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -75,6 +75,7 @@ public class ChangeConfig extends CommandBase {
p_71515_1_.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]));
}catch (Exception e){
e.printStackTrace();
}
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
new file mode 100644
index 0000000000..0b179f0332
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java
@@ -0,0 +1,45 @@
+/*
+ * 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.bartworks.common.commands;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.util.ChatComponentText;
+
+public class GetWorkingDirectory extends CommandBase {
+ @Override
+ public String getCommandName() {
+ return "bwgwd";
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender p_71518_1_) {
+ return "bwgwd";
+ }
+
+ @Override
+ public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
+ p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath()));
+ }
+}
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
new file mode 100644
index 0000000000..00a1fc4c4c
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java
@@ -0,0 +1,45 @@
+/*
+ * 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.bartworks.common.commands;
+
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.util.ChatComponentText;
+
+public class RunGC extends CommandBase {
+ @Override
+ public String getCommandName() {
+ return "bwgc";
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender p_71518_1_) {
+ return "bwgc";
+ }
+
+ @Override
+ public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
+ Runtime.getRuntime().gc();
+ p_71515_1_.addChatMessage(new ChatComponentText("Ran GC!"));
+ }
+}
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 d71b89b8cb..b949444067 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.configs;
import com.github.bartimaeusnek.ASM.BWCoreTransformer;
-import gregtech.api.enums.GT_Values;
+import com.github.bartimaeusnek.bartworks.API.API_ConfigValues;
import net.minecraftforge.common.config.Configuration;
import java.util.Arrays;
@@ -46,6 +46,7 @@ public class ConfigHandler {
public static int creativeScannerID;
public static int bioVatMaxParallelBonus = 1000;
public static int cutoffTier = 5;
+ public static int[][][] metasForTiers;
public static long energyPerCell = 1000000L;
@@ -58,16 +59,50 @@ public class ConfigHandler {
public static boolean DEHPDirectSteam;
public static boolean teslastaff;
public static boolean classicMode;
- public static boolean experimentalThreadedLoader;
public static boolean GTNH;
public static boolean ezmode;
- //One-Side-Only
- public static boolean debugLog;
public static boolean GTppLogDisabler;
public static boolean tooltips = true;
public static boolean[] enabledPatches;
+ public static byte maxTierRoss;
+
+ private static final int[][] METAFORTIERS_ENERGY = {
+ {100, 101, 102, 105},
+ {1110, 1115, 1120, 1127},
+ {1111, 12726, 1116, 1121, 1128},
+ {1112, 12727, 1117, 1122, 1129},
+ {12728, 1190, 1130, 12685},
+ {1191, 1174, 695, 12686},
+ };
+ private static final int[][] METAFORTIERS_BUFFER = {
+ {5133, 5123},
+ {161, 171, 181, 191},
+ {162, 172, 182, 192},
+ {163, 173, 183, 193},
+ {164, 174, 184, 194},
+ {165, 175, 185, 195},
+ };
+ private static final int[][] METAFORTIERS_CABLE = {
+ {5133, 5123},
+ {1210, 1230, 1250, 1270, 1290},
+ {1310, 1330, 1350, 1370, 1390},
+ {1410, 1430, 1450, 1470, 1490},
+ {1510, 1530, 1550, 1570, 1590},
+ {1650, 1670, 1690},
+ };
+ private static final int[][] METAFORTIERS_MACHINE = {
+ {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119},
+ {201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, 631, 641, 651, 661, 671},
+ {202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, 632, 642, 652, 662, 672},
+ {203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, 633, 643, 653, 663, 673},
+ {204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, 634, 644, 654, 664, 674},
+ {205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 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", "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"};
+ private static final String[] names = {"Generators", "Buffers", "Cables", "Machines"};
public ConfigHandler(Configuration C) {
ConfigHandler.c = C;
@@ -79,8 +114,8 @@ public class ConfigHandler {
ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false);
ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false);
ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false);
- ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.").getInt(5);
- ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? GT_Values.VN.length : ConfigHandler.cutoffTier);
+ ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "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.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false);
ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150);
@@ -89,17 +124,18 @@ public class ConfigHandler {
ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false);
ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256);
ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000);
+
if (ConfigHandler.IDOffset == 0) {
ConfigHandler.IDOffset = 12600;
ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600);
}
+
ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false);
- ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false);
- ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false);
+ API_ConfigValues.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false);
- for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) {
+ for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++)
BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true);
- }
+
ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length];
ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length);
ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64);
@@ -111,6 +147,16 @@ public class ConfigHandler {
ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3);
ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false);
+ ConfigHandler.maxTierRoss = (byte) ConfigHandler.c.get("Ross Ruin Metas", "A_Ruin Machine Tiers",6,"", 0, VOLTAGE_NAMES.length).getInt(6);
+ ConfigHandler.metasForTiers = new int[4][maxTierRoss][];
+
+ for (int i = 0; i < 4; i++) {
+ if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length)
+ ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0];
+ for (int j = 0; j < maxTierRoss; j++)
+ ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get("Ross Ruin Metas", j+"_Ruin " + names[i] +" Tier " + VOLTAGE_NAMES[j], ConfigHandler.defaultMetasForTiers[i][j]).getIntList();
+ }
+
ConfigHandler.setUpComments();
if (ConfigHandler.c.hasChanged())
@@ -123,6 +169,6 @@ public class ConfigHandler {
ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here.");
ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here.");
ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!");
+ ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here.");
}
-
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java
index 5012725e34..11c9d96f66 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -39,6 +39,10 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.lang.reflect.Field;
+/**
+ * This class gets injected into GT via ASM!
+ * DO NOT CALL IT YOURSELF!
+ */
public class BeforeGTPreload implements Runnable {
private static boolean didrun;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java
index e5591f1150..fcdf63cbc0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -31,7 +31,7 @@ import net.minecraft.item.EnumRarity;
import java.awt.*;
-public class BioCultureLoader implements Runnable {
+public class BioCultureLoader {
public static final BioData BIO_DATA_BETA_LACMATASE = BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0);
private static final BioData BIO_DATA_YEAST = BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common);
@@ -47,8 +47,9 @@ public class BioCultureLoader implements Runnable {
public static BioCulture eColi;
public static BioCulture anaerobicOil;
public static BioCulture generalPurposeFermentingBacteria;
- @Override
- public void run() {
+
+
+ public static void run() {
BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true);
BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true);
BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java
index 93b2ece861..72189ce4da 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -35,15 +35,16 @@ import net.minecraft.item.ItemStack;
import java.util.Collection;
import java.util.HashSet;
-
public class BioItemList {
+ private BioItemList() {
+ }
private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"});
public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)};
private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"});
- public BioItemList() {
+ public static void registerBioItems(){
GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules");
GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts");
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java
index 80a0ff744f..f72cd1f0aa 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,19 +22,11 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
-public class BioLabLoader implements Runnable {
+public class BioLabLoader {
-
- private FluidLoader fluidLoader;
- private BioItemList bioItemList;
- private BioRecipeLoader bioRecipeLoader;
-
- @Override
- public void run() {
- this.fluidLoader = new FluidLoader();
- this.fluidLoader.run();
- this.bioItemList = new BioItemList();
- this.bioRecipeLoader = new BioRecipeLoader();
- this.bioRecipeLoader.run();
+ public static void run() {
+ FluidLoader.run();
+ BioItemList.registerBioItems();
+ BioRecipeLoader.run();
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java
index 5c2088e606..686a7a0777 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,13 +22,13 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -45,11 +45,10 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
-public class BioRecipeLoader extends RecipeLoader {
+public class BioRecipeLoader {
- @Override
@SuppressWarnings("deprecation")
- public void run() {
+ public static void run() {
//DNAExtractionModule
GT_ModHandler.addCraftingRecipe(
@@ -133,16 +132,16 @@ public class BioRecipeLoader extends RecipeLoader {
}
);
- if (Loader.isModLoaded("croploadcore") && OreDictionary.getOres("cropVine").size() > 1)
+ if (LoaderReference.croploadcore && OreDictionary.getOres("cropVine").size() > 1)
for (int i = 0; i < OreDictionary.getOres("cropVine").size(); i++) {
- GT_Values.RA.addExtractorRecipe(OreDictionary.getOres("cropVine").get(i).splitStack(12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3));
+ GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(OreDictionary.getOres("cropVine").get(i),12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3));
}
else
GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3));
GT_Values.RA.addExtractorRecipe(ItemList.Circuit_Chip_Stemcell.get(1L), BioItemList.getOther(4), 500, BW_Util.getMachineVoltageFromTier(6));
- FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L);
+ FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L);
GT_Values.RA.addMixerRecipe(GT_Utility.getIntegratedCircuit(17), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), null, null, dnaFluid, new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), Materials.Empty.getCells(1), 500, BW_Util.getMachineVoltageFromTier(3));
GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), BioItemList.getOther(4), null, null, null, null, null, new int[]{1000}, 60 * 20, BW_Util.getMachineVoltageFromTier(3));
@@ -328,7 +327,7 @@ public class BioRecipeLoader extends RecipeLoader {
new ItemStack[]{new ItemStack(Items.sugar, 64)},
new FluidStack[]{new FluidStack(fluidStack, 100)},
BioCultureLoader.CommonYeast,
- new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))},
+ new FluidStack[]{(LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))},
350,
BW_Util.getMachineVoltageFromTier(4)
);
@@ -384,10 +383,17 @@ public class BioRecipeLoader extends RecipeLoader {
}
public static void runOnServerStarted(){
- for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList){
- FluidStack[] flInput = new FluidStack[]{new FluidStack(recipe.mFluidInputs[0], recipe.mFluidInputs[0].amount*100)};
- FluidStack[] flOutput = new FluidStack[]{new FluidStack(recipe.mFluidOutputs[0], recipe.mFluidOutputs[0].amount)};
- BWRecipes.instance.addBacterialVatRecipe(new ItemStack[]{null},BioCultureLoader.generalPurposeFermentingBacteria,flInput,flOutput,recipe.mDuration > 10 ? recipe.mDuration/10 : recipe.mDuration,recipe.mEUt,GT_Utility.getTier(recipe.mEUt));
- }
+ GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach(
+ recipe ->
+ BWRecipes.instance.addBacterialVatRecipe(
+ new ItemStack[]{null},
+ BioCultureLoader.generalPurposeFermentingBacteria,
+ recipe.mFluidInputs,
+ recipe.mFluidOutputs,
+ recipe.mDuration,
+ recipe.mEUt,
+ GT_Utility.getTier(recipe.mEUt)
+ )
+ );
}
} \ No newline at end of file
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 beba91a18d..924511cd5d 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,14 +22,14 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock;
import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid;
import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock;
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge;
import com.github.bartimaeusnek.bartworks.util.BioCulture;
import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -47,7 +47,7 @@ import net.minecraftforge.fluids.FluidStack;
import java.awt.*;
import java.util.Arrays;
-public class FluidLoader implements Runnable {
+public class FluidLoader {
public static IIcon autogenIIcon;
public static Fluid ff;
@@ -59,8 +59,7 @@ public class FluidLoader implements Runnable {
//OilProcessing chain
public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen;
- @Override
- public void run() {
+ public static void run() {
FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId();
short[] rgb = new short[3];
Arrays.fill(rgb, (short) 255);
@@ -82,7 +81,7 @@ public class FluidLoader implements Runnable {
}
// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB())));
- FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
+ FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
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()}));
@@ -95,7 +94,7 @@ public class FluidLoader implements Runnable {
FluidLoader.bioFluidBlock = new BioFluidBlock();
GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock");
GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge");
- if (FMLCommonHandler.instance().getSide().isClient()) {
+ if (SideReference.Side.Client) {
RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance);
RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java
index f602963c8e..1023b23ee1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,65 +23,65 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
-import cpw.mods.fml.common.Loader;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
/**
* Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek
* Executed on 2019-01-03 02:08:43
* modified by bartimaeusnek to only add blocks that mods are loaded
+ * modified by bartimaeusnek on 2020-03-22 00:20 to run statically
*/
-public class GTNHBlocks implements Runnable {
+public class GTNHBlocks {
- @Override
- public void run() {
+ public static void run() {
BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "glass", 0, 3);
BioVatLogicAdder.BioVatGlass.addCustomGlass("IC2", "blockAlloyGlass", 0, 4);
- if (Loader.isModLoaded("BloodArsenal"))
+ if (LoaderReference.BloodArsenal)
BioVatLogicAdder.BioVatGlass.addCustomGlass("BloodArsenal", "blood_stained_glass", 0, 3);
- if (Loader.isModLoaded("Botany"))
+ if (LoaderReference.Botany)
BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3);
- if (Loader.isModLoaded("EnderIO"))
+ if (LoaderReference.EnderIO)
for (int i = 0; i <= 5; ++i)
BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3);
- if (Loader.isModLoaded("ExtraUtilities")) {
+ if (LoaderReference.ExtraUtilities) {
BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock1", 9, 3);
for (int i = 0; i <= 11; ++i)
BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock2", i, 3);
for (int i = 0; i <= 5; ++i)
BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "etherealglass", i, 3);
}
- if (Loader.isModLoaded("GalaxySpace"))
+ if (LoaderReference.GalaxySpace)
BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglass", 0, 3);
- if (Loader.isModLoaded("HardcoreEnderExpension"))
+ if (LoaderReference.HardcoreEnderExpension)
BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3);
- if (Loader.isModLoaded("Natura"))
+ if (LoaderReference.Natura)
for (int i = 0; i <= 1; ++i)
BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3);
- if (Loader.isModLoaded("RandomThings"))
+ if (LoaderReference.RandomThings)
BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3);
- if (Loader.isModLoaded("TConstruct"))
+ if (LoaderReference.TConstruct)
BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3);
- if (Loader.isModLoaded("tectech"))
+ if (LoaderReference.tectech)
BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8);
- if (Loader.isModLoaded("chisel"))
+ if (LoaderReference.chisel)
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3);
for (int i = 0; i <= 15; ++i) {
BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3);
- if (Loader.isModLoaded("GalaxySpace"))
+ if (LoaderReference.GalaxySpace)
BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3);
- if (Loader.isModLoaded("Railcraft"))
+ if (LoaderReference.Railcraft)
BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3);
- if (Loader.isModLoaded("TConstruct"))
+ if (LoaderReference.TConstruct)
BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3);
- if (Loader.isModLoaded("Ztones"))
+ if (LoaderReference.Ztones)
BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3);
- if (Loader.isModLoaded("chisel")) {
+ if (LoaderReference.chisel) {
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3);
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3);
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_yellow", i, 3);
@@ -89,7 +89,7 @@ public class GTNHBlocks implements Runnable {
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3);
BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3);
}
- if (Loader.isModLoaded("witchery"))
+ if (LoaderReference.witchery)
BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3);
}
}
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 2b61f3250f..df60aafa0f 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,6 +22,7 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks;
import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks;
@@ -41,6 +42,11 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_Til
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
+import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiners;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserBox;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserDynamo;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserHatch;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_Pipe_Energy_LowPower;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -78,28 +84,30 @@ public class ItemRegistry {
public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor");
public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump");
+ public static final Block bw_realglas = new BW_GlasBlocks(
+ "BW_GlasBlocks",
+ new String[]{
+ MainMod.MOD_ID + ":BoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5",
+ MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6",
+ MainMod.MOD_ID + ":ThoriumYttriumGlass",
+ },
+ new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()},
+ MainMod.BIO_TAB,
+ true, false
+ );
+
public static final Block[] bw_glasses = {
- new BW_GlasBlocks(
- "BW_GlasBlocks",
- new String[]{
- MainMod.MOD_ID + ":BoronSilicateGlassBlock",
- MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock",
- MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock",
- MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock",
- MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock",
- MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5",
- MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6",
- MainMod.MOD_ID + ":ThoriumYttriumGlass",
- },
- new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()},
- MainMod.BIO_TAB,
- true, false
- )
+ bw_realglas
};
public static final Block bw_fake_glasses =
new BW_GlasBlocks("BW_GlasBlocks", new String[]{
@@ -133,12 +141,16 @@ public class ItemRegistry {
public static ItemStack[] acidGens = new ItemStack[3];
public static ItemStack[] megaMachines = new ItemStack[3];
public static ItemStack dehp;
+ public static ItemStack[] voidminer = new ItemStack[3];
public static ItemStack thtr;
public static ItemStack eic;
public static ItemStack cal;
public static ItemStack compressedHatch;
public static ItemStack giantOutputHatch;
+ public static ItemStack[][][] TecTechLaserAdditions = new ItemStack[3][4][4];
+ public static ItemStack TecTechPipeEnergyLowPower;
+
public static void run() {
if (newStuff) {
GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock");
@@ -194,6 +206,31 @@ public class ItemRegistry {
ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L);
ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L);
ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L);
+
+ if (LoaderReference.galacticgreg) {
+ ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L);
+ ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L);
+ ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L);
+ }
+ if (LoaderReference.tectech) {
+ TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, "pipe.lowpowerlaser", "Low Power Laser Pipe").getStackForm(1L);
+ int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15;
+ 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++, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L);
+ }
+ }
+ 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++, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L);
+ }
+ }
+ 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++, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L);
+ }
+ }
+ }
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java
new file mode 100644
index 0000000000..733ba9b67b
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java
@@ -0,0 +1,56 @@
+/*
+ * 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.bartworks.common.loaders;
+
+import gregtech.api.util.GT_LanguageManager;
+
+public class LocalisationLoader {
+
+ private LocalisationLoader() {
+ }
+
+ private static void localiseTooltips(){
+ GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore");
+ GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute");
+ }
+
+ private static void localiseAchivements(){
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no...");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!");
+ }
+
+ public static void localiseAll(){
+ localiseAchivements();
+ localiseTooltips();
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
index 34401b4d11..738fe18351 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
@@ -22,6 +22,7 @@
package com.github.bartimaeusnek.bartworks.common.loaders;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo;
@@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import cpw.mods.fml.common.Loader;
import gregtech.api.GregTech_API;
import gregtech.api.enums.*;
import gregtech.api.interfaces.ISubTagContainer;
@@ -50,13 +50,12 @@ import net.minecraftforge.oredict.OreDictionary;
import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff;
-public class RecipeLoader implements Runnable {
+public class RecipeLoader {
protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE;
- @Override
@SuppressWarnings("deprecation")
- public void run() {
+ public static void run() {
if (ConfigHandler.GTNH) {
/*
@@ -753,37 +752,188 @@ public class RecipeLoader implements Runnable {
"BZB",
"BRB",
"BZB",
- 'B',new ItemStack(GregTech_API.sBlockCasings3,1,12),
- 'R',GT_ModHandler.getModItem("IC2","blockGenerator",1,5),
- 'Z',"circuitUltimate"
+ 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12),
+ 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5),
+ 'Z', "circuitUltimate"
}
);
- if (!Loader.isModLoaded("tectech"))
- GT_Values.RA.addAssemblylineRecipe(
- ItemList.Machine_Multi_ImplosionCompressor.get(1L),24000,
- new ItemStack[]{
- ItemList.Machine_Multi_ImplosionCompressor.get(1L),
- Materials.Neutronium.getBlocks(5),
- GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64),
- GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64),
- GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64),
- ItemList.Electric_Piston_UV.get(64),
- },
- new FluidStack[]{
- Materials.SolderingAlloy.getMolten(1440),
- Materials.Osmium.getMolten(1440),
- Materials.Neutronium.getMolten(1440)
- },
- ItemRegistry.eic.copy(),
- 240000,
- BW_Util.getMachineVoltageFromTier(8)
- );
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Input_HV.get(64),Materials.LiquidAir.getCells(1),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.compressedHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0));
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Output_HV.get(64),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.giantOutputHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0));
+ if (LoaderReference.galacticgreg) {
+ GT_Values.RA.addAssemblylineRecipe(
+ ItemList.OreDrill4.get(1L),
+ BW_Util.getMachineVoltageFromTier(6),
+ new Object[]{
+ ItemList.OreDrill4.get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L),
+ Materials.Europium.getPlates(3),
+ ItemList.Electric_Motor_LuV.get(9L),
+ ItemList.Sensor_LuV.get(9L),
+ ItemList.Field_Generator_LuV.get(9L),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L)
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ WerkstoffLoader.Neon.getFluidOrGas(20000),
+ },
+ ItemRegistry.voidminer[0].copy(),
+ 108000,
+ BW_Util.getMachineVoltageFromTier(6)
+ );
+ }
+
+ if (!LoaderReference.tectech) {
+ if (LoaderReference.galacticgreg) {
+ GT_Values.RA.addAssemblylineRecipe(
+ ItemRegistry.voidminer[0].copy(),
+ BW_Util.getMachineVoltageFromTier(7),
+ new Object[]{
+ ItemRegistry.voidminer[0].copy(),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L),
+ Materials.BlackPlutonium.getPlates(3),
+ ItemList.Electric_Motor_ZPM.get(9L),
+ ItemList.Sensor_ZPM.get(9L),
+ ItemList.Field_Generator_ZPM.get(9L),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L)
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ WerkstoffLoader.Krypton.getFluidOrGas(20000)
+ },
+ ItemRegistry.voidminer[1].copy(),
+ 216000,
+ BW_Util.getMachineVoltageFromTier(7)
+ );
+
+ GT_Values.RA.addAssemblylineRecipe(
+ ItemRegistry.voidminer[1].copy(),
+ BW_Util.getMachineVoltageFromTier(8),
+ new Object[]{
+ ItemRegistry.voidminer[1].copy(),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L),
+ Materials.Neutronium.getPlates(3),
+ ItemList.Electric_Motor_UV.get(9L),
+ ItemList.Sensor_UV.get(9L),
+ ItemList.Field_Generator_UV.get(9L),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L)
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ WerkstoffLoader.Oganesson.getFluidOrGas(20000)
+ },
+ ItemRegistry.voidminer[2].copy(),
+ 432000,
+ BW_Util.getMachineVoltageFromTier(8)
+ );
+ }
+ GT_Values.RA.addAssemblylineRecipe(
+ ItemList.Machine_Multi_ImplosionCompressor.get(1L), 24000,
+ new ItemStack[]{
+ ItemList.Machine_Multi_ImplosionCompressor.get(1L),
+ Materials.Neutronium.getBlocks(5),
+ GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64),
+ ItemList.Electric_Piston_UV.get(64),
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ Materials.Osmium.getMolten(1440),
+ Materials.Neutronium.getMolten(1440)
+ },
+ ItemRegistry.eic.copy(),
+ 240000,
+ BW_Util.getMachineVoltageFromTier(8)
+ );
+ } else {
+ ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0];
+ ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1];
+ ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2];
+
+ ItemList[] emitters = {
+ ItemList.Emitter_EV,
+ ItemList.Emitter_IV,
+ ItemList.Emitter_LuV,
+ ItemList.Emitter_ZPM
+ };
+
+ ItemList[] sensors = {
+ ItemList.Sensor_EV,
+ ItemList.Sensor_IV,
+ ItemList.Sensor_LuV,
+ ItemList.Sensor_ZPM
+ };
+
+ OrePrefixes[] prefixes = {
+ OrePrefixes.cableGt04,
+ OrePrefixes.cableGt08,
+ OrePrefixes.cableGt12,
+ OrePrefixes.cableGt16
+ };
+
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[]{
+ ItemList.Circuit_Parts_GlassFiber.get(32),
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8),
+ WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2)
+ },
+ Materials.Polytetrafluoroethylene.getMolten(72),
+ new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()),
+ 200,
+ BW_Util.getMachineVoltageFromTier(4)
+ );
+
+ for (int j = 0; j < 4; j++) {
+ for (int i = 0; i < 4; i++) {
+ ItemStack converter = converters[j][i];
+ ItemStack eInput = input[j][i];
+ ItemStack eDynamo = dynamo[j][i];
+
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[]{
+ 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),
+ emitters[i].get(2 * (j + 1)),
+ sensors[i].get(2 * (j + 1)),
+ ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)),
+ },
+ Materials.SolderingAlloy.getMolten(144 * i * (j + 1)),
+ converter,
+ 200 * (j + 1),
+ BW_Util.getMachineVoltageFromTier(4 + i));
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[]{
+ 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)),
+ },
+ Materials.SolderingAlloy.getMolten(144 * i * (j + 1)),
+ eInput,
+ 200 * (j + 1),
+ BW_Util.getMachineVoltageFromTier(4 + i));
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[]{
+ 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),
+ emitters[i].get(2 * (j + 1)),
+ ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)),
+ },
+ Materials.SolderingAlloy.getMolten(144 * i * (j + 1)),
+ eDynamo,
+ 200 * (j + 1),
+ BW_Util.getMachineVoltageFromTier(4 + i));
+ }
+ }
+ }
+
+ GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.compressedHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0));
+ GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.giantOutputHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0));
GT_Values.RA.addAssemblylineRecipe(
- ItemList.Machine_LuV_CircuitAssembler.get(1L),24000,
+ ItemList.Machine_LuV_CircuitAssembler.get(1L), 24000,
new ItemStack[]{
ItemList.Machine_LuV_CircuitAssembler.get(1L),
ItemList.Robot_Arm_LuV.get(4L),
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java
new file mode 100644
index 0000000000..bac618bb95
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java
@@ -0,0 +1,39 @@
+/*
+ * 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.bartworks.common.loaders;
+
+import com.github.bartimaeusnek.bartworks.common.commands.*;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+
+public class RegisterServerCommands {
+
+ public static void registerAll(FMLServerStartingEvent event){
+ event.registerServerCommand(new SummonRuin());
+ event.registerServerCommand(new ChangeConfig());
+ event.registerServerCommand(new PrintRecipeListToFile());
+ event.registerServerCommand(new ClearCraftingCache());
+ event.registerServerCommand(new GetWorkingDirectory());
+ event.registerServerCommand(new RunGC());
+ }
+
+}
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
new file mode 100644
index 0000000000..cf668d4d36
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
@@ -0,0 +1,559 @@
+/*
+ * 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.bartworks.common.loaders;
+
+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;
+import com.google.common.collect.ArrayListMultimap;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.enums.*;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import org.apache.commons.lang3.reflect.FieldUtils;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap;
+import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*;
+import static gregtech.api.enums.GT_Values.VN;
+
+public class StaticRecipeChangeLoaders {
+
+ private StaticRecipeChangeLoaders() {
+ }
+
+ public static void addEBFGasRecipes() {
+ ArrayListMultimap<SubTag, GT_Recipe> toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS);
+ editRecipes(toChange, getNoGasItems(toChange));
+ }
+
+ 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++) {
+ if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) {
+ gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i);
+ }
+ }
+ }));
+ }
+
+ private static void replaceWrongFluidOutput(Werkstoff werkstoff, GT_Recipe recipe, FluidStack wrongNamedFluid) {
+ for (int i = 0; i < recipe.mFluidOutputs.length; i++) {
+ if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) {
+ recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount);
+ }
+ }
+ }
+
+ private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) {
+ for (int i = 0; i < recipe.mFluidInputs.length; i++) {
+ if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) {
+ Collection<GT_Recipe> col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid());
+ map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid());
+ map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col);
+ recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount);
+ map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName());
+ }
+ }
+ }
+
+ private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) {
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0));
+ }
+
+ private static FluidStack getWrongNameFluid(Werkstoff werkstoff) {
+ String name = werkstoff.getFluidOrGas(1).getFluid().getName();
+ String wrongname = "molten." + name;
+ return FluidRegistry.getFluidStack(wrongname, 1);
+ }
+
+ private static void enforceNobleGas(Werkstoff werkstoff) {
+ FluidStack wrongNamedFluid = getWrongNameFluid(werkstoff);
+ if (wrongNamedFluid != null) {
+ GT_Recipe.GT_Recipe_Map.sMappings.forEach(map -> map.mRecipeList.forEach(recipe -> {
+ replaceWrongFluidInput(werkstoff, map, recipe, wrongNamedFluid);
+ replaceWrongFluidOutput(werkstoff, recipe, wrongNamedFluid);
+ }));
+ addConversionRecipe(werkstoff, wrongNamedFluid);
+ }
+ }
+
+ public static void unificationRecipeEnforcer() {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
+ if (werkstoff.getGenerationFeatures().enforceUnification) {
+
+ if (werkstoff.contains(NOBLE_GAS))
+ enforceNobleGas(werkstoff);
+
+ HashSet<String> oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT());
+ oreDictNames.add(werkstoff.getVarName());
+ StaticRecipeChangeLoaders.runMoltenUnificationEnfocement(werkstoff);
+ StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff);
+ for (String s : oreDictNames)
+ for (OrePrefixes prefixes : OrePrefixes.values()) {
+ if (!werkstoff.hasItemType(prefixes))
+ continue;
+ if (OreDictionary.getOres(prefixes + s).size() <= 1)
+ continue;
+ for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) {
+ ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j);
+ ItemStack replacement = werkstoff.get(prefixes);
+ if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null)
+ continue;
+ for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
+ HashSet<GT_Recipe> toRem = new HashSet<>();
+ for (GT_Recipe recipe : map.mRecipeList) {
+ boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes);
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace))
+ continue;
+ if (removal)
+ toRem.add(recipe);
+ else {
+ int amount = recipe.mInputs[i].stackSize;
+ recipe.mInputs[i] = BW_Util.setStackSize(replacement, amount);
+ }
+ }
+ for (int i = 0; i < recipe.mOutputs.length; i++) {
+ if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace))
+ continue;
+ if (removal)
+ toRem.add(recipe);
+ else {
+ int amount = recipe.mOutputs[i].stackSize;
+ recipe.mOutputs[i] = BW_Util.setStackSize(replacement, amount);
+ }
+ }
+ if (recipe.mSpecialItems instanceof ItemStack) {
+ if (!GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace))
+ continue;
+ if (removal)
+ toRem.add(recipe);
+ else {
+ int amount = ((ItemStack) recipe.mSpecialItems).stackSize;
+ recipe.mSpecialItems = BW_Util.setStackSize(replacement, amount);
+ }
+ }
+ }
+ map.mRecipeList.removeAll(toRem);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("ALL")
+ private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) {
+ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) {
+ try {
+ FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1));
+ Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData");
+ f.setAccessible(true);
+ Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData> sFilledContainerToData = (Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData>) f.get(null);
+ HashSet torem = 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 (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) {
+ toReplace = entry.getValue().filledContainer;
+ torem.add(entry);
+ }
+ }
+ sFilledContainerToData.entrySet().removeAll(torem);
+ torem.clear();
+ if (toReplace != null) {
+ for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
+ torem.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);
+ // 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);
+ // recipe.mOutputs[i] = data.filledContainer;
+ if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) {
+ torem.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;
+ }
+ }
+ }
+ map.mRecipeList.removeAll(torem);
+ }
+ }
+ GT_Utility.addFluidContainerData(data);
+ } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static void runUnficationDeleter(Werkstoff werkstoff) {
+ if (werkstoff.getType() == Werkstoff.Types.ELEMENT) {
+ if (werkstoff.getBridgeMaterial() != 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)) {
+ GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true);
+ for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) {
+ GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false);
+ GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes);
+ }
+ }
+ }
+
+ private static ArrayListMultimap<SubTag, GT_Recipe> getRecipesToChange(SubTag... GasTags) {
+ ArrayListMultimap<SubTag, GT_Recipe> toAdd = ArrayListMultimap.create();
+ for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) {
+ if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
+ String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
+ Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1));
+ if (mat != Materials._NULL) {
+ for (SubTag tag : GasTags) {
+ if (mat.contains(tag)) {
+ DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0]));
+ toAdd.put(tag, recipe);
+ }
+ }
+ }
+ }
+ }
+ return toAdd;
+ }
+
+ private static HashSet<ItemStack> getNoGasItems(ArrayListMultimap<SubTag, GT_Recipe> base) {
+ HashSet<ItemStack> toAdd = new HashSet<>();
+ ArrayListMultimap<SubTag, GT_Recipe> repToAdd = ArrayListMultimap.create();
+ for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) {
+ for (SubTag tag : base.keySet())
+ recipeLoop:
+ for (GT_Recipe baseRe : base.get(tag)) {
+ if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length)
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && 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])) {
+ toAdd.add(recipe.mOutputs[0]);
+ repToAdd.put(tag, recipe);
+ continue recipeLoop;
+ }
+ }
+ }
+ }
+ base.putAll(repToAdd);
+ return toAdd;
+ }
+
+ private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet<GT_Recipe> toAdd) {
+ for (Materials materials : Materials.values()) {
+ if (materials.contains(GasTag)) {
+ int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons())));
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue));
+ }
+ }
+ }
+
+ private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet<GT_Recipe> toAdd) {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) {
+ if (werkstoff.contains(GasTag)) {
+ int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons())));
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue));
+ }
+ }
+ }
+
+ private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials mat, HashSet<GT_Recipe> toAdd, HashSet<ItemStack> noGas) {
+ for (ItemStack is : noGas) {
+ byte circuitConfiguration = 1;
+ if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) {
+ ArrayList<ItemStack> inputs = new ArrayList<>(recipe.mInputs.length);
+ for (ItemStack stack : recipe.mInputs)
+ if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !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);
+ inputs.add(stack);
+ }
+ inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration));
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue));
+ break;
+ }
+ }
+ }
+
+ private static void removeDuplicateGasRecipes(HashSet<GT_Recipe> toAdd) {
+ HashSet<GT_Recipe> duplicates = new HashSet<>();
+ for (GT_Recipe recipe : toAdd) {
+ for (GT_Recipe recipe2 : toAdd) {
+ if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length)
+ continue;
+ boolean isSame = true;
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i]))
+ isSame = false;
+ }
+ for (int i = 0; i < recipe.mFluidInputs.length; i++) {
+ if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i]))
+ isSame = false;
+ }
+ if (isSame)
+ duplicates.add(recipe2);
+ }
+ }
+ toAdd.removeAll(duplicates);
+ }
+
+ private static Materials getMaterialFromInputFluid(GT_Recipe recipe) {
+ String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
+ return Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1));
+ }
+
+ private static void editRecipes(ArrayListMultimap<SubTag, GT_Recipe> base, HashSet<ItemStack> noGas) {
+ if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName()))
+ return;
+
+ HashSet<GT_Recipe> toAdd = new HashSet<>();
+
+ for (SubTag gasTag : base.keySet()) {
+ for (GT_Recipe recipe : base.get(gasTag)) {
+ if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
+ Materials mat = getMaterialFromInputFluid(recipe);
+ if (mat != Materials._NULL) {
+ editEBFWerkstoffRecipes(gasTag, recipe, mat, toAdd);
+ editEBFMaterialRecipes(gasTag, recipe, mat, toAdd);
+ editEBFNoGasRecipes(recipe, mat, toAdd, noGas);
+ }
+ }
+ }
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(gasTag));
+ }
+
+ removeDuplicateGasRecipes(toAdd);
+ toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add);
+ }
+
+ @SuppressWarnings("ALL")
+ public static void addElectricImplosionCompressorRecipes() {
+ if (eicMap == null) {
+ eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true);
+ GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0));
+ }
+ }
+
+ private static boolean checkForExplosives(ItemStack input) {
+ 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)));
+ }
+
+ public static void patchEBFMapForCircuitUnification() {
+ Field mUsualInputCount = FieldUtils.getField(GT_Recipe.GT_Recipe_Map.class, "mUsualInputCount", true);
+ mUsualInputCount.setAccessible(true);
+
+ try {
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(mUsualInputCount, mUsualInputCount.getModifiers() & ~Modifier.FINAL);
+ mUsualInputCount.setInt(GT_Recipe.GT_Recipe_Map.sBlastRecipes, 3);
+ } catch (IllegalAccessException | NoSuchFieldException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void synchroniseCircuitUseMulti() {
+ GT_Recipe.GT_Recipe_Map[] gt_recipe_maps = {
+ GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes,
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes
+ };
+ getRecipesByCircuitID(gt_recipe_maps).forEach(StaticRecipeChangeLoaders::transformCircuitRecipes);
+ }
+
+ 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()
+ )
+ ));
+ }
+} \ No newline at end of file
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 ede9c1df94..46a7c36cc9 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.bartworks.common.net;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat;
import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
import com.github.bartimaeusnek.bartworks.util.Coords;
import com.google.common.io.ByteArrayDataInput;
-import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.net.GT_Packet;
import net.minecraft.world.IBlockAccess;
@@ -102,7 +102,7 @@ public class RendererPacket extends GT_Packet {
@Override
public void process(IBlockAccess iBlockAccess) {
- if (FMLCommonHandler.instance().getSide().isClient()) {
+ if (SideReference.Side.Client) {
if (this.removal == 0)
GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer);
else
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 fb687ed2a0..e22b440150 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides;
import com.github.bartimaeusnek.bartworks.API.ITileWithGUI;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
+import gregtech.common.GT_Pollution;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -39,6 +40,9 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*;
+import java.util.Arrays;
+import java.util.Optional;
+
public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides {
public static final int FUELSLOT = 0;
@@ -53,12 +57,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
@Override
public void writeToNBT(NBTTagCompound p_145841_1_) {
NBTTagCompound subItemStack = new NBTTagCompound();
- if (this.fuelstack == null)
- p_145841_1_.setTag("ItemStack", subItemStack);
- else {
+ if (this.fuelstack != null) {
this.fuelstack.writeToNBT(subItemStack);
- p_145841_1_.setTag("ItemStack", subItemStack);
}
+ p_145841_1_.setTag("ItemStack", subItemStack);
NBTTagCompound subFluidStack = new NBTTagCompound();
this.outputstack.writeToNBT(subFluidStack);
p_145841_1_.setTag("FluidStack", subFluidStack);
@@ -79,22 +81,26 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
super.readFromNBT(p_145839_1_);
}
- @Override
- public void updateEntity() {
- if (this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) {
- return;
- }
+ private boolean checkPreUpdate() {
+ return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air);
+ }
+
+ private void fixUnderlflow() {
if (this.fuel < 0)
this.fuel = 0;
+ }
+ private void handleRefuel() {
if (this.fuelstack != null && this.fuel == 0) {
this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack);
--this.fuelstack.stackSize;
if (this.fuelstack.stackSize <= 0)
this.fuelstack = null;
}
+ }
+ private void handleWaterGeneration() {
if (this.fuel > 0) {
++this.tick;
--this.fuel;
@@ -107,6 +113,60 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr
}
@Override
+ public void updateEntity() {
+ pushWaterToAdjacentTiles();
+ if (checkPreUpdate())
+ return;
+
+ fixUnderlflow();
+ handleRefuel();
+ handleWaterGeneration();
+ causePollution();
+ }
+
+ private void pushWaterToAdjacentTiles() {
+ Arrays.stream(ForgeDirection.values(), 0, 6) //All but Unknown
+ .forEach(
+ direction -> Optional.ofNullable(
+ this.worldObj.getTileEntity(
+ this.xCoord + direction.offsetX,
+ this.yCoord + direction.offsetY,
+ this.zCoord + direction.offsetZ)
+ ).ifPresent(
+ te -> {
+ if (te instanceof IFluidHandler) {
+ IFluidHandler tank = (IFluidHandler) te;
+ if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) {
+ int drainage;
+ if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 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) {
+ tank.fill(this.outputstack, true);
+ this.drain(drainage, true);
+ }
+ }
+ }
+ ));
+ }
+
+ private void causePollution() {
+ Optional.ofNullable(this.worldObj).ifPresent(e -> {
+ if (e.getTotalWorldTime() % 20 == 0) {
+ Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)).ifPresent(c ->
+ GT_Pollution.addPollution(c, 5)
+ );
+ }
+ }
+ );
+ }
+
+ @Override
public int[] getAccessibleSlotsFromSide(int side) {
return new int[]{0};
}
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 5623735b19..90b0c4ff7d 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
@@ -22,6 +22,7 @@
package com.github.bartimaeusnek.bartworks.common.tileentities.multis;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.items.LabParts;
@@ -29,7 +30,6 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
import com.github.bartimaeusnek.bartworks.common.net.RendererPacket;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
import com.github.bartimaeusnek.bartworks.util.*;
-import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -53,9 +53,8 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.util.*;
+import java.util.stream.Collectors;
public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
@@ -86,8 +85,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
public static int[] specialValueUnpack(int aSpecialValue) {
int[] ret = new int[4];
- ret[0] = aSpecialValue & 0xF; // = glas tier
- ret[1] = aSpecialValue >>> 4 & 0b11; // = special valure
+ ret[0] = aSpecialValue & 0xF; // = glass tier
+ ret[1] = aSpecialValue >>> 4 & 0b11; // = special value
ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false
ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert
return ret;
@@ -102,21 +101,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
private int getInputCapacity() {
- int ret = 0;
-
- for (GT_MetaTileEntity_Hatch_Input fluidH : this.mInputHatches) {
- ret += fluidH.getCapacity();
- }
- return ret;
+ return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum();
}
private int getOutputCapacity() {
- int ret = 0;
-
- for (GT_MetaTileEntity_Hatch_Output fluidH : this.mOutputHatches) {
- ret += fluidH.getCapacity();
- }
- return ret;
+ return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum();
}
@Override
@@ -143,17 +132,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
private int calcMod(double x) {
- int ret = (int) MathUtils.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D));
- return ret <= 0 ? 1 : Math.min(ret, 100);//(int) MathUtils.ceil((-0.00000025D * x * (x - this.getOutputCapacity())));
- }
+ double y = (((double) this.getOutputCapacity()) / 2D),
+ z = ConfigHandler.bioVatMaxParallelBonus;
- @Override
- public boolean checkRecipe(ItemStack itemStack) {
- GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap();
-
- if (gtRecipeMap == null)
- return false;
+ int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z));
+ return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus);
+ }
+ private List<ItemStack> getItemInputs(){
ArrayList<ItemStack> tInputList = this.getStoredInputs();
int tInputList_sS = tInputList.size();
for (int i = 0; i < tInputList_sS - 1; i++) {
@@ -170,8 +156,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
}
}
- ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]);
+ return tInputList;
+ }
+ private List<FluidStack> getFluidInputs(){
ArrayList<FluidStack> tFluidList = this.getStoredFluids();
int tFluidList_sS = tFluidList.size();
for (int i = 0; i < tFluidList_sS - 1; i++) {
@@ -188,10 +176,20 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
}
}
+ return tFluidList;
+ }
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]);
+ @Override
+ public boolean checkRecipe(ItemStack itemStack) {
+ GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap();
- if (tFluidList.size() > 0) {
+ if (gtRecipeMap == null)
+ return false;
+
+ ItemStack[] tInputs = getItemInputs().toArray(new ItemStack[0]);
+ FluidStack[] tFluids = getFluidInputs().toArray(new FluidStack[0]);
+
+ if (tFluids.length > 0) {
GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs);
@@ -205,19 +203,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
this.mNeededSievert = conditions[3];
- if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0]))
+ if (conditions[2] == 0 ?
+ (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0])
+ : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0]))
return false;
int times = 1;
-
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
+ Set<FluidStack> storedFluidOutputs = this.getStoredFluidOutputs();
+
if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- if (this.getStoredFluidOutputs().size() > 0) {
+ if (storedFluidOutputs.size() > 0) {
this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length];
- for (FluidStack storedOutputFluid : this.getStoredFluidOutputs()) {
+ for (FluidStack storedOutputFluid : storedFluidOutputs) {
if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0)))
for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) {
int j = this.calcMod(storedOutputFluid.amount);
@@ -226,7 +227,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
times++;
}
}
- for (FluidStack storedfluidStack : this.getStoredFluidOutputs()) {
+ for (FluidStack storedfluidStack : storedFluidOutputs) {
for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) {
if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i)))
this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount));
@@ -254,14 +255,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
return false;
}
- public ArrayList<FluidStack> getStoredFluidOutputs() {
- ArrayList<FluidStack> rList = new ArrayList<>();
-
- for (GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (tHatch.getFluid() != null)
- rList.add(tHatch.getFluid());
- }
- return rList;
+ public Set<FluidStack> getStoredFluidOutputs() {
+ return this.mOutputHatches.stream().map(GT_MetaTileEntity_Hatch_Output::getFluid).filter(Objects::nonNull).collect(Collectors.toSet());
}
private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) {
@@ -317,12 +312,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
}
- if (blockcounter > 18)
- if (this.mRadHatches.size() < 2)
- if (this.mOutputHatches.size() == 1)
- if (this.mMaintenanceHatches.size() == 1)
- if (this.mInputHatches.size() > 0)
- return this.mEnergyHatches.size() > 0;
+ if (blockcounter > 18 &&
+ this.mRadHatches.size() < 2 &&
+ this.mOutputHatches.size() == 1 &&
+ this.mMaintenanceHatches.size() == 1 &&
+ this.mInputHatches.size() > 0)
+ return this.mEnergyHatches.size() > 0;
return false;
}
@@ -359,7 +354,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId));
GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB());
- if (FMLCommonHandler.instance().getSide().isServer()) {
+ if (SideReference.Side.Server) {
MainMod.BW_Network_instance.sendPacketToAllPlayersInRange(
this.getBaseMetaTileEntity().getWorld(),
new RendererPacket(
@@ -433,11 +428,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
private int reCalculateFluidAmmount() {
- int lFluidAmount = 0;
- for (int i = 0; i < this.getStoredFluids().size(); i++) {
- lFluidAmount += this.getStoredFluids().get(i).amount;
- }
- return lFluidAmount;
+ return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum();
}
private int reCalculateHeight() {
@@ -532,7 +523,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock))
this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord());
GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId);
- if (FMLCommonHandler.instance().getSide().isServer())
+ if (SideReference.Side.Server)
MainMod.BW_Network_instance.sendPacketToAllPlayersInRange(
this.getBaseMetaTileEntity().getWorld(),
new RendererPacket(
@@ -587,6 +578,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
+ @SuppressWarnings("deprecation")
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX]};
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java
index 5b26664943..c1c7cc0d29 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java
@@ -69,9 +69,9 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil
FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length];
for (int i = 0; i < nuoutputs.length; i++) {
nuoutputs[i] = recipeDistill.mFluidOutputs[i];
- nuoutputs[i].amount = (int) (MathUtils.floor(recipeDistill.mFluidOutputs[i].amount * ratio));
+ nuoutputs[i].amount = MathUtils.floorInt(recipeDistill.mFluidOutputs[i].amount * ratio);
}
- BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (MathUtils.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (MathUtils.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0);
+ BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0);
if (combined.isRecipeInputEqual(true, array)) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
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 0d449ecddc..dc85f9476d 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
@@ -139,7 +139,19 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000))
return false;
- int toReduce = new XSTR().nextInt((int) MathUtils.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D));
+ reduceSupply();
+ addBurnedOutBalls();
+ this.updateSlots();
+
+ this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)};
+
+ this.mEUt=0;
+ this.mMaxProgresstime=648000;
+ return true;
+ }
+
+ private void reduceSupply() {
+ int toReduce = new XSTR().nextInt(MathUtils.floorInt(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D));
this.savedBISO = BISOPeletSupply;
this.savedTRISO = TRISOPeletSupply;
@@ -155,14 +167,23 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
else
this.BISOPeletSupply -= toReduce;
}
+ }
- this.updateSlots();
+ private void addBurnedOutBalls() {
+ int burnedTRISO = this.savedTRISO - this.TRISOPeletSupply;
+ int burnedBISO = this.savedBISO - this.BISOPeletSupply;
+ int burnedTRISOBall = burnedTRISO / 64;
+ int burnedBISOBall = burnedBISO / 64;
- this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)};
+ burnedBISO -= (burnedBISOBall*64);
+ burnedTRISO -= (burnedTRISOBall*64);
- this.mEUt=0;
- this.mMaxProgresstime=648000;
- return true;
+ this.mOutputItems = new ItemStack[] {
+ new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISOBall, 6),
+ new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISO, 8),
+ new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISOBall, 7),
+ new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISO, 9)
+ };
}
@Override
@@ -186,7 +207,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
accessibleCoolant += fluidStack.amount;
}
}
-
+
accessibleCoolant = Math.min((long) ((0.00711111111111111111111111111111D*(double)this.savedTRISO + 0.00474074074074074074074074074074D*(double)this.savedBISO)), accessibleCoolant);
for (FluidStack fluidStack : this.getStoredFluids()) {
@@ -308,6 +329,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
+ @SuppressWarnings("deprecation")
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX]};
}
@@ -319,7 +341,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
}
public static class THTRMaterials{
- static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass("BISOPelletCompound","BISOPellet","TRISOPelletCompound","TRISOPellet","BISOPelletBall","TRISOPelletBall");
+ static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass(
+ "BISOPelletCompound",
+ "BISOPellet",
+ "TRISOPelletCompound",
+ "TRISOPellet",
+ "BISOPelletBall",
+ "TRISOPelletBall",
+ "BurnedOutBISOPelletBall",
+ "BurnedOutTRISOPelletBall",
+ "BurnedOutBISOPellet",
+ "BurnedOutTRISOPellet"
+ );
public static void registeraTHR_Materials(){
GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials");
}
@@ -345,15 +378,17 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase {
GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),40,30);
ItemStack[] pellets = new ItemStack[6];
Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,1));
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,24000,30,0);
GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30);
GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),40,30);
pellets = new ItemStack[6];
Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,3));
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,6),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,8)},null,null,null,null,48000,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,7),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,9)},null,null,null,null,48000,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8)},new ItemStack[]{Materials.Lutetium.getDustSmall(2)},null,null,null,null,1200,30,0);
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9)},new ItemStack[]{Materials.Lutetium.getDustSmall(4)},null,null,null,null,1200,30,0);
}
}
-
-
-}
+} \ No newline at end of file
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 1e3c2dc45d..69a20db22c 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill;
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock;
+import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -57,8 +58,9 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
import static gregtech.api.enums.GT_Values.V;
@@ -68,7 +70,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
private static final IIconContainer[] iIconContainers = new IIconContainer[2];
private static final ITexture[] iTextures = new ITexture[3];
- private final ArrayList<TileEntityDispenser> tedList = new ArrayList<>();
+ private static final XSTR localRandomInstance = new XSTR();
private BW_RotorBlock rotorBlock;
private byte hasDoor;
@@ -85,16 +87,15 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
return true;
}
+ private final Set<TileEntityDispenser> tileEntityDispensers = new HashSet<>();
+
+ @Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mMaxProgresstime > 0)
this.mProgresstime += this.rotorBlock.getGrindPower();
return this.rotorBlock.getGrindPower() > 0;
}
- public boolean doRandomMaintenanceDamage() {
- return true;
- }
-
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return true;
@@ -139,6 +140,27 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
+ public boolean doRandomMaintenanceDamage() {
+ return true;
+ }
+
+ private boolean hardOverride(int maxProgresstime, boolean randomise, ItemStack input, ItemStack... outputs) {
+ input.stackSize -= 1;
+ this.mMaxProgresstime = maxProgresstime;
+ if (randomise) {
+ if (localRandomInstance.nextInt(2) == 0)
+ this.mOutputItems[0] = outputs[0];
+ else
+ this.mOutputItems[0] = outputs[1];
+ } else {
+ this.mOutputItems[0] = outputs[0];
+ if (outputs.length == 2)
+ this.mOutputItems[1] = outputs[1];
+ }
+ return true;
+ }
+
+ @Override
public boolean checkRecipe(ItemStack itemStack) {
if (itemStack == null || itemStack.getItem() == null)
@@ -150,119 +172,110 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
//Override Recipes that doesnt quite work well with OreUnificator
//Items
if (itemStack.getItem().equals(Items.wheat)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 15 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L));
- this.mOutputItems[1] = (GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L));
- return true;
+ return hardOverride(
+ 30000,
+ false,
+ itemStack,
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L));
} else if (itemStack.getItem().equals(Items.bone)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 15 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.dye, 4, 15);
- else
- this.mOutputItems[0] = new ItemStack(Items.dye, 3, 15);
- return true;
+ return hardOverride(
+ 30000,
+ true,
+ itemStack,
+ new ItemStack(Items.dye, 4, 15),
+ new ItemStack(Items.dye, 3, 15));
}
//Blocks
else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 30 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.flint, 2);
- else
- this.mOutputItems[0] = new ItemStack(Items.flint);
- return true;
+ return hardOverride(
+ 60000,
+ true,
+ itemStack,
+ new ItemStack(Items.flint, 2),
+ new ItemStack(Items.flint));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L);
- else
- this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L);
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 45 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Blocks.sand, 3);
- else
- this.mOutputItems[0] = new ItemStack(Blocks.sand, 2);
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ new ItemStack(Blocks.sand, 3),
+ new ItemStack(Blocks.sand, 2));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = Materials.Clay.getDust(2);
- else
- this.mOutputItems[0] = Materials.Clay.getDust(1);
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ Materials.Clay.getDust(2),
+ Materials.Clay.getDust(1));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- this.mOutputItems[0] = Materials.Redstone.getDust(9);
- return true;
+ return hardOverride(
+ 120000,
+ false,
+ itemStack,
+ Materials.Redstone.getDust(9));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L));
- return true;
+ return hardOverride(
+ 120000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L)));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.string, 3);
- else
- this.mOutputItems[0] = new ItemStack(Items.string, 2);
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ new ItemStack(Items.string, 3),
+ new ItemStack(Items.string, 2));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 4);
- else
- this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 3);
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ new ItemStack(Items.glowstone_dust, 4),
+ new ItemStack(Items.glowstone_dust, 3));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L));
- else
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L));
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)),
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L)));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L));
- else
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L));
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)),
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L));
- else
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L));
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)),
+ (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 15 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 2);
- else
- this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 1);
- return true;
+ return hardOverride(
+ 30000,
+ true,
+ itemStack,
+ new ItemStack(Items.pumpkin_seeds, 2),
+ new ItemStack(Items.pumpkin_seeds, 1));
} else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 15 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 2);
- else
- this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 1);
- return true;
+ return hardOverride(
+ 30000,
+ true,
+ itemStack,
+ new ItemStack(Items.melon_seeds, 2),
+ new ItemStack(Items.melon_seeds, 1));
}
//null checks for GT shit
@@ -276,40 +289,47 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
//Ore Unificator shit for balance
if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 45 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 90000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 120000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 15 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 30000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 30 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 60000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 30 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 60000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 30 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 60000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
} else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L));
- return true;
+ return hardOverride(
+ 120000,
+ false,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)));
} else if (
OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) ||
OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) ||
@@ -321,36 +341,41 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) ||
OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)
) {
- itemStack.stackSize -= 1;
- this.mMaxProgresstime = 60 * 20 * 100;
- if (new XSTR().nextInt(2) == 0)
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L));
- else
- this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L));
- return true;
+ return hardOverride(
+ 120000,
+ true,
+ itemStack,
+ (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)),
+ (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)));
}
return this.recipe_fallback(itemStack); //2nd fallback
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new BW_Container_Windmill(aPlayerInventory, aBaseMetaTileEntity);
}
public boolean addDispenserToOutputSet(TileEntity aTileEntity) {
if (aTileEntity instanceof TileEntityDispenser) {
- this.tedList.add((TileEntityDispenser) aTileEntity);
+ this.tileEntityDispensers.add((TileEntityDispenser) aTileEntity);
return true;
}
return false;
}
@SuppressWarnings("ALL")
+ @Override
public boolean addOutput(ItemStack aStack) {
if (GT_Utility.isStackInvalid(aStack))
return false;
- for (TileEntityDispenser tHatch : this.tedList) {
+ for (TileEntityDispenser tHatch : this.tileEntityDispensers) {
for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) {
if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) {
@@ -454,9 +479,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
return false;
//check for outputs
- if (this.tedList.isEmpty())
+ if (this.tileEntityDispensers.isEmpty())
return false;
-
this.mWrench = true;
this.mScrewdriver = true;
this.mSoftHammer = true;
@@ -473,12 +497,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ this.mProgresstime++;
if (aBaseMetaTileEntity.isServerSide()) {
if (this.mEfficiency < 0)
this.mEfficiency = 0;
+ //noinspection NonAtomicOperationOnVolatileField
if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) {
this.hasDoor = 0;
- this.tedList.clear();
+ this.tileEntityDispensers.clear();
this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]);
}
if (this.mStartUpCheck < 0) {
@@ -577,6 +603,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
}
@SideOnly(Side.CLIENT)
+ @Override
public void registerIcons(IIconRegister aBlockIconRegister) {
GT_TileEntity_Windmill.iIcons[0] = Blocks.brick_block.getIcon(0, 0);
GT_TileEntity_Windmill.iIconContainers[0] = new IIconContainer() {
@@ -643,4 +670,4 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase {
return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT;
return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT;
}
-}
+} \ No newline at end of file
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 cf38712bc6..86ac7fc73d 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,18 +22,25 @@
package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
+import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.bartimaeusnek.bartworks.util.MegaUtils;
+import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti;
+import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser;
+import cpw.mods.fml.common.Optional;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace;
@@ -46,16 +53,28 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;
import static gregtech.api.enums.GT_Values.V;
-public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace {
+@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true)
+public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace implements TecTechEnabledMulti {
private int mHeatingCapacity;
private byte glasTier;
private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax;
+ static Field controllerY;
+
+ static {
+ try {
+ controllerY = GT_MetaTileEntity_ElectricBlastFurnace.class.getDeclaredField("controllerY");
+ } catch (NoSuchFieldException e) {
+ MainMod.LOGGER.catching(e);
+ }
+ controllerY.setAccessible(true);
+ }
public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -77,13 +96,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
return fdsc;
}
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setByte("glasTier",glasTier);
- aNBT.setByte("circuitMode",circuitMode);
- aNBT.setLong("lEUt",lEUt);
- }
+ @SuppressWarnings("rawtypes")
+ public ArrayList TTTunnels = new ArrayList<>();
+ @SuppressWarnings("rawtypes")
+ public ArrayList TTMultiAmp = new ArrayList<>();
@Override
public void loadNBTData(NBTTagCompound aNBT) {
@@ -119,69 +135,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
this.getBaseMetaTileEntity().disableWorking();
}
- public String[] getInfoData() {
- int mPollutionReduction = 0;
-
- for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) {
- if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) {
- mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction);
- }
- }
-
- long storedEnergy = 0L;
- long maxEnergy = 0L;
-
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
- }
-
- return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"};
- }
-
- private long lEUt = 0;
-
- public boolean drainEnergyInput(long aEU) {
- if (aEU <= 0)
- return true;
- long allTheEu = 0;
- int hatches = 0;
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches)
- if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- allTheEu += tHatch.getEUVar();
- hatches++;
- }
- if (allTheEu < aEU)
- return false;
- long euperhatch = aEU / hatches;
- HashSet<Boolean> returnset = new HashSet<>();
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches)
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false))
- returnset.add(true);
- else
- returnset.add(false);
- return returnset.size() > 0 && !returnset.contains(false);
- }
-
-// @Override
-// public long getMaxInputVoltage() {
-// long rVoltage = 0L;
-// Iterator var3 = this.mEnergyHatches.iterator();
-//
-// while(var3.hasNext()) {
-// GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next();
-// if (isValidMetaTileEntity(tHatch)) {
-// rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
-// }
-// }
-// //glass tier needs NBT persistance if this is enabled
-// return glasTier != 8 && rVoltage > BW_Util.getTierVoltage(glasTier) ? BW_Util.getTierVoltage(glasTier) : rVoltage ;
-// }
-
-
private byte circuitMode = 0;
+ private long lEUt = 0;
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
@@ -195,95 +150,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
circuitMode = 0;
}
- GT_Utility.sendChatToPlayer(aPlayer,circuitMode > 0 ? "MEBF will prioritise circuit: "+circuitMode : "Circuit prioritisation disabled.");
+ GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled.");
}
@Override
- public boolean checkRecipe(ItemStack itemStack) {
-
- ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]);
-
- FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]);
- long tVoltage = this.getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe;
- if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){
- List<ItemStack> modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList());
- modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode));
- tInputs = modInputs.toArray(new ItemStack[0]);
- }
- tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
- if (tRecipe == null) {
- if (circuitMode == 0)
- return false;
- tInputs = this.getStoredInputs().toArray(new ItemStack[0]);
- tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
- if (tRecipe == null)
- return false;
- }
-
- ArrayList<ItemStack> outputItems = new ArrayList<>();
- ArrayList<FluidStack> outputFluids = new ArrayList<>();
-
- boolean found_Recipe = false;
- int processed = 0;
-
- long nominalV = BW_Util.getnominalVoltage(this);
- int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900;
- long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers));
-
- while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) {
- if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- found_Recipe = true;
- for (int i = 0; i < tRecipe.mOutputs.length; i++) {
- outputItems.add(tRecipe.getOutput(i));
- }
- for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) {
- outputFluids.add(tRecipe.getFluidOutput(i));
- }
- ++processed;
- } else
- break;
- }
-
- if (found_Recipe) {
- this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- byte overclockCount;
- long actualEUT = (long) (tRecipe.mEUt) * processed;
-// if (actualEUT > Integer.MAX_VALUE) {
-// byte divider = 0;
-// while (actualEUT > Integer.MAX_VALUE) {
-// actualEUT = actualEUT / 2;
-// divider++;
-// }
-// overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV);
-// } else
- overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV);
- //In case recipe is too OP for that machine
- if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1)
- return false;
- if (this.lEUt > 0) {
- this.lEUt = (-this.lEUt);
- }
- if (tHeatCapacityDivTiers > 0) {
- this.lEUt = (int) (this.lEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
- this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible
- if (this.mMaxProgresstime < 1)
- this.mMaxProgresstime = 1;//no eu efficiency correction
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setByte("glasTier", glasTier);
+ aNBT.setByte("circuitMode", circuitMode);
+ aNBT.setLong("lEUt", lEUt);
+ }
- this.polPtick = super.getPollutionPerTick(null) * processed;
- this.mOutputItems = new ItemStack[outputItems.size()];
- this.mOutputItems = outputItems.toArray(this.mOutputItems);
- this.mOutputFluids = new FluidStack[outputFluids.size()];
- this.mOutputFluids = outputFluids.toArray(this.mOutputFluids);
- this.updateSlots();
- return true;
- }
- return false;
+ @Override
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (LoaderReference.tectech)
+ return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex);
+ return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex);
}
/**
@@ -321,7 +203,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power
timesOverclocked++;
}
- if (xEUt > maxInputVoltage){
+ if (xEUt > maxInputVoltage) {
//downclock one notch, we have overshot.
xEUt >>=2;
this.mMaxProgresstime <<= 1;
@@ -341,47 +223,44 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
return timesOverclocked;
}
- @Override
- public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- this.mHeatingCapacity = 0;
- boolean ret;
- ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11);
- ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11);
- ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11);
- for (int y = -1; y < 17; y++) {
- ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11);
- if (!this.getCoilHeat(iGregTechTileEntity, y))
- return false;
- List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false);
- for (Byte meta : metasFromLayer) {
- byte inttier = BW_Util.getTierFromGlasMeta(meta);
- if (this.glasTier > 0 && inttier != this.glasTier)
- return false;
- else if (this.glasTier == 0)
- this.glasTier = inttier;
- }
+ public String[] getInfoData() {
+ int mPollutionReduction = 0;
+
+ for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches)
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e))
+ mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction);
+
+ long storedEnergy = 0L;
+ long maxEnergy = 0L;
+
+ if (LoaderReference.tectech) {
+ long[] info = getCurrentInfoData();
+ storedEnergy = info[0];
+ maxEnergy = info[1];
}
- int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7;
- int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7;
- for (int z = -6; z <= 6; z++)
- for (int x = -6; x <= 6; x++) {
- if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) {
- return false;
- }
+
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
}
- if (!this.mOutputHatches.isEmpty()) {
- for (GT_MetaTileEntity_Hatch_Output hatchOutput : this.mOutputHatches)
- if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord())
- return false;
}
- if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty())
- for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) {
- if (this.glasTier < hatchEnergy.mTier)
- return false;
- }
+ return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"};
+ }
- return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty();
+ @Override
+ public boolean drainEnergyInput(long aEU) {
+ if (LoaderReference.tectech)
+ return TecTechUtils.drainEnergyMEBFTecTech(this, aEU);
+ return MegaUtils.drainEnergyMegaVanilla(this, aEU);
+ }
+
+ @Override
+ public long getMaxInputVoltage() {
+ if (LoaderReference.tectech)
+ return TecTechUtils.getMaxInputVoltage(this);
+ return super.getMaxInputVoltage();
}
private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) {
@@ -445,4 +324,179 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
return new GT_TileEntity_MegaBlastFurnace(this.mName);
}
+
+ @Override
+ public boolean checkRecipe(ItemStack itemStack) {
+
+ ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]);
+
+ FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]);
+ long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this);
+
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV));
+ GT_Recipe tRecipe;
+ if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) {
+ List<ItemStack> modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList());
+ modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode));
+ tInputs = modInputs.toArray(new ItemStack[0]);
+ }
+ tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
+ if (tRecipe == null) {
+ if (circuitMode == 0)
+ return false;
+ tInputs = this.getStoredInputs().toArray(new ItemStack[0]);
+ tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
+ if (tRecipe == null)
+ return false;
+ }
+
+ ArrayList<ItemStack> outputItems = new ArrayList<>();
+ ArrayList<FluidStack> outputFluids = new ArrayList<>();
+
+ boolean found_Recipe = false;
+ int processed = 0;
+
+ int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900;
+ long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers));
+
+ while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) {
+ if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
+ found_Recipe = true;
+ for (int i = 0; i < tRecipe.mOutputs.length; i++) {
+ outputItems.add(tRecipe.getOutput(i));
+ }
+ for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) {
+ outputFluids.add(tRecipe.getFluidOutput(i));
+ }
+ ++processed;
+ } else
+ break;
+ }
+
+ if (found_Recipe) {
+ this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ long actualEUT = precutRecipeVoltage * processed;
+ byte overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV);
+
+ //In case recipe is too OP for that machine
+ if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1)
+ return false;
+
+ if (this.lEUt > 0)
+ this.lEUt = (-this.lEUt);
+
+ if (tHeatCapacityDivTiers > 0) {
+ this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible
+ if (this.mMaxProgresstime < 1)
+ this.mMaxProgresstime = 1; //no eu efficiency correction
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ this.polPtick = super.getPollutionPerTick(null) * processed;
+ this.mOutputItems = new ItemStack[outputItems.size()];
+ this.mOutputItems = outputItems.toArray(this.mOutputItems);
+ this.mOutputFluids = new FluidStack[outputFluids.size()];
+ this.mOutputFluids = outputFluids.toArray(this.mOutputFluids);
+ this.updateSlots();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
+ try {
+ controllerY.set(this, iGregTechTileEntity.getYCoord() - 2);
+ } catch (IllegalAccessException e) {
+ MainMod.LOGGER.catching(e);
+ }
+
+ if (LoaderReference.tectech) {
+ this.getTecTechEnergyMultis().clear();
+ this.getTecTechEnergyTunnels().clear();
+ }
+
+ this.mHeatingCapacity = 0;
+ boolean ret;
+ ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false, false, true, GregTech_API.sBlockCasings1, 11, true, 11);
+ ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11);
+ ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11);
+
+ for (int y = -1; y < 17; y++) {
+ ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11);
+ if (!this.getCoilHeat(iGregTechTileEntity, y))
+ return false;
+ List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false);
+ for (Byte meta : metasFromLayer) {
+ byte inttier = BW_Util.getTierFromGlasMeta(meta);
+ if (this.glasTier > 0 && inttier != this.glasTier)
+ return false;
+ else if (this.glasTier == 0)
+ this.glasTier = inttier;
+ }
+ }
+
+ int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7;
+ int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7;
+
+ for (int z = -6; z <= 6; z++)
+ for (int x = -6; x <= 6; x++)
+ if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11))
+ return false;
+
+ if (LoaderReference.tectech && this.glasTier != 8)
+ if (!areLazorsLowPowa() || !areThingsProperlyTiered(this.getTecTechEnergyTunnels()) || !areThingsProperlyTiered(this.getTecTechEnergyMultis()))
+ return false;
+
+ if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty())
+ for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches)
+ if (this.glasTier < hatchEnergy.mTier)
+ return false;
+
+ return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty();
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areThingsProperlyTiered(Collection collection) {
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier)
+ return false;
+ return true;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areLazorsLowPowa() {
+ Collection collection = this.getTecTechEnergyTunnels();
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (!(tecTechEnergyMulti instanceof LowPowerLaser))
+ return false;
+ return true;
+ }
+
+ @Override
+ @Optional.Method(modid = "tectech")
+ public List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches() {
+ return this.mEnergyHatches;
+ }
+
+ @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Optional.Method(modid = "tectech")
+ public List getTecTechEnergyTunnels() {
+ return TTTunnels;
+ }
+
+ @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Optional.Method(modid = "tectech")
+ public List getTecTechEnergyMultis() {
+ return TTMultiAmp;
+ }
}
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 4e81813ca1..33434bb9d6 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
@@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
import com.github.bartimaeusnek.bartworks.util.MathUtils;
+import com.github.bartimaeusnek.bartworks.util.MegaUtils;
import com.google.common.collect.ArrayListMultimap;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -142,7 +143,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati
if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) {
if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) {
int layer = aTileEntity.getYCoord() - controllerY;
- layer = (int) MathUtils.ceil(((double)layer) /5D)-1;
+ layer = MathUtils.ceilInt(((double)layer) /5D)-1;
LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity());
}
return true;
@@ -236,9 +237,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati
if (stacks > 0) {
for (int i = 0; i < stacks; i++)
if (i != stacks - 1)
- outputs[i] = tRecipe.getOutput(0).splitStack(64);
+ outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),64);
else
- outputs[i] = tRecipe.getOutput(0).splitStack(processed - (64 * i));
+ outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),processed - (64 * i));
this.mOutputItems = outputs;
} else
this.mOutputItems = null;
@@ -250,4 +251,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati
}
return false;
}
+
+ @Override
+ public boolean drainEnergyInput(long aEU) {
+ return MegaUtils.drainEnergyMegaVanilla(this, aEU);
+ }
} \ No newline at end of file
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 1a3e1ca7bb..2d553a506e 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,14 +22,18 @@
package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.bartimaeusnek.bartworks.util.MegaUtils;
+import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti;
+import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils;
+import cpw.mods.fml.common.Optional;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer;
@@ -38,11 +42,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.List;
import static gregtech.api.enums.GT_Values.V;
-public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer {
+@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true)
+public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer implements TecTechEnabledMulti {
public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -67,26 +72,30 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre
return new GT_TileEntity_MegaVacuumFreezer(this.mName);
}
+ @SuppressWarnings("rawtypes")
+ public ArrayList TTTunnels = new ArrayList<>();
+ @SuppressWarnings("rawtypes")
+ public ArrayList TTMultiAmp = new ArrayList<>();
+
+ @Override
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (LoaderReference.tectech)
+ return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex);
+ return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
+ @Override
public boolean drainEnergyInput(long aEU) {
- if (aEU <= 0)
- return true;
- long allTheEu = 0;
- int hatches = 0;
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches)
- if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- allTheEu += tHatch.getEUVar();
- hatches++;
- }
- if (allTheEu < aEU)
- return false;
- long euperhatch = aEU / hatches;
- HashSet<Boolean> returnset = new HashSet<>();
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches)
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false))
- returnset.add(true);
- else
- returnset.add(false);
- return returnset.size() > 0 && !returnset.contains(false);
+ if (LoaderReference.tectech)
+ return TecTechUtils.drainEnergyMEBFTecTech(this, aEU);
+ return MegaUtils.drainEnergyMegaVanilla(this, aEU);
+ }
+
+ @Override
+ public long getMaxInputVoltage() {
+ if (LoaderReference.tectech)
+ return TecTechUtils.getMaxInputVoltage(this);
+ return super.getMaxInputVoltage();
}
@Override
@@ -94,13 +103,14 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre
ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]);
ArrayList<ItemStack> outputItems = new ArrayList<>();
- long tVoltage = this.getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this);
+
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV));
GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs);
boolean found_Recipe = false;
int processed = 0;
- long nominalV = BW_Util.getnominalVoltage(this);
+
while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) {
if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) {
found_Recipe = true;
@@ -140,15 +150,51 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre
return false;
}
+ // -------------- TEC TECH COMPAT ----------------
+
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ if (LoaderReference.tectech) {
+ this.getTecTechEnergyMultis().clear();
+ this.getTecTechEnergyTunnels().clear();
+ }
return (
- BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17)
- && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)
- && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)
- && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)
- && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17)
- ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty();
+ BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17)
+ && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)
+ && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)
+ && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)
+ && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17)
+ ) &&
+ !this.mInputBusses.isEmpty() &&
+ !this.mOutputBusses.isEmpty() &&
+ !this.mMaintenanceHatches.isEmpty() &&
+ LoaderReference.tectech ?
+ (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) :
+ !this.mEnergyHatches.isEmpty();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData();
+ }
+
+ @Override
+ @Optional.Method(modid = "tectech")
+ public List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches() {
+ return this.mEnergyHatches;
+ }
+
+ @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Optional.Method(modid = "tectech")
+ public List getTecTechEnergyTunnels() {
+ return TTTunnels;
}
+ @Override
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Optional.Method(modid = "tectech")
+ public List getTecTechEnergyMultis() {
+ return TTMultiAmp;
+ }
} \ No newline at end of file
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 e7ded86c91..fccba2ae65 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,13 +22,13 @@
package com.github.bartimaeusnek.bartworks.common.tileentities.tiered;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.items.LabModule;
import com.github.bartimaeusnek.bartworks.common.items.LabParts;
import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList;
import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
import com.github.bartimaeusnek.bartworks.util.*;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -87,7 +87,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
public int checkRecipe(boolean skipOC) {
int rTier = 3;
- FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L);
+ FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L);
if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) {
int damage = this.getSpecialSlot().getItemDamage();
@@ -260,7 +260,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
break;
case INCUBATION_MODULE:
default:
- return super.checkRecipe(skipOC);
+ break;
}
}
return super.checkRecipe(skipOC);
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 205dab5a9a..9b6154b4aa 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
@@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered;
import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
import com.github.bartimaeusnek.bartworks.API.IRadMaterial;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch;
import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch;
@@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
import com.github.bartimaeusnek.bartworks.util.MathUtils;
import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -83,14 +83,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch {
else if (x == 61)
ret = 4500;
else if (x <= 100)
- ret = (long) MathUtils.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D);
+ ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D);
else
- ret = (long) MathUtils.ceil(((8000D * Math.tanh(-x / 65D) + 8000D)));
+ ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D)));
return ret;//*20;
}
public int getSievert() {
- return this.sievert - (int) MathUtils.ceil((float) this.sievert / 100f * (float) this.coverage);
+ return this.sievert - MathUtils.ceilInt((float) this.sievert / 100f * (float) this.coverage);
}
public short[] getColorForGUI() {
@@ -173,10 +173,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch {
if (lStack == null)
return;
-
IRadMaterial radmat = null;
//gt++ compat
- if (Loader.isModLoaded("miscutils"))
+ if (LoaderReference.miscutils)
radmat = RadioHatchCompat.GTppRadChecker(lStack);
if (lStack.getItem() instanceof IRadMaterial || radmat != null) {
@@ -198,46 +197,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch {
}
}
- if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) {
- Materials materials = Materials.Uranium;
- byte kg = 3;
-
- if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)))
- materials = Materials.Plutonium;
- else if (GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)))
- materials = Materials.Thorium;
- else if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)))
- materials = Materials.Naquadah;
- else
- kg = 6;
-
- if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)))
- kg = (byte) (2 * kg);
- else if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)))
- kg = (byte) (4 * kg);
-
-
- if (this.mass == 0 || this.sievert == calculateSv(materials)) {
- if (this.mass + kg <= this.cap) {
- this.sievert = calculateSv(materials);
- this.mass += kg;
- this.mInventory[0].stackSize--;
- this.updateSlots();
- this.colorForGUI = materials.mColor.mRGBa;
- this.material = materials.mName;
- }
- }
- }
-
for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) {
- if (GT_Utility.areStacksEqual(varStack, lStack)) {
+ if (GT_Utility.areStacksEqual(varStack, lStack, true)) {
if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) {
- if (this.mass < this.cap) {
- this.mass++;
+ int massToAdd = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,1);
+ if (this.mass + massToAdd <= this.cap) {
+ this.mass += massToAdd;
this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack);
this.mInventory[0].stackSize--;
this.updateSlots();
- this.colorForGUI = null;
+ this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack);
this.material = StatCollector.translateToLocal(varStack.getUnlocalizedName());
return;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java
index faa06e135d..f05a35cdb9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -20,7 +20,7 @@
* SOFTWARE.
*/
-package com.github.bartimaeusnek.bartworks.util;
+package com.github.bartimaeusnek.bartworks.neiHandler;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
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 59b8b947b7..a2943e67e1 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.bartworks.server.EventHandler;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket;
import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
@@ -43,7 +43,7 @@ public class ServerEventHandler {
//MinecraftForge.EVENT_BUS
@SubscribeEvent(priority = EventPriority.LOWEST)
public void EntityJoinWorldEvent(EntityJoinWorldEvent event) {
- if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer())
+ if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server)
return;
MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity);
MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java
new file mode 100644
index 0000000000..fc11974864
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java
@@ -0,0 +1,40 @@
+/*
+ * 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.bartworks.server.container;
+
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+public class BW_Container_Windmill extends GT_Container_MultiMachine {
+
+ public BW_Container_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 60, 36));
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java
index f370d07043..385897db6a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java
@@ -163,7 +163,7 @@ public class GT_Container_CircuitProgrammer extends Container {
@Override
public void setInventorySlotContents(int slotNR, ItemStack itemStack) {
if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) {
- this.Slot = itemStack.copy().splitStack(1);
+ this.Slot = BW_Util.setStackSize(itemStack.copy(),1);
itemStack.stackSize--;
this.tag = this.toBind.getTagCompound();
this.tag.setBoolean("HasChip", true);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java
index 1b1b4b240f..512325688c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java
@@ -22,17 +22,28 @@
package com.github.bartimaeusnek.bartworks.server.container;
+import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
+import com.github.bartimaeusnek.bartworks.API.IRadMaterial;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.gui.GT_Container_1by1;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
import java.nio.ByteBuffer;
import java.util.Iterator;
+import java.util.Optional;
public class GT_Container_RadioHatch extends GT_Container_1by1 {
@@ -46,6 +57,10 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 {
super(aInventoryPlayer, aTileEntity);
}
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new RadioSlot(this.mTileEntity, 0, 80, 35));
+ }
+
@SuppressWarnings("rawtypes")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -153,4 +168,30 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 {
return true;
}
+ private static class RadioSlot extends Slot{
+ public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
+ super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack p_75214_1_) {
+ if (BioVatLogicAdder.RadioHatch.getIsSv()
+ .keySet()
+ .stream()
+ .anyMatch(
+ stack -> GT_Utility.areStacksEqual(stack, p_75214_1_,true)
+ ))
+ return true;
+
+ if (!BW_Util.checkStackAndPrefix(p_75214_1_))
+ return false;
+
+ ItemData ass = GT_OreDictUnificator.getAssociation(p_75214_1_);
+ return IRadMaterial.class.isAssignableFrom(p_75214_1_.getItem().getClass()) ||
+ ass.mPrefix == OrePrefixes.rod ||
+ ass.mPrefix == OrePrefixes.stick ||
+ ass.mPrefix == OrePrefixes.stickLong;
+ }
+ }
+
}
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 268be7eddf..10e33f28cc 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,12 +23,9 @@
package com.github.bartimaeusnek.bartworks.system.material;
import com.github.bartimaeusnek.bartworks.API.IRadMaterial;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker;
-import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
-import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
-import com.github.bartimaeusnek.bartworks.util.Pair;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
@@ -84,16 +81,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
this.setCreativeTab(BW_MetaGenerated_Items.metaTab);
for (Werkstoff w : werkstoffHashSet) {
ItemStack tStack = new ItemStack(this, 1, w.getmID());
- if (((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) )
- continue;
- if ((w.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0)
+ if (!w.hasItemType(this.orePrefixes))
continue;
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w));
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip());
- if (ConfigHandler.experimentalThreadedLoader)
- OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getVarName(), tStack));
- else
- GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack);
+ GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack);
}
}
@@ -165,7 +157,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
}
protected IIconContainer getIconContainerBartWorks(int aMetaData) {
- if (FMLCommonHandler.instance().getSide().isClient())
+ if (SideReference.Side.Client)
return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet());
return null;
}
@@ -175,7 +167,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
@SuppressWarnings("unchecked")
public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
for (Werkstoff werkstoff : werkstoffHashSet) {
- if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) {
+ if (werkstoff != null && werkstoff.hasItemType(this.orePrefixes)) {
ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID());
aList.add(tStack);
}
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 7cea9d0588..37c1da6c8d 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -47,11 +47,10 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
- if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0))
+ if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0))
return;
GT_ModHandler.addValuableOre(this, w.getmID(), 1);
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost);
-
}
}
@@ -107,7 +106,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks {
@SuppressWarnings("unchecked")
public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) {
- if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((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()));
}
}
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 24f447c3d8..dc1db4303a 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -41,7 +41,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores {
@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
- if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0))
+ if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0))
return;
GT_ModHandler.addValuableOre(this, w.getmID(), 1);
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", "Small " + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost);
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 632c3e034f..75c774240b 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,7 +22,10 @@
package com.github.bartimaeusnek.bartworks.system.material;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
+import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TextureSet;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
@@ -33,10 +36,15 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T
@Override
public ITexture[] getTexture(Block aBlock, byte aSide) {
- Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
- if ((aMaterial != null)) {
- GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.block.mTextureIndex], aMaterial.getRGBA());
- return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet};
+ if (SideReference.Side.Client) {
+ Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData);
+ if ((aMaterial != null)) {
+ TextureSet set = aMaterial.getTexSet();
+ GT_RenderedTexture aIconSet = new GT_RenderedTexture(
+ set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA()
+ );
+ return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet};
+ }
}
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])};
}
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 382163ae8b..166f9aef8d 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -34,6 +34,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import java.util.List;
+import java.util.Optional;
public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks {
@@ -43,10 +44,14 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks {
@Override
protected void doRegistrationStuff(Werkstoff tMaterial) {
- if (tMaterial != null) {
- if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0)
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + tMaterial.getmID() + ".name", OrePrefixes.block.mLocalizedMaterialPre + tMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost);
- }
+ Optional.ofNullable(tMaterial)
+ .filter(pMaterial -> pMaterial.hasItemType(OrePrefixes.gem) || pMaterial.hasItemType(OrePrefixes.ingot))
+ .ifPresent(pMaterial ->
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name",
+ OrePrefixes.block.mLocalizedMaterialPre + pMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost
+ )
+ );
}
@Override
@@ -67,9 +72,9 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks {
@Override
@SuppressWarnings("unchecked")
public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
- for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) {
- if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0)
- aList.add(new ItemStack(aItem, 1, tMaterial.getmID()));
- }
+ 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/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java
index 1d1cc94863..98fcfb7878 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,24 +23,27 @@
package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
public class BW_CircuitsLoader {
- private static final BW_Meta_Items NEW_CIRCUITS;
+
+ private static final BW_Meta_Items NEW_CIRCUITS = new BW_Meta_Items();
+
+ private BW_CircuitsLoader() {
+ }
public static BW_Meta_Items getNewCircuits() {
return BW_CircuitsLoader.NEW_CIRCUITS;
}
- static {
- NEW_CIRCUITS = new BW_Meta_Items();
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,4, "Primitive Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,5, "Basic Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,6, "Good Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,7, "Advanced Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,8, "Data Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,9, "Elite Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,10, "Master Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,11, "Ultimate Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,12, "Superconductor Magneto Resonatic Circuit");
- BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,13, "Infinite Magneto Resonatic Circuit");
+ public static void initNewCircuits() {
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0, 4, "Primitive Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1, 5, "Basic Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2, 6, "Good Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3, 7, "Advanced Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4, 8, "Data Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5, 9, "Elite Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6, 10, "Master Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7, 11, "Ultimate Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8, 12, "Superconductor Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9, 13, "Infinite Magneto Resonatic Circuit");
BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,14, "Bio Magneto Resonatic Circuit");
}
} \ No newline at end of file
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 66038d5d85..7870b820e8 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,14 +23,11 @@
package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
import com.github.bartimaeusnek.bartworks.MainMod;
-import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
-import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
-import com.github.bartimaeusnek.bartworks.util.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
@@ -92,9 +89,6 @@ public class BW_Meta_Items {
ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier);
- if (ConfigHandler.experimentalThreadedLoader)
- OreDictAdder.addToMap(new Pair<>((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack));
- else
GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack);
}
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 81fa72717f..56e3ad035c 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
@@ -272,7 +272,7 @@ public class CircuitImprintLoader {
public static NBTTagCompound getTagFromStack(ItemStack stack) {
if (GT_Utility.isStackValid(stack))
- return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound());
+ return BW_Util.setStackSize(stack.copy(),1).writeToNBT(new NBTTagCompound());
return new NBTTagCompound();
}
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 1d1b1a0f35..d9d4ac7dbe 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,14 +22,11 @@
package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker;
-import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
-import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
-import com.github.bartimaeusnek.bartworks.util.Pair;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
@@ -65,9 +62,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
continue materialloop;
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w));
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip());
- if (ConfigHandler.experimentalThreadedLoader)
- OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack));
- else
GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack);
}
if (noSubIDMaterials != null){
@@ -83,9 +77,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
continue materialloop;
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w));
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip());
- if (ConfigHandler.experimentalThreadedLoader)
- OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack));
- else
GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack);
}
}
@@ -107,7 +98,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
}
protected IIconContainer getIconContainerBartWorks(int aMetaData) {
- if (FMLCommonHandler.instance().getSide().isClient()) {
+ if (SideReference.Side.Client) {
if (aMetaData > 1000 && hasList)
return PrefixTextureLinker.texMap.get(this.orePrefixes).get(NoMetaValue.get(aMetaData-1001).mIconSet);
return PrefixTextureLinker.texMap.get(this.orePrefixes).get(Materials.values()[(short) aMetaData].mIconSet);
@@ -121,7 +112,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
for (int i = 0; i < Materials.values().length; i++) {
Materials w = Materials.values()[i];
- if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(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 == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
continue;
@@ -130,7 +121,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items {
if (hasList)
for (int i = 0; i < NoMetaValue.size(); i++) {
Materials w = NoMetaValue.get(i);
- if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(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 == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle))))
continue;
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 4beeab09b2..96e222ee11 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,8 +22,8 @@
package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -42,8 +42,11 @@ import java.util.stream.Collectors;
public class GTMetaItemEnhancer {
static List<Materials> NoMetaValue;
- static{
- if (Loader.isModLoaded("Forestry")) {
+ private GTMetaItemEnhancer() {
+ }
+
+ public static void init(){
+ if (LoaderReference.Forestry) {
NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList());
Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null);
Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
index b63d7377b8..dc1d1f7ade 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,11 +22,12 @@
package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
+import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import cpw.mods.fml.common.Loader;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -69,7 +70,7 @@ public class LuVTierEnhancer implements Runnable {
.filter(item -> item.toString().contains("LuV") && item.hasBeenSet())
.forEach(item -> LuVMachines.add(item.get(1)));
- if (Loader.isModLoaded("dreamcraft")) {
+ if (LoaderReference.dreamcraft) {
addDreamcraftItemListItems(LuVMachines);
}
@@ -173,48 +174,52 @@ public class LuVTierEnhancer implements Runnable {
}
}
- private static void replaceOsmiridiumInLuVRecipes(){
- for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){
- if (recipe_assemblyLine.mEUt > 6000)
- continue;
- for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) {
- ItemStack stack = recipe_assemblyLine.mInputs[i];
- if (!BW_Util.checkStackAndPrefix(stack))
- continue;
- ItemData ass = GT_OreDictUnificator.getAssociation(stack);
- if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- if (WerkstoffLoader.items.get(ass.mPrefix) != null)
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize);
- }
- }
- for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){
- if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6))
- continue;
- if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0]))
- continue;
- for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) {
- ItemStack stack = recipe_assemblyLine.mInputs[i];
- if (!BW_Util.checkStackAndPrefix(stack))
- continue;
- ItemData ass = GT_OreDictUnificator.getAssociation(stack);
- if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- if (WerkstoffLoader.items.get(ass.mPrefix) != null)
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix, stack.stackSize);
- }
- }
- for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){
- if (recipe_assemblyLine.mEUt > 6000)
+ private static void replaceOsmiridiumInLuVRecipes() {
+ Consumer<GT_Recipe> replace = gt_recipe ->
+ gt_recipe.mInputs = replaceArrayWith(
+ gt_recipe.mInputs,
+ Materials.Osmiridium,
+ WerkstoffLoader.Ruridit
+ );
+
+ GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream()
+ .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000)
+ .forEach(recipe_assemblyLine ->
+ recipe_assemblyLine.mInputs = replaceArrayWith(
+ recipe_assemblyLine.mInputs,
+ Materials.Osmiridium,
+ WerkstoffLoader.Ruridit
+ )
+ );
+
+ GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream()
+ .filter(gt_recipe ->
+ gt_recipe.mEUt < BW_Util.getTierVoltage(6) &&
+ !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0])
+ )
+ .forEach(replace);
+
+ GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream()
+ .filter(gt_recipe -> gt_recipe.mEUt <= 6000)
+ .forEach(replace);
+ }
+
+ private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) {
+ for (int i = 0; i < stackArray.length; i++) {
+ ItemStack stack = stackArray[i];
+ if (!BW_Util.checkStackAndPrefix(stack))
continue;
- for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) {
- ItemStack stack = recipe_assemblyLine.mInputs[i];
- if (!BW_Util.checkStackAndPrefix(stack))
- continue;
- ItemData ass = GT_OreDictUnificator.getAssociation(stack);
- if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- if (WerkstoffLoader.items.get(ass.mPrefix) != null)
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize);
- }
+ stackArray[i] = replaceStackWith(stack, source, target);
}
+ return stackArray;
+ }
+
+ private static ItemStack replaceStackWith(ItemStack stack, Materials source, Werkstoff target) {
+ ItemData ass = GT_OreDictUnificator.getAssociation(stack);
+ if (ass.mMaterial.mMaterial.equals(source))
+ if (target.hasItemType(ass.mPrefix))
+ stack = target.get(ass.mPrefix, stack.stackSize);
+ return stack;
}
private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) {
@@ -243,7 +248,7 @@ public class LuVTierEnhancer implements Runnable {
else {
int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize;
stacks[i] = new ArrayList<>();
- ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount));
+ ((ArrayList)stacks[i]).add(BW_Util.setStackSize(replacement[0], amount));
replaced = true;
}
@@ -254,7 +259,7 @@ public class LuVTierEnhancer implements Runnable {
return true;
else {
int amount = ((ItemStack) stacks[i]).stackSize;
- stacks[i] = replacement[0].splitStack(amount);
+ stacks[i] = BW_Util.setStackSize(replacement[0], amount);
replaced = true;
}
}
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 74c60fb27e..3a290b7777 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -300,13 +300,13 @@ public class PlatinumSludgeOverHaul {
}
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)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2);
}
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) {
for (int j = 0; j < recipe.mInputs.length; j++) {
@@ -315,13 +315,13 @@ public class PlatinumSludgeOverHaul {
}
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)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 2);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 2);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2);
+ recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 2);
}
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) {
for (int j = 0; j < recipe.mInputs.length; j++) {
@@ -330,13 +330,13 @@ public class PlatinumSludgeOverHaul {
}
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)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount);
}
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) {
for (int j = 0; j < recipe.mInputs.length; j++) {
@@ -345,13 +345,13 @@ public class PlatinumSludgeOverHaul {
}
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)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount);
} else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) {
int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount);
+ recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount);
}
}
}
@@ -392,7 +392,7 @@ public class PlatinumSludgeOverHaul {
inputName = "recipeOutput";
inputItemName = "recipeItems";
}
- else if (Loader.isModLoaded("miscutils")) {
+ else if (LoaderReference.miscutils) {
try {
if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass()))
obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj);
@@ -560,7 +560,7 @@ public class PlatinumSludgeOverHaul {
return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial);
}
- if (Loader.isModLoaded("miscutils")) {
+ if (LoaderReference.miscutils) {
try {
if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust")))
return true;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java
deleted file mode 100644
index 8957f2a986..0000000000
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2018-2019 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.bartworks.system.material;
-
-import com.github.bartimaeusnek.bartworks.MainMod;
-import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
-import cpw.mods.fml.common.FMLCommonHandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ThreadedLoader implements Runnable {
-
- private List<Thread> threads = new ArrayList<>();
- private List<Thread> threadsInit = new ArrayList<>();
-
- @Override
- public synchronized void run() {
- MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!");
- MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech");
- this.threads.add(new AllRecipes());
- this.threads.forEach(Thread::start);
-
- }
-
- public synchronized void runInit() {
- MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!");
- MainMod.LOGGER.info("Starting the Material Generation Thread");
- this.threadsInit.add(new MaterialGen());
- this.threadsInit.forEach(Thread::start);
- for (Thread thread : this.threadsInit) {
- try {
- MainMod.LOGGER.info("Trying to join the Material Generation Thread");
- thread.join();
- }catch (InterruptedException e){
- e.printStackTrace();
- FMLCommonHandler.instance().exitJava(500,true);
- }
- }
- MainMod.LOGGER.info("Successfully joined the Material Generation Thread, Registering the Items/Blocks to the GameRegistry");
- if ((WerkstoffLoader.toGenerateGlobal) != 0){
- OreDictAdder.addToOreDict();
- }
- if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0)
- WerkstoffLoader.INSTANCE.gameRegistryHandler();
- }
-
- static class AllRecipes extends Thread {
-
- public synchronized void run() {
- WerkstoffLoader.INSTANCE.run();
- }
-
- }
-
- static class MaterialGen extends Thread {
-
- public synchronized void run() {
- WerkstoffLoader.INSTANCE.runInit();
- }
-
- }
-
-}
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 09810a54cb..c72632bf3e 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,10 +22,7 @@
package com.github.bartimaeusnek.bartworks.system.material;
-import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
-import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import com.github.bartimaeusnek.bartworks.util.MurmurHash3;
-import com.github.bartimaeusnek.bartworks.util.Pair;
+import com.github.bartimaeusnek.bartworks.util.*;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
import gregtech.api.enums.*;
import gregtech.api.interfaces.IColorModulationContainer;
@@ -74,22 +71,26 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.bridgeMaterial = bridgeMaterial;
}
- public static void init(){
+ public static void init() {
Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE);
}
- public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) {
+ public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) {
this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents);
}
+
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) {
this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents);
}
+
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) {
this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents);
}
+
public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) {
this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents);
}
+
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) {
this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents);
}
@@ -184,8 +185,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.texSet = texSet;
- switch(this.mOreByProducts.size()) {
- case 0 :
+ switch (this.mOreByProducts.size()) {
+ case 0:
this.mOreByProducts.add(this);
this.mOreByProducts.add(this);
this.mOreByProducts.add(this);
@@ -199,13 +200,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
break;
}
+ Optional<Pair<ISubTagContainer, Integer>> firstContent;
+ if (this.CONTENTS.size() == 1 && (firstContent = this.CONTENTS.stream().findFirst()).isPresent()) {
+ ISubTagContainer firstContentSubTagContainer = firstContent.get().getKey();
+ if (firstContent.get().getValue() == 1 && firstContentSubTagContainer instanceof Materials)
+ this.getGenerationFeatures().setExtension();
+ }
+
Werkstoff.werkstoffHashSet.add(this);
Werkstoff.werkstoffHashMap.put(this.mID, this);
- Werkstoff.werkstoffNameHashMap.put(this.defaultName,this);
+ Werkstoff.werkstoffNameHashMap.put(this.defaultName, this);
}
- public Werkstoff addAdditionalOreDict(String s){
+ public Werkstoff addAdditionalOreDict(String s) {
ADDITIONAL_OREDICT.add(s);
return this;
}
@@ -214,11 +222,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return ADDITIONAL_OREDICT;
}
- public void setTCAspects(Pair<Object,Integer>... pAspectsArr){
- this.stats.mTC_Aspects=pAspectsArr;
+ public void setTCAspects(Pair<Object, Integer>... pAspectsArr) {
+ this.stats.mTC_Aspects = pAspectsArr;
}
- public Pair<Object,Integer>[] getTCAspects(int ratio){
+ 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<>();
@@ -231,24 +239,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount)));
this.stats.mTC_Aspects = set.toArray(new Pair[0]);
}
- Pair<Object,Integer>[] ret = this.stats.mTC_Aspects.clone();
+ Pair<Object, Integer>[] ret = this.stats.mTC_Aspects.clone();
for (int i = 0; i < ret.length; i++) {
- ret[i]=ret[i].copyWithNewValue(ret[i].getValue() * ratio);
+ ret[i] = ret[i].copyWithNewValue(ret[i].getValue() * ratio);
}
return ret;
}
public List<TC_Aspects.TC_AspectStack> getGTWrappedTCAspects() {
final List<TC_Aspects.TC_AspectStack> ret = new ArrayList<>();
- Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> {
- try {
- new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret);
- } catch (IllegalAccessException | InvocationTargetException ignored) {}
- });
+ Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> {
+ try {
+ new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret);
+ } catch (IllegalAccessException | InvocationTargetException ignored) {
+ }
+ });
return ret;
}
- public Pair<Object,Integer>[] getTCAspects(){
+ public Pair<Object, Integer>[] getTCAspects() {
return this.getTCAspects(1);
}
@@ -256,8 +265,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this.type;
}
- public boolean containsStuff(ISubTagContainer stuff){
- for (Pair<ISubTagContainer, Integer> pair : this.CONTENTS){
+ public boolean containsStuff(ISubTagContainer stuff) {
+ for (Pair<ISubTagContainer, Integer> pair : this.CONTENTS) {
if (pair.getKey().equals(stuff))
return true;
}
@@ -286,7 +295,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this.mOreByProducts.size();
}
- public ISubTagContainer getOreByProductRaw(int aNumber){
+ public ISubTagContainer getOreByProductRaw(int aNumber) {
if (this.mOreByProducts.size() == 0)
return null;
if (aNumber < 0)
@@ -307,7 +316,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
while (aNumber >= this.mOreByProducts.size())
aNumber--;
Object o = this.mOreByProducts.get(aNumber);
- if (o == null||o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL))
+ if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL))
return this.get(prefixes);
if (o instanceof Werkstoff)
return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o);
@@ -321,7 +330,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public String getVarName() {
- return this.defaultName.replaceAll(" ","");
+ return this.defaultName.replaceAll(" ", "");
}
public String getToolTip() {
@@ -373,8 +382,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this.SUBTAGS.remove(subTag);
}
- public void getAndAddToCollection(OrePrefixes prefixes,int amount,Collection<ItemStack> stacks){
- stacks.add(this.get(prefixes,amount));
+ public void getAndAddToCollection(OrePrefixes prefixes, int amount, Collection<ItemStack> stacks) {
+ stacks.add(this.get(prefixes, amount));
}
public ItemStack get(OrePrefixes prefixes) {
@@ -382,10 +391,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public FluidStack getFluidOrGas(int fluidAmount) {
- return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)),fluidAmount);
+ return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)), fluidAmount);
}
+
public FluidStack getMolten(int fluidAmount) {
- return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount);
+ return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)), fluidAmount);
}
public ItemStack get(OrePrefixes prefixes, int amount) {
@@ -393,12 +403,12 @@ 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 * (((float) this.getStats().getProtons() / 188f) + (float) 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()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality()
+ 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality()
);
}
@@ -406,8 +416,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
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()));
}
- public boolean hasItemType(OrePrefixes prefixes){
- return (this.getGenerationFeatures().toGenerate & GenerationFeatures.prefixLogic.get(prefixes)) != 0;
+ public boolean hasItemType(OrePrefixes prefixes) {
+ int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes);
+ return (this.getGenerationFeatures().toGenerate & unpacked) != 0 && (this.getGenerationFeatures().blacklist & unpacked) == 0;
}
public enum Types {
@@ -427,6 +438,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public static class GenerationFeatures {
+ long toGenerate = 0b0001001;
//logic gate shit
/*
dust 1
@@ -440,66 +452,85 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
meta crafting metal 100000000 (gears, screws, bolts, springs)
multiple ingotWorth stuff 1000000000 (double, triple, quadruple, ingot/plates)
*/
- public short toGenerate = 0b0001001;
- public static final HashMap<OrePrefixes,Integer> prefixLogic = new HashMap<>();
-
- static {
- Arrays.stream(OrePrefixes.values()).forEach( e -> prefixLogic.put(e,0));
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,0b10);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,0b10);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,0b10);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,0b100);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,0b100);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens,0b100);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,0b1000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,0b1000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,0b1000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule,0b10000);
- // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten,0b1000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer,0b10000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench,0b10000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw,0b10000000);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor,0b100000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine,0b100000000);
-
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple,0b1000000000);
- Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple,0b1000000000);
+ private boolean isExtension;
+ private static final NonNullWrappedHashMap<OrePrefixes, Integer> prefixLogic = new NonNullWrappedHashMap<>(0);
+
+ public GenerationFeatures() {
+ }
+
+ public static void initPrefixLogic() {
+ Arrays.stream(OrePrefixes.values()).forEach(e -> prefixLogic.put(e, 0));
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust, 0b1);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny, 0b1);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall, 0b1);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot, 0b10);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot, 0b10);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget, 0b10);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem, 0b100);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed, 0b100);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite, 0b100);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped, 0b100);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless, 0b100);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens, 0b100);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.block, 0b110);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore, 0b1000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure, 0b1000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure, 0b1000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed, 0b1000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified, 0b1000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged, 0b1000);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell, 0b10000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule, 0b10000);
+ // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten, 0b1000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten, 0b1000000);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate, 0b10000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick, 0b10000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong, 0b10000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer, 0b10000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench, 0b10000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw, 0b10000000);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor, 0b100000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine, 0b100000000);
+
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple, 0b1000000000);
+ Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple, 0b1000000000);
+ }
+
+ public void setExtension() {
+ isExtension = !isExtension;
+ }
+
+ public static int getPrefixDataRaw(OrePrefixes prefixes) {
+ if (prefixes == null)
+ throw new IllegalArgumentException("OrePrefixes is NULL!");
+ return GenerationFeatures.prefixLogic.get(prefixes);
+ }
+
+ public boolean isExtension() {
+ return isExtension;
}
//public byte toGenerateSecondary = 0b0000000;
@@ -516,120 +547,153 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
*/
public byte extraRecipes;
- public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p){
- if (p == OrePrefixes.dustTiny || p == OrePrefixes.dust || p == OrePrefixes.dustSmall || p == OrePrefixes.crateGtDust){
- this.blacklist |= 1;
- }else
- this.blacklist |= p.mMaterialGenerationBits;
+ public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) {
+ this.blacklist |= getPrefixDataRaw(p);
return this;
}
+ @Deprecated
public boolean hasDusts() {
return (this.toGenerate & 0b1) != 0;
}
+
+ @Deprecated
public boolean hasGems() {
return (this.toGenerate & 0b100) != 0;
}
+
+ @Deprecated
public boolean hasOres() {
return (this.toGenerate & 0b1000) != 0;
}
- public Werkstoff.GenerationFeatures enforceUnification(){
+ public Werkstoff.GenerationFeatures enforceUnification() {
this.enforceUnification = true;
return this;
}
- public Werkstoff.GenerationFeatures removeGems(){
+ @Deprecated
+ public Werkstoff.GenerationFeatures removeGems() {
if (this.hasGems())
- this.toGenerate = (byte) (this.toGenerate ^ 0b100);
+ this.toGenerate = (long) (this.toGenerate ^ 0b100);
return this;
}
- public Werkstoff.GenerationFeatures removeDusts(){
+ @Deprecated
+ public Werkstoff.GenerationFeatures removeDusts() {
if (this.hasDusts())
- this.toGenerate = (byte) (this.toGenerate ^ 0b1);
+ this.toGenerate = (long) (this.toGenerate ^ 0b1);
return this;
}
- public Werkstoff.GenerationFeatures removeOres(){
+
+ @Deprecated
+ public Werkstoff.GenerationFeatures removeOres() {
if (this.hasOres())
- this.toGenerate = (byte) (this.toGenerate ^ 0b1000);
+ this.toGenerate = (long) (this.toGenerate ^ 0b1000);
return this;
}
- public Werkstoff.GenerationFeatures addChemicalRecipes(){
+ public Werkstoff.GenerationFeatures addChemicalRecipes() {
this.extraRecipes = (byte) (this.extraRecipes | 1);
return this;
}
+
public boolean hasChemicalRecipes() {
- return (this.extraRecipes & 1) != 0;
+ return (this.extraRecipes & 1) != 0;
}
- public Werkstoff.GenerationFeatures addMixerRecipes(){
+ public Werkstoff.GenerationFeatures addMixerRecipes() {
this.extraRecipes = (byte) (this.extraRecipes | 10);
return this;
}
+
public boolean hasMixerRecipes() {
return (this.extraRecipes & 10) != 0;
}
- public Werkstoff.GenerationFeatures addSifterRecipes(){
+ public Werkstoff.GenerationFeatures addSifterRecipes() {
this.extraRecipes = (byte) (this.extraRecipes | 100);
return this;
}
+
public boolean hasSifterRecipes() {
return (this.extraRecipes & 100) != 0;
}
public Werkstoff.GenerationFeatures onlyDust() {
- this.toGenerate = (byte) (0b1);
+ this.toGenerate = (long) (0b1);
return this;
}
+ /**
+ * Automatically adds Simple Metal Working Items
+ */
public Werkstoff.GenerationFeatures addMetalItems() {
- this.toGenerate = (byte) (this.toGenerate | 0b10);
+ this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0b10);
return this;
}
public Werkstoff.GenerationFeatures disable() {
- this.toGenerate = (byte) (0);
+ this.toGenerate = (long) (0);
return this;
}
+
public Werkstoff.GenerationFeatures addCells() {
- this.toGenerate = (byte) (this.toGenerate | 0b10000);
+ this.toGenerate = (long) (this.toGenerate | 0b10000);
return this;
}
+ @Deprecated
public boolean hasCells() {
return (this.toGenerate & 0b10000) != 0;
}
+ @Deprecated
public boolean hasMolten() {
return (this.toGenerate & 0b1000000) != 0;
}
public Werkstoff.GenerationFeatures addMolten() {
- this.toGenerate = (byte) (this.toGenerate | 0b1000000);
+ this.toGenerate = (long) (this.toGenerate | 0b1000000);
return this;
}
+ /**
+ * Automatically adds Simple Metal Working Items
+ */
public Werkstoff.GenerationFeatures addGems() {
- this.toGenerate = (byte) (this.toGenerate | 0x4);
+ this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0x4);
return this;
}
+
public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() {
- this.toGenerate = (byte) (this.toGenerate | 0b10000000);
+ this.toGenerate = (long) (this.toGenerate | 0b10000000);
return this;
}
+
+ @Deprecated
public boolean hasSimpleMetalWorkingItems() {
return (this.toGenerate & 0b10000000) != 0;
}
+
public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() {
- this.toGenerate = (byte) (this.toGenerate | 0b100000000);
+ this.toGenerate = (long) (this.toGenerate | 0b100000000);
return this;
}
+
public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() {
- this.toGenerate = (byte) (this.toGenerate | 0b1000000000);
+ this.toGenerate = (long) (this.toGenerate | 0b1000000000);
+ return this;
+ }
+
+ public Werkstoff.GenerationFeatures addPrefix(OrePrefixes prefixes) {
+ this.toGenerate = (long) (this.toGenerate | this.getPrefixDataRaw(prefixes));
+ return this;
+ }
+
+ public Werkstoff.GenerationFeatures removePrefix(OrePrefixes prefixes) {
+ this.toGenerate = (long) (this.toGenerate ^ this.getPrefixDataRaw(prefixes));
return this;
}
}
@@ -714,7 +778,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.durMod = durMod;
}
- private Pair<Object,Integer>[] mTC_Aspects;
+ private Pair<Object, Integer>[] mTC_Aspects;
//logic gate shit
byte quality = ~0b1111111;
@@ -860,4 +924,4 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
}
-}
+} \ No newline at end of file
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 6f6267021a..1cc9b077cf 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
@@ -22,25 +22,26 @@
package com.github.bartimaeusnek.bartworks.system.material;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores;
+import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
-import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader;
import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer;
import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes;
-import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
-import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.bartworks.util.EnumUtils;
import com.github.bartimaeusnek.bartworks.util.Pair;
+import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
+import com.github.bartimaeusnek.crossmod.cls.CLSCompat;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
import com.google.common.collect.HashBiMap;
import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ProgressManager;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.GT_Mod;
@@ -63,7 +64,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
@@ -79,11 +79,10 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers
import static gregtech.api.enums.OrePrefixes.*;
@SuppressWarnings({"unchecked", "unused", "deprecation"})
-public class WerkstoffLoader implements Runnable {
-
- private WerkstoffLoader() {}
+public class WerkstoffLoader {
+ private WerkstoffLoader() {
+ }
- public static final WerkstoffLoader INSTANCE = new WerkstoffLoader();
public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas");
public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas");
public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting");
@@ -97,38 +96,67 @@ public class WerkstoffLoader implements Runnable {
public static ItemList ringMold;
public static ItemList boltMold;
public static boolean gtnhGT = false;
- static {
+
+
+ public static void setUp() {
+ //GTNH detection hack
try {
- gtnhGT = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV") != null;
- } catch (NoSuchFieldException ignored) {}
+ Field f = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV");
+ gtnhGT = true;
+ } catch (Exception ignored) {
+ gtnhGT = false;
+ }
//GTNH hack for molten cells
- for (OrePrefixes prefix : OrePrefixes.values()){
- if (prefix.toString().equals("cellMolten"))
+ for (OrePrefixes prefix : values()) {
+ if (prefix.toString().equals("cellMolten")) {
WerkstoffLoader.cellMolten = prefix;
+ break;
+ }
}
+
if (WerkstoffLoader.cellMolten == null) {
- WerkstoffLoader.cellMolten = EnumHelper.addEnum(OrePrefixes.class,"cellMolten",new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class},new Object[]{"Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, 31});
- // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w));
+ WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix(
+ "cellMolten","Cells of Molten stuff", "Molten ",
+ " Cell", true, true,
+ true, true, false,
+ false, false, true,
+ false, false, 0b1000000,
+ 3628800L, 64, 31
+ );
+ // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w));
} else {
WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000;
}
+
try {
WerkstoffLoader.rotorMold = Enum.valueOf(ItemList.class, "Shape_Mold_Rotor");
WerkstoffLoader.rotorShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Rotor");
WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear");
WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring");
WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt");
- } catch (NullPointerException | IllegalArgumentException ignored){}
+ } catch (NullPointerException | IllegalArgumentException ignored) {
+ }
+
//add tiberium
- Element t = BW_Util.createNewElement("Tr",123L, 203L, 0L, -1L, null, "Tiberium", false);
+ Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false);
+
//add molten & regular capsuls
- if (Loader.isModLoaded("Forestry")) {
- capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1});
+ if (LoaderReference.Forestry) {
+ capsuleMolten = EnumUtils.addNewOrePrefix(
+ "capsuleMolten", "Capsule of Molten stuff", "Molten ",
+ " Capsule", true, true,
+ true, true, false,
+ false, false, true,
+ false, false, 0b1000000,
+ 3628800L, 64, -1
+ );
capsule.mMaterialGenerationBits = 0b100000;
capsule.mDefaultStackSize = 64;
}
+
bottle.mDefaultStackSize = 1;
+ Werkstoff.GenerationFeatures.initPrefixLogic();
}
//TODO:
@@ -199,7 +227,7 @@ public class WerkstoffLoader implements Runnable {
new Pair<>(Materials.Fluorine, 1)
);
public static final Werkstoff YttriumOxide = new Werkstoff(
- new short[]{255,255,255,0},
+ new short[]{255, 255, 255, 0},
"Yttrium Oxide",
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand
@@ -375,7 +403,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().addGems(),
19,
TextureSet.SET_GEM_VERTICAL,
- Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon),
+ Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon),
new Pair<>(WerkstoffLoader.Zirconium, 1),
new Pair<>(Materials.Silicon, 1),
new Pair<>(Materials.Oxygen, 4)
@@ -390,7 +418,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(),
20,
TextureSet.SET_FLINT,
- Arrays.asList(Materials.RockSalt,Materials.Borax),
+ Arrays.asList(Materials.RockSalt, Materials.Borax),
new Pair<>(Materials.Salt, 1)
);
public static final Werkstoff Spodumen = new Werkstoff(
@@ -412,79 +440,79 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(),
22,
TextureSet.SET_FLINT,
- Arrays.asList(Materials.RockSalt,Materials.Borax),
+ Arrays.asList(Materials.RockSalt, Materials.Borax),
new Pair<>(Materials.RockSalt, 1)
);
public static final Werkstoff Fayalit = new Werkstoff(
- new short[]{50,50,50,0},
+ new short[]{50, 50, 50, 0},
"Fayalite",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().addGems(),
23,
TextureSet.SET_QUARTZ,
- Arrays.asList(Materials.Iron,Materials.Silicon),
+ Arrays.asList(Materials.Iron, Materials.Silicon),
new Pair<>(Materials.Iron, 2),
new Pair<>(Materials.Silicon, 1),
new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff Forsterit = new Werkstoff(
- new short[]{255,255,255,0},
+ new short[]{255, 255, 255, 0},
"Forsterite",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().addGems(),
24,
TextureSet.SET_QUARTZ,
- Arrays.asList(Materials.Magnesium,Materials.Silicon),
+ Arrays.asList(Materials.Magnesium, Materials.Silicon),
new Pair<>(Materials.Magnesium, 2),
new Pair<>(Materials.Silicon, 1),
new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff Hedenbergit = new Werkstoff(
- new short[]{100,150,100,0},
+ new short[]{100, 150, 100, 0},
"Hedenbergite",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().addGems(),
25,
TextureSet.SET_QUARTZ,
- Arrays.asList(Materials.Iron,Materials.Calcium,Materials.Silicon),
+ Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon),
new Pair<>(Materials.Calcium, 1),
new Pair<>(Materials.Iron, 1),
new Pair<>(Materials.Silicon, 2),
new Pair<>(Materials.Oxygen, 6)
);
public static final Werkstoff DescloiziteZNVO4 = new Werkstoff(
- new short[]{0xBF,0x18,0x0F,0},
+ new short[]{0xBF, 0x18, 0x0F, 0},
"Red Descloizite",//Pb(Zn,Cu)[OH|VO4
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures(),
26,
TextureSet.SET_QUARTZ,
- Arrays.asList(Materials.Lead,Materials.Copper,Materials.Vanadium),
+ Arrays.asList(Materials.Lead, Materials.Copper, Materials.Vanadium),
new Pair<>(Materials.Lead, 1),
new Pair<>(Materials.Zinc, 1),
new Pair<>(Materials.Vanadium, 1),
new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff DescloiziteCUVO4 = new Werkstoff(
- new short[]{0xf9,0x6d,0x18,0},
+ new short[]{0xf9, 0x6d, 0x18, 0},
"Orange Descloizite",//Pb(Zn,Cu)[OH|VO4
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures(),
27,
TextureSet.SET_QUARTZ,
- Arrays.asList(Materials.Lead,Materials.Zinc,Materials.Vanadium),
+ Arrays.asList(Materials.Lead, Materials.Zinc, Materials.Vanadium),
new Pair<>(Materials.Lead, 1),
new Pair<>(Materials.Copper, 1),
new Pair<>(Materials.Vanadium, 1),
new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff FuchsitAL = new Werkstoff(
- new short[]{0x4D,0x7F,0x64,0},
+ new short[]{0x4D, 0x7F, 0x64, 0},
"Green Fuchsite",
subscriptNumbers("KAl3Si3O10(OH)2"),
new Werkstoff.Stats().setElektrolysis(true),
@@ -492,7 +520,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
28,
TextureSet.SET_METALLIC,
- Arrays.asList(Materials.Potassium,Materials.Aluminium,Materials.Silicon),
+ Arrays.asList(Materials.Potassium, Materials.Aluminium, Materials.Silicon),
new Pair<>(Materials.Potassium, 1),
new Pair<>(Materials.Aluminium, 3),
new Pair<>(Materials.Silicon, 3),
@@ -501,7 +529,7 @@ public class WerkstoffLoader implements Runnable {
);
public static final Werkstoff FuchsitCR = new Werkstoff(
- new short[]{128,0,0,0},
+ new short[]{128, 0, 0, 0},
"Red Fuchsite",
subscriptNumbers("KCr3Si3O10(OH)2"),
new Werkstoff.Stats().setElektrolysis(true),
@@ -509,7 +537,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
29,
TextureSet.SET_METALLIC,
- Arrays.asList(Materials.Potassium,Materials.Chrome,Materials.Silicon),
+ Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon),
new Pair<>(Materials.Potassium, 1),
new Pair<>(Materials.Chrome, 3),
new Pair<>(Materials.Silicon, 3),
@@ -518,7 +546,7 @@ public class WerkstoffLoader implements Runnable {
);
public static final Werkstoff Thorium232 = new Werkstoff(
- new short[]{0,64,0,0},
+ new short[]{0, 64, 0, 0},
"Thorium 232",
superscriptNumbers("Th232"),
new Werkstoff.Stats().setRadioactive(true),
@@ -529,7 +557,7 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff BismuthTellurite = new Werkstoff(
- new short[]{32,72,32,0},
+ new short[]{32, 72, 32, 0},
"Bismuth Tellurite",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
@@ -541,18 +569,18 @@ public class WerkstoffLoader implements Runnable {
new Pair<>(Materials.Tellurium, 3)
);
public static final Werkstoff Tellurium = new Werkstoff(
- new short[]{0xff,0xff,0xff,0},
+ new short[]{0xff, 0xff, 0xff, 0},
"Tellurium",
new Werkstoff.Stats(),
Werkstoff.Types.ELEMENT,
- new Werkstoff.GenerationFeatures().addMetalItems().removeOres(),
+ new Werkstoff.GenerationFeatures().addMetalItems().removePrefix(ore),
32,
TextureSet.SET_METALLIC,
//No Byproducts
new Pair<>(Materials.Tellurium, 1)
);
public static final Werkstoff BismuthHydroBorat = new Werkstoff(
- new short[]{72,144,72,0},
+ new short[]{72, 144, 72, 0},
"Dibismuthhydroborat",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
@@ -565,7 +593,7 @@ public class WerkstoffLoader implements Runnable {
new Pair<>(Materials.Hydrogen, 1)
);
public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff(
- new short[]{36,36,36,0},
+ new short[]{36, 36, 36, 0},
"Circuit Compound MK3",
new Werkstoff.Stats().setCentrifuge(true),
Werkstoff.Types.COMPOUND,
@@ -579,7 +607,7 @@ public class WerkstoffLoader implements Runnable {
);
public static final Werkstoff Prasiolite = new Werkstoff(
- new short[]{0xD0,0xDD,0x95,0},
+ new short[]{0xD0, 0xDD, 0x95, 0},
"Prasiolite",
new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(1923),
Werkstoff.Types.COMPOUND,
@@ -587,13 +615,13 @@ public class WerkstoffLoader implements Runnable {
35,
TextureSet.SET_QUARTZ,
//No Byproducts
- new Pair<>(Materials.Silicon,5),
- new Pair<>(Materials.Oxygen,10),
- new Pair<>(Materials.Iron,1)
+ new Pair<>(Materials.Silicon, 5),
+ new Pair<>(Materials.Oxygen, 10),
+ new Pair<>(Materials.Iron, 1)
);
public static final Werkstoff MagnetoResonaticDust = new Werkstoff(
- new short[]{0xDD,0x77,0xDD,0},
+ new short[]{0xDD, 0x77, 0xDD, 0},
"Magneto Resonatic",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
@@ -601,13 +629,13 @@ public class WerkstoffLoader implements Runnable {
36,
TextureSet.SET_MAGNETIC,
//No Byproducts
- new Pair<>(WerkstoffLoader.Prasiolite,3),
- new Pair<>(WerkstoffLoader.BismuthTellurite,4),
- new Pair<>(WerkstoffLoader.CubicZirconia,1),
- new Pair<>(Materials.SteelMagnetic,1)
+ new Pair<>(WerkstoffLoader.Prasiolite, 3),
+ new Pair<>(WerkstoffLoader.BismuthTellurite, 4),
+ new Pair<>(WerkstoffLoader.CubicZirconia, 1),
+ new Pair<>(Materials.SteelMagnetic, 1)
);
public static final Werkstoff Xenon = new Werkstoff(
- new short[]{0x14,0x39,0x7F,0},
+ new short[]{0x14, 0x39, 0x7F, 0},
"Xenon",
"Xe",
new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true),
@@ -619,7 +647,7 @@ public class WerkstoffLoader implements Runnable {
//No Ingredients
);
public static final Werkstoff Oganesson = new Werkstoff(
- new short[]{0x14,0x39,0x7F,0},
+ new short[]{0x14, 0x39, 0x7F, 0},
"Oganesson",
"Og",
new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true),
@@ -631,7 +659,7 @@ public class WerkstoffLoader implements Runnable {
//No Ingredients
);
public static final Werkstoff Californium = new Werkstoff(
- new short[]{0xAA,0xAA,0xAA,0},
+ new short[]{0xAA, 0xAA, 0xAA, 0},
"Californium",
"Cf",
new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900),
@@ -650,12 +678,12 @@ public class WerkstoffLoader implements Runnable {
Werkstoff.Types.ELEMENT,
new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(),
40,
- Materials.Calcium.mIconSet
+ Materials.Calcium.mIconSet,
//No Byproducts
- //No Ingredients
+ new Pair<>(Materials.Calcium,1)
);
public static final Werkstoff Neon = new Werkstoff(
- new short[]{0xff,0x07,0x3a},
+ new short[]{0xff, 0x07, 0x3a},
"Neon",
"Ne",
new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true),
@@ -667,7 +695,7 @@ public class WerkstoffLoader implements Runnable {
//No Ingredients
);
public static final Werkstoff Krypton = new Werkstoff(
- new short[]{0xb1,0xff,0x32},
+ new short[]{0xb1, 0xff, 0x32},
"Krypton",
"Kr",
new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true),
@@ -679,7 +707,7 @@ public class WerkstoffLoader implements Runnable {
//No Ingredients
);
public static final Werkstoff BArTiMaEuSNeK = new Werkstoff(
- new short[]{0x00,0xff,0x00},
+ new short[]{0x00, 0xff, 0x00},
"BArTiMaEuSNeK",
"Are you serious?",
new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true),
@@ -692,14 +720,14 @@ public class WerkstoffLoader implements Runnable {
Materials.Titanium,
Materials.Europium
),
- new Pair<>(Materials.Boron,1),
- new Pair<>(Materials.Argon,1),
- new Pair<>(Materials.Titanium,1),
- new Pair<>(Materials.Magic,1),
- new Pair<>(Materials.Europium,1),
- new Pair<>(Materials.Sulfur,1),
- new Pair<>(WerkstoffLoader.Neon,1),
- new Pair<>(Materials.Potassium,1)
+ new Pair<>(Materials.Boron, 1),
+ new Pair<>(Materials.Argon, 1),
+ new Pair<>(Materials.Titanium, 1),
+ new Pair<>(Materials.Magic, 1),
+ new Pair<>(Materials.Europium, 1),
+ new Pair<>(Materials.Sulfur, 1),
+ new Pair<>(WerkstoffLoader.Neon, 1),
+ new Pair<>(Materials.Potassium, 1)
);
public static final Werkstoff PTConcentrate = new Werkstoff(
Materials.Platinum.getRGBA(),
@@ -747,11 +775,11 @@ public class WerkstoffLoader implements Runnable {
47,
TextureSet.SET_METALLIC,
//No Byproducts
- new Pair<>(Materials.Platinum,1),
- new Pair<>(Materials.Stone,2)
+ new Pair<>(Materials.Platinum, 1),
+ new Pair<>(Materials.Stone, 2)
);
public static final Werkstoff AquaRegia = new Werkstoff(
- new short[]{0xff,0xb1,0x32},
+ new short[]{0xff, 0xb1, 0x32},
"Aqua Regia",
new Werkstoff.Stats(),
Werkstoff.Types.MIXTURE,
@@ -759,11 +787,11 @@ public class WerkstoffLoader implements Runnable {
48,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.DilutedSulfuricAcid,1),
- new Pair<>(Materials.NitricAcid,1)
+ new Pair<>(Materials.DilutedSulfuricAcid, 1),
+ new Pair<>(Materials.NitricAcid, 1)
);
public static final Werkstoff PTResidue = new Werkstoff(
- new short[]{0x64,0x63,0x2E},
+ new short[]{0x64, 0x63, 0x2E},
"Platinum Residue",
"??IrOsRhRu??",
new Werkstoff.Stats(),
@@ -774,7 +802,7 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff AmmoniumChloride = new Werkstoff(
- new short[]{0xff,0xff,0xff},
+ new short[]{0xff, 0xff, 0xff},
"Ammonium Chloride",
subscriptNumbers("NH4Cl"),
new Werkstoff.Stats(),
@@ -783,8 +811,8 @@ public class WerkstoffLoader implements Runnable {
50,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.Ammonium,1),
- new Pair<>(Materials.HydrochloricAcid,1)
+ new Pair<>(Materials.Ammonium, 1),
+ new Pair<>(Materials.HydrochloricAcid, 1)
);
public static final Werkstoff PTRawPowder = new Werkstoff(
Materials.Platinum.getRGBA(),
@@ -806,8 +834,8 @@ public class WerkstoffLoader implements Runnable {
52,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.Ammonium,1),
- new Pair<>(Materials.Palladium,1)
+ new Pair<>(Materials.Ammonium, 1),
+ new Pair<>(Materials.Palladium, 1)
);
public static final Werkstoff PDMetallicPowder = new Werkstoff(
Materials.Palladium.getRGBA(),
@@ -819,8 +847,8 @@ public class WerkstoffLoader implements Runnable {
53,
TextureSet.SET_METALLIC,
//No Byproducts
- new Pair<>(Materials.Palladium,1),
- new Pair<>(Materials.Stone,2)
+ new Pair<>(Materials.Palladium, 1),
+ new Pair<>(Materials.Stone, 2)
);
public static final Werkstoff PDRawPowder = new Werkstoff(
Materials.Palladium.getRGBA(),
@@ -846,7 +874,7 @@ public class WerkstoffLoader implements Runnable {
//No Ingredients
);
public static final Werkstoff Sodiumformate = new Werkstoff(
- new short[]{0xff,0xaa,0xaa},
+ new short[]{0xff, 0xaa, 0xaa},
"Sodium Formate",
"HCOONa",
new Werkstoff.Stats(),
@@ -855,11 +883,11 @@ public class WerkstoffLoader implements Runnable {
56,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.SodiumHydroxide,1),
- new Pair<>(Materials.CarbonMonoxide,1)
+ new Pair<>(Materials.SodiumHydroxide, 1),
+ new Pair<>(Materials.CarbonMonoxide, 1)
);
public static final Werkstoff Sodiumsulfate = new Werkstoff(
- new short[]{0xff,0xff,0xff},
+ new short[]{0xff, 0xff, 0xff},
"Sodium Sulfate",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
@@ -867,12 +895,12 @@ public class WerkstoffLoader implements Runnable {
57,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.Sodium,2),
- new Pair<>(Materials.Sulfur,1),
- new Pair<>(Materials.Oxygen,4)
+ new Pair<>(Materials.Sodium, 2),
+ new Pair<>(Materials.Sulfur, 1),
+ new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff FormicAcid = new Werkstoff(
- new short[]{0xff,0xaa,0x77},
+ new short[]{0xff, 0xaa, 0x77},
"Formic Acid",
subscriptNumbers("CH2O2"),
new Werkstoff.Stats().setElektrolysis(true),
@@ -881,12 +909,12 @@ public class WerkstoffLoader implements Runnable {
58,
TextureSet.SET_FLUID,
//No Byproducts
- new Pair<>(Materials.Carbon,1),
- new Pair<>(Materials.Hydrogen,2),
- new Pair<>(Materials.Oxygen,2)
+ new Pair<>(Materials.Carbon, 1),
+ new Pair<>(Materials.Hydrogen, 2),
+ new Pair<>(Materials.Oxygen, 2)
);
public static final Werkstoff PotassiumDisulfate = new Werkstoff(
- new short[]{0xfb,0xbb,0x66},
+ new short[]{0xfb, 0xbb, 0x66},
"Potassium Disulfate",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
@@ -894,9 +922,9 @@ public class WerkstoffLoader implements Runnable {
59,
TextureSet.SET_DULL,
//No Byproducts
- new Pair<>(Materials.Potassium,2),
- new Pair<>(Materials.Sulfur,2),
- new Pair<>(Materials.Oxygen,7)
+ new Pair<>(Materials.Potassium, 2),
+ new Pair<>(Materials.Sulfur, 2),
+ new Pair<>(Materials.Oxygen, 7)
);
public static final Werkstoff LeachResidue = new Werkstoff(
new short[]{0x64, 0x46, 0x29},
@@ -910,7 +938,7 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff RHSulfate = new Werkstoff(
- new short[]{0xee,0xaa,0x55},
+ new short[]{0xee, 0xaa, 0x55},
"Rhodium Sulfate",
new Werkstoff.Stats().setGas(true),
Werkstoff.Types.COMPOUND,
@@ -920,7 +948,7 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff RHSulfateSolution = new Werkstoff(
- new short[]{0xff,0xbb,0x66},
+ new short[]{0xff, 0xbb, 0x66},
"Rhodium Sulfate Solution",
new Werkstoff.Stats(),
Werkstoff.Types.MIXTURE,
@@ -930,19 +958,19 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff CalciumChloride = new Werkstoff(
- new short[]{0xff,0xff,0xff},
+ new short[]{0xff, 0xff, 0xff},
"Calcium Chloride",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(),
63,
TextureSet.SET_DULL,
- new Pair<>(Materials.Calcium,1),
- new Pair<>(Materials.Chlorine,2)
+ new Pair<>(Materials.Calcium, 1),
+ new Pair<>(Materials.Chlorine, 2)
//No Byproducts
);
public static final Werkstoff Ruthenium = new Werkstoff(
- new short[]{0x64,0x64,0x64},
+ new short[]{0x64, 0x64, 0x64},
"Ruthenium",
"Ru",
new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons),
@@ -953,32 +981,32 @@ public class WerkstoffLoader implements Runnable {
//No Byproducts
);
public static final Werkstoff SodiumRuthenate = new Werkstoff(
- new short[]{0x3a,0x40,0xcb},
+ new short[]{0x3a, 0x40, 0xcb},
"Sodium Ruthenate",
new Werkstoff.Stats(),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().disable().onlyDust(),
65,
TextureSet.SET_SHINY,
- new Pair<>(Materials.Sodium,2),
- new Pair<>(Ruthenium,1),
- new Pair<>(Materials.Oxygen,3)
+ new Pair<>(Materials.Sodium, 2),
+ new Pair<>(Ruthenium, 1),
+ new Pair<>(Materials.Oxygen, 3)
//No Byproducts
);
public static final Werkstoff RutheniumTetroxide = new Werkstoff(
- new short[]{0xc7,0xc7,0xc7},
+ new short[]{0xc7, 0xc7, 0xc7},
"Ruthenium Tetroxide",
new Werkstoff.Stats().setMeltingPoint(313),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(),
66,
TextureSet.SET_DULL,
- new Pair<>(WerkstoffLoader.Ruthenium,1),
- new Pair<>(Materials.Oxygen,4)
+ new Pair<>(WerkstoffLoader.Ruthenium, 1),
+ new Pair<>(Materials.Oxygen, 4)
//No Byproducts
);
- public static final Werkstoff HotRutheniumTetroxideSollution= new Werkstoff(
- new short[]{0xc7,0xc7,0xc7},
+ public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff(
+ new short[]{0xc7, 0xc7, 0xc7},
"Hot Ruthenium Tetroxide Solution",
"???",
new Werkstoff.Stats().setGas(true).setMeltingPoint(700),
@@ -986,15 +1014,15 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addCells(),
67,
TextureSet.SET_FLUID,
- new Pair<>(WerkstoffLoader.Ruthenium,1),
- new Pair<>(Materials.Oxygen,4),
- new Pair<>(Materials.Chlorine,2),
- new Pair<>(Materials.Sodium,2),
- new Pair<>(Materials.Water,2)
+ new Pair<>(WerkstoffLoader.Ruthenium, 1),
+ new Pair<>(Materials.Oxygen, 4),
+ new Pair<>(Materials.Chlorine, 2),
+ new Pair<>(Materials.Sodium, 2),
+ new Pair<>(Materials.Water, 2)
//No Byproducts
);
public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff(
- new short[]{0xc7,0xc7,0xc7},
+ new short[]{0xc7, 0xc7, 0xc7},
"Ruthenium Tetroxide Solution",
"???",
new Werkstoff.Stats().setMeltingPoint(313),
@@ -1002,11 +1030,11 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addCells(),
68,
TextureSet.SET_FLUID,
- new Pair<>(Ruthenium,1),
- new Pair<>(Materials.Oxygen,4),
- new Pair<>(Materials.Chlorine,2),
- new Pair<>(Materials.Sodium,2),
- new Pair<>(Materials.Water,2)
+ new Pair<>(Ruthenium, 1),
+ new Pair<>(Materials.Oxygen, 4),
+ new Pair<>(Materials.Chlorine, 2),
+ new Pair<>(Materials.Sodium, 2),
+ new Pair<>(Materials.Water, 2)
//No Byproducts
);
public static final Werkstoff IrOsLeachResidue = new Werkstoff(
@@ -1019,8 +1047,8 @@ public class WerkstoffLoader implements Runnable {
69,
TextureSet.SET_ROUGH,
//No Byproducts
- new Pair<>(Materials.Osmiridium,1),
- new Pair<>(Materials.Stone,2)
+ new Pair<>(Materials.Osmiridium, 1),
+ new Pair<>(Materials.Stone, 2)
);
public static final Werkstoff IrLeachResidue = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1031,8 +1059,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
70,
TextureSet.SET_ROUGH,
- new Pair<>(Materials.Iridium,1),
- new Pair<>(Materials.Stone,2)
+ new Pair<>(Materials.Iridium, 1),
+ new Pair<>(Materials.Stone, 2)
//No Byproducts
);
public static final Werkstoff PGSDResidue = new Werkstoff(
@@ -1043,8 +1071,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
71,
TextureSet.SET_DULL,
- new Pair<>(Materials.SiliconDioxide,3),
- new Pair<>(Materials.Gold,2)
+ new Pair<>(Materials.SiliconDioxide, 3),
+ new Pair<>(Materials.Gold, 2)
);
public static final Werkstoff AcidicOsmiumSolution = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1055,8 +1083,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addCells(),
72,
TextureSet.SET_FLUID,
- new Pair<>(Materials.Osmium,1),
- new Pair<>(Materials.HydrochloricAcid,1)
+ new Pair<>(Materials.Osmium, 1),
+ new Pair<>(Materials.HydrochloricAcid, 1)
);
public static final Werkstoff IridiumDioxide = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1066,8 +1094,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
73,
TextureSet.SET_FLUID,
- new Pair<>(Materials.Iridium,1),
- new Pair<>(Materials.Oxygen,2)
+ new Pair<>(Materials.Iridium, 1),
+ new Pair<>(Materials.Oxygen, 2)
);
public static final Werkstoff OsmiumSolution = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1078,8 +1106,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addCells(),
74,
TextureSet.SET_FLUID,
- new Pair<>(Materials.Osmium,1),
- new Pair<>(Materials.Hydrogen,1)
+ new Pair<>(Materials.Osmium, 1),
+ new Pair<>(Materials.Hydrogen, 1)
);
public static final Werkstoff AcidicIridiumSolution = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1090,8 +1118,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addCells(),
75,
TextureSet.SET_FLUID,
- new Pair<>(Materials.Iridium,1),
- new Pair<>(Materials.Hydrogen,1)
+ new Pair<>(Materials.Iridium, 1),
+ new Pair<>(Materials.Hydrogen, 1)
);
public static final Werkstoff IridiumChloride = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1102,8 +1130,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
76,
TextureSet.SET_LAPIS,
- new Pair<>(Materials.Iridium,1),
- new Pair<>(Materials.Chlorine,3)
+ new Pair<>(Materials.Iridium, 1),
+ new Pair<>(Materials.Chlorine, 3)
);
public static final Werkstoff PGSDResidue2 = new Werkstoff(
new short[]{0x84, 0x66, 0x49},
@@ -1113,8 +1141,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
77,
TextureSet.SET_DULL,
- new Pair<>(Materials.Nickel,1),
- new Pair<>(Materials.Copper,1)
+ new Pair<>(Materials.Nickel, 1),
+ new Pair<>(Materials.Copper, 1)
);
public static final Werkstoff Rhodium = new Werkstoff(
new short[]{0xF4, 0xF4, 0xF4},
@@ -1135,8 +1163,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
79,
TextureSet.SET_DULL,
- new Pair<>(Rhodium,1),
- new Pair<>(Materials.Stone,1)
+ new Pair<>(Rhodium, 1),
+ new Pair<>(Materials.Stone, 1)
);
public static final Werkstoff RHSalt = new Werkstoff(
new short[]{0x84, 0x84, 0x84},
@@ -1165,8 +1193,8 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(),
82,
TextureSet.SET_ROUGH,
- new Pair<>(Materials.Sodium,1),
- new Pair<>(Materials.NitricAcid,1)
+ new Pair<>(Materials.Sodium, 1),
+ new Pair<>(Materials.NitricAcid, 1)
);
public static final Werkstoff RHNitrate = new Werkstoff(
new short[]{0x77, 0x66, 0x49},
@@ -1185,9 +1213,9 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
84,
TextureSet.SET_QUARTZ,
- new Pair<>(Materials.Zinc,1),
- new Pair<>(Materials.Sulfur,1),
- new Pair<>(Materials.Oxygen,4)
+ new Pair<>(Materials.Zinc, 1),
+ new Pair<>(Materials.Sulfur, 1),
+ new Pair<>(Materials.Oxygen, 4)
);
public static final Werkstoff RhFilterCake = new Werkstoff(
new short[]{0x77, 0x66, 0x49},
@@ -1225,11 +1253,11 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(),
88,
TextureSet.SET_METALLIC,
- new Pair<>(Materials.Palladium,3),
- new Pair<>(WerkstoffLoader.Rhodium,1)
+ new Pair<>(Materials.Palladium, 3),
+ new Pair<>(WerkstoffLoader.Rhodium, 1)
);
public static final Werkstoff Tiberium = new Werkstoff(
- new short[]{0x22,0xEE,0x22},
+ new short[]{0x22, 0xEE, 0x22},
"Tiberium",
"Tr",
new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true),
@@ -1239,44 +1267,44 @@ public class WerkstoffLoader implements Runnable {
TextureSet.SET_DIAMOND
);
public static final Werkstoff Ruridit = new Werkstoff(
- new short[]{0xA4,0xA4,0xA4},
+ new short[]{0xA4, 0xA4, 0xA4},
"Ruridit",
new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(),
90,
TextureSet.SET_METALLIC,
- new Pair<>(WerkstoffLoader.Ruthenium,2),
- new Pair<>(Materials.Iridium,1)
+ new Pair<>(WerkstoffLoader.Ruthenium, 2),
+ new Pair<>(Materials.Iridium, 1)
);
public static final Werkstoff Fluorspar = new Werkstoff(
- new short[]{185,69,251},
+ new short[]{185, 69, 251},
"Fluorspar",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().addGems(),
91,
TextureSet.SET_GEM_VERTICAL,
- new Pair<>(Materials.Calcium,1),
- new Pair<>(Materials.Fluorine,2)
+ new Pair<>(Materials.Calcium, 1),
+ new Pair<>(Materials.Fluorine, 2)
);
public static final Werkstoff HDCS = new Werkstoff(
- new short[]{0x33,0x44,0x33},
+ new short[]{0x33, 0x44, 0x33},
"High Durability Compound Steel",
new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000),
Werkstoff.Types.MIXTURE,
new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(),
92,
TextureSet.SET_SHINY,
- new Pair<>(Materials.TungstenSteel,12),
- new Pair<>(Materials.HSSE,9),
- new Pair<>(Materials.HSSG,6),
- new Pair<>(WerkstoffLoader.Ruridit,3),
- new Pair<>(WerkstoffLoader.MagnetoResonaticDust,2),
- new Pair<>(Materials.Plutonium,1)
+ new Pair<>(Materials.TungstenSteel, 12),
+ new Pair<>(Materials.HSSE, 9),
+ new Pair<>(Materials.HSSG, 6),
+ new Pair<>(WerkstoffLoader.Ruridit, 3),
+ new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2),
+ new Pair<>(Materials.Plutonium, 1)
);
public static final Werkstoff Atheneite = new Werkstoff(
- new short[]{175,175,175},
+ new short[]{175, 175, 175},
"Atheneite",
subscriptNumbers("(Pd,Hg)3As"),
new Werkstoff.Stats().setElektrolysis(true),
@@ -1284,12 +1312,12 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
93,
TextureSet.SET_SHINY,
- new Pair<>(WerkstoffLoader.PDMetallicPowder,3),
- new Pair<>(Materials.Mercury,3),
- new Pair<>(Materials.Arsenic,1)
+ new Pair<>(WerkstoffLoader.PDMetallicPowder, 3),
+ new Pair<>(Materials.Mercury, 3),
+ new Pair<>(Materials.Arsenic, 1)
);
public static final Werkstoff Temagamite = new Werkstoff(
- new short[]{245,245,245},
+ new short[]{245, 245, 245},
"Temagamite",
subscriptNumbers("Pd3HgTe"),
new Werkstoff.Stats().setElektrolysis(true),
@@ -1297,24 +1325,24 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
94,
TextureSet.SET_ROUGH,
- new Pair<>(WerkstoffLoader.PDMetallicPowder,3),
- new Pair<>(Materials.Mercury,1),
- new Pair<>(Materials.Tellurium,1)
+ new Pair<>(WerkstoffLoader.PDMetallicPowder, 3),
+ new Pair<>(Materials.Mercury, 1),
+ new Pair<>(Materials.Tellurium, 1)
);
public static final Werkstoff Terlinguaite = new Werkstoff(
- new short[]{245,245,245},
+ new short[]{245, 245, 245},
"Terlinguaite",
new Werkstoff.Stats().setElektrolysis(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures(),
95,
TextureSet.SET_GEM_HORIZONTAL,
- new Pair<>(Materials.Mercury,2),
- new Pair<>(Materials.Chlorine,1),
- new Pair<>(Materials.Oxygen,1)
+ new Pair<>(Materials.Mercury, 2),
+ new Pair<>(Materials.Chlorine, 1),
+ new Pair<>(Materials.Oxygen, 1)
);
public static final Werkstoff AdemicSteel = new Werkstoff(
- new short[]{0xcc,0xcc,0xcc},
+ new short[]{0xcc, 0xcc, 0xcc},
"Ademic Steel",
"The break in the line",
new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4),
@@ -1322,22 +1350,22 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(),
96,
TextureSet.SET_METALLIC,
- new Pair<>(Materials.Steel ,2),
- new Pair<>(Materials.VanadiumSteel,1),
- new Pair<>(Materials.DamascusSteel,1),
- new Pair<>(Materials.Carbon,4)
+ new Pair<>(Materials.Steel, 2),
+ new Pair<>(Materials.VanadiumSteel, 1),
+ new Pair<>(Materials.DamascusSteel, 1),
+ new Pair<>(Materials.Carbon, 4)
);
public static final Werkstoff RawAdemicSteel = new Werkstoff(
- new short[]{0xed,0xed,0xed},
+ new short[]{0xed, 0xed, 0xed},
"Raw Ademic Steel",
new Werkstoff.Stats().setCentrifuge(true),
Werkstoff.Types.MIXTURE,
new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(),
97,
TextureSet.SET_ROUGH,
- new Pair<>(Materials.Steel ,2),
- new Pair<>(Materials.VanadiumSteel,1),
- new Pair<>(Materials.DamascusSteel,1)
+ new Pair<>(Materials.Steel, 2),
+ new Pair<>(Materials.VanadiumSteel, 1),
+ new Pair<>(Materials.DamascusSteel, 1)
);
public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>();
@@ -1346,16 +1374,15 @@ public class WerkstoffLoader implements Runnable {
public static Block BWOres;
public static Block BWSmallOres;
public static Block BWBlocks;
- public boolean registered;
+ public static boolean registered;
public static final HashSet<OrePrefixes> ENABLED_ORE_PREFIXES = new HashSet<>();
- public static Werkstoff getWerkstoff(String Name){
- try{
+ public static Werkstoff getWerkstoff(String Name) {
+ try {
Field f = WerkstoffLoader.class.getField(Name);
- if (f != null)
- return (Werkstoff) f.get(null);
+ return (Werkstoff) f.get(null);
} catch (IllegalAccessException | NoSuchFieldException | ClassCastException e) {
- e.printStackTrace();
+ MainMod.LOGGER.catching(e);
}
return Werkstoff.default_null_Werkstoff;
}
@@ -1364,7 +1391,7 @@ public class WerkstoffLoader implements Runnable {
return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1);
}
- private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount){
+ private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) {
if (!werkstoff.getGenerationFeatures().enforceUnification) {
ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount);
if (ret != null)
@@ -1375,7 +1402,7 @@ public class WerkstoffLoader implements Runnable {
else if (orePrefixes == oreSmall)
return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID());
else if (orePrefixes == block)
- return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID());
+ return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID());
else if (WerkstoffLoader.items.get(orePrefixes) == null)
return null;
return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy();
@@ -1386,86 +1413,90 @@ public class WerkstoffLoader implements Runnable {
if (stack != null)
return stack;
else
- MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " +
- "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName()));
+ MainMod.LOGGER.catching(Level.ERROR, new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " +
+ "If you are a Developer, you forgot to enable " + orePrefixes + " OrePrefix for Werkstoff " + werkstoff.getDefaultName()));
return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy();
}
- public void init() {
- if (WerkstoffLoader.INSTANCE == null) {
- MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!");
- FMLCommonHandler.instance().exitJava(1,true);
- }
- GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore");
- }
-
- public void runInit() {
+ public static void runInit() {
MainMod.LOGGER.info("Making Meta Items for BW Materials");
long timepre = System.nanoTime();
- WerkstoffAdderRegistry.getINSTANCE().run();
- this.addSubTags();
- this.addItemsForGeneration();
- this.runAdditionalOreDict();
+ WerkstoffAdderRegistry.run();
+ addSubTags();
+ addItemsForGeneration();
+ runAdditionalOreDict();
long timepost = System.nanoTime();
MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!");
}
- @Override
- public void run() {
- if (!this.registered) {
+ public static void run() {
+ if (!registered) {
MainMod.LOGGER.info("Loading Processing Recipes for BW Materials");
long timepre = System.nanoTime();
- ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size()+1);
- DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre));
+ ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1);
+ DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre));
+
+ Integer[] clsArr = new Integer[0];
+ int size = 0;
+ if (LoaderReference.betterloadingscreen)
+ clsArr = CLSCompat.initCls();
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
long timepreone = System.nanoTime();
- DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone));
+ DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + (System.nanoTime() - timepreone));
if (werkstoff == null || werkstoff.getmID() < 0) {
progressBar.step("");
continue;
}
- DebugLog.log("Werkstoff: "+ werkstoff.getDefaultName() +" " +(System.nanoTime()-timepreone));
- DebugLog.log("Loading Dusts Recipes"+" " +(System.nanoTime()-timepreone));
- this.addDustRecipes(werkstoff);
- DebugLog.log("Loading Gem Recipes"+" " +(System.nanoTime()-timepreone));
- this.addGemRecipes(werkstoff);
- DebugLog.log("Loading Ore Recipes"+" " +(System.nanoTime()-timepreone));
- this.addOreRecipes(werkstoff);
- DebugLog.log("Loading Crushed Recipes"+" " +(System.nanoTime()-timepreone));
- this.addCrushedRecipes(werkstoff);
- DebugLog.log("Loading Cell Recipes"+" " +(System.nanoTime()-timepreone));
- this.addCellRecipes(werkstoff);
- DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone));
- this.addMoltenRecipes(werkstoff);
- DebugLog.log("Loading Simple MetalWorking Recipes"+" " +(System.nanoTime()-timepreone));
- this.addSimpleMetalRecipes(werkstoff);
- DebugLog.log("Loading Crafting MetalWorking Recipes"+" " +(System.nanoTime()-timepreone));
- this.addCraftingMetalRecipes(werkstoff);
- DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone));
- this.addMultipleMetalRecipes(werkstoff);
- DebugLog.log("Loading Metal Recipes"+" " +(System.nanoTime()-timepreone));
- this.addMetalRecipes(werkstoff);
- DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone));
- this.addTools(werkstoff);
- if (Loader.isModLoaded("Thaumcraft")) {
- DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone));
- ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff);
+ if (LoaderReference.betterloadingscreen)
+ size = CLSCompat.invokeStepSize(werkstoff, clsArr, size);
+ DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone));
+ DebugLog.log("Loading Dusts Recipes" + " " + (System.nanoTime() - timepreone));
+ addDustRecipes(werkstoff);
+ DebugLog.log("Loading Gem Recipes" + " " + (System.nanoTime() - timepreone));
+ addGemRecipes(werkstoff);
+ DebugLog.log("Loading Ore Recipes" + " " + (System.nanoTime() - timepreone));
+ addOreRecipes(werkstoff);
+ DebugLog.log("Loading Crushed Recipes" + " " + (System.nanoTime() - timepreone));
+ addCrushedRecipes(werkstoff);
+ DebugLog.log("Loading Cell Recipes" + " " + (System.nanoTime() - timepreone));
+ addCellRecipes(werkstoff);
+ DebugLog.log("Loading Meltdown Recipes" + " " + (System.nanoTime() - timepreone));
+ addMoltenRecipes(werkstoff);
+ DebugLog.log("Loading Simple MetalWorking Recipes" + " " + (System.nanoTime() - timepreone));
+ addSimpleMetalRecipes(werkstoff);
+ DebugLog.log("Loading Crafting MetalWorking Recipes" + " " + (System.nanoTime() - timepreone));
+ addCraftingMetalRecipes(werkstoff);
+ DebugLog.log("Loading MultipleIngots MetalWorking Recipes" + " " + (System.nanoTime() - timepreone));
+ addMultipleMetalRecipes(werkstoff);
+ DebugLog.log("Loading Metal Recipes" + " " + (System.nanoTime() - timepreone));
+ addMetalRecipes(werkstoff);
+ DebugLog.log("Loading Block Recipes" + " " + (System.nanoTime() - timepreone));
+ addBlockRecipes(werkstoff);
+ DebugLog.log("Loading Tool Recipes" + " " + (System.nanoTime() - timepreone));
+ addTools(werkstoff);
+ if (LoaderReference.Thaumcraft) {
+ DebugLog.log("Loading Aspects" + " " + (System.nanoTime() - timepreone));
+ addAspectToAll(werkstoff);
}
- DebugLog.log("Loading New Circuits"+" " +(System.nanoTime()-timepreone));
- new BW_CircuitsLoader();
- DebugLog.log("Done"+" " +(System.nanoTime()-timepreone));
+ DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone));
+ BW_CircuitsLoader.initNewCircuits();
+ DebugLog.log("Done" + " " + (System.nanoTime() - timepreone));
progressBar.step(werkstoff.getDefaultName());
}
+
+ if (LoaderReference.betterloadingscreen)
+ CLSCompat.disableCls();
+
progressBar.step("Load Additional Recipes");
- new AdditionalRecipes().run();
+ AdditionalRecipes.run();
ProgressManager.pop(progressBar);
long timepost = System.nanoTime();
MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!");
- this.registered = true;
+ registered = true;
}
}
- private void addSubTags() {
+ private static void addSubTags() {
WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability);
WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed);
@@ -1474,9 +1505,9 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS);
Materials.Argon.add(WerkstoffLoader.NOBLE_GAS);
WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS);
- WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS);
+ WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS, WerkstoffLoader.ANAEROBE_GAS);
Materials.Radon.add(WerkstoffLoader.NOBLE_GAS);
- WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS);
+ WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS, WerkstoffLoader.ANAEROBE_GAS);
Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS);
@@ -1490,7 +1521,7 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST);
//Calcium Smelting block
- Materials.Calcium.mBlastFurnaceRequired=true;
+ Materials.Calcium.mBlastFurnaceRequired = true;
Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability();
Materials.Spodumene.mDurability = WerkstoffLoader.Spodumen.getDurability();
@@ -1521,17 +1552,18 @@ public class WerkstoffLoader implements Runnable {
break;
}
}
- if (W.getGenerationFeatures().hasGems()) {
+ if (W.hasItemType(gem)) {
W.add(SubTag.CRYSTAL);
W.add(SubTag.CRYSTALLISABLE);
}
}
}
- public static int toGenerateGlobal;
- private void addItemsForGeneration() {
+ public static long toGenerateGlobal;
+
+ private static void addItemsForGeneration() {
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0){
+ if (werkstoff.hasItemType(cell)) {
if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) {
DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName());
GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas());
@@ -1541,29 +1573,28 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName()));
}
}
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) != 0){
- if (!FluidRegistry.isFluidRegistered("molten."+werkstoff.getDefaultName())) {
+ if (werkstoff.hasItemType(cellMolten)) {
+ if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) {
DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName());
Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA());
if (werkstoff.getStats().meltingPoint > 0)
fluid = fluid.setTemperature(werkstoff.getStats().meltingPoint);
FluidRegistry.registerFluid(fluid);
//GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName());
- GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten "+ werkstoff.getDefaultName());
+ GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName());
WerkstoffLoader.molten.put(werkstoff, fluid);
} else {
WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName()));
}
}
for (OrePrefixes p : values())
- if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) {
- DebugLog.log("Found: "+(p+werkstoff.getVarName())+" in oreDict, disable and reroute my Items to that, also add a Tooltip.");
+ if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) {
+ DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in oreDict, disable and reroute my Items to that, also add a Tooltip.");
werkstoff.getGenerationFeatures().setBlacklist(p);
}
WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate);
- //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate);
}
- DebugLog.log("GlobalGeneration: "+WerkstoffLoader.toGenerateGlobal);
+ DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal);
if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) {
WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust));
WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny));
@@ -1580,11 +1611,10 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite));
WerkstoffLoader.items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed));
WerkstoffLoader.items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless));
- WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens));
+ WerkstoffLoader.items.put(lens, new BW_MetaGenerated_Items(lens));
}
if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) {
- if (!ConfigHandler.experimentalThreadedLoader)
- this.gameRegistryHandler();
+ gameRegistryHandler();
WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed));
WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified));
WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged));
@@ -1594,7 +1624,7 @@ public class WerkstoffLoader implements Runnable {
if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) {
WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell));
//WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle));
- if (Loader.isModLoaded("Forestry"))
+ if (LoaderReference.Forestry)
WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule));
}
if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) {
@@ -1602,7 +1632,7 @@ public class WerkstoffLoader implements Runnable {
}
if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) {
WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten));
- if (Loader.isModLoaded("Forestry"))
+ if (LoaderReference.Forestry)
WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten));
}
if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) {
@@ -1641,19 +1671,19 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.runGTItemDataRegistrator();
}
- void gameRegistryHandler(){
- if (FMLCommonHandler.instance().getSide().isClient())
+ static void gameRegistryHandler() {
+ if (SideReference.Side.Client)
RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE);
GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE");
GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE");
GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE");
WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores");
WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall");
- WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron,BW_MetaGenerated_WerkstoffBlock_TE.class,"bw.werkstoffblocks");
+ WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks");
GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01");
GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02");
GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01");
- new GTMetaItemEnhancer();
+ GTMetaItemEnhancer.init();
}
private static void runGTItemDataRegistrator() {
@@ -1675,7 +1705,7 @@ public class WerkstoffLoader implements Runnable {
werkstoffBridgeMaterial.mElement = e;
e.mLinkedMaterials = new ArrayList<>();
e.mLinkedMaterials.add(werkstoffBridgeMaterial);
- if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) {
+ if (werkstoff.hasItemType(dust)) {
GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false);
GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true);
}
@@ -1693,7 +1723,7 @@ public class WerkstoffLoader implements Runnable {
// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
// e.printStackTrace();
// }
- if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) {
+ if (werkstoff.hasItemType(dust)) {
ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L);
Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan");
Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip());
@@ -1703,14 +1733,14 @@ public class WerkstoffLoader implements Runnable {
}
}
- if (werkstoff.getGenerationFeatures().hasCells()) {
+ if (werkstoff.hasItemType(cell)) {
werkstoffBridgeMaterial.setHasCorrespondingFluid(true);
werkstoffBridgeMaterial.setHasCorrespondingGas(true);
werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid();
werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid();
}
- if (werkstoff.getGenerationFeatures().hasMolten()) {
+ if (werkstoff.hasItemType(cellMolten)) {
werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid();
}
werkstoffBridgeMaterial.mName = werkstoff.getVarName();
@@ -1721,7 +1751,7 @@ public class WerkstoffLoader implements Runnable {
} catch (NoSuchFieldException | IllegalAccessException ignored) {
}
werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip();
- if (Loader.isModLoaded("Thaumcraft"))
+ if (LoaderReference.Thaumcraft)
werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects();
werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial;
werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood;
@@ -1739,23 +1769,24 @@ public class WerkstoffLoader implements Runnable {
}
public static void addAssociationToItems() {
- Arrays.stream(values()).forEach( prefixes ->
+ Arrays.stream(values()).forEach(prefixes ->
Werkstoff.werkstoffHashSet.stream()
- .filter(werkstoff -> werkstoff.hasItemType(prefixes) && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)
- .forEach(werkstoff -> {
- Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial();
- ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1);
- if (stack != null && stack.getItem() != null) {
- GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false);
- GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true);
- }
- }));
+ .filter(werkstoff -> werkstoff.hasItemType(prefixes))
+ .forEach(werkstoff -> {
+ Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial();
+ ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1);
+
+ if (stack != null && stack.getItem() != null) {
+ GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false);
+ GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true);
+ }
+ }));
}
/**
- * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix.
- * used for the miners mostly
- * removing this hacky material from the materials map instantly. we only need the item data.
+ * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix.
+ * used for the miners mostly
+ * removing this hacky material from the materials map instantly. we only need the item data.
*/
private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() {
@@ -1772,14 +1803,14 @@ public class WerkstoffLoader implements Runnable {
if (MATERIALS_MAP == null)
throw new NullPointerException("MATERIALS_MAP null!");
- Materials oreMat = new Materials(-1,null,0,0,0,false,"bwores","bwores",null,true,null);
- Materials smallOreMat = new Materials(-1,null,0,0,0,false,"bwsmallores","bwsmallores",null,true,null);
- Materials blockMat = new Materials(-1,null,0,0,0,false,"bwblocks","bwblocks",null,true,null);
+ Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null);
+ Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null);
+ Materials blockMat = new Materials(-1, null, 0, 0, 0, false, "bwblocks", "bwblocks", null, true, null);
for (int i = 0; i < 16; i++) {
- GT_OreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres,1,i), true);
- GT_OreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres,1,i), true);
- GT_OreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks,1,i), true);
+ GT_OreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres, 1, i), true);
+ GT_OreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres, 1, i), true);
+ GT_OreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks, 1, i), true);
}
MATERIALS_MAP.remove("bwores");
@@ -1787,68 +1818,78 @@ public class WerkstoffLoader implements Runnable {
MATERIALS_MAP.remove("bwblocks");
}
- private void addTools(Werkstoff werkstoff){
+ private static void addTools(Werkstoff werkstoff) {
if (werkstoff.getBridgeMaterial().mDurability == 0)
return;
- if (werkstoff.getGenerationFeatures().hasGems()){
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.gem.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', OrePrefixes.gem.get(werkstoff.getBridgeMaterial())});
+ if (werkstoff.hasItemType(gem)) {
+ if (!werkstoff.getGenerationFeatures().isExtension())
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())});
}
- if (!werkstoff.getGenerationFeatures().hasSimpleMetalWorkingItems())
+ if (!werkstoff.hasItemType(plate))
return;
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'R', OrePrefixes.plate.get(Materials.AnyRubber)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(Materials.Iron), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)});
- if (gtnhGT) {
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.StyreneButadieneRubber), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)});
- }
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)});
-
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)});
- if (gtnhGT) {
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)});
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)});
- }
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', OrePrefixes.ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', OrePrefixes.screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
-
- GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ //Disable recipe gen with handle Material for GT Materials
+ if (!werkstoff.getGenerationFeatures().isExtension()) {
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)});
+
+ if (gtnhGT) {
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)});
+ }
- if (!werkstoff.getGenerationFeatures().hasGems()) {
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())});
+ if (!werkstoff.hasItemType(gem)) {
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ }
}
- GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue});
+
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())});
+
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)});
+
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)});
+
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())});
+
+ if (!werkstoff.hasItemType(gem)) {
+ GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())});
+ }
- GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)});
+ if (gtnhGT) {
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)});
+ GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)});
+ }
- // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(OrePrefixes.ingot)});
+ // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)});
}
public static void removeIC2Recipes() {
@@ -1859,67 +1900,52 @@ public class WerkstoffLoader implements Runnable {
if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) {
remset.add(curr);
}
- for (ItemStack stack : curr.getValue().items){
+ for (ItemStack stack : curr.getValue().items) {
if (stack.getItem() instanceof BW_MetaGenerated_Items)
remset.add(curr);
}
}
}
Recipes.macerator.getRecipes().entrySet().removeAll(remset);
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- private void runAdditionalOreDict(){
- if (ConfigHandler.experimentalThreadedLoader){
- for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
- if (werkstoff.getGenerationFeatures().hasOres())
- OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getVarName(), werkstoff.get(ore)));
- if (werkstoff.getGenerationFeatures().hasGems())
- OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)));
- if (werkstoff.getADDITIONAL_OREDICT().size() > 0)
- werkstoff.getADDITIONAL_OREDICT()
- .forEach(s -> ENABLED_ORE_PREFIXES
- .stream()
- .filter(o -> Objects.nonNull(werkstoff.get(o)))
- .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od))));
- }
- OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)));
- } else {
- for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
- if (werkstoff.getGenerationFeatures().hasOres()) {
- GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore));
- GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall));
- werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore)));
- werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall)));
- }
+ private static void runAdditionalOreDict() {
- if (werkstoff.getGenerationFeatures().hasGems())
- OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens));
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
+ if (werkstoff.hasItemType(ore)) {
+ GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore));
+ GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall));
+ werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore)));
+ werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall)));
+ }
- if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){
- GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block));
- werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(block+e, werkstoff.get(block)));
- }
+ if (werkstoff.hasItemType(gem))
+ OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens));
- werkstoff.getADDITIONAL_OREDICT()
- .forEach(s -> ENABLED_ORE_PREFIXES
- .stream()
- .filter(o -> Objects.nonNull(werkstoff.get(o)))
- .forEach(od -> OreDictionary.registerOre(od+s, werkstoff.get(od))));
+ if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) {
+ GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block));
+ werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block)));
}
- GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite));
+ werkstoff.getADDITIONAL_OREDICT()
+ .forEach(s -> ENABLED_ORE_PREFIXES
+ .stream()
+ .filter(o -> Objects.nonNull(werkstoff.get(o)))
+ .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od))));
}
+
+ GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite));
}
- private void addGemRecipes(Werkstoff werkstoff) {
- if (werkstoff.getGenerationFeatures().hasGems()) {
- if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) {
+ private static void addGemRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(gem)) {
+ if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) {
GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block));
- GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block),werkstoff.get(gem, 9), 100, 24);
+ GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24);
GT_Values.RA.addSifterRecipe(
werkstoff.get(crushedPurified),
new ItemStack[]{
@@ -1966,7 +1992,6 @@ public class WerkstoffLoader implements Runnable {
if (werkstoff.hasItemType(plate)) {
GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120);
- GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate,9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30);
}
GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30);
@@ -1983,13 +2008,21 @@ public class WerkstoffLoader implements Runnable {
}
}
- private void addSimpleMetalRecipes(Werkstoff werkstoff) {
+ private static void addSimpleMetalRecipes(Werkstoff werkstoff) {
if (werkstoff.hasItemType(plate)) {
if (werkstoff.hasItemType(gem)) {
- GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16);
+ GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16);
GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)});
GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)});
GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16);
+
+ TextureSet texSet = werkstoff.getTexSet();
+ GT_RenderedTexture texture = SideReference.Side.Client ?
+ new GT_RenderedTexture(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) :
+ new GT_RenderedTexture(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false);
+ GregTech_API.registerCover(werkstoff.get(plate),texture,null);
+
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8);
return;
}
@@ -1997,73 +2030,73 @@ public class WerkstoffLoader implements Runnable {
GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)});
GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)});
- GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0));
- GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16);
+ GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0));
+ GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16);
GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null);
- GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16);
+ GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16);
GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16);
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Plate.get(0),werkstoff.get(plate),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45);
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Rod.get(0),werkstoff.get(stick,2),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot),new ItemStack[]{werkstoff.get(dust)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate),new ItemStack[]{werkstoff.get(dust)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong),new ItemStack[]{werkstoff.get(dust)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick),new ItemStack[]{werkstoff.get(dustSmall,2)},null,2,8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8);
}
}
- private void addCraftingMetalRecipes(Werkstoff werkstoff) {
- if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(screw)) != 0) {
+ private static void addCraftingMetalRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(screw)) {
int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15;
//bolt
- GT_Values.RA.addExtruderRecipe(werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier);
- GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt,4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8);
+ GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier);
+ GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8);
//screw
- GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw),null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4);
+ GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4);
GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)});
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8);
- if (werkstoff.getGenerationFeatures().hasGems())
+ if (werkstoff.hasItemType(gem))
return;
//ring
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring,4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier);
GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)});
//Gear
GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)});
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier);
//wireFine
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier);
- GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier);
- GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine,4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier);
+ GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier);
+ GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier);
//smallGear
if (WerkstoffLoader.smallGearShape != null)
GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier);
if (ConfigHandler.GTNH)
- GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx"," S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)});
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)});
else
- GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P "," h ", 'P', werkstoff.get(plate)});
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)});
//Rotor
GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)});
- GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24);
- GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24);
- GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24);
if (WerkstoffLoader.rotorShape != null)
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60);
//molten -> metal
- if (werkstoff.getGenerationFeatures().hasMolten()) {
+ if (werkstoff.hasItemType(cellMolten)) {
GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8);
GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8);
if (WerkstoffLoader.ringMold != null)
@@ -2075,31 +2108,45 @@ public class WerkstoffLoader implements Runnable {
GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60);
}
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt),new ItemStack[]{werkstoff.get(dust,4)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall),new ItemStack[]{werkstoff.get(dust,1)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor),new ItemStack[]{werkstoff.get(dust,4),werkstoff.get(dustSmall)},null,2,8);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring),new ItemStack[]{werkstoff.get(dustSmall,1)},null,2,8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8);
}
}
- private void addMetalRecipes(Werkstoff werkstoff) {
- if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(ingot)) != 0) {
+ private static void addBlockRecipes(Werkstoff werkstoff) {
+ if (!werkstoff.hasItemType(block))
+ return;
+ if (werkstoff.hasItemType(ingot)) {
+ GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false);
+ }
+ if (werkstoff.hasItemType(cellMolten)) {
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8);
+ }
+ if (werkstoff.hasItemType(plate)) {
+ GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30);
+ }
+ }
+
+ private static void addMetalRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(ingot)) {
GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block));
- GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9),ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15);
- GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass/2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15);
+ GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15);
+ GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15);
}
}
- private void addMultipleMetalRecipes(Werkstoff werkstoff){
- if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) {
- GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0));
+ private static void addMultipleMetalRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(plateDense)) {
+ GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0));
GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null);
- GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble),new ItemStack[]{werkstoff.get(dust,2)},null,2,8);
+ GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8);
}
}
- private void addDustRecipes(Werkstoff werkstoff) {
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) {
+ private static void addDustRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(dust)) {
List<FluidStack> flOutputs = new ArrayList<>();
List<ItemStack> stOutputs = new ArrayList<>();
HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>();
@@ -2125,7 +2172,7 @@ public class WerkstoffLoader implements Runnable {
cells += container.getValue();
}
} else {
- if (((Materials) container.getKey()).getDust(container.getValue()) == null ) {
+ 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(1000 * container.getValue());
if (tmpFl == null || tmpFl.getFluid() == null) {
@@ -2154,7 +2201,7 @@ public class WerkstoffLoader implements Runnable {
}
}
} else if (container.getKey() instanceof Werkstoff) {
- if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) {
+ if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) {
FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue());
if (tmpFl == null || tmpFl.getFluid() == null) {
tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue());
@@ -2171,8 +2218,8 @@ public class WerkstoffLoader implements Runnable {
cells += container.getValue();
}
} else {
- if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts())
- continue;
+ 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));
@@ -2192,22 +2239,22 @@ public class WerkstoffLoader implements Runnable {
if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) {
if (cells > 0)
stOutputs.add(Materials.Empty.getCells(cells));
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0));
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0);
+ GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0));
+ GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0);
}
if (werkstoff.getGenerationFeatures().hasMixerRecipes()) {
if (cells > 0)
stOutputs.add(Materials.Empty.getCells(cells));
- GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0));
+ GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0));
}
}
- GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{
- "TTT","TTT","TTT",'T',
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{
+ "TTT", "TTT", "TTT", 'T',
werkstoff.get(dustTiny)
});
- GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{
- "TT ","TT ",'T',
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{
+ "TT ", "TT ", 'T',
WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff)
});
GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{
@@ -2217,23 +2264,20 @@ public class WerkstoffLoader implements Runnable {
"T ", 'T', werkstoff.get(dust)
});
- GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4);
- GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4);
- GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4);
- GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4);
+ GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4);
+ GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4);
+ GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4);
+ GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4);
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) {
+ if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) {
GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot));
GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget));
- }
- else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){
- if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){
- GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint());
- }
- else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) {
+ } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0) {
+ if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) {
+ GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint());
+ } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) {
GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint());
- }
- else {
+ } else {
GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint());
if (werkstoff.getStats().meltingPoint <= 1000) {
GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint);
@@ -2242,26 +2286,26 @@ public class WerkstoffLoader implements Runnable {
}
}
- if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750){
- GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot),werkstoff.get(ingot),(int) Math.max(werkstoff.getStats().mass * 3L, 1L));
+ if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750) {
+ GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().mass * 3L, 1L));
}
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){
- GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust));
- GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny));
+ if (werkstoff.hasItemType(ingot)) {
+ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot), werkstoff.get(dust));
+ GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget), werkstoff.get(dustTiny));
}
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 || werkstoff.getGenerationFeatures().hasGems() ){
- GT_ModHandler.addPulverisationRecipe(werkstoff.get(block),werkstoff.get(dust, 9));
+ if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) {
+ GT_ModHandler.addPulverisationRecipe(werkstoff.get(block), werkstoff.get(dust, 9));
}
}
}
- private void addOreRecipes(Werkstoff werkstoff) {
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace())
+ private static void addOreRecipes(Werkstoff werkstoff) {
+ if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace())
GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot));
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) {
- GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10);
+ if (werkstoff.hasItemType(ore)) {
+ GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10);
GT_ModHandler.addPulverisationRecipe(
werkstoff.get(ore),
werkstoff.get(crushed, 2),
@@ -2273,17 +2317,16 @@ public class WerkstoffLoader implements Runnable {
}
}
- private void addCrushedRecipes(Werkstoff werkstoff) {
+ private static void addCrushedRecipes(Werkstoff werkstoff) {
if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0)
return;
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) {
+ if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) {
if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
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));
- }
- else {
+ } else {
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(ingot));
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(ingot));
GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(ingot));
@@ -2293,9 +2336,9 @@ public class WerkstoffLoader implements Runnable {
GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot));
}
- GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure),new Object[]{"h ", "W ",'W',werkstoff.get(crushed)});
- GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure),new Object[]{"h ", "W ",'W',werkstoff.get(crushedPurified)});
- GT_ModHandler.addCraftingRecipe(werkstoff.get(dust),new Object[]{"h ", "W ",'W',werkstoff.get(crushedCentrifuged)});
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)});
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)});
+ GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)});
GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16);
GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false);
@@ -2330,7 +2373,7 @@ public class WerkstoffLoader implements Runnable {
GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24);
}
- private void addCellRecipes(Werkstoff werkstoff){
+ private static void addCellRecipes(Werkstoff werkstoff) {
if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0)
return;
@@ -2369,7 +2412,7 @@ public class WerkstoffLoader implements Runnable {
// }
// }
// } else if (container.getKey() instanceof Werkstoff) {
-// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) {
+// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) {
// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue());
// if (tmpFl == null || tmpFl.getFluid() == null) {
// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue());
@@ -2386,7 +2429,7 @@ public class WerkstoffLoader implements Runnable {
// cells += container.getValue();
// }
// } else {
-// if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts())
+// if (!((Werkstoff) container.getKey()).hasItemType(dust))
// continue;
// if (!tracker.containsKey(container.getKey())) {
// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue()));
@@ -2419,29 +2462,29 @@ public class WerkstoffLoader implements Runnable {
// }
//Tank "Recipe"
- GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000),werkstoff.get(cell),Materials.Empty.getCells(1)));
- FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1));
- GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000), GT_Values.NF);
- GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000));
+ GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1)));
+ FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1));
+ GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000), GT_Values.NF);
+ GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000));
- if (Loader.isModLoaded("Forestry")) {
+ if (LoaderReference.Forestry) {
FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true);
GT_Utility.addFluidContainerData(emptyData);
FluidContainerRegistry.registerFluidContainer(emptyData);
GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000));
}
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,(int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30);
- GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ if (werkstoff.hasItemType(dust)) {
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
}
if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
Materials werkstoffBridgeMaterial = null;
boolean ElementSet = false;
- for (Element e : Element.values()){
- if (e.toString().equals(werkstoff.getToolTip())){
- werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName());
+ for (Element e : Element.values()) {
+ if (e.toString().equals(werkstoff.getToolTip())) {
+ werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName());
werkstoffBridgeMaterial.mElement = e;
e.mLinkedMaterials.add(werkstoffBridgeMaterial);
ElementSet = true;
@@ -2451,7 +2494,7 @@ public class WerkstoffLoader implements Runnable {
if (!ElementSet)
return;
- GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false);
+ GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false);
// try {
// Field f = Materials.class.getDeclaredField("MATERIALS_MAP");
// f.setAccessible(true);
@@ -2461,48 +2504,68 @@ public class WerkstoffLoader implements Runnable {
// e.printStackTrace();
// }
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(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0));
- GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0));
+ 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(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0));
+ GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0));
}
}
- private void addMoltenRecipes(Werkstoff werkstoff) {
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) == 0)
+
+ private static void addMoltenRecipes(Werkstoff werkstoff) {
+ if (!werkstoff.hasItemType(cellMolten))
return;
//Tank "Recipe"
- final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1));
- FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144),werkstoff.get(cell),Materials.Empty.getCells(1));
+ final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1));
+ FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1));
GT_Utility.addFluidContainerData(data);
- GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144), GT_Values.NF);
- GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144));
+ GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), GT_Values.NF);
+ GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144));
- if (Loader.isModLoaded("Forestry")) {
+ if (LoaderReference.Forestry) {
final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1));
FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1));
GT_Utility.addFluidContainerData(emptyData);
GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144));
}
- if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) {
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ if (werkstoff.hasItemType(ingot)) {
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) {
GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
}
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
//GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
- } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block),null,werkstoff.getMolten(1296),0,288, 8);
+ } else if (werkstoff.hasItemType(dust) && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0) {
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ }
+ }
+
+ public static void addAspectToAll(Werkstoff werkstoff){
+ for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) {
+ if (werkstoff.hasItemType(enabledOrePrefixes)) {
+ if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) {
+ DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount/3628800L);
+ if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes)))
+ ThaumcraftHandler.AspectAdder.addAspectViaBW(
+ werkstoff.get(enabledOrePrefixes),
+ werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 :
+ (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))
+ );
+ }
+ else if (enabledOrePrefixes.mMaterialAmount >= 0L) {
+ if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes)))
+ ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1));
+ }
+ }
}
}
} \ No newline at end of file
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 a585f8291b..ed77b13329 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,21 +22,28 @@
package com.github.bartimaeusnek.bartworks.system.material.processingLoaders;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
+import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
+import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader;
+import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList;
+import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems;
import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items;
import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
-import com.github.bartimaeusnek.bartworks.util.BWRecipes;
-import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.bartworks.util.*;
import gregtech.api.GregTech_API;
import gregtech.api.enums.*;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
+import ic2.core.item.ItemFluidCell;
+import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.reflect.FieldUtils;
@@ -46,13 +53,230 @@ import java.util.Map;
import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM;
import static gregtech.api.enums.OrePrefixes.*;
-public class AdditionalRecipes implements Runnable {
+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 GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0);
+
+ private static void runBWRecipes(){
+
+ if (ConfigHandler.BioLab) {
+ FluidStack[] dnaFluid = {LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)};
+
+ for (ItemStack stack : BioItemList.getAllPetriDishes()) {
+ BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA"));
+ if (DNA != null) {
+ ItemStack Detergent = BioItemList.getOther(1);
+ ItemStack DNAFlask = BioItemList.getDNASampleFlask(null);
+ ItemStack EthanolCell = Materials.Ethanol.getCells(1);
+ sBiolab.addFakeRecipe(false,
+ new ItemStack[]{
+ stack,
+ DNAFlask,
+ Detergent,
+ EthanolCell
+ },
+ new ItemStack[]{
+ BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)),
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)
+ },
+ BioItemList.mBioLabParts[0],
+ new int[]{DNA.getChance(), 10000},
+ new FluidStack[]{
+ FluidRegistry.getFluidStack("ic2distilledwater", 1000)
+ },
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()),
+ BW_Util.STANDART
+ );
+ }
+ }
+
+ for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) {
+ BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound());
+
+ if (DNA != null) {
+ ItemStack Outp = ItemList.Tool_DataOrb.get(1L);
+ Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample");
+ Behaviour_DataOrb.setDataName(Outp, DNA.getName());
+
+ sBiolab.addFakeRecipe(false,
+ new ItemStack[]{
+ stack,
+ FluidLoader.BioLabFluidCells[0],
+ FluidLoader.BioLabFluidCells[3],
+ ItemList.Tool_DataOrb.get(1L)
+ },
+ new ItemStack[]{
+ Outp,
+ ItemList.Cell_Universal_Fluid.get(2L)
+ },
+ BioItemList.mBioLabParts[1],
+ new int[]{DNA.getChance(), 10000},
+ dnaFluid,
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()),
+ BW_Util.STANDART
+ );
+ }
+ }
+
+ for (ItemStack stack : BioItemList.getAllPlasmidCells()) {
+ BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound());
+
+ if (DNA != null) {
+ ItemStack inp = ItemList.Tool_DataOrb.get(0L);
+ Behaviour_DataOrb.setDataTitle(inp, "DNA Sample");
+ Behaviour_DataOrb.setDataName(inp, DNA.getName());
+ ItemStack inp2 = ItemList.Tool_DataOrb.get(0L);
+ Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample");
+ Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName());
+
+ sBiolab.addFakeRecipe(false,
+ new ItemStack[]{
+ FluidLoader.BioLabFluidCells[1],
+ BioItemList.getPlasmidCell(null),
+ inp,
+ inp2
+ },
+ new ItemStack[]{
+ stack,
+ ItemList.Cell_Universal_Fluid.get(1L)
+ },
+ BioItemList.mBioLabParts[2],
+ new int[]{DNA.getChance(), 10000},
+ dnaFluid,
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()),
+ BW_Util.STANDART
+ );
+ }
+ }
+
+ //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells
+ sBiolab.addFakeRecipe(false,
+ new ItemStack[]{
+ BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"),
+ BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"),
+ FluidLoader.BioLabFluidCells[2],
+ },
+ new ItemStack[]{
+ BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"),
+ ItemList.Cell_Universal_Fluid.get(1L)
+ },
+ BioItemList.mBioLabParts[3],
+ new int[]{7500, 10000},
+ new FluidStack[]{
+ FluidRegistry.getFluidStack("ic2distilledwater", 1000)
+ },
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(6),
+ BW_Util.STANDART
+ );
+
+
+ ItemStack Outp = ItemList.Tool_DataOrb.get(1L);
+ Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample");
+ Behaviour_DataOrb.setDataName(Outp, "Any DNA");
+ //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data
+ sBiolab.addFakeRecipe(false,
+ new ItemStack[]{
+ BioItemList.getPetriDish(null),
+ BioItemList.getOther(4),
+ ItemList.Circuit_Chip_Stemcell.get(2L),
+ Outp
+ },
+ new ItemStack[]{
+ BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"),
+ },
+ BioItemList.mBioLabParts[4],
+ new int[]{7500, 10000},
+ new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)},
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(6),
+ BW_Util.STANDART
+ );
+
+ FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)};
+ for (FluidStack fluidStack : easyFluids) {
+ for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) {
+ if (bioCulture.isBreedable() && bioCulture.getTier() == 0) {
+ sBacteriaVat.addRecipe(
+ //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue
+ new BWRecipes.BacteriaVatRecipe(
+ true,
+ new ItemStack[]{
+ GT_Utility.getIntegratedCircuit(0),
+ new ItemStack(Items.sugar, 64)
+ },
+ null,
+ BioItemList.getPetriDish(bioCulture),
+ null,
+ new FluidStack[]{
+ fluidStack
+ },
+ new FluidStack[]{
+ new FluidStack(bioCulture.getFluid(), 10)
+ },
+ 1000,
+ BW_Util.getMachineVoltageFromTier(3),
+ BW_Util.STANDART
+ ), true
+ );
+ //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue
+ sBiolab.addRecipe(
+ new BWRecipes.DynamicGTRecipe(
+ false,
+ new ItemStack[]{
+ BioItemList.getPetriDish(null),
+ fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000))
+ },
+ new ItemStack[]{
+ BioItemList.getPetriDish(bioCulture),
+ fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L)
+ },
+ null,
+ new int[]{
+ bioCulture.getChance(),
+ 10000
+ },
+ new FluidStack[]{
+ new FluidStack(bioCulture.getFluid(), 1000)
+ },
+ null,
+ 500,
+ BW_Util.getMachineVoltageFromTier(3),
+ BW_Util.STANDART
+ ));
+ }
+ }
+ }
+ }
+
+ sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36);
+ sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14);
+ sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30);
+ sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40);
+ sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28);
+ sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24);
+ sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32);
+ sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9);
+ sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18);
+ sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11);
+ sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10);
+ }
- @Override
@SuppressWarnings("deprecation")
- public void run() {
- GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust),4,WerkstoffLoader.AdemicSteel.get(dust),null);
- ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40);
+ public static void run() {
+ runBWRecipes();
+ GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null);
+ ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40);
//Thorium/Yttrium Glas
GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663);
//Thorianit recipes
@@ -76,19 +300,19 @@ public class AdditionalRecipes implements Runnable {
GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500);
GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800);
//Cubic Circonia
- GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1));
+ GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1));
GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953);
//Tellurium
GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722);
- GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250, 49152, 480000000);
- GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000);
+ GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 250, 49152, 480000000);
+ GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(48), WerkstoffLoader.Calcium.getMolten(48), WerkstoffLoader.Oganesson.getFluidOrGas(48), 500, 49152, 600000000);
GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4));
GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5));
GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5));
//Milk
//GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000);
- GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120);
+ GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1), GT_Values.NI, Materials.Milk.getFluid(10000), Materials.Water.getFluid(8832), Materials.Sugar.getDustSmall(21), Materials.Calcium.getDustTiny(1), Materials.Magnesium.getDustTiny(1), Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), new int[]{10000, 10000, 1000, 10000, 1000, 1000}, 50, 120);
for (int i = 0; i <= 6; i++) {
GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(
@@ -129,31 +353,31 @@ public class AdditionalRecipes implements Runnable {
GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500);
GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500);
- try{
+ try {
Class<GT_Recipe.GT_Recipe_Map> map = GT_Recipe.GT_Recipe_Map.class;
- GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null);
- GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null);
- GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null);
+ GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null);
+ GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null);
+ GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null);
sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000);
sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250);
sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000);
- }catch (NullPointerException | IllegalAccessException ignored){}
+ } catch (NullPointerException | IllegalAccessException ignored) {}
- new LoadItemContainers().run();
+ LoadItemContainers.run();
- GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust,3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16);
+ GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust, 3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16);
GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400);
GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400);
GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400);
GT_Values.RA.addAssemblerRecipe(
- new ItemStack[]{ItemList.NaquadahCell_1.get(32L),
- GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L),
- GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L),
- GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L),
- WerkstoffLoader.Tiberium.get(dust,64),
- WerkstoffLoader.Tiberium.get(dust,64)
- },null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6));
+ new ItemStack[]{ItemList.NaquadahCell_1.get(32L),
+ GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L),
+ GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L),
+ GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L),
+ WerkstoffLoader.Tiberium.get(dust, 64),
+ WerkstoffLoader.Tiberium.get(dust, 64)
+ }, null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6));
GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer());
AdditionalRecipes.oldGThelperMethod();
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java
index 320bf534fb..c6768aad7b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java
@@ -30,10 +30,9 @@ import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
-public class DownTierLoader implements Runnable {
+public class DownTierLoader {
- @Override
- public void run() {
+ public static void run() {
GT_Recipe.GT_Recipe_Map.sMappings.stream()
.filter(map -> StreamUtils.filterVisualMaps(map) && map != GT_Recipe.GT_Recipe_Map.sFusionRecipes)
.forEach(map -> {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java
index f2edb3b32d..c008588477 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -26,10 +26,9 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialIte
import gregtech.api.items.GT_RadioactiveCellIC_Item;
import gregtech.common.items.GT_DepletetCell_Item;
-public class LoadItemContainers implements Runnable {
+public class LoadItemContainers {
- @Override
- public void run() {
+ public static void run() {
BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1));
BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1));
BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1));
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 5d86ecf88e..2a29fe2855 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.system.oregen;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.system.material.*;
import com.github.bartimaeusnek.bartworks.util.MurmurHash3;
+import com.github.bartimaeusnek.bartworks.util.Pair;
import com.google.common.collect.ArrayListMultimap;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -118,6 +119,15 @@ public abstract class BW_OreLayer extends GT_Worldgen {
return ret;
}
+ public List<Pair<Integer,Boolean>> getStacksRawData(){
+ ArrayList<Pair<Integer,Boolean>> ret = new ArrayList<>();
+ ret.add(new Pair<>(this.mPrimaryMeta, (this.bwOres & 0b1000) != 0));
+ ret.add(new Pair<>(this.mSecondaryMeta, (this.bwOres & 0b0100) != 0));
+ ret.add(new Pair<>(this.mBetweenMeta, (this.bwOres & 0b0010) != 0));
+ ret.add(new Pair<>(this.mSporadicMeta, (this.bwOres & 0b0001) != 0));
+ return ret;
+ }
+
@Override
public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java
index 2471a36b60..33c36d270a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,6 +22,7 @@
package com.github.bartimaeusnek.bartworks.system.worldgen;
+import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import gregtech.api.GregTech_API;
import net.minecraft.block.Block;
@@ -33,74 +34,23 @@ public class GT_WorldgenUtil {
public static final Block GT_TILES = GregTech_API.sBlockMachines;
- public static final short[][] METAFORTIERS_ENERGY = {
- {100,101,102,105}, //ULV=HPSteam
- {1110,1115,1120,1127},
- {1111,12726,1116,1121,1128},
- {1112,12727,1117,1122,1129},
- {12728,1190,1130,12685},
- {1191,1174,695,12686},
- };
- public static final short[][] METAFORTIERS_BUFFER = {
- {5133,5123}, //ULV=HPSteam
- {161,171,181,191},
- {162,172,182,192},
- {163,173,183,193},
- {164,174,184,194},
- {165,175,185,195},
- };
- //ULV=HPSteam
- public static final short[][] METAFORTIERS_CABLE = {
- {5133,5123}, //ULV=HPSteam
- {1210,1230,1250,1270,1290},
- {1310,1330,1350,1370,1390},
- {1410,1430,1450,1470,1490},
- {1510,1530,1550,1570,1590},
- {1650,1670,1690},
- };
- public static final short[][] METAFORTIERS_MACHINE = {
- {103,104,106,107,109,110,112,113,115,116,118,119}, //ULV=HPSteam
- {201,211,221,231,241,251,261,271,281,291,301,311,321,331,341,351,361,371,381,391,401,411,421,431,441,451,461,471,481,491,501,511,521,531,541,551,561,571,581,591,601,611,621,631,641,651,661,671},
- {},
- {},
- {},
- {},
- };
-
- private static boolean initialisized;
-
- private static void init(){
-
- for (int j = 1; j < 5; j++) {
- GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1]=new short[GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length];
- for (int i = 0; i < GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length; i++) {
- GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1][i]= (short) (GT_WorldgenUtil.METAFORTIERS_MACHINE[1][i]+j);
- }
- }
- GT_WorldgenUtil.initialisized =true;
- }
-
public static short getGenerator(Random rand,int tier){
- short meta = GT_WorldgenUtil.METAFORTIERS_ENERGY[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_ENERGY[tier].length)];
- return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getGenerator(rand,tier);
+ int meta = ConfigHandler.metasForTiers[0][tier][rand.nextInt(ConfigHandler.metasForTiers[0][tier].length)];
+ return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand,tier);
}
public static short getBuffer(Random rand,int tier){
- short meta = GT_WorldgenUtil.METAFORTIERS_BUFFER[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_BUFFER[tier].length)];
- return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getBuffer(rand,tier);
+ int meta = ConfigHandler.metasForTiers[1][tier][rand.nextInt(ConfigHandler.metasForTiers[1][tier].length)];
+ return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand,tier);
}
public static short getCable(Random rand,int tier){
- short meta = GT_WorldgenUtil.METAFORTIERS_CABLE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_CABLE[tier].length)];
- return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getCable(rand,tier);
+ int meta = ConfigHandler.metasForTiers[2][tier][rand.nextInt(ConfigHandler.metasForTiers[2][tier].length)];
+ return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand,tier);
}
public static short getMachine(Random rand,int tier){
- if (!GT_WorldgenUtil.initialisized)
- GT_WorldgenUtil.init();
- short meta = GT_WorldgenUtil.METAFORTIERS_MACHINE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_MACHINE[tier].length)];
- return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getMachine(rand,tier);
+ int meta = ConfigHandler.metasForTiers[3][tier][rand.nextInt(ConfigHandler.metasForTiers[3][tier].length)];
+ return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand,tier);
}
-
-
-}
+} \ No newline at end of file
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 dbeaa9ef3e..14f0ca8e0c 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -40,6 +40,7 @@ import net.minecraftforge.common.ChestGenHooks;
import java.security.SecureRandom;
import java.util.Random;
+import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss;
import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST;
@SuppressWarnings({"ALL"})
public abstract class MapGenRuins extends WorldGenerator {
@@ -133,10 +134,10 @@ public abstract class MapGenRuins extends WorldGenerator {
this.setMiscBlocks(new int[]{1},Blocks.log);
this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)};
int colored = rand.nextInt(15);
- int tier = secureRandom.nextInt(6);
+ int tier = secureRandom.nextInt(maxTierRoss);
boolean useColor = rand.nextBoolean();
byte set = 0;
- byte toSet = (byte) (rand.nextInt(6-tier)+1);
+ byte toSet = (byte) (rand.nextInt(maxTierRoss - tier) + 1);
short cablemeta = GT_WorldgenUtil.getCable(secureRandom,tier);
byte treeinaRow = 0;
boolean lastset = rand.nextBoolean();
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 5da71e18b4..c7f578fe41 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,35 +22,25 @@
package com.github.bartimaeusnek.bartworks.util;
-import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
-import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList;
-import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
-import cpw.mods.fml.common.Loader;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.common.items.behaviors.Behaviour_DataOrb;
import ic2.core.Ic2Items;
import ic2.core.item.ItemFluidCell;
-import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import javax.annotation.Nonnegative;
-import java.io.Serializable;
import java.util.*;
import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv;
@@ -101,221 +91,6 @@ public class BWRecipes {
"", 1, "", true, true //special handler
);
-
- public BWRecipes() {
-
- if (ConfigHandler.BioLab) {
- FluidStack[] dnaFluid = {Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)};
-
- for (ItemStack stack : BioItemList.getAllPetriDishes()) {
- BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA"));
- if (DNA != null) {
- ItemStack Detergent = BioItemList.getOther(1);
- ItemStack DNAFlask = BioItemList.getDNASampleFlask(null);
- ItemStack EthanolCell = Materials.Ethanol.getCells(1);
- sBiolab.addFakeRecipe(false,
- new ItemStack[]{
- stack,
- DNAFlask,
- Detergent,
- EthanolCell
- },
- new ItemStack[]{
- BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)),
- GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)
- },
- BioItemList.mBioLabParts[0],
- new int[]{DNA.getChance(), 10000},
- new FluidStack[]{
- FluidRegistry.getFluidStack("ic2distilledwater", 1000)
- },
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()),
- BW_Util.STANDART
- );
- }
- }
-
- for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) {
- BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound());
-
- if (DNA != null) {
- ItemStack Outp = ItemList.Tool_DataOrb.get(1L);
- Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample");
- Behaviour_DataOrb.setDataName(Outp, DNA.getName());
-
- sBiolab.addFakeRecipe(false,
- new ItemStack[]{
- stack,
- FluidLoader.BioLabFluidCells[0],
- FluidLoader.BioLabFluidCells[3],
- ItemList.Tool_DataOrb.get(1L)
- },
- new ItemStack[]{
- Outp,
- ItemList.Cell_Universal_Fluid.get(2L)
- },
- BioItemList.mBioLabParts[1],
- new int[]{DNA.getChance(), 10000},
- dnaFluid,
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()),
- BW_Util.STANDART
- );
- }
- }
-
- for (ItemStack stack : BioItemList.getAllPlasmidCells()) {
- BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound());
-
- if (DNA != null) {
- ItemStack inp = ItemList.Tool_DataOrb.get(0L);
- Behaviour_DataOrb.setDataTitle(inp, "DNA Sample");
- Behaviour_DataOrb.setDataName(inp, DNA.getName());
- ItemStack inp2 = ItemList.Tool_DataOrb.get(0L);
- Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample");
- Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName());
-
- sBiolab.addFakeRecipe(false,
- new ItemStack[]{
- FluidLoader.BioLabFluidCells[1],
- BioItemList.getPlasmidCell(null),
- inp,
- inp2
- },
- new ItemStack[]{
- stack,
- ItemList.Cell_Universal_Fluid.get(1L)
- },
- BioItemList.mBioLabParts[2],
- new int[]{DNA.getChance(), 10000},
- dnaFluid,
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()),
- BW_Util.STANDART
- );
- }
- }
-
- //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells
- sBiolab.addFakeRecipe(false,
- new ItemStack[]{
- BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"),
- BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"),
- FluidLoader.BioLabFluidCells[2],
- },
- new ItemStack[]{
- BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"),
- ItemList.Cell_Universal_Fluid.get(1L)
- },
- BioItemList.mBioLabParts[3],
- new int[]{7500, 10000},
- new FluidStack[]{
- FluidRegistry.getFluidStack("ic2distilledwater", 1000)
- },
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(6),
- BW_Util.STANDART
- );
-
-
- ItemStack Outp = ItemList.Tool_DataOrb.get(1L);
- Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample");
- Behaviour_DataOrb.setDataName(Outp, "Any DNA");
- //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data
- sBiolab.addFakeRecipe(false,
- new ItemStack[]{
- BioItemList.getPetriDish(null),
- BioItemList.getOther(4),
- ItemList.Circuit_Chip_Stemcell.get(2L),
- Outp
- },
- new ItemStack[]{
- BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"),
- },
- BioItemList.mBioLabParts[4],
- new int[]{7500, 10000},
- new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)},
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(6),
- BW_Util.STANDART
- );
-
- FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)};
- for (FluidStack fluidStack : easyFluids) {
- for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) {
- if (bioCulture.isBreedable() && bioCulture.getTier() == 0) {
- sBacteriaVat.addRecipe(
- //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue
- new BacteriaVatRecipe(
- true,
- new ItemStack[]{
- GT_Utility.getIntegratedCircuit(0),
- new ItemStack(Items.sugar, 64)
- },
- null,
- BioItemList.getPetriDish(bioCulture),
- null,
- new FluidStack[]{
- fluidStack
- },
- new FluidStack[]{
- new FluidStack(bioCulture.getFluid(), 10)
- },
- 1000,
- BW_Util.getMachineVoltageFromTier(3),
- BW_Util.STANDART
- ), true
- );
- //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue
- sBiolab.addRecipe(
- new DynamicGTRecipe(
- false,
- new ItemStack[]{
- BioItemList.getPetriDish(null),
- fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000))
- },
- new ItemStack[]{
- BioItemList.getPetriDish(bioCulture),
- fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L)
- },
- null,
- new int[]{
- bioCulture.getChance(),
- 10000
- },
- new FluidStack[]{
- new FluidStack(bioCulture.getFluid(), 1000)
- },
- null,
- 500,
- BW_Util.getMachineVoltageFromTier(3),
- BW_Util.STANDART
- ));
- }
- }
- }
- }
-
- sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36);
- sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14);
- sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30);
- sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40);
- sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28);
- sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24);
- sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32);
- sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9);
- sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18);
- sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11);
- sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10);
- }
-
-
/**
* @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine
*/
@@ -464,13 +239,16 @@ public class BWRecipes {
return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
- public static class DynamicGTRecipe extends GT_Recipe implements Serializable {
+ public static class DynamicGTRecipe extends GT_Recipe {
+
public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
}
+
}
public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel {
+
public BW_Recipe_Map_LiquidFuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
}
@@ -487,13 +265,14 @@ public class BWRecipes {
return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn);
}
-
}
public static class BacteriaVatRecipe extends GT_Recipe {
- protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+
+ public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
}
+
}
public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap {
@@ -522,6 +301,7 @@ public class BWRecipes {
}
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 {
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 cbeede008f..6429cece69 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,8 +23,6 @@
package com.github.bartimaeusnek.bartworks.util;
import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
-import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
-import gregtech.api.enums.Element;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OreDictNames;
import gregtech.api.enums.ToolDictNames;
@@ -42,10 +40,10 @@ import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
-import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
@@ -53,8 +51,10 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
+import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.*;
+import java.util.stream.Collectors;
import static gregtech.api.enums.GT_Values.*;
@@ -98,7 +98,9 @@ public class BW_Util {
newTime >>= (tier - oldTier);
newVoltage <<= 2 * (tier - oldTier);
}
- return new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, recipe.mFluidInputs, recipe.mFluidOutputs, newTime, newVoltage, recipe.mSpecialValue);
+ recipe.mEUt = newVoltage;
+ recipe.mDuration = newTime;
+ return recipe;
}
public static String subscriptNumbers(String b){
@@ -189,9 +191,8 @@ public class BW_Util {
special = 1;
else if (aSpecialValue == (CLEANROOM))
special = 2;
- else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) {
+ else if (aSpecialValue == (LOWGRAVITY | CLEANROOM))
special = 3;
- }
return special;
}
@@ -218,37 +219,91 @@ public class BW_Util {
return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons());
}
+ public static ItemStack setStackSize(ItemStack stack, int size) {
+ if (stack != null)
+ stack.stackSize = size;
+ return stack;
+ }
+
public static boolean checkStackAndPrefix(ItemStack itemStack) {
return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null;
}
-// public static int getRecipeHash(GT_Recipe recipe) {
-// int mInputItemsRawHash = Arrays.stream(recipe.mInputs).filter(Objects::nonNull).mapToInt(e ->
-// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound())
-// ).hashCode();
-// int mInputFluidRawHash = Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).mapToInt(e ->
-// Objects.hash(e.getFluidID(),e.amount,e.tag)
-// ).hashCode();
-// int mOutputItemRawHash = Arrays.stream(recipe.mOutputs).filter(Objects::nonNull).mapToInt(e ->
-// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound())
-// ).hashCode();
-// int mOutputFluidRawHash = Arrays.stream(recipe.mFluidOutputs).filter(Objects::nonNull).mapToInt(e ->
-// Objects.hash(e.getFluidID(),e.amount,e.tag)
-// ).hashCode();
-// int mChancesRawHash = Arrays.hashCode(recipe.mChances);
-// int others = Objects.hash(recipe.mEUt,recipe.mSpecialValue,recipe.mDuration);
-// int specialItem = Objects.hash(recipe.mSpecialItems instanceof ItemStack ?
-// ((ItemStack) (recipe.mSpecialItems)).getItem() : recipe.mSpecialItems instanceof Item ? recipe.mSpecialItems : 0 ,
-// recipe.mSpecialItems instanceof ItemStack ? ((ItemStack) (recipe.mSpecialItems)).getItemDamage() : 0);
-// return Objects.hash(mInputItemsRawHash,mInputFluidRawHash,mOutputItemRawHash,mOutputFluidRawHash,mChancesRawHash,others,specialItem);
-// }
+ public static Map<ItemStack, ItemStack[]> getInputsFromOutput(Collection<GT_Recipe> gt_recipes, ItemStack... inputs) {
+ return gt_recipes.stream()
+ .filter(ar ->
+ Arrays.stream(inputs)
+ .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0])))
+ .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs));
+ }
+
+ public static Map<ItemStack, ItemStack[]> getAsslineInputsFromOutputs(ItemStack... inputs) {
+ return GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream()
+ .filter(ar ->
+ Arrays.stream(inputs)
+ .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput)))
+ .collect(Collectors.toMap(k -> k.mOutput, k -> k.mInputs));
+ }
+
+ public static int abstractHashGTRecipe(GT_Recipe recipe) {
+ int hash = 31;
+ hash += recipe.mDuration / 20 * 31;
+ hash += GT_Utility.getTier(recipe.mEUt) * 31;
+ hash += BW_Util.specialToByte(recipe.mSpecialValue) * 31;
+ hash += recipe.mInputs.length * 31;
+ for (ItemStack mInput : recipe.mInputs) {
+ if (mInput != null) {
+ hash += mInput.stackSize * 31;
+ hash += Item.getIdFromItem(mInput.getItem()) * 31;
+ }
+ }
+ hash += recipe.mOutputs.length * 31;
+ for (ItemStack mOutput : recipe.mOutputs) {
+ if (mOutput != null) {
+ hash += mOutput.stackSize * 31;
+ hash += Item.getIdFromItem(mOutput.getItem()) * 31;
+ }
+ }
+ hash += recipe.mFluidInputs.length * 31;
+ for (FluidStack mInput : recipe.mFluidInputs) {
+ if (mInput != null) {
+ hash += mInput.amount * 31;
+ hash += mInput.getFluidID() * 31;
+ }
+ }
+ hash += recipe.mFluidOutputs.length * 31;
+ for (FluidStack mOutput : recipe.mFluidOutputs) {
+ if (mOutput != null) {
+ hash += mOutput.amount * 31;
+ hash += mOutput.getFluidID() * 31;
+ }
+ }
+ return hash;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ public static <T> T[] copyAndRemoveNulls(T[] input, Class<T> clazz) {
+ List<T> ret = Arrays.stream(input)
+ .filter(Objects::nonNull)
+ .collect(Collectors.toList());
+
+ if (ret.size() <= 0)
+ return (T[]) Array.newInstance(clazz, 0);
+
+ T[] retArr = (T[]) Array.newInstance(clazz, ret.size());
+
+ for (int i = 0; i < ret.size(); i++)
+ retArr[i] = ret.get(i);
+
+ return retArr;
+ }
public static int getMachineVoltageFromTier(int tier) {
return (int) (30 * Math.pow(4, (tier - 1)));
}
public static int getTierVoltage(int tier) {
- return 8 << (2*tier);
+ return 8 << (2 * tier);
}
public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) {
@@ -393,15 +448,13 @@ public class BW_Util {
}
}
-
public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) {
long rVoltage = 0L;
long rAmperage = 0L;
for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage())
- rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage();
+ rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage);
rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage();
}
}
@@ -416,6 +469,7 @@ public class BW_Util {
}
return tmp.toArray(new FluidStack[0]);
}
+
public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){
ArrayList<ItemStack> tmp = new ArrayList<>();
for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){
@@ -424,11 +478,6 @@ public class BW_Util {
return tmp.toArray(new ItemStack[0]);
}
-
- public static Element createNewElement(String variableName, long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope){
- return EnumHelper.addEnum(Element.class,variableName,new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope});
- }
-
public static EnumRarity getRarityFromByte(byte b) {
switch (b) {
case 1:
@@ -442,7 +491,6 @@ public class BW_Util {
}
}
-
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);
}
@@ -561,9 +609,19 @@ public class BW_Util {
}
}
+ private static Block bw_realglasRef;
+
public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) {
- if (block.equals(ItemRegistry.bw_glasses[0]))
+ if (bw_realglasRef == null){
+ try {
+ bw_realglasRef = (Block) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_realglas").get(null);
+ } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (block.equals(bw_realglasRef))
return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4;
if (block.getUnlocalizedName().equals("blockAlloyGlass"))
@@ -738,9 +796,11 @@ public class BW_Util {
break;
}
ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1);
- if (tStack == null) tRemoveRecipe = false;
- else tItemStackMap.put(chr, tStack);
- in = aRecipe[idx + 1] = in.toString();
+ if (tStack == null)
+ tRemoveRecipe = false;
+ else
+ tItemStackMap.put(chr, tStack);
+ aRecipe[idx + 1] = in.toString();
} else if (in instanceof String) {
if (in.equals(OreDictNames.craftingChest.toString()))
tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8));
@@ -810,4 +870,4 @@ public class BW_Util {
return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored);
}
-}
+} \ No newline at end of file
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 ab8eea357d..5d728b8d2a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,7 +23,6 @@
package com.github.bartimaeusnek.bartworks.util;
-import com.github.bartimaeusnek.bartworks.MainMod;
import gregtech.api.interfaces.IColorModulationContainer;
import gregtech.api.util.GT_LanguageManager;
import net.minecraft.item.EnumRarity;
@@ -137,7 +136,7 @@ public class BioCulture extends BioData implements IColorModulationContainer {
public Fluid getFluid() {
if (this.mFluid == null)
- MainMod.LOGGER.error("Fluid has not been set yet! The issuring Culture is: " + this.name);
+ throw new IllegalStateException("Fluid has not been set yet! The issuring Culture is: " + this.name);
return this.mFluid;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java
new file mode 100644
index 0000000000..d18eb37eca
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java
@@ -0,0 +1,68 @@
+/*
+ * 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.bartworks.util;
+
+import gregtech.api.enums.Element;
+import gregtech.api.enums.OrePrefixes;
+import net.minecraftforge.common.util.EnumHelper;
+
+public class EnumUtils {
+ private EnumUtils() {
+ }
+
+ public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost,
+ boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing,
+ boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks,
+ boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable,
+ boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount,
+ int aDefaultStackSize, int aTextureindex) {
+ return EnumHelper.addEnum(OrePrefixes.class, enumName, new Class<?>[]{
+ String.class, String.class, String.class,
+ boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class,
+ boolean.class, int.class, long.class,
+ int.class, int.class
+ }, new Object[]{
+ aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost,
+ aIsUnificatable, aIsMaterialBased, aIsSelfReferencing,
+ aIsContainer, aDontUnificateActively, aIsUsedForBlocks,
+ aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable,
+ aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount,
+ aDefaultStackSize, aTextureindex
+ });
+ }
+
+ public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass,
+ long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) {
+ return EnumHelper.addEnum(Element.class, enumName, new Class[]{
+ long.class, long.class, long.class,
+ long.class, String.class, String.class,
+ boolean.class
+ }, new Object[]{
+ aProtons, aNeutrons, aAdditionalMass,
+ aHalfLifeSeconds, aDecayTo, aName,
+ aIsIsotope
+ });
+ }
+}
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 dfb95c921d..27b2d4cb27 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java
@@ -25,21 +25,102 @@ package com.github.bartimaeusnek.bartworks.util;
/*
* Faster implementations for Math stuff
*/
+@SuppressWarnings("unused")
public class MathUtils {
+
+ public static long floorLong(double x) {
+ if (Double.isInfinite(x) || Double.isNaN(x))
+ return (long) x;
+ long xi = (long) x;
+ return x < xi ? xi - 1 : xi;
+ }
+
+ public static long ceilLong(double x) {
+ if (Double.isInfinite(x) || Double.isNaN(x))
+ return (long) x;
+ long xi = (long) x;
+ return x > xi ? xi + 1 : xi;
+ }
+
+ public static int floorInt(double x) {
+ if (Double.isInfinite(x) || Double.isNaN(x))
+ return (int) x;
+ int xi = (int) x;
+ return x < xi ? xi - 1 : xi;
+ }
+
+ public static int ceilInt(float x) {
+ if (Float.isInfinite(x) || Float.isNaN(x))
+ return (int) x;
+ int xi = (int) x;
+ return x > xi ? xi + 1 : xi;
+ }
+
+ public static int ceilInt(double x) {
+ if (Double.isInfinite(x) || Double.isNaN(x))
+ return (int) x;
+ int xi = (int) x;
+ return x > xi ? xi + 1 : xi;
+ }
+
public static double floor(double x) {
if (Double.isInfinite(x) || Double.isNaN(x))
return x;
- int xi = (int)x;
+ int xi = (int) x;
return x < xi ? xi - 1 : xi;
}
public static double ceil(double x) {
if (Double.isInfinite(x) || Double.isNaN(x))
return x;
- int xi = (int)x;
+ int xi = (int) x;
return x > xi ? xi + 1 : xi;
}
+ public static byte clamp(byte amount, byte min, byte max) {
+ 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;
+ }
+
+ public static int clamp(int amount, int min, int max) {
+ return Math.max(min, Math.min(amount, max));
+ }
+
+ public static long clamp(long amount, long min, long max) {
+ return Math.max(min, Math.min(amount, max));
+ }
+
+ public static float clamp(float amount, float min, float max) {
+ return Math.max(min, Math.min(amount, max));
+ }
+
+ public static double clamp(double amount, double min, double max) {
+ return Math.max(min, Math.min(amount, max));
+ }
+
+ 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;
+ }
+
+ public static int wrap(int input, int bound){
+ return (((input % bound)+bound) % bound);
+ }
+ public static long wrap(long input, long bound){
+ return (((input % bound)+bound) % bound);
+ }
+
+ public static double wrap(double input, double bound){
+ return (((input % bound)+bound) % bound);
+ }
+
+ public static float wrap(float input, float bound){
+ return (((input % bound)+bound) % bound);
+ }
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java
new file mode 100644
index 0000000000..95588a4cf2
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java
@@ -0,0 +1,54 @@
+/*
+ * 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.bartworks.util;
+
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+
+public class MegaUtils {
+
+ public static boolean drainEnergyMegaVanilla(GT_MetaTileEntity_MultiBlockBase multiBlockBase, long aEU) {
+ if (aEU <= 0)
+ return true;
+
+ long allTheEu = 0;
+ int hatches = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches)
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ allTheEu += tHatch.getEUVar();
+ hatches++;
+ }
+
+ if (allTheEu < aEU)
+ return false;
+
+ long euperhatch = aEU / hatches;
+
+ boolean hasDrained = false;
+
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches)
+ hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+
+ return hasDrained && multiBlockBase.mEnergyHatches.size() > 0;
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java
index 4a6b8584dd..3e27fe94c3 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java
@@ -23,6 +23,7 @@
package com.github.bartimaeusnek.bartworks.util.NoiseUtil;
import com.github.bartimaeusnek.bartworks.API.INoiseGen;
+import com.github.bartimaeusnek.bartworks.util.MathUtils;
import gregtech.api.objects.XSTR;
import java.util.Random;
@@ -56,13 +57,6 @@ public class BartsNoise implements INoiseGen {
}
}
- public static double clamp(double input, double lowerBound, double upperBound){
- return Math.min(Math.max(input, lowerBound),upperBound);
- }
- public static double wrap(double input, double bound){
- return (((input % bound)+bound) % bound);
- }
-
public BartsNoise(int octaves, double frequency, double amplitude, long seed) {
this.octaves = octaves;
this.frequency = frequency;
@@ -159,13 +153,13 @@ public class BartsNoise implements INoiseGen {
result = Double.MAX_VALUE;
if (result == Double.NEGATIVE_INFINITY)
result = Double.MIN_VALUE;
- return BartsNoise.wrap(result,1D);
+ return MathUtils.wrap(result,1D);
}
double getNonOctavedNoise(double x, double y){
double phase = SimplexNoise.noise( Math.pow(x*this.frequency,this.amplitude),Math.pow(y*this.frequency,this.amplitude));
- return BartsNoise.wrap(phase,1);
+ return MathUtils.wrap(phase,1);
}
@@ -196,7 +190,7 @@ public class BartsNoise implements INoiseGen {
result += 1d/i * this.getNonOctavedNoise(i * x, y);
}
//result = (this.getNeighbouringNoise(x,y)+result)/2;
- return BartsNoise.wrap(result,1D);
+ return MathUtils.wrap(result,1D);
}
@Override
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 5dcb897da2..9c9e9ebd8d 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
@@ -16,6 +16,8 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil;
*
*/
+import com.github.bartimaeusnek.bartworks.util.MathUtils;
+
public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0),
new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1),
@@ -64,8 +66,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
// This method is a *lot* faster than using (int)Math.floor(x)
private static int fastfloor(double x) {
- int xi = (int)x;
- return x<xi ? xi-1 : xi;
+ return MathUtils.floorInt(x);
}
private static double dot(Grad g, double x, double y) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java
new file mode 100644
index 0000000000..3ea9983d80
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java
@@ -0,0 +1,62 @@
+/*
+ * 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.bartworks.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+public class NonNullWrappedHashMap<K,V> extends HashMap<K,V> {
+
+ private V defaultValue;
+
+ public NonNullWrappedHashMap(int initialCapacity, float loadFactor, V defaultValue) {
+ super(initialCapacity, loadFactor);
+ this.defaultValue = Objects.requireNonNull(defaultValue);
+ }
+
+ public NonNullWrappedHashMap(int initialCapacity, V defaultValue) {
+ super(initialCapacity);
+ this.defaultValue = Objects.requireNonNull(defaultValue);
+ }
+
+ public NonNullWrappedHashMap(V defaultValue) {
+ this.defaultValue = Objects.requireNonNull(defaultValue);
+ }
+
+ public NonNullWrappedHashMap(Map<? extends K, ? extends V> m, V defaultValue) {
+ super(m);
+ this.defaultValue = Objects.requireNonNull(defaultValue);
+ }
+
+ @Override
+ public V get(Object key) {
+ return getOrDefault(key, defaultValue);
+ }
+
+ @Override
+ public V getOrDefault(Object key, V defaultValue) {
+ return Objects.requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue));
+ }
+} \ No newline at end of file
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 4d49e8523f..4cbb55c278 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
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.NotImplementedException;
import java.util.*;
+@SuppressWarnings("ALL")
public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
transient int size = 0;
@@ -36,7 +37,8 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
return new AccessPriorityList();
}
- public AccessPriorityList() {}
+ public AccessPriorityList() {
+ }
@Override
public void addFirst(E t) {
@@ -185,7 +187,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
return true;
}
- private void moveNodeUp(AccessPriorityListNode<E> node){
+ private void moveNodeUp(AccessPriorityListNode<E> node) {
if (node == head || node.getBefore() == null)
return;
final AccessPriorityListNode<E> before = node.getBefore();
@@ -327,18 +329,22 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> {
}
}
- public void addPrioToNode(int index, long prio){
+ public void addPrioToNode(int index, long prio) {
if (!isValidIndex(index))
return;
AccessPriorityListNode<E> node = getNode(index);
- node.setPriority(node.getPriority()+prio);
- while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()){
- moveNodeUp(node);
+ long current = node.getPriority();
+ 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);
}
}
- public void addPrioToNode(int index){
- addPrioToNode(index,1L);
+ public void addPrioToNode(int index) {
+ addPrioToNode(index, 1L);
}
@Override
@@ -376,12 +382,12 @@ 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<>(head, tail, false);
}
@Override
public ListIterator<E> listIterator(int index) {
- return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this,index);
+ return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this, index);
}
@Override
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
new file mode 100644
index 0000000000..3a43bba536
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java
@@ -0,0 +1,157 @@
+/*
+ * 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.bartworks.util.flowerset;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.function.Function;
+
+public class FlowerSet<T> implements Set<T> {
+
+ public FlowerSet(int petals, Function<FlowerNode, Integer> comparerison) {
+ this.petals = petals;
+ this.comparerison = comparerison;
+ }
+
+ final int petals;
+ final Function<FlowerNode, Integer> comparerison;
+
+ public static FlowerSet createBase64(Function<FlowerNode, Integer> comparerison) {
+ return new FlowerSet(64, comparerison);
+ }
+
+ public static FlowerSet createHexflower(Function<FlowerNode, Integer> comparerison) {
+ return new FlowerSet(16, comparerison);
+ }
+
+ @Override
+ public int size() {
+ return 0;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return false;
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return false;
+ }
+
+ @Override
+ public Iterator<T> iterator() {
+ return null;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[0];
+ }
+
+ @Override
+ public <T1> T1[] toArray(T1[] a) {
+ return null;
+ }
+
+ @Override
+ public boolean add(T t) {
+ return false;
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ return false;
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ return false;
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends T> c) {
+ return false;
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ return false;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ return false;
+ }
+
+ @Override
+ public void clear() {
+
+ }
+
+ static class FlowerNode<V> {
+ private final FlowerSet<V> map;
+ final V value;
+ final FlowerNode[] links;
+
+ public FlowerNode(V value, FlowerSet<V> map) {
+ this.value = value;
+ this.map = map;
+ links = new FlowerNode[map.petals];
+ }
+
+ private static final int DEPTH = 20480;
+
+ public void TryToSetSingleNode(FlowerNode node, FlowerNode 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++);
+ }
+
+ public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) {
+ if (node.links[place] == null)
+ node.links[place] = toset;
+ else
+ 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);
+ }
+ }
+ }
+
+ static class Functions {
+ public static Function<FlowerNode, Integer> HashBasedFunction() {
+ return function -> function.hashCode() % function.map.petals;
+ }
+ }
+
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java
index 286d3faa84..1009ed4bc1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -20,7 +20,7 @@
* SOFTWARE.
*/
-package com.github.bartimaeusnek.bartworks.system.log;
+package com.github.bartimaeusnek.bartworks.util.log;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@@ -38,7 +38,8 @@ public class DebugLog {
private static boolean init;
static FileHandler fh;
private static Logger utilLog;
- public DebugLog(FMLPreInitializationEvent event) throws IOException {
+
+ public static void initDebugLog(FMLPreInitializationEvent event) throws IOException {
if (DebugLog.init)
return;
DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString());
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java
index 63f27d299f..8199032651 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -20,17 +20,29 @@
* SOFTWARE.
*/
-package com.github.bartimaeusnek.bartworks.system.log;
-
+package com.github.bartimaeusnek.bartworks.util.log;
+import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.MessageFactory;
+import java.lang.reflect.Field;
+
public class STFUGTPPLOG implements Logger {
+ public static void replaceLogger(){
+ try {
+ Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true);
+ FieldUtils.removeFinalModifier(loggerField, true);
+ loggerField.set(null, new STFUGTPPLOG());
+ } catch (IllegalAccessException | ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
@Override
public void catching(Level level, Throwable t) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java
new file mode 100644
index 0000000000..a8fd428baa
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks util")
+package com.github.bartimaeusnek.bartworks.util;
+
+import com.github.bartimaeusnek.bartworks.API.API_REFERENCE;
+import cpw.mods.fml.common.API; \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
index 953cfa62ad..526a9f6be7 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.crossmod;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat;
import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy;
import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader;
import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
@@ -63,27 +63,27 @@ public class BartWorksCrossmod {
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent preinit) {
-// if (Loader.isModLoaded("appliedenergistics2"))
+// if (LoaderReference.appliedenergistics2)
// new ItemSingleItemStorageCell("singleItemStorageCell");
- if (Loader.isModLoaded("GalacticraftCore"))
+ if (LoaderReference.GalacticraftCore)
GalacticraftProxy.preInit(preinit);
- if (Loader.isModLoaded("Thaumcraft"))
+ if (LoaderReference.Thaumcraft)
new CustomAspects();
}
@Mod.EventHandler
public void init(FMLInitializationEvent init) {
- if (Loader.isModLoaded("GalacticraftCore"))
+ if (LoaderReference.GalacticraftCore)
GalacticraftProxy.init(init);
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent init) {
- if (Loader.isModLoaded("GalacticraftCore"))
+ if (LoaderReference.GalacticraftCore)
GalacticraftProxy.postInit(init);
- if (Loader.isModLoaded("miscutils"))
- new RadioHatchCompat().run();
- if (Loader.isModLoaded("tectech"))
+ if (LoaderReference.miscutils)
+ RadioHatchCompat.run();
+ if (LoaderReference.tectech)
TecTechResearchLoader.runResearches();
}
@@ -97,7 +97,7 @@ public class BartWorksCrossmod {
// @Mod.EventHandler
// public void onServerStarted(FMLServerStartedEvent event) {
-// if (Loader.isModLoaded("EMT")){
+// if (LoaderReference.EMT){
// try {
// TCRecipeHandler.init();
// } catch (IllegalAccessException | InvocationTargetException e) {
@@ -108,7 +108,7 @@ public class BartWorksCrossmod {
@Mod.EventHandler
public void onFMLServerStart(FMLServerStartingEvent event) {
- if (Loader.isModLoaded("miscutils"))
+ if (LoaderReference.miscutils)
for (Object s : RadioHatchCompat.TranslateSet){
StringTranslate.inject(new ReaderInputStream(new StringReader((String) s)));
}
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 11ae398d54..2b46acee0f 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -23,7 +23,7 @@
package com.github.bartimaeusnek.crossmod.GTpp.loader;
import com.github.bartimaeusnek.bartworks.API.IRadMaterial;
-import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
+import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
@@ -39,7 +39,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
@SuppressWarnings({"unchecked","rawtypes","unused"})
-public class RadioHatchCompat implements Runnable {
+public class RadioHatchCompat {
private static Class intf;
private static Class materialClass;
@@ -104,8 +104,7 @@ public class RadioHatchCompat implements Runnable {
}
}
- @Override
- public void run() {
+ public static void run() {
DebugLog.log("Starting Generation of missing GT++ rods/longrods");
try {
Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod");
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java
new file mode 100644
index 0000000000..930360bef4
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java
@@ -0,0 +1,108 @@
+/*
+ * 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.cls;
+
+import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Optional;
+
+@SuppressWarnings({"rawtypes","unchecked"})
+public class CLSCompat {
+ private CLSCompat() {
+ }
+
+ private static Class alexiilMinecraftDisplayer;
+ private static Class alexiilProgressDisplayer;
+ private static Method displayProgress;
+ private static Field isRegisteringBartWorks;
+
+ static {
+ try {
+ alexiilMinecraftDisplayer = Class.forName("alexiil.mods.load.MinecraftDisplayer");
+ alexiilProgressDisplayer = Class.forName("alexiil.mods.load.ProgressDisplayer");
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ Optional.ofNullable(alexiilMinecraftDisplayer).ifPresent(e -> {
+ try {
+ isRegisteringBartWorks = e.getField("isRegisteringBartWorks");
+ } catch (NoSuchFieldException ex) {
+ ex.printStackTrace();
+ }
+ });
+
+ Optional.ofNullable(alexiilProgressDisplayer).ifPresent(e -> {
+ try {
+ displayProgress = e.getMethod("displayProgress", String.class, float.class);
+ } catch (NoSuchMethodException ex) {
+ ex.printStackTrace();
+ }
+ });
+ }
+
+ public static Integer[] initCls() {
+ int sizeStep;
+ int sizeStep2 = 1;
+
+ try {
+ isRegisteringBartWorks.set(null, true);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+
+ if (Werkstoff.werkstoffHashSet.size() >= 100)
+ sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1;
+ else
+ sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size();
+
+ return new Integer[]{sizeStep, sizeStep2, sizeStep};
+ }
+
+ public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) {
+ --steps[0];
+
+ try {
+ displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000);
+ } catch (IllegalAccessException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+
+ if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100)
+ steps[0] = steps[2];
+
+ size += steps[1];
+ return size;
+ }
+
+ public static void disableCls() {
+ try {
+ isRegisteringBartWorks.set(null, false);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..bc81b2026c
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java
@@ -0,0 +1,387 @@
+/*
+ * 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.galacticgreg;
+
+import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space;
+import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space;
+import bloodasp.galacticgreg.GalacticGreg;
+import bloodasp.galacticgreg.api.ModDimensionDef;
+import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space;
+import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space;
+import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
+import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
+import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer;
+import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b;
+import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba;
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.bartimaeusnek.bartworks.util.Pair;
+import com.google.common.collect.ArrayListMultimap;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.ISubTagContainer;
+import gregtech.api.objects.XSTR;
+import gregtech.api.util.GT_LanguageManager;
+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;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.gen.ChunkProviderServer;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.*;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers;
+
+@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),
+ WerkstoffLoader.Krypton.getFluidOrGas(1),
+ WerkstoffLoader.Xenon.getFluidOrGas(1),
+ WerkstoffLoader.Oganesson.getFluidOrGas(1)
+ };
+
+ private HashMap<Pair<Integer,Boolean>, Float> dropmap = null;
+ private float totalWeight;
+ private int multiplier = 1;
+
+ protected byte TIER_MULTIPLIER;
+
+ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) {
+ if (Material instanceof Materials)
+ getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight));
+ else if (Material instanceof Werkstoff)
+ getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff)Material).getmID(),true), weight));
+ }
+
+ static {
+ addMatierialToDimensionList(0, Materials.Tellurium, 8.0f);
+ }
+
+ public GT_TileEntity_VoidMiner_Base(int aID, String aName, String aNameRegional, int tier) {
+ super(aID, aName, aNameRegional);
+ TIER_MULTIPLIER = (byte) Math.max(tier, 1);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setByte("TIER_MULTIPLIER",TIER_MULTIPLIER);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ TIER_MULTIPLIER = aNBT.getByte("TIER_MULTIPLIER");
+ }
+
+ public GT_TileEntity_VoidMiner_Base(String aName, int tier) {
+ super(aName);
+ TIER_MULTIPLIER = (byte) tier;
+ }
+
+ @Override
+ protected int getMinTier() {
+ return this.TIER_MULTIPLIER + 5; //min tier = LuV
+ }
+
+ @Override
+ protected boolean checkHatches() {
+ return true;
+ }
+
+ @Override
+ protected void setElectricityStats() {
+ try {
+ this.mEUt = this.isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[this.getMinTier()]);
+ } catch (ArithmeticException e) {
+ e.printStackTrace();
+ this.mEUt = Integer.MAX_VALUE - 7;
+ }
+ this.mOutputItems = new ItemStack[0];
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 10;
+ this.mEfficiency = this.getCurrentEfficiency(null);
+ this.mEfficiencyIncrease = 10000;
+ this.mEUt = this.mEUt > 0 ? -this.mEUt : this.mEUt;
+ }
+
+ @Override
+ protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) {
+ makeDropMap();
+ handleFluidConsumption();
+ handleOutputs();
+ return true;
+ }
+
+ @Override
+ public String[] getDescription() {
+ String casingName = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(this.getCasingBlockItem().get(1L)));
+ return new String[]{"Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()],
+ "Size(WxHxD): 3x7x3",
+ "Controller (Front middle at bottom)",
+ "3x1x3 Base of " + casingName,
+ "1x3x1 " + casingName + " pillar (Center of base)",
+ "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)",
+ "1x Output Bus (One of base casings)",
+ "Optional: 0+ Input Hatch (One of base casings)",
+ "1x Maintenance Hatch (One of base casings)",
+ "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)",
+ "Consumes " + GT_Values.V[this.getMinTier()] + "EU/t",
+ "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64)",
+ "for higher outputs.",
+ "Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in",
+ StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
+ };
+ }
+
+ public static ArrayListMultimap<Integer, Pair<Pair<Integer, Boolean>, Float>> getExtraDropsDimMap() {
+ return extraDropsDimMap;
+ }
+
+ private Predicate<GT_Worldgen_GT_Ore_Layer> makeOreLayerPredicate() {
+ switch (this.getBaseMetaTileEntity().getWorld().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;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ private Predicate<GT_Worldgen_GT_Ore_SmallPieces> makeSmallOresPredicate() {
+ switch (this.getBaseMetaTileEntity().getWorld().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;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ 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 -> {
+ dropmap.put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight);
+ dropmap.put(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight);
+ dropmap.put(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f));
+ dropmap.put(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f));
+ }
+ );
+ }
+
+ 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 ->
+ dropmap.put(new Pair<>((int) element.mMeta,false), (float) element.mAmount)
+ );
+ }
+
+ private void getDropMapVanilla() {
+ getDropsVanillaVeins(makeOreLayerPredicate());
+ getDropsVanillaSmallOres(makeSmallOresPredicate());
+ }
+
+ private void getDropMapSpace(ModDimensionDef finalDef) {
+ getDropsOreVeinsSpace(finalDef);
+ getDropsSmallOreSpace(finalDef);
+ }
+
+ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) {
+ Set space = 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 -> {
+ dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight);
+ dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight);
+ dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f));
+ dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f));
+ }
+ );
+ }
+
+ 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 ->
+ dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)
+ );
+ }
+
+ private Pair<Integer,Boolean> getOreDamage() {
+ int curentWeight = 0;
+ while (true) {
+ int randomeint = (Math.abs(XSTR.XSTR_INSTANCE.nextInt((int) Math.ceil(totalWeight))));
+ for (Map.Entry<Pair<Integer,Boolean>, Float> entry : dropmap.entrySet()) {
+ curentWeight += entry.getValue();
+ if (randomeint < curentWeight)
+ return entry.getKey();
+ }
+ }
+ }
+
+ private FluidStack getNobleGasInputAndSetMultiplier() {
+ for (FluidStack s : this.getStoredFluids()) {
+ 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)));
+ return s;
+ }
+ }
+ }
+ return null;
+ }
+
+ private boolean consumeNobleGas(FluidStack gasToConsume) {
+ for (FluidStack s : this.getStoredFluids()) {
+ if (s.isFluidEqual(gasToConsume) && s.amount >= 1) {
+ s.amount -= 1;
+ this.updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void handleFluidConsumption() {
+ FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier();
+ if (storedNobleGas == null || !consumeNobleGas(storedNobleGas))
+ multiplier = TIER_MULTIPLIER;
+ }
+
+ private void getDropMapBartworks(ModDimensionDef finalDef, int aID) {
+ Consumer<BW_OreLayer> addToList = makeAddToList();
+ if (aID == ConfigHandler.ross128BID)
+ BW_WorldGenRoss128b.sList.forEach(addToList);
+ else if (aID == ConfigHandler.ross128BAID)
+ BW_WorldGenRoss128ba.sList.forEach(addToList);
+ else {
+ addOresVeinsBartworks(finalDef, addToList);
+ addSmallOresBartworks(finalDef);
+ }
+ }
+
+ private Consumer<BW_OreLayer> makeAddToList() {
+ return element -> {
+ List<Pair<Integer,Boolean>> data = element.getStacksRawData();
+ for (int i = 0; i < data.size(); i++) {
+ if (i < data.size()-1)
+ dropmap.put(data.get(i), (float) element.mWeight);
+ else
+ dropmap.put(data.get(i), (element.mWeight/8f));
+ }
+ };
+ }
+
+ private ModDimensionDef makeModDimDef() {
+ return getModContainers().stream()
+ .flatMap(modContainer -> modContainer.getDimensionList().stream())
+ .filter(modDimensionDef -> modDimensionDef.getChunkProviderName()
+ .equals(((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld().getChunkProvider()).currentChunkProvider.getClass().getName()))
+ .findFirst().orElse(null);
+ }
+
+ private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer<BW_OreLayer> addToList) {
+ try {
+ Set space = 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);
+ } catch (NullPointerException ignored) {}
+ }
+
+ private void addSmallOresBartworks(ModDimensionDef finalDef) {
+ try {
+ Set space = 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 ->
+ dropmap.put(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)
+ );
+ } catch (NullPointerException ignored) {}
+ }
+
+ private void handleExtraDrops(int id) {
+ Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> dropmap.put(f.getKey(), f.getValue())));
+ }
+
+ private void calculateTotalWeight() {
+ totalWeight = 0.0f;
+ dropmap.values().forEach(f -> totalWeight += f);
+ }
+
+ private void handleDimBasedDrops(ModDimensionDef finalDef, int id) {
+ if (id != ConfigHandler.ross128BID && id != ConfigHandler.ross128BAID)
+ getDropMapSpace(finalDef);
+ }
+
+ private void handleModDimDef(int id) {
+ if (id <= 1 && id >= -1)
+ getDropMapVanilla();
+ Optional.ofNullable(makeModDimDef()).ifPresent(def -> {
+ handleDimBasedDrops(def, id);
+ getDropMapBartworks(def, id);
+ });
+ }
+
+ private void calculateDropMap() {
+ dropmap = new HashMap<>();
+ int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId;
+ handleModDimDef(id);
+ handleExtraDrops(id);
+ calculateTotalWeight();
+ }
+
+ private void makeDropMap() {
+ if (dropmap == null || totalWeight == 0)
+ calculateDropMap();
+ }
+
+ private void handleOutputs() {
+ Pair<Integer,Boolean> stats = getOreDamage();
+ this.addOutput(new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()));
+ this.updateSlots();
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java
new file mode 100644
index 0000000000..a5058a34d7
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java
@@ -0,0 +1,124 @@
+/*
+ * 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.galacticgreg;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GT_TileEntity_VoidMiners {
+
+ public static class VMLUV extends GT_TileEntity_VoidMiner_Base {
+
+ public VMLUV(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 1);
+ }
+
+ public VMLUV(String aName, int tier) {
+ super(aName, tier);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_UV;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.Europium;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 8;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new VMLUV(this.mName, this.TIER_MULTIPLIER);
+ }
+ }
+
+ public static class VMZPM extends GT_TileEntity_VoidMiner_Base {
+
+ public VMZPM(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ }
+
+ public VMZPM(String aName, int tier) {
+ super(aName, tier);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_MiningBlackPlutonium;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.BlackPlutonium;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 179;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new VMZPM(this.mName, this.TIER_MULTIPLIER);
+ }
+ }
+
+ public static class VMUV extends GT_TileEntity_VoidMiner_Base {
+
+ public VMUV(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 3);
+ }
+
+ public VMUV(String aName, int tier) {
+ super(aName, tier);
+ }
+
+ @Override
+ protected ItemList getCasingBlockItem() {
+ return ItemList.Casing_MiningNeutronium;
+ }
+
+ @Override
+ protected Materials getFrameMaterial() {
+ return Materials.Neutronium;
+ }
+
+ @Override
+ protected int getCasingTextureIndex() {
+ return 178;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new VMUV(this.mName, this.TIER_MULTIPLIER);
+ }
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java
index 255f83a125..447909e03d 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.crossmod.galacticraft;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba;
import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager;
import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@@ -44,7 +44,7 @@ public class GalacticraftProxy {
}
public static void postInit(FMLPostInitializationEvent e){
- if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) {
+ if (SideReference.Side.Server || SideReference.EffectiveSide.Server) {
GalacticraftProxy.serverPostInit(e);
} else {
GalacticraftProxy.clientPostInit(e);
@@ -53,7 +53,7 @@ public class GalacticraftProxy {
}
public static void preInit(FMLPreInitializationEvent e) {
- if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) {
+ if (SideReference.Side.Server || SideReference.EffectiveSide.Server) {
GalacticraftProxy.serverpreInit(e);
} else {
GalacticraftProxy.clientpreInit(e);
@@ -81,7 +81,7 @@ public class GalacticraftProxy {
}
public static void init(FMLInitializationEvent e) {
- if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) {
+ if (SideReference.Side.Server || SideReference.EffectiveSide.Server) {
GalacticraftProxy.serverInit(e);
} else {
GalacticraftProxy.clientInit(e);
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 372eb2471d..74b0f94a26 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,7 +22,7 @@
package com.github.bartimaeusnek.crossmod.galacticraft;
-import cpw.mods.fml.common.Loader;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import micdoodle8.mods.galacticraft.api.vector.Vector3;
import micdoodle8.mods.galacticraft.api.world.ITeleportType;
import micdoodle8.mods.galacticraft.core.entities.EntityLander;
@@ -71,7 +71,7 @@ public class UniversalTeleportType implements ITeleportType {
}
EntityLanderBase elb;
- if (Loader.isModLoaded("GalacticraftMars"))
+ if (LoaderReference.GalacticraftMars)
elb=PlanetsHelperClass.getLanderType(player);
else
elb = new EntityLander(player);
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 bc33a08855..4bc8f64f10 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,11 +22,11 @@
package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator;
import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
-import cpw.mods.fml.common.Loader;
import gregtech.api.objects.XSTR;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
@@ -83,7 +83,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate {
} else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) {
this.biomesForGeneration[i] = BiomeGenBase.stoneBeach;
}
- if (Loader.isModLoaded("Thaumcraft")) {
+ if (LoaderReference.Thaumcraft) {
if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID))
this.biomesForGeneration[i] = BiomeGenBase.taiga;
else if (ConfigHandler.disableMagicalForest && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID))
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 69e7c3d525..cf4c13f326 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
@@ -39,6 +39,7 @@ import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import java.util.Arrays;
+import java.util.Random;
public class ChunkProviderRoss128ba extends ChunkProviderMoon {
@@ -51,11 +52,11 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
super(world, seed, mapFeaturesEnabled);
this.biomesForGeneration = new BiomeGenBase[]{BiomeGenBaseMoon.moonFlat};
this.caveGenerator = new MapGenCavesMoon();
- this.worldObj=world;
+ this.worldObj = world;
}
public Chunk provideChunk(int cx, int cz) {
- this.rand.setSeed((long)cx * 341873128712L + (long)cz * 132897987541L);
+ this.rand.setSeed((long) cx * 341873128712L + (long) cz * 132897987541L);
Block[] ids = new Block[65536];
byte[] meta = new byte[65536];
Arrays.fill(ids, Blocks.air);
@@ -69,6 +70,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
return Chunk;
}
+ public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {
+ }
+
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
super.populate(par1IChunkProvider, par2, par3);
@@ -82,21 +86,21 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon {
}
final Block lowerBlockID = GCBlocks.blockMoon;
- final BartsNoise noiseGen= new BartsNoise(2,0.008F,1D,System.nanoTime());
- final BartsNoise noiseGen2= new BartsNoise(2,0.01F,1D,System.nanoTime());
- final BartsNoise noiseGen3= new BartsNoise(2,0.002F,1D,System.nanoTime());
+ final BartsNoise noiseGen = new BartsNoise(2, 0.008F, 1D, System.nanoTime());
+ final BartsNoise noiseGen2 = new BartsNoise(2, 0.01F, 1D, System.nanoTime());
+ final BartsNoise noiseGen3 = new BartsNoise(2, 0.002F, 1D, System.nanoTime());
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) {
+ 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 yDev = d*4+d2*2+d3;
+ double yDev = d * 4 + d2 * 2 + d3;
- for(int y = 0; y < 128; ++y) {
- if ((double)y < 60.0D + yDev) {
+ for (int y = 0; y < 128; ++y) {
+ if ((double) 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/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java
index 8ecb971452..c51fe51611 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java
@@ -31,21 +31,22 @@ import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.chunk.IChunkProvider;
-public class WorldProviderRoss128Ba extends AbstractWorldProviderSpace {
+public class WorldProviderRoss128ba extends AbstractWorldProviderSpace {
@Override
public Vector3 getFogColor() {
- return new Vector3(0,0,0);
+ return new Vector3(0, 0, 0);
}
@Override
public Vector3 getSkyColor() {
- return new Vector3(0,0,0);
+ return new Vector3(0, 0, 0);
}
@Override
public long getDayLength() {
- return (long) MathUtils.floor(24000f*9.9f/100f);
+ return MathUtils.floorLong(24000f * 9.9f / 100f);
}
+
@Override
public boolean hasSunset() {
return false;
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 cc3f2a0744..bc47a60f4a 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,12 @@
package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType;
import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b;
-import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba;
-import cpw.mods.fml.common.Loader;
+import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba;
import micdoodle8.mods.galacticraft.api.GalacticraftRegistry;
import micdoodle8.mods.galacticraft.api.galaxies.*;
import micdoodle8.mods.galacticraft.api.vector.Vector3;
@@ -68,16 +68,16 @@ public class Ross128SolarSystem {
Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b);
Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F);
Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png"));
- Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class);
- Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("GalaxySpace") ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3);
+ Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class);
+ Ross128SolarSystem.Ross128ba.setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3);
GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System);
GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b);
GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba);
GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png"));
- GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png"));
+ GalacticraftRegistry.registerRocketGui(WorldProviderRoss128ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png"));
GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType());
- GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType());
+ GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType());
}
}
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 1cfdcf32d6..082b7307d1 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -25,9 +25,9 @@ package com.github.bartimaeusnek.crossmod.openComputers;
import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation;
import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides;
import com.github.bartimaeusnek.bartworks.API.ITileWithGUI;
+import com.github.bartimaeusnek.bartworks.API.SideReference;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Optional;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_Utility;
@@ -77,7 +77,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento
private boolean isServerSide(){
- return !this.worldObj.isRemote || FMLCommonHandler.instance().getSide().isServer();
+ return !this.worldObj.isRemote || SideReference.Side.Server;
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java
new file mode 100644
index 0000000000..9f78d02d5a
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java
@@ -0,0 +1,89 @@
+/*
+ * 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.tectech;
+
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+import java.util.List;
+
+public interface TecTechEnabledMulti {
+
+ List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches();
+
+ List<GT_MetaTileEntity_Hatch_EnergyTunnel> getTecTechEnergyTunnels();
+
+ List<GT_MetaTileEntity_Hatch_EnergyMulti> getTecTechEnergyMultis();
+
+ default long[] getCurrentInfoData() {
+ long storedEnergy = 0, maxEnergy = 0;
+ for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : this.getTecTechEnergyTunnels()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : this.getTecTechEnergyMultis()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+ return new long[]{storedEnergy, maxEnergy};
+ }
+
+ default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) {
+ int mPollutionReduction = 0;
+
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : multiBlockBase.mMufflerHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction);
+ }
+ }
+
+ long[] ttHatches = getCurrentInfoData();
+ long storedEnergy = ttHatches[0];
+ long maxEnergy = ttHatches[1];
+
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+
+ return new String[]{
+ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ + EnumChatFormatting.GREEN + multiBlockBase.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + multiBlockBase.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -multiBlockBase.mEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + multiBlockBase.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"};
+ }
+
+}
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 855c5011a1..c16a042aca 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,7 +22,9 @@
package com.github.bartimaeusnek.crossmod.tectech;
+import com.github.bartimaeusnek.bartworks.API.LoaderReference;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.technus.tectech.recipe.TT_recipeAdder;
import gregtech.api.enums.ItemList;
@@ -31,10 +33,62 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import net.minecraftforge.fluids.FluidStack;
-public class TecTechResearchLoader {
+public class TecTechResearchLoader {
@SuppressWarnings("deprecation")
- public static void runResearches(){
+ public static void runResearches() {
+
+ if (LoaderReference.galacticgreg) {
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(
+ ItemRegistry.voidminer[0].copy(),
+ 1024000,
+ 256,
+ BW_Util.getMachineVoltageFromTier(7),
+ 24,
+ new Object[]{
+ ItemRegistry.voidminer[0].copy(),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L),
+ Materials.BlackPlutonium.getPlates(3),
+ ItemList.Electric_Motor_ZPM.get(9L),
+ ItemList.Sensor_ZPM.get(9L),
+ ItemList.Field_Generator_ZPM.get(9L),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L)
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ WerkstoffLoader.Krypton.getFluidOrGas(20000)
+ },
+ ItemRegistry.voidminer[1].copy(),
+ 216000,
+ BW_Util.getMachineVoltageFromTier(7)
+ );
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(
+ ItemRegistry.voidminer[1].copy(),
+ 8192000,
+ 512,
+ BW_Util.getMachineVoltageFromTier(8),
+ 64,
+ new Object[]{
+ ItemRegistry.voidminer[1].copy(),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L),
+ Materials.Neutronium.getPlates(3),
+ ItemList.Electric_Motor_UV.get(9L),
+ ItemList.Sensor_UV.get(9L),
+ ItemList.Field_Generator_UV.get(9L),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L)
+ },
+ new FluidStack[]{
+ Materials.SolderingAlloy.getMolten(1440),
+ WerkstoffLoader.Oganesson.getFluidOrGas(20000)
+ },
+ ItemRegistry.voidminer[2].copy(),
+ 432000,
+ BW_Util.getMachineVoltageFromTier(8)
+ );
+
+ }
TT_recipeAdder.addResearchableAssemblylineRecipe(
ItemList.Machine_Multi_ImplosionCompressor.get(1L),
@@ -45,9 +99,9 @@ public class TecTechResearchLoader {
new Object[]{
ItemList.Machine_Multi_ImplosionCompressor.get(1L),
Materials.Neutronium.getBlocks(5),
- GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64),
- GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64),
- GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64),
+ GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64),
ItemList.Electric_Piston_UV.get(64),
},
new FluidStack[]{
@@ -83,4 +137,4 @@ public class TecTechResearchLoader {
// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner);
// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine);
}
-}
+} \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java
new file mode 100644
index 0000000000..7759eddfd5
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java
@@ -0,0 +1,148 @@
+/*
+ * 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.tectech;
+
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+
+public class TecTechUtils {
+
+ public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) {
+ if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch))
+ return false;
+ else {
+ GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity();
+
+ if (mte instanceof GT_MetaTileEntity_Hatch_Energy)
+ baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte);
+ else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel)
+ baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte);
+ else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti)
+ baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte);
+ else
+ return false;
+
+ mte.updateTexture(aBaseCasingIndex);
+ return true;
+ }
+ }
+
+ public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) {
+ if (aEU <= 0)
+ return true;
+
+ long allTheEu = 0;
+ int hatches = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches())
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ allTheEu += tHatch.getEUVar();
+ hatches++;
+ }
+
+ for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels())
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ allTheEu += tHatch.getEUVar();
+ hatches++;
+ }
+
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis())
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ allTheEu += tHatch.getEUVar();
+ hatches++;
+ }
+
+ if (allTheEu < aEU)
+ return false;
+
+ long euperhatch = aEU / hatches;
+
+ boolean hasDrained = false;
+
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches())
+ hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+
+ for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels())
+ hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis())
+ hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+
+ return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0);
+ }
+
+ public static long getnominalVoltageTT(TecTechEnabledMulti base) {
+ long rVoltage = 0L;
+ long rAmperage = 0L;
+
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage);
+ rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage();
+ }
+ }
+
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage);
+ rAmperage += tHatch.Amperes;
+ }
+ }
+
+ for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage = Math.max(getEUPerTickFromLaser(tHatch), rVoltage);
+ rAmperage += 1;
+ }
+ }
+
+ return rVoltage * rAmperage;
+ }
+
+ public static long getMaxInputVoltage(TecTechEnabledMulti base) {
+ long rVoltage = 0L;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ rVoltage += getEUPerTickFromLaser(tHatch);
+ }
+ }
+ return rVoltage;
+ }
+
+ public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) {
+ return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20);
+ }
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..e89bff4e00
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java
@@ -0,0 +1,116 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;
+import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
+
+public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel {
+
+ boolean isSender();
+
+ boolean isReceiver();
+
+ boolean isTunnel();
+
+ default boolean isConnectedCorrectly(byte side) {
+ return false;
+ }
+
+ default void setEUVar(long aEnergy) {
+ }
+
+ default long getAMPERES() {
+ return -1;
+ }
+
+ default long maxEUInput() {
+ return -1;
+ }
+
+ default long maxEUOutput() {
+ return -1;
+ }
+
+ default long maxEUStore() {
+ return -1;
+ }
+
+ default long getTotalPower() {
+ return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - (this.getAMPERES() / 20);
+ }
+
+ default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) {
+ byte color = this.getBaseMetaTileEntity().getColorization();
+ if (color >= 0) {
+ byte front = aBaseMetaTileEntity.getFrontFacing();
+ byte opposite = GT_Utility.getOppositeSide(front);
+
+ for (short dist = 1; dist < 250; ++dist) {
+ IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist);
+ if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) {
+ return;
+ }
+
+ IMetaTileEntity aMetaTileEntity = tGTTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return;
+ }
+
+ if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() && opposite == tGTTileEntity.getFrontFacing()) {
+ if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) {
+ aMetaTileEntity.doExplosion(this.maxEUOutput());
+ this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput());
+ return;
+ }
+
+ if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) {
+ long diff = Math.min(this.getAMPERES() * 20L * this.maxEUOutput(), Math.min(((LowPowerLaser) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU()));
+ this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff);
+ ((LowPowerLaser) aMetaTileEntity).setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff);
+ }
+ return;
+ }
+
+
+ if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) {
+ return;
+ }
+
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) {
+ if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) {
+ return;
+ }
+
+ ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed();
+ } else if (aBaseMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) {
+ if (!((LowPowerLaser) aMetaTileEntity).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
new file mode 100644
index 0000000000..1b82aedace
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java
@@ -0,0 +1,148 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+import java.util.Optional;
+
+public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock implements LowPowerLaser {
+
+ protected long AMPERES;
+
+ public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
+ this.AMPERES = aAmperes;
+ }
+
+ public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
+ this.AMPERES = aAmperes;
+ }
+
+ public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ this.AMPERES = aAmperes;
+ }
+
+ public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ this.AMPERES = aAmperes;
+ }
+
+ public long getAMPERES() {
+ return AMPERES;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean shouldJoinIc2Enet() {
+ return true;
+ }
+
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound nbtTagCompound) {
+ Optional.ofNullable(nbtTagCompound).ifPresent(
+ tag -> tag.setLong("AMPERES", AMPERES)
+ );
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound nbtTagCompound) {
+ Optional.ofNullable(nbtTagCompound).ifPresent(
+ tag -> AMPERES = tag.getLong("AMPERES")
+ );
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return GT_Values.V[this.mTier + 1];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512L + GT_Values.V[this.mTier + 1] * 24L * 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
new file mode 100644
index 0000000000..aa88094922
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
@@ -0,0 +1,144 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.util.StatCollector;
+
+public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy {
+
+ public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures);
+ }
+
+ public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aAmperes, 0, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean isSender() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean isReceiver() {
+ return !this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean isTunnel() {
+ return false;
+ }
+
+ public long maxAmperesOut() {
+ return !this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES : 0;
+ }
+
+ public long maxAmperesIn() {
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES + (AMPERES / 4) : 0;
+ }
+
+ public boolean hasAlternativeModeText() {
+ return true;
+ }
+
+ public String getAlternativeModeText() {
+ return isReceiver() ? "Set to receiving mode" : "Set to sending mode";
+ }
+
+ public boolean isEnetInput() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean isEnetOutput() {
+ return !this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canConnect(byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new TT_MetaTileEntity_LowPowerLaserBox(this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork());
+
+ byte Tick = (byte) ((int) (aTick % 20L));
+ if (16 == Tick) {
+ if (aBaseMetaTileEntity.getStoredEU() > 0L) {
+ this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.AMPERES);
+ if (aBaseMetaTileEntity.getStoredEU() < 0L) {
+ this.setEUVar(0L);
+ }
+ }
+ if (this.getBaseMetaTileEntity().isAllowedToWork())
+ if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) {
+ this.moveAroundLowPower(aBaseMetaTileEntity);
+ }
+ }
+ }
+ }
+
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[12][17][];
+
+ for (byte i = -1; i < 16; ++i) {
+ rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]};
+ rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]};
+ rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]};
+ rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]};
+ rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]};
+ rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]};
+ rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]};
+ rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]};
+ rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]};
+ }
+
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1];
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"};
+ }
+}
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
new file mode 100644
index 0000000000..df3cd12773
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
@@ -0,0 +1,95 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoTunnel;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+@SuppressWarnings("deprecation")
+public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel implements LowPowerLaser {
+
+ public TT_MetaTileEntity_LowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) {
+ super(aID, aName, aNameRegional, aTier, aAmp);
+ }
+
+ public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aAmp, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new TT_MetaTileEntity_LowPowerLaserDynamo(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isSender() {
+ return true;
+ }
+
+ @Override
+ public boolean isReceiver() {
+ return false;
+ }
+
+ @Override
+ public boolean isTunnel() {
+ return false;
+ }
+
+ @Override
+ public long getAMPERES() {
+ return this.Amperes;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ this.mDescription,
+ StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t",
+ StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
+ };
+ }
+
+ @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);
+ }
+ }
+ }
+ if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) {
+ this.moveAroundLowPower(aBaseMetaTileEntity);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java
new file mode 100644
index 0000000000..1774fc0966
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java
@@ -0,0 +1,78 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+@SuppressWarnings("deprecation")
+public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel implements LowPowerLaser {
+
+ public TT_MetaTileEntity_LowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) {
+ super(aID, aName, aNameRegional, aTier, aAmp);
+ }
+
+ public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aAmp, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ this.mDescription,
+ StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t",
+ StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
+ };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new TT_MetaTileEntity_LowPowerLaserHatch(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isSender() {
+ return false;
+ }
+
+ @Override
+ public boolean isReceiver() {
+ return true;
+ }
+
+ @Override
+ public boolean isTunnel() {
+ return false;
+ }
+
+ @Override
+ public long getAMPERES() {
+ return this.Amperes;
+ }
+
+}
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
new file mode 100644
index 0000000000..140359c159
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java
@@ -0,0 +1,113 @@
+/*
+ * 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.tectech.tileentites.tiered;
+
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Client;
+import ic2.core.Ic2Items;
+import net.minecraft.block.Block;
+import net.minecraft.util.StatCollector;
+
+public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser {
+
+ public TT_MetaTileEntity_Pipe_Energy_LowPower(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 0.25f, Materials.BorosilicateGlass, 0, 0, 0, false, false);
+ }
+
+ public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new TT_MetaTileEntity_Pipe_Energy_LowPower(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aTick % 20 == 13 && aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) {
+ aBaseMetaTileEntity.issueTextureUpdate();
+ }
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ return new ITexture[]{
+ new GT_CopiedBlockTexture(
+ Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()),
+ aSide,
+ Ic2Items.glassFiberCableBlock.getItemDamage(),
+ Dyes.getModulation(aColorIndex, Dyes._NULL.mRGBa)
+ )
+ };
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Primitive Laser Cable intended for Low Power Applications",
+ "Does not auto-connect",
+ "Does not turn or bend",
+ ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work",
+ StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
+ };
+ }
+
+ @Override
+ public boolean isSender() {
+ return false;
+ }
+
+ @Override
+ public boolean isReceiver() {
+ return false;
+ }
+
+ @Override
+ public boolean isTunnel() {
+ return true;
+ }
+
+ @Override
+ public boolean canConnect(byte b) {
+ return true;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public boolean isConnectedCorrectly(byte aSide) {
+ return this.isConnectedAtSide(aSide) && this.isConnectedAtSide(GT_Utility.getOppositeSide(aSide));
+ }
+}
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 8789ee60d3..872970b2f2 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 bartimaeusnek
+ * 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
@@ -22,12 +22,9 @@
package com.github.bartimaeusnek.crossmod.thaumcraft.util;
-import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
-import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
-import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
-import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
+import com.github.bartimaeusnek.bartworks.API.API_ConfigValues;
import com.github.bartimaeusnek.bartworks.util.Pair;
-import gregtech.api.enums.OrePrefixes;
+import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
import gregtech.api.enums.TC_Aspects;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -36,7 +33,6 @@ import net.minecraft.world.biome.BiomeGenBase;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.Objects;
@SuppressWarnings({"rawtypes","unchecked","unused"})
public class ThaumcraftHandler {
@@ -127,7 +123,7 @@ public class ThaumcraftHandler {
try {
Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance();
for (Pair a : aspectPair) {
- if (ConfigHandler.debugLog)
+ if (API_ConfigValues.debugLog)
DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue());
ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue());
}
@@ -147,23 +143,5 @@ public class ThaumcraftHandler {
e.printStackTrace();
}
}
-
- public static void addAspectToAll(Werkstoff werkstoff){
- for (OrePrefixes element : WerkstoffLoader.ENABLED_ORE_PREFIXES) {
- if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) {
- if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) {
- DebugLog.log("OrePrefix: " + element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L);
- if (Objects.nonNull(WerkstoffLoader.items.get(element)))
- ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L)));
- }
- else if (element.mMaterialAmount >= 0L) {
- if (Objects.nonNull(WerkstoffLoader.items.get(element)))
- ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1));
- }
- }
- }
- }
-
-
}
}
diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang
index 7677ce6751..dfeb3cfd6e 100644
--- a/src/main/resources/assets/bartworks/lang/de_DE.lang
+++ b/src/main/resources/assets/bartworks/lang/de_DE.lang
@@ -105,7 +105,7 @@ tooltip.rotor.0.name=Durchmesser:
tooltip.rotor.1.name=Haltbarkeit:
tooltip.rotor.2.name=Effizienz:
tooltip.teslastaff.0.name=Keine Garantie!
-tooltip.tile.acidgen.0.name=An Acid Generator
+tooltip.tile.acidgen.0.name=Ein Säure Generator
tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials.
tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station
tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled!
@@ -125,7 +125,7 @@ tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks
tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level
tooltip.tile.radhatch.2.name=Material:
tooltip.tile.radhatch.3.name=Sievert:
-tooltip.tile.radhatch.4.name=Amount:
+tooltip.tile.radhatch.4.name=Menge:
tooltip.tile.radhatch.5.name=Time (in t/s/m/h) to decay (1kg):
tooltip.tile.radhatch.6.name=t
tooltip.tile.radhatch.7.name=s
@@ -147,4 +147,9 @@ tooltip.windmeter.4.name=normal zu sein.
tooltip.windmeter.5.name=eher stark zu sein.
tooltip.windmeter.6.name=sehr stark zu sein.
tooltip.windmeter.7.name=zu stark zu sein.
-tooltip.windmeter.8.name=Der Wind hier scheint \ No newline at end of file
+tooltip.windmeter.8.name=Der Wind hier scheint
+
+item.BurnedOutBISOPelletBall.name=Ausgebranntes BISO Kügelchen Ball
+item.BurnedOutBISOPellet.name=Ausgebranntes BISO Kügelchen
+item.BurnedOutTRISOPelletBall.name=Ausgebranntes TRISO Kügelchen Ball
+item.BurnedOutTRISOPellet.name=Ausgebranntes TRISO Kügelchen
diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang
index 92579a6bee..ff7b806fbd 100644
--- a/src/main/resources/assets/bartworks/lang/en_US.lang
+++ b/src/main/resources/assets/bartworks/lang/en_US.lang
@@ -97,10 +97,10 @@ tooltip.labparts.7.name=A DNA Flask containing:
tooltip.labparts.8.name=A Plasmid Cell containing:
tooltip.tile.waterpump.0.name=Produces
-tooltip.tile.waterpump.1.name=L/s Water when fueled.
+tooltip.tile.waterpump.1.name=L/s Water when fueled. Causes 5 Pollution per second.
tooltip.tile.waterpump.2.name=Must be placed on the Ground.
-tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum
+tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum
tooltip.tile.mbf.1.name=Pollution per second
tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest
tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled!
@@ -151,6 +151,11 @@ item.BISOPelletBall.name=BISO pebble ball
item.BISOPellet.name=BISO pebble
item.TRISOPelletCompound.name=TRISO pebble compund
item.BISOPelletCompound.name=BISO pebble compund
+item.BurnedOutBISOPelletBall.name=Burned Out BISO pebble ball
+item.BurnedOutBISOPellet.name=Burned Out BISO pebble
+item.BurnedOutTRISOPelletBall.name=Burned Out TRISO pebble ball
+item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble
+
itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials
tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so!
diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png
index 4237fa0636..9a340eca30 100644
--- a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png
+++ b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png
index f66994bcd2..f66994bcd2 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png
index 1249814be6..1249814be6 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png
index 0bb400b3dc..0bb400b3dc 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png
index e40c597ceb..e40c597ceb 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png
index 2ddabd3331..2ddabd3331 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png
index 617758a4b6..617758a4b6 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png
index a8ab0806e2..a8ab0806e2 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png
index d3f697ab1f..d3f697ab1f 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png
index 543b011c03..543b011c03 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png
index d69e640fb3..d69e640fb3 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png
index 48509772ce..48509772ce 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png
index 93dc271b8e..93dc271b8e 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png
index da2f1deb4a..da2f1deb4a 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png
index 4a7a5b4a3f..4a7a5b4a3f 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png
index fdf64c2958..fdf64c2958 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png
index d4110a3b06..d4110a3b06 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png
index 5622806282..5622806282 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png
index c0b5b0da4d..c0b5b0da4d 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png
index 3c8b4c66d7..3c8b4c66d7 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png
index 036adac6f3..036adac6f3 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png
index ea67c34b23..ea67c34b23 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png
index 1727d6228a..1727d6228a 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png
index 8795c1dacc..8795c1dacc 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png
index f711908135..f711908135 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png
index c69982d8e7..c69982d8e7 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png
index 18eadf45ed..18eadf45ed 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png
index 269de3edb1..269de3edb1 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png
index 198701e1bb..198701e1bb 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png
index 9f050cc629..9f050cc629 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png
index 4969508f31..4969508f31 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png
index c73f1f5320..c73f1f5320 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png
index f9a450ae2d..f9a450ae2d 100644
--- a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png
+++ b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png
new file mode 100644
index 0000000000..573d4b309e
--- /dev/null
+++ b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png
new file mode 100644
index 0000000000..72ba51bbe0
--- /dev/null
+++ b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png
new file mode 100644
index 0000000000..73abda00dd
--- /dev/null
+++ b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png
Binary files differ
diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png
new file mode 100644
index 0000000000..eb5e37eaa1
--- /dev/null
+++ b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png
Binary files differ