diff options
author | boubou19 <miisterunknown@gmail.com> | 2024-08-27 20:50:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 18:50:30 +0000 |
commit | 4908d5967c3dfeff5616c65144e701859b9e30a2 (patch) | |
tree | 3e58a4b8ebd8b70745e81c4c71c765980e4ec4f4 /src/main/java/gregtech | |
parent | 3c574facfb224029c0b69865e281023da6170ce0 (diff) | |
download | GT5-Unofficial-4908d5967c3dfeff5616c65144e701859b9e30a2.tar.gz GT5-Unofficial-4908d5967c3dfeff5616c65144e701859b9e30a2.tar.bz2 GT5-Unofficial-4908d5967c3dfeff5616c65144e701859b9e30a2.zip |
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
Diffstat (limited to 'src/main/java/gregtech')
84 files changed, 4705 insertions, 4190 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 837c2c5d04..4f1297bd81 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -25,7 +25,6 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; @@ -33,8 +32,11 @@ import org.apache.logging.log4j.Logger; import com.google.common.base.Stopwatch; import com.google.common.collect.SetMultimap; +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.ConfigurationManager; import appeng.api.AEApi; +import bloodasp.galacticgreg.SpaceDimRegisterer; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; @@ -80,6 +82,24 @@ import gregtech.common.GT_DummyWorld; import gregtech.common.GT_Network; import gregtech.common.GT_Proxy; import gregtech.common.GT_RecipeAdder; +import gregtech.common.config.client.ConfigColorModulation; +import gregtech.common.config.client.ConfigInterface; +import gregtech.common.config.client.ConfigPreference; +import gregtech.common.config.client.ConfigRender; +import gregtech.common.config.client.ConfigWaila; +import gregtech.common.config.gregtech.ConfigDebug; +import gregtech.common.config.gregtech.ConfigFeatures; +import gregtech.common.config.gregtech.ConfigGeneral; +import gregtech.common.config.gregtech.ConfigHarvestLevel; +import gregtech.common.config.gregtech.ConfigMachines; +import gregtech.common.config.gregtech.ConfigOreDropBehavior; +import gregtech.common.config.gregtech.ConfigPollution; +import gregtech.common.config.machinestats.ConfigBronzeSolarBoiler; +import gregtech.common.config.machinestats.ConfigMassFabricator; +import gregtech.common.config.machinestats.ConfigMicrowaveEnergyTransmitter; +import gregtech.common.config.machinestats.ConfigSteelSolarBoiler; +import gregtech.common.config.machinestats.ConfigTeleporter; +import gregtech.common.config.worldgen.ConfigEndAsteroids; import gregtech.common.covers.GT_Cover_FacadeAE; import gregtech.common.misc.GT_Command; import gregtech.common.misc.spaceprojects.commands.SPM_Command; @@ -168,6 +188,47 @@ import ic2.api.recipe.RecipeOutput; + " after:gendustry;") public class GT_Mod implements IGT_Mod { + static { + try { + // Client + ConfigurationManager.registerConfig(ConfigColorModulation.class); + ConfigurationManager.registerConfig(ConfigInterface.class); + ConfigurationManager.registerConfig(ConfigPreference.class); + ConfigurationManager.registerConfig(ConfigRender.class); + ConfigurationManager.registerConfig(ConfigWaila.class); + + // GregTech.cfg + ConfigurationManager.registerConfig(ConfigDebug.class); + ConfigurationManager.registerConfig(ConfigFeatures.class); + ConfigurationManager.registerConfig(ConfigGeneral.class); + ConfigurationManager.registerConfig(ConfigHarvestLevel.class); + ConfigurationManager.registerConfig(ConfigMachines.class); + ConfigurationManager.registerConfig(ConfigOreDropBehavior.class); + ConfigurationManager.registerConfig(ConfigPollution.class); + + // MachineStats.cfg + ConfigurationManager.registerConfig(ConfigBronzeSolarBoiler.class); + ConfigurationManager.registerConfig(gregtech.common.config.machinestats.ConfigMachines.class); + ConfigurationManager.registerConfig(ConfigMassFabricator.class); + ConfigurationManager.registerConfig(ConfigMicrowaveEnergyTransmitter.class); + ConfigurationManager.registerConfig(ConfigSteelSolarBoiler.class); + ConfigurationManager.registerConfig(ConfigTeleporter.class); + + // OverPoweredStuff + ConfigurationManager.registerConfig(gregtech.common.config.opstuff.ConfigGeneral.class); + + // Other + ConfigurationManager.registerConfig(gregtech.common.config.other.ConfigGeneral.class); + + // WorldGeneration + ConfigurationManager.registerConfig(ConfigEndAsteroids.class); + ConfigurationManager.registerConfig(gregtech.common.config.worldgen.ConfigGeneral.class); + + } catch (ConfigException e) { + throw new RuntimeException(e); + } + } + public static final int NBT_VERSION = calculateTotalGTVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); @Mod.Instance(Mods.Names.GREG_TECH) @@ -182,6 +243,7 @@ public class GT_Mod implements IGT_Mod { public static int MAX_IC2 = 2147483647; public static GT_Achievements achievements; + @Deprecated public static final String aTextGeneral = "general"; public static final String aTextIC2 = "ic2_"; public static final Logger GT_FML_LOGGER = LogManager.getLogger("GregTech GTNH"); @@ -232,17 +294,16 @@ public class GT_Mod implements IGT_Mod { } } - Configuration tMainConfig = GT_PreLoad.getConfiguration(aEvent.getModConfigurationDirectory()); + GT_PreLoad.getConfiguration(aEvent.getModConfigurationDirectory()); GT_PreLoad.createLogFiles( aEvent.getModConfigurationDirectory() - .getParentFile(), - tMainConfig); + .getParentFile()); gregtechproxy.onPreLoad(); GT_Log.out.println("GT_Mod: Setting Configs"); - GT_PreLoad.loadConfig(tMainConfig); + GT_PreLoad.loadConfig(); new Enchantment_Hazmat(); new Enchantment_EnderDamage(); @@ -250,9 +311,6 @@ public class GT_Mod implements IGT_Mod { Materials.init(); - GT_Log.out.println("GT_Mod: Saving Main Config"); - tMainConfig.save(); - GT_PreLoad.initLocalization( aEvent.getModConfigurationDirectory() .getParentFile()); @@ -353,6 +411,9 @@ public class GT_Mod implements IGT_Mod { LHECoolantRegistry.registerBaseCoolants(); + GT_FML_LOGGER.debug("Registering SpaceDimensions"); + SpaceDimRegisterer.register(); + GregTech_API.sLoadFinished = true; GT_Log.out.println("GT_Mod: Load-Phase finished!"); GT_Log.ore.println("GT_Mod: Load-Phase finished!"); diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index 92e0ef36dd..51bf250659 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -35,10 +35,8 @@ import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; -import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.SoundResource; @@ -231,8 +229,7 @@ public class GregTech_API { /** * The Configuration Objects */ - public static GT_Config sMachineFile = null, sWorldgenFile = null, sMaterialProperties = null, sUnification = null, - sSpecialFile = null, sClientDataFile, sOPStuff = null; + public static GT_Config NEIClientFIle; public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100; /** @@ -258,11 +255,10 @@ public class GregTech_API { * Getting assigned by the Config */ public static boolean sTimber = true, sDrinksAlwaysDrinkable = false, sMultiThreadedSounds = false, - sDoShowAllItemsInCreative = false, sColoredGUI = true, sMachineMetalGUI = false, sConstantEnergy = true, - sMachineExplosions = true, sMachineFlammable = true, sMachineNonWrenchExplosions = true, - sMachineRainExplosions = true, sMachineThunderExplosions = true, sMachineFireExplosions = true, - sMachineWireFire = true, mOutputRF = false, mInputRF = false, meIOLoaded = false, mRFExplosions = false, - mServerStarted = false; + sDoShowAllItemsInCreative = false, sColoredGUI = true, sMachineMetalGUI = false, sMachineExplosions = true, + sMachineFlammable = true, sMachineNonWrenchExplosions = true, sMachineRainExplosions = true, + sMachineThunderExplosions = true, sMachineFireExplosions = true, sMachineWireFire = true, mOutputRF = false, + mInputRF = false, mRFExplosions = false, mServerStarted = false; public static int mEUtoRF = 360, mRFtoEU = 20; @@ -775,14 +771,7 @@ public class GregTech_API { } public static Comparator<ItemStack> getConfigurationCircuitsComparator() { - return Comparator.comparingInt((ItemStack is) -> { - // By default, the Programmed Circuit should be the earliest configuration circuit to which the - // player is exposed - if (GT_Mod.gregtechproxy.mCircuitsOrder.isEmpty()) - return is.getItem() instanceof GT_IntegratedCircuit_Item ? 0 : 1; - return GT_Mod.gregtechproxy.mCircuitsOrder - .getOrDefault(String.valueOf(GameRegistry.findUniqueIdentifierFor(is.getItem())), Integer.MAX_VALUE); - }) + return Comparator.comparingInt((ItemStack is) -> is.getItem() instanceof GT_IntegratedCircuit_Item ? 0 : 1) .thenComparing(ItemStack::getUnlocalizedName) .thenComparing(ItemStack::getItemDamage); } diff --git a/src/main/java/gregtech/api/enums/ConfigCategories.java b/src/main/java/gregtech/api/enums/ConfigCategories.java index 83deec4f58..0e70e54651 100644 --- a/src/main/java/gregtech/api/enums/ConfigCategories.java +++ b/src/main/java/gregtech/api/enums/ConfigCategories.java @@ -1,5 +1,6 @@ package gregtech.api.enums; +@Deprecated public enum ConfigCategories { news, diff --git a/src/main/java/gregtech/api/enums/Dimensions.java b/src/main/java/gregtech/api/enums/Dimensions.java new file mode 100644 index 0000000000..21dee59977 --- /dev/null +++ b/src/main/java/gregtech/api/enums/Dimensions.java @@ -0,0 +1,33 @@ +package gregtech.api.enums; + +public enum Dimensions { + + Overworld("0"), + Moon("Moon"), + Mercury("Mercury"), + Venus("Venus"), + Mars("Mars"), + Io("Io"), + Europa("Europa"), + Callisto("Callisto"), + Titan("Titan"), + Miranda("Miranda"), + Oberon("oberon"), + Triton("Triton"), + Proteus("Proteus"), + Pluto("Pluto"), + Makemake("Makemake"), + AlphaCentauriBb("aCentauriBb"), + BarnardaC("BarnardaC"), + BarnardaE("BarnardaE"), + BarnardaF("BarnardaF"), + TCetiE("TCetiE"), + Ross128b("Ross128b"), + Ross128ba("Ross128ba"),; + + public final String id; + + private Dimensions(String id) { + this.id = id; + } +} diff --git a/src/main/java/gregtech/api/enums/GTStones.java b/src/main/java/gregtech/api/enums/GTStones.java new file mode 100644 index 0000000000..82d7cb90ce --- /dev/null +++ b/src/main/java/gregtech/api/enums/GTStones.java @@ -0,0 +1,398 @@ +package gregtech.api.enums; + +import gregtech.api.GregTech_API; +import gregtech.common.GT_Worldgen_Stone; +import gregtech.common.StoneBuilder; + +public enum GTStones { + + NetherBlackgraniteTiny(new StoneBuilder().name("nether.stone.blackgranite.tiny") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(-1) + .size(50) + .probability(45) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBlackgraniteSmall(new StoneBuilder().name("nether.stone.blackgranite.small") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(-1) + .size(100) + .probability(60) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBlackgraniteMedium(new StoneBuilder().name("nether.stone.blackgranite.medium") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(-1) + .size(200) + .probability(80) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBlackgraniteLarge(new StoneBuilder().name("nether.stone.blackgranite.large") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(-1) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBlackgraniteHuge(new StoneBuilder().name("nether.stone.blackgranite.huge") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(-1) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherRedgraniteTiny(new StoneBuilder().name("nether.stone.redgranite.tiny") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(-1) + .size(50) + .probability(45) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherRedgraniteSmall(new StoneBuilder().name("nether.stone.redgranite.small") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(-1) + .size(100) + .probability(60) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherRedgraniteMedium(new StoneBuilder().name("nether.stone.redgranite.medium") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(-1) + .size(200) + .probability(80) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherRedgraniteLarge(new StoneBuilder().name("nether.stone.redgranite.large") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(-1) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherRedgraniteHuge(new StoneBuilder().name("nether.stone.redgranite.huge") + .disabledByDefault() + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(-1) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherMarbleTiny(new StoneBuilder().name("nether.stone.marble.tiny") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(-1) + .size(50) + .probability(45) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherMarbleSmall(new StoneBuilder().name("nether.stone.marble.small") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(-1) + .size(100) + .probability(60) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherMarbleMedium(new StoneBuilder().name("nether.stone.marble.medium") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(-1) + .size(200) + .probability(80) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherMarbleLarge(new StoneBuilder().name("nether.stone.marble.large") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(-1) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherMarbleHuge(new StoneBuilder().name("nether.stone.marble.huge") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(-1) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBasaltTiny(new StoneBuilder().name("nether.stone.basalt.tiny") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(-1) + .size(50) + .probability(45) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBasaltSmall(new StoneBuilder().name("nether.stone.basalt.small") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(-1) + .size(100) + .probability(60) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBasaltMedium(new StoneBuilder().name("nether.stone.basalt.medium") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(-1) + .size(200) + .probability(80) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBasaltLarge(new StoneBuilder().name("nether.stone.basalt.large") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(-1) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + NetherBasaltHuge(new StoneBuilder().name("nether.stone.basalt.huge") + .disabledByDefault() + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(-1) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + OverworldBlackgraniteTiny(new StoneBuilder().name("overworld.stone.blackgranite.tiny") + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(0) + .size(75) + .probability(5) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBlackgraniteSmall(new StoneBuilder().name("overworld.stone.blackgranite.small") + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(0) + .size(100) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBlackgraniteMedium(new StoneBuilder().name("overworld.stone.blackgranite.medium") + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(0) + .size(200) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBlackgraniteLarge(new StoneBuilder().name("overworld.stone.blackgranite.large") + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(0) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldBlackgraniteHuge(new StoneBuilder().name("overworld.stone.blackgranite.huge") + .block(GregTech_API.sBlockGranites) + .blockMeta(0) + .dimension(0) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldRedgraniteTiny(new StoneBuilder().name("overworld.stone.redgranite.tiny") + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(0) + .size(75) + .probability(5) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldRedgraniteSmall(new StoneBuilder().name("overworld.stone.redgranite.small") + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(0) + .size(100) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldRedgraniteMedium(new StoneBuilder().name("overworld.stone.redgranite.medium") + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(0) + .size(200) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldRedgraniteLarge(new StoneBuilder().name("overworld.stone.redgranite.large") + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(0) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldRedgraniteHuge(new StoneBuilder().name("overworld.stone.redgranite.huge") + .block(GregTech_API.sBlockGranites) + .blockMeta(8) + .dimension(0) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldMarbleTiny(new StoneBuilder().name("overworld.stone.marble.tiny") + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(0) + .size(75) + .probability(5) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldMarbleSmall(new StoneBuilder().name("overworld.stone.marble.small") + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(0) + .size(100) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldMarbleMedium(new StoneBuilder().name("overworld.stone.marble.medium") + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(0) + .size(200) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldMarbleLarge(new StoneBuilder().name("overworld.stone.marble.large") + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(0) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldMarbleHuge(new StoneBuilder().name("overworld.stone.marble.huge") + .block(GregTech_API.sBlockStones) + .blockMeta(0) + .dimension(0) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldBasaltTiny(new StoneBuilder().name("overworld.stone.basalt.tiny") + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(0) + .size(75) + .probability(5) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBasaltSmall(new StoneBuilder().name("overworld.stone.basalt.small") + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(0) + .size(100) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBasaltMedium(new StoneBuilder().name("overworld.stone.basalt.medium") + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(0) + .size(200) + .probability(10) + .heightRange(0, 180) + .generationInVoidEnabled(false)), + + OverworldBasaltLarge(new StoneBuilder().name("overworld.stone.basalt.large") + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(0) + .size(300) + .probability(70) + .heightRange(0, 120) + .generationInVoidEnabled(false)), + + OverworldBasaltHuge(new StoneBuilder().name("overworld.stone.basalt.huge") + .block(GregTech_API.sBlockStones) + .blockMeta(8) + .dimension(0) + .size(400) + .probability(150) + .heightRange(0, 120) + .generationInVoidEnabled(false)),; + + public final StoneBuilder stone; + + private GTStones(StoneBuilder stone) { + this.stone = stone; + } + + public GT_Worldgen_Stone addGTStone() { + return new GT_Worldgen_Stone(this.stone); + } + +} diff --git a/src/main/java/gregtech/api/enums/ManualOreDictTweaks.java b/src/main/java/gregtech/api/enums/ManualOreDictTweaks.java new file mode 100644 index 0000000000..2392fcb591 --- /dev/null +++ b/src/main/java/gregtech/api/enums/ManualOreDictTweaks.java @@ -0,0 +1,70 @@ +package gregtech.api.enums; + +import static gregtech.api.enums.Mods.Avaritia; +import static gregtech.api.enums.Mods.Botania; +import static gregtech.api.enums.Mods.DraconicEvolution; +import static gregtech.api.enums.Mods.EnderIO; +import static gregtech.api.enums.Mods.GregTech; +import static gregtech.api.enums.Mods.HardcoreEnderExpansion; +import static gregtech.api.enums.Mods.ProjectRedCore; +import static gregtech.api.enums.Mods.RandomThings; +import static gregtech.api.enums.Mods.Thaumcraft; +import static gregtech.api.enums.Mods.Translocator; + +import java.util.HashMap; +import java.util.Map; + +public class ManualOreDictTweaks { + + private static final Map<String, Map<String, Boolean>> oredictLookupTable = new HashMap<>(); + + private static final String[] gregtech = new String[] { "dustAlumina', 'dustNikolite" }; + private static final String[] enderio = new String[] { "ingotDarkSteel" }; + private static final String[] draconicevolution = new String[] { "dustDraconium" }; + private static final String[] thaumcraft = new String[] { + "ingotThaumium', 'ingotVoid', 'nuggetThaumium', 'nuggetVoid" }; + private static final String[] projred_core = new String[] { "dustElectrotine" }; + private static final String[] translocator = new String[] { "nuggetDiamond" }; + private static final String[] hardcoreenderexpansion = new String[] { "ingotHeeEndium" }; + private static final String[] avaritia = new String[] { "ingotCosmicNeutronium', 'ingotInfinity" }; + private static final String[] randomthings = new String[] { "stickObsidian" }; + private static final String[] botania = new String[] { + "ingotElvenElementium', 'ingotManasteel', 'ingotTerrasteel', 'nuggetElvenElementium', 'nuggetManasteel', 'nuggetTerrasteel" }; + + private static final String[] modNames = { GregTech.ID, EnderIO.ID, DraconicEvolution.ID, Thaumcraft.ID, + ProjectRedCore.ID, Translocator.ID, HardcoreEnderExpansion.ID, Avaritia.ID, RandomThings.ID, Botania.ID }; + private static final String[][] array = new String[][] { gregtech, enderio, draconicevolution, thaumcraft, + projred_core, translocator, hardcoreenderexpansion, avaritia, randomthings, botania }; + + static { + initTweakedValues(); + } + + private static void initTweakedValues() { + for (int i = 0; i < array.length; i++) { + HashMap<String, Boolean> modTableLookup = new HashMap<>(); + String name = modNames[i]; + for (String oredict : array[i]) { + modTableLookup.put(oredict, true); + } + oredictLookupTable.put(name, modTableLookup); + } + } + + public static boolean shouldOredictBeOverwritten(String modID, String oredict) { + Map<String, Boolean> modLookupTable = oredictLookupTable.get(modID); + if (modLookupTable == null) { + modLookupTable = new HashMap<>(); + modLookupTable.put(oredict, false); + oredictLookupTable.put(modID, modLookupTable); + return false; + } + Boolean result = modLookupTable.get(oredict); + if (result == null) { + modLookupTable.put(oredict, false); + result = false; + } + return result; + } + +} diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 16553e2d42..e5f9991236 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -13,7 +13,6 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -34,6 +33,7 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.config.gregtech.ConfigHarvestLevel; import gregtech.common.render.items.CosmicNeutroniumRenderer; import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; import gregtech.common.render.items.GaiaSpiritRenderer; @@ -2574,59 +2574,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } } - private static void addFuelValues(Materials aMaterial, String aConfigPath) { - aMaterial.mFuelPower = GregTech_API.sMaterialProperties.get(aConfigPath, "FuelPower", aMaterial.mFuelPower); - aMaterial.mFuelType = GregTech_API.sMaterialProperties.get(aConfigPath, "FuelType", aMaterial.mFuelType); - } - - private static void addTemperatureValues(Materials aMaterial, String aConfigPath) { - aMaterial.mMeltingPoint = GregTech_API.sMaterialProperties - .get(aConfigPath, "MeltingPoint", aMaterial.mMeltingPoint); - aMaterial.mBlastFurnaceRequired = GregTech_API.sMaterialProperties - .get(aConfigPath, "BlastFurnaceRequired", aMaterial.mBlastFurnaceRequired); - aMaterial.mBlastFurnaceTemp = (short) GregTech_API.sMaterialProperties - .get(aConfigPath, "BlastFurnaceTemp", aMaterial.mBlastFurnaceTemp); - aMaterial.mGasTemp = GregTech_API.sMaterialProperties.get(aConfigPath, "GasTemp", aMaterial.mGasTemp); - aMaterial.setHeatDamage( - (float) GregTech_API.sMaterialProperties.get(aConfigPath, "HeatDamage", aMaterial.mHeatDamage)); - } - - private static void addDensityValues(Materials aMaterial, String aConfigPath) { - aMaterial.mDensityMultiplier = GregTech_API.sMaterialProperties - .get(aConfigPath, "DensityMultiplier", aMaterial.mDensityMultiplier); - aMaterial.mDensityDivider = GregTech_API.sMaterialProperties - .get(aConfigPath, "DensityDivider", aMaterial.mDensityDivider); - aMaterial.mDensity = (long) GregTech_API.sMaterialProperties.get( - aConfigPath, - "Density", - ((double) M * aMaterial.mDensityMultiplier) - / (aMaterial.mDensityDivider != 0 ? aMaterial.mDensityDivider : 1)); - } - - private static void addColorValues(Materials aMaterial, String aConfigPath) { - aMaterial.mTransparent = GregTech_API.sMaterialProperties - .get(aConfigPath, "Transparent", aMaterial.mTransparent); - String aColor = GregTech_API.sMaterialProperties - .get(aConfigPath, "DyeColor", aMaterial.mColor == Dyes._NULL ? "None" : aMaterial.mColor.toString()); - aMaterial.mColor = aColor.equals("None") ? Dyes._NULL : Dyes.get(aColor); - String[] aRGBA = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MatRGBA", - aMaterial.mRGBa[0] + "," + aMaterial.mRGBa[1] + "," + aMaterial.mRGBa[2] + "," + aMaterial.mRGBa[3] + ",") - .split(","); - aMaterial.mRGBa[0] = Short.parseShort(aRGBA[0]); - aMaterial.mRGBa[1] = Short.parseShort(aRGBA[1]); - aMaterial.mRGBa[2] = Short.parseShort(aRGBA[2]); - aMaterial.mRGBa[3] = Short.parseShort(aRGBA[3]); - } - - private static void addToolValues(Materials aMaterial, String aConfigPath) { - aMaterial.mDurability = GregTech_API.sMaterialProperties - .get(aConfigPath, "ToolDurability", aMaterial.mDurability); - aMaterial.mToolSpeed = (float) GregTech_API.sMaterialProperties - .get(aConfigPath, "ToolSpeed", aMaterial.mToolSpeed); - aMaterial.mToolQuality = (byte) GregTech_API.sMaterialProperties - .get(aConfigPath, "ToolQuality", aMaterial.mToolQuality); + private static void addToolValues(Materials aMaterial) { // Moved from GT_Proxy? (Not sure) aMaterial.mHandleMaterial = (aMaterial == Desh ? aMaterial.mHandleMaterial : aMaterial == Diamond || aMaterial == Thaumium ? Wood @@ -2653,79 +2601,26 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } } - private static void addEnchantmentValues(Materials aMaterial, String aConfigPath) { - aMaterial.mEnchantmentToolsLevel = (byte) GregTech_API.sMaterialProperties - .get(aConfigPath, "EnchantmentLevel", aMaterial.mEnchantmentToolsLevel); - String aEnchantmentName = GregTech_API.sMaterialProperties.get( - aConfigPath, - "Enchantment", - aMaterial.mEnchantmentTools != null ? aMaterial.mEnchantmentTools.getName() : ""); + private static void addEnchantmentValues(Materials aMaterial) { + String aEnchantmentName = aMaterial.mEnchantmentTools != null ? aMaterial.mEnchantmentTools.getName() : ""; if (aMaterial.mEnchantmentTools != null && !aEnchantmentName.equals(aMaterial.mEnchantmentTools.getName())) IntStream.range(0, Enchantment.enchantmentsList.length) .filter(i -> aEnchantmentName.equals(Enchantment.enchantmentsList[i].getName())) .forEach(i -> aMaterial.mEnchantmentTools = Enchantment.enchantmentsList[i]); } - private static void addProcessingIntoValues(Materials aMaterial, String aConfigPath) { - aMaterial.mSmeltInto = MATERIALS_MAP - .get(GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialSmeltInto", aMaterial.mSmeltInto.mName)); - aMaterial.mMacerateInto = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialMacerateInto", aMaterial.mMacerateInto.mName)); - aMaterial.mArcSmeltInto = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialArcSmeltInto", aMaterial.mArcSmeltInto.mName)); - aMaterial.mDirectSmelting = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties - .get(aConfigPath, "MaterialDirectSmeltInto", aMaterial.mDirectSmelting.mName)); - aMaterial.mAutoGenerateBlastFurnaceRecipes = GregTech_API.sMaterialProperties - .get(aConfigPath, "AutoGenerateBlastFurnaceRecipes", aMaterial.mAutoGenerateBlastFurnaceRecipes); - } - - private static void addMultiplierValues(Materials aMaterial, String aConfigPath) { - aMaterial.mOreValue = GregTech_API.sMaterialProperties.get(aConfigPath, "OreValue", aMaterial.mOreValue); - aMaterial.setOreMultiplier( - GregTech_API.sMaterialProperties.get(aConfigPath, "OreMultiplier", aMaterial.mOreMultiplier)); - aMaterial.setSmeltingMultiplier( - GregTech_API.sMaterialProperties.get(aConfigPath, "OreSmeltingMultiplier", aMaterial.mSmeltingMultiplier)); - aMaterial.setByProductMultiplier( - GregTech_API.sMaterialProperties - .get(aConfigPath, "OreByProductMultiplier", aMaterial.mByProductMultiplier)); - } - - private static void addHasGasFluid(Materials aMaterial, String aConfigPath) { - - if (!aMaterial.mIconSet.is_custom) { - aMaterial.mHasPlasma = GregTech_API.sMaterialProperties.get(aConfigPath, "AddPlasma", aMaterial.mHasPlasma); - if (aMaterial.mHasPlasma) { - GT_Mod.gregtechproxy.addAutogeneratedPlasmaFluid(aMaterial); - } - aMaterial.mHasGas = GregTech_API.sMaterialProperties.get(aConfigPath, "AddGas", aMaterial.mHasGas); - if (aMaterial.mHasGas) { - GT_FluidFactory - .of(aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName, aMaterial, GAS, aMaterial.mGasTemp); - } + private static void addHasGasFluid(Materials aMaterial) { + if (aMaterial.mIconSet.is_custom) { + return; } - } - private static void addInternalStuff(Materials aMaterial, String aConfigPath) { - aMaterial.mMetaItemSubID = GregTech_API.sMaterialProperties - .get(aConfigPath, "MaterialID", aMaterial.mCustomOre ? -1 : aMaterial.mMetaItemSubID); - aMaterial.mTypes = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialTypes", - aMaterial.mCustomOre ? 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 : aMaterial.mTypes); - aMaterial.mUnificatable = GregTech_API.sMaterialProperties - .get(aConfigPath, "Unificatable", aMaterial.mUnificatable); - aMaterial.mHasParentMod = GregTech_API.sMaterialProperties - .get(aConfigPath, "HasParentMod", aMaterial.mHasParentMod); - } - - private static void addLocalisation(Materials aMaterial, String aConfigPath) { - aMaterial.mDefaultLocalName = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialName", - aMaterial.mCustomOre ? "CustomOre" + aMaterial.mCustomID : aMaterial.mDefaultLocalName); - aMaterial.mChemicalFormula = GregTech_API.sMaterialProperties - .get(aConfigPath, "ChemicalFormula", aMaterial.mChemicalFormula); + if (aMaterial.mHasPlasma) { + GT_Mod.gregtechproxy.addAutogeneratedPlasmaFluid(aMaterial); + } + if (aMaterial.mHasGas) { + GT_FluidFactory + .of(aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName, aMaterial, GAS, aMaterial.mGasTemp); + } } private static String getConfigPath(Materials aMaterial) { @@ -2733,135 +2628,32 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { return "materials." + aMaterial.mConfigSection + "." + cOre; } - private static void addHarvestLevelNerfs(Materials aMaterial, String aConfigPath) { + private static void addHarvestLevelNerfs(Materials aMaterial) { /* Moved the harvest level changes from GT_Mod to have fewer things iterating over MATERIALS_ARRAY */ if (GT_Mod.gregtechproxy.mChangeHarvestLevels && aMaterial.mToolQuality > 0 && aMaterial.mMetaItemSubID < GT_Mod.gregtechproxy.mHarvestLevel.length && aMaterial.mMetaItemSubID >= 0) { - GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties - .get(aConfigPath, "HarvestLevel", aMaterial.mToolQuality); + GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = aMaterial.mToolQuality; } } private static void addHarvestLevels() { - GT_Mod.gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties - .get("harvestlevel", "ActivateHarvestLevelChange", false); - GT_Mod.gregtechproxy.mMaxHarvestLevel = Math - .min(15, GregTech_API.sMaterialProperties.get("harvestlevel", "MaxHarvestLevel", 7)); - GT_Mod.gregtechproxy.mGraniteHavestLevel = GregTech_API.sMaterialProperties - .get("harvestlevel", "GraniteHarvestLevel", 3); + GT_Mod.gregtechproxy.mChangeHarvestLevels = ConfigHarvestLevel.activateHarvestLevelChange; + GT_Mod.gregtechproxy.mMaxHarvestLevel = Math.min(15, ConfigHarvestLevel.maxHarvestLevel); + GT_Mod.gregtechproxy.mGraniteHavestLevel = ConfigHarvestLevel.graniteHarvestLevel; } public static void initMaterialProperties() { addHarvestLevels(); for (Materials aMaterial : MATERIALS_MAP.values()) { - if (aMaterial != null && aMaterial != Materials._NULL && aMaterial != Materials.Empty) { - - String aConfigPath = getConfigPath(aMaterial); - - addFuelValues(aMaterial, aConfigPath); - addTemperatureValues(aMaterial, aConfigPath); - addDensityValues(aMaterial, aConfigPath); - addColorValues(aMaterial, aConfigPath); - addToolValues(aMaterial, aConfigPath); - addEnchantmentValues(aMaterial, aConfigPath); - addProcessingIntoValues(aMaterial, aConfigPath); - addMultiplierValues(aMaterial, aConfigPath); - addHasGasFluid(aMaterial, aConfigPath); - addInternalStuff(aMaterial, aConfigPath); - addLocalisation(aMaterial, aConfigPath); - SubTagCalculation(aMaterial, aConfigPath); - OreByProductsCalculation(aMaterial, aConfigPath); - OreReRegistrationsCalculation(aMaterial, aConfigPath); - aspectCalculation(aMaterial, aConfigPath); - addHarvestLevelNerfs(aMaterial, aConfigPath); - } - } - } - - private static void aspectCalculation(Materials aMaterial, String aConfigPath) { - - String aDefaultAspectString = aMaterial.mAspects.stream() - .map(aAspectStack -> aAspectStack.mAspect.toString()) - .collect(Collectors.joining(",", ",", "")); - String aDefaultAspectAmountString = aMaterial.mAspects.stream() - .map(aAspectStack -> String.valueOf(aAspectStack.mAmount)) - .collect(Collectors.joining(",", ",", "")); - - String aConfigAspectString = GregTech_API.sMaterialProperties - .get(aConfigPath, "ListTCAspects", aDefaultAspectString); - String aConfigAspectAmountString = GregTech_API.sMaterialProperties - .get(aConfigPath, "ListTCAspectAmounts", aDefaultAspectAmountString); - - if (!aConfigAspectString.equals(aDefaultAspectString) - || !aConfigAspectAmountString.equals(aDefaultAspectAmountString)) { - aMaterial.mAspects.clear(); - if (aConfigAspectString.length() > 0) { - String[] aAspects = aConfigAspectString.split(","); - String[] aAspectAmounts = aConfigAspectAmountString.split(","); - for (int i = 0; i < aAspects.length; i++) { - String aAspectString = aAspects[i]; - long aAspectAmount = Long.parseLong(aAspectAmounts[i]); - TC_AspectStack aAspectStack = new TC_AspectStack(TC_Aspects.valueOf(aAspectString), aAspectAmount); - aMaterial.mAspects.add(aAspectStack); - } - } - } - } - - private static void OreReRegistrationsCalculation(Materials aMaterial, String aConfigPath) { - String aDefaultMatReRegString = aMaterial.mOreReRegistrations.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); - String aConfigMatMatReRegString = GregTech_API.sMaterialProperties - .get(aConfigPath, "ListMaterialReRegistrations", aDefaultMatReRegString); - if (!aConfigMatMatReRegString.equals(aDefaultMatReRegString)) { - aMaterial.mOreReRegistrations.clear(); - if (aConfigMatMatReRegString.length() > 0) { - Arrays.stream(aConfigMatMatReRegString.split(",")) - .map(MATERIALS_MAP::get) - .filter(Objects::nonNull) - .forEach(aMat -> aMaterial.mOreReRegistrations.add(aMat)); - } - } - } - - private static void OreByProductsCalculation(Materials aMaterial, String aConfigPath) { - String aDefaultMatByProString = aMaterial.mOreByProducts.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); - String aConfigMatByProString = GregTech_API.sMaterialProperties - .get(aConfigPath, "ListMaterialByProducts", aDefaultMatByProString); - if (!aConfigMatByProString.equals(aDefaultMatByProString)) { - aMaterial.mOreByProducts.clear(); - if (aConfigMatByProString.length() > 0) { - Arrays.stream(aConfigMatByProString.split(",")) - .map(MATERIALS_MAP::get) - .filter(Objects::nonNull) - .forEach(aMat -> aMaterial.mOreByProducts.add(aMat)); + if (aMaterial == null || aMaterial == Materials._NULL || aMaterial == Materials.Empty) { + continue; } - } - } - /** - * Converts the pre-defined list of SubTags from a material into a list of SubTag names for setting/getting to/from - * the config. It is then converted to a String[] and finally to a singular String for insertion into the config If - * the config string is different from the default, we then want to clear the Materials SubTags and insert new ones - * from the config string. - */ - private static void SubTagCalculation(Materials aMaterial, String aConfigPath) { - String aDefaultTagString = aMaterial.mSubTags.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); - String aConfigTagString = GregTech_API.sMaterialProperties.get(aConfigPath, "ListSubTags", aDefaultTagString); - if (!aConfigTagString.equals(aDefaultTagString)) { - aMaterial.mSubTags.clear(); - if (aConfigTagString.length() > 0) { - Arrays.stream(aConfigTagString.split(",")) - .map(SubTag.sSubTags::get) - .filter(Objects::nonNull) - .forEach(aTag -> aMaterial.mSubTags.add(aTag)); - } + addToolValues(aMaterial); + addEnchantmentValues(aMaterial); + addHasGasFluid(aMaterial); + addHarvestLevelNerfs(aMaterial); } } diff --git a/src/main/java/gregtech/api/enums/Mods.java b/src/main/java/gregtech/api/enums/Mods.java index 28ed17d299..856817d972 100644 --- a/src/main/java/gregtech/api/enums/Mods.java +++ b/src/main/java/gregtech/api/enums/Mods.java @@ -179,14 +179,8 @@ public enum Mods { ZTones(Names.Z_TONES), // Do we keep compat of those? - ArsMagica2(Names.ARS_MAGICA2), - GanysSurface(Names.GANYS_SURFACE), - IndustrialCraft2Classic(Names.INDUSTRIAL_CRAFT2_CLASSIC), - MagicalCrops(Names.MAGICAL_CROPS), Metallurgy(Names.METALLURGY), RotaryCraft(Names.ROTARY_CRAFT), - ThermalExpansion(Names.THERMAL_EXPANSION), - ThermalFondation(Names.THERMAL_FONDATION), UndergroundBiomes(Names.UNDERGROUND_BIOMES), ; @@ -364,14 +358,8 @@ public enum Mods { public static final String Z_TONES = "Ztones"; // Do we keep compat of those mods? - public static final String ARS_MAGICA2 = "arsmagica2"; - public static final String GANYS_SURFACE = "ganyssurface"; - public static final String INDUSTRIAL_CRAFT2_CLASSIC = "IC2-Classic-Spmod"; - public static final String MAGICAL_CROPS = "magicalcrops"; public static final String METALLURGY = "Metallurgy"; public static final String ROTARY_CRAFT = "RotaryCraft"; - public static final String THERMAL_EXPANSION = "ThermalExpansion"; - public static final String THERMAL_FONDATION = "ThermalFoundation"; public static final String UNDERGROUND_BIOMES = "UndergroundBiomes"; } diff --git a/src/main/java/gregtech/api/enums/OreMixes.java b/src/main/java/gregtech/api/enums/OreMixes.java new file mode 100644 index 0000000000..c5c306baab --- /dev/null +++ b/src/main/java/gregtech/api/enums/OreMixes.java @@ -0,0 +1,982 @@ +package gregtech.api.enums; + +import static bloodasp.galacticgreg.api.enums.DimensionDef.*; +import static gregtech.common.OreMixBuilder.NETHER; +import static gregtech.common.OreMixBuilder.OW; +import static gregtech.common.OreMixBuilder.THE_END; +import static gregtech.common.OreMixBuilder.TWILIGHT_FOREST; + +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; +import bloodasp.galacticgreg.api.enums.DimensionDef; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import gregtech.common.OreMixBuilder; + +public enum OreMixes { + + // spotless : off + Naquadah(new OreMixBuilder().name("ore.mix.naquadah") + .heightRange(10, 90) + .weight(30) + .density(4) + .size(32) + .enableInDim( + EndAsteroids, + Maahes, + Asteroids, + BarnardE, + BarnardF, + Haumea, + KuiperBelt, + Mercury, + Oberon, + Pluto, + Titan, + VegaB, + Venus) + .primary(Materials.Naquadah) + .secondary(Materials.Naquadah) + .inBetween(Materials.Naquadah) + .sporadic(Materials.NaquadahEnriched)), + + LigniteCoal(new OreMixBuilder().name("ore.mix.lignite") + .heightRange(80, 210) + .weight(160) + .density(7) + .size(32) + .enableInDim(OW) + .enableInDim(BarnardC) + .primary(Materials.Lignite) + .secondary(Materials.Lignite) + .inBetween(Materials.Lignite) + .sporadic(Materials.Coal)), + + Coal(new OreMixBuilder().name("ore.mix.coal") + .heightRange(30, 80) + .weight(80) + .density(5) + .size(32) + .enableInDim(OW, TWILIGHT_FOREST) + .primary(Materials.Coal) + .secondary(Materials.Coal) + .inBetween(Materials.Coal) + .sporadic(Materials.Lignite)), + + Magnetite(new OreMixBuilder().name("ore.mix.magnetite") + .heightRange(60, 180) + .weight(160) + .density(2) + .size(32) + .enableInDim(OW, TWILIGHT_FOREST) + .enableInDim(Seth, BarnardE, Ceres, Deimos, Io, MakeMake, TcetiE) + .primary(Materials.Magnetite) + .secondary(Materials.Magnetite) + .inBetween(Materials.Iron) + .sporadic(Materials.VanadiumMagnetite)), + + Gold(new OreMixBuilder().name("ore.mix.gold") + .heightRange(30, 60) + .weight(160) + .density(2) + .size(32) + .enableInDim(OW, THE_END, TWILIGHT_FOREST) + .enableInDim(EndAsteroids, Seth, Asteroids, Mars, BarnardF, Callisto, Phobos, Pluto, TcetiE, Triton, VegaB) + .primary(Materials.Magnetite) + .secondary(Materials.Magnetite) + .inBetween(Materials.VanadiumMagnetite) + .sporadic(Materials.Gold)), + + Iron(new OreMixBuilder().name("ore.mix.iron") + .heightRange(10, 40) + .weight(120) + .density(3) + .size(24) + .enableInDim(OW, NETHER, TWILIGHT_FOREST) + .enableInDim(Mars, Callisto, Ceres, Ganymede, Mercury, Oberon, Pluto) + .primary(Materials.BrownLimonite) + .secondary(Materials.YellowLimonite) + .inBetween(Materials.BandedIron) + .sporadic(Materials.Malachite)), + + Cassiterite(new OreMixBuilder().name("ore.mix.cassiterite") + .heightRange(60, 220) + .weight(50) + .density(4) + .size(24) + .enableInDim(EndAsteroids, MehenBelt, Seth, Moon, Io, Miranda, TcetiE, Venus) + .enableInDim(OW, THE_END, TWILIGHT_FOREST) + .primary(Materials.Tin) + .secondary(Materials.Tin) + .inBetween(Materials.Cassiterite) + .sporadic(Materials.Tin)), + + Tetrahedrite(new OreMixBuilder().name("ore.mix.tetrahedrite") + .heightRange(80, 120) + .weight(70) + .density(3) + .size(24) + .enableInDim(NETHER, THE_END) + .enableInDim(EndAsteroids, Asteroids, Mars, CentauriAlpha, Deimos, Ganymede, KuiperBelt, Miranda, VegaB, Venus) + .primary(Materials.Tetrahedrite) + .secondary(Materials.Tetrahedrite) + .inBetween(Materials.Copper) + .sporadic(Materials.Stibnite)), + + NetherQuartz(new OreMixBuilder().name("ore.mix.netherquartz") + .heightRange(40, 80) + .weight(80) + .density(4) + .size(24) + .enableInDim(NETHER) + .enableInDim(Neper, CentauriAlpha) + .primary(Materials.NetherQuartz) + .secondary(Materials.NetherQuartz) + .inBetween(Materials.NetherQuartz) + .sporadic(Materials.Quartzite)), + + Sulfur(new OreMixBuilder().name("ore.mix.sulfur") + .heightRange(5, 20) + .weight(100) + .density(4) + .size(24) + .enableInDim(NETHER) + .enableInDim(Anubis, Mars, CentauriAlpha, Deimos, Io, Phobos, Venus) + .primary(Materials.Sulfur) + .secondary(Materials.Sulfur) + .inBetween(Materials.Pyrite) + .sporadic(Materials.Sphalerite)), + + Copper(new OreMixBuilder().name("ore.mix.copper") + .heightRange(5, 60) + .weight(80) + .density(3) + .size(24) + .enableInDim(EndAsteroids, Moon, BarnardE, BarnardF, Callisto, Ceres, Enceladus, Proteus) + .enableInDim(OW, NETHER, THE_END) + .primary(Materials.Chalcopyrite) + .secondary(Materials.Iron) + .inBetween(Materials.Pyrite) + .sporadic(Materials.Copper)), + + Bauxite(new OreMixBuilder().name("ore.mix.bauxite") + .heightRange(10, 80) + .weight(80) + .density(3) + .size(24) + .enableInDim( + Seth, + Moon, + Asteroids, + Ganymede, + Haumea, + KuiperBelt, + MakeMake, + Mercury, + Phobos, + Pluto, + Proteus, + TcetiE, + Titan) + .primary(Materials.Bauxite) + .secondary(Materials.Ilmenite) + .inBetween(Materials.Aluminium) + .sporadic(Materials.Ilmenite)), + + Salts(new OreMixBuilder().name("ore.mix.salts") + .heightRange(50, 70) + .weight(50) + .density(2) + .size(24) + .enableInDim(OW, TWILIGHT_FOREST) + .enableInDim(Mars, BarnardC, TcetiE) + .primary(Materials.RockSalt) + .secondary(Materials.Salt) + .inBetween(Materials.Lepidolite) + .sporadic(Materials.Spodumene)), + + Redstone(new OreMixBuilder().name("ore.mix.redstone") + .heightRange(5, 40) + .weight(60) + .density(2) + .size(24) + .enableInDim(OW, NETHER) + .enableInDim(Mars, BarnardF, CentauriAlpha, Ganymede, Mercury, Miranda, VegaB, Venus) + .primary(Materials.Redstone) + .secondary(Materials.Redstone) + .inBetween(Materials.Ruby) + .sporadic(Materials.Cinnabar)), + + Soapstone(new OreMixBuilder().name("ore.mix.soapstone") + .heightRange(20, 50) + .weight(40) + .density(2) + .size(16) + .enableInDim(OW, TWILIGHT_FOREST) + .enableInDim(Anubis, Maahes, Ceres) + .primary(Materials.Soapstone) + .secondary(Materials.Talc) + .inBetween(Materials.Glauconite) + .sporadic(Materials.Pentlandite)), + + Nickel(new OreMixBuilder().name("ore.mix.nickel") + .heightRange(10, 40) + .weight(40) + .density(2) + .size(16) + .enableInDim(THE_END, TWILIGHT_FOREST) + .enableInDim(EndAsteroids, MehenBelt, Mars, Deimos, KuiperBelt, Phobos, Titan, Triton, Venus) + .primary(Materials.Garnierite) + .secondary(Materials.Nickel) + .inBetween(Materials.Cobaltite) + .sporadic(Materials.Pentlandite)), + + Platinum(new OreMixBuilder().name("ore.mix.platinum") + .heightRange(40, 50) + .weight(5) + .density(2) + .size(16) + .enableInDim(EndAsteroids, Maahes, MehenBelt) + .primary(Materials.Cooperite) + .secondary(Materials.Palladium) + .inBetween(Materials.Platinum) + .sporadic(Materials.Iridium)), + + Pitchblende(new OreMixBuilder().name("ore.mix.pitchblende") + .heightRange(60, 60) + .weight(40) + .density(2) + .size(16) + .enableInDim(Mars, BarnardF, CentauriAlpha, Haumea, Io, KuiperBelt, MakeMake, Oberon, Phobos, VegaB, Venus) + .primary(Materials.Pitchblende) + .secondary(Materials.Pitchblende) + .inBetween(Materials.Uraninite) + .sporadic(Materials.Uraninite)), + + Monazite(new OreMixBuilder().name("ore.mix.monazite") + .heightRange(20, 40) + .weight(30) + .density(2) + .size(16) + .enableInDim(Seth, Moon, BarnardF, Callisto, Deimos, Enceladus, Haumea, Io, MakeMake, Titan, Triton, Venus) + .primary(Materials.Bastnasite) + .secondary(Materials.Bastnasite) + .inBetween(Materials.Monazite) + .sporadic(Materials.Neodymium)), + + Molybdenum(new OreMixBuilder().name("ore.mix.molybdenum") + .heightRange(20, 50) + .weight(5) + .density(2) + .size(16) + .enableInDim(NETHER, THE_END, TWILIGHT_FOREST) + .enableInDim(EndAsteroids, Moon, BarnardE, Ceres, Mercury, Phobos, Pluto, Proteus, Titan) + .primary(Materials.Wulfenite) + .secondary(Materials.Molybdenite) + .inBetween(Materials.Molybdenum) + .sporadic(Materials.Powellite)), + + Tungstate(new OreMixBuilder().name("ore.mix.tungstate") + .heightRange(20, 60) + .weight(10) + .density(2) + .size(16) + .enableInDim( + EndAsteroids, + Asteroids, + Mars, + Callisto, + Deimos, + Enceladus, + Ganymede, + Haumea, + KuiperBelt, + MakeMake, + Oberon, + Pluto, + Triton, + VegaB) + .primary(Materials.Scheelite) + .secondary(Materials.Scheelite) + .inBetween(Materials.Tungstate) + .sporadic(Materials.Lithium)), + + Sapphire(new OreMixBuilder().name("ore.mix.sapphire") + .heightRange(10, 40) + .weight(60) + .density(2) + .size(16) + .enableInDim(TWILIGHT_FOREST) + .enableInDim(Horus) + .primary(Materials.Almandine) + .secondary(Materials.Pyrope) + .inBetween(Materials.Sapphire) + .sporadic(Materials.GreenSapphire)), + + Manganese(new OreMixBuilder().name("ore.mix.manganese") + .heightRange(20, 30) + .weight(20) + .density(2) + .size(16) + .enableInDim(OW, NETHER) + .enableInDim(EndAsteroids, BarnardE, BarnardF, CentauriAlpha, Ceres, Io, Oberon, Titan, Triton) + .primary(Materials.Grossular) + .secondary(Materials.Spessartine) + .inBetween(Materials.Pyrolusite) + .sporadic(Materials.Tantalite)), + + Quartz(new OreMixBuilder().name("ore.mix.quartz") + .heightRange(80, 120) + .weight(20) + .density(2) + .size(16) + .enableInDim(NETHER) + .enableInDim(Neper) + .primary(Materials.Quartzite) + .secondary(Materials.Barite) + .inBetween(Materials.CertusQuartz) + .sporadic(Materials.CertusQuartz)), + + Diamond(new OreMixBuilder().name("ore.mix.diamond") + .heightRange(5, 20) + .weight(40) + .density(1) + .size(16) + .enableInDim(BarnardF, Ganymede, KuiperBelt, Mercury, Miranda, Phobos, Pluto, Proteus, Titan) + .enableInDim(OW, TWILIGHT_FOREST) + .primary(Materials.Graphite) + .secondary(Materials.Graphite) + .inBetween(Materials.Diamond) + .sporadic(Materials.Coal)), + + Olivine(new OreMixBuilder().name("ore.mix.olivine") + .heightRange(10, 40) + .weight(60) + .density(2) + .size(16) + .enableInDim(TWILIGHT_FOREST) + .enableInDim(EndAsteroids, Anubis, MehenBelt, BarnardE, Ceres, Haumea, MakeMake) + .primary(Materials.Bentonite) + .secondary(Materials.Magnesite) + .inBetween(Materials.Olivine) + .sporadic(Materials.Glauconite)), + + Apatite(new OreMixBuilder().name("ore.mix.apatite") + .heightRange(40, 60) + .weight(60) + .density(2) + .size(16) + .enableInDim(TcetiE.modDimensionDef.getDimensionName(), OW, OreMixBuilder.TWILIGHT_FOREST) + .primary(Materials.Apatite) + .secondary(Materials.Apatite) + .inBetween(Materials.TricalciumPhosphate) + .sporadic(Materials.Pyrochlore)), + + Galena(new OreMixBuilder().name("ore.mix.galena") + .heightRange(5, 45) + .weight(40) + .density(4) + .size(16) + .enableInDim(Moon, Mars, Ganymede, Oberon, Triton, VegaB, Venus) + .primary(Materials.Galena) + .secondary(Materials.Galena) + .inBetween(Materials.Silver) + .sporadic(Materials.Lead)), + + Lapis(new OreMixBuilder().name("ore.mix.lapis") + .heightRange(20, 50) + .weight(40) + .density(4) + .size(16) + .enableInDim(OW, TWILIGHT_FOREST) + .enableInDim(EndAsteroids, MehenBelt, Ceres, Deimos, Enceladus, VegaB) + .primary(Materials.Lazurite) + .secondary(Materials.Sodalite) + .inBetween(Materials.Lapis) + .sporadic(Materials.Calcite)), + + Beryllium(new OreMixBuilder().name("ore.mix.beryllium") + .heightRange(5, 30) + .weight(30) + .density(2) + .size(16) + .enableInDim(OreMixBuilder.NETHER, OreMixBuilder.THE_END) + .enableInDim(EndAsteroids, Mars, BarnardF, CentauriAlpha, Ceres, Haumea, MakeMake, Pluto, Titan, Venus) + .primary(Materials.Beryllium) + .secondary(Materials.Beryllium) + .inBetween(Materials.Emerald) + .sporadic(Materials.Thorium)), + + Uranium(new OreMixBuilder().name("ore.mix.uranium") + .heightRange(20, 30) + .weight(20) + .density(2) + .size(16) + .enableInDim( + MehenBelt, + BarnardE, + Ceres, + Deimos, + Enceladus, + Ganymede, + Haumea, + KuiperBelt, + MakeMake, + Phobos, + Proteus) + .primary(Materials.Uraninite) + .secondary(Materials.Uraninite) + .inBetween(Materials.Uranium) + .sporadic(Materials.Uranium)), + OilSand(new OreMixBuilder().name("ore.mix.oilsand") + .heightRange(50, 80) + .weight(40) + .density(5) + .size(16) + .enableInDim(OW) + .enableInDim(BarnardC, TcetiE) + .primary(Materials.Oilsands) + .secondary(Materials.Oilsands) + .inBetween(Materials.Oilsands) + .sporadic(Materials.Oilsands)), + + Neutronium(new OreMixBuilder().name("ore.mix.neutronium") + .heightRange(5, 30) + .weight(10) + .density(2) + .size(16) + .enableInDim(Maahes, MehenBelt, BarnardE, BarnardF, Haumea, KuiperBelt, MakeMake, Pluto, Proteus, Triton, VegaB) + .primary(Materials.Neutronium) + .secondary(Materials.Adamantium) + .inBetween(Materials.Naquadah) + .sporadic(Materials.Titanium)), + + AquaIgnis(new OreMixBuilder().name("ore.mix.aquaignis") + .heightRange(5, 35) + .weight(16) + .density(2) + .size(16) + .enableInDim(Neper.modDimensionDef.getDimensionName(), OreMixBuilder.TWILIGHT_FOREST) + .primary(Materials.InfusedWater) + .secondary(Materials.InfusedFire) + .inBetween(Materials.Amber) + .sporadic(Materials.Cinnabar)), + + TerraAer(new OreMixBuilder().name("ore.mix.terraaer") + .heightRange(5, 35) + .weight(16) + .density(2) + .size(16) + .enableInDim(Neper) + .enableInDim(TWILIGHT_FOREST) + .primary(Materials.InfusedEarth) + .secondary(Materials.InfusedAir) + .inBetween(Materials.Amber) + .sporadic(Materials.Cinnabar)), + + PerditioOrdo(new OreMixBuilder().name("ore.mix.perditioordo") + .heightRange(5, 35) + .weight(16) + .density(2) + .size(16) + .enableInDim(TWILIGHT_FOREST) + .enableInDim(Neper) + .primary(Materials.InfusedEntropy) + .secondary(Materials.InfusedOrder) + .inBetween(Materials.Amber) + .sporadic(Materials.Cinnabar)), + + CopperTin(new OreMixBuilder().name("ore.mix.coppertin") + .heightRange(80, 200) + .weight(80) + .density(3) + .size(24) + .enableInDim(OW) + .primary(Materials.Chalcopyrite) + .secondary(Materials.Vermiculite) + .inBetween(Materials.Cassiterite) + .sporadic(Materials.Alunite)), + + TitaniumChrome(new OreMixBuilder().name("ore.mix.titaniumchrome") + .heightRange(10, 70) + .weight(16) + .density(2) + .size(16) + .enableInDim(MehenBelt, Moon, Asteroids, Callisto, Ganymede, Mercury, Miranda, Pluto, Proteus, TcetiE, Titan) + .primary(Materials.Ilmenite) + .secondary(Materials.Chromite) + .inBetween(Materials.Uvarovite) + .sporadic(Materials.Perlite)), + + MineralSand(new OreMixBuilder().name("ore.mix.mineralsand") + .heightRange(50, 60) + .weight(80) + .density(3) + .size(24) + .enableInDim(OW) + .enableInDim(Anubis, Maahes, BarnardC, DimensionDef.Europa) + .primary(Materials.BasalticMineralSand) + .secondary(Materials.GraniticMineralSand) + .inBetween(Materials.FullersEarth) + .sporadic(Materials.Gypsum)), + + GarnetTin(new OreMixBuilder().name("ore.mix.garnettin") + .heightRange(50, 60) + .weight(80) + .density(3) + .size(24) + .enableInDim(OW) + .enableInDim(CentauriAlpha, DimensionDef.Europa) + .primary(Materials.CassiteriteSand) + .secondary(Materials.GarnetSand) + .inBetween(Materials.Asbestos) + .sporadic(Materials.Diatomite)), + + KaoliniteZeolite(new OreMixBuilder().name("ore.mix.kaolinitezeolite") + .heightRange(50, 70) + .weight(60) + .density(4) + .size(16) + .enableInDim(OW) + .enableInDim(Neper, TcetiE) + .primary(Materials.Kaolinite) + .secondary(Materials.Zeolite) + .inBetween(Materials.FullersEarth) + .sporadic(Materials.GlauconiteSand)), + + Mica(new OreMixBuilder().name("ore.mix.mica") + .heightRange(20, 40) + .weight(20) + .density(2) + .size(16) + .enableInDim(Anubis, Neper, BarnardC) + .enableInDim(OW) + .primary(Materials.Kyanite) + .secondary(Materials.Mica) + .inBetween(Materials.Cassiterite) + .sporadic(Materials.Pollucite)), + + Dolomite(new OreMixBuilder().name("ore.mix.dolomite") + .heightRange(150, 200) + .weight(40) + .density(4) + .size(24) + .enableInDim(OW) + .enableInDim(Anubis, Neper) + .primary(Materials.Dolomite) + .secondary(Materials.Wollastonite) + .inBetween(Materials.Trona) + .sporadic(Materials.Andradite)), + + PlatinumChrome(new OreMixBuilder().name("ore.mix.platinumchrome") + .heightRange(5, 30) + .weight(10) + .density(2) + .size(16) + .enableInDim(MehenBelt, Seth, Callisto, Ceres, Ganymede, Io, KuiperBelt, Mercury, Oberon, Pluto) + .primary(Materials.Platinum) + .secondary(Materials.Chrome) + .inBetween(Materials.Cooperite) + .sporadic(Materials.Palladium)), + + IridiumMytryl(new OreMixBuilder().name("ore.mix.iridiummytryl") + .heightRange(15, 40) + .weight(10) + .density(2) + .size(16) + .enableInDim(MehenBelt, Seth, Enceladus, Io, KuiperBelt, Mercury, Miranda, Titan, Triton, Venus) + .primary(Materials.Nickel) + .secondary(Materials.Iridium) + .inBetween(Materials.Palladium) + .sporadic(Materials.Mithril)), + + Osmium(new OreMixBuilder().name("ore.mix.osmium") + .heightRange(5, 30) + .weight(10) + .density(2) + .size(16) + .enableInDim(MehenBelt, Seth, BarnardC, Enceladus, KuiperBelt, Miranda, Oberon, Pluto, Proteus, Titan) + .primary(Materials.Nickel) + .secondary(Materials.Osmium) + .inBetween(Materials.Iridium) + .sporadic(Materials.Nickel)), + + SaltPeterElectrotine(new OreMixBuilder().name("ore.mix.saltpeterelectrotine") + .heightRange(5, 45) + .weight(40) + .density(3) + .size(16) + .enableInDim(NETHER) + .enableInDim(CentauriAlpha, Ceres) + .primary(Materials.Saltpeter) + .secondary(Materials.Diatomite) + .inBetween(Materials.Electrotine) + .sporadic(Materials.Alunite)), + + Desh(new OreMixBuilder().name("ore.mix.desh") + .heightRange(5, 40) + .weight(30) + .density(2) + .size(16) + .enableInDim(Anubis, Mars, Miranda) + .primary(Materials.Desh) + .secondary(Materials.Desh) + .inBetween(Materials.Scheelite) + .sporadic(Materials.Tungstate)), + + Draconium(new OreMixBuilder().name("ore.mix.draconium") + .heightRange(20, 40) + .weight(40) + .density(1) + .size(16) + .enableInDim(Horus, Seth, Deimos, Mercury, Miranda, Phobos) + .primary(Materials.Draconium) + .secondary(Materials.Electrotine) + .inBetween(Materials.Jade) + .sporadic(Materials.Vinteum)), + + Quantium(new OreMixBuilder().name("ore.mix.quantium") + .heightRange(5, 25) + .weight(30) + .density(3) + .size(24) + .enableInDim(Horus, Maahes, Venus) + .primary(Materials.Quantium) + .secondary(Materials.Amethyst) + .inBetween(Materials.Rutile) + .sporadic(Materials.Ardite)), + + CallistoIce(new OreMixBuilder().name("ore.mix.callistoice") + .heightRange(40, 60) + .weight(40) + .density(2) + .size(16) + .enableInDim(Anubis, Maahes, Callisto) + .primary(Materials.CallistoIce) + .secondary(Materials.Topaz) + .inBetween(Materials.BlueTopaz) + .sporadic(Materials.Alduorite)), + + Mytryl(new OreMixBuilder().name("ore.mix.mytryl") + .heightRange(10, 30) + .weight(40) + .density(2) + .size(16) + .enableInDim(Anubis, Horus, Io) + .primary(Materials.Mytryl) + .secondary(Materials.Jasper) + .inBetween(Materials.Ceruclase) + .sporadic(Materials.Vulcanite)), + + Ledox(new OreMixBuilder().name("ore.mix.ledox") + .heightRange(55, 65) + .weight(30) + .density(2) + .size(24) + .enableInDim(Horus, Enceladus, DimensionDef.Europa) + .primary(Materials.Ledox) + .secondary(Materials.Opal) + .inBetween(Materials.Orichalcum) + .sporadic(Materials.Rubracium)), + + Oriharukon(new OreMixBuilder().name("ore.mix.oriharukon") + .heightRange(30, 60) + .weight(40) + .density(2) + .size(16) + .enableInDim(Horus, Deimos, Phobos) + .primary(Materials.Oriharukon) + .secondary(Materials.Tanzanite) + .inBetween(Materials.Vyroxeres) + .sporadic(Materials.Mirabilite)), + + BlackPlutonium(new OreMixBuilder().name("ore.mix.blackplutonium") + .heightRange(5, 25) + .weight(40) + .density(2) + .size(24) + .enableInDim(Horus, BarnardC, CentauriAlpha, MakeMake, Pluto, TcetiE) + .primary(Materials.BlackPlutonium) + .secondary(Materials.GarnetRed) + .inBetween(Materials.GarnetYellow) + .sporadic(Materials.Borax)), + + InfusedGold(new OreMixBuilder().name("ore.mix.infusedgold") + .heightRange(15, 40) + .weight(30) + .density(2) + .size(16) + .enableInDim(BarnardE, Haumea, Io, Proteus, Titan, VegaB) + .primary(Materials.Gold) + .secondary(Materials.Gold) + .inBetween(Materials.InfusedGold) + .sporadic(Materials.Platinum)), + + Niobium(new OreMixBuilder().name("ore.mix.niobium") + .heightRange(5, 30) + .weight(60) + .density(2) + .size(24) + .enableInDim(BarnardF, MakeMake, Triton, VegaB) + .primary(Materials.Niobium) + .secondary(Materials.Yttrium) + .inBetween(Materials.Gallium) + .sporadic(Materials.Gallium)), + + TungstenIrons(new OreMixBuilder().name("ore.mix.tungstenirons") + .heightRange(5, 25) + .weight(16) + .density(2) + .size(30) + .enableInDim(Neper, BarnardC, BarnardE, BarnardF, Oberon, Pluto, Proteus, Triton) + .primary(Materials.Tungsten) + .secondary(Materials.Silicon) + .inBetween(Materials.DeepIron) + .sporadic(Materials.ShadowIron)), + + UraniumGTNH(new OreMixBuilder().name("ore.mix.uraniumgtnh") + .heightRange(10, 30) + .weight(60) + .density(2) + .size(24) + .enableInDim(BarnardE, BarnardF, Haumea, Pluto, Triton, VegaB) + .primary(Materials.Thorium) + .secondary(Materials.Uranium) + .inBetween(Materials.Plutonium241) + .sporadic(Materials.Uranium235)), + + VanadiumGold(new OreMixBuilder().name("ore.mix.vanadiumgold") + .heightRange(10, 50) + .weight(60) + .density(2) + .size(24) + .enableInDim(Maahes, BarnardF, Enceladus, MakeMake, Proteus, VegaB) + .primary(Materials.Vanadium) + .secondary(Materials.Magnetite) + .inBetween(Materials.Gold) + .sporadic(Materials.Chrome)), + + NetherStar(new OreMixBuilder().name("ore.mix.netherstar") + .heightRange(20, 60) + .weight(60) + .density(2) + .size(24) + .enableInDim(Horus, BarnardE, Haumea, TcetiE, VegaB) + .primary(Materials.GarnetSand) + .secondary(Materials.NetherStar) + .inBetween(Materials.GarnetRed) + .sporadic(Materials.GarnetYellow)), + + Garnet(new OreMixBuilder().name("ore.mix.garnet") + .heightRange(10, 30) + .weight(40) + .density(2) + .size(16) + .enableInDim(Horus, BarnardF, MakeMake, VegaB) + .primary(Materials.GarnetRed) + .secondary(Materials.GarnetYellow) + .inBetween(Materials.Chrysotile) + .sporadic(Materials.Realgar)), + + RareEarth(new OreMixBuilder().name("ore.mix.rareearth") + .heightRange(30, 60) + .weight(40) + .density(2) + .size(24) + .enableInDim(BarnardE, BarnardF, CentauriAlpha, VegaB) + .primary(Materials.Cadmium) + .secondary(Materials.Caesium) + .inBetween(Materials.Lanthanum) + .sporadic(Materials.Cerium)), + + RichNuclear(new OreMixBuilder().name("ore.mix.richnuclear") + .heightRange(55, 120) + .weight(5) + .density(2) + .size(8) + .enableInDim(Callisto, Ceres, Ganymede, Io) + .primary(Materials.Uranium) + .secondary(Materials.Plutonium) + .inBetween(Materials.Thorium) + .sporadic(Materials.Thorium)), + + HeavyPentele(new OreMixBuilder().name("ore.mix.heavypentele") + .heightRange(40, 60) + .weight(60) + .density(5) + .size(32) + .enableInDim(Neper, Mars, BarnardC, Mercury, Phobos, Titan, VegaB) + .primary(Materials.Arsenic) + .secondary(Materials.Bismuth) + .inBetween(Materials.Antimony) + .sporadic(Materials.Antimony)), + + Europa(new OreMixBuilder().name("ore.mix.europa") + .heightRange(55, 65) + .weight(110) + .density(4) + .size(24) + .enableInDim(Horus, DimensionDef.Europa, TcetiE) + .primary(Materials.Magnesite) + .secondary(Materials.BandedIron) + .inBetween(Materials.Sulfur) + .sporadic(Materials.Opal)), + + EuropaCore(new OreMixBuilder().name("ore.mix.europacore") + .heightRange(5, 15) + .weight(5) + .density(2) + .size(16) + .enableInDim(Maahes, DimensionDef.Europa, TcetiE) + .primary(Materials.Chrome) + .secondary(Materials.Tungstate) + .inBetween(Materials.Molybdenum) + .sporadic(Materials.Manganese)), + + SecondLanthanid(new OreMixBuilder().name("ore.mix.secondlanthanid") + .heightRange(10, 40) + .weight(10) + .density(3) + .size(24) + .enableInDim(Seth, BarnardC, CentauriAlpha) + .primary(Materials.Samarium) + .secondary(Materials.Neodymium) + .inBetween(Materials.Tartarite) + .sporadic(Materials.Tartarite)), + + QuartzSpace(new OreMixBuilder().name("ore.mix.quartzspace") + .heightRange(40, 80) + .weight(20) + .density(3) + .size(16) + .enableInDim(Horus, Moon, Mars, CentauriAlpha, Io, Phobos, Proteus, TcetiE, Venus) + .primary(Materials.Quartzite) + .secondary(Materials.Barite) + .inBetween(Materials.CertusQuartz) + .sporadic(Materials.CertusQuartz)), + + Rutile(new OreMixBuilder().name("ore.mix.rutile") + .heightRange(5, 20) + .weight(8) + .density(4) + .size(12) + .enableInDim(Anubis, Titan, Venus) + .primary(Materials.Rutile) + .secondary(Materials.Titanium) + .inBetween(Materials.Bauxite) + .sporadic(Materials.MeteoricIron)), + + TFGalena(new OreMixBuilder().name("ore.mix.tfgalena") + .heightRange(5, 35) + .weight(40) + .density(4) + .size(16) + .enableInDim(TWILIGHT_FOREST) + .enableInDim(Anubis, Maahes) + .primary(Materials.Galena) + .secondary(Materials.Silver) + .inBetween(Materials.Lead) + .sporadic(Materials.Cryolite)), + + LuVTantalite(new OreMixBuilder().name("ore.mix.luvtantalite") + .heightRange(20, 30) + .weight(10) + .density(4) + .size(16) + .enableInDim(Io, Miranda) + .primary(Materials.Pyrolusite) + .secondary(Materials.Apatite) + .inBetween(Materials.Tantalite) + .sporadic(Materials.Pyrochlore)), + + CertusQuartz(new OreMixBuilder().name("ore.mix.certusquartz") + .heightRange(40, 80) + .weight(60) + .density(5) + .size(32) + .enableInDim(Horus, Neper) + .primary(Materials.CertusQuartz) + .secondary(Materials.CertusQuartz) + .inBetween(Materials.CertusQuartzCharged) + .sporadic(Materials.QuartzSand)), + + InfinityCatalyst(new OreMixBuilder().name("ore.mix.infinitycatalyst") + .heightRange(5, 20) + .weight(15) + .density(2) + .size(16) + .enableInDim(Anubis) + .primary(Materials.Neutronium) + .secondary(Materials.Adamantium) + .inBetween(Materials.InfinityCatalyst) + .sporadic(Materials.Bedrockium)), + + CosmicNeutronium(new OreMixBuilder().name("ore.mix.cosmicneutronium") + .heightRange(5, 20) + .weight(15) + .density(2) + .size(16) + .enableInDim(Horus) + .primary(Materials.Neutronium) + .secondary(Materials.CosmicNeutronium) + .inBetween(Materials.BlackPlutonium) + .sporadic(Materials.Bedrockium)), + + Dilithium(new OreMixBuilder().name("ore.mix.dilithium") + .heightRange(30, 100) + .weight(30) + .density(3) + .size(24) + .enableInDim(Neper) + .primary(Materials.Dilithium) + .secondary(Materials.Dilithium) + .inBetween(Materials.MysteriousCrystal) + .sporadic(Materials.Vinteum)), + + Naquadria(new OreMixBuilder().name("ore.mix.naquadria") + .heightRange(10, 90) + .weight(40) + .density(4) + .size(24) + .enableInDim(Maahes) + .primary(Materials.Naquadah) + .secondary(Materials.NaquadahEnriched) + .inBetween(Materials.Naquadria) + .sporadic(Materials.Trinium)), + + AwakenedDraconium(new OreMixBuilder().name("ore.mix.awakeneddraconium") + .heightRange(20, 40) + .weight(20) + .density(3) + .size(16) + .enableInDim(MehenBelt) + .primary(Materials.Draconium) + .secondary(Materials.Draconium) + .inBetween(Materials.DraconiumAwakened) + .sporadic(Materials.NetherStar)), + + Tengam(new OreMixBuilder().name("ore.mix.tengam") + .heightRange(30, 180) + .weight(80) + .density(2) + .size(32) + .enableInDim(MehenBelt) + .primary(Materials.TengamRaw) + .secondary(Materials.TengamRaw) + .inBetween(Materials.Electrotine) + .sporadic(Materials.Samarium)); + + // spotless : on + + public final OreMixBuilder oreMixBuilder; + + private OreMixes(OreMixBuilder oreMixBuilder) { + this.oreMixBuilder = oreMixBuilder; + } + + public GT_Worldgen_GT_Ore_Layer addGTOreLayer() { + return new GT_Worldgen_GT_Ore_Layer(this.oreMixBuilder); + } + + public GT_Worldgen_GT_Ore_Layer_Space addGaGregOreLayer() { + return new GT_Worldgen_GT_Ore_Layer_Space(this.oreMixBuilder); + } +} diff --git a/src/main/java/gregtech/api/enums/SmallOres.java b/src/main/java/gregtech/api/enums/SmallOres.java new file mode 100644 index 0000000000..6de67bc3b9 --- /dev/null +++ b/src/main/java/gregtech/api/enums/SmallOres.java @@ -0,0 +1,555 @@ +package gregtech.api.enums; + +import static bloodasp.galacticgreg.api.enums.DimensionDef.Anubis; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Asteroids; +import static bloodasp.galacticgreg.api.enums.DimensionDef.BarnardE; +import static bloodasp.galacticgreg.api.enums.DimensionDef.BarnardF; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Callisto; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Ceres; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Deimos; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Enceladus; +import static bloodasp.galacticgreg.api.enums.DimensionDef.EndAsteroids; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Ganymede; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Haumea; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Horus; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Io; +import static bloodasp.galacticgreg.api.enums.DimensionDef.KuiperBelt; +import static bloodasp.galacticgreg.api.enums.DimensionDef.MakeMake; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Mars; +import static bloodasp.galacticgreg.api.enums.DimensionDef.MehenBelt; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Mercury; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Miranda; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Moon; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Oberon; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Phobos; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Pluto; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Proteus; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Seth; +import static bloodasp.galacticgreg.api.enums.DimensionDef.TcetiE; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Titan; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Triton; +import static bloodasp.galacticgreg.api.enums.DimensionDef.VegaB; +import static bloodasp.galacticgreg.api.enums.DimensionDef.Venus; +import static gregtech.common.SmallOreBuilder.NETHER; +import static gregtech.common.SmallOreBuilder.OW; +import static gregtech.common.SmallOreBuilder.THE_END; +import static gregtech.common.SmallOreBuilder.TWILIGHT_FOREST; + +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; +import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import gregtech.common.SmallOreBuilder; + +public enum SmallOres { + + // spotless : off + Copper(new SmallOreBuilder().name("ore.small.copper") + .heightRange(60, 180) + .amount(32) + .ore(Materials.Copper) + .enableInDim(Mars, Phobos, Proteus, Triton) + .enableInDim(NETHER, OW, THE_END)), + + Tin(new SmallOreBuilder().name("ore.small.tin") + .heightRange(80, 220) + .amount(32) + .ore(Materials.Tin) + .enableInDim(MehenBelt, Mars, Deimos, Ganymede, Proteus, Titan, EndAsteroids) + .enableInDim(NETHER, OW, THE_END)), + + Bismuth(new SmallOreBuilder().name("ore.small.bismuth") + .heightRange(80, 120) + .amount(8) + .ore(Materials.Bismuth) + .enableInDim(Mars, Callisto, Ceres, Io, MakeMake, Mercury, Proteus, VegaB) + .enableInDim(NETHER)), + + Coal(new SmallOreBuilder().name("ore.small.coal") + .heightRange(120, 250) + .amount(24) + .ore(Materials.Coal) + .enableInDim(OW)), + + Iron(new SmallOreBuilder().name("ore.small.iron") + .heightRange(40, 100) + .amount(16) + .ore(Materials.Iron) + .enableInDim( + Asteroids, + Mars, + BarnardE, + BarnardF, + Callisto, + Enceladus, + Ganymede, + Haumea, + Io, + KuiperBelt, + Miranda, + Phobos, + Titan, + Triton) + .enableInDim(NETHER, OW, THE_END)), + + Lead(new SmallOreBuilder().name("ore.small.lead") + .heightRange(40, 180) + .amount(16) + .ore(Materials.Lead) + .enableInDim( + Asteroids, + Mars, + Ceres, + Deimos, + Ganymede, + KuiperBelt, + MakeMake, + Mercury, + Oberon, + Pluto, + Triton, + VegaB, + Venus, + EndAsteroids) + .enableInDim(NETHER, THE_END, TWILIGHT_FOREST)), + + Zinc(new SmallOreBuilder().name("ore.small.zinc") + .heightRange(80, 210) + .amount(24) + .ore(Materials.Zinc) + .enableInDim(Mars, BarnardE, Enceladus, Ganymede, Haumea, Io, Mercury, Proteus, Titan, EndAsteroids) + .enableInDim(NETHER, OW, THE_END)), + + Gold(new SmallOreBuilder().name("ore.small.gold") + .heightRange(20, 60) + .amount(8) + .ore(Materials.Gold) + .enableInDim( + Asteroids, + Mars, + BarnardF, + Callisto, + Ceres, + KuiperBelt, + Miranda, + Phobos, + Pluto, + Venus, + EndAsteroids) + .enableInDim(OW, THE_END)), + + Silver(new SmallOreBuilder().name("ore.small.silver") + .heightRange(20, 60) + .amount(20) + .ore(Materials.Silver) + .enableInDim(Enceladus, Io, Oberon, Pluto, Proteus, Titan, Triton, VegaB, EndAsteroids) + .enableInDim(NETHER, OW, THE_END)), + + Nickel(new SmallOreBuilder().name("ore.small.nickel") + .heightRange(80, 150) + .amount(8) + .ore(Materials.Nickel) + .enableInDim( + MehenBelt, + Asteroids, + Mars, + BarnardE, + BarnardF, + Ceres, + Deimos, + KuiperBelt, + MakeMake, + Mercury, + Pluto, + Venus, + EndAsteroids) + .enableInDim(OW, THE_END)), + + Lapis(new SmallOreBuilder().name("ore.small.lapis") + .heightRange(10, 50) + .amount(4) + .ore(Materials.Lapis) + .enableInDim(MehenBelt, Enceladus, Ganymede, Io, Oberon, Phobos, TcetiE) + .enableInDim(OW)), + + Diamond(new SmallOreBuilder().name("ore.small.diamond") + .heightRange(5, 15) + .amount(2) + .ore(Materials.Diamond) + .enableInDim(Asteroids, Callisto, Ceres, Deimos, KuiperBelt, Oberon, Titan, Triton, VegaB, Venus) + .enableInDim(OW)), + + Emerald(new SmallOreBuilder().name("ore.small.emerald") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Emerald) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Ruby(new SmallOreBuilder().name("ore.small.ruby") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Ruby) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Sapphire(new SmallOreBuilder().name("ore.small.sapphire") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Sapphire) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Greensapphire(new SmallOreBuilder().name("ore.small.greensapphire") + .heightRange(5, 35) + .amount(2) + .ore(Materials.GreenSapphire) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Olivine(new SmallOreBuilder().name("ore.small.olivine") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Olivine) + .enableInDim(Horus, MehenBelt) + .enableInDim(TWILIGHT_FOREST)), + + Topaz(new SmallOreBuilder().name("ore.small.topaz") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Topaz) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Tanzanite(new SmallOreBuilder().name("ore.small.tanzanite") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Tanzanite) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Amethyst(new SmallOreBuilder().name("ore.small.amethyst") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Amethyst) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Opal(new SmallOreBuilder().name("ore.small.opal") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Opal) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Jasper(new SmallOreBuilder().name("ore.small.jasper") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Jasper) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Bluetopaz(new SmallOreBuilder().name("ore.small.bluetopaz") + .heightRange(5, 35) + .amount(2) + .ore(Materials.BlueTopaz) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Amber(new SmallOreBuilder().name("ore.small.amber") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Amber) + .enableInDim(TWILIGHT_FOREST)), + + Foolsruby(new SmallOreBuilder().name("ore.small.foolsruby") + .heightRange(5, 35) + .amount(2) + .ore(Materials.FoolsRuby) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Garnetred(new SmallOreBuilder().name("ore.small.garnetred") + .heightRange(5, 35) + .amount(2) + .ore(Materials.GarnetRed) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Garnetyellow(new SmallOreBuilder().name("ore.small.garnetyellow") + .heightRange(5, 35) + .amount(2) + .ore(Materials.GarnetYellow) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Redstone(new SmallOreBuilder().name("ore.small.redstone") + .heightRange(5, 25) + .amount(8) + .ore(Materials.Redstone) + .enableInDim(Mars, Ganymede, Io, Mercury, Proteus, Titan) + .enableInDim(NETHER, OW)), + + Netherquartz(new SmallOreBuilder().name("ore.small.netherquartz") + .heightRange(30, 120) + .amount(64) + .ore(Materials.NetherQuartz) + .enableInDim(NETHER)), + + Saltpeter(new SmallOreBuilder().name("ore.small.saltpeter") + .heightRange(10, 60) + .amount(8) + .ore(Materials.Saltpeter) + .enableInDim(Mars, Deimos, Enceladus, Ganymede, Io, Proteus, Venus) + .enableInDim(NETHER, TWILIGHT_FOREST)), + + Sulfur(new SmallOreBuilder().name("ore.small.sulfur") + .heightRange(5, 60) + .amount(40) + .ore(Materials.Sulfur) + .enableInDim(NETHER)), + + Titanium(new SmallOreBuilder().name("ore.small.titanium") + .heightRange(10, 180) + .amount(32) + .ore(Materials.Titanium) + .enableInDim( + MehenBelt, + Asteroids, + Mars, + BarnardE, + BarnardF, + Callisto, + Ceres, + Deimos, + Enceladus, + Ganymede, + Haumea, + Io, + KuiperBelt, + MakeMake, + Mercury, + Miranda, + Oberon, + Phobos, + Pluto, + Proteus, + Titan, + Triton, + Venus) + + ), + + Tungsten(new SmallOreBuilder().name("ore.small.tungsten") + .heightRange(10, 120) + .amount(16) + .ore(Materials.Tungsten) + .enableInDim(Io, Venus)), + + Meteoriciron(new SmallOreBuilder().name("ore.small.meteoriciron") + .heightRange(50, 70) + .amount(8) + .ore(Materials.MeteoricIron) + .enableInDim(Moon, Mars, Deimos, Io, Phobos, Pluto, Venus)), + + Firestone(new SmallOreBuilder().name("ore.small.firestone") + .heightRange(5, 15) + .amount(2) + .ore(Materials.Firestone) + .enableInDim(Io, Venus)), + + Neutronium(new SmallOreBuilder().name("ore.small.neutronium") + .heightRange(5, 15) + .amount(8) + .ore(Materials.Neutronium) + .enableInDim( + MehenBelt, + BarnardE, + BarnardF, + Enceladus, + Haumea, + KuiperBelt, + MakeMake, + Oberon, + Pluto, + Proteus, + TcetiE, + Titan, + Triton, + VegaB)), + + Chromite(new SmallOreBuilder().name("ore.small.chromite") + .heightRange(20, 40) + .amount(8) + .ore(Materials.Chromite) + .enableInDim( + MehenBelt, + Asteroids, + Mars, + Callisto, + Ceres, + Deimos, + Enceladus, + Ganymede, + Haumea, + Io, + KuiperBelt, + MakeMake, + Mercury, + Oberon, + Phobos, + Pluto, + Proteus, + Titan, + Triton, + VegaB, + Venus)), + + Tungstate(new SmallOreBuilder().name("ore.small.tungstate") + .heightRange(20, 40) + .amount(8) + .ore(Materials.Tungstate) + .enableInDim( + Asteroids, + Mars, + Callisto, + Ceres, + Deimos, + Enceladus, + Ganymede, + Io, + KuiperBelt, + Mercury, + Miranda, + Oberon, + Phobos, + Pluto, + Proteus, + Titan, + Triton, + Venus)), + + Naquadah(new SmallOreBuilder().name("ore.small.naquadah") + .heightRange(5, 25) + .amount(8) + .ore(Materials.Naquadah) + .enableInDim(BarnardE, BarnardF, Ceres, Enceladus, Io, KuiperBelt, Mercury, Pluto, Proteus, Venus)), + + Quantium(new SmallOreBuilder().name("ore.small.quantium") + .heightRange(5, 25) + .amount(6) + .ore(Materials.Quantium) + .enableInDim(Ceres, Haumea, Io, MakeMake, Pluto, Titan)), + + Mythril(new SmallOreBuilder().name("ore.small.mythril") + .heightRange(5, 25) + .amount(6) + .ore(Materials.Mytryl) + .enableInDim(Horus, Callisto, MakeMake, Miranda, Proteus, Venus)), + + Ledox(new SmallOreBuilder().name("ore.small.ledox") + .heightRange(40, 60) + .amount(4) + .ore(Materials.Ledox) + .enableInDim(Callisto, Enceladus, Haumea, Mercury, Oberon, Pluto)), + + Oriharukon(new SmallOreBuilder().name("ore.small.oriharukon") + .heightRange(20, 40) + .amount(6) + .ore(Materials.Oriharukon) + .enableInDim(Mars, Ceres, Haumea, MakeMake, Mercury, Titan, Triton)), + + Draconium(new SmallOreBuilder().name("ore.small.draconium") + .heightRange(5, 15) + .amount(4) + .ore(Materials.Draconium) + .enableInDim(Seth, Deimos, Ganymede, Haumea, MakeMake, Oberon, Phobos, Pluto, Venus)), + + Awdraconium(new SmallOreBuilder().name("ore.small.awdraconium") + .heightRange(5, 15) + .amount(2) + .ore(Materials.DraconiumAwakened) + .enableInDim(Seth, BarnardE, BarnardF, TcetiE, VegaB)), + + Desh(new SmallOreBuilder().name("ore.small.desh") + .heightRange(10, 30) + .amount(6) + .ore(Materials.Desh) + .enableInDim(Callisto, Deimos, Haumea, MakeMake, Mercury, Miranda, Phobos, Proteus, Triton)), + + Blackplutonium(new SmallOreBuilder().name("ore.small.blackplutonium") + .heightRange(25, 45) + .amount(6) + .ore(Materials.BlackPlutonium) + .enableInDim(BarnardE, BarnardF, Haumea, MakeMake, Pluto, Triton, VegaB)), + + Infinitycatalyst(new SmallOreBuilder().name("ore.small.infinitycatalyst") + .heightRange(40, 80) + .amount(6) + .ore(Materials.InfinityCatalyst) + .enableInDim(Anubis, VegaB)), + + Infinity(new SmallOreBuilder().name("ore.small.infinity") + .heightRange(2, 40) + .amount(2) + .ore(Materials.Infinity) + .disabledByDefault()), + + Bedrockium(new SmallOreBuilder().name("ore.small.bedrockium") + .heightRange(5, 25) + .amount(6) + .ore(Materials.Bedrockium) + .enableInDim(BarnardF)), + + Realgar(new SmallOreBuilder().name("ore.small.realgar") + .heightRange(15, 85) + .amount(32) + .ore(Materials.Realgar) + .enableInDim(BarnardF) + .enableInDim(NETHER)), + + Certusquartz(new SmallOreBuilder().name("ore.small.certusquartz") + .heightRange(5, 115) + .amount(16) + .ore(Materials.CertusQuartz) + .enableInDim(Horus) + .enableInDim(NETHER)), + + Jade(new SmallOreBuilder().name("ore.small.jade") + .heightRange(5, 35) + .amount(2) + .ore(Materials.Jade) + .enableInDim(Horus) + .enableInDim(TWILIGHT_FOREST)), + + Deepiron(new SmallOreBuilder().name("ore.small.deepiron") + .heightRange(5, 40) + .amount(8) + .ore(Materials.DeepIron) + .enableInDim(Mercury)), + + Redgarnet(new SmallOreBuilder().name("ore.small.redgarnet") + .heightRange(5, 35) + .amount(2) + .ore(Materials.GarnetRed) + .enableInDim(Horus)), + + Chargedcertus(new SmallOreBuilder().name("ore.small.chargedcertus") + .heightRange(5, 115) + .amount(4) + .ore(Materials.CertusQuartzCharged) + .enableInDim(Horus)),; + // spotless : on + + public final SmallOreBuilder smallOreBuilder; + + private SmallOres(gregtech.common.SmallOreBuilder smallOreBuilder) { + this.smallOreBuilder = smallOreBuilder; + } + + public GT_Worldgen_GT_Ore_SmallPieces addGTSmallOre() { + return new GT_Worldgen_GT_Ore_SmallPieces(this.smallOreBuilder); + } + + public GT_Worldgen_GT_Ore_SmallPieces_Space addGaGregSmallOre() { + return new GT_Worldgen_GT_Ore_SmallPieces_Space(this.smallOreBuilder); + } +} diff --git a/src/main/java/gregtech/api/enums/UndergroundFluidNames.java b/src/main/java/gregtech/api/enums/UndergroundFluidNames.java new file mode 100644 index 0000000000..5e96544bd2 --- /dev/null +++ b/src/main/java/gregtech/api/enums/UndergroundFluidNames.java @@ -0,0 +1,43 @@ +package gregtech.api.enums; + +public enum UndergroundFluidNames { + + carbonDioxide("carbondioxide"), + carbonMonoxide("carbonmonoxide"), + chlorobenzene("chlorobenzene"), + deuterium("deuterium"), + distilledWater("ic2distilledwater"), + ethane("ethane"), + ethylene("ethylene"), + fluorine("fluorine"), + heavyOil("liquid_heavy_oil"), + helium3("helium-3"), + hydrofluoricAcid("hydrofluoricacid_gt5u"), + hydrogen("hydrogen"), + hydrogenSulfide("liquid_hydricsulfur"), + lava("lava"), + lightOil("liquid_light_oil"), + liquidAir("liquidair"), + mediumOil("liquid_medium_oil"), + methane("methane"), + moltenCopper("molten.copper"), + moltenIron("molten.iron"), + moltenLead("molten.lead"), + moltenTin("molten.tin"), + naturalGas("gas_natural_gas"), + nitrogen("nitrogen"), + oil("oil"), + oxygen("oxygen"), + saltWater("saltwater"), + sulfuricAcid("sulfuricacid"), + unknownWater("unknowwater"), + veryHeavyOil("liquid_extra_heavy_oil"), + + ; + + public final String name; + + private UndergroundFluidNames(String name) { + this.name = name; + } +} diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 946caaa172..4959f8b060 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -35,7 +35,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregtechWailaProvider; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Util; /** @@ -122,7 +121,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * Called to set Configuration values for this MetaTileEntity. Use aConfig.get(ConfigCategories.machineconfig, * "MetaTileEntityName.Ability", DEFAULT_VALUE); to set the Values. */ - void onConfigLoad(GT_Config aConfig); + void onConfigLoad(); /** * If a Cover of that Type can be placed on this Side. Also Called when the Facing of the Block Changes and a Cover diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index a4c5df4efe..8971db2d92 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -41,7 +41,6 @@ import gregtech.api.interfaces.tileentity.IColoredTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_LanguageManager; @@ -239,7 +238,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } @Override - public void onConfigLoad(GT_Config aConfig) { + public void onConfigLoad() { /* Do nothing */ } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 604c1dfb3b..d4f8aa6ba4 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -52,7 +52,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; @@ -204,7 +203,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei } @Override - public void onConfigLoad(GT_Config aConfig) { + public void onConfigLoad() { /* Do nothing */ } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index f5ab88fb45..e44860963f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -76,9 +76,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public int mTransferredAmperage = 0; - public int mOverheat; - public static short mMaxOverheat = (short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100); - public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aID, aName, aNameRegional, 0); @@ -471,13 +468,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile final long maxVoltageOut = (mVoltage - mCableLossPerMeter) * mAmperage; return new String[] { - "Heat: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mOverheat) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxOverheat) - + EnumChatFormatting.RESET, "Amperage: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(currAmp) + EnumChatFormatting.RESET diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index d94a7c0ac2..cafd1c9cb7 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -40,8 +40,6 @@ import org.apache.commons.lang3.tuple.MutableTriple; import cpw.mods.fml.common.Optional; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; @@ -66,6 +64,7 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; import gregtech.common.GT_Client; +import gregtech.common.config.other.ConfigGeneral; import gregtech.common.covers.CoverInfo; import gregtech.common.covers.GT_Cover_Drain; import gregtech.common.covers.GT_Cover_FluidRegulator; @@ -512,7 +511,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { boolean wasActionPerformed = false; - int limit = GregTech_API.sSpecialFile.get(ConfigCategories.general, "PipeWrenchingChainRange", 64); + int limit = ConfigGeneral.pipeWrenchingChainRange; for (int connected = 0; connected < limit; connected++) { TileEntity nextPipeBaseTile = currentPipeBase.getTileEntityAtSide(tSide); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 4ffe82b1c2..fb77abd8b2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -58,8 +58,6 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.SoundResource; import gregtech.api.enums.VoidingMode; import gregtech.api.gui.modularui.GT_UIInfos; @@ -94,6 +92,7 @@ import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.client.GT_SoundLoop; import gregtech.common.GT_Pollution; +import gregtech.common.config.machinestats.ConfigMachines; import gregtech.common.gui.modularui.widget.CheckRecipeResultSyncer; import gregtech.common.gui.modularui.widget.ShutDownReasonSyncer; import gregtech.common.items.GT_MetaGenerated_Tool_01; @@ -169,12 +168,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 2); this.processingLogic = null; - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); - this.damageFactorLow = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); - this.damageFactorHigh = (float) GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; + this.damageFactorLow = ConfigMachines.damageFactorLow; + this.damageFactorHigh = ConfigMachines.damageFactorHigh; this.mNEI = ""; if (!shouldCheckMaintenance()) fixAllIssues(); } @@ -182,12 +178,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public GT_MetaTileEntity_MultiBlockBase(String aName) { super(aName, 2); this.processingLogic = createProcessingLogic(); - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); - this.damageFactorLow = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); - this.damageFactorHigh = (float) GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; + this.damageFactorLow = ConfigMachines.damageFactorLow; + this.damageFactorHigh = ConfigMachines.damageFactorHigh; if (!shouldCheckMaintenance()) fixAllIssues(); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java index a8c26957f8..de7019b292 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -1,6 +1,7 @@ package gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Mods.EnderIO; import static mcp.mobius.waila.api.SpecialChars.BLUE; import static mcp.mobius.waila.api.SpecialChars.GOLD; import static mcp.mobius.waila.api.SpecialChars.GREEN; @@ -194,7 +195,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi .extractEnergy(GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false); tEU = tEU * GregTech_API.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits(ForgeDirection.UNKNOWN, Math.min(tEU, maxEUInput()), 1); - } else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer powerContainer + } else if (EnderIO.isModLoaded() && tTileEntity instanceof IPowerContainer powerContainer && powerContainer.getEnergyStored() > 0) { final int storedRF = powerContainer.getEnergyStored(); final int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU); diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java index 95d4246cb6..f057614ccf 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java @@ -1,5 +1,58 @@ package gregtech.api.objects; +import static gregtech.api.enums.Dimensions.AlphaCentauriBb; +import static gregtech.api.enums.Dimensions.BarnardaC; +import static gregtech.api.enums.Dimensions.BarnardaE; +import static gregtech.api.enums.Dimensions.BarnardaF; +import static gregtech.api.enums.Dimensions.Callisto; +import static gregtech.api.enums.Dimensions.Europa; +import static gregtech.api.enums.Dimensions.Io; +import static gregtech.api.enums.Dimensions.Makemake; +import static gregtech.api.enums.Dimensions.Mars; +import static gregtech.api.enums.Dimensions.Mercury; +import static gregtech.api.enums.Dimensions.Miranda; +import static gregtech.api.enums.Dimensions.Moon; +import static gregtech.api.enums.Dimensions.Oberon; +import static gregtech.api.enums.Dimensions.Overworld; +import static gregtech.api.enums.Dimensions.Pluto; +import static gregtech.api.enums.Dimensions.Proteus; +import static gregtech.api.enums.Dimensions.Ross128b; +import static gregtech.api.enums.Dimensions.Ross128ba; +import static gregtech.api.enums.Dimensions.TCetiE; +import static gregtech.api.enums.Dimensions.Titan; +import static gregtech.api.enums.Dimensions.Triton; +import static gregtech.api.enums.Dimensions.Venus; +import static gregtech.api.enums.UndergroundFluidNames.carbonDioxide; +import static gregtech.api.enums.UndergroundFluidNames.carbonMonoxide; +import static gregtech.api.enums.UndergroundFluidNames.chlorobenzene; +import static gregtech.api.enums.UndergroundFluidNames.deuterium; +import static gregtech.api.enums.UndergroundFluidNames.distilledWater; +import static gregtech.api.enums.UndergroundFluidNames.ethane; +import static gregtech.api.enums.UndergroundFluidNames.ethylene; +import static gregtech.api.enums.UndergroundFluidNames.fluorine; +import static gregtech.api.enums.UndergroundFluidNames.heavyOil; +import static gregtech.api.enums.UndergroundFluidNames.helium3; +import static gregtech.api.enums.UndergroundFluidNames.hydrofluoricAcid; +import static gregtech.api.enums.UndergroundFluidNames.hydrogen; +import static gregtech.api.enums.UndergroundFluidNames.hydrogenSulfide; +import static gregtech.api.enums.UndergroundFluidNames.lava; +import static gregtech.api.enums.UndergroundFluidNames.lightOil; +import static gregtech.api.enums.UndergroundFluidNames.liquidAir; +import static gregtech.api.enums.UndergroundFluidNames.mediumOil; +import static gregtech.api.enums.UndergroundFluidNames.methane; +import static gregtech.api.enums.UndergroundFluidNames.moltenCopper; +import static gregtech.api.enums.UndergroundFluidNames.moltenIron; +import static gregtech.api.enums.UndergroundFluidNames.moltenLead; +import static gregtech.api.enums.UndergroundFluidNames.moltenTin; +import static gregtech.api.enums.UndergroundFluidNames.naturalGas; +import static gregtech.api.enums.UndergroundFluidNames.nitrogen; +import static gregtech.api.enums.UndergroundFluidNames.oil; +import static gregtech.api.enums.UndergroundFluidNames.oxygen; +import static gregtech.api.enums.UndergroundFluidNames.saltWater; +import static gregtech.api.enums.UndergroundFluidNames.sulfuricAcid; +import static gregtech.api.enums.UndergroundFluidNames.unknownWater; +import static gregtech.api.enums.UndergroundFluidNames.veryHeavyOil; + import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; @@ -7,6 +60,9 @@ import net.minecraftforge.common.config.Configuration; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import gregtech.api.enums.Dimensions; +import gregtech.api.enums.UndergroundFluidNames; + public class GT_UO_DimensionList { private Configuration fConfig; @@ -19,6 +75,10 @@ public class GT_UO_DimensionList { fDimensionList = HashBiMap.create(); } + public void save() { + fConfig.save(); + } + public GT_UO_Dimension GetDimension(int aDimension) { if (CheckBlackList(aDimension)) return null; if (fDimensionList.containsKey(Integer.toString(aDimension))) @@ -59,26 +119,463 @@ public class GT_UO_DimensionList { // IT IS IN BUCKETS!!! } - public void SetDafultValues() { - SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 700, 20, 7); - SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 650, 20, 6); - SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 600, 20, 5); - SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 550, 20, 4); - SetConfigValues("Overworld", "0", "oil", "oil", 0, 600, 20, 5); - SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 24, 128, 100, 1); + private void setOverworldValues() { + new ConfigSetter().dimension(Overworld) + .fluid(naturalGas) + .chance(20) + .decreaseAmount(5) + .maxAmount(350) + .minAmount(10) + .writeToConfig(); + + new ConfigSetter().dimension(Overworld) + .fluid(lightOil) + .chance(20) + .decreaseAmount(5) + .maxAmount(350) + .minAmount(10) + .writeToConfig(); + + new ConfigSetter().dimension(Overworld) + .fluid(mediumOil) + .chance(20) + .decreaseAmount(5) + .maxAmount(625) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Overworld) + .fluid(heavyOil) + .chance(20) + .decreaseAmount(5) + .maxAmount(625) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Overworld) + .fluid(oil) + .chance(20) + .decreaseAmount(5) + .maxAmount(625) + .minAmount(0) + .writeToConfig(); + } + + private void setMoonValues() { + new ConfigSetter().dimension(Moon) + .fluid(helium3) + .chance(100) + .decreaseAmount(5) + .maxAmount(425) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Moon) + .fluid(saltWater) + .chance(20) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + } + + private void setMercuryValues() { + new ConfigSetter().dimension(Mercury) + .fluid(helium3) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Mercury) + .fluid(moltenIron) + .chance(30) + .decreaseAmount(5) + .maxAmount(400) + .minAmount(0) + .writeToConfig(); + } + + private void setVenusValues() { + new ConfigSetter().dimension(Venus) + .fluid(moltenLead) + .chance(100) + .decreaseAmount(5) + .maxAmount(1600) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Venus) + .fluid(sulfuricAcid) + .chance(100) + .decreaseAmount(5) + .maxAmount(250) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Venus) + .fluid(carbonDioxide) + .chance(100) + .decreaseAmount(5) + .maxAmount(1500) + .minAmount(0) + .writeToConfig(); + } + + private void setMarsValues() { + new ConfigSetter().dimension(Mars) + .fluid(saltWater) + .chance(100) + .decreaseAmount(5) + .maxAmount(400) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Mars) + .fluid(chlorobenzene) + .chance(100) + .decreaseAmount(5) + .maxAmount(400) + .minAmount(0) + .writeToConfig(); + } + + private void setIoValues() { + new ConfigSetter().dimension(Io) + .fluid(moltenLead) + .chance(20) + .decreaseAmount(5) + .maxAmount(650) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Io) + .fluid(sulfuricAcid) + .chance(80) + .decreaseAmount(5) + .maxAmount(350) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Io) + .fluid(carbonDioxide) + .chance(80) + .decreaseAmount(5) + .maxAmount(750) + .minAmount(0) + .writeToConfig(); + } + + private void setEuropaValues() { + new ConfigSetter().dimension(Europa) + .fluid(saltWater) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Europa) + .fluid(veryHeavyOil) + .chance(20) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Europa) + .fluid(distilledWater) + .chance(80) + .decreaseAmount(5) + .maxAmount(3500) + .minAmount(0) + .writeToConfig(); + } + + private void setCallistoValues() { + new ConfigSetter().dimension(Callisto) + .fluid(oxygen) + .chance(100) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Callisto) + .fluid(liquidAir) + .chance(100) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + } + + private void setTitanValues() { + new ConfigSetter().dimension(Titan) + .fluid(methane) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Titan) + .fluid(ethane) + .chance(100) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + } + + private void setMirandaValues() { + new ConfigSetter().dimension(Miranda) + .fluid(hydrogenSulfide) + .chance(100) + .decreaseAmount(5) + .maxAmount(900) + .minAmount(0) + .writeToConfig(); + } + + private void setOberonValues() { + new ConfigSetter().dimension(Oberon) + .fluid(carbonMonoxide) + .chance(100) + .decreaseAmount(5) + .maxAmount(2000) + .minAmount(0) + .writeToConfig(); + } + + private void setTritonValues() { + new ConfigSetter().dimension(Triton) + .fluid(nitrogen) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Triton) + .fluid(ethylene) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + } + + private void setProteusValues() { + new ConfigSetter().dimension(Proteus) + .fluid(deuterium) + .chance(100) + .decreaseAmount(5) + .maxAmount(700) + .minAmount(0) + .writeToConfig(); + } + + private void setPlutoValues() { + new ConfigSetter().dimension(Pluto) + .fluid(nitrogen) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Pluto) + .fluid(oxygen) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Pluto) + .fluid(liquidAir) + .chance(40) + .decreaseAmount(5) + .maxAmount(300) + .minAmount(4) + .writeToConfig(); + + new ConfigSetter().dimension(Pluto) + .fluid(fluorine) + .chance(80) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(4) + .writeToConfig(); + } + + private void setMakeMakeValues() { + new ConfigSetter().dimension(Makemake) + .fluid(hydrofluoricAcid) + .chance(80) + .decreaseAmount(5) + .maxAmount(300) + .minAmount(0) + .writeToConfig(); + } + + private void setAlphaCentauriBBValues() { + new ConfigSetter().dimension(AlphaCentauriBb) + .fluid(moltenCopper) + .chance(10) + .decreaseAmount(5) + .maxAmount(300) + .minAmount(0) + .writeToConfig(); + } + + private void setBarnardaCValues() { + new ConfigSetter().dimension(BarnardaC) + .fluid(veryHeavyOil) + .chance(100) + .decreaseAmount(5) + .maxAmount(800) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(BarnardaC) + .fluid(unknownWater) + .chance(100) + .decreaseAmount(5) + .maxAmount(300) + .minAmount(0) + .writeToConfig(); + } + + private void setBarnardaEValues() { + new ConfigSetter().dimension(BarnardaE) + .fluid(liquidAir) + .chance(20) + .decreaseAmount(5) + .maxAmount(400) + .minAmount(0) + .writeToConfig(); + } + + private void setBarnardaFValues() { + new ConfigSetter().dimension(BarnardaF) + .fluid(moltenTin) + .chance(15) + .decreaseAmount(5) + .maxAmount(400) + .minAmount(0) + .writeToConfig(); + } + + private void setTcetiEValues() { + new ConfigSetter().dimension(TCetiE) + .fluid(veryHeavyOil) + .chance(100) + .decreaseAmount(5) + .maxAmount(200) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(TCetiE) + .fluid(hydrogen) + .chance(50) + .decreaseAmount(5) + .maxAmount(700) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(TCetiE) + .fluid(distilledWater) + .chance(100) + .decreaseAmount(5) + .maxAmount(10_000) + .minAmount(0) + .writeToConfig(); + } + + private void setRoss128bValues() { + new ConfigSetter().dimension(Ross128b) + .fluid(veryHeavyOil) + .chance(40) + .decreaseAmount(5) + .maxAmount(625) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Ross128b) + .fluid(lava) + .chance(5) + .decreaseAmount(5) + .maxAmount(820) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Ross128b) + .fluid(naturalGas) + .chance(65) + .decreaseAmount(5) + .maxAmount(625) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Ross128b) + .fluid(distilledWater) + .chance(100) + .decreaseAmount(5) + .maxAmount(5000) + .minAmount(0) + .writeToConfig(); + } + + private void setRoss128baValues() { + new ConfigSetter().dimension(Ross128ba) + .fluid(saltWater) + .chance(40) + .decreaseAmount(5) + .maxAmount(1250) + .minAmount(0) + .writeToConfig(); + + new ConfigSetter().dimension(Ross128ba) + .fluid(helium3) + .chance(60) + .decreaseAmount(5) + .maxAmount(1250) + .minAmount(0) + .writeToConfig(); + } + + public void setDefaultValues() { + setOverworldValues(); + setMoonValues(); + setMercuryValues(); + setVenusValues(); + setMarsValues(); + setIoValues(); + setEuropaValues(); + setCallistoValues(); + setTitanValues(); + setMirandaValues(); + setOberonValues(); + setTritonValues(); + setProteusValues(); + setPlutoValues(); + setMakeMakeValues(); + setAlphaCentauriBBValues(); + setBarnardaCValues(); + setBarnardaEValues(); + setBarnardaFValues(); + setTcetiEValues(); + setRoss128bValues(); + setRoss128baValues(); } public void getConfig(Configuration aConfig, String aCategory) { fCategory = aCategory; fConfig = aConfig; - if (!fConfig.hasCategory(fCategory)) SetDafultValues(); - - fConfig.setCategoryComment(fCategory, "Config Underground Fluids (Delete this Category for regenerate)"); - fConfig.setCategoryComment( - fCategory + ".Default", - "Set Default Generating (Use this Category for Default settings)"); - fConfig.setCategoryComment(fCategory + ".Overworld", "Set Overworld Generating"); - fConfig.setCategoryComment(fCategory + ".Moon", "Set Moon Generating"); + if (!fConfig.hasCategory(fCategory)) setDefaultValues(); blackList = new int[] { -1, 1 }; blackList = aConfig.get(fCategory, "DimBlackList", blackList, "Dimension IDs Black List") @@ -94,5 +591,58 @@ public class GT_UO_DimensionList { .toArray()[i]); fDimensionList.put(Dimension.Dimension, Dimension); } + save(); + } + + public class ConfigSetter { + + private int chance; + private int decreaseAmount; + private int maxAmount; + private int minAmount; + private UndergroundFluidNames fluid; + private Dimensions dim; + + public ConfigSetter chance(int chance) { + this.chance = chance; + return this; + } + + public ConfigSetter decreaseAmount(int decreaseAmount) { + this.decreaseAmount = decreaseAmount; + return this; + } + + public ConfigSetter maxAmount(int maxAmount) { + this.maxAmount = maxAmount; + return this; + } + + public ConfigSetter minAmount(int minAmount) { + this.minAmount = minAmount; + return this; + } + + public ConfigSetter fluid(UndergroundFluidNames fluid) { + this.fluid = fluid; + return this; + } + + public ConfigSetter dimension(Dimensions dim) { + this.dim = dim; + return this; + } + + public void writeToConfig() { + SetConfigValues( + dim.toString(), + dim.id, + fluid.toString(), + fluid.name, + minAmount, + maxAmount, + chance, + decreaseAmount); + } } } diff --git a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java index 53152312f4..b38b66e41b 100644 --- a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java @@ -9,8 +9,6 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; @@ -25,12 +23,8 @@ public class LargeBoilerFuelBackend extends RecipeMapBackend { private static boolean addedGeneralDesc = false; - private static final List<String> ALLOWED_SOLID_FUELS = Arrays.asList( - GregTech_API.sMachineFile.mConfig.getStringList( - "LargeBoiler.allowedFuels", - ConfigCategories.machineconfig.toString(), - new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" }, - "Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler")); + private static final List<String> ALLOWED_SOLID_FUELS = Arrays + .asList("gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7"); public LargeBoilerFuelBackend(RecipeMapBackendPropertiesBuilder propertiesBuilder) { super(propertiesBuilder); diff --git a/src/main/java/gregtech/api/util/GT_ClientPreference.java b/src/main/java/gregtech/api/util/GT_ClientPreference.java index 8df4ef8b05..3ea2730a0c 100644 --- a/src/main/java/gregtech/api/util/GT_ClientPreference.java +++ b/src/main/java/gregtech/api/util/GT_ClientPreference.java @@ -1,5 +1,8 @@ package gregtech.api.util; +import gregtech.common.config.client.ConfigPreference; +import gregtech.common.config.client.ConfigWaila; + public class GT_ClientPreference { private final boolean mSingleBlockInitialFilter; @@ -15,12 +18,11 @@ public class GT_ClientPreference { this.wailaAverageNS = wailaAverageNS; } - public GT_ClientPreference(GT_Config aClientDataFile) { - this.mSingleBlockInitialFilter = aClientDataFile.get("preference", "mSingleBlockInitialFilter", false); - this.mSingleBlockInitialMultiStack = aClientDataFile - .get("preference", "mSingleBlockInitialAllowMultiStack", false); - this.mInputBusInitialFilter = aClientDataFile.get("preference", "mInputBusInitialFilter", true); - this.wailaAverageNS = aClientDataFile.get("waila", "WailaAverageNS", false); + public GT_ClientPreference() { + this.mSingleBlockInitialFilter = ConfigPreference.singleBlockInitialFilter; + this.mSingleBlockInitialMultiStack = ConfigPreference.singleBlockInitialAllowMultiStack; + this.mInputBusInitialFilter = ConfigPreference.inputBusInitialFilter; + this.wailaAverageNS = ConfigWaila.wailaAverageNS; } public boolean isSingleBlockInitialFilterEnabled() { diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java index dc56def68f..e1157febb4 100644 --- a/src/main/java/gregtech/api/util/GT_Config.java +++ b/src/main/java/gregtech/api/util/GT_Config.java @@ -14,6 +14,8 @@ public class GT_Config implements Runnable { public static boolean troll = false; public static Configuration sConfigFileIDs; + public static Configuration cleanroomFile; + public static Configuration undergroundFluidsFile; public final Configuration mConfig; public GT_Config(Configuration aConfig) { @@ -38,7 +40,7 @@ public class GT_Config implements Runnable { aName.replaceAll("\\|", "."), aDefault); int rResult = tProperty.getInt(aDefault); - if (!tProperty.wasRead() && shouldSave()) sConfigFileIDs.save(); + sConfigFileIDs.save(); return rResult; } diff --git a/src/main/java/gregtech/api/world/GT_Worldgen.java b/src/main/java/gregtech/api/world/GT_Worldgen.java index bd85813e2b..1ce0c85523 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen.java @@ -1,6 +1,5 @@ package gregtech.api.world; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Random; @@ -10,7 +9,8 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.DimensionManager; -import gregtech.api.GregTech_API; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; public abstract class GT_Worldgen { @@ -21,7 +21,7 @@ public abstract class GT_Worldgen { @SuppressWarnings({ "unchecked", "rawtypes" }) // The adding of "this" needs a List<this> which does not exist public GT_Worldgen(String aName, List aList, boolean aDefault) { mWorldGenName = aName; - mEnabled = GregTech_API.sWorldgenFile.get("worldgen", mWorldGenName, aDefault); + mEnabled = aDefault; if (mEnabled) aList.add(this); } @@ -45,32 +45,6 @@ public abstract class GT_Worldgen { } /** - * @param aWorld The World Object - * @param aRandom The Random Generator to use - * @param aBiome The Name of the Biome (always != null) - * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End - * @param aChunkX xCoord of the Chunk - * @param aChunkZ zCoord of the Chunk - * @return if the Worldgeneration has been successfully completed - */ - public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - return false; - } - - /** - * - * @param aWorld The World Object - * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End - * @param aAllowedDimensionType The Type of allowed Worldgeneration - * @return if generation for this world is allowed for MoronTech (tm) OreGen (ATM (2.0.3.1Dev) only End, Nether, - * Overworld, Twilight Forest and Deep Dark) - */ - public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return isGenerationAllowed(aWorld.provider.getDimensionName(), aDimensionType, aAllowedDimensionType); - } - - /** * * @param aDimName The Dimension Name * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End @@ -79,17 +53,17 @@ public abstract class GT_Worldgen { * Overworld, Twilight Forest and Deep Dark) */ public boolean isGenerationAllowed(String aDimName, int aDimensionType, int aAllowedDimensionType) { + if (aDimName.equalsIgnoreCase("Underdark")) { + return false; + } if (!(aDimName.equalsIgnoreCase("Overworld") || aDimName.equalsIgnoreCase("Nether") || aDimName.equalsIgnoreCase("The End") - || aDimName.equalsIgnoreCase("Twilight Forest") - || aDimName.equalsIgnoreCase("Underdark"))) return false; + || aDimName.equalsIgnoreCase("Twilight Forest"))) return false; Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { - boolean tValue = GregTech_API.sWorldgenFile - .get("worldgen." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); - mDimensionMap.put(aDimName, tValue); - return tValue; + mDimensionMap.put(aDimName, aDimensionType == aAllowedDimensionType); + return aDimensionType == aAllowedDimensionType; } return tAllowed; } @@ -112,20 +86,32 @@ public abstract class GT_Worldgen { */ public boolean isGenerationAllowed(World aWorld, Class... aAllowedDimensionTypes) { String aDimName = aWorld.provider.getDimensionName(); + if (aDimName.equalsIgnoreCase("Underdark")) { + return false; + } if (!(aDimName.equalsIgnoreCase("Overworld") || aDimName.equalsIgnoreCase("Nether") || aDimName.equalsIgnoreCase("The End") - || aDimName.equalsIgnoreCase("Twilight Forest") - || aDimName.equalsIgnoreCase("Underdark"))) return false; + || aDimName.equalsIgnoreCase("Twilight Forest"))) return false; Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { - boolean tValue = GregTech_API.sWorldgenFile.get( - "worldgen." + mWorldGenName, - aDimName, - Arrays.stream(aAllowedDimensionTypes) - .anyMatch(worldProvider -> worldProvider.isInstance(aWorld.provider))); - mDimensionMap.put(aDimName, tValue); - return tValue; + boolean value = false; + for (int i = 0; i < aAllowedDimensionTypes.length; i++) { + if (aAllowedDimensionTypes[i].isInstance(aWorld.provider)) { + value = true; + } + } + + // ugly, but idk how to do it better without hard depping on tf provider in ore constructors + if (this instanceof GT_Worldgen_GT_Ore_SmallPieces) { + value = ((GT_Worldgen_GT_Ore_SmallPieces) this).twilightForest && aWorld.provider.dimensionId == 7; + } + if (this instanceof GT_Worldgen_GT_Ore_Layer) { + value = ((GT_Worldgen_GT_Ore_Layer) this).twilightForest && aWorld.provider.dimensionId == 7; + } + + mDimensionMap.put(aDimName, value); + return value; } return tAllowed; } diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java deleted file mode 100644 index 958adfad54..0000000000 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java +++ /dev/null @@ -1,34 +0,0 @@ -package gregtech.api.world; - -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.block.Block; - -import gregtech.api.GregTech_API; - -public abstract class GT_Worldgen_Ore extends GT_Worldgen { - - public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType; - public final Block mBlock; - public final Collection<String> mBiomeList; - public final boolean mAllowToGenerateinVoid; - private final String aTextWorldgen = "worldgen."; - - public GT_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { - super(aName, GregTech_API.sWorldgenList, aDefault); - mDimensionType = aDimensionType; - mBlock = aBlock; - mBlockMeta = Math.min(Math.max(aBlockMeta, 0), 15); - mProbability = GregTech_API.sWorldgenFile.get(aTextWorldgen + mWorldGenName, "Probability", aProbability); - mAmount = GregTech_API.sWorldgenFile.get(aTextWorldgen + mWorldGenName, "Amount", aAmount); - mSize = GregTech_API.sWorldgenFile.get(aTextWorldgen + mWorldGenName, "Size", aSize); - mMinY = GregTech_API.sWorldgenFile.get(aTextWorldgen + mWorldGenName, "MinHeight", aMinY); - mMaxY = GregTech_API.sWorldgenFile.get(aTextWorldgen + mWorldGenName, "MaxHeight", aMaxY); - if (aBiomeList == null) mBiomeList = new ArrayList<>(); - else mBiomeList = aBiomeList; - mAllowToGenerateinVoid = aAllowToGenerateinVoid; - } -} diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java deleted file mode 100644 index f89d3ad8f8..0000000000 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java +++ /dev/null @@ -1,52 +0,0 @@ -package gregtech.api.world; - -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -public class GT_Worldgen_Ore_SingleBlock extends GT_Worldgen_Ore { - - public GT_Worldgen_Ore_SingleBlock(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { - super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (isGenerationAllowed(aWorld, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { - for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); - Block tBlock = aWorld.getBlock(tX, tY, tZ); - if (((mAllowToGenerateinVoid && aWorld.getBlock(tX, tY, tZ) - .isAir(aWorld, tX, tY, tZ)) - || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { - aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); - } - } - return true; - } - return false; - } -} diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java deleted file mode 100644 index 3993c65f2a..0000000000 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java +++ /dev/null @@ -1,54 +0,0 @@ -package gregtech.api.world; - -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -public class GT_Worldgen_Ore_SingleBlock_UnderLava extends GT_Worldgen_Ore { - - public GT_Worldgen_Ore_SingleBlock_UnderLava(String aName, boolean aDefault, Block aBlock, int aBlockMeta, - int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, - Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) { - super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); - } - - @Override - public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (isGenerationAllowed(aWorld, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { - for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); - Block tBlock = aWorld.getBlock(tX, tY, tZ); - if (((mAllowToGenerateinVoid && aWorld.getBlock(tX, tY, tZ) - .isAir(aWorld, tX, tY, tZ)) - || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { - if (aWorld.getBlock(tX, tY + 1, tZ) == Blocks.lava - || aWorld.getBlock(tX, tY, tZ) == Blocks.flowing_lava) - aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); - } - } - return true; - } - return false; - } -} diff --git a/src/main/java/gregtech/client/GT_GUI_ClientConfig.java b/src/main/java/gregtech/client/GT_GUI_ClientConfig.java index 1e9841369b..dfb4b2800c 100644 --- a/src/main/java/gregtech/client/GT_GUI_ClientConfig.java +++ b/src/main/java/gregtech/client/GT_GUI_ClientConfig.java @@ -2,62 +2,28 @@ package gregtech.client; import static gregtech.api.enums.Mods.GregTech; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import net.minecraft.client.gui.GuiScreen; -import net.minecraftforge.common.config.ConfigCategory; -import net.minecraftforge.common.config.ConfigElement; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import cpw.mods.fml.client.config.GuiConfig; -import cpw.mods.fml.client.config.IConfigElement; -import gregtech.api.GregTech_API; +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig; + +import gregtech.common.config.client.ConfigColorModulation; +import gregtech.common.config.client.ConfigInterface; +import gregtech.common.config.client.ConfigPreference; +import gregtech.common.config.client.ConfigRender; +import gregtech.common.config.client.ConfigWaila; -public class GT_GUI_ClientConfig extends GuiConfig { +public class GT_GUI_ClientConfig extends SimpleGuiConfig { - public GT_GUI_ClientConfig(GuiScreen parentScreen) { + public GT_GUI_ClientConfig(GuiScreen parentScreen) throws ConfigException { super( parentScreen, - getConfigElements(), GregTech.ID, - "client", - false, - false, - getAbridgedConfigPath(GregTech_API.sClientDataFile.mConfig.toString())); - } - - @SuppressWarnings("rawtypes") - private static List<IConfigElement> getConfigElements() { - final Configuration config = GregTech_API.sClientDataFile.mConfig; - setLanguageKeys(config); - return config.getCategoryNames() - .stream() - .filter(name -> name.indexOf('.') == -1) - .map(name -> new ConfigElement(config.getCategory(name))) - .collect(Collectors.toList()); - } - - private static void setLanguageKeys(Configuration config) { - for (String categoryName : config.getCategoryNames()) { - ConfigCategory category = config.getCategory(categoryName); - category.setLanguageKey("GT5U.config." + categoryName); - for (Map.Entry<String, Property> entry : category.entrySet()) { - // drop the default value in name - String name = entry.getKey(); - int defaultStart = name.lastIndexOf('_'); - String realName = defaultStart >= 0 ? name.substring(0, defaultStart) : name; - if (categoryName.equals("nei.recipe_categories")) { - // reuse existing translation for RecipeCategory - entry.getValue() - .setLanguageKey(name); - } else { - entry.getValue() - .setLanguageKey(String.format("%s.%s", category.getLanguagekey(), realName)); - } - } - } + "GregTech", + ConfigColorModulation.class, + ConfigInterface.class, + ConfigPreference.class, + ConfigRender.class, + ConfigWaila.class); } } diff --git a/src/main/java/gregtech/client/GT_GuiFactory.java b/src/main/java/gregtech/client/GT_GuiFactory.java index 3c8e5cd52c..ecf317a6fa 100644 --- a/src/main/java/gregtech/client/GT_GuiFactory.java +++ b/src/main/java/gregtech/client/GT_GuiFactory.java @@ -1,29 +1,13 @@ package gregtech.client; -import java.util.Set; - -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import cpw.mods.fml.client.IModGuiFactory; - -public class GT_GuiFactory implements IModGuiFactory { +import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory; - @Override - public void initialize(Minecraft minecraftInstance) {} +public class GT_GuiFactory implements SimpleGuiFactory { @Override public Class<? extends GuiScreen> mainConfigGuiClass() { return GT_GUI_ClientConfig.class; } - - @Override - public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() { - return null; - } - - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { - return null; - } } 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<Boolean> 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<String, Integer> 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<GT_Worldgen_GT_Ore_SmallPieces> 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<Class> 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<Class> 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<String> mBiomeList; + public final boolean mAllowToGenerateinVoid; + private final String aTextWorldgen = "worldgen."; + public Hashtable<Long, StoneSeeds> 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<String> 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<Long, GT_Worldgen_GT_Ore_Layer> 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<String, Boolean> 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<String, Boolean> 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_ChunkAssociatedData") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugWorldData; + + @Config.Comment("Debug parameter for chunk loaders.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean debugChunkloaders; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigFeatures.java b/src/main/java/gregtech/common/config/gregtech/ConfigFeatures.java new file mode 100644 index 0000000000..82a86f9186 --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigFeatures.java @@ -0,0 +1,34 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "features", configSubDirectory = "GregTech", filename = "GregTech") +public class ConfigFeatures { + + @Config.Comment("Controls the stacksize of tree related blocks.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int maxLogStackSize; + + @Config.Comment("Controls the stacksize of every oredicted prefix based items used for blocks (if that even makes sense)") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int maxOtherBlocksStackSize; + + @Config.Comment("Controls the stacksize of oredicted planks.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int maxPlankStackSize; + + @Config.Comment("Controls the stacksize of oredicted items used in ore treatment.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int maxOreStackSize; + + @Config.Comment("Controls the stacksize of IC2 overclocker upgrades.") + @Config.DefaultInt(4) + @Config.RequiresMcRestart + public static int upgradeStackSize; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigGeneral.java b/src/main/java/gregtech/common/config/gregtech/ConfigGeneral.java new file mode 100644 index 0000000000..e2ac011d39 --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigGeneral.java @@ -0,0 +1,254 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "general", configSubDirectory = "GregTech", filename = "GregTech") +public class ConfigGeneral { + + @Config.Comment("Control percentage of filled 3x3 chunks. Lower number means less oreveins spawn.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int oreveinPercentage; + + @Config.Comment("Control number of attempts to find a valid orevein. Generally this maximum limit isn't hit, selecting a vein is cheap") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int oreveinAttempts; + + @Config.Comment("Control number of attempts to place a valid ore vein. If a vein wasn't placed due to height restrictions, completely in the water, etc, another attempt is tried.") + @Config.DefaultInt(8) + @Config.RequiresMcRestart + public static int oreveinMaxPlacementAttempts; + + @Config.Comment("Whether to place small ores as placer ores for an orevein.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean oreveinPlacerOres; + + @Config.Comment("Multiplier to control how many placer ores get generated.") + @Config.DefaultInt(2) + @Config.RequiresMcRestart + public static int oreveinPlacerOresMultiplier; + + @Config.Comment("If true, enables the timber axe (cuts down whole tree in a single hit).") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean timber; + + @Config.Comment("If true, all the GT5U potions are always drinkable.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean drinksAlwaysDrinkable; + + @Config.Comment("if true, shows all the metaitems in creative and in NEI.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean doShowAllItemsInCreative; + + @Config.Comment("if true, makes the GT5U sounds multi-threaded.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean multiThreadedSounds; + + @Config.Comment("Max entity amount in the same block for entity craming.") + @Config.DefaultInt(6) + @Config.RequiresMcRestart + public static int maxEqualEntitiesAtOneSpot; + + @Config.Comment("The chance of success to start a fire from the flint and steel.") + @Config.DefaultInt(30) + @Config.RequiresMcRestart + public static int flintChance; + + @Config.Comment("Entity despawn time.") + @Config.DefaultInt(6000) + @Config.RequiresMcRestart + public static int itemDespawnTime; + + @Config.Comment("If true, allows small boiler automation.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean allowSmallBoilerAutomation; + + @Config.Comment("If true, increases dungeon loots in vanilla structures.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean increaseDungeonLoot; + + @Config.Comment("If true, spawns an axe at the start in adventure mode. Does nothing if the advanture mode isn't forced.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean axeWhenAdventure; + + @Config.Comment("If true, forces the survival map into adventure mode.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean survivalIntoAdventure; + + @Config.Comment("If true, hungers the players based on his amount of stuff in the inventory every 6s, regardless of player movement.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean hungerEffect; + + @Config.Comment("If true, enables the item oredification of the items in the inventory.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean inventoryUnification; + + @Config.Comment("if true, enables GT5U and GT++ bees.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean GTBees; + + @Config.Comment("if true, enables crafting unification.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean craftingUnification; + + @Config.Comment("If true, nerfs planks recipes.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean nerfedWoodPlank; + + @Config.Comment("if true, reduces the durability of the vanilla tools.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean nerfedVanillaTools; + + @Config.Comment("if true, enables GT5U achievements.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean achievements; + + @Config.Comment("if true, hides unused ores.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean hideUnusedOres; + + @Config.Comment("if true, enables all the materials in GT5U.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean enableAllMaterials; + + @Config.Comment("Controls the amount of tick over the lag averaging is done with the scanner.") + @Config.DefaultInt(25) + @Config.RequiresMcRestart + public static int ticksForLagAveraging; + + @Config.Comment("Controls the threshold (in ms) above which a lag warning is issued in log for a specific tile entity.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int millisecondThesholdUntilLagWarning; + + @Config.Comment("if true, drops the content of the machine inventory before exploding.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean explosionItemDrop; + + @Config.Comment("if true, enables the cleanroom multi.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean enableCleanroom; + + @Config.Comment("if true, enables low gravity requirement in some crafts. Is forced to false if GalactiCraft is not present.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean lowGravProcessing; + + @Config.Comment("if true, crops need a block below to fully grow.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean cropNeedBlock; + + @Config.Comment("if yes, allows the automatic interactions with the maintenance hatches.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean autoMaintenaceHatchesInteraction; + + @Config.Comment("if true, mixed ores only yields the equivalent of 2/3 of the pure ores.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean mixedOreOnlyYieldsTwoThirdsOfPureOre; + + @Config.Comment("if true, rich ores yield twice as much as normal ores.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean richOreYieldMultiplier; + + @Config.Comment("if true, nether ores yield twice as much as normal ores.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean netherOreYieldMultiplier; + + @Config.Comment("if true, end ores yield twice as much as normal ores.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean endOreYieldMultiplier; + + @Config.Comment("if true, enables GT6 styled pipe connections.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean gt6Pipe; + + @Config.Comment("if true, enables GT6 styled wire connections.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean gt6Cable; + + @Config.Comment("if true, allows GT5U cables to be IC2 power sources.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean ic2EnergySourceCompat; + + @Config.Comment("if true, wires will require soldering material to be connected.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean costlyCableConnection; + + @Config.Comment("if true, crashes on null recipe input.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean crashOnNullRecipeInput; + + @Config.Comment("if true, enable placeholder for material names in lang file.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean i18nPlaceholder; + + @Config.Comment("if true, sets the hardness of the mobspawers to 500 and their blast resistance to 6 000 000.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean harderMobSpawner; + + @Config.Comment("Controls the minimum distance allowed for the long distance pipelines to form.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int minimalDistancePoints; + + @Config.Comment("This will set the blacklist of blocks for CTM blocks.") + @Config.DefaultStringList({ "team.chisel.block.BlockRoadLine" }) + @Config.RequiresMcRestart + public static String[] CTMBlacklist; + + @Config.Comment("This will set the whitelist of blocks for CTM blocks.") + @Config.DefaultStringList({ "team.chisel.block.BlockCarvable", "team.chisel.block.BlockCarvableGlass" }) + @Config.RequiresMcRestart + public static String[] CTMWhitelist; + + @Config.Comment("if true, logs all the oredict in logs/OreDict.log.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean loggingOreDict; + + @Config.Comment("if true, logs all the oredict in logs/Explosion.log.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean loggingExplosions; + + @Config.Comment("if true, log all the oredict in logs/PlayerActivity.log.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean loggingPlayerActicity; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigHarvestLevel.java b/src/main/java/gregtech/common/config/gregtech/ConfigHarvestLevel.java new file mode 100644 index 0000000000..f924ceda8d --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigHarvestLevel.java @@ -0,0 +1,28 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "harvest_level", + configSubDirectory = "GregTech", + filename = "GregTech") +public class ConfigHarvestLevel { + + @Config.Comment("Activate Harvest Level Change") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean activateHarvestLevelChange; + + @Config.Comment("Maximum harvest level") + @Config.DefaultInt(7) + @Config.RequiresMcRestart + public static int maxHarvestLevel; + + @Config.Comment("GraniteHarvestLevel harvest level") + @Config.DefaultInt(3) + @Config.RequiresMcRestart + public static int graniteHarvestLevel; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigMachines.java b/src/main/java/gregtech/common/config/gregtech/ConfigMachines.java new file mode 100644 index 0000000000..06f6c0c18f --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigMachines.java @@ -0,0 +1,147 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "machines", configSubDirectory = "GregTech", filename = "GregTech") +public class ConfigMachines { + + @Config.Comment("Number of ticks between sending sound packets to clients for electric machines. Default is 1.5 seconds. Trying to mitigate lag and FPS drops.") + @Config.DefaultInt(30) + @Config.RequiresMcRestart + public static int ticksBetweenSounds; + + @Config.Comment("This will set the blacklist for the world accelerator in TE mode.") + @Config.DefaultStringList({ "com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry", + "advsolar.common.tiles.TileEntityUltimateSolarPanel", "advsolar.common.tiles.TileEntitySolarPanel", + "advsolar.common.tiles.TileEntityQuantumSolarPanel", "advsolar.common.tiles.TileEntityHybridSolarPanel", + "advsolar.common.tiles.TileEntityAdvancedSolarPanel", "com.supsolpans.tiles.TileAdminSolarPanel", + "com.supsolpans.tiles.TilePhotonicSolarPanel", "com.supsolpans.tiles.TileSingularSolarPanel", + "com.supsolpans.tiles.TileSpectralSolarPanel", "emt.tile.solar.air.TileEntityAirSolar", + "emt.tile.solar.air.TileEntityDoubleAirSolar", "emt.tile.solar.air.TileEntityTripleAirSolar", + "emt.tile.solar.air.TileEntityQuadrupleAirSolar", "emt.tile.solar.air.TileEntityQuintupleAirSolar", + "emt.tile.solar.air.TileEntitySextupleAirSolar", "emt.tile.solar.air.TileEntitySeptupleAirSolar", + "emt.tile.solar.air.TileEntityOctupleAirSolar", "emt.tile.solar.compressed.TileEntityCompressedSolar", + "emt.tile.solar.compressed.TileEntityDoubleCompressedSolar", + "emt.tile.solar.compressed.TileEntityTripleCompressedSolar", + "emt.tile.solar.compressed.TileEntityQuadrupleAirSolar", + "emt.tile.solar.compressed.TileEntityQuintupleAirSolar", "emt.tile.solar.compressed.TileEntitySextupleAirSolar", + "emt.tile.solar.compressed.TileEntitySeptupleAirSolar", "emt.tile.solar.compressed.TileEntityOctupleAirSolar", + "emt.tile.solar.dark.TileEntityDarkSolar", "emt.tile.solar.dark.TileEntityDoubleDarkSolar", + "emt.tile.solar.dark.TileEntityTripleDarkSolar", "emt.tile.solar.dark.TileEntityQuadrupleAirSolar", + "emt.tile.solar.dark.TileEntityQuintupleAirSolar", "emt.tile.solar.dark.TileEntitySextupleAirSolar", + "emt.tile.solar.dark.TileEntitySeptupleAirSolar", "emt.tile.solar.dark.TileEntityOctupleAirSolar", + "emt.tile.solar.earth.TileEntityDoubleEarthSolar", "emt.tile.solar.earth.TileEntityEarthSolar", + "emt.tile.solar.earth.TileEntityTripleEarthSolar", "emt.tile.solar.earth.TileEntityQuadrupleAirSolar", + "emt.tile.solar.earth.TileEntityQuintupleAirSolar", "emt.tile.solar.earth.TileEntitySextupleAirSolar", + "emt.tile.solar.earth.TileEntitySeptupleAirSolar", "emt.tile.solar.earth.TileEntityOctupleAirSolar", + "emt.tile.solar.fire.TileEntityDoubleFireSolar", "emt.tile.solar.fire.TileEntityFireSolar", + "emt.tile.solar.fire.TileEntityTripleFireSolar", "emt.tile.solar.fire.TileEntityQuadrupleAirSolar", + "emt.tile.solar.fire.TileEntityQuintupleAirSolar", "emt.tile.solar.fire.TileEntitySextupleAirSolar", + "emt.tile.solar.fire.TileEntitySeptupleAirSolar", "emt.tile.solar.fire.TileEntityOctupleAirSolar", + "emt.tile.solar.order.TileEntityDoubleOrderSolar", "emt.tile.solar.order.TileEntityOrderSolar", + "emt.tile.solar.order.TileEntityTripleOrderSolar", "emt.tile.solar.order.TileEntityQuadrupleAirSolar", + "emt.tile.solar.order.TileEntityQuintupleAirSolar", "emt.tile.solar.order.TileEntitySextupleAirSolar", + "emt.tile.solar.order.TileEntitySeptupleAirSolar", "emt.tile.solar.order.TileEntityOctupleAirSolar", + "emt.tile.solar.water.TileEntityDoubleWaterSolar", "emt.tile.solar.water.TileEntityTripleWaterSolar", + "emt.tile.solar.water.TileEntityWaterSolar", "emt.tile.solar.water.TileEntityQuadrupleAirSolar", + "emt.tile.solar.water.TileEntityQuintupleAirSolar", "emt.tile.solar.water.TileEntitySextupleAirSolar", + "emt.tile.solar.water.TileEntitySeptupleAirSolar", "emt.tile.solar.water.TileEntityOctupleAirSolar", + "com.lulan.compactkineticgenerators.tileentity.TileCkgE", + "com.lulan.compactkineticgenerators.tileentity.TileCkgH", + "com.lulan.compactkineticgenerators.tileentity.TileCkgL", + "com.lulan.compactkineticgenerators.tileentity.TileCkgM", + "com.lulan.compactkineticgenerators.tileentity.TileCkwaE", + "com.lulan.compactkineticgenerators.tileentity.TileCkwaH", + "com.lulan.compactkineticgenerators.tileentity.TileCkwaL", + "com.lulan.compactkineticgenerators.tileentity.TileCkwaM", + "com.lulan.compactkineticgenerators.tileentity.TileCkwmE", + "com.lulan.compactkineticgenerators.tileentity.TileCkwmH", + "com.lulan.compactkineticgenerators.tileentity.TileCkwmL", + "com.lulan.compactkineticgenerators.tileentity.TileCkwmM", "com.supsolpans.tiles.TileSpectralSolarPanel", + "com.supsolpans.tiles.TileSingularSolarPanel", "com.supsolpans.tiles.TileAdminSolarPanel", + "com.supsolpans.tiles.TilePhotonicSolarPanel", "gtPlusPlus.core.tileentities.general.TileEntityFishTrap", + "gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest", + "net.bdew.gendustry.machines.apiary.TileApiary", "goodgenerator.blocks.tileEntity.EssentiaHatch", + "magicbees.tileentity.TileEntityApimancersDrainerCommon", + "magicbees.tileentity.TileEntityApimancersDrainerGT" }) + @Config.RequiresMcRestart + public static String[] blacklistedTileEntiyClassNamesForWA; + + @Config.Comment("This will set the percentage how much ReinforcedGlass is Allowed in Cleanroom Walls.") + @Config.DefaultFloat(5.0f) + @Config.RequiresMcRestart + public static float cleanroomGlass; + + @Config.Comment("This will let machines such as drills and pumps chunkload their work area.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean enableChunkloaders; + + @Config.Comment("This will make all chunkloading machines act as World Anchors (true) or Passive Anchors (false).") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean alwaysReloadChunkloaders; + + @Config.Comment("If true, then digital chest with AE2 storage bus will be accessible only through AE2") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean disableDigitalChestsExternalAccess; + + @Config.Comment("If true, machines can explode.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineExplosions; + + @Config.Comment("If true, machine can take fire.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineFlammable; + + @Config.Comment("If true, explodes if the machine is dismantled without a wrench.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineNonWrenchExplosions; + + @Config.Comment("If true, burn the wires on explosion. (by sending IV amps into the cables)") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineWireFire; + + @Config.Comment("If true, machine will randomly explode if there is fire on adjacent blocks.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineFireExplosions; + + @Config.Comment("If true, will randomly explode if it is raining.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineRainExplosions; + + @Config.Comment("If true, will randomly explode during thunderstorm if the machine can be exposed to rain.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean machineThunderExplosions; + + @Config.Comment("If true, enable the guis of the machines to get a tint and it will be of the color of the dye applied to the machine.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean coloredGUI; + + @Config.Comment("If true and if the machine tint is activated, the guis will have a uniform metallic tint no matter what color is applied to the machines.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean machineMetalGUI; + + // Implementation for this is actually handled in NewHorizonsCoreMod in MainRegistry.java! + @Config.Comment("If true, use the definition of the metallic tint in GT5U, otherwise NHCore will set it to white.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean useMachineMetal; + + @Config.Comment("if true, enables MuTEs(multitile entities) to be added to the game. MuTEs are in the start of development and its not recommended to enable them unless you know what you are doing. (always activated in dev env)") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean enableMultiTileEntities; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigOreDropBehavior.java b/src/main/java/gregtech/common/config/gregtech/ConfigOreDropBehavior.java new file mode 100644 index 0000000000..dd6e1420e2 --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigOreDropBehavior.java @@ -0,0 +1,24 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "ore_drop_behavior", + configSubDirectory = "GregTech", + filename = "GregTech") +public class ConfigOreDropBehavior { + + @Config.Comment({ "Settings:", + " - 'PerDimBlock': Sets the drop to the block variant of the ore block based on dimension, defaults to stone type", + " - 'UnifiedBlock': Sets the drop to the stone variant of the ore block", + " - 'Block': Sets the drop to the ore mined", + " - 'FortuneItem': Sets the drop to the new ore item and makes it affected by fortune" + + " - 'Item': Sets the drop to the new ore item" }) + + @Config.DefaultString("FortuneItem") + @Config.RequiresMcRestart + public static String setting; +} diff --git a/src/main/java/gregtech/common/config/gregtech/ConfigPollution.java b/src/main/java/gregtech/common/config/gregtech/ConfigPollution.java new file mode 100644 index 0000000000..a78fff8f8c --- /dev/null +++ b/src/main/java/gregtech/common/config/gregtech/ConfigPollution.java @@ -0,0 +1,129 @@ +package gregtech.common.config.gregtech; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "pollution", configSubDirectory = "GregTech", filename = "GregTech") +public class ConfigPollution { + + @Config.Comment("if true, enables pollution in the game.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean pollution; + + @Config.Comment("Controls the threshold starting from which you can see fog.") + @Config.DefaultInt(550_000) + @Config.RequiresMcRestart + public static int pollutionSmogLimit; + @Config.Comment("Controls the threshold starting from which players get poison effect.") + @Config.DefaultInt(750_000) + @Config.RequiresMcRestart + public static int pollutionPoisonLimit; + @Config.Comment("Controls the threshold starting from which vegetation starts to be killed.") + @Config.DefaultInt(1_000_000) + @Config.RequiresMcRestart + public static int pollutionVegetationLimit; + @Config.Comment("Controls the threshold starting from which if it rains, will turn cobblestone into gravel and gravel into sand.") + @Config.DefaultInt(2_000_000) + @Config.RequiresMcRestart + public static int pollutionSourRainLimit; + @Config.Comment("Controls the pollution released by an explosion.") + @Config.DefaultInt(100_000) + @Config.RequiresMcRestart + public static int pollutionOnExplosion; + @Config.Comment("Controls the pollution released per second by the bricked blast furnace.") + @Config.DefaultInt(200) + @Config.RequiresMcRestart + public static int pollutionPrimitveBlastFurnacePerSecond; + @Config.Comment("Controls the pollution released per second by the charcoal pile igniter.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int pollutionCharcoalPitPerSecond; + @Config.Comment("Controls the pollution released per second by the EBF.") + @Config.DefaultInt(400) + @Config.RequiresMcRestart + public static int pollutionEBFPerSecond; + @Config.Comment("Controls the pollution released per second by the large combustion engine.") + @Config.DefaultInt(480) + @Config.RequiresMcRestart + public static int pollutionLargeCombustionEnginePerSecond; + @Config.Comment("Controls the pollution released per second by the extreme combustion engine.") + @Config.DefaultInt(3_840) + @Config.RequiresMcRestart + public static int pollutionExtremeCombustionEnginePerSecond; + @Config.Comment("Controls the pollution released per second by the implosion compressor.") + @Config.DefaultInt(10_000) + @Config.RequiresMcRestart + public static int pollutionImplosionCompressorPerSecond; + @Config.Comment("Controls the pollution released per second by the large bronze boiler.") + @Config.DefaultInt(1_000) + @Config.RequiresMcRestart + public static int pollutionLargeBronzeBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large steel boiler.") + @Config.DefaultInt(2_000) + @Config.RequiresMcRestart + public static int pollutionLargeSteelBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large titanium boiler.") + @Config.DefaultInt(3_000) + @Config.RequiresMcRestart + public static int pollutionLargeTitaniumBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large tungstensteel boiler.") + @Config.DefaultInt(4_000) + @Config.RequiresMcRestart + public static int pollutionLargeTungstenSteelBoilerPerSecond; + @Config.Comment("Controls the pollution reduction obtained with each increment of the circuit when throttling large boilers.") + @Config.DefaultFloat(1.0f / 24.0f) // divided by 24 because there are 24 circuit configs. + @Config.RequiresMcRestart + public static float pollutionReleasedByThrottle; + @Config.Comment("Controls the pollution released per second by the large gas turbine.") + @Config.DefaultInt(300) + @Config.RequiresMcRestart + public static int pollutionLargeGasTurbinePerSecond; + @Config.Comment("Controls the pollution released per second by the multi smelter.") + @Config.DefaultInt(400) + @Config.RequiresMcRestart + public static int pollutionMultiSmelterPerSecond; + @Config.Comment("Controls the pollution released per second by the pyrolyse oven.") + @Config.DefaultInt(300) + @Config.RequiresMcRestart + public static int pollutionPyrolyseOvenPerSecond; + @Config.Comment("Controls the pollution released per second by the small coil boiler.") + @Config.DefaultInt(20) + @Config.RequiresMcRestart + public static int pollutionSmallCoalBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the high pressure lava boiler.") + @Config.DefaultInt(20) + @Config.RequiresMcRestart + public static int pollutionHighPressureLavaBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the high pressure coil boiler.") + @Config.DefaultInt(30) + @Config.RequiresMcRestart + public static int pollutionHighPressureCoalBoilerPerSecond; + + @Config.Comment("Controls the pollution released per second by the base diesel generator.") + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int pollutionBaseDieselGeneratorPerSecond; + + // reading double as strings, not perfect, but better than nothing + @Config.Comment({ + "Pollution released by tier, with the following formula: PollutionBaseDieselGeneratorPerSecond * PollutionDieselGeneratorReleasedByTier[Tier]", + "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) + @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8 }) + @Config.RequiresMcRestart + public static double[] pollutionDieselGeneratorReleasedByTier; + + @Config.Comment("Controls the pollution released per second by the base gas turbine.") + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int pollutionBaseGasTurbinePerSecond; + + // reading double as strings, not perfect, but better than nothing + @Config.Comment({ + "Pollution released by tier, with the following formula: PollutionBaseGasTurbinePerSecond * PollutionGasTurbineReleasedByTier[Tier]", + "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) + @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8, 0.7, 0.6 }) + @Config.RequiresMcRestart + public static double[] pollutionGasTurbineReleasedByTier; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigBronzeSolarBoiler.java b/src/main/java/gregtech/common/config/machinestats/ConfigBronzeSolarBoiler.java new file mode 100644 index 0000000000..59042b7e41 --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigBronzeSolarBoiler.java @@ -0,0 +1,32 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "bronze_solar_boiler", + configSubDirectory = "GregTech", + filename = "MachineStats") +public class ConfigBronzeSolarBoiler { + + @Config.Comment({ "Number of run-time ticks before boiler starts calcification.", + "100% calcification and minimal output will be reached at 2 times this." }) + @Config.DefaultInt(1_080_000) + @Config.RequiresMcRestart + public static int calcificationTicks; + + @Config.Comment("Number of ticks it takes to lose 1°C.") + @Config.DefaultInt(45) + @Config.RequiresMcRestart + public static int cooldownTicks; + + @Config.DefaultInt(120) + @Config.RequiresMcRestart + public static int maxOutputPerSecond; + + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int minOutputPerSecond; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigMachines.java b/src/main/java/gregtech/common/config/machinestats/ConfigMachines.java new file mode 100644 index 0000000000..ed93f31629 --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigMachines.java @@ -0,0 +1,34 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "machines", configSubDirectory = "GregTech", filename = "MachineStats") +public class ConfigMachines { + + @Config.Comment("Controls the damageFactorLow variable in the maintenance damage equation.") + @Config.DefaultInt(5) + @Config.RequiresMcRestart + public static int damageFactorLow; + + @Config.Comment("Controls the damageFactorHigh variable in the maintenance damage equation.") + @Config.DefaultFloat(0.6f) + @Config.RequiresMcRestart + public static float damageFactorHigh; + + @Config.Comment("if true, disable maintenance checks.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean disableMaintenanceChecks; + + @Config.Comment("If true, allows for multiple eggs on the magical energy absorber.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean allowMultipleEggs; + + @Config.Comment("If true, requires at least a free face to open a machine gui.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean forceFreeFace; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigMassFabricator.java b/src/main/java/gregtech/common/config/machinestats/ConfigMassFabricator.java new file mode 100644 index 0000000000..13cf89470b --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigMassFabricator.java @@ -0,0 +1,33 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "mass_fabricator", + configSubDirectory = "GregTech", + filename = "MachineStats") +public class ConfigMassFabricator { + + @Config.Comment("if true, requires UUA to run the mass fab.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean requiresUUA; + + @Config.Comment("Duration multiplier.") + @Config.DefaultInt(3215) + @Config.RequiresMcRestart + public static int durationMultiplier; + + @Config.Comment("mb of UUA per UUM.") + @Config.DefaultInt(1) + @Config.RequiresMcRestart + public static int UUAPerUUM; + + @Config.Comment("Speed bonus delivered by the UUA.") + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int UUASpeedBonus; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigMicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/config/machinestats/ConfigMicrowaveEnergyTransmitter.java new file mode 100644 index 0000000000..6efec5ca12 --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigMicrowaveEnergyTransmitter.java @@ -0,0 +1,28 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "microwave_energy_transmitter", + configSubDirectory = "GregTech", + filename = "MachineStats") +public class ConfigMicrowaveEnergyTransmitter { + + @Config.Comment("if true, it has a passive energy loss.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean passiveEnergyUse; + + @Config.Comment("max loss.") + @Config.DefaultInt(50) + @Config.RequiresMcRestart + public static int maxLoss; + + @Config.Comment("max loss distance.") + @Config.DefaultInt(10_000) + @Config.RequiresMcRestart + public static int maxLossDistance; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigSteelSolarBoiler.java b/src/main/java/gregtech/common/config/machinestats/ConfigSteelSolarBoiler.java new file mode 100644 index 0000000000..c6f6ea9f2a --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigSteelSolarBoiler.java @@ -0,0 +1,32 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "steel_solar_boiler", + configSubDirectory = "GregTech", + filename = "MachineStats") +public class ConfigSteelSolarBoiler { + + @Config.Comment({ "Number of run-time ticks before boiler starts calcification.", + "100% calcification and minimal output will be reached at 2 times this." }) + @Config.DefaultInt(1_080_000) + @Config.RequiresMcRestart + public static int calcificationTicks; + + @Config.Comment("Number of ticks it takes to lose 1°C.") + @Config.DefaultInt(75) + @Config.RequiresMcRestart + public static int cooldownTicks; + + @Config.DefaultInt(360) + @Config.RequiresMcRestart + public static int maxOutputPerSecond; + + @Config.DefaultInt(120) + @Config.RequiresMcRestart + public static int minOutputPerSecond; +} diff --git a/src/main/java/gregtech/common/config/machinestats/ConfigTeleporter.java b/src/main/java/gregtech/common/config/machinestats/ConfigTeleporter.java new file mode 100644 index 0000000000..26f1f8fb4d --- /dev/null +++ b/src/main/java/gregtech/common/config/machinestats/ConfigTeleporter.java @@ -0,0 +1,28 @@ +package gregtech.common.config.machinestats; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "teleporter", + configSubDirectory = "GregTech", + filename = "MachineStats") +public class ConfigTeleporter { + + @Config.Comment("if true, allows interdim tp") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean interDimensionalTPAllowed; + + @Config.Comment("passive energy loss.") + @Config.DefaultInt(2048) + @Config.RequiresMcRestart + public static int passiveEnergyDrain; + + @Config.Comment("power multiplier.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int powerMultiplier; +} diff --git a/src/main/java/gregtech/common/config/opstuff/ConfigGeneral.java b/src/main/java/gregtech/common/config/opstuff/ConfigGeneral.java new file mode 100644 index 0000000000..63cd2bc231 --- /dev/null +++ b/src/main/java/gregtech/common/config/opstuff/ConfigGeneral.java @@ -0,0 +1,48 @@ +package gregtech.common.config.opstuff; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "general", + configSubDirectory = "GregTech", + filename = "OverpoweredStuff") +public class ConfigGeneral { + + @Config.Comment("How much RF you get with 100 EU in input.") + @Config.DefaultInt(360) + @Config.RequiresMcRestart + public static int howMuchRFWith100EUInInput; + + @Config.Comment("How much EU you get with 100 RF in input.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int howMuchEUWith100RFInInput; + + @Config.Comment("if true, enables RF -> EU conversion.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean inputRF; + + @Config.Comment("if true, enables EU -> RF conversion.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean outputRF; + + @Config.Comment("If true, machines will explode if RFs injected to a GT machine are above 600 * the max energy they can store.") + @Config.DefaultBoolean(false) + @Config.RequiresMcRestart + public static boolean RFExplosions; + + @Config.Comment("if true, ignores TinkerConstruct in ore registration.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean ignoreTinkerConstruct; + + @Config.Comment("Controls the exposant used in the computation of the UUM required to replicate an element (uum = mass^replicatorExponent)") + @Config.DefaultFloat(1.2f) + @Config.RequiresMcRestart + public static float replicatorExponent; +} diff --git a/src/main/java/gregtech/common/config/other/ConfigGeneral.java b/src/main/java/gregtech/common/config/other/ConfigGeneral.java new file mode 100644 index 0000000000..495ef190c4 --- /dev/null +++ b/src/main/java/gregtech/common/config/other/ConfigGeneral.java @@ -0,0 +1,24 @@ +package gregtech.common.config.other; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.GREG_TECH, category = "general", configSubDirectory = "GregTech", filename = "Other") +public class ConfigGeneral { + + @Config.Comment("How much pipes you can chain wrench to disable their input.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int pipeWrenchingChainRange; + + @Config.Comment("How much blocks you can chain paint with GT spray cans.") + @Config.DefaultInt(64) + @Config.RequiresMcRestart + public static int sprayCanChainRange; + + @Config.Comment("How much blocks you can paint with GT spray cans.") + @Config.DefaultInt(512) + @Config.RequiresMcRestart + public static int sprayCanUses; +} diff --git a/src/main/java/gregtech/common/config/worldgen/ConfigEndAsteroids.java b/src/main/java/gregtech/common/config/worldgen/ConfigEndAsteroids.java new file mode 100644 index 0000000000..c1ec0125b5 --- /dev/null +++ b/src/main/java/gregtech/common/config/worldgen/ConfigEndAsteroids.java @@ -0,0 +1,33 @@ +package gregtech.common.config.worldgen; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "end_asteroids", + configSubDirectory = "GregTech", + filename = "WorldGeneration") +public class ConfigEndAsteroids { + + @Config.Comment("The maximum size for the end asteroids.") + @Config.DefaultInt(200) + @Config.RequiresMcRestart + public static int EndAsteroidMaxSize; + + @Config.Comment("The minimum size for the end asteroids.") + @Config.DefaultInt(200) + @Config.RequiresMcRestart + public static int EndAsteroidMinSize; + + @Config.Comment("The probability weight to generate end asteroids.") + @Config.DefaultInt(300) + @Config.RequiresMcRestart + public static int EndAsteroidProbability; + + @Config.Comment("if true, enables end asteroids.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateEndAsteroids; +} diff --git a/src/main/java/gregtech/common/config/worldgen/ConfigGeneral.java b/src/main/java/gregtech/common/config/worldgen/ConfigGeneral.java new file mode 100644 index 0000000000..c978f35365 --- /dev/null +++ b/src/main/java/gregtech/common/config/worldgen/ConfigGeneral.java @@ -0,0 +1,48 @@ +package gregtech.common.config.worldgen; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config( + modid = Mods.Names.GREG_TECH, + category = "general", + configSubDirectory = "GregTech", + filename = "WorldGeneration") +public class ConfigGeneral { + + @Config.Comment("if true, enables basalt ore gen.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateBasaltOres; + + @Config.Comment("if true, enables black granite ore gen.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateBlackGraniteOres; + + @Config.Comment("if true, enables marble ore gen.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateMarbleOres; + + @Config.Comment("if true, enables red granite ore gen.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateRedGraniteOres; + + @Config.Comment("If true, disables vanilla oregen.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean disableVanillaOres; + + @Config.Comment("if true, enables underground dirt gen. Does nothing if the vanilla oregen is enabled!") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateUndergroundDirtGen; + + @Config.Comment("if true, enables underground gravel gen. Does nothing if the vanilla oregen is enabled!") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean generateUndergroundGravelGen; +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 88a7e1f69e..17d0c13f03 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -67,7 +67,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -91,6 +90,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.config.other.ConfigGeneral; import gregtech.common.covers.GT_Cover_Arm; import gregtech.common.covers.GT_Cover_Chest; import gregtech.common.covers.GT_Cover_ControlsWork; @@ -4068,7 +4068,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Spray_Empty.get(1L), ItemList.SPRAY_CAN_DYES_USED[i].get(1L), ItemList.SPRAY_CAN_DYES[i].get(1L), - GregTech_API.sSpecialFile.get(ConfigCategories.general, "SprayCanUses", 512), + ConfigGeneral.sprayCanUses, i); addItemBehavior(32000 + Spray_Colors[i], behaviourSprayColor); addItemBehavior(32000 + Spray_Colors_Used[i], behaviourSprayColor); diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java index 33cf67cfd5..f8777dcf58 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java @@ -59,7 +59,6 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; @@ -618,10 +617,6 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { } private void initCraftingShapelessRecipes() { - if (GregTech_API.sSpecialFile.get(ConfigCategories.general, "DisableFlintTools", false)) { - return; - } - GT_ModHandler.addShapelessCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -718,37 +713,34 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { new Object[] { " S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.IronWood), 'S', OrePrefixes.stick.get(Materials.IronWood) }); - if (!GregTech_API.sSpecialFile.get(ConfigCategories.general, "DisableFlintTools", false)) { - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(SWORD.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(PICKAXE.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(SHOVEL.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(AXE.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(HOE.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GT_ModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(KNIFE.ID, 1, Materials.Flint, Materials.Wood, null), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - } + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(SWORD.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', + new ItemStack(Items.flint, 1) }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(PICKAXE.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', + new ItemStack(Items.flint, 1) }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(SHOVEL.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', + new ItemStack(Items.flint, 1) }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(AXE.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', + new ItemStack(Items.flint, 1) }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(HOE.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', + new ItemStack(Items.flint, 1) }); + GT_ModHandler.addCraftingRecipe( + INSTANCE.getToolWithStats(KNIFE.ID, 1, Materials.Flint, Materials.Wood, null), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1) }); } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java index cbc698d474..216eb4d745 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java @@ -19,14 +19,13 @@ import net.minecraftforge.common.util.ForgeDirection; import appeng.api.implementations.tiles.IColorableTile; import appeng.api.util.AEColor; import appeng.block.networking.BlockCableBus; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import gregtech.common.config.other.ConfigGeneral; public class Behaviour_Spray_Color extends Behaviour_None { @@ -96,7 +95,7 @@ public class Behaviour_Spray_Color extends Behaviour_None { tUses = this.mUses; } int painted = 0; - int maxPainted = GregTech_API.sSpecialFile.get(ConfigCategories.general, "SprayCanChainRange", 256); + int maxPainted = ConfigGeneral.sprayCanChainRange; ForgeDirection lookSide; Vec3 look = aPlayer.getLookVec(); double absX = Math.abs(look.xCoord); @@ -208,10 +207,7 @@ public class Behaviour_Spray_Color extends Behaviour_None { public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); aList.add(this.mTooltipChain); - aList.add( - String.format( - this.mTooltipChainAmount, - GregTech_API.sSpecialFile.get(ConfigCategories.general, "SprayCanChainRange", 256))); + aList.add(String.format(this.mTooltipChainAmount, ConfigGeneral.sprayCanChainRange)); NBTTagCompound tNBT = aStack.getTagCompound(); long tRemainingPaint = tNBT == null ? this.mUses : GT_Utility.areStacksEqual(aStack, this.mFull, true) ? this.mUses : tNBT.getLong("GT.RemainingPaint"); diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index 4c7eb3ce38..b10b44228d 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.boilers; -import static gregtech.api.GregTech_API.sMachineFile; -import static gregtech.api.enums.ConfigCategories.machineconfig; import static mcp.mobius.waila.api.SpecialChars.GOLD; import static mcp.mobius.waila.api.SpecialChars.RESET; @@ -28,6 +26,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import gregtech.common.config.machinestats.ConfigBronzeSolarBoiler; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -39,37 +38,28 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { "Steam Power by the Sun%n" + "Produces %sL of Steam per second%n" + "Calcifies over time, reducing Steam output to %sL/s%n" + "Break and replace to descale"); - protected final Config mConfig; + protected int calcificationTicks = ConfigBronzeSolarBoiler.calcificationTicks; + protected int cooldownTicks = ConfigBronzeSolarBoiler.cooldownTicks; + protected int maxOutputPerSecond = ConfigBronzeSolarBoiler.maxOutputPerSecond; + protected int minOutputPerSecond = ConfigBronzeSolarBoiler.minOutputPerSecond; + protected final int basicTemperatureMod = 5; // Base Celsius gain or loss private int mRunTimeTicks = 0; public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[0]); - mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - mConfig = createConfig(); - } - - protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - Config aConfig) { - super(aName, aTier, aDescription, aTextures); - mConfig = aConfig; - } - - protected Config createConfig() { - return new Config(machineconfig + ".boiler.solar.bronze", 1080000, 40, 120, 45); } public int getMaxOutputPerSecond() { - return mConfig.getMaxOutputPerSecond(); + return maxOutputPerSecond; } @Override @@ -83,7 +73,7 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } public int getMinOutputPerSecond() { - return mConfig.getMinOutputPerSecond(); + return minOutputPerSecond; } @Override @@ -159,21 +149,34 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { if (mTemperature < 100) { return 0; } - if (mRunTimeTicks > mConfig.getMaxRuntimeTicks()) { - return mConfig.getMinOutputPerSecond(); - } else if (mRunTimeTicks > mConfig.getCalcificationTicks()) { + if (mRunTimeTicks > getMaxRuntimeTicks()) { + return getMinOutputPerSecond(); + } else if (mRunTimeTicks > getCalcificationTicks()) { /* * When reaching calcification ticks; discount the proportion of run-time spent on calcification from the * maximum output per second, and return this or the minimum output per second */ - return mConfig.getMaxOutputPerSecond() - - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) - / mConfig.getCalcificationTicks(); + return getMaxOutputPerSecond() + - getMaxOutputPerSecond() * (mRunTimeTicks - getCalcificationTicks()) / getCalcificationTicks(); } else { - return mConfig.getMaxOutputPerSecond(); + return getMaxOutputPerSecond(); } } + protected int getCalcificationTicks() { + return calcificationTicks; + } + + protected int getCooldownTicks() { + return cooldownTicks; + } + + protected int getMaxRuntimeTicks() { + // After which min output is reached. + return (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() / getMaxOutputPerSecond() + + getCalcificationTicks(); + } + @Override protected int getMaxTemperature() { return 500; @@ -186,7 +189,7 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override protected int getCooldownInterval() { - return mConfig.getCoolDownTicks() / basicTemperatureMod; + return getCooldownTicks() / basicTemperatureMod; } @Override @@ -272,7 +275,7 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar(mName, mTier, mDescriptionArray, mTextures, mConfig); + return new GT_MetaTileEntity_Boiler_Solar(mName, mTier, mDescriptionArray, mTextures); } @Override @@ -305,64 +308,4 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { tag.setInteger("calcificationOutput", (getProductionPerSecond())); tag.setInteger("maxCalcificationOutput", (getMaxOutputPerSecond())); } - - protected static class Config { - - private final int calcificationTicks; - private final int minOutputPerSecond; - private final int maxOutputPerSecond; - private final int coolDownTicks; - private final int maxRuntimeTicks; - - public Config(String aCategory, int aDefaultCalcificationTicks, int aDefaultMinOutputPerSecond, - int aDefaultMaxOutputPerSecond, int aDefaultCoolDownTicks) { - calcificationTicks = get( - aCategory, - "CalcificationTicks", - aDefaultCalcificationTicks, - "Number of run-time ticks before boiler starts calcification.", - "100% calcification and minimal output will be reached at 2 times this."); - minOutputPerSecond = get(aCategory, "MinOutputPerSecond", aDefaultMinOutputPerSecond); - maxOutputPerSecond = get(aCategory, "MaxOutputPerSecond", aDefaultMaxOutputPerSecond); - coolDownTicks = get( - aCategory, - "CoolDownTicks", - aDefaultCoolDownTicks, - "Number of ticks it takes to lose 1°C."); - // After which min output is reached. - maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() - / getMaxOutputPerSecond() + getCalcificationTicks(); - } - - protected int get(final String aCategory, final String aKey, final int aDefaultValue, - final String... aComments) { - final StringBuilder tCommentBuilder = new StringBuilder(); - for (String tComment : aComments) tCommentBuilder.append(tComment) - .append('\n'); - tCommentBuilder.append("Default: ") - .append(aDefaultValue); - return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()) - .getInt(); - } - - public int getCalcificationTicks() { - return calcificationTicks; - } - - public int getMinOutputPerSecond() { - return minOutputPerSecond; - } - - public int getMaxOutputPerSecond() { - return maxOutputPerSecond; - } - - public int getCoolDownTicks() { - return coolDownTicks; - } - - public int getMaxRuntimeTicks() { - return maxRuntimeTicks; - } - } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index c20ea4018a..c537e388d1 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.boilers; -import static gregtech.api.enums.ConfigCategories.machineconfig; - import gregtech.api.enums.Dyes; import gregtech.api.enums.SteamVariant; import gregtech.api.enums.Textures.BlockIcons; @@ -9,31 +7,32 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; +import gregtech.common.config.machinestats.ConfigSteelSolarBoiler; public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar { public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + initBoilerStats(); } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + initBoilerStats(); } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + initBoilerStats(); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, Config aConfig) { - super(aName, aTier, aDescription, aTextures, aConfig); - } - - @Override - protected Config createConfig() { - return new Config(machineconfig + ".boiler.solar.steel", 1080000, 120, 360, 75); + protected void initBoilerStats() { + calcificationTicks = ConfigSteelSolarBoiler.calcificationTicks; + cooldownTicks = ConfigSteelSolarBoiler.cooldownTicks; + maxOutputPerSecond = ConfigSteelSolarBoiler.maxOutputPerSecond; + minOutputPerSecond = ConfigSteelSolarBoiler.minOutputPerSecond; } @Override @@ -67,11 +66,6 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar_Steel( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mConfig); + return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 5047cb7624..10138bdfc2 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -31,8 +31,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.ItemList; import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ITexture; @@ -95,10 +93,7 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "DieselGenerator.efficiency.tier." + this.mTier, - (100 - this.mTier * 5)); + this.mEfficiency = (100 - this.mTier * 5); } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index e18bc00b51..ca0a5d6958 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -25,8 +25,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; import net.minecraftforge.common.util.ForgeDirection; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -51,14 +49,12 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + " Pollution per second" }); this.mEfficiency = mEfficiency; - onConfigLoad(); } public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int mEfficiency) { super(aName, aTier, aDescription, aTextures); this.mEfficiency = mEfficiency; - onConfigLoad(); } @Override @@ -86,11 +82,6 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat return 16000; } - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, this.mEfficiency); - } - @Override public int getEfficiency() { return this.mEfficiency; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index 7317180b5d..647aa504e5 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -12,8 +12,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -68,10 +66,7 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MagicEnergyConverter.efficiency.tier." + this.mTier, - 100 - this.mTier * 5); + this.mEfficiency = 100 - this.mTier * 5; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 8dc3417a84..3245607ac2 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,6 +1,5 @@ package gregtech.common.tileentities.generators; -import static gregtech.api.enums.ConfigCategories.machineconfig; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_DRAGONEGG; @@ -52,7 +51,6 @@ import com.google.common.base.Enums; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import gregtech.api.enums.ParticleFX; import gregtech.api.enums.TC_Aspects; import gregtech.api.interfaces.ITexture; @@ -62,11 +60,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; +import gregtech.common.config.machinestats.ConfigMachines; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectSourceHelper; @@ -81,10 +79,9 @@ interface MagicalEnergyBBListener { public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator implements MagicalEnergyBBListener { - private static final boolean THAUMCRAFT_LOADED = Thaumcraft.isModLoaded(); private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>( 4); - private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() + private static final List<Aspect> sPrimalAspects = (Thaumcraft.isModLoaded()) ? Aspect.getPrimalAspects() : new ArrayList<>(); private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>(); private static boolean sAllowMultipleEggs = false; @@ -103,28 +100,21 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it:"); - onConfigLoad(GregTech_API.sMachineFile); + onConfigLoad(); } private GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - onConfigLoad(GregTech_API.sMachineFile); + onConfigLoad(); } /** * Populates static variables dependant on config settings - * - * @param aConfig GT_Config */ - private static void sharedConfigLoad(GT_Config aConfig) { - sAllowMultipleEggs = aConfig.get(machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); - sDragonEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.DragonEgg", 2048); - sCreeperEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.CreeperEgg", 512); - sEnergyPerEndercrystal = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 512); - if (THAUMCRAFT_LOADED) { - sEnergyFromVis = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerVis", 20); - sEnergyPerEssentia = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerEssentia", 320); + private static void sharedConfigLoad() { + sAllowMultipleEggs = ConfigMachines.allowMultipleEggs; + if (Thaumcraft.isModLoaded()) { for (Aspect tAspect : Aspect.aspects.values()) { // noinspection UnstableApiUsage sAspectsEnergy.put( @@ -142,13 +132,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B sActiveSiphon = aSiphon; } - @Override - public void onConfigLoad(GT_Config aConfig) { - sharedConfigLoad(aConfig); - mEfficiency = aConfig.get(machineconfig, "MagicEnergyAbsorber.efficiency.tier." + mTier, 100 - mTier * 10); - mMaxVisPerDrain = (int) Math.round( - Math.sqrt((double) (V[mTier] * 10000) / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); - if (Math.pow(mMaxVisPerDrain, 2) * sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100) < V[mTier]) { + public void onConfigLoad() { + sharedConfigLoad(); + mEfficiency = 100 - mTier * 10; + mMaxVisPerDrain = (int) Math.round(Math.sqrt((double) (V[mTier] * 10000) / (sEnergyFromVis * getEfficiency()))); + if (Math.pow(mMaxVisPerDrain, 2) * sEnergyFromVis * getEfficiency() < V[mTier]) { mMaxVisPerDrain += 1; } } @@ -229,7 +217,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (sEnergyPerEndercrystal > 0) { description.add(LI + sEnergyPerEndercrystal + EU_PER + LIGHT_PURPLE + "Ender Crystal" + GRAY + " in range"); } - if (THAUMCRAFT_LOADED) { + if (Thaumcraft.isModLoaded()) { description.add(LI + mMaxVisPerDrain + "%%%CV/t from an " + LIGHT_PURPLE + "Energised Node" + GRAY); description.add( LI + (sEnergyPerEssentia * getEfficiency()) / 100 @@ -561,7 +549,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } private long absorbFromVisNet() { - if (!THAUMCRAFT_LOADED) return 0; + if (!Thaumcraft.isModLoaded()) return 0; long tEU; IGregTechTileEntity tBaseMetaTileEntity = getBaseMetaTileEntity(); @@ -584,7 +572,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } private long absorbFromEssentiaContainers() { - if (!THAUMCRAFT_LOADED) return 0; + if (!Thaumcraft.isModLoaded()) return 0; long tEU = 0; @@ -666,7 +654,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B mMaxTier = Math.max(Math.max(aMaxTier, 0), Math.max(aDefaultTier, 0)); mDefaultTier = Math.min(aDefaultTier, mMaxTier); mTier = mDefaultTier; - if (THAUMCRAFT_LOADED) mAvailableAspects = new ArrayList<>(Aspect.aspects.size()); + if (Thaumcraft.isModLoaded()) mAvailableAspects = new ArrayList<>(Aspect.aspects.size()); } int getTier() { @@ -734,7 +722,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } private void scanAvailableAspects() { - if (!THAUMCRAFT_LOADED) return; + if (!Thaumcraft.isModLoaded()) return; IGregTechTileEntity tBaseMetaTileEntity = mAbsorber.getBaseMetaTileEntity(); if (tBaseMetaTileEntity.isInvalidTileEntity()) return; int tRange = getRange(); diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index ba5aaf4c64..1dd378e746 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -23,8 +23,6 @@ import static gregtech.api.enums.Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -43,7 +41,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); } - onConfigLoad(); + mEfficiency = getBaseEff(); } public GT_MetaTileEntity_NaquadahReactor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -51,7 +49,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); } - onConfigLoad(); + mEfficiency = getBaseEff(); } @Override @@ -89,18 +87,13 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe @Override public int getEfficiency() { - return mEfficiency == 0 ? onConfigLoad() : mEfficiency; + return mEfficiency; } private int getBaseEff() { return mTier == 4 ? 80 : 100 + (50 * (mTier - 5)); } - public int onConfigLoad() { - return mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); - } - @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java index 603c1439ba..fa980ce480 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -7,8 +7,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -23,17 +21,17 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Plasma into energy"); - onConfigLoad(); + setEfficiency(); } public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - onConfigLoad(); + setEfficiency(); } public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - onConfigLoad(); + setEfficiency(); } @Override @@ -133,11 +131,8 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "PlasmaGenerator.efficiency.tier." + this.mTier, - Math.max(10, 10 + Math.min(90, this.mTier * 10))); + public void setEfficiency() { + this.mEfficiency = Math.max(10, 10 + Math.min(90, this.mTier * 10)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index 3c9a89815a..9c1b8db562 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -25,8 +25,6 @@ import static gregtech.api.enums.Textures.BlockIcons.STEAM_TURBINE_TOP_GLOW; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -46,17 +44,17 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener aNameRegional, aTier, new String[] { "Converts Steam into EU", "Base rate: 2L of Steam -> 1 EU" }); - onConfigLoad(); + this.mEfficiency = 6 + this.mTier; } public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - onConfigLoad(); + this.mEfficiency = 6 + this.mTier; } public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - onConfigLoad(); + this.mEfficiency = 6 + this.mTier; } @Override @@ -90,11 +88,6 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener return 24000 * this.mTier; } - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); - } - @Override public int getEfficiency() { return this.mEfficiency; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index ef0914f6a4..7eaa8122c1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -26,7 +26,6 @@ import net.minecraftforge.fluids.FluidStack; import com.google.common.primitives.Ints; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.ItemList; import gregtech.api.enums.MachineType; import gregtech.api.enums.Materials; @@ -39,11 +38,11 @@ import gregtech.api.objects.overclockdescriber.OverclockDescriber; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.common.config.machinestats.ConfigMassFabricator; public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine { @@ -135,13 +134,12 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac } @Override - public void onConfigLoad(GT_Config aConfig) { - super.onConfigLoad(aConfig); - sDurationMultiplier = aConfig - .get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); - sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); - sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); - sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); + public void onConfigLoad() { + super.onConfigLoad(); + sDurationMultiplier = ConfigMassFabricator.durationMultiplier; + sUUAperUUM = ConfigMassFabricator.UUAPerUUM; + sUUASpeedBonus = ConfigMassFabricator.UUASpeedBonus; + sRequiresUUA = ConfigMassFabricator.requiresUUA; Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java index aa8616e03d..575e98c5c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -28,7 +28,6 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; @@ -42,8 +41,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; +import gregtech.common.config.machinestats.ConfigMicrowaveEnergyTransmitter; +import gregtech.common.config.machinestats.ConfigTeleporter; public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo, IAddUIWidgets { @@ -154,12 +154,11 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } @Override - public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig - .get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); - mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss", 50), 11); - mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance", 10000); - mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy", true); + public void onConfigLoad() { + sInterDimensionalTeleportAllowed = ConfigTeleporter.interDimensionalTPAllowed; + mMaxLoss = Math.max(ConfigMicrowaveEnergyTransmitter.maxLoss, 11); + mMaxLossDistance = ConfigMicrowaveEnergyTransmitter.maxLossDistance; + mPassiveEnergyUse = ConfigMicrowaveEnergyTransmitter.passiveEnergyUse; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index 1c95ee563d..9de00b4a0e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -50,7 +50,6 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; -import gregtech.api.enums.ConfigCategories; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.gui.modularui.GUITextureSet; @@ -61,8 +60,8 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; +import gregtech.common.config.machinestats.ConfigTeleporter; public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo, IAddUIWidgets { @@ -246,12 +245,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank } @Override - public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig - .get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); - sPassiveEnergyDrain = aConfig - .get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain); - sPowerMultiplyer = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PowerMultipler", sPowerMultiplyer); + public void onConfigLoad() { + sInterDimensionalTeleportAllowed = ConfigTeleporter.interDimensionalTPAllowed; + sPassiveEnergyDrain = ConfigTeleporter.passiveEnergyDrain; + sPowerMultiplyer = ConfigTeleporter.powerMultiplier; sFPowerMultiplyer = sPowerMultiplyer / 100.0; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index cd31b9cc1e..b0b9cdd078 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -470,6 +470,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB cfg.get("cleanroom_allowed_blocks.warded_glass", "Name", "tile.blockCosmeticOpaque"); cfg.get("cleanroom_allowed_blocks.warded_glass", "Meta", 2); cfg.get("cleanroom_allowed_blocks.warded_glass", "Percentage", 50); + cfg.save(); } public static void loadConfig(Configuration cfg) { diff --git a/src/main/java/gregtech/loaders/load/GT_Loader_MetaTileEntities_Recipes.java b/src/main/java/gregtech/loaders/load/GT_Loader_MetaTileEntities_Recipes.java index 95ee79db74..1c90187ee2 100644 --- a/src/main/java/gregtech/loaders/load/GT_Loader_MetaTileEntities_Recipes.java +++ b/src/main/java/gregtech/loaders/load/GT_Loader_MetaTileEntities_Recipes.java @@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack; import codechicken.nei.api.API; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -3960,21 +3959,13 @@ public class GT_Loader_MetaTileEntities_Recipes implements Runnable { GT_ModHandler.addCraftingRecipe( ItemList.MicroTransmitter_ZPM.get(1L), bitsd, - new Object[] { "CPC", aTextCableHull, "GBG", 'M', ItemList.Hull_ZPM, 'B', - GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "EnableZPMandUVBatteries", false) - ? ItemList.Energy_Module - : ItemList.ZPM2, - 'C', ItemList.Emitter_ZPM, 'G', OrePrefixes.circuit.get(Materials.ZPM), 'P', - ItemList.Field_Generator_ZPM }); + new Object[] { "CPC", aTextCableHull, "GBG", 'M', ItemList.Hull_ZPM, 'B', ItemList.Energy_Module, 'C', + ItemList.Emitter_ZPM, 'G', OrePrefixes.circuit.get(Materials.ZPM), 'P', ItemList.Field_Generator_ZPM }); GT_ModHandler.addCraftingRecipe( ItemList.MicroTransmitter_UV.get(1L), bitsd, - new Object[] { "CPC", aTextCableHull, "GBG", 'M', ItemList.Hull_UV, 'B', - GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "EnableZPMandUVBatteries", false) - ? ItemList.Energy_Module - : ItemList.ZPM3, - 'C', ItemList.Emitter_UV, 'G', OrePrefixes.circuit.get(Materials.UV), 'P', - ItemList.Field_Generator_UV }); + new Object[] { "CPC", aTextCableHull, "GBG", 'M', ItemList.Hull_UV, 'B', ItemList.Energy_Module, 'C', + ItemList.Emitter_UV, 'G', OrePrefixes.circuit.get(Materials.UV), 'P', ItemList.Field_Generator_UV }); GT_ModHandler.addCraftingRecipe( ItemList.Machine_Multi_Assemblyline.get(1L), diff --git a/src/main/java/gregtech/loaders/misc/GT_Achievements.java b/src/main/java/gregtech/loaders/misc/GT_Achievements.java index 7747711cd8..1245a1dbaf 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Achievements.java +++ b/src/main/java/gregtech/loaders/misc/GT_Achievements.java @@ -20,8 +20,6 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.ItemSmeltedEvent; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -372,13 +370,10 @@ public class GT_Achievements { "over9000", false); registerAchievement("denseaspossible", 6, 10, ItemList.FusionComputer_UV.get(1), "finalpreparations", false); - if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "EnableZPMandUVBatteries", false)) { - registerAchievement("zpmage", 8, 10, ItemList.Energy_Module.get(1), "denseaspossible", false); - registerAchievement("uvage", 10, 10, ItemList.Energy_Cluster.get(1), "zpmage", false); - registerAchievement("whatnow", 12, 10, ItemList.ZPM2.get(1), "uvage", false); - } else { - registerAchievement("whatnow", 8, 10, ItemList.ZPM2.get(1), "denseaspossible", false); - } + + registerAchievement("zpmage", 8, 10, ItemList.Energy_Module.get(1), "denseaspossible", false); + registerAchievement("uvage", 10, 10, ItemList.Energy_Cluster.get(1), "zpmage", false); + registerAchievement("whatnow", 12, 10, ItemList.ZPM2.get(1), "uvage", false); if (GT_Mod.gregtechproxy.mAchievements) { AchievementPage.registerAchievementPage( diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java index 945ffae386..79342a460d 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java @@ -63,17 +63,7 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra .eut(TierEU.RECIPE_LV) .addTo(centrifugeRecipes); } else { - registerStandardOreRecipes( - aPrefix, - aMaterial, - GT_Utility.copyAmount(1, aStack), - Math.max( - 1, - gregtech.api.GregTech_API.sOPStuff.get( - gregtech.api.enums.ConfigCategories.Materials.oreprocessingoutputmultiplier, - aMaterial.toString(), - 1)) - * (tIsRich ? 2 : 1)); + registerStandardOreRecipes(aPrefix, aMaterial, GT_Utility.copyAmount(1, aStack), tIsRich ? 2 : 1); } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingRawOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingRawOre.java index 5ece6f5315..2da9f4b865 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingRawOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingRawOre.java @@ -40,16 +40,7 @@ public class ProcessingRawOre implements gregtech.api.interfaces.IOreRecipeRegis .eut(TierEU.RECIPE_LV) .addTo(centrifugeRecipes); } else { - registerStandardOreRecipes( - aPrefix, - aMaterial, - GT_Utility.copyAmount(1, aStack), - Math.max( - 1, - gregtech.api.GregTech_API.sOPStuff.get( - gregtech.api.enums.ConfigCategories.Materials.oreprocessingoutputmultiplier, - aMaterial.toString(), - 1))); + registerStandardOreRecipes(aPrefix, aMaterial, GT_Utility.copyAmount(1, aStack), 1); } } diff --git a/src/main/java/gregtech/loaders/postload/GT_PostLoad.java b/src/main/java/gregtech/loaders/postload/GT_PostLoad.java index 7998ba1ed2..5f0310a21e 100644 --- a/src/main/java/gregtech/loaders/postload/GT_PostLoad.java +++ b/src/main/java/gregtech/loaders/postload/GT_PostLoad.java @@ -15,7 +15,6 @@ import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -415,11 +414,9 @@ public class GT_PostLoad { @SuppressWarnings("UnstableApiUsage") // Stable enough for this project Stopwatch stopwatch = Stopwatch.createStarted(); GT_Mod.GT_FML_LOGGER.info("Replacing Vanilla Materials in recipes, please wait."); - Set<Materials> replaceVanillaItemsSet = GT_Mod.gregtechproxy.mUseGreatlyShrukenReplacementList - ? Arrays.stream(Materials.values()) - .filter(GT_RecipeRegistrator::hasVanillaRecipes) - .collect(Collectors.toSet()) - : new HashSet<>(Arrays.asList(Materials.values())); + Set<Materials> replaceVanillaItemsSet = Arrays.stream(Materials.values()) + .filter(GT_RecipeRegistrator::hasVanillaRecipes) + .collect(Collectors.toSet()); ProgressManager.ProgressBar progressBar = ProgressManager .push("Register materials", replaceVanillaItemsSet.size()); diff --git a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java index 8213013bfc..921f227b08 100644 --- a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java +++ b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java @@ -1,2384 +1,33 @@ package gregtech.loaders.postload; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; +import bloodasp.galacticgreg.WorldGenGaGT; +import gregtech.api.enums.GTStones; +import gregtech.api.enums.OreMixes; +import gregtech.api.enums.SmallOres; import gregtech.api.util.GT_Log; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; -import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; -import gregtech.common.GT_Worldgen_Stone; import gregtech.common.GT_Worldgenerator; public class GT_Worldgenloader implements Runnable { public void run() { - new GT_Worldgenerator(); - new GT_Worldgen_Stone( - "overworld.stone.blackgranite.tiny", - true, - GregTech_API.sBlockGranites, - 0, - 0, - 1, - 75, - 5, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.blackgranite.small", - true, - GregTech_API.sBlockGranites, - 0, - 0, - 1, - 100, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.blackgranite.medium", - true, - GregTech_API.sBlockGranites, - 0, - 0, - 1, - 200, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.blackgranite.large", - true, - GregTech_API.sBlockGranites, - 0, - 0, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.blackgranite.huge", - true, - GregTech_API.sBlockGranites, - 0, - 0, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "overworld.stone.redgranite.tiny", - true, - GregTech_API.sBlockGranites, - 8, - 0, - 1, - 75, - 5, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.redgranite.small", - true, - GregTech_API.sBlockGranites, - 8, - 0, - 1, - 100, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.redgranite.medium", - true, - GregTech_API.sBlockGranites, - 8, - 0, - 1, - 200, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.redgranite.large", - true, - GregTech_API.sBlockGranites, - 8, - 0, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.redgranite.huge", - true, - GregTech_API.sBlockGranites, - 8, - 0, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "overworld.stone.marble.tiny", - true, - GregTech_API.sBlockStones, - 0, - 0, - 1, - 75, - 5, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.marble.small", - true, - GregTech_API.sBlockStones, - 0, - 0, - 1, - 100, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.marble.medium", - true, - GregTech_API.sBlockStones, - 0, - 0, - 1, - 200, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.marble.large", - true, - GregTech_API.sBlockStones, - 0, - 0, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.marble.huge", - true, - GregTech_API.sBlockStones, - 0, - 0, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "overworld.stone.basalt.tiny", - true, - GregTech_API.sBlockStones, - 8, - 0, - 1, - 75, - 5, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.basalt.small", - true, - GregTech_API.sBlockStones, - 8, - 0, - 1, - 100, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.basalt.medium", - true, - GregTech_API.sBlockStones, - 8, - 0, - 1, - 200, - 10, - 0, - 180, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.basalt.large", - true, - GregTech_API.sBlockStones, - 8, - 0, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "overworld.stone.basalt.huge", - true, - GregTech_API.sBlockStones, - 8, - 0, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "nether.stone.blackgranite.tiny", - false, - GregTech_API.sBlockGranites, - 0, - -1, - 1, - 50, - 45, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.blackgranite.small", - false, - GregTech_API.sBlockGranites, - 0, - -1, - 1, - 100, - 60, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.blackgranite.medium", - false, - GregTech_API.sBlockGranites, - 0, - -1, - 1, - 200, - 80, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.blackgranite.large", - false, - GregTech_API.sBlockGranites, - 0, - -1, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.blackgranite.huge", - false, - GregTech_API.sBlockGranites, - 0, - -1, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "nether.stone.redgranite.tiny", - false, - GregTech_API.sBlockGranites, - 8, - -1, - 1, - 50, - 45, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.redgranite.small", - false, - GregTech_API.sBlockGranites, - 8, - -1, - 1, - 100, - 60, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.redgranite.medium", - false, - GregTech_API.sBlockGranites, - 8, - -1, - 1, - 200, - 80, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.redgranite.large", - false, - GregTech_API.sBlockGranites, - 8, - -1, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.redgranite.huge", - false, - GregTech_API.sBlockGranites, - 8, - -1, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "nether.stone.marble.tiny", - false, - GregTech_API.sBlockStones, - 0, - -1, - 1, - 50, - 45, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.marble.small", - false, - GregTech_API.sBlockStones, - 0, - -1, - 1, - 100, - 60, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.marble.medium", - false, - GregTech_API.sBlockStones, - 0, - -1, - 1, - 200, - 80, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.marble.large", - false, - GregTech_API.sBlockStones, - 0, - -1, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.marble.huge", - false, - GregTech_API.sBlockStones, - 0, - -1, - 1, - 400, - 150, - 0, - 120, - null, - false); - - new GT_Worldgen_Stone( - "nether.stone.basalt.tiny", - false, - GregTech_API.sBlockStones, - 8, - -1, - 1, - 50, - 45, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.basalt.small", - false, - GregTech_API.sBlockStones, - 8, - -1, - 1, - 100, - 60, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.basalt.medium", - false, - GregTech_API.sBlockStones, - 8, - -1, - 1, - 200, - 80, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.basalt.large", - false, - GregTech_API.sBlockStones, - 8, - -1, - 1, - 300, - 70, - 0, - 120, - null, - false); - new GT_Worldgen_Stone( - "nether.stone.basalt.huge", - false, - GregTech_API.sBlockStones, - 8, - -1, - 1, - 400, - 150, - 0, - 120, - null, - false); + // GT Stones + for (GTStones stone : GTStones.values()) { + stone.addGTStone(); + } // GT Default Small Ores - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.copper", - true, - 60, - 180, - 32, - true, - true, - true, - true, - true, - false, - Materials.Copper); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.tin", - true, - 80, - 220, - 32, - true, - true, - true, - true, - true, - true, - Materials.Tin); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.bismuth", - true, - 80, - 120, - 8, - false, - true, - false, - true, - true, - false, - Materials.Bismuth); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.coal", - true, - 120, - 250, - 24, - true, - false, - false, - false, - false, - false, - Materials.Coal); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.iron", - true, - 40, - 100, - 16, - true, - true, - true, - true, - true, - false, - Materials.Iron); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.lead", - true, - 40, - 180, - 16, - false, - true, - true, - true, - true, - true, - Materials.Lead); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.zinc", - true, - 80, - 210, - 24, - true, - true, - true, - true, - true, - false, - Materials.Zinc); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.gold", - true, - 20, - 60, - 8, - true, - false, - true, - true, - true, - true, - Materials.Gold); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.silver", - true, - 20, - 60, - 20, - true, - true, - true, - true, - true, - true, - Materials.Silver); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.nickel", - true, - 80, - 150, - 8, - true, - false, - true, - true, - true, - true, - Materials.Nickel); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.lapis", - true, - 10, - 50, - 4, - true, - false, - false, - true, - false, - true, - Materials.Lapis); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.diamond", - true, - 5, - 15, - 2, - true, - false, - false, - true, - true, - true, - Materials.Diamond); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.emerald", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Emerald); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.ruby", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Ruby); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.sapphire", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Sapphire); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.greensapphire", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.GreenSapphire); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.olivine", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Olivine); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.topaz", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Topaz); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.tanzanite", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Tanzanite); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.amethyst", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Amethyst); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.opal", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Opal); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.jasper", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Jasper); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.bluetopaz", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.BlueTopaz); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.amber", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.Amber); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.foolsruby", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.FoolsRuby); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.garnetred", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.GarnetRed); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.garnetyellow", - true, - 5, - 35, - 2, - false, - false, - false, - false, - true, - true, - Materials.GarnetYellow); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.redstone", - true, - 5, - 25, - 8, - true, - true, - false, - true, - true, - true, - Materials.Redstone); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.netherquartz", - true, - 30, - 120, - 64, - false, - true, - false, - false, - false, - false, - Materials.NetherQuartz); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.saltpeter", - true, - 10, - 60, - 8, - false, - true, - false, - false, - false, - false, - Materials.Saltpeter); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.sulfur", - true, - 5, - 60, - 40, - false, - true, - false, - false, - false, - false, - Materials.Sulfur); - - // TODO: GTNH Custom Small Ores - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.titanium", - true, - 10, - 180, - 32, - false, - false, - false, - Materials.Titanium); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.tungsten", - true, - 10, - 120, - 16, - false, - false, - false, - Materials.Tungsten); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.meteoriciron", - true, - 50, - 70, - 8, - false, - false, - false, - Materials.MeteoricIron); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.firestone", - true, - 5, - 15, - 2, - false, - false, - false, - Materials.Firestone); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.neutronium", - true, - 5, - 15, - 8, - false, - false, - false, - Materials.Neutronium); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.chromite", - true, - 20, - 40, - 8, - false, - false, - false, - Materials.Chromite); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.tungstate", - true, - 20, - 40, - 8, - false, - false, - false, - Materials.Tungstate); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.naquadah", - true, - 5, - 25, - 8, - false, - false, - false, - Materials.Naquadah); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.quantium", - true, - 5, - 25, - 6, - false, - false, - false, - Materials.Quantium); - new GT_Worldgen_GT_Ore_SmallPieces("ore.small.mythril", true, 5, 25, 6, false, false, false, Materials.Mytryl); - new GT_Worldgen_GT_Ore_SmallPieces("ore.small.ledox", true, 40, 60, 4, false, false, false, Materials.Ledox); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.oriharukon", - true, - 20, - 40, - 6, - false, - false, - false, - Materials.Oriharukon); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.draconium", - true, - 5, - 15, - 4, - false, - false, - false, - Materials.Draconium); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.awdraconium", - true, - 5, - 15, - 2, - false, - false, - false, - Materials.DraconiumAwakened); - new GT_Worldgen_GT_Ore_SmallPieces("ore.small.desh", true, 10, 30, 6, false, false, false, Materials.Desh); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.blackplutonium", - true, - 25, - 45, - 6, - false, - false, - false, - Materials.BlackPlutonium); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.infinitycatalyst", - true, - 40, - 80, - 6, - false, - false, - false, - Materials.InfinityCatalyst); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.infinity", - true, - 2, - 40, - 2, - false, - false, - false, - Materials.Infinity); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.bedrockium", - true, - 5, - 25, - 6, - false, - false, - false, - Materials.Bedrockium); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.realgar", - true, - 15, - 85, - 32, - false, - true, - false, - Materials.Realgar); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.certusquartz", - true, - 5, - 115, - 16, - false, - true, - false, - Materials.CertusQuartz); - new GT_Worldgen_GT_Ore_SmallPieces("ore.small.jade", true, 5, 35, 2, false, false, false, Materials.Jade); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.deepiron", - true, - 5, - 40, - 8, - false, - false, - false, - Materials.DeepIron); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.redgarnet", - true, - 5, - 35, - 2, - false, - false, - false, - Materials.GarnetRed); - new GT_Worldgen_GT_Ore_SmallPieces( - "ore.small.chargedcertus", - true, - 5, - 115, - 4, - false, - false, - false, - Materials.CertusQuartzCharged); - - // GT Default Veins - - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.naquadah", - true, - 10, - 90, - 30, - 4, - 32, - false, - false, - false, - Materials.Naquadah, - Materials.Naquadah, - Materials.Naquadah, - Materials.NaquadahEnriched); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.lignite", - true, - 80, - 210, - 160, - 7, - 32, - true, - false, - false, - Materials.Lignite, - Materials.Lignite, - Materials.Lignite, - Materials.Coal); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.coal", - true, - 30, - 80, - 80, - 5, - 32, - true, - false, - false, - Materials.Coal, - Materials.Coal, - Materials.Coal, - Materials.Lignite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.magnetite", - true, - 60, - 180, - 160, - 2, - 32, - true, - false, - false, - Materials.Magnetite, - Materials.Magnetite, - Materials.Iron, - Materials.VanadiumMagnetite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.gold", - true, - 30, - 60, - 160, - 2, - 32, - true, - false, - true, - Materials.Magnetite, - Materials.Magnetite, - Materials.VanadiumMagnetite, - Materials.Gold); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.iron", - true, - 10, - 40, - 120, - 3, - 24, - true, - true, - false, - Materials.BrownLimonite, - Materials.YellowLimonite, - Materials.BandedIron, - Materials.Malachite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.cassiterite", - true, - 60, - 220, - 50, - 4, - 24, - true, - false, - true, - Materials.Tin, - Materials.Tin, - Materials.Cassiterite, - Materials.Tin); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.tetrahedrite", - true, - 80, - 120, - 70, - 3, - 24, - false, - true, - true, - Materials.Tetrahedrite, - Materials.Tetrahedrite, - Materials.Copper, - Materials.Stibnite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.netherquartz", - true, - 40, - 80, - 80, - 4, - 24, - false, - true, - false, - Materials.NetherQuartz, - Materials.NetherQuartz, - Materials.NetherQuartz, - Materials.Quartzite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.sulfur", - true, - 5, - 20, - 100, - 4, - 24, - false, - true, - false, - Materials.Sulfur, - Materials.Sulfur, - Materials.Pyrite, - Materials.Sphalerite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.copper", - true, - 5, - 60, - 80, - 3, - 24, - true, - true, - true, - Materials.Chalcopyrite, - Materials.Iron, - Materials.Pyrite, - Materials.Copper); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.bauxite", - true, - 10, - 80, - 80, - 3, - 24, - false, - false, - false, - Materials.Bauxite, - Materials.Ilmenite, - Materials.Aluminium, - Materials.Ilmenite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.salts", - true, - 50, - 70, - 50, - 2, - 24, - true, - false, - false, - Materials.RockSalt, - Materials.Salt, - Materials.Lepidolite, - Materials.Spodumene); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.redstone", - true, - 5, - 40, - 60, - 2, - 24, - true, - true, - false, - Materials.Redstone, - Materials.Redstone, - Materials.Ruby, - Materials.Cinnabar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.soapstone", - true, - 20, - 50, - 40, - 2, - 16, - true, - false, - false, - Materials.Soapstone, - Materials.Talc, - Materials.Glauconite, - Materials.Pentlandite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.nickel", - true, - 10, - 40, - 40, - 2, - 16, - false, - false, - true, - Materials.Garnierite, - Materials.Nickel, - Materials.Cobaltite, - Materials.Pentlandite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.platinum", - true, - 40, - 50, - 5, - 2, - 16, - false, - false, - false, - Materials.Cooperite, - Materials.Palladium, - Materials.Platinum, - Materials.Iridium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.pitchblende", - true, - 30, - 60, - 40, - 2, - 16, - false, - false, - false, - Materials.Pitchblende, - Materials.Pitchblende, - Materials.Uraninite, - Materials.Uraninite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.monazite", - true, - 20, - 40, - 30, - 2, - 16, - false, - false, - false, - Materials.Bastnasite, - Materials.Bastnasite, - Materials.Monazite, - Materials.Neodymium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.molybdenum", - true, - 20, - 50, - 5, - 2, - 16, - false, - true, - true, - Materials.Wulfenite, - Materials.Molybdenite, - Materials.Molybdenum, - Materials.Powellite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.tungstate", - true, - 20, - 60, - 10, - 2, - 16, - false, - false, - false, - Materials.Scheelite, - Materials.Scheelite, - Materials.Tungstate, - Materials.Lithium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.sapphire", - true, - 10, - 40, - 60, - 2, - 16, - false, - false, - false, - Materials.Almandine, - Materials.Pyrope, - Materials.Sapphire, - Materials.GreenSapphire); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.manganese", - true, - 20, - 30, - 20, - 2, - 16, - true, - true, - false, - Materials.Grossular, - Materials.Spessartine, - Materials.Pyrolusite, - Materials.Tantalite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.quartz", - true, - 80, - 120, - 30, - 2, - 16, - false, - true, - false, - Materials.Quartzite, - Materials.Barite, - Materials.CertusQuartz, - Materials.CertusQuartz); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.diamond", - true, - 5, - 20, - 40, - 1, - 16, - true, - false, - false, - Materials.Graphite, - Materials.Graphite, - Materials.Diamond, - Materials.Coal); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.olivine", - true, - 10, - 40, - 60, - 2, - 16, - false, - false, - false, - Materials.Bentonite, - Materials.Magnesite, - Materials.Olivine, - Materials.Glauconite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.apatite", - true, - 40, - 60, - 60, - 2, - 16, - true, - false, - false, - Materials.Apatite, - Materials.Apatite, - Materials.TricalciumPhosphate, - Materials.Pyrochlore); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.galena", - true, - 5, - 45, - 40, - 4, - 16, - false, - false, - false, - Materials.Galena, - Materials.Galena, - Materials.Silver, - Materials.Lead); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.lapis", - true, - 20, - 50, - 40, - 4, - 16, - true, - false, - false, - Materials.Lazurite, - Materials.Sodalite, - Materials.Lapis, - Materials.Calcite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.beryllium", - true, - 5, - 30, - 30, - 2, - 16, - false, - true, - true, - Materials.Beryllium, - Materials.Beryllium, - Materials.Emerald, - Materials.Thorium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.uranium", - true, - 20, - 30, - 20, - 2, - 16, - false, - false, - false, - Materials.Uraninite, - Materials.Uraninite, - Materials.Uranium, - Materials.Uranium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.oilsand", - true, - 50, - 80, - 40, - 5, - 16, - true, - false, - false, - Materials.Oilsands, - Materials.Oilsands, - Materials.Oilsands, - Materials.Oilsands); - - /* - * TODO: custom GTNH OreMixes WARNING: NO DUPLICATES IN aName OR DEPRECATED MATERIALS IN HERE. Materials can be - * used unlimited, since achievements for Ores are turned off. - */ - - // aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, aOverworld, aNether, aEnd, aPrimary, aSecondary, - // aBetween, aSporadic - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.neutronium", - true, - 5, - 30, - 10, - 2, - 16, - false, - false, - false, - Materials.Neutronium, - Materials.Adamantium, - Materials.Naquadah, - Materials.Titanium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.aquaignis", - true, - 5, - 35, - 16, - 2, - 16, - false, - false, - false, - Materials.InfusedWater, - Materials.InfusedFire, - Materials.Amber, - Materials.Cinnabar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.terraaer", - true, - 5, - 35, - 16, - 2, - 16, - false, - false, - false, - Materials.InfusedEarth, - Materials.InfusedAir, - Materials.Amber, - Materials.Cinnabar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.perditioordo", - true, - 5, - 35, - 16, - 2, - 16, - false, - false, - false, - Materials.InfusedEntropy, - Materials.InfusedOrder, - Materials.Amber, - Materials.Cinnabar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.coppertin", - true, - 80, - 200, - 80, - 3, - 24, - true, - false, - false, - Materials.Chalcopyrite, - Materials.Vermiculite, - Materials.Cassiterite, - Materials.Alunite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.titaniumchrome", - true, - 10, - 70, - 16, - 2, - 16, - false, - false, - false, - Materials.Ilmenite, - Materials.Chromite, - Materials.Uvarovite, - Materials.Perlite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.mineralsand", - true, - 50, - 60, - 80, - 3, - 24, - true, - false, - false, - Materials.BasalticMineralSand, - Materials.GraniticMineralSand, - Materials.FullersEarth, - Materials.Gypsum); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.garnettin", - true, - 50, - 60, - 80, - 3, - 24, - true, - false, - false, - Materials.CassiteriteSand, - Materials.GarnetSand, - Materials.Asbestos, - Materials.Diatomite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.kaolinitezeolite", - true, - 50, - 70, - 60, - 4, - 16, - true, - false, - false, - Materials.Kaolinite, - Materials.Zeolite, - Materials.FullersEarth, - Materials.GlauconiteSand); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.mica", - true, - 20, - 40, - 20, - 2, - 16, - true, - false, - false, - Materials.Kyanite, - Materials.Mica, - Materials.Cassiterite, - Materials.Pollucite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.dolomite", - true, - 150, - 200, - 40, - 4, - 24, - true, - false, - false, - Materials.Dolomite, - Materials.Wollastonite, - Materials.Trona, - Materials.Andradite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.platinumchrome", - true, - 5, - 30, - 10, - 2, - 16, - false, - false, - false, - Materials.Platinum, - Materials.Chrome, - Materials.Cooperite, - Materials.Palladium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.iridiummytryl", - true, - 15, - 40, - 10, - 2, - 16, - false, - false, - false, - Materials.Nickel, - Materials.Iridium, - Materials.Palladium, - Materials.Mithril); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.osmium", - true, - 5, - 30, - 10, - 2, - 16, - false, - false, - false, - Materials.Nickel, - Materials.Osmium, - Materials.Iridium, - Materials.Nickel); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.saltpeterelectrotine", - true, - 5, - 45, - 40, - 3, - 16, - false, - true, - false, - Materials.Saltpeter, - Materials.Diatomite, - Materials.Electrotine, - Materials.Alunite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.desh", - true, - 5, - 40, - 30, - 2, - 16, - false, - false, - false, - Materials.Desh, - Materials.Desh, - Materials.Scheelite, - Materials.Tungstate); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.draconium", - true, - 20, - 40, - 40, - 1, - 16, - false, - false, - false, - Materials.Draconium, - Materials.Electrotine, - Materials.Jade, - Materials.Vinteum); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.quantium", - true, - 5, - 25, - 30, - 3, - 24, - false, - false, - false, - Materials.Quantium, - Materials.Amethyst, - Materials.Rutile, - Materials.Ardite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.callistoice", - true, - 40, - 60, - 40, - 2, - 16, - false, - false, - false, - Materials.CallistoIce, - Materials.Topaz, - Materials.BlueTopaz, - Materials.Alduorite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.mytryl", - true, - 10, - 30, - 40, - 2, - 16, - false, - false, - false, - Materials.Mytryl, - Materials.Jasper, - Materials.Ceruclase, - Materials.Vulcanite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.ledox", - true, - 55, - 65, - 30, - 2, - 24, - false, - false, - false, - Materials.Ledox, - Materials.Opal, - Materials.Orichalcum, - Materials.Rubracium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.oriharukon", - true, - 30, - 60, - 40, - 2, - 16, - false, - false, - false, - Materials.Oriharukon, - Materials.Tanzanite, - Materials.Vyroxeres, - Materials.Mirabilite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.blackplutonium", - true, - 5, - 25, - 40, - 2, - 24, - false, - false, - false, - Materials.BlackPlutonium, - Materials.GarnetRed, - Materials.GarnetYellow, - Materials.Borax); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.infusedgold", - true, - 15, - 40, - 30, - 2, - 16, - false, - false, - false, - Materials.Gold, - Materials.Gold, - Materials.InfusedGold, - Materials.Platinum); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.niobium", - true, - 5, - 30, - 60, - 2, - 24, - false, - false, - false, - Materials.Niobium, - Materials.Yttrium, - Materials.Gallium, - Materials.Gallium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.tungstenirons", - true, - 5, - 25, - 16, - 2, - 30, - false, - false, - false, - Materials.Tungsten, - Materials.Silicon, - Materials.DeepIron, - Materials.ShadowIron); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.uraniumgtnh", - true, - 10, - 30, - 60, - 2, - 24, - false, - false, - false, - Materials.Thorium, - Materials.Uranium, - Materials.Plutonium241, - Materials.Uranium235); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.vanadiumgold", - true, - 10, - 50, - 60, - 2, - 24, - false, - false, - false, - Materials.Vanadium, - Materials.Magnetite, - Materials.Gold, - Materials.Chrome); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.netherstar", - true, - 20, - 60, - 60, - 2, - 24, - false, - false, - false, - Materials.GarnetSand, - Materials.NetherStar, - Materials.GarnetRed, - Materials.GarnetYellow); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.garnet", - true, - 10, - 30, - 40, - 2, - 16, - false, - false, - false, - Materials.GarnetRed, - Materials.GarnetYellow, - Materials.Chrysotile, - Materials.Realgar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.rareearth", - true, - 30, - 60, - 40, - 2, - 24, - false, - false, - false, - Materials.Cadmium, - Materials.Caesium, - Materials.Lanthanum, - Materials.Cerium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.richnuclear", - true, - 55, - 120, - 5, - 2, - 8, - false, - false, - false, - Materials.Uranium, - Materials.Plutonium, - Materials.Thorium, - Materials.Thorium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.heavypentele", - true, - 40, - 60, - 60, - 5, - 32, - false, - false, - false, - Materials.Arsenic, - Materials.Bismuth, - Materials.Antimony, - Materials.Antimony); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.europa", - true, - 55, - 65, - 110, - 4, - 24, - false, - false, - false, - Materials.Magnesite, - Materials.BandedIron, - Materials.Sulfur, - Materials.Opal); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.europacore", - true, - 5, - 15, - 5, - 2, - 16, - false, - false, - false, - Materials.Chrome, - Materials.Tungstate, - Materials.Molybdenum, - Materials.Manganese); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.secondlanthanid", - true, - 10, - 40, - 10, - 3, - 24, - false, - false, - false, - Materials.Samarium, - Materials.Neodymium, - Materials.Tartarite, - Materials.Tartarite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.quartzspace", - true, - 40, - 80, - 20, - 3, - 16, - false, - false, - false, - Materials.Quartzite, - Materials.Barite, - Materials.CertusQuartz, - Materials.CertusQuartz); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.rutile", - true, - 5, - 20, - 8, - 4, - 12, - false, - false, - false, - Materials.Rutile, - Materials.Titanium, - Materials.Bauxite, - Materials.MeteoricIron); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.tfgalena", - true, - 5, - 35, - 40, - 4, - 16, - false, - false, - false, - Materials.Galena, - Materials.Silver, - Materials.Lead, - Materials.Cryolite); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.luvtantalite", - true, - 20, - 30, - 10, - 4, - 16, - false, - false, - false, - Materials.Pyrolusite, - Materials.Apatite, - Materials.Tantalite, - Materials.Pyrochlore); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.certusquartz", - true, - 40, - 80, - 60, - 5, - 32, - false, - false, - false, - Materials.CertusQuartz, - Materials.CertusQuartz, - Materials.CertusQuartzCharged, - Materials.QuartzSand); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.infinitycatalyst", - true, - 5, - 20, - 15, - 2, - 16, - false, - false, - false, - Materials.Neutronium, - Materials.Adamantium, - Materials.InfinityCatalyst, - Materials.Bedrockium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.cosmicneutronium", - true, - 5, - 20, - 15, - 2, - 16, - false, - false, - false, - Materials.Neutronium, - Materials.CosmicNeutronium, - Materials.BlackPlutonium, - Materials.Bedrockium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.dilithium", - true, - 30, - 100, - 30, - 3, - 24, - false, - false, - false, - Materials.Dilithium, - Materials.Dilithium, - Materials.MysteriousCrystal, - Materials.Vinteum); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.naquadria", - true, - 10, - 90, - 40, - 4, - 24, - false, - false, - false, - Materials.Naquadah, - Materials.NaquadahEnriched, - Materials.Naquadria, - Materials.Trinium); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.awakeneddraconium", - true, - 20, - 40, - 20, - 3, - 16, - false, - false, - false, - Materials.Draconium, - Materials.Draconium, - Materials.DraconiumAwakened, - Materials.NetherStar); - new GT_Worldgen_GT_Ore_Layer( - "ore.mix.tengam", - true, - 30, - 180, - 80, - 2, - 32, - false, - false, - false, - Materials.TengamRaw, - Materials.TengamRaw, - Materials.Electrotine, - Materials.Samarium); + for (SmallOres smallOre : SmallOres.values()) { + smallOre.addGTSmallOre(); + } - // DO NOT DELETE V THIS V - this is needed so that gregtech generates its Ore Layer's first (the ones up there), - // which can then be transformed into "GT_Worldgen_GT_Ore_Layer_Space". Also, Reflexion is slow. - try { - Class<?> clazz = Class.forName("bloodasp.galacticgreg.WorldGenGaGT"); - Constructor<?> constructor = clazz.getConstructor(); - Method method = clazz.getMethod("run"); - method.invoke(constructor.newInstance()); - GT_Log.out.println("Started Galactic Greg ore gen code"); - // this function calls Galactic Greg and enables its generation. - } catch (Exception e) { - // ClassNotFound is expected if Galactic Greg is absent, so only report if other problem - if (!(e instanceof ClassNotFoundException)) { - GT_Log.err.println("Unable to start Galactic Greg ore gen code"); - e.printStackTrace(GT_Log.err); - } + // GT Veins registration + for (OreMixes oreMix : OreMixes.values()) { + oreMix.addGTOreLayer(); } - // DO NOT DELETE ^ THIS ^ + new WorldGenGaGT().run(); + GT_Log.out.println("Started Galactic Greg ore gen code"); } } diff --git a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java index 449bda7b27..dfbb2501f0 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java @@ -12,7 +12,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -1201,16 +1200,6 @@ public class DistilleryRecipes implements Runnable { Materials.Carbon.getDustTiny(3), 120, 120); - - if (GregTech_API.sSpecialFile.get("general", "EnableLagencyOilGalactiCraft", false) - && FluidRegistry.getFluid("oilgc") != null) - addUniversalDistillationRecipe( - new FluidStack(FluidRegistry.getFluid("oilgc"), 50), - new FluidStack[] { Materials.SulfuricHeavyFuel.getFluid(15), Materials.SulfuricLightFuel.getFluid(50), - Materials.SulfuricNaphtha.getFluid(20), Materials.SulfuricGas.getGas(60) }, - null, - 20, - 96); } public void addUniversalDistillationRecipewithCircuit(FluidStack aInput, ItemStack[] aCircuit, diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java index ce69a4fa27..fda6c4c9e8 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java @@ -31,7 +31,6 @@ import cpw.mods.fml.common.event.FMLInterModComms; 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.GT_Values; import gregtech.api.enums.ItemList; @@ -2061,59 +2060,33 @@ public class GT_Loader_Item_Block_And_Fluid implements Runnable { GT_OreDictUnificator .set(OrePrefixes.ingot, Materials.Void, GT_ModHandler.getModItem(Thaumcraft.ID, "ItemResource", 1L, 16)); - if (GregTech_API.sUnification - .get(ConfigCategories.specialunificationtargets + "." + "railcraft", "plateIron", true)) { - GT_OreDictUnificator - .set(OrePrefixes.plate, Materials.Iron, GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 0)); - } else { - GT_OreDictUnificator.set( - OrePrefixes.plate, - Materials.Iron, - GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 0), - false, - false); - } + GT_OreDictUnificator.set( + OrePrefixes.plate, + Materials.Iron, + GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 0), + false, + false); - if (GregTech_API.sUnification - .get(ConfigCategories.specialunificationtargets + "." + "railcraft", "plateSteel", true)) { - GT_OreDictUnificator - .set(OrePrefixes.plate, Materials.Steel, GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 1)); - } else { - GT_OreDictUnificator.set( - OrePrefixes.plate, - Materials.Steel, - GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 1), - false, - false); - } + GT_OreDictUnificator.set( + OrePrefixes.plate, + Materials.Steel, + GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 1), + false, + false); - if (GregTech_API.sUnification - .get(ConfigCategories.specialunificationtargets + "." + "railcraft", "plateTinAlloy", true)) { - GT_OreDictUnificator.set( - OrePrefixes.plate, - Materials.TinAlloy, - GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 2)); - } else { - GT_OreDictUnificator.set( - OrePrefixes.plate, - Materials.TinAlloy, - GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 2), - false, - false); - } + GT_OreDictUnificator.set( + OrePrefixes.plate, + Materials.TinAlloy, + GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 2), + false, + false); - if (GregTech_API.sUnification - .get(ConfigCategories.specialunificationtargets + "." + "railcraft", "plateCopper", true)) { - GT_OreDictUnificator - .set(OrePrefixes.plate, Materials.Copper, GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 3)); - } else { - GT_OreDictUnificator.set( - OrePrefixes.plate, - Materials.Copper, - GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 3), - false, - false); - } + GT_OreDictUnificator.set( + OrePrefixes.plate, + Materials.Copper, + GT_ModHandler.getModItem(Railcraft.ID, "part.plate", 1L, 3), + false, + false); GT_OreDictUnificator.set( OrePrefixes.dust, diff --git a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java index 26d75c7933..a2e6137cff 100644 --- a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java @@ -2,7 +2,6 @@ package gregtech.loaders.preload; import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.Mods.CraftTweaker; -import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.enums.Mods.GalacticraftCore; import static gregtech.api.enums.Mods.GregTech; @@ -14,7 +13,6 @@ import java.io.PrintStream; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; -import java.util.Calendar; import java.util.List; import java.util.Objects; import java.util.regex.Matcher; @@ -35,7 +33,6 @@ import cpw.mods.fml.common.discovery.ASMDataTable; import cpw.mods.fml.common.discovery.ModDiscoverer; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -50,6 +47,16 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_RecipeBuilder; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; +import gregtech.common.config.client.ConfigColorModulation; +import gregtech.common.config.client.ConfigInterface; +import gregtech.common.config.client.ConfigRender; +import gregtech.common.config.client.ConfigWaila; +import gregtech.common.config.gregtech.ConfigDebug; +import gregtech.common.config.gregtech.ConfigFeatures; +import gregtech.common.config.gregtech.ConfigGeneral; +import gregtech.common.config.gregtech.ConfigMachines; +import gregtech.common.config.gregtech.ConfigOreDropBehavior; +import gregtech.common.config.gregtech.ConfigPollution; import gregtech.common.tileentities.machines.long_distance.GT_MetaTileEntity_LongDistancePipelineBase; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; @@ -126,33 +133,28 @@ public class GT_PreLoad { .addStringLocalization("Material." + aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName)); } - public static Configuration getConfiguration(File configDir) { - File tFile = new File(new File(configDir, "GregTech"), "GregTech.cfg"); - Configuration tMainConfig = new Configuration(tFile); - tMainConfig.load(); - tFile = new File(new File(configDir, "GregTech"), "IDs.cfg"); + public static void getConfiguration(File configDir) { + File tFile = new File(new File(configDir, "GregTech"), "IDs.cfg"); GT_Config.sConfigFileIDs = new Configuration(tFile); GT_Config.sConfigFileIDs.load(); GT_Config.sConfigFileIDs.save(); - GregTech_API.sMachineFile = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "MachineStats.cfg"))); - GregTech_API.sWorldgenFile = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "WorldGeneration.cfg"))); - GregTech_API.sMaterialProperties = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "MaterialProperties.cfg"))); - GregTech_API.sUnification = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "Unification.cfg"))); - GregTech_API.sSpecialFile = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "Other.cfg"))); - GregTech_API.sOPStuff = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "OverpoweredStuff.cfg"))); - - GregTech_API.sClientDataFile = new GT_Config( - new Configuration(new File(new File(configDir, "GregTech"), "Client.cfg"))); - return tMainConfig; + + tFile = new File(new File(configDir, "GregTech"), "Cleanroom.cfg"); + GT_Config.cleanroomFile = new Configuration(tFile); + GT_Config.cleanroomFile.load(); + GT_Config.cleanroomFile.save(); + + tFile = new File(new File(configDir, "GregTech"), "UndergroundFluids.cfg"); + GT_Config.undergroundFluidsFile = new Configuration(tFile); + GT_Config.undergroundFluidsFile.load(); + GT_Config.undergroundFluidsFile.save(); + + GregTech_API.NEIClientFIle = new GT_Config( + new Configuration(new File(new File(configDir, "GregTech"), "NEIClient.cfg"))); + } - public static void createLogFiles(File parentFile, Configuration tMainConfig) { + public static void createLogFiles(File parentFile) { GT_Log.mLogFile = new File(parentFile, "logs/GregTech.log"); if (!GT_Log.mLogFile.exists()) { try { @@ -163,8 +165,7 @@ public class GT_PreLoad { GT_Log.out = GT_Log.err = new PrintStream(GT_Log.mLogFile); } catch (FileNotFoundException ignored) {} - if (tMainConfig.get(GT_Mod.aTextGeneral, "LoggingOreDict", false) - .getBoolean(false)) { + if (ConfigGeneral.loggingOreDict) { GT_Log.mOreDictLogFile = new File(parentFile, "logs/OreDict.log"); if (!GT_Log.mOreDictLogFile.exists()) { try { @@ -183,8 +184,7 @@ public class GT_PreLoad { GT_Log.ore.println("******************************************************************************"); tList.forEach(GT_Log.ore::println); } - if (tMainConfig.get(GT_Mod.aTextGeneral, "LoggingExplosions", true) - .getBoolean(true)) { + if (ConfigGeneral.loggingExplosions) { GT_Log.mExplosionLog = new File(parentFile, "logs/Explosion.log"); if (!GT_Log.mExplosionLog.exists()) { try { @@ -196,8 +196,7 @@ public class GT_PreLoad { } catch (Throwable ignored) {} } - if (tMainConfig.get(GT_Mod.aTextGeneral, "LoggingPlayerActivity", true) - .getBoolean(true)) { + if (ConfigGeneral.loggingPlayerActicity) { GT_Log.mPlayerActivityLogFile = new File(parentFile, "logs/PlayerActivity.log"); if (!GT_Log.mPlayerActivityLogFile.exists()) { try { @@ -371,270 +370,126 @@ public class GT_PreLoad { GT_ModHandler.addScrapboxDrop(200.0F, GT_ModHandler.getIC2Item("scrap", 1L)); } - public static void loadConfig(Configuration tMainConfig) { - GT_Values.D1 = tMainConfig.get(GT_Mod.aTextGeneral, "Debug", false) - .getBoolean(false); - GT_Values.D2 = tMainConfig.get(GT_Mod.aTextGeneral, "Debug2", false) - .getBoolean(false); - GT_Values.allow_broken_recipemap = tMainConfig.get(GT_Mod.aTextGeneral, "debug allow broken recipemap", false) - .getBoolean(false); - GT_Values.debugCleanroom = tMainConfig.get(GT_Mod.aTextGeneral, "debugCleanroom", false) - .getBoolean(false); - GT_Values.debugDriller = tMainConfig.get(GT_Mod.aTextGeneral, "debugDriller", false) - .getBoolean(false); - GT_Values.debugWorldGen = tMainConfig.get(GT_Mod.aTextGeneral, "debugWorldGen", false) - .getBoolean(false); - GT_Values.debugOrevein = tMainConfig.get(GT_Mod.aTextGeneral, "debugOrevein", false) - .getBoolean(false); - GT_Values.debugSmallOres = tMainConfig.get(GT_Mod.aTextGeneral, "debugSmallOres", false) - .getBoolean(false); - GT_Values.debugStones = tMainConfig.get(GT_Mod.aTextGeneral, "debugStones", false) - .getBoolean(false); - GT_Values.debugBlockMiner = tMainConfig.get(GT_Mod.aTextGeneral, "debugBlockMiner", false) - .getBoolean(false); - GT_Values.debugBlockPump = tMainConfig.get(GT_Mod.aTextGeneral, "debugBlockPump", false) - .getBoolean(false); - GT_Values.debugEntityCramming = tMainConfig.get(GT_Mod.aTextGeneral, "debugEntityCramming", false) - .getBoolean(false); - GT_Values.debugWorldData = tMainConfig.get(GT_Mod.aTextGeneral, "debugWorldData", false) - .getBoolean(false); - GT_Values.oreveinPercentage = tMainConfig.get(GT_Mod.aTextGeneral, "oreveinPercentage_100", 100) - .getInt(100); - GT_Values.oreveinAttempts = tMainConfig.get(GT_Mod.aTextGeneral, "oreveinAttempts_64", 64) - .getInt(64); - GT_Values.oreveinMaxPlacementAttempts = tMainConfig.get(GT_Mod.aTextGeneral, "oreveinMaxPlacementAttempts_8", 8) - .getInt(8); - GT_Values.oreveinPlacerOres = tMainConfig.get(GT_Mod.aTextGeneral, "oreveinPlacerOres", true) - .getBoolean(true); - GT_Values.oreveinPlacerOresMultiplier = tMainConfig.get(GT_Mod.aTextGeneral, "oreveinPlacerOresMultiplier", 2) - .getInt(2); - // GT_Values.oreveinMaxSize = tMainConfig.get(aTextGeneral, "oreveinMaxSize_64",64).getInt(64); - GT_Values.ticksBetweenSounds = tMainConfig.get("machines", "TicksBetweenSounds", 30) - .getInt(30); - GT_Values.blacklistedTileEntiyClassNamesForWA = tMainConfig.getStringList( - "blacklistedTileEntiyClassNamesForWA", - "machines", - GT_Values.blacklistedTileEntiyClassNamesForWA, - "class names to be blacklisted from the world accelerator"); - GT_Values.cleanroomGlass = (float) tMainConfig.get("machines", "ReinforcedGlassPercentageForCleanroom", 5D) - .getDouble(5D); - GT_Values.enableChunkloaders = tMainConfig.get("machines", "enableChunkloaders", true) - .getBoolean(true); - GT_Values.alwaysReloadChunkloaders = tMainConfig.get("machines", "alwaysReloadChunkloaders", false) - .getBoolean(false); - GT_Values.debugChunkloaders = tMainConfig.get("machines", "debugChunkloaders", false) - .getBoolean(false); - GT_Values.disableDigitalChestsExternalAccess = tMainConfig - .get("machines", "disableDigitalChestsExternalAccess", false) - .getBoolean(false); - GT_Values.enableMultiTileEntities = tMainConfig.get( - "machines", - "enableMultiTileEntities", - false, - "This enabled MuTEs(multitile entities) to be added to the game. MuTEs are in the start of development and its not recommended to enable them unless you know what you are doing.") - .getBoolean(false) - // Make sure MuTEs are enabled in development - || (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); - GregTech_API.TICKS_FOR_LAG_AVERAGING = tMainConfig - .get(GT_Mod.aTextGeneral, "TicksForLagAveragingWithScanner", 25) - .getInt(25); - GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = tMainConfig - .get(GT_Mod.aTextGeneral, "MillisecondsPassedInGTTileEntityUntilLagWarning", 100) - .getInt(100); - if (tMainConfig.get(GT_Mod.aTextGeneral, "disable_STDOUT", false) - .getBoolean(false)) { - GT_FML_LOGGER.info("Disableing Console Messages."); - GT_FML_LOGGER.exit(); - System.out.close(); - System.err.close(); + public static void loadConfig() { + // general + GT_Values.D1 = ConfigDebug.D1; + GT_Values.D2 = ConfigDebug.D2; + GT_Values.allow_broken_recipemap = ConfigDebug.allowBrokenRecipeMap; + GT_Values.debugCleanroom = ConfigDebug.debugCleanroom; + GT_Values.debugDriller = ConfigDebug.debugDriller; + GT_Values.debugWorldGen = ConfigDebug.debugWorldgen; + GT_Values.debugOrevein = ConfigDebug.debugOrevein; + GT_Values.debugSmallOres = ConfigDebug.debugSmallOres; + GT_Values.debugStones = ConfigDebug.debugStones; + GT_Values.debugBlockMiner = ConfigDebug.debugBlockMiner; + GT_Values.debugBlockPump = ConfigDebug.debugBlockPump; + GT_Values.debugEntityCramming = ConfigDebug.debugEntityCramming; + GT_Values.debugWorldData = ConfigDebug.debugWorldData; + GT_Values.oreveinPercentage = ConfigGeneral.oreveinPercentage; + GT_Values.oreveinAttempts = ConfigGeneral.oreveinAttempts; + GT_Values.oreveinMaxPlacementAttempts = ConfigGeneral.oreveinMaxPlacementAttempts; + GT_Values.oreveinPlacerOres = ConfigGeneral.oreveinPlacerOres; + GT_Values.oreveinPlacerOresMultiplier = ConfigGeneral.oreveinPlacerOresMultiplier; + GregTech_API.TICKS_FOR_LAG_AVERAGING = ConfigGeneral.ticksForLagAveraging; + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = ConfigGeneral.millisecondThesholdUntilLagWarning; + GregTech_API.sTimber = ConfigGeneral.timber; + GregTech_API.sDrinksAlwaysDrinkable = ConfigGeneral.drinksAlwaysDrinkable; + GregTech_API.sDoShowAllItemsInCreative = ConfigGeneral.doShowAllItemsInCreative; + GregTech_API.sMultiThreadedSounds = ConfigGeneral.multiThreadedSounds; + GT_Mod.gregtechproxy.mMaxEqualEntitiesAtOneSpot = ConfigGeneral.maxEqualEntitiesAtOneSpot; + GT_Mod.gregtechproxy.mFlintChance = ConfigGeneral.flintChance; + GT_Mod.gregtechproxy.mItemDespawnTime = ConfigGeneral.itemDespawnTime; + GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation = ConfigGeneral.allowSmallBoilerAutomation; + GT_Mod.gregtechproxy.mDisableVanillaOres = gregtech.common.config.worldgen.ConfigGeneral.disableVanillaOres; + GT_Mod.gregtechproxy.mIncreaseDungeonLoot = ConfigGeneral.increaseDungeonLoot; + GT_Mod.gregtechproxy.mAxeWhenAdventure = ConfigGeneral.axeWhenAdventure; + GT_Mod.gregtechproxy.mSurvivalIntoAdventure = ConfigGeneral.survivalIntoAdventure; + GT_Mod.gregtechproxy.mHungerEffect = ConfigGeneral.hungerEffect; + GT_Mod.gregtechproxy.mInventoryUnification = ConfigGeneral.inventoryUnification; + GT_Mod.gregtechproxy.mGTBees = ConfigGeneral.GTBees; + GT_Mod.gregtechproxy.mCraftingUnification = ConfigGeneral.craftingUnification; + GT_Mod.gregtechproxy.mNerfedWoodPlank = ConfigGeneral.nerfedWoodPlank; + GT_Mod.gregtechproxy.mNerfedVanillaTools = ConfigGeneral.nerfedVanillaTools; + GT_Mod.gregtechproxy.mAchievements = ConfigGeneral.achievements; + GT_Mod.gregtechproxy.mHideUnusedOres = ConfigGeneral.hideUnusedOres; + GT_Mod.gregtechproxy.mEnableAllMaterials = ConfigGeneral.enableAllMaterials; + GT_Mod.gregtechproxy.mExplosionItemDrop = ConfigGeneral.explosionItemDrop; + GT_Mod.gregtechproxy.mEnableCleanroom = ConfigGeneral.enableCleanroom; + GT_Mod.gregtechproxy.mLowGravProcessing = GalacticraftCore.isModLoaded() && ConfigGeneral.lowGravProcessing; + GT_Mod.gregtechproxy.mCropNeedBlock = ConfigGeneral.cropNeedBlock; + GT_Mod.gregtechproxy.mAMHInteraction = ConfigGeneral.autoMaintenaceHatchesInteraction; + GT_Mod.gregtechproxy.mMixedOreOnlyYieldsTwoThirdsOfPureOre = ConfigGeneral.mixedOreOnlyYieldsTwoThirdsOfPureOre; + GT_Mod.gregtechproxy.mRichOreYieldMultiplier = ConfigGeneral.richOreYieldMultiplier; + GT_Mod.gregtechproxy.mNetherOreYieldMultiplier = ConfigGeneral.netherOreYieldMultiplier; + GT_Mod.gregtechproxy.mEndOreYieldMultiplier = ConfigGeneral.endOreYieldMultiplier; + GT_Mod.gregtechproxy.gt6Pipe = ConfigGeneral.gt6Pipe; + GT_Mod.gregtechproxy.gt6Cable = ConfigGeneral.gt6Cable; + GT_Mod.gregtechproxy.ic2EnergySourceCompat = ConfigGeneral.ic2EnergySourceCompat; + GT_Mod.gregtechproxy.costlyCableConnection = ConfigGeneral.costlyCableConnection; + GT_Mod.gregtechproxy.crashOnNullRecipeInput = ConfigGeneral.crashOnNullRecipeInput; + if ((boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { + GT_Mod.gregtechproxy.crashOnNullRecipeInput = false; // Use flags in GT_RecipeBuilder instead! + } + GT_LanguageManager.i18nPlaceholder = ConfigGeneral.i18nPlaceholder; + GT_MetaTileEntity_LongDistancePipelineBase.minimalDistancePoints = ConfigGeneral.minimalDistancePoints; + GT_Values.mCTMEnabledBlock.addAll(Arrays.asList(ConfigGeneral.CTMWhitelist)); + GT_Values.mCTMDisabledBlock.addAll(Arrays.asList(ConfigGeneral.CTMBlacklist)); + if (ConfigGeneral.harderMobSpawner) { + Blocks.mob_spawner.setHardness(500.0F) + .setResistance(6000000.0F); } - GregTech_API.sMachineExplosions = tMainConfig.get("machines", "machines_explosion_damage", true) - .getBoolean(false); - GregTech_API.sMachineFlammable = tMainConfig.get("machines", "machines_flammable", true) - .getBoolean(false); - GregTech_API.sMachineNonWrenchExplosions = tMainConfig.get("machines", "explosions_on_nonwrenching", true) - .getBoolean(false); - GregTech_API.sMachineWireFire = tMainConfig.get("machines", "wirefire_on_explosion", true) - .getBoolean(false); - GregTech_API.sMachineFireExplosions = tMainConfig.get("machines", "fire_causes_explosions", true) - .getBoolean(false); - GregTech_API.sMachineRainExplosions = tMainConfig.get("machines", "rain_causes_explosions", true) - .getBoolean(false); - GregTech_API.sMachineThunderExplosions = tMainConfig.get("machines", "lightning_causes_explosions", true) - .getBoolean(false); - GregTech_API.sConstantEnergy = tMainConfig.get("machines", "constant_need_of_energy", true) - .getBoolean(false); - GregTech_API.sColoredGUI = tMainConfig.get("machines", "colored_guis_when_painted", true) - .getBoolean(false); - GregTech_API.sMachineMetalGUI = tMainConfig.get("machines", "guis_in_consistent_machine_metal_color", false) - .getBoolean(false); + // machines + GT_Values.ticksBetweenSounds = ConfigMachines.ticksBetweenSounds; + GT_Values.blacklistedTileEntiyClassNamesForWA = ConfigMachines.blacklistedTileEntiyClassNamesForWA; + GT_Values.cleanroomGlass = ConfigMachines.cleanroomGlass; + GT_Values.enableChunkloaders = ConfigMachines.enableChunkloaders; + GT_Values.alwaysReloadChunkloaders = ConfigMachines.alwaysReloadChunkloaders; + GT_Values.debugChunkloaders = ConfigDebug.debugChunkloaders; + GT_Values.disableDigitalChestsExternalAccess = ConfigMachines.disableDigitalChestsExternalAccess; + GT_Values.enableMultiTileEntities = ConfigMachines.enableMultiTileEntities + || (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); + GregTech_API.sMachineExplosions = ConfigMachines.machineExplosions; + GregTech_API.sMachineFlammable = ConfigMachines.machineFlammable; + GregTech_API.sMachineNonWrenchExplosions = ConfigMachines.machineNonWrenchExplosions; + GregTech_API.sMachineWireFire = ConfigMachines.machineWireFire; + GregTech_API.sMachineFireExplosions = ConfigMachines.machineFireExplosions; + GregTech_API.sMachineRainExplosions = ConfigMachines.machineRainExplosions; + GregTech_API.sMachineThunderExplosions = ConfigMachines.machineThunderExplosions; + GregTech_API.sColoredGUI = ConfigMachines.coloredGUI; + GregTech_API.sMachineMetalGUI = ConfigMachines.machineMetalGUI; // Implementation for this is actually handled in NewHorizonsCoreMod in MainRegistry.java! - GregTech_API.sUseMachineMetal = tMainConfig.get("machines", "use_machine_metal_tint", true) - .getBoolean(true); - - GregTech_API.sTimber = tMainConfig.get(GT_Mod.aTextGeneral, "timber_axe", true) - .getBoolean(true); - GregTech_API.sDrinksAlwaysDrinkable = tMainConfig.get(GT_Mod.aTextGeneral, "drinks_always_drinkable", false) - .getBoolean(false); - GregTech_API.sDoShowAllItemsInCreative = tMainConfig - .get(GT_Mod.aTextGeneral, "show_all_metaitems_in_creative_and_NEI", false) - .getBoolean(false); - GregTech_API.sMultiThreadedSounds = tMainConfig.get(GT_Mod.aTextGeneral, "sound_multi_threading", false) - .getBoolean(false); + GregTech_API.sUseMachineMetal = ConfigMachines.useMachineMetal; + // client loadClientConfig(); - GT_Mod.gregtechproxy.mMaxEqualEntitiesAtOneSpot = tMainConfig - .get(GT_Mod.aTextGeneral, "MaxEqualEntitiesAtOneSpot", 3) - .getInt(3); - GT_Mod.gregtechproxy.mSkeletonsShootGTArrows = tMainConfig - .get(GT_Mod.aTextGeneral, "SkeletonsShootGTArrows", 16) - .getInt(16); - GT_Mod.gregtechproxy.mFlintChance = tMainConfig.get(GT_Mod.aTextGeneral, "FlintAndSteelChance", 30) - .getInt(30); - GT_Mod.gregtechproxy.mItemDespawnTime = tMainConfig.get(GT_Mod.aTextGeneral, "ItemDespawnTime", 6000) - .getInt(6000); - GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation = tMainConfig - .get(GT_Mod.aTextGeneral, "AllowSmallBoilerAutomation", false) - .getBoolean(false); - GT_Mod.gregtechproxy.mDisableVanillaOres = tMainConfig.get(GT_Mod.aTextGeneral, "DisableVanillaOres", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mIncreaseDungeonLoot = tMainConfig.get(GT_Mod.aTextGeneral, "IncreaseDungeonLoot", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mAxeWhenAdventure = tMainConfig.get(GT_Mod.aTextGeneral, "AdventureModeStartingAxe", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mSurvivalIntoAdventure = tMainConfig.get(GT_Mod.aTextGeneral, "forceAdventureMode", false) - .getBoolean(false); - GT_Mod.gregtechproxy.mHungerEffect = tMainConfig.get(GT_Mod.aTextGeneral, "AFK_Hunger", false) - .getBoolean(false); - GT_Mod.gregtechproxy.mInventoryUnification = tMainConfig.get(GT_Mod.aTextGeneral, "InventoryUnification", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mGTBees = tMainConfig.get(GT_Mod.aTextGeneral, "GTBees", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mCraftingUnification = tMainConfig.get(GT_Mod.aTextGeneral, "CraftingUnification", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mNerfedWoodPlank = tMainConfig.get(GT_Mod.aTextGeneral, "WoodNeedsSawForCrafting", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mNerfedVanillaTools = tMainConfig - .get(GT_Mod.aTextGeneral, "smallerVanillaToolDurability", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mAchievements = tMainConfig.get(GT_Mod.aTextGeneral, "EnableAchievements", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mHideUnusedOres = tMainConfig.get(GT_Mod.aTextGeneral, "HideUnusedOres", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mEnableAllMaterials = tMainConfig.get("general", "EnableAllMaterials", false) - .getBoolean(false); - - // Pollution: edit GT_Proxy.java to change default values - GT_Mod.gregtechproxy.mPollution = tMainConfig - .get("Pollution", "EnablePollution", GT_Mod.gregtechproxy.mPollution) - .getBoolean(GT_Mod.gregtechproxy.mPollution); - GT_Mod.gregtechproxy.mPollutionSmogLimit = tMainConfig - .get("Pollution", "SmogLimit", GT_Mod.gregtechproxy.mPollutionSmogLimit) - .getInt(GT_Mod.gregtechproxy.mPollutionSmogLimit); - GT_Mod.gregtechproxy.mPollutionPoisonLimit = tMainConfig - .get("Pollution", "PoisonLimit", GT_Mod.gregtechproxy.mPollutionPoisonLimit) - .getInt(GT_Mod.gregtechproxy.mPollutionPoisonLimit); - GT_Mod.gregtechproxy.mPollutionVegetationLimit = tMainConfig - .get("Pollution", "VegetationLimit", GT_Mod.gregtechproxy.mPollutionVegetationLimit) - .getInt(GT_Mod.gregtechproxy.mPollutionVegetationLimit); - GT_Mod.gregtechproxy.mPollutionSourRainLimit = tMainConfig - .get("Pollution", "SourRainLimit", GT_Mod.gregtechproxy.mPollutionSourRainLimit) - .getInt(GT_Mod.gregtechproxy.mPollutionSourRainLimit); - GT_Mod.gregtechproxy.mPollutionOnExplosion = tMainConfig - .get("Pollution", "SourRainLimit", GT_Mod.gregtechproxy.mPollutionOnExplosion) - .getInt(GT_Mod.gregtechproxy.mPollutionOnExplosion); - GT_Mod.gregtechproxy.mExplosionItemDrop = tMainConfig - .get("general", "ExplosionItemDrops", GT_Mod.gregtechproxy.mExplosionItemDrop) - .getBoolean(GT_Mod.gregtechproxy.mExplosionItemDrop); - GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = tMainConfig - .get( - "Pollution", - "PollutionPrimitiveBlastFurnace", - GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); - GT_Mod.gregtechproxy.mPollutionCharcoalPitPerSecond = tMainConfig - .get("Pollution", "PollutionCharcoalPit", GT_Mod.gregtechproxy.mPollutionCharcoalPitPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionCharcoalPitPerSecond); - GT_Mod.gregtechproxy.mPollutionEBFPerSecond = tMainConfig - .get("Pollution", "PollutionEBF", GT_Mod.gregtechproxy.mPollutionEBFPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionEBFPerSecond); - GT_Mod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond = tMainConfig - .get( - "Pollution", - "PollutionLargeCombustionEngine", - GT_Mod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond); - GT_Mod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = tMainConfig - .get( - "Pollution", - "PollutionExtremeCombustionEngine", - GT_Mod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond); - GT_Mod.gregtechproxy.mPollutionImplosionCompressorPerSecond = tMainConfig - .get( - "Pollution", - "PollutionImplosionCompressor", - GT_Mod.gregtechproxy.mPollutionImplosionCompressorPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionImplosionCompressorPerSecond); - GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = tMainConfig - .get("Pollution", "PollutionLargeBronzeBoiler", GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond = tMainConfig - .get("Pollution", "PollutionLargeSteelBoiler", GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = tMainConfig - .get( - "Pollution", - "PollutionLargeTitaniumBoiler", - GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = tMainConfig - .get( - "Pollution", - "PollutionLargeTungstenSteelBoiler", - GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionReleasedByThrottle = tMainConfig - .get("Pollution", "PollutionReleasedByThrottle", GT_Mod.gregtechproxy.mPollutionReleasedByThrottle) - .getDouble(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle); - GT_Mod.gregtechproxy.mPollutionLargeGasTurbinePerSecond = tMainConfig - .get("Pollution", "PollutionLargeGasTurbine", GT_Mod.gregtechproxy.mPollutionLargeGasTurbinePerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionLargeGasTurbinePerSecond); - GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond = tMainConfig - .get("Pollution", "PollutionMultiSmelter", GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond); - GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond = tMainConfig - .get("Pollution", "PollutionPyrolyseOven", GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond); - GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond = tMainConfig - .get("Pollution", "PollutionSmallCoalBoiler", GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = tMainConfig - .get( - "Pollution", - "PollutionHighPressureLavaBoiler", - GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = tMainConfig - .get( - "Pollution", - "PollutionHighPressureCoalBoiler", - GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond); - GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = tMainConfig - .get( - "Pollution", - "PollutionBaseDieselGenerator", - GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond); - double[] mPollutionDieselGeneratorReleasedByTier = tMainConfig - .get( - "Pollution", - "PollutionReleasedByTierDieselGenerator", - GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier) - .getDoubleList(); + // Pollution + GT_Mod.gregtechproxy.mPollution = ConfigPollution.pollution; + GT_Mod.gregtechproxy.mPollutionSmogLimit = ConfigPollution.pollutionSmogLimit; + GT_Mod.gregtechproxy.mPollutionPoisonLimit = ConfigPollution.pollutionPoisonLimit; + GT_Mod.gregtechproxy.mPollutionVegetationLimit = ConfigPollution.pollutionVegetationLimit; + GT_Mod.gregtechproxy.mPollutionSourRainLimit = ConfigPollution.pollutionSourRainLimit; + GT_Mod.gregtechproxy.mPollutionOnExplosion = ConfigPollution.pollutionOnExplosion; + GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = ConfigPollution.pollutionPrimitveBlastFurnacePerSecond; + GT_Mod.gregtechproxy.mPollutionCharcoalPitPerSecond = ConfigPollution.pollutionCharcoalPitPerSecond; + GT_Mod.gregtechproxy.mPollutionEBFPerSecond = ConfigPollution.pollutionEBFPerSecond; + GT_Mod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond = ConfigPollution.pollutionLargeCombustionEnginePerSecond; + GT_Mod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = ConfigPollution.pollutionExtremeCombustionEnginePerSecond; + GT_Mod.gregtechproxy.mPollutionImplosionCompressorPerSecond = ConfigPollution.pollutionImplosionCompressorPerSecond; + GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = ConfigPollution.pollutionLargeBronzeBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond = ConfigPollution.pollutionLargeSteelBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = ConfigPollution.pollutionLargeTitaniumBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = ConfigPollution.pollutionLargeTungstenSteelBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionReleasedByThrottle = ConfigPollution.pollutionReleasedByThrottle; + GT_Mod.gregtechproxy.mPollutionLargeGasTurbinePerSecond = ConfigPollution.pollutionLargeGasTurbinePerSecond; + GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond = ConfigPollution.pollutionMultiSmelterPerSecond; + GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond = ConfigPollution.pollutionPyrolyseOvenPerSecond; + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond = ConfigPollution.pollutionSmallCoalBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = ConfigPollution.pollutionHighPressureLavaBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = ConfigPollution.pollutionHighPressureCoalBoilerPerSecond; + GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = ConfigPollution.pollutionBaseDieselGeneratorPerSecond; + double[] mPollutionDieselGeneratorReleasedByTier = ConfigPollution.pollutionDieselGeneratorReleasedByTier; if (mPollutionDieselGeneratorReleasedByTier.length == GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier.length) { GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier = mPollutionDieselGeneratorReleasedByTier; @@ -642,18 +497,8 @@ public class GT_PreLoad { GT_FML_LOGGER .error("The Length of the Diesel Turbine Pollution Array Config must be the same as the Default"); } - GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond = tMainConfig - .get( - "Pollution", - "PollutionBaseGasTurbineGenerator", - GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond) - .getInt(GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond); - double[] mPollutionGasTurbineReleasedByTier = tMainConfig - .get( - "Pollution", - "PollutionReleasedByTierGasTurbineGenerator", - GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier) - .getDoubleList(); + GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond = ConfigPollution.pollutionBaseGasTurbinePerSecond; + double[] mPollutionGasTurbineReleasedByTier = ConfigPollution.pollutionGasTurbineReleasedByTier; if (mPollutionGasTurbineReleasedByTier.length == GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier.length) { GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier = mPollutionGasTurbineReleasedByTier; @@ -661,223 +506,107 @@ public class GT_PreLoad { GT_FML_LOGGER.error("The Length of the Gas Turbine Pollution Array Config must be the same as the Default"); } - GT_Mod.gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); - GT_Mod.gregtechproxy.enableUndergroundGravelGen = GregTech_API.sWorldgenFile - .get("general", "enableUndergroundGravelGen", GT_Mod.gregtechproxy.enableUndergroundGravelGen); - GT_Mod.gregtechproxy.enableUndergroundDirtGen = GregTech_API.sWorldgenFile - .get("general", "enableUndergroundDirtGen", GT_Mod.gregtechproxy.enableUndergroundDirtGen); - GT_Mod.gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true) - .getBoolean(true); - if (GT_Mod.gregtechproxy.mEnableCleanroom) GT_MetaTileEntity_Cleanroom.loadConfig(tMainConfig); - GT_Mod.gregtechproxy.mLowGravProcessing = GalacticraftCore.isModLoaded() - && tMainConfig.get("general", "LowGravProcessing", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mUseGreatlyShrukenReplacementList = tMainConfig - .get("general", "GTNH Optimised Material Loading", true) - .getBoolean(true); - Calendar now = Calendar.getInstance(); - GT_Mod.gregtechproxy.mAprilFool = GregTech_API.sSpecialFile.get( - ConfigCategories.general, - "AprilFool", - now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) == 1); - GT_Mod.gregtechproxy.mCropNeedBlock = tMainConfig.get("general", "CropNeedBlockBelow", true) - .getBoolean(true); - GT_Mod.gregtechproxy.mAMHInteraction = tMainConfig.get("general", "AllowAutoMaintenanceHatchInteraction", false) - .getBoolean(false); - GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true); - GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false); - GregTech_API.mEUtoRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "100EUtoRF", 360); - GregTech_API.mRFtoEU = GregTech_API.sOPStuff.get(ConfigCategories.general, "100RFtoEU", 20); - GregTech_API.mRFExplosions = GregTech_API.sOPStuff.get(ConfigCategories.general, "RFExplosions", false); - GregTech_API.meIOLoaded = EnderIO.isModLoaded(); - GT_Mod.gregtechproxy.mForceFreeFace = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "forceFreeFace", true); - GT_Mod.gregtechproxy.mBrickedBlastFurnace = tMainConfig.get("general", "BrickedBlastFurnace", true) - .getBoolean(true); - - GT_Mod.gregtechproxy.mMixedOreOnlyYieldsTwoThirdsOfPureOre = tMainConfig - .get("general", "MixedOreOnlyYieldsTwoThirdsOfPureOre", false) - .getBoolean(false); - GT_Mod.gregtechproxy.mRichOreYieldMultiplier = tMainConfig.get("general", "RichOreYieldMultiplier", true) - .getBoolean(false); - GT_Mod.gregtechproxy.mNetherOreYieldMultiplier = tMainConfig.get("general", "NetherOreYieldMultiplier", true) - .getBoolean(false); - GT_Mod.gregtechproxy.mEndOreYieldMultiplier = tMainConfig.get("general", "EndOreYieldMultiplier", true) - .getBoolean(false); - GT_Mod.gregtechproxy.enableBlackGraniteOres = GregTech_API.sWorldgenFile - .get("general", "enableBlackGraniteOres", GT_Mod.gregtechproxy.enableBlackGraniteOres); - GT_Mod.gregtechproxy.enableRedGraniteOres = GregTech_API.sWorldgenFile - .get("general", "enableRedGraniteOres", GT_Mod.gregtechproxy.enableRedGraniteOres); - GT_Mod.gregtechproxy.enableMarbleOres = GregTech_API.sWorldgenFile - .get("general", "enableMarbleOres", GT_Mod.gregtechproxy.enableMarbleOres); - GT_Mod.gregtechproxy.enableBasaltOres = GregTech_API.sWorldgenFile - .get("general", "enableBasaltOres", GT_Mod.gregtechproxy.enableBasaltOres); - GT_Mod.gregtechproxy.gt6Pipe = tMainConfig.get("general", "GT6StyledPipesConnection", true) - .getBoolean(true); - GT_Mod.gregtechproxy.gt6Cable = tMainConfig.get("general", "GT6StyledWiresConnection", true) - .getBoolean(true); - GT_Mod.gregtechproxy.ic2EnergySourceCompat = tMainConfig.get("general", "Ic2EnergySourceCompat", true) - .getBoolean(true); - GT_Mod.gregtechproxy.costlyCableConnection = tMainConfig - .get("general", "CableConnectionRequiresSolderingMaterial", false) - .getBoolean(false); - GT_Mod.gregtechproxy.crashOnNullRecipeInput = tMainConfig.get("general", "crashOnNullRecipeInput", false) - .getBoolean(false); - GT_LanguageManager.i18nPlaceholder = tMainConfig - .get("general", "EnablePlaceholderForMaterialNamesInLangFile", true) - .getBoolean(true); - GT_MetaTileEntity_LongDistancePipelineBase.minimalDistancePoints = tMainConfig - .get("general", "LongDistancePipelineMinimalDistancePoints", 64) - .getInt(64); - try { - String setting_string = tMainConfig.get( - "OreDropBehaviour", - "general", - "FortuneItem", - "Settings: \n'PerDimBlock': Sets the drop to the block variant of the ore block based on dimension, defaults to stone type, \n'UnifiedBlock': Sets the drop to the stone variant of the ore block, \n'Block': Sets the drop to the ore mined, \n'FortuneItem': Sets the drop to the new ore item and makes it affected by fortune, \n'Item': Sets the drop to the new ore item, \nDefaults to: 'FortuneItem'") - .getString(); - GT_Log.out.println("Trying to set it to: " + setting_string); - GT_Proxy.OreDropSystem setting = GT_Proxy.OreDropSystem.valueOf(setting_string); - GT_Mod.gregtechproxy.oreDropSystem = setting; + // cleanroom file + if (GT_Mod.gregtechproxy.mEnableCleanroom) GT_MetaTileEntity_Cleanroom.loadConfig(GT_Config.cleanroomFile); + + // underground fluids file + GT_Mod.gregtechproxy.mUndergroundOil.getConfig(GT_Config.undergroundFluidsFile, "undergroundfluid"); + + // Worldgeneration.cfg + GT_Mod.gregtechproxy.enableUndergroundGravelGen = gregtech.common.config.worldgen.ConfigGeneral.generateUndergroundGravelGen; + GT_Mod.gregtechproxy.enableUndergroundDirtGen = gregtech.common.config.worldgen.ConfigGeneral.generateUndergroundDirtGen; + GT_Mod.gregtechproxy.enableBlackGraniteOres = gregtech.common.config.worldgen.ConfigGeneral.generateBlackGraniteOres; + GT_Mod.gregtechproxy.enableRedGraniteOres = gregtech.common.config.worldgen.ConfigGeneral.generateBlackGraniteOres; + GT_Mod.gregtechproxy.enableMarbleOres = gregtech.common.config.worldgen.ConfigGeneral.generateMarbleOres; + GT_Mod.gregtechproxy.enableBasaltOres = gregtech.common.config.worldgen.ConfigGeneral.generateBasaltOres; + + // OverpoweredStuff.cfg + GregTech_API.mOutputRF = gregtech.common.config.opstuff.ConfigGeneral.outputRF; + GregTech_API.mInputRF = gregtech.common.config.opstuff.ConfigGeneral.inputRF; + GregTech_API.mEUtoRF = gregtech.common.config.opstuff.ConfigGeneral.howMuchRFWith100EUInInput; + GregTech_API.mRFtoEU = gregtech.common.config.opstuff.ConfigGeneral.howMuchEUWith100RFInInput; + GregTech_API.mRFExplosions = gregtech.common.config.opstuff.ConfigGeneral.RFExplosions; + + // MachineStats.cfg + GT_Mod.gregtechproxy.mForceFreeFace = gregtech.common.config.machinestats.ConfigMachines.forceFreeFace; + // ore_drop_behavior + try { + GT_Log.out.println("Trying to set it to: " + ConfigOreDropBehavior.setting); + GT_Mod.gregtechproxy.oreDropSystem = GT_Proxy.OreDropSystem.valueOf(ConfigOreDropBehavior.setting);; } catch (IllegalArgumentException e) { GT_Log.err.println(e); GT_Mod.gregtechproxy.oreDropSystem = GT_Proxy.OreDropSystem.FortuneItem; } - GT_Mod.gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties - .get("havestLevel", "activateHarvestLevelChange", false); // TODO CHECK - if (GT_Mod.gregtechproxy.mChangeHarvestLevels) { - GT_Mod.gregtechproxy.mGraniteHavestLevel = GregTech_API.sMaterialProperties - .get("havestLevel", "graniteHarvestLevel", 3); - GT_Mod.gregtechproxy.mMaxHarvestLevel = Math - .min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel", 7)); - Materials.getMaterialsMap() - .values() - .parallelStream() - .filter( - tMaterial -> tMaterial != null && tMaterial.mToolQuality > 0 - && tMaterial.mMetaItemSubID < GT_Mod.gregtechproxy.mHarvestLevel.length - && tMaterial.mMetaItemSubID >= 0) - .forEach( - tMaterial -> GT_Mod.gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties - .get("materialHavestLevel", tMaterial.mDefaultLocalName, tMaterial.mToolQuality)); - } - - if (tMainConfig.get("general", "hardermobspawners", true) - .getBoolean(true)) { - Blocks.mob_spawner.setHardness(500.0F) - .setResistance(6000000.0F); - } - - GT_Mod.gregtechproxy.mUpgradeCount = Math.min( - 64, - Math.max( - 1, - tMainConfig.get("features", "UpgradeStacksize", 4) - .getInt())); + // features + GT_Mod.gregtechproxy.mUpgradeCount = Math.min(64, Math.max(1, ConfigFeatures.upgradeStackSize)); for (OrePrefixes tPrefix : OrePrefixes.values()) { if (tPrefix.mIsUsedForOreProcessing) { - tPrefix.mDefaultStackSize = ((byte) Math.min( - 64, - Math.max( - 1, - tMainConfig.get("features", "MaxOreStackSize", 64) - .getInt()))); + tPrefix.mDefaultStackSize = ((byte) Math.min(64, Math.max(1, ConfigFeatures.maxOreStackSize))); } else if (tPrefix == OrePrefixes.plank) { - tPrefix.mDefaultStackSize = ((byte) Math.min( - 64, - Math.max( - 16, - tMainConfig.get("features", "MaxPlankStackSize", 64) - .getInt()))); + tPrefix.mDefaultStackSize = ((byte) Math.min(64, Math.max(16, ConfigFeatures.maxPlankStackSize))); } else if ((tPrefix == OrePrefixes.wood) || (tPrefix == OrePrefixes.treeLeaves) || (tPrefix == OrePrefixes.treeSapling) || (tPrefix == OrePrefixes.log)) { - tPrefix.mDefaultStackSize = ((byte) Math.min( - 64, - Math.max( - 16, - tMainConfig.get("features", "MaxLogStackSize", 64) - .getInt()))); + tPrefix.mDefaultStackSize = ((byte) Math.min(64, Math.max(16, ConfigFeatures.maxLogStackSize))); } else if (tPrefix.mIsUsedForBlocks) { - tPrefix.mDefaultStackSize = ((byte) Math.min( - 64, - Math.max( - 16, - tMainConfig.get("features", "MaxOtherBlockStackSize", 64) - .getInt()))); + tPrefix.mDefaultStackSize = ((byte) Math + .min(64, Math.max(16, ConfigFeatures.maxOtherBlocksStackSize))); } } - GT_Values.mCTMEnabledBlock - .addAll( - Arrays - .asList( - tMainConfig - .get( - "general", - "ctm_block_whitelist", - new String[] { "team.chisel.block.BlockCarvable", - "team.chisel.block.BlockCarvableGlass" }) - .getStringList())); - GT_Values.mCTMDisabledBlock.addAll( - Arrays.asList( - tMainConfig.get("general", "ctm_block_blacklist", new String[] { "team.chisel.block.BlockRoadLine" }) - .getStringList())); - GT_RecipeBuilder.onConfigLoad(); } + public static void parseHex(Dyes dye, String hexString) { + dye.mRGBa[0] = Short.parseShort(hexString.substring(1, 3), 16); + dye.mRGBa[1] = Short.parseShort(hexString.substring(3, 5), 16); + dye.mRGBa[2] = Short.parseShort(hexString.substring(5), 16); + } + public static void loadClientConfig() { - final String sBDye0 = "ColorModulation."; Arrays.stream(Dyes.values()) - .filter(tDye -> (tDye != Dyes._NULL) && (tDye.mIndex < 0)) - .forEach(tDye -> { - String sBDye1 = sBDye0 + tDye; - tDye.mRGBa[0] = ((short) Math - .min(255, Math.max(0, GregTech_API.sClientDataFile.get(sBDye1, "R", tDye.mOriginalRGBa[0])))); - tDye.mRGBa[1] = ((short) Math - .min(255, Math.max(0, GregTech_API.sClientDataFile.get(sBDye1, "G", tDye.mOriginalRGBa[1])))); - tDye.mRGBa[2] = ((short) Math - .min(255, Math.max(0, GregTech_API.sClientDataFile.get(sBDye1, "B", tDye.mOriginalRGBa[2])))); + .filter(dye -> (dye != Dyes._NULL) && (dye.mIndex < 0)) + .forEach(dye -> { + switch (dye.toString() + .toLowerCase()) { + case "cable_insulation" -> parseHex(dye, ConfigColorModulation.cableInsulation); + case "construction_foam" -> parseHex(dye, ConfigColorModulation.constructionFoam); + case "machine_metal" -> parseHex(dye, ConfigColorModulation.machineMetal); + default -> { + GT_FML_LOGGER.warn( + "unknown color modulation entry: " + dye + + ". Report this pls, as config is missing this entry being parsed in code."); + } + } }); - GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion = GregTech_API.sClientDataFile - .get("render", "TileAmbientOcclusion", true); - GT_Mod.gregtechproxy.mRenderGlowTextures = GregTech_API.sClientDataFile.get("render", "GlowTextures", true); - GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped = GregTech_API.sClientDataFile - .get("render", "RenderFlippedMachinesFlipped", true); - GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch = GregTech_API.sClientDataFile - .get("render", "RenderIndicatorsOnHatch", true); - GT_Mod.gregtechproxy.mRenderDirtParticles = GregTech_API.sClientDataFile - .get("render", "RenderDirtParticles", true); - GT_Mod.gregtechproxy.mRenderPollutionFog = GregTech_API.sClientDataFile - .get("render", "RenderPollutionFog", true); - GT_Mod.gregtechproxy.mRenderItemDurabilityBar = GregTech_API.sClientDataFile - .get("render", "RenderItemDurabilityBar", true); - GT_Mod.gregtechproxy.mRenderItemChargeBar = GregTech_API.sClientDataFile - .get("render", "RenderItemChargeBar", true); - GT_Mod.gregtechproxy.mUseBlockUpdateHandler = GregTech_API.sClientDataFile - .get("render", "UseBlockUpdateHandler", false); - - GT_Mod.gregtechproxy.mCoverTabsVisible = GregTech_API.sClientDataFile - .get("interface", "DisplayCoverTabs", true); - GT_Mod.gregtechproxy.mCoverTabsFlipped = GregTech_API.sClientDataFile.get("interface", "FlipCoverTabs", false); - GT_Mod.gregtechproxy.mTooltipVerbosity = GregTech_API.sClientDataFile.get("interface", "TooltipVerbosity", 2); - GT_Mod.gregtechproxy.mTooltipShiftVerbosity = GregTech_API.sClientDataFile - .get("interface", "TooltipShiftVerbosity", 3); - GT_Mod.gregtechproxy.mTitleTabStyle = GregTech_API.sClientDataFile.get("interface", "TitleTabStyle", 0); - - GT_Mod.gregtechproxy.mNEIRecipeSecondMode = GregTech_API.sClientDataFile.get("nei", "RecipeSecondMode", true); - GT_Mod.gregtechproxy.mNEIRecipeOwner = GregTech_API.sClientDataFile.get("nei", "RecipeOwner", false); - GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace = GregTech_API.sClientDataFile + GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion = ConfigRender.renderTileAmbientOcclusion; + GT_Mod.gregtechproxy.mRenderGlowTextures = ConfigRender.renderGlowTextures; + GT_Mod.gregtechproxy.mRenderFlippedMachinesFlipped = ConfigRender.renderFlippedMachinesFlipped; + GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch = ConfigRender.renderIndicatorsOnHatch; + GT_Mod.gregtechproxy.mRenderDirtParticles = ConfigRender.renderDirtParticles; + GT_Mod.gregtechproxy.mRenderPollutionFog = ConfigRender.renderPollutionFog; + GT_Mod.gregtechproxy.mRenderItemDurabilityBar = ConfigRender.renderItemDurabilityBar; + GT_Mod.gregtechproxy.mRenderItemChargeBar = ConfigRender.renderItemChargeBar; + GT_Mod.gregtechproxy.mUseBlockUpdateHandler = ConfigRender.useBlockUpdateHandler; + + GT_Mod.gregtechproxy.mCoverTabsVisible = ConfigInterface.coverTabsVisible; + GT_Mod.gregtechproxy.mCoverTabsFlipped = ConfigInterface.coverTabsFlipped; + GT_Mod.gregtechproxy.mTooltipVerbosity = ConfigInterface.tooltipVerbosity; + GT_Mod.gregtechproxy.mTooltipShiftVerbosity = ConfigInterface.tooltipShiftVerbosity; + GT_Mod.gregtechproxy.mTitleTabStyle = ConfigInterface.titleTabStyle; + + GT_Mod.gregtechproxy.mNEIRecipeSecondMode = GregTech_API.NEIClientFIle.get("nei", "RecipeSecondMode", true); + GT_Mod.gregtechproxy.mNEIRecipeOwner = GregTech_API.NEIClientFIle.get("nei", "RecipeOwner", false); + GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace = GregTech_API.NEIClientFIle .get("nei", "RecipeOwnerStackTrace", false); - GT_Mod.gregtechproxy.mNEIOriginalVoltage = GregTech_API.sClientDataFile.get("nei", "OriginalVoltage", false); + GT_Mod.gregtechproxy.mNEIOriginalVoltage = GregTech_API.NEIClientFIle.get("nei", "OriginalVoltage", false); GT_Mod.gregtechproxy.recipeCategorySettings.clear(); for (RecipeCategory recipeCategory : findRecipeCategories()) { RecipeCategorySetting setting = RecipeCategorySetting.find( - GregTech_API.sClientDataFile.getWithValidValues( + GregTech_API.NEIClientFIle.getWithValidValues( "nei.recipe_categories", recipeCategory.unlocalizedName, RecipeCategorySetting.NAMES, @@ -886,15 +615,8 @@ public class GT_PreLoad { GT_Mod.gregtechproxy.recipeCategorySettings.put(recipeCategory, setting); } - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier = GregTech_API.sClientDataFile - .get("waila", "WailaTransformerVoltageTier", true); - GT_Mod.gregtechproxy.wailaAverageNS = GregTech_API.sClientDataFile.get("waila", "WailaAverageNS", false); - - final String[] Circuits = GregTech_API.sClientDataFile.get("interface", "CircuitsOrder"); - GT_Mod.gregtechproxy.mCircuitsOrder.clear(); - for (int i = 0; i < Circuits.length; i++) { - GT_Mod.gregtechproxy.mCircuitsOrder.putIfAbsent(Circuits[i], i); - } + GT_Mod.gregtechproxy.mWailaTransformerVoltageTier = ConfigWaila.wailaTransformerVoltageTier; + GT_Mod.gregtechproxy.wailaAverageNS = ConfigWaila.wailaAverageNS; GT_Mod.gregtechproxy.reloadNEICache(); } |