From 4908d5967c3dfeff5616c65144e701859b9e30a2 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Tue, 27 Aug 2024 20:50:30 +0200 Subject: Config/gregtech.cfg (#2939) * first pass on config migration * second pass on config migration * removing bad configs * rename config classes and register them * move debug options to its own debug category * migrate pollution * finish migrating general config * removing useless config * finish GregTech.cfg port to GTNHLib * don't accidentally force panic mode in dev env * typo * defaults are now handled by the confg handler * remove dead config * force config save after defaults are being written * stop messing with the GregTech.cfg externally * removing comments * new underground fluid builder and porting default underground fluids to code * move config handlers of gregtech.cfg in their own package * process MachineStats.cfg * yeeted MaterialProperties.cfg * remove unused compat in GTNH * process OverpoweredStuff.cfg * process Other.cfg * ungregify some config variables * remove unused variables * fix Ids.cfg not being populated * delete duplicate printing of MTE IDs in GT5U clients * bump hodgepodge version to get mod phase timers * process Client.cfg * fix bad category naming * registering all the config handlers in gui * bump GTNHLib version * actually only registering client configs * use proper double arrays now * move GT ore mixes to patternbuilders * dead code * fix multifiles config not being handled properly * import class from NHCore * removing reflection * use enums for registration * yeet config for Asteroid dimensions * remove unused since 2015 enum entry * todo * rework oremix enums * imported dimension data in enums * convert old dirty predicate into proper one * hook gagreg onto the OreMixes enum * finally nuke worldgen.ore.mix config category! * hook gagreg small ores onto the SmallOres enum * imported dim values in enum * fix dirty work around in vm predicate * yeet unused classes * hook GT stones to GTStones enum * yeet all the remaining booleans in the worldgen category * port endasteroids category * port general category * deprecated * yeet unused bw compat * finish worldgen config migration * hardcode config into code * remove not generated config entry * remove Unification.cfg * fix build * migrate oreveins away from config * migrate small ores away from config * delete config parser * forgotten * fix EoH recipe crash in dev * fix GT NEI Ore Plugin config and csv paths * shade opencsv * rewrite csv generator * spotless apply --- src/main/java/gregtech/common/GT_Client.java | 23 +- src/main/java/gregtech/common/GT_Proxy.java | 237 ++----------------- .../gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 71 ++---- .../common/GT_Worldgen_GT_Ore_SmallPieces.java | 64 ++---- .../java/gregtech/common/GT_Worldgen_Stone.java | 38 +-- .../java/gregtech/common/GT_Worldgenerator.java | 34 ++- src/main/java/gregtech/common/OreMixBuilder.java | 86 +++++++ src/main/java/gregtech/common/SmallOreBuilder.java | 60 +++++ src/main/java/gregtech/common/StoneBuilder.java | 66 ++++++ .../config/client/ConfigColorModulation.java | 25 ++ .../common/config/client/ConfigInterface.java | 29 +++ .../common/config/client/ConfigPreference.java | 21 ++ .../common/config/client/ConfigRender.java | 46 ++++ .../gregtech/common/config/client/ConfigWaila.java | 21 ++ .../common/config/gregtech/ConfigDebug.java | 79 +++++++ .../common/config/gregtech/ConfigFeatures.java | 34 +++ .../common/config/gregtech/ConfigGeneral.java | 254 +++++++++++++++++++++ .../common/config/gregtech/ConfigHarvestLevel.java | 28 +++ .../common/config/gregtech/ConfigMachines.java | 147 ++++++++++++ .../config/gregtech/ConfigOreDropBehavior.java | 24 ++ .../common/config/gregtech/ConfigPollution.java | 129 +++++++++++ .../machinestats/ConfigBronzeSolarBoiler.java | 32 +++ .../common/config/machinestats/ConfigMachines.java | 34 +++ .../config/machinestats/ConfigMassFabricator.java | 33 +++ .../ConfigMicrowaveEnergyTransmitter.java | 28 +++ .../machinestats/ConfigSteelSolarBoiler.java | 32 +++ .../config/machinestats/ConfigTeleporter.java | 28 +++ .../common/config/opstuff/ConfigGeneral.java | 48 ++++ .../common/config/other/ConfigGeneral.java | 24 ++ .../common/config/worldgen/ConfigEndAsteroids.java | 33 +++ .../common/config/worldgen/ConfigGeneral.java | 48 ++++ .../common/items/GT_MetaGenerated_Item_01.java | 4 +- .../common/items/GT_MetaGenerated_Tool_01.java | 66 +++--- .../items/behaviors/Behaviour_Spray_Color.java | 10 +- .../boilers/GT_MetaTileEntity_Boiler_Solar.java | 117 +++------- .../GT_MetaTileEntity_Boiler_Solar_Steel.java | 26 +-- .../GT_MetaTileEntity_DieselGenerator.java | 7 +- .../generators/GT_MetaTileEntity_GasTurbine.java | 9 - .../GT_MetaTileEntity_MagicEnergyConverter.java | 7 +- .../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 46 ++-- .../GT_MetaTileEntity_NaquadahReactor.java | 13 +- .../GT_MetaTileEntity_PlasmaGenerator.java | 15 +- .../generators/GT_MetaTileEntity_SteamTurbine.java | 13 +- .../basic/GT_MetaTileEntity_Massfabricator.java | 16 +- ..._MetaTileEntity_MicrowaveEnergyTransmitter.java | 15 +- .../basic/GT_MetaTileEntity_Teleporter.java | 13 +- .../multi/GT_MetaTileEntity_Cleanroom.java | 1 + 47 files changed, 1608 insertions(+), 626 deletions(-) create mode 100644 src/main/java/gregtech/common/OreMixBuilder.java create mode 100644 src/main/java/gregtech/common/SmallOreBuilder.java create mode 100644 src/main/java/gregtech/common/StoneBuilder.java create mode 100644 src/main/java/gregtech/common/config/client/ConfigColorModulation.java create mode 100644 src/main/java/gregtech/common/config/client/ConfigInterface.java create mode 100644 src/main/java/gregtech/common/config/client/ConfigPreference.java create mode 100644 src/main/java/gregtech/common/config/client/ConfigRender.java create mode 100644 src/main/java/gregtech/common/config/client/ConfigWaila.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigDebug.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigFeatures.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigGeneral.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigHarvestLevel.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigMachines.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigOreDropBehavior.java create mode 100644 src/main/java/gregtech/common/config/gregtech/ConfigPollution.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigBronzeSolarBoiler.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigMachines.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigMassFabricator.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigMicrowaveEnergyTransmitter.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigSteelSolarBoiler.java create mode 100644 src/main/java/gregtech/common/config/machinestats/ConfigTeleporter.java create mode 100644 src/main/java/gregtech/common/config/opstuff/ConfigGeneral.java create mode 100644 src/main/java/gregtech/common/config/other/ConfigGeneral.java create mode 100644 src/main/java/gregtech/common/config/worldgen/ConfigEndAsteroids.java create mode 100644 src/main/java/gregtech/common/config/worldgen/ConfigGeneral.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index b93060ba59..cdd21a13d4 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -619,7 +619,7 @@ public class GT_Client extends GT_Proxy implements Runnable { mPollutionRenderer.preLoad(); - mPreference = new GT_ClientPreference(GregTech_API.sClientDataFile); + mPreference = new GT_ClientPreference(); Materials.initClient(); } @@ -650,24 +650,6 @@ public class GT_Client extends GT_Proxy implements Runnable { public void onPostLoad() { super.onPostLoad(); - if (GregTech_API.sClientDataFile.get("debug", "PrintMetaIDs", false)) { - try { - for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { - try { - if (GregTech_API.METATILEENTITIES[i] != null) { - GregTech_API.METATILEENTITIES[i].getStackForm(1L) - .getTooltip(null, true); - GT_Log.out.println("META " + i + " " + GregTech_API.METATILEENTITIES[i].getMetaName()); - } - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } - } - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } - } - // reobf doesn't work with lambda, so this must be a class // noinspection Convert2Lambda ((IReloadableResourceManager) Minecraft.getMinecraft() @@ -825,9 +807,8 @@ public class GT_Client extends GT_Proxy implements Runnable { @SubscribeEvent public void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent e) { if (GregTech.ID.equals(e.modID) && "client".equals(e.configID)) { - GregTech_API.sClientDataFile.mConfig.save(); // refresh client preference and send to server, since it's the only config we allow changing at runtime. - mPreference = new GT_ClientPreference(GregTech_API.sClientDataFile); + mPreference = new GT_ClientPreference(); GT_PreLoad.loadClientConfig(); if (e.isWorldRunning) GT_Values.NW.sendToServer(new GT_Packet_ClientPreference(mPreference)); } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index b6eb9ec3ad..85978e4c20 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -18,17 +18,16 @@ import static gregtech.api.enums.Mods.Forestry; import static gregtech.api.enums.Mods.GTPlusPlus; import static gregtech.api.enums.Mods.GalacticraftCore; import static gregtech.api.enums.Mods.GalaxySpace; -import static gregtech.api.enums.Mods.GanysSurface; import static gregtech.api.enums.Mods.GraviSuite; import static gregtech.api.enums.Mods.GregTech; import static gregtech.api.enums.Mods.IguanaTweaksTinkerConstruct; -import static gregtech.api.enums.Mods.MagicalCrops; import static gregtech.api.enums.Mods.Names; import static gregtech.api.enums.Mods.Railcraft; import static gregtech.api.enums.Mods.TaintedMagic; import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.enums.Mods.ThaumicBoots; import static gregtech.api.enums.Mods.ThaumicTinkerer; +import static gregtech.api.enums.Mods.TinkerConstruct; import static gregtech.api.enums.Mods.TwilightForest; import static gregtech.api.enums.Mods.WitchingGadgets; import static gregtech.api.recipe.RecipeMaps.crackingRecipes; @@ -120,11 +119,11 @@ import cpw.mods.fml.common.network.FMLNetworkEvent; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.FluidState; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.enums.ManualOreDictTweaks; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.OrePrefixes; @@ -166,6 +165,7 @@ import gregtech.api.util.GT_Shaped_Recipe; import gregtech.api.util.GT_Shapeless_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; +import gregtech.common.config.opstuff.ConfigGeneral; import gregtech.common.items.GT_MetaGenerated_Item_98; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.ID_MetaTool_01; @@ -543,7 +543,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public final GT_BlockMap mCTMBlockCache = new GT_BlockMap<>(); public boolean mDisableVanillaOres = true; public boolean mAllowSmallBoilerAutomation = false; - public boolean mSortToTheEnd = true; public boolean mCraftingUnification = true; public boolean mInventoryUnification = true; public boolean mIncreaseDungeonLoot = true; @@ -551,7 +550,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public boolean mSurvivalIntoAdventure = false; public boolean mNerfedWoodPlank = true; public boolean mNerfedVanillaTools = true; - public boolean mHardRock = false; public boolean mHungerEffect = true; public boolean mIgnoreTcon = true; public boolean mAchievements = true; @@ -563,8 +561,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public boolean mHideUnusedOres = true; public boolean mPollution = true; public boolean mExplosionItemDrop = false; - public boolean mUseGreatlyShrukenReplacementList = true; - public int mSkeletonsShootGTArrows = 16; public int mMaxEqualEntitiesAtOneSpot = 3; public int mFlintChance = 30; public int mItemDespawnTime = 6000; @@ -572,7 +568,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public int[] mHarvestLevel = new int[1000]; public int mGraniteHavestLevel = 3; public int mMaxHarvestLevel = 7; - public int mWireHeatingTicks = 4; public double replicatorExponent = 1.2D; public int mPollutionSmogLimit = 550000; public int mPollutionPoisonLimit = 750000; @@ -608,11 +603,9 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public boolean mEnableAllMaterials = false; public boolean mEnableCleanroom = true; public boolean mLowGravProcessing = false; - public boolean mAprilFool = false; public boolean mCropNeedBlock = true; public boolean mAMHInteraction = true; public boolean mForceFreeFace = true; - public boolean mBrickedBlastFurnace = true; public boolean mMixedOreOnlyYieldsTwoThirdsOfPureOre = false; public boolean mRichOreYieldMultiplier = true; public boolean mNetherOreYieldMultiplier = true; @@ -735,10 +728,8 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public boolean mWailaTransformerVoltageTier = true; /** - * What is the order of the circuits when they are selected? + * This enables showing the cpu load in nanoseconds via waila. */ - public Map mCircuitsOrder = new HashMap<>(); - public boolean wailaAverageNS = false; public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15 @@ -834,9 +825,8 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { GT_Log.ore.println("GT_Mod: Preload-Phase started!"); GregTech_API.sPreloadStarted = true; - this.mIgnoreTcon = GregTech_API.sOPStuff.get(ConfigCategories.general, "ignoreTConstruct", true); - this.mWireHeatingTicks = GregTech_API.sOPStuff.get(ConfigCategories.general, "WireHeatingTicks", 4); - this.replicatorExponent = GregTech_API.sOPStuff.get("Replicator", "Nerf Exponent", 1.2D); + this.mIgnoreTcon = ConfigGeneral.ignoreTinkerConstruct; + this.replicatorExponent = ConfigGeneral.replicatorExponent; for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry .getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { @@ -1070,19 +1060,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { public void onLoad() { GT_Log.out.println("GT_Mod: Beginning Load-Phase."); GT_Log.ore.println("GT_Mod: Beginning Load-Phase."); - if (MagicalCrops.isModLoaded()) { - GT_OreDictUnificator.registerOre( - "cropChilipepper", - GT_ModHandler.getModItem(MagicalCrops.ID, "magicalcrops_CropProduce", 1L, 2)); - GT_OreDictUnificator.registerOre( - "cropTomato", - GT_ModHandler.getModItem(MagicalCrops.ID, "magicalcrops_CropProduce", 1L, 8)); - GT_OreDictUnificator - .registerOre("cropGrape", GT_ModHandler.getModItem(MagicalCrops.ID, "magicalcrops_CropProduce", 1L, 4)); - } - if (GanysSurface.isModLoaded()) { - GT_OreDictUnificator.registerOre("cropTea", GT_ModHandler.getModItem(GanysSurface.ID, "teaLeaves", 1L, 0)); - } // Clay buckets, which don't get registered until Iguana Tweaks pre-init if (IguanaTweaksTinkerConstruct.isModLoaded()) { @@ -1283,7 +1260,7 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { for (; i < GregTech_API.METATILEENTITIES.length; i++) { if (GregTech_API.METATILEENTITIES[i] != null) { - GregTech_API.METATILEENTITIES[i].onConfigLoad(GregTech_API.sMachineFile); + GregTech_API.METATILEENTITIES[i].onConfigLoad(); } } } @@ -1719,17 +1696,10 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { } try { aEvent.Ore.stackSize = 1; - if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName() - .startsWith("item.oreberry")) { - if ((aOriginalMod.toLowerCase(Locale.ENGLISH) - .contains("xycraft")) - || (aOriginalMod.toLowerCase(Locale.ENGLISH) - .contains("tconstruct"))) { - if (GT_Values.D1) { - GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P"); - } - return; - } + + // skipping TinkerConstruct ore registration + if (this.mIgnoreTcon && aOriginalMod.equals(TinkerConstruct.ID)) { + return; } String tModToName = aMod + " -> " + aEvent.Name; if (this.mOreDictActivated || GregTech_API.sPostloadStarted || GregTech_API.sLoadFinished) { @@ -2743,8 +2713,6 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { } public void registerUnificationEntries() { - GregTech_API.sUnification.mConfig.save(); - GregTech_API.sUnification.mConfig.load(); GT_OreDictUnificator.resetUnificationEntries(); for (OreDictEventContainer tOre : this.mEvents) { if ((!(tOre.mEvent.Ore.getItem() instanceof GT_MetaGenerated_Item)) && (tOre.mPrefix != null) @@ -2753,166 +2721,17 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { boolean checkModID = tOre.mModID != null; if (checkModID) { - switch (tOre.mModID) { - case Names.ENDER_I_O -> { - if (tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.DarkSteel) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } - } - case Names.THERMAL_FONDATION -> { - if (tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Blizz) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Pyrotheum) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } - } - case Names.ARS_MAGICA2 -> { - if (tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.Vinteum) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.BlueTopaz) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Chimerite) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Moonstone) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.Sunstone) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } - } - case Names.ROTARY_CRAFT -> { - if (tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.HSLA) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } - } - case Names.APPLIED_ENERGISTICS2 -> { - if (tOre.mPrefix == OrePrefixes.gem && tOre.mMaterial == Materials.CertusQuartz) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } else if (tOre.mPrefix == OrePrefixes.dust && tOre.mMaterial == Materials.CertusQuartz) { - GT_OreDictUnificator - .addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); - GT_OreDictUnificator.set( - tOre.mPrefix, - tOre.mMaterial, - tOre.mEvent.Ore, - (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - true)), - true); - continue; - } + if (tOre.mModID.equals(Names.ENDER_I_O)) { + if (tOre.mPrefix == OrePrefixes.ingot && tOre.mMaterial == Materials.DarkSteel) { + GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false); + GT_OreDictUnificator.set( + tOre.mPrefix, + tOre.mMaterial, + tOre.mEvent.Ore, + ManualOreDictTweaks.shouldOredictBeOverwritten(tOre.mModID, tOre.mEvent.Name), + true); + continue; } - default -> {} } } if (GT_OreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) { @@ -2923,10 +2742,7 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, - (checkModID) && (GregTech_API.sUnification.get( - ConfigCategories.specialunificationtargets + "." + tOre.mModID, - tOre.mEvent.Name, - false)), + checkModID && ManualOreDictTweaks.shouldOredictBeOverwritten(tOre.mModID, tOre.mEvent.Name), true); } } @@ -2944,18 +2760,13 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler { tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, - (tOre.mModID != null) && (GregTech_API.sUnification.get( - new StringBuilder().append(ConfigCategories.specialunificationtargets) - .append(".") - .append(tOre.mModID), - tOre.mEvent.Name, - false)), + (tOre.mModID != null) + && ManualOreDictTweaks.shouldOredictBeOverwritten(tOre.mModID, tOre.mEvent.Name), true); } } } GregTech_API.sUnificationEntriesRegistered = true; - GregTech_API.sUnification.mConfig.save(); GT_Recipe.reInit(); } diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 23bf149b9c..718b682916 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -17,8 +17,8 @@ import net.minecraft.world.WorldProviderHell; import net.minecraft.world.WorldProviderSurface; import net.minecraft.world.chunk.IChunkProvider; +import bloodasp.galacticgreg.api.enums.DimensionDef; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; @@ -36,76 +36,45 @@ public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { public final short mSecondaryMeta; public final short mBetweenMeta; public final short mSporadicMeta; - // public final String mBiome; public final String mRestrictBiome; public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; public final boolean mEndAsteroid; + public final boolean twilightForest; public static final int WRONG_BIOME = 0; public static final int WRONG_DIMENSION = 1; public static final int NO_ORE_IN_BOTTOM_LAYER = 2; public static final int NO_OVERLAP = 3; public static final int ORE_PLACED = 4; public static final int NO_OVERLAP_AIR_BLOCK = 5; - - public final boolean mMoon = false, mMars = false, mAsteroid = false; public final String aTextWorldgen = "worldgen."; public Class[] mAllowedProviders; - @Deprecated - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, - boolean GC_UNUSED3, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { - this( - aName, - aDefault, - aMinY, - aMaxY, - aWeight, - aDensity, - aSize, - aOverworld, - aNether, - aEnd, - aPrimary, - aSecondary, - aBetween, - aSporadic); - } - - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, - Materials aBetween, Materials aSporadic) { - super(aName, sList, aDefault); - this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); - this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); - this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); - this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); + public GT_Worldgen_GT_Ore_Layer(OreMixBuilder mix) { + super(mix.oreMixName, sList, mix.enabledByDefault); + this.mOverworld = mix.dimsEnabled.getOrDefault(OreMixBuilder.OW, false); + this.mNether = mix.dimsEnabled.getOrDefault(OreMixBuilder.NETHER, false); + this.mEnd = mix.dimsEnabled.getOrDefault(OreMixBuilder.THE_END, false); + this.mEndAsteroid = mix.dimsEnabled + .getOrDefault(DimensionDef.EndAsteroids.modDimensionDef.getDimensionName(), false); + this.twilightForest = mix.dimsEnabled.getOrDefault(OreMixBuilder.TWILIGHT_FOREST, false); + this.mMinY = ((short) mix.minY); + short mMaxY = ((short) mix.maxY); if (mMaxY < (this.mMinY + 9)) { GT_Log.out.println("Oremix " + this.mWorldGenName + " has invalid Min/Max heights!"); mMaxY = (short) (this.mMinY + 9); } this.mMaxY = mMaxY; - this.mWeight = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math - .max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); - this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); - this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); - this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mRestrictBiome = GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + this.mWeight = (short) mix.weight; + this.mDensity = (short) mix.density; + this.mSize = (short) Math.max(1, mix.size); + this.mPrimaryMeta = (short) mix.primary.mMetaItemSubID; + this.mSecondaryMeta = (short) mix.secondary.mMetaItemSubID; + this.mBetweenMeta = (short) mix.between.mMetaItemSubID; + this.mSporadicMeta = (short) mix.sporadic.mMetaItemSubID; + this.mRestrictBiome = "None"; if (this.mEnabled) { sWeight += this.mWeight; diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index f1e0c92703..ef01c2ea0f 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -13,7 +13,6 @@ import net.minecraft.world.WorldProviderSurface; import net.minecraft.world.chunk.IChunkProvider; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; @@ -27,63 +26,26 @@ public class GT_Worldgen_GT_Ore_SmallPieces extends GT_Worldgen { public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; - public final boolean mMoon = false, mMars = false, mAsteroid = false; + public final boolean twilightForest; public final String mBiome; - public final String aTextWorldgen = "worldgen."; public static ArrayList sList = new ArrayList<>(); public Class[] mAllowedProviders; - // TODO CHECK IF INSTANTIATION IS CORRECT - public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, - boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { - super(aName, GregTech_API.sWorldgenList, aDefault); - this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); - this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); - this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max( - this.mMinY + 1, - GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mAmount = ((short) Math - .max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); - this.mMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); - this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - sList.add(this); + public GT_Worldgen_GT_Ore_SmallPieces(SmallOreBuilder ore) { + super(ore.smallOreName, GregTech_API.sWorldgenList, ore.enabledByDefault); + this.mOverworld = ore.dimsEnabled.getOrDefault(SmallOreBuilder.OW, false); + this.mNether = ore.dimsEnabled.getOrDefault(SmallOreBuilder.NETHER, false); + this.mEnd = ore.dimsEnabled.getOrDefault(SmallOreBuilder.THE_END, false); + this.twilightForest = ore.dimsEnabled.getOrDefault(SmallOreBuilder.TWILIGHT_FOREST, false); - List allowedProviders = new ArrayList<>(); - if (this.mNether) { - allowedProviders.add(WorldProviderHell.class); - } - - if (this.mOverworld) { - allowedProviders.add(WorldProviderSurface.class); - } - - if (this.mEnd) { - allowedProviders.add(WorldProviderEnd.class); - } - mAllowedProviders = allowedProviders.toArray(new Class[allowedProviders.size()]); - } + this.mMinY = (short) ore.minY; + this.mMaxY = (short) Math.max(this.mMinY + 1, ore.maxY); + this.mAmount = (short) Math.max(1, ore.amount); + this.mMeta = (short) ore.ore.mMetaItemSubID; + this.mBiome = "None"; - public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, - boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, - Materials aPrimary) { - super(aName, GregTech_API.sWorldgenList, aDefault); - this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); - this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); - this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max( - this.mMinY + 1, - GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mAmount = ((short) Math - .max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); - this.mMeta = ((short) GregTech_API.sWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); - this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - sList.add(this); + if (this.mEnabled) sList.add(this); List allowedProviders = new ArrayList<>(); if (this.mNether) { diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index a9001d3f26..97621865bc 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -16,11 +16,11 @@ import net.minecraft.world.chunk.IChunkProvider; import gregtech.api.GregTech_API; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; -import gregtech.api.world.GT_Worldgen_Ore; +import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; -public class GT_Worldgen_Stone extends GT_Worldgen_Ore { +public class GT_Worldgen_Stone extends GT_Worldgen { static final double[] sizeConversion = { 1, 1, 1.333333, 1.333333, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; // Bias // the @@ -36,6 +36,12 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { // or // sills. + public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType; + public final Block mBlock; + public final Collection mBiomeList; + public final boolean mAllowToGenerateinVoid; + private final String aTextWorldgen = "worldgen."; + public Hashtable validStoneSeeds = new Hashtable<>(1024); static class StoneSeeds { @@ -58,22 +64,18 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { } } - public GT_Worldgen_Stone(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, - boolean aAllowToGenerateinVoid) { - super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); + public GT_Worldgen_Stone(StoneBuilder stone) { + super(stone.stoneName, GregTech_API.sWorldgenList, stone.enabledByDefault); + mDimensionType = stone.dimension; + mBlock = stone.block; + mBlockMeta = Math.min(Math.max(stone.blockMeta, 0), 15); + mProbability = stone.probability; + mAmount = stone.amount; + mSize = stone.size; + mMinY = stone.minY; + mMaxY = stone.maxY; + mBiomeList = new ArrayList<>(); + mAllowToGenerateinVoid = stone.allowToGenerateInVoid; } @Override diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 7357f42446..68ce3e4d82 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -34,6 +34,7 @@ import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; +import gregtech.common.config.worldgen.ConfigEndAsteroids; public class GT_Worldgenerator implements IWorldGenerator { @@ -47,30 +48,27 @@ public class GT_Worldgenerator implements IWorldGenerator { // This is probably not going to work. Trying to create a fake orevein to put into hashtable when there will be no // ores in a vein. public static GT_Worldgen_GT_Ore_Layer noOresInVein = new GT_Worldgen_GT_Ore_Layer( - "NoOresInVein", - false, - 0, - 255, - 0, - 255, - 16, - false, - false, - false, - Materials.Aluminium, - Materials.Aluminium, - Materials.Aluminium, - Materials.Aluminium); + new OreMixBuilder().name("NoOresInVein") + .disabledByDefault() + .heightRange(0, 255) + .weight(0) + .density(255) + .size(16) + .primary(Materials.Aluminium) + .secondary(Materials.Aluminium) + .inBetween(Materials.Aluminium) + .sporadic(Materials.Aluminium)); + public static Hashtable validOreveins = new Hashtable<>(1024); public boolean mIsGenerating = false; public static final Object listLock = new Object(); public static OregenPattern oregenPattern = OregenPattern.AXISSYMMETRICAL; public GT_Worldgenerator() { - endAsteroids = GregTech_API.sWorldgenFile.get("endasteroids", "GenerateAsteroids", true); - endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50); - endMaxSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMaxSize", 200); - mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300); + endAsteroids = ConfigEndAsteroids.generateEndAsteroids; + endMinSize = ConfigEndAsteroids.EndAsteroidMinSize; + endMaxSize = ConfigEndAsteroids.EndAsteroidMaxSize; + mEndAsteroidProbability = ConfigEndAsteroids.EndAsteroidProbability; GameRegistry.registerWorldGenerator(this, 1073741823); if (debugWorldGen) { GT_Log.out.println("GT_Worldgenerator created"); diff --git a/src/main/java/gregtech/common/OreMixBuilder.java b/src/main/java/gregtech/common/OreMixBuilder.java new file mode 100644 index 0000000000..2a78f516a0 --- /dev/null +++ b/src/main/java/gregtech/common/OreMixBuilder.java @@ -0,0 +1,86 @@ +package gregtech.common; + +import java.util.HashMap; +import java.util.Map; + +import bloodasp.galacticgreg.api.enums.DimensionDef; +import gregtech.api.enums.Materials; + +public class OreMixBuilder { + + public static final String OW = "Overworld"; + public static final String NETHER = "Nether"; + public static final String THE_END = "TheEnd"; + public static final String TWILIGHT_FOREST = "Twilight Forest"; + public String oreMixName; + public boolean enabledByDefault = true; + public Map dimsEnabled = new HashMap<>(); + public int minY, maxY, weight, density, size; + public Materials primary, secondary, between, sporadic; + + public OreMixBuilder name(String name) { + this.oreMixName = name; + return this; + } + + public OreMixBuilder disabledByDefault() { + this.enabledByDefault = false; + return this; + } + + public OreMixBuilder enableInDim(DimensionDef... dims) { + for (DimensionDef dim : dims) { + this.dimsEnabled.put(dim.modDimensionDef.getDimensionName(), true); + } + return this; + } + + public OreMixBuilder enableInDim(String... dims) { + for (String dim : dims) { + this.dimsEnabled.put(dim, true); + } + return this; + } + + public OreMixBuilder heightRange(int minY, int maxY) { + this.minY = minY; + this.maxY = maxY; + return this; + } + + public OreMixBuilder density(int density) { + this.density = density; + return this; + } + + public OreMixBuilder weight(int weight) { + this.weight = weight; + return this; + } + + public OreMixBuilder size(int size) { + this.size = size; + return this; + } + + public OreMixBuilder primary(Materials primary) { + this.primary = primary; + return this; + } + + public OreMixBuilder secondary(Materials secondary) { + this.secondary = secondary; + return this; + } + + public OreMixBuilder inBetween(Materials between) { + this.between = between; + return this; + } + + public OreMixBuilder sporadic(Materials sporadic) { + this.sporadic = sporadic; + return this; + } + +} diff --git a/src/main/java/gregtech/common/SmallOreBuilder.java b/src/main/java/gregtech/common/SmallOreBuilder.java new file mode 100644 index 0000000000..e9a68e7caf --- /dev/null +++ b/src/main/java/gregtech/common/SmallOreBuilder.java @@ -0,0 +1,60 @@ +package gregtech.common; + +import java.util.HashMap; +import java.util.Map; + +import bloodasp.galacticgreg.api.enums.DimensionDef; +import gregtech.api.enums.Materials; + +public class SmallOreBuilder { + + public static final String OW = "Overworld"; + public static final String NETHER = "Nether"; + public static final String THE_END = "TheEnd"; + public static final String TWILIGHT_FOREST = "Twilight Forest"; + public String smallOreName; + public boolean enabledByDefault = true; + public Map dimsEnabled = new HashMap<>(); + public int minY, maxY, amount; + public Materials ore; + + public SmallOreBuilder name(String name) { + this.smallOreName = name; + return this; + } + + public SmallOreBuilder disabledByDefault() { + this.enabledByDefault = false; + return this; + } + + public SmallOreBuilder enableInDim(DimensionDef... dims) { + for (DimensionDef dim : dims) { + this.dimsEnabled.put(dim.modDimensionDef.getDimensionName(), true); + } + return this; + } + + public SmallOreBuilder enableInDim(String... dims) { + for (String dim : dims) { + this.dimsEnabled.put(dim, true); + } + return this; + } + + public SmallOreBuilder heightRange(int minY, int maxY) { + this.minY = minY; + this.maxY = maxY; + return this; + } + + public SmallOreBuilder amount(int amount) { + this.amount = amount; + return this; + } + + public SmallOreBuilder ore(Materials ore) { + this.ore = ore; + return this; + } +} diff --git a/src/main/java/gregtech/common/StoneBuilder.java b/src/main/java/gregtech/common/StoneBuilder.java new file mode 100644 index 0000000000..3ab32937a6 --- /dev/null +++ b/src/main/java/gregtech/common/StoneBuilder.java @@ -0,0 +1,66 @@ +package gregtech.common; + +import net.minecraft.block.Block; + +public class StoneBuilder { + + public String stoneName; + public Block block; + public int blockMeta; + public int dimension; + public int minY, maxY; + public int amount, size, probability; + public boolean enabledByDefault = true; + public boolean allowToGenerateInVoid; + + public StoneBuilder name(String name) { + this.stoneName = name; + return this; + } + + public StoneBuilder block(Block block) { + this.block = block; + return this; + } + + public StoneBuilder blockMeta(int blockMeta) { + this.blockMeta = blockMeta; + return this; + } + + public StoneBuilder disabledByDefault() { + this.enabledByDefault = false; + return this; + } + + public StoneBuilder generationInVoidEnabled(boolean allowToGenerateInVoid) { + this.allowToGenerateInVoid = allowToGenerateInVoid; + return this; + } + + public StoneBuilder heightRange(int minY, int maxY) { + this.minY = minY; + this.maxY = maxY; + return this; + } + + public StoneBuilder amount(int amount) { + this.amount = amount; + return this; + } + + public StoneBuilder size(int size) { + this.size = size; + return this; + } + + public StoneBuilder probability(int probability) { + this.probability = probability; + return this; + } + + public StoneBuilder dimension(int dimension) { + this.dimension = dimension; + return this; + } +} diff --git a/src/main/java/gregtech/common/config/client/ConfigColorModulation.java b/src/main/java/gregtech/common/config/client/ConfigColorModulation.java new file mode 100644 index 0000000000..f5b189136e --- /dev/null +++ b/src/main/java/gregtech/common/config/client/ConfigColorModulation.java @@ -0,0 +1,25 @@ +package gregtech.common.config.client; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "color_modulation", + configSubDirectory = "GregTech", + filename = "Client") +public class ConfigColorModulation { + + @Config.Comment("hex value for the cable insulation color modulation.") + @Config.DefaultString("#404040") + public static String cableInsulation; + + @Config.Comment("hex value for the construction foam color modulation.") + @Config.DefaultString("#404040") + public static String constructionFoam; + + @Config.Comment("hex value for the machine metal color modulation.") + @Config.DefaultString("#D2DCFF") + public static String machineMetal; +} diff --git a/src/main/java/gregtech/common/config/client/ConfigInterface.java b/src/main/java/gregtech/common/config/client/ConfigInterface.java new file mode 100644 index 0000000000..261be6f51c --- /dev/null +++ b/src/main/java/gregtech/common/config/client/ConfigInterface.java @@ -0,0 +1,29 @@ +package gregtech.common.config.client; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "interface", configSubDirectory = "GregTech", filename = "Client") +public class ConfigInterface { + + @Config.Comment("if true, makes cover tabs visible on GregTech machines.") + @Config.DefaultBoolean(true) + public static boolean coverTabsVisible; + + @Config.Comment("if true, puts the cover tabs display on the right of the UI instead of the left.") + @Config.DefaultBoolean(false) + public static boolean coverTabsFlipped; + + @Config.Comment("How verbose should tooltips be? 0: disabled, 1: one-line, 2: normal, 3+: extended.") + @Config.DefaultInt(2) + public static int tooltipVerbosity; + + @Config.Comment("How verbose should tooltips be when LSHIFT is held? 0: disabled, 1: one-line, 2: normal, 3+: extended.") + @Config.DefaultInt(3) + public static int tooltipShiftVerbosity; + + @Config.Comment("Which style to use for title tab on machine GUI? 0: text tab split-dark, 1: text tab unified, 2: item icon tab.") + @Config.DefaultInt(0) + public static int titleTabStyle; +} diff --git a/src/main/java/gregtech/common/config/client/ConfigPreference.java b/src/main/java/gregtech/common/config/client/ConfigPreference.java new file mode 100644 index 0000000000..f69ee8b890 --- /dev/null +++ b/src/main/java/gregtech/common/config/client/ConfigPreference.java @@ -0,0 +1,21 @@ +package gregtech.common.config.client; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "preference", configSubDirectory = "GregTech", filename = "Client") +public class ConfigPreference { + + @Config.Comment("if true, input filter will initially be on when input buses are placed in the world.") + @Config.DefaultBoolean(false) + public static boolean inputBusInitialFilter; + + @Config.Comment("if true, allow multistacks on single blocks by default when they are first placed in the world.") + @Config.DefaultBoolean(false) + public static boolean singleBlockInitialAllowMultiStack; + + @Config.Comment("if true, input filter will initially be on when machines are placed in the world.") + @Config.DefaultBoolean(false) + public static boolean singleBlockInitialFilter; +} diff --git a/src/main/java/gregtech/common/config/client/ConfigRender.java b/src/main/java/gregtech/common/config/client/ConfigRender.java new file mode 100644 index 0000000000..27860a13cb --- /dev/null +++ b/src/main/java/gregtech/common/config/client/ConfigRender.java @@ -0,0 +1,46 @@ +package gregtech.common.config.client; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "render", configSubDirectory = "GregTech", filename = "Client") +public class ConfigRender { + + @Config.Comment("if true, enables ambient-occlusion smooth lighting on tiles.") + @Config.DefaultBoolean(true) + public static boolean renderTileAmbientOcclusion; + + @Config.Comment("if true, enables glowing of the machine controllers.") + @Config.DefaultBoolean(true) + public static boolean renderGlowTextures; + + @Config.Comment("if true, render flipped machine with flipped textures.") + @Config.DefaultBoolean(true) + public static boolean renderFlippedMachinesFlipped; + + @Config.Comment("if true, render indicators on hatches.") + @Config.DefaultBoolean(true) + public static boolean renderIndicatorsOnHatch; + + @Config.Comment("if true, enables dirt particles when pollution reaches the threshold.") + @Config.DefaultBoolean(true) + public static boolean renderDirtParticles; + + @Config.Comment("if true, enables pollution fog when pollution reaches the threshold.") + @Config.DefaultBoolean(true) + public static boolean renderPollutionFog; + + @Config.Comment("if true, enables the green -> red durability for an item's damage value.") + @Config.DefaultBoolean(true) + public static boolean renderItemDurabilityBar; + + @Config.Comment("if true, enables the blue charge bar for an electric item's charge.") + @Config.DefaultBoolean(true) + public static boolean renderItemChargeBar; + + @Config.Comment("enables BaseMetaTileEntity block updates handled by BlockUpdateHandler.") + @Config.DefaultBoolean(false) + public static boolean useBlockUpdateHandler; + +} diff --git a/src/main/java/gregtech/common/config/client/ConfigWaila.java b/src/main/java/gregtech/common/config/client/ConfigWaila.java new file mode 100644 index 0000000000..9d6f732941 --- /dev/null +++ b/src/main/java/gregtech/common/config/client/ConfigWaila.java @@ -0,0 +1,21 @@ +package gregtech.common.config.client; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "waila", configSubDirectory = "GregTech", filename = "Client") + +public class ConfigWaila { + + /** + * This enables showing voltage tier of transformer for Waila, instead of raw voltage number + */ + @Config.Comment("if true, enables showing voltage tier of transformer for Waila, instead of raw voltage number.") + @Config.DefaultBoolean(true) + public static boolean wailaTransformerVoltageTier; + + @Config.Comment("if true, enables showing voltage tier of transformer for Waila, instead of raw voltage number.") + @Config.DefaultBoolean(false) + public static boolean wailaAverageNS; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigDebug.java b/src/main/java/gregtech/common/config/gregtech/ConfigDebug.java new file mode 100644 index 0000000000..fe5fc52b13 --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigDebug.java @@ -0,0 +1,79 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "debug", configSubDirectory = "GregTech", filename = "GregTech") +public class ConfigDebug { + + @Config.Comment("enable D1 flag (a set of debug logs)") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean D1; + + @Config.Comment("enable D2 flag (another set of debug logs)") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean D2; + + @Config.Comment("This will prevent NEI from crashing but spams the Log.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean allowBrokenRecipeMap; + + @Config.Comment("Debug parameters for cleanroom testing.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugCleanroom; + + @Config.Comment("Debug parameter for driller testing.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugDriller; + + @Config.Comment("Debug parameter for world generation. Tracks chunks added/removed from run queue.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugWorldgen; + + @Config.Comment("Debug parameter for orevein generation.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugOrevein; + + @Config.Comment("Debug parameter for small ore generation.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugSmallOres; + + @Config.Comment("Debug parameter for stones generation.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugStones; + + @Config.Comment("Debug parameter for single block miner.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugBlockMiner; + + @Config.Comment("Debug parameter for single block pump.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugBlockPump; + + @Config.Comment("Debug parameter for entity cramming reduction.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugEntityCramming; + + @Config.Comment("Debug parameter for gregtech.api.util.GT_ChunkAssoci