From 3997e9f86243bef67175609a6093fe6668cf5ed7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 27 May 2020 12:53:54 +0200 Subject: 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 Co-authored-by: jackowski626 Former-commit-id: 3dce197579f950aa9c2e450e446e03c74b41dc83 --- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 11 +- .../bartworks/API/API_ConfigValues.java | 28 + .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 3 +- .../bartworks/API/AcidGenFuelAdder.java | 14 +- .../bartworks/API/BioObjectAdder.java | 5 +- .../bartworks/API/BioObjectGetter.java | 4 +- .../bartworks/API/BioVatLogicAdder.java | 103 +- .../bartworks/API/LoaderReference.java | 88 ++ .../bartimaeusnek/bartworks/API/SideReference.java | 37 + .../bartworks/API/VoidMinerDropAdder.java | 46 + .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 15 +- .../bartworks/API/WerkstoffAdderRegistry.java | 16 +- .../bartimaeusnek/bartworks/API/package-info.java | 25 + .../github/bartimaeusnek/bartworks/GuiHandler.java | 6 +- .../github/bartimaeusnek/bartworks/MainMod.java | 452 +------- .../client/ClientEventHandler/TooltipCache.java | 5 +- .../client/gui/BW_GUIContainer_Windmill.java | 45 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 2 +- .../client/textures/PrefixTextureLinker.java | 23 +- .../bartworks/common/blocks/BW_Blocks.java | 21 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 14 +- .../common/blocks/BW_TileEntityContainer.java | 21 +- .../bartworks/common/commands/ChangeConfig.java | 3 +- .../common/commands/GetWorkingDirectory.java | 45 + .../bartworks/common/commands/RunGC.java | 45 + .../bartworks/common/configs/ConfigHandler.java | 70 +- .../bartworks/common/loaders/BeforeGTPreload.java | 6 +- .../bartworks/common/loaders/BioCultureLoader.java | 9 +- .../bartworks/common/loaders/BioItemList.java | 7 +- .../bartworks/common/loaders/BioLabLoader.java | 20 +- .../bartworks/common/loaders/BioRecipeLoader.java | 34 +- .../bartworks/common/loaders/FluidLoader.java | 15 +- .../bartworks/common/loaders/GTNHBlocks.java | 44 +- .../bartworks/common/loaders/ItemRegistry.java | 81 +- .../bartworks/common/loaders/LoaderRegistry.java | 33 - .../common/loaders/LocalisationLoader.java | 56 + .../bartworks/common/loaders/RecipeLoader.java | 210 +++- .../common/loaders/RegisterServerCommands.java | 39 + .../common/loaders/StaticRecipeChangeLoaders.java | 559 ++++++++++ .../bartworks/common/net/RendererPacket.java | 6 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 80 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 104 +- .../multis/GT_TileEntity_CrackingDistillTower.java | 4 +- .../tileentities/multis/GT_TileEntity_THTR.java | 61 +- .../multis/GT_TileEntity_Windmill.java | 319 +++--- .../mega/GT_TileEntity_MegaBlastFurnace.java | 442 ++++---- .../mega/GT_TileEntity_MegaDistillTower.java | 12 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 110 +- .../tiered/GT_MetaTileEntity_BioLab.java | 8 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 51 +- .../bartworks/neiHandler/NEIbartworksConfig.java | 79 ++ .../server/EventHandler/ServerEventHandler.java | 6 +- .../server/container/BW_Container_Windmill.java | 40 + .../container/GT_Container_CircuitProgrammer.java | 2 +- .../server/container/GT_Container_RadioHatch.java | 41 + .../bartworks/system/log/DebugLog.java | 68 -- .../bartworks/system/log/STFUGTPPLOG.java | 653 ------------ .../system/material/BW_MetaGenerated_Items.java | 20 +- .../system/material/BW_MetaGenerated_Ores.java | 7 +- .../material/BW_MetaGenerated_SmallOres.java | 4 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 18 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 23 +- .../CircuitGeneration/BW_CircuitsLoader.java | 31 +- .../material/CircuitGeneration/BW_Meta_Items.java | 8 +- .../CircuitGeneration/CircuitImprintLoader.java | 2 +- .../material/GT_Enhancement/BWGTMetaItems.java | 19 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 11 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 95 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 32 +- .../bartworks/system/material/ThreadedLoader.java | 84 -- .../bartworks/system/material/Werkstoff.java | 308 +++--- .../bartworks/system/material/WerkstoffLoader.java | 1077 +++++++++++--------- .../processingLoaders/AdditionalRecipes.java | 276 ++++- .../material/processingLoaders/DownTierLoader.java | 5 +- .../processingLoaders/LoadItemContainers.java | 7 +- .../bartworks/system/oregen/BW_OreLayer.java | 12 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 72 +- .../bartworks/system/worldgen/MapGenRuins.java | 7 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 238 +---- .../bartimaeusnek/bartworks/util/BW_Util.java | 144 ++- .../bartimaeusnek/bartworks/util/BioCulture.java | 5 +- .../bartimaeusnek/bartworks/util/EnumUtils.java | 68 ++ .../bartimaeusnek/bartworks/util/MathUtils.java | 85 +- .../bartimaeusnek/bartworks/util/MegaUtils.java | 54 + .../bartworks/util/NEIbartworksConfig.java | 79 -- .../bartworks/util/NoiseUtil/BartsNoise.java | 14 +- .../bartworks/util/NoiseUtil/SimplexNoise.java | 5 +- .../bartworks/util/NonNullWrappedHashMap.java | 62 ++ .../accessprioritylist/AccessPriorityList.java | 26 +- .../bartworks/util/flowerset/FlowerSet.java | 157 +++ .../bartimaeusnek/bartworks/util/log/DebugLog.java | 69 ++ .../bartworks/util/log/STFUGTPPLOG.java | 665 ++++++++++++ .../bartimaeusnek/bartworks/util/package-info.java | 26 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 24 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 9 +- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 108 ++ .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 387 +++++++ .../galacticgreg/GT_TileEntity_VoidMiners.java | 124 +++ .../crossmod/galacticraft/GalacticraftProxy.java | 10 +- .../galacticraft/UniversalTeleportType.java | 6 +- .../planets/ross128b/ChunkProviderRoss128b.java | 6 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 24 +- .../planets/ross128ba/WorldProviderRoss128Ba.java | 118 --- .../planets/ross128ba/WorldProviderRoss128ba.java | 119 +++ .../solarsystems/Ross128SolarSystem.java | 14 +- .../openComputers/TileEntity_GTDataServer.java | 6 +- .../crossmod/tectech/TecTechEnabledMulti.java | 89 ++ .../crossmod/tectech/TecTechResearchLoader.java | 68 +- .../crossmod/tectech/TecTechUtils.java | 148 +++ .../tectech/tileentites/tiered/LowPowerLaser.java | 116 +++ .../tiered/TT_Abstract_LowPowerLaserThingy.java | 148 +++ .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 144 +++ .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 95 ++ .../TT_MetaTileEntity_LowPowerLaserHatch.java | 78 ++ .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 113 ++ .../thaumcraft/util/ThaumcraftHandler.java | 30 +- 116 files changed, 6746 insertions(+), 3399 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java (limited to 'src/main/java') 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/API/API_ConfigValues.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java new file mode 100644 index 0000000000..3839d28038 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java @@ -0,0 +1,28 @@ +/* + * 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; + +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 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 MaSv = new HashSet<>(); private static final HashMap IsSv = new HashMap<>(); + private static final HashMap IsKg = new HashMap<>(); + private static final HashMap IsColor = new HashMap<>(); public static HashSet getMaSv() { return RadioHatch.MaSv; } + public static HashMap getIsKg() { + return IsKg; + } + public static HashMap getIsSv() { return RadioHatch.IsSv; } - public static void setOverrideSvForMaterial(Materials m, Integer sv) { + public static HashMap 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 toRun = new HashSet<>(); + private static final HashSet 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 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 toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); - HashSet noGas = MainMod.getNoGasItems(toChange); - MainMod.editRecipes(toChange, noGas); - } + if (!disableExtraGasRecipes) + StaticRecipeChangeLoaders.addEBFGasRecipes(); + if (classicMode) - new DownTierLoader().run(); -// removeDuplicateRecipes(