From 4cdf4aa7dba14b5c0732ca6b6bd8c2ed5a7a4a64 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 11 Apr 2015 18:29:46 +0100 Subject: [PATCH] Added config for ThermalGenerator eu out --- .../techreborn/config/ConfigTechReborn.java | 8 ++++++ .../config/TechRebornConfigGui.java | 28 ++++++++++++++++++- .../tiles/TileThermalGenerator.java | 3 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/config/ConfigTechReborn.java b/src/main/java/techreborn/config/ConfigTechReborn.java index 7552174ba..e3966e76c 100644 --- a/src/main/java/techreborn/config/ConfigTechReborn.java +++ b/src/main/java/techreborn/config/ConfigTechReborn.java @@ -7,6 +7,7 @@ import net.minecraftforge.common.config.Configuration; public class ConfigTechReborn { private static ConfigTechReborn instance = null; public static String CATEGORY_WORLD = "world"; + public static String CATEGORY_POWER = "power"; //WORLDGEN public static boolean GalenaOreTrue; @@ -22,6 +23,8 @@ public class ConfigTechReborn { public static boolean OlivineOreTrue; public static boolean SodaliteOreTrue; + //Power + public static int ThermalGenertaorOutput; public static Configuration config; @@ -109,6 +112,11 @@ public class ConfigTechReborn { "Allow SodaliteOre", true, "Allow SodaliteOre to be generated in your world.") .getBoolean(true); + + ThermalGenertaorOutput = config.get(CATEGORY_POWER, + "Thermal Generator Power", 30, + "The amount of power that the thermal generator makes for 1mb of lava") + .getInt(); if (config.hasChanged()) config.save(); diff --git a/src/main/java/techreborn/config/TechRebornConfigGui.java b/src/main/java/techreborn/config/TechRebornConfigGui.java index 2dd04b2ab..c37a6480b 100644 --- a/src/main/java/techreborn/config/TechRebornConfigGui.java +++ b/src/main/java/techreborn/config/TechRebornConfigGui.java @@ -27,7 +27,9 @@ public class TechRebornConfigGui extends GuiConfig{ "tr.configgui.category.trGeneral", TRGeneral.class)); list.add(new DummyConfigElement.DummyCategoryElement("World Gen", "tr.configgui.category.trWorld", TRWORLD.class)); - + list.add(new DummyConfigElement.DummyCategoryElement("Power", + "tr.configgui.category.trPower", TRPOWER.class)); + return list; } @@ -75,4 +77,28 @@ public class TechRebornConfigGui extends GuiConfig{ .toString())); } } + + // Power + public static class TRPOWER extends CategoryEntry { + public TRPOWER(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } + + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config + .getCategory(ConfigTechReborn.CATEGORY_POWER))) + .getChildElements(), this.owningScreen.modID, + Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() + || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() + || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config + .toString())); + } + } } diff --git a/src/main/java/techreborn/tiles/TileThermalGenerator.java b/src/main/java/techreborn/tiles/TileThermalGenerator.java index fd6d38288..1cdc45a68 100644 --- a/src/main/java/techreborn/tiles/TileThermalGenerator.java +++ b/src/main/java/techreborn/tiles/TileThermalGenerator.java @@ -17,6 +17,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.util.FluidUtils; import techreborn.util.Inventory; @@ -27,7 +28,7 @@ public class TileThermalGenerator extends TileEntity implements IWrenchable, IFl public Tank tank = new Tank("TileThermalGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this); public Inventory inventory = new Inventory(3, "TileThermalGenerator", 64); public BasicSource energySource; - public static final int euTick = 30; + public static final int euTick = ConfigTechReborn.ThermalGenertaorOutput; public TileThermalGenerator() { this.energySource = new BasicSource(this, 1000000, 1);