From 3e9e4afbfd1acdec3b0bcdfc124cf42d17230dd3 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 21 Jun 2015 22:34:42 -0700 Subject: [PATCH] Localize Configs #507 --- lang | 2 +- src/main/java/forestry/core/GameMode.java | 96 +++---- .../java/forestry/core/config/Config.java | 201 ++++++--------- .../core/config/LocalizedConfiguration.java | 118 +++++++++ .../forestry/plugins/PluginApiculture.java | 42 ++-- .../forestry/plugins/PluginArboriculture.java | 2 +- .../plugins/PluginLepidopterology.java | 31 +-- .../java/forestry/plugins/PluginMail.java | 9 +- .../java/forestry/plugins/PluginStorage.java | 15 +- .../config/forestry/gamemodes/EASY.cfg | 143 ----------- .../config/forestry/gamemodes/HARD.cfg | 233 ++++++++--------- .../config/forestry/gamemodes/NORMAL.cfg | 234 +++++++++--------- .../config/forestry/gamemodes/OP.cfg | 234 +++++++++--------- 13 files changed, 633 insertions(+), 727 deletions(-) create mode 100644 src/main/java/forestry/core/config/LocalizedConfiguration.java delete mode 100644 src/main/resources/config/forestry/gamemodes/EASY.cfg diff --git a/lang b/lang index e111b835a..8b7cc82cf 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit e111b835ada3dde177bf2a54be6a641e74386eea +Subproject commit 8b7cc82cfde21efff1fe382bfc5ef057cf16c539 diff --git a/src/main/java/forestry/core/GameMode.java b/src/main/java/forestry/core/GameMode.java index 05f8f856c..d2b506b11 100755 --- a/src/main/java/forestry/core/GameMode.java +++ b/src/main/java/forestry/core/GameMode.java @@ -17,15 +17,13 @@ import java.util.Map; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - import forestry.Forestry; import forestry.api.core.ForestryAPI; import forestry.api.core.IGameMode; import forestry.core.config.Config; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; +import forestry.core.config.LocalizedConfiguration; import forestry.core.proxy.Proxies; public class GameMode implements IGameMode { @@ -39,6 +37,7 @@ public class GameMode implements IGameMode { return ForestryAPI.activeMode; } + private static final String GAMEMODE_KEY = "gamemode"; private String identifier = "EASY"; private final String category; @@ -102,45 +101,46 @@ public class GameMode implements IGameMode { } } - Configuration config = new Configuration(newConfigFile); + LocalizedConfiguration config = new LocalizedConfiguration(newConfigFile, "1.0.0"); - initSettingFloat(config, "energy", "demand.modifier", ENERGY_DEMAND_MODIFIER, "modifies the energy required to activate machines, as well as the max amount of energy stored and accepted."); - initSettingInt(config, "farms", "fertilizer.value", FARM_FERTILIZER_VALUE, "modifies the time a piece of fertilizer lasts in a farm."); + initSettingFloat(config, "energy", "demand.modifier", ENERGY_DEMAND_MODIFIER); + initSettingBoolean(config, "energy", "engine.clockwork", true); - initSettingFloat(config, "fuel.ethanol", "generator", FUEL_MODIFIER, "modifies the energy provided by ethanol in a Bio Generator."); - initSettingFloat(config, "fuel.ethanol", "combustion", FUEL_MODIFIER, "modifies the energy provided by ethanol in Buildcraft Combustion Engines."); - initSettingFloat(config, "fuel.biomass", "generator", FUEL_MODIFIER, "modifies the energy provided by Biomass in a Bio Generator."); - initSettingFloat(config, "fuel.biomass", "biogas", FUEL_MODIFIER, "modifies the energy provided by Biomass in Biogas Engines."); + initSettingInt(config, "farms", "fertilizer.value", FARM_FERTILIZER_VALUE); - initSettingStack(config, "recipe.output.fertilizer", "apatite", recipeFertilizerOutputApatite, "amount of fertilizer yielded by the recipe using apatite."); - initSettingStack(config, "recipe.output.fertilizer", "ash", recipeFertilizerOutputAsh, "amount of fertilizer yielded by the recipe using ash."); - initSettingStack(config, "recipe.output.compost", "wheat", recipeCompostOutputWheat, "amount of compost yielded by the recipe using wheat."); - initSettingStack(config, "recipe.output.compost", "ash", recipeCompostOutputAsh, "amount of compost yielded by the recipe using ash."); - initSettingStack(config, "recipe.output.humus", "fertilizer", recipeHumusOutputFertilizer, "amount of humus yielded by the recipe using fertilizer."); - initSettingStack(config, "recipe.output.humus", "compost", recipeHumusOutputCompost, "amount of humus yielded by the recipe using compost."); - initSettingStack(config, "recipe.output.bogearth", "bucket", recipeBogEarthOutputBucket, "amount of bog earth yielded by the recipe using buckets."); - initSettingStack(config, "recipe.output.bogearth", "can", recipeBogEarthOutputCans, "amount of bog earth yielded by the recipes using cans, cells or capsules."); + initSettingFloat(config, "fuel.ethanol", "generator", FUEL_MODIFIER); + initSettingFloat(config, "fuel.ethanol", "combustion", FUEL_MODIFIER); + initSettingFloat(config, "fuel.biomass", "generator", FUEL_MODIFIER); + initSettingFloat(config, "fuel.biomass", "biogas", FUEL_MODIFIER); - initSettingStack(config, "recipe.output", "can", recipeCanOutput, "amount yielded by the recipe for tin cans."); - initSettingStack(config, "recipe.output", "capsule", recipeCapsuleOutput, "amount yielded by the recipe for wax capsules."); - initSettingStack(config, "recipe.output", "refractory", recipeRefractoryOutput, "amount yielded by the recipe for refractory capsules."); + initSettingStack(config, "recipe.output.fertilizer", "apatite", recipeFertilizerOutputApatite); + initSettingStack(config, "recipe.output.fertilizer", "ash", recipeFertilizerOutputAsh); + initSettingStack(config, "recipe.output.compost", "wheat", recipeCompostOutputWheat); + initSettingStack(config, "recipe.output.compost", "ash", recipeCompostOutputAsh); + initSettingStack(config, "recipe.output.humus", "fertilizer", recipeHumusOutputFertilizer); + initSettingStack(config, "recipe.output.humus", "compost", recipeHumusOutputCompost); + initSettingStack(config, "recipe.output.bogearth", "bucket", recipeBogEarthOutputBucket); + initSettingStack(config, "recipe.output.bogearth", "can", recipeBogEarthOutputCans); + initSettingStack(config, "recipe.output", "can", recipeCanOutput); + initSettingStack(config, "recipe.output", "capsule", recipeCapsuleOutput); + initSettingStack(config, "recipe.output", "refractory", recipeRefractoryOutput); - initSettingInt(config, "fermenter.cycles", "fertilizer", FERMENTATION_DURATION_FERTILIZER, "modifies the amount of cycles fertilizer can keep a fermenter going."); - initSettingInt(config, "fermenter.cycles", "compost", FERMENTATION_DURATION_COMPOST, "modifies the amount of cycles compost can keep a fermenter going."); + initSettingInt(config, "fermenter.cycles", "fertilizer", FERMENTATION_DURATION_FERTILIZER); + initSettingInt(config, "fermenter.cycles", "compost", FERMENTATION_DURATION_COMPOST); - initSettingInt(config, "fermenter.value", "fertilizer", FERMENTED_CYCLE_FERTILIZER, "modifies the amount of biomass per cycle a fermenter will produce using fertilizer."); - initSettingInt(config, "fermenter.value", "compost", FERMENTED_CYCLE_COMPOST, "modifies the amount of biomass per cycle a fermenter will produce using compost."); + initSettingInt(config, "fermenter.value", "fertilizer", FERMENTED_CYCLE_FERTILIZER); + initSettingInt(config, "fermenter.value", "compost", FERMENTED_CYCLE_COMPOST); - initSettingInt(config, "fermenter.yield", "sapling", FERMENTED_SAPLING, "modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait."); - initSettingInt(config, "fermenter.yield", "cactus", FERMENTED_CACTI, "modifies the amount of biomass a piece of cactus will yield in a fermenter."); - initSettingInt(config, "fermenter.yield", "wheat", FERMENTED_WHEAT, "modifies the amount of biomass a piece of wheat will yield in a fermenter."); - initSettingInt(config, "fermenter.yield", "cane", FERMENTED_CANE, "modifies the amount of biomass a piece of sugar cane will yield in a fermenter."); - initSettingInt(config, "fermenter.yield", "mushroom", FERMENTED_MUSHROOM, "modifies the amount of biomass a mushroom will yield in a fermenter."); + initSettingInt(config, "fermenter.yield", "sapling", FERMENTED_SAPLING); + initSettingInt(config, "fermenter.yield", "cactus", FERMENTED_CACTI); + initSettingInt(config, "fermenter.yield", "wheat", FERMENTED_WHEAT); + initSettingInt(config, "fermenter.yield", "cane", FERMENTED_CANE); + initSettingInt(config, "fermenter.yield", "mushroom", FERMENTED_MUSHROOM); - initSettingInt(config, "squeezer.liquid", "seed", SQUEEZED_LIQUID_SEED, "modifies the amount of seed oil squeezed from a single seed. other sources are based off this."); - initSettingInt(config, "squeezer.liquid", "apple", SQUEEZED_LIQUID_APPLE, "modifies the amount of juice squeezed from a single apple. other sources are based off this."); - initSettingInt(config, "squeezer.mulch", "apple", SQUEEZED_MULCH_APPLE, "modifies the chance of mulch per squeezed apple."); - initSettingBoolean(config, "energy", "engine.clockwork", true, "set to false to disable the clockwork engine."); + initSettingInt(config, "squeezer.liquid", "seed", SQUEEZED_LIQUID_SEED); + initSettingInt(config, "squeezer.liquid", "apple", SQUEEZED_LIQUID_APPLE); + + initSettingInt(config, "squeezer.mulch", "apple", SQUEEZED_MULCH_APPLE); config.save(); } @@ -185,20 +185,20 @@ public class GameMode implements IGameMode { initSettingBoolean_old("energy.engine.clockwork", true, "set to false to disable the clockwork engine."); } - private void initSettingFloat(Configuration config, String category, String key, double def, String comment) { - String fullKey = category + '.' + key; + private void initSettingFloat(LocalizedConfiguration config, String category, String name, float def) { + String fullName = category + '.' + name; // legacy conversion of old format to new format { - Float oldSetting = floatSettings.get(fullKey); + Float oldSetting = floatSettings.get(fullName); if (oldSetting != null) { def = oldSetting; } } - Property property = config.get(category, key, def, comment); - floatSettings.put(fullKey, (float) property.getDouble()); + float floatValue = config.getFloatLocalized(GAMEMODE_KEY + '.' + category, name, def, 0.0f, 10.0f); + floatSettings.put(fullName, floatValue); } - private void initSettingInt(Configuration config, String category, String key, int def, String comment) { + private void initSettingInt(LocalizedConfiguration config, String category, String key, int def) { String fullKey = category + '.' + key; // legacy conversion of old format to new format { @@ -207,11 +207,11 @@ public class GameMode implements IGameMode { def = oldSetting; } } - Property property = config.get(category, key, def, comment); - integerSettings.put(fullKey, property.getInt()); + int intValue = config.getIntLocalized(GAMEMODE_KEY + '.' + category, key, def, 0, 2000); + integerSettings.put(fullKey, intValue); } - private void initSettingStack(Configuration config, String category, String key, ItemStack def, String comment) { + private void initSettingStack(LocalizedConfiguration config, String category, String key, ItemStack def) { String fullKey = category + '.' + key; // legacy conversion of old format to new format { @@ -220,13 +220,13 @@ public class GameMode implements IGameMode { def = oldSetting; } } - Property property = config.get(category, key, def.stackSize, comment); + int stackSize = config.getIntLocalized(GAMEMODE_KEY + '.' + category, key, def.stackSize, 0, 64); ItemStack changed = def.copy(); - changed.stackSize = property.getInt(); + changed.stackSize = stackSize; stackSettings.put(fullKey, changed); } - private void initSettingBoolean(Configuration config, String category, String key, boolean def, String comment) { + private void initSettingBoolean(LocalizedConfiguration config, String category, String key, boolean def) { String fullKey = category + '.' + key; // legacy conversion of old format to new format { @@ -235,8 +235,8 @@ public class GameMode implements IGameMode { def = oldSetting; } } - Property property = config.get(category, key, def, comment); - booleanSettings.put(fullKey, property.getBoolean()); + boolean booleanValue = config.getBooleanLocalized(GAMEMODE_KEY + '.' + category, key, def); + booleanSettings.put(fullKey, booleanValue); } private void initSettingStack_old(String ident, ItemStack def, String comment) { diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index ae2798a2b..06ebfe51c 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -22,12 +22,14 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import net.minecraftforge.common.config.Configuration; +import net.minecraft.util.StatCollector; + import net.minecraftforge.common.config.Property; import forestry.Forestry; import forestry.core.fluids.Fluids; import forestry.core.proxy.Proxies; +import forestry.core.utils.StringUtil; public class Config { @@ -60,9 +62,9 @@ public class Config { public static boolean generateApatiteOre = true; public static boolean generateCopperOre = true; public static boolean generateTinOre = true; - private static double generateBeehivesAmount = 1.0; + private static float generateBeehivesAmount = 1.0f; public static boolean generateBeehivesDebug = false; - public static boolean enableVillager = true; + public static boolean enableVillagers = true; // Retrogen public static boolean doRetrogen = false; @@ -171,170 +173,102 @@ public class Config { private static void loadNewConfigCommon(File configFileCommon) { - Configuration config = new Configuration(configFileCommon); + LocalizedConfiguration config = new LocalizedConfiguration(configFileCommon, "1.0.0"); - Property property; - - property = config.get("difficulty", "gamemode", "EASY"); - property.comment = "set to your preferred game mode. available modes are OP, EASY, NORMAL, HARD. mismatch with the server may cause visual glitches with recipes. setting an unavailable mode will create a new mode definition file."; - gameMode = property.getString(); - - property = config.get("difficulty", "recreate.definitions", true); - property.comment = "set to true to force recreation of the game mode definitions in config/forestry/gamemodes"; - boolean recreate = property.getBoolean(); - property.set(false); + gameMode = config.getStringLocalized("difficulty", "game.mode", "EASY", new String[]{"OP, EASY, NORMAL, HARD"}); + boolean recreate = config.getBooleanLocalized("difficulty", "recreate.definitions", true); if (recreate) { Proxies.log.info("Recreating all gamemode definitions from the defaults. This may be caused by an upgrade"); - } - // Make sure the default mode files are there. - File easyMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/EASY.cfg"); - if (recreate) { + String recreateDefinitionsComment = StringUtil.localize("config.difficulty.recreate.definitions.comment"); + Property property = config.get("difficulty", "recreate.definitions", true, recreateDefinitionsComment); + property.set(false); + + // Make sure the default mode files are there. + File easyMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/EASY.cfg"); CopyFileToFS(easyMode, "/config/forestry/gamemodes/EASY.cfg"); - } - File opMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/OP.cfg"); - if (!opMode.exists() || recreate) { + File opMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/OP.cfg"); CopyFileToFS(opMode, "/config/forestry/gamemodes/OP.cfg"); - } - File normalMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/NORMAL.cfg"); - if (!normalMode.exists() || recreate) { + File normalMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/NORMAL.cfg"); CopyFileToFS(normalMode, "/config/forestry/gamemodes/NORMAL.cfg"); - } - File hardMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/HARD.cfg"); - if (!hardMode.exists() || recreate) { + File hardMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/HARD.cfg"); CopyFileToFS(hardMode, "/config/forestry/gamemodes/HARD.cfg"); } - property = config.get("performance", "particleFX.enabled", enableParticleFX); - property.comment = "Set to false to disable particle fx on slower machines. Note that Forestry respects Minecraft's reduced particle video settings."; - enableParticleFX = property.getBoolean(); + enableParticleFX = config.getBooleanLocalized("performance", "particleFX", enableParticleFX); // RetroGen - String retroGenMessage = "Forestry will attempt worldGen in chunks that were created before the mod was added."; - property = config.get("world.retrogen", "normal", doRetrogen); - property.comment = "Set to true, " + retroGenMessage; - doRetrogen = property.getBoolean(); - - String forcedRetroGenMessage = "Forestry will attempt worldGen in all chunks for this game instance. Config option will be set to false after this run."; - property = config.get("world.retrogen", "forced", forceRetrogen); - property.comment = "Set to true, " + forcedRetroGenMessage; - forceRetrogen = property.getBoolean(); - property.setToDefault(); + doRetrogen = config.getBooleanLocalized("world.generate.retrogen", "normal", doRetrogen); + forceRetrogen = config.getBooleanLocalized("world.generate.retrogen", "forced", forceRetrogen); if (forceRetrogen) { - Proxies.log.info(forcedRetroGenMessage); + Property property = config.get("world.generate.retrogen", "forced", false); + property.set(false); + + Proxies.log.info("Enabled force retrogen."); doRetrogen = true; } else if (doRetrogen) { - Proxies.log.info(retroGenMessage); + Proxies.log.info("Enabled retrogen."); } - property = config.get("world.generate.beehives", "amount", generateBeehivesAmount); - property.comment = "Set how often beehives spawn. 1.0 is default, 0.0 is disabled, 2.0 is double, 0.5 is half, etc."; - generateBeehivesAmount = property.getDouble(); + generateBeehivesAmount = config.getFloatLocalized("world.generate.beehives", "amount", generateBeehivesAmount, 0.0f, 10.0f); + generateBeehivesDebug = config.getBooleanLocalized("world.generate.beehives", "debug", generateBeehivesDebug); - property = config.get("world.generate.beehives", "debug", generateBeehivesDebug); - property.comment = "Force Forestry to generate a beehive at every possible location (only useful to developers)."; - generateBeehivesDebug = property.getBoolean(); + generateApatiteOre = config.getBooleanLocalized("world.generate.ore", "apatite", generateApatiteOre); + generateCopperOre = config.getBooleanLocalized("world.generate.ore", "copper", generateCopperOre); + generateTinOre = config.getBooleanLocalized("world.generate.ore", "tin", generateTinOre); - property = config.get("world.generate.ore", "apatite", generateApatiteOre); - property.comment = "Generate apatite ore blocks in the world"; - generateApatiteOre = property.getBoolean(); + enableVillagers = config.getBooleanLocalized("world.generate", "villagers", enableVillagers); - property = config.get("world.generate.ore", "copper", generateCopperOre); - property.comment = "Generate copper ore blocks in the world"; - generateCopperOre = property.getBoolean(); + craftingBronzeEnabled = config.getBooleanLocalized("crafting", "bronze", craftingBronzeEnabled); + craftingStampsEnabled = config.getBooleanLocalized("crafting.stamps", "enabled", true); - property = config.get("world.generate.ore", "tin", generateTinOre); - property.comment = "Generate tin ore blocks in the world"; - generateTinOre = property.getBoolean(); - - property = config.get("world.generate", "villager", enableVillager); - property.comment = "Create forestry villagers and their houses"; - enableVillager = property.getBoolean(); - - property = config.get("crafting", "bronze", craftingBronzeEnabled); - property.comment = "Enable crafting recipe for bronze"; - craftingBronzeEnabled = property.getBoolean(); - - property = config.get("crafting.stamps", "enabled", true); - property.comment = "Enable crafting recipes for all types of stamps."; - craftingStampsEnabled = property.getBoolean(); - - String defaultCollectors = "20n;50n;100n;200n"; - property = config.get("crafting.stamps", "excluded", defaultCollectors.split(";")); - property.comment = "Excluded specific stamps from crafting."; + String[] allStamps = new String[]{"1n", "2n", "5n", "10n", "20n", "50n", "100n"}; + String[] defaultCollectors = new String[]{"20n", "50n", "100n"}; + String[] stamps = config.getStringListLocalized("crafting.stamps", "disabled", defaultCollectors, allStamps); try { - collectorStamps.addAll(Arrays.asList(property.getStringList())); + collectorStamps.addAll(Arrays.asList(stamps)); } catch (Exception ex) { - Proxies.log.warning("Failed to read config for 'crafting.stamps.collector', setting to default."); + Proxies.log.warning("Failed to read config for 'crafting.stamps.disabled', setting to default."); + Property property = config.get("crafting.stamps", "disabled", defaultCollectors); property.setToDefault(); - collectorStamps.addAll(Arrays.asList(parseStamps(defaultCollectors))); + collectorStamps.addAll(Arrays.asList(defaultCollectors)); } - property = config.get("genetics", "clear.invalid.chromosomes", clearInvalidChromosomes); - property.comment = "Clear chromosomes which contain invalid alleles. Might rescue your save if it is crashing after the removal of a bee addon."; - clearInvalidChromosomes = property.getBoolean(); + clearInvalidChromosomes = config.getBooleanLocalized("genetics", "clear.invalid.chromosomes", clearInvalidChromosomes); + dungeonLootRare = config.getBooleanLocalized("difficulty", "loot.rare", dungeonLootRare); - property = config.get("difficulty", "dungeonloot.rare", dungeonLootRare); - property.comment = "Make dungeon loot generated by forestry rarer"; - dungeonLootRare = property.getBoolean(); + enableBackpackResupply = config.getBooleanLocalized("performance.backpacks", "resupply", enableBackpackResupply); - property = config.get("performance.backpacks", "resupply", enableBackpackResupply); - property.comment = "Enable backpack resupply. You may want to set this to false on busy servers."; - enableBackpackResupply = property.getBoolean(); + mailAlertEnabled = config.getBooleanLocalized("tweaks.gui", "mail.alert", mailAlertEnabled); - property = config.get("tweaks.gui", "mail.alert", mailAlertEnabled); - property.comment = "Display the mail alert box when you get mail."; - mailAlertEnabled = property.getBoolean(); + guiTabSpeed = config.getIntLocalized("tweaks.gui.tabs", "speed", guiTabSpeed, 1, 50); + enableHints = config.getBooleanLocalized("tweaks.gui.tabs", "hints", enableHints); + enableEnergyStat = config.getBooleanLocalized("tweaks.gui.tabs", "energy", enableEnergyStat); - property = config.get("tweaks.gui.tabs", "speed", guiTabSpeed); - property.comment = "Set the speed at which the gui side tabs open and close."; - guiTabSpeed = property.getInt(); + tooltipLiquidAmount = config.getBooleanLocalized("tweaks.gui.tooltip", "liquidamount", tooltipLiquidAmount); - property = config.get("tweaks.gui.tabs", "hints", enableHints); - property.comment = "Display the hints tab on machine and engine guis."; - enableHints = property.getBoolean(); + enablePermissions = config.getBooleanLocalized("tweaks", "permissions", enablePermissions); - property = config.get("tweaks.gui.tabs", "energystat", enableEnergyStat); - property.comment = "Display the energy statistics tab on energy consumers."; - enableEnergyStat = property.getBoolean(); - - property = config.get("tweaks.gui.tooltip", "liquidamount", tooltipLiquidAmount); - property.comment = "Display liquid amounts in tank tooltips."; - tooltipLiquidAmount = property.getBoolean(); - - property = config.get("tweaks", "permissions", enablePermissions); - property.comment = "Enable access restrictions on forestry machines."; - enablePermissions = property.getBoolean(); - - property = config.get("tweaks.farms", "squared", squareFarms); - property.comment = "Give farms a square layout instead of a diamond one."; - squareFarms = property.getBoolean(); - - property = config.get("tweaks.farms", "enderlily", enableExUtilEnderLily); - property.comment = "Enable farm support for ExtraUtilities Ender-lily seeds."; - enableExUtilEnderLily = property.getBoolean(); - - property = config.get("tweaks.farms", "magicalcrops", enableMagicalCropsSupport); - property.comment = "Enable farm support for Magical Crops."; - enableMagicalCropsSupport = property.getBoolean(); + squareFarms = config.getBooleanLocalized("tweaks.farms", "square", squareFarms); + enableExUtilEnderLily = config.getBooleanLocalized("tweaks.farms", "enderlily", enableExUtilEnderLily); + enableMagicalCropsSupport = config.getBooleanLocalized("tweaks.farms", "magicalcrops", enableMagicalCropsSupport); + String[] availableStructures = new String[]{"alveary3x3", "farm3x3", "farm3x4", "farm3x5", "farm4x4", "farm5x5"}; String[] disabledStructureArray = disabledStructures.toArray(new String[disabledStructures.size()]); - property = config.get("structures.schemata", "disabled", disabledStructureArray); - property.comment = "Add schemata keys to disable them. One per line. Available keys: alveary3x3, farm3x3, farm3x4, farm3x5, farm4x4, farm5x5"; - disabledStructures.addAll(Arrays.asList(property.getStringList())); + disabledStructureArray = config.getStringListLocalized("structures", "disabled", disabledStructureArray, availableStructures); + + disabledStructures.addAll(Arrays.asList(disabledStructureArray)); for (String str : disabledStructures) { Proxies.log.finer("Disabled structure '%s'.", str); } - property = config.get("debug", "enabled", isDebug); - property.comment = "Enable Debug mode (only useful to developers)."; - isDebug = property.getBoolean(); + isDebug = config.getBooleanLocalized("debug", "enabled", isDebug); config.save(); } @@ -375,7 +309,7 @@ public class Config { property.comment = "set to false to force forestry to skip generating own apatite ore blocks in the world"; generateApatiteOre = Boolean.parseBoolean(property.value); - property = configOld.get("world.generate.beehives.rate", CATEGORY_COMMON, (float) generateBeehivesAmount); + property = configOld.get("world.generate.beehives.rate", CATEGORY_COMMON, generateBeehivesAmount); property.comment = "set how many beehives spawn. Default is 1.0, double is 2.0, half is 0.5 etc."; generateBeehivesAmount = Float.parseFloat(property.value); @@ -383,7 +317,7 @@ public class Config { property.comment = "set to false to force forestry to skip generating beehives in the world"; boolean generateBeehives = Boolean.parseBoolean(property.value); if (!generateBeehives) { - generateBeehivesAmount = 0.0; + generateBeehivesAmount = 0.0f; } property = configOld.get("world.generate.beehives.debug", CATEGORY_DEBUG, false); @@ -400,7 +334,7 @@ public class Config { property = configOld.get("world.generate.villager", CATEGORY_COMMON, true); property.comment = "set to false to disable the creation of forestry villagers and their houses"; - enableVillager = Boolean.parseBoolean(property.value); + enableVillagers = Boolean.parseBoolean(property.value); property = configOld.get("crafting.bronze.enabled", CATEGORY_COMMON, true); property.comment = "set to false to disable crafting recipe for bronze"; @@ -475,19 +409,22 @@ public class Config { } private static void loadNewConfigFluids(File configFile) { - net.minecraftforge.common.config.Configuration config = new net.minecraftforge.common.config.Configuration(configFile); + LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0"); - net.minecraftforge.common.config.Property property; for (Fluids fluid : Fluids.forestryFluids) { + String fluidName = StatCollector.translateToLocal("fluid." + fluid.getTag()); + boolean enabledFluid = !Config.disabledFluids.contains(fluid.getTag()); - property = config.get("enableFluid", fluid.getTag(), enabledFluid); - if (!property.getBoolean()) { + String enableFluidComment = StringUtil.localizeAndFormatRaw("for.config.fluids.enable.format", fluidName); + enabledFluid = config.getBoolean("enableFluid", fluid.getTag(), enabledFluid, enableFluidComment); + if (!enabledFluid) { Config.disabledFluids.add(fluid.getTag()); } boolean enabledFluidBlock = !Config.disabledBlocks.contains(fluid.getTag()); - property = config.get("enableFluidBlock", fluid.getTag(), enabledFluidBlock); - if (!property.getBoolean()) { + String enableFluidBlockComment = StringUtil.localizeAndFormatRaw("for.config.fluid.blocks.enable.format", fluidName); + enabledFluidBlock = config.getBoolean("enableFluidBlock", fluid.getTag(), enabledFluidBlock, enableFluidBlockComment); + if (!enabledFluidBlock) { Config.disabledBlocks.add(fluid.getTag()); } } diff --git a/src/main/java/forestry/core/config/LocalizedConfiguration.java b/src/main/java/forestry/core/config/LocalizedConfiguration.java new file mode 100644 index 000000000..8e92367d6 --- /dev/null +++ b/src/main/java/forestry/core/config/LocalizedConfiguration.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************/ +package forestry.core.config; + +import java.io.File; +import java.util.Arrays; + +import net.minecraft.util.StatCollector; + +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; + +public class LocalizedConfiguration extends Configuration { + + public LocalizedConfiguration(File file, String configVersion) { + super(file, configVersion); + } + + public Configuration setCategoryLanguageKey(String categoryName) { + String categoryKey = "for.config" + categoryName; + return super.setCategoryLanguageKey(categoryName, categoryKey); + } + + public boolean getBoolean(String category, String name, boolean defaultValue, String comment) { + Property prop = this.get(category, name, defaultValue); + prop.comment = comment + " [default: " + defaultValue + "]"; + return prop.getBoolean(defaultValue); + } + + public boolean getBooleanLocalized(String category, String name, boolean defaultValue) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + return getBoolean(name, category, defaultValue, comment, langKey); + } + + public String getStringLocalized(String category, String name, String defaultValue) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + return getString(name, category, defaultValue, comment, langKey); + } + + public String getStringLocalized(String category, String name, String defaultValue, String[] validValues) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + + Property prop = this.get(category, name, defaultValue); + prop.setValidValues(validValues); + prop.setLanguageKey(langKey); + prop.comment = comment + " [default: " + defaultValue + "] [valid: " + Arrays.toString(prop.getValidValues()) + "]"; + return prop.getString(); + } + + public String[] getStringListLocalized(String category, String name, String[] defaultValue) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + return super.getStringList(name, category, defaultValue, comment); + } + + public String[] getStringListLocalized(String category, String name, String[] defaultValue, String[] validValues) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + + Property prop = this.get(category, name, defaultValue); + prop.setLanguageKey(langKey); + prop.setValidValues(validValues); + prop.comment = comment + " [default: " + Arrays.toString(defaultValue) + "] [valid: " + Arrays.toString(prop.getValidValues()) + "]"; + return prop.getStringList(); + } + + public float getFloatLocalized(String category, String name, float defaultValue, float minValue, float maxValue) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + return getFloat(name, category, defaultValue, minValue, maxValue, comment, langKey); + } + + public int getIntLocalized(String category, String name, int defaultValue, int minValue, int maxValue) { + String langKey = "for.config." + category + '.' + name; + String commentKey = langKey + '.' + "comment"; + String comment = ""; + if (StatCollector.canTranslate(commentKey)) { + comment = StatCollector.translateToLocal(commentKey); + } + return getInt(name, category, defaultValue, minValue, maxValue, comment, langKey); + } + +} diff --git a/src/main/java/forestry/plugins/PluginApiculture.java b/src/main/java/forestry/plugins/PluginApiculture.java index e9935ad3c..022c383cc 100644 --- a/src/main/java/forestry/plugins/PluginApiculture.java +++ b/src/main/java/forestry/plugins/PluginApiculture.java @@ -36,7 +36,6 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.oredict.OreDictionary; @@ -135,6 +134,7 @@ import forestry.core.config.Config; import forestry.core.config.Defaults; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; +import forestry.core.config.LocalizedConfiguration; import forestry.core.fluids.Fluids; import forestry.core.gadgets.BlockBase; import forestry.core.gadgets.MachineDefinition; @@ -151,6 +151,7 @@ import forestry.core.proxy.Proxies; import forestry.core.render.EntitySnowFX; import forestry.core.utils.ShapedRecipeCustom; import forestry.core.utils.StackUtils; +import forestry.core.utils.StringUtil; @Plugin(pluginID = "Apiculture", name = "Apiculture", author = "SirSengir", url = Defaults.URL, unlocalizedDescription = "for.plugin.apiculture.description") public class PluginApiculture extends ForestryPlugin { @@ -160,7 +161,7 @@ public class PluginApiculture extends ForestryPlugin { private static final String CONFIG_CATEGORY = "apiculture"; public static final String[] EMPTY_STRINGS = new String[0]; public static String beekeepingMode = "NORMAL"; - private static double secondPrincessChance = 0; + private static float secondPrincessChance = 0; public static int ticksPerBeeWorkCycle = 550; public static boolean apiarySideSensitive = false; public static boolean fancyRenderedBees = false; @@ -261,7 +262,7 @@ public class PluginApiculture extends ForestryPlugin { ApicultureTriggers.initialize(); } - if (Config.enableVillager) { + if (Config.enableVillagers) { // Register village components with the Structure registry. VillageHandlerApiculture.registerVillageComponents(); } @@ -291,35 +292,29 @@ public class PluginApiculture extends ForestryPlugin { } } - Configuration config = new Configuration(configFile); - - Property property = config.get("apiary", "sidesensitive", apiarySideSensitive); - property.comment = "set to false if apiaries should output all items regardless of side a pipe is attached to"; - apiarySideSensitive = property.getBoolean(); - - property = config.get("render.bees", "fancy", fancyRenderedBees); - property.comment = "set to true to enable a fancy butterfly-like renderer for bees. (experimental!)"; - fancyRenderedBees = property.getBoolean(); + LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0"); List beekeepingModes = BeeManager.beeRoot.getBeekeepingModes(); String[] validBeekeepingModeNames = new String[beekeepingModes.size()]; for (int i = 0; i < beekeepingModes.size(); i++) { validBeekeepingModeNames[i] = beekeepingModes.get(i).getName(); } - property = config.get("beekeeping", "mode", "NORMAL", "Change the beekeeping mode. Accepted values are EASY, NORMAL, HARD, HARDCORE, and INSANE.", validBeekeepingModeNames); - beekeepingMode = property.getString(); + + beekeepingMode = config.getStringLocalized("beekeeping", "mode", "NORMAL", validBeekeepingModeNames); Proxies.log.finer("Beekeeping mode read from config: " + beekeepingMode); - property = config.get("beekeeping", "secondPrincess", secondPrincessChance, "percent chance of a second princess drop, for limited/skyblock maps.", 0.0, 100.0); - secondPrincessChance = property.getDouble(); + secondPrincessChance = config.getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f); + + String acceptedFlowerMessage = StringUtil.localize("config.beekeeping.flowers.accepted.comment"); + String plantableFlowerMessage = StringUtil.localize("config.beekeeping.flowers.plantable.comment"); for (String flowerType : FlowerManager.flowerRegistry.getFlowerTypes()) { String[] defaultAccepted = defaultAcceptedFlowers.get(flowerType); if (defaultAccepted == null) { defaultAccepted = EMPTY_STRINGS; } - property = config.get("beekeeping.flowers." + flowerType, "accepted", defaultAccepted); - property.comment = "Accepted flowers allow bees to work. Format is 'modid:name:meta', one per line. The format for wildcard metadata is 'modid:name'."; + Property property = config.get("beekeeping.flowers." + flowerType, "accepted", defaultAccepted); + property.comment = acceptedFlowerMessage; parseAcceptedFlowers(property, flowerType); String[] defaultPlantable = defaultPlantableFlowers.get(flowerType); @@ -327,13 +322,12 @@ public class PluginApiculture extends ForestryPlugin { defaultPlantable = EMPTY_STRINGS; } property = config.get("beekeeping.flowers." + flowerType, "plantable", defaultPlantable); - property.comment = "Plantable flowers are placed by bees. All plantable flowers are automatically accepted flowers. Format is 'weight:modid:name:meta', one per line. 'weight' is between 0.0 and 1.0. The format for wildcard metadata is 'weight:modid:name'."; + property.comment = plantableFlowerMessage; parsePlantableFlowers(property, flowerType); } - property = config.get("species.blacklist", CONFIG_CATEGORY, EMPTY_STRINGS); - property.comment = "add species to blacklist identified by their uid, one per line."; - parseBeeBlacklist(property.getStringList()); + String[] blacklist = config.getStringListLocalized("species", "blacklist", EMPTY_STRINGS); + parseBeeBlacklist(blacklist); config.save(); @@ -370,7 +364,7 @@ public class PluginApiculture extends ForestryPlugin { BeeManager.villageBees[1].add(BeeDefinition.COMMON.getGenome()); BeeManager.villageBees[1].add(BeeDefinition.VALIANT.getGenome()); - if (Config.enableVillager) { + if (Config.enableVillagers) { // Register villager stuff VillageHandlerApiculture villageHandler = new VillageHandlerApiculture(); VillagerRegistry.instance().registerVillageCreationHandler(villageHandler); @@ -465,7 +459,7 @@ public class PluginApiculture extends ForestryPlugin { beekeepingMode = property.value.trim(); Proxies.log.finer("Beekeeping mode read from config: " + beekeepingMode); - property = apicultureConfig.get("beekeeping.secondprincess", CONFIG_CATEGORY, (float) secondPrincessChance); + property = apicultureConfig.get("beekeeping.secondprincess", CONFIG_CATEGORY, secondPrincessChance); property.comment = "percent chance of second princess drop, for limited/skyblock maps. Acceptable values up to 2 decimals."; secondPrincessChance = Float.parseFloat(property.value); diff --git a/src/main/java/forestry/plugins/PluginArboriculture.java b/src/main/java/forestry/plugins/PluginArboriculture.java index 9129128b0..65b3ff019 100644 --- a/src/main/java/forestry/plugins/PluginArboriculture.java +++ b/src/main/java/forestry/plugins/PluginArboriculture.java @@ -340,7 +340,7 @@ public class PluginArboriculture extends ForestryPlugin { MinecraftForge.EVENT_BUS.register(new EventHandlerArboriculture()); - if (Config.enableVillager) { + if (Config.enableVillagers) { VillagerRegistry.instance().registerVillagerId(Defaults.ID_VILLAGER_LUMBERJACK); Proxies.render.registerVillagerSkin(Defaults.ID_VILLAGER_LUMBERJACK, Defaults.TEXTURE_SKIN_LUMBERJACK); VillagerRegistry.instance().registerVillageTradeHandler(Defaults.ID_VILLAGER_LUMBERJACK, new VillageHandlerArboriculture()); diff --git a/src/main/java/forestry/plugins/PluginLepidopterology.java b/src/main/java/forestry/plugins/PluginLepidopterology.java index cc2cd0a87..48f6fa74e 100755 --- a/src/main/java/forestry/plugins/PluginLepidopterology.java +++ b/src/main/java/forestry/plugins/PluginLepidopterology.java @@ -19,8 +19,6 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.crafting.CraftingManager; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; import net.minecraftforge.oredict.RecipeSorter; import cpw.mods.fml.common.SidedProxy; @@ -40,6 +38,7 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Defaults; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; +import forestry.core.config.LocalizedConfiguration; import forestry.core.fluids.Fluids; import forestry.core.gadgets.BlockBase; import forestry.core.gadgets.MachineDefinition; @@ -124,21 +123,7 @@ public class PluginLepidopterology extends ForestryPlugin { } } - Configuration config = new Configuration(configFile); - - Property property = config.get("entities", "spawn.limit", spawnConstraint); - property.comment = "Butterflies will stop natural spawning once this limit is reached."; - spawnConstraint = property.getInt(); - - property = config.get("entities", "maximum", entityConstraint); - property.comment = "New butterflies will stay in item form and will not take flight once this limit is reached."; - entityConstraint = property.getInt(); - - property = config.get("entities", "pollination", allowPollination); - property.comment = "Allow butterflies to pollinate leaves."; - allowPollination = property.getBoolean(); - - config.save(); + loadNewConfig(configFile); PluginCore.rootCommand.addChildCommand(new CommandButterfly()); @@ -165,7 +150,17 @@ public class PluginLepidopterology extends ForestryPlugin { RecipeSorter.register("forestry:lepidopterologymating", MatingRecipe.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless"); } - private void loadOldConfig() { + private static void loadNewConfig(File configFile) { + LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0"); + + spawnConstraint = config.getIntLocalized("butterfly.entities", "spawn.limit", spawnConstraint, 0, 500); + entityConstraint = config.getIntLocalized("butterfly.entities", "maximum", entityConstraint, 0, 5000); + allowPollination = config.getBooleanLocalized("butterfly.entities", "pollination", allowPollination); + + config.save(); + } + + private static void loadOldConfig() { forestry.core.config.deprecated.Configuration config = new forestry.core.config.deprecated.Configuration(); forestry.core.config.deprecated.Property property = config.get("entities.spawn.limit", CONFIG_CATEGORY, spawnConstraint); diff --git a/src/main/java/forestry/plugins/PluginMail.java b/src/main/java/forestry/plugins/PluginMail.java index f1218fc21..0f63ae9d4 100755 --- a/src/main/java/forestry/plugins/PluginMail.java +++ b/src/main/java/forestry/plugins/PluginMail.java @@ -131,9 +131,12 @@ public class PluginMail extends ForestryPlugin { protected void registerItems() { stampDefinitions = new StampInfo[]{ - new StampInfo("1n", EnumPostage.P_1, ForestryItem.apatite, 0x4a8ca7, 0xffffff), new StampInfo("2n", EnumPostage.P_2, "ingotCopper", 0xe8c814, 0xffffff), - new StampInfo("5n", EnumPostage.P_5, "ingotTin", 0x9c0707, 0xffffff), new StampInfo("10n", EnumPostage.P_10, Items.gold_ingot, 0x7bd1b8, 0xffffff), - new StampInfo("20n", EnumPostage.P_20, Items.diamond, 0xff9031, 0xfff7dd), new StampInfo("50n", EnumPostage.P_50, Items.emerald, 0x6431d7, 0xfff7dd), + new StampInfo("1n", EnumPostage.P_1, ForestryItem.apatite, 0x4a8ca7, 0xffffff), + new StampInfo("2n", EnumPostage.P_2, "ingotCopper", 0xe8c814, 0xffffff), + new StampInfo("5n", EnumPostage.P_5, "ingotTin", 0x9c0707, 0xffffff), + new StampInfo("10n", EnumPostage.P_10, Items.gold_ingot, 0x7bd1b8, 0xffffff), + new StampInfo("20n", EnumPostage.P_20, Items.diamond, 0xff9031, 0xfff7dd), + new StampInfo("50n", EnumPostage.P_50, Items.emerald, 0x6431d7, 0xfff7dd), new StampInfo("100n", EnumPostage.P_100, Items.nether_star, 0xd731ba, 0xfff7dd)}; //new StampInfo("200n", EnumPostage.P_200, Item.netherStar, 0xcd9831, 0xfff7dd)}; /* STAMPS */ diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index b4a9ca1b7..cc4fd8bfd 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -43,7 +43,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IShearable; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.oredict.OreDictionary; @@ -61,6 +60,7 @@ import forestry.api.storage.StorageManager; import forestry.core.config.Defaults; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; +import forestry.core.config.LocalizedConfiguration; import forestry.core.fluids.Fluids; import forestry.core.interfaces.IPickupHandler; import forestry.core.interfaces.IResupplyHandler; @@ -68,6 +68,7 @@ import forestry.core.items.ItemCrated; import forestry.core.network.GuiId; import forestry.core.proxy.Proxies; import forestry.core.utils.StackUtils; +import forestry.core.utils.StringUtil; import forestry.factory.gadgets.MachineCarpenter; import forestry.storage.BackpackDefinition; import forestry.storage.BackpackHelper; @@ -165,7 +166,7 @@ public class PluginStorage extends ForestryPlugin { } } - Configuration config = new Configuration(configFile); + LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0"); handleBackpackConfig(config, "miner"); handleBackpackConfig(config, "digger"); @@ -413,7 +414,7 @@ public class PluginStorage extends ForestryPlugin { } } - private static void handleBackpackConfig(Configuration config, String backpackName) { + private static void handleBackpackConfig(LocalizedConfiguration config, String backpackName) { BackpackDefinition backpackDefinition = (BackpackDefinition) BackpackManager.definitions.get(backpackName); List backpackItems; @@ -424,8 +425,8 @@ public class PluginStorage extends ForestryPlugin { Collections.sort(validItems); String[] defaultValidItems = validItems.toArray(new String[validItems.size()]); - Property backpackConf = config.get("backpacks." + backpackName, "itemStacks", defaultValidItems); - backpackConf.comment = "Add itemStacks for the " + backpackName + "'s backpack here in the format 'modid:name:meta'. For wildcard metadata the format is 'modid:name'."; + Property backpackConf = config.get("backpacks." + backpackName, "item.stacks", defaultValidItems); + backpackConf.comment = StringUtil.localizeAndFormat("config.backpacks.item.stacks.format", backpackName); String[] backpackItemList = backpackConf.getStringList(); backpackItems = StackUtils.parseItemStackStrings(backpackItemList, OreDictionary.WILDCARD_VALUE); @@ -444,8 +445,8 @@ public class PluginStorage extends ForestryPlugin { Collections.sort(defaultOreNamesList); defaultOreNames = defaultOreNamesList.toArray(new String[defaultOreNamesList.size()]); - Property backpackConf = config.get("backpacks." + backpackName, "oreDict", defaultOreNames); - backpackConf.comment = "Add ore dictionary names for the " + backpackName + "'s backpack here in the format 'oreDictName'."; + Property backpackConf = config.get("backpacks." + backpackName, "ore.dict", defaultOreNames); + backpackConf.comment = StringUtil.localizeAndFormat("config.backpacks.ore.dict.format", backpackName); String[] oreDictNameList = backpackConf.getStringList(); Collections.addAll(backpackOreDict, oreDictNameList); diff --git a/src/main/resources/config/forestry/gamemodes/EASY.cfg b/src/main/resources/config/forestry/gamemodes/EASY.cfg deleted file mode 100644 index 7715b30b5..000000000 --- a/src/main/resources/config/forestry/gamemodes/EASY.cfg +++ /dev/null @@ -1,143 +0,0 @@ -# Configuration file - -energy { - # modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. - D:demand.modifier=1.0 - - # set to false to disable the clockwork engine. - B:engine.clockwork=true -} - - -farms { - # modifies the time a piece of fertilizer lasts in a farm. - I:fertilizer.value=2000 -} - - -fermenter { - - cycles { - # modifies the amount of cycles compost can keep a fermenter going. - I:compost=250 - - # modifies the amount of cycles fertilizer can keep a fermenter going. - I:fertilizer=200 - } - - value { - # modifies the amount of biomass per cycle a fermenter will produce using compost. - I:compost=48 - - # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. - I:fertilizer=56 - } - - yield { - # modifies the amount of biomass a piece of cactus will yield in a fermenter. - I:cactus=50 - - # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. - I:cane=50 - - # modifies the amount of biomass a mushroom will yield in a fermenter. - I:mushroom=50 - - # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. - I:sapling=250 - - # modifies the amount of biomass a piece of wheat will yield in a fermenter. - I:wheat=50 - } - -} - - -fuel { - - ethanol { - # modifies the energy provided by ethanol in Buildcraft Combustion Engines. - D:combustion=1.0 - - # modifies the energy provided by ethanol in a Bio Generator. - D:generator=1.0 - } - - biomass { - # modifies the energy provided by Biomass in Biogas Engines. - D:biogas=1.0 - - # modifies the energy provided by Biomass in a Bio Generator. - D:generator=1.0 - } - -} - - -recipe { - - output { - # amount yielded by the recipe for tin cans. - I:can=12 - - # amount yielded by the recipe for wax capsules. - I:capsule=4 - - # amount yielded by the recipe for refractory capsules. - I:refractory=4 - - fertilizer { - # amount of fertilizer yielded by the recipe using apatite. - I:apatite=8 - - # amount of fertilizer yielded by the recipe using ash. - I:ash=16 - } - - compost { - # amount of compost yielded by the recipe using ash. - I:ash=1 - - # amount of compost yielded by the recipe using wheat. - I:wheat=4 - } - - humus { - # amount of humus yielded by the recipe using compost. - I:compost=8 - - # amount of humus yielded by the recipe using fertilizer. - I:fertilizer=8 - } - - bogearth { - # amount of bog earth yielded by the recipe using buckets. - I:bucket=6 - - # amount of bog earth yielded by the recipes using cans, cells or capsules. - I:can=8 - } - - } - -} - - -squeezer { - - liquid { - # modifies the amount of juice squeezed from a single apple. other sources are based off this. - I:apple=200 - - # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. - I:seed=10 - } - - mulch { - # modifies the chance of mulch per squeezed apple. - I:apple=20 - } - -} - - diff --git a/src/main/resources/config/forestry/gamemodes/HARD.cfg b/src/main/resources/config/forestry/gamemodes/HARD.cfg index 0b2d4bdfa..8e4217858 100644 --- a/src/main/resources/config/forestry/gamemodes/HARD.cfg +++ b/src/main/resources/config/forestry/gamemodes/HARD.cfg @@ -1,121 +1,140 @@ # Configuration file -energy { - # modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. - D:demand.modifier=4.0 +~CONFIG_VERSION: 1.0.0 - # set to false to disable the clockwork engine. - B:engine.clockwork=true -} +gamemode { + energy { + # Modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. [range: 0.0 ~ 10.0, default: 4.0] + S:demand.modifier=4.0 -farms { - # modifies the time a piece of fertilizer lasts in a farm. - I:fertilizer.value=500 -} - - -fermenter { - - cycles { - # modifies the amount of cycles compost can keep a fermenter going. - I:compost=150 - - # modifies the amount of cycles fertilizer can keep a fermenter going. - I:fertilizer=100 + # Enable the clockwork engine. [default: true] + B:engine.clockwork=true } - value { - # modifies the amount of biomass per cycle a fermenter will produce using compost. - I:compost=48 - - # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. - I:fertilizer=56 + farms { + # Modifies the time a piece of fertilizer lasts in a farm. [range: 0 ~ 2000, default: 500] + I:fertilizer.value=500 } - yield { - # modifies the amount of biomass a piece of cactus will yield in a fermenter. - I:cactus=10 + fuel { - # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. - I:cane=10 + ethanol { + # modifies the energy provided by ethanol in Buildcraft Combustion Engines. [range: 0.0 ~ 10.0, default: 0.5] + S:combustion=0.5 - # modifies the amount of biomass a mushroom will yield in a fermenter. - I:mushroom=10 - - # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. - I:sapling=50 - - # modifies the amount of biomass a piece of wheat will yield in a fermenter. - I:wheat=10 - } - -} - - -fuel { - - ethanol { - # modifies the energy provided by ethanol in Buildcraft Combustion Engines. - D:combustion=0.5 - - # modifies the energy provided by ethanol in a Bio Generator. - D:generator=0.5 - } - - biomass { - # modifies the energy provided by Biomass in Biogas Engines. - D:biogas=0.5 - - # modifies the energy provided by Biomass in a Bio Generator. - D:generator=0.5 - } - -} - - -recipe { - - output { - # amount yielded by the recipe for tin cans. - I:can=8 - - # amount yielded by the recipe for wax capsules. - I:capsule=2 - - # amount yielded by the recipe for refractory capsules. - I:refractory=2 - - fertilizer { - # amount of fertilizer yielded by the recipe using apatite. - I:apatite=5 - - # amount of fertilizer yielded by the recipe using ash. - I:ash=0 + # modifies the energy provided by ethanol in a Bio Generator. [range: 0.0 ~ 10.0, default: 0.5] + S:generator=0.5 } - compost { - # amount of compost yielded by the recipe using ash. - I:ash=1 + biomass { + # modifies the energy provided by Biomass in Biogas Engines. [range: 0.0 ~ 10.0, default: 0.5] + S:biogas=0.5 - # amount of compost yielded by the recipe using wheat. - I:wheat=1 + # modifies the energy provided by Biomass in a Bio Generator. [range: 0.0 ~ 10.0, default: 0.5] + S:generator=0.5 } - humus { - # amount of humus yielded by the recipe using compost. - I:compost=8 + } + + recipe { + + output { + # amount yielded by the recipe for tin cans. [range: 0 ~ 64, default: 8] + I:can=8 + + # amount yielded by the recipe for wax capsules. [range: 0 ~ 64, default: 2] + I:capsule=2 + + # amount yielded by the recipe for refractory capsules. [range: 0 ~ 64, default: 2] + I:refractory=2 + + fertilizer { + # amount of fertilizer yielded by the recipe using apatite. [range: 0 ~ 64, default: 5] + I:apatite=5 + + # amount of fertilizer yielded by the recipe using ash. [range: 0 ~ 64, default: 0] + I:ash=0 + } + + compost { + # amount of compost yielded by the recipe using ash. [range: 0 ~ 64, default: 1] + I:ash=1 + + # amount of compost yielded by the recipe using wheat. [range: 0 ~ 64, default: 1] + I:wheat=1 + } + + humus { + # amount of humus yielded by the recipe using compost. [range: 0 ~ 64, default: 8] + I:compost=8 + + # amount of humus yielded by the recipe using fertilizer. [range: 0 ~ 64, default: 8] + I:fertilizer=8 + } + + bogearth { + # amount of bog earth yielded by the recipe using buckets. [range: 0 ~ 64, default: 4] + I:bucket=4 + + # amount of bog earth yielded by the recipes using cans, cells or capsules. [range: 0 ~ 64, default: 5] + I:can=5 + } - # amount of humus yielded by the recipe using fertilizer. - I:fertilizer=8 } - bogearth { - # amount of bog earth yielded by the recipe using buckets. - I:bucket=4 + } - # amount of bog earth yielded by the recipes using cans, cells or capsules. - I:can=5 + fermenter { + + cycles { + # modifies the amount of cycles compost can keep a fermenter going. [range: 0 ~ 2000, default: 150] + I:compost=150 + + # modifies the amount of cycles fertilizer can keep a fermenter going. [range: 0 ~ 2000, default: 100] + I:fertilizer=100 + } + + value { + # modifies the amount of biomass per cycle a fermenter will produce using compost. [range: 0 ~ 2000, default: 48] + I:compost=48 + + # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. [range: 0 ~ 2000, default: 56] + I:fertilizer=56 + } + + yield { + # modifies the amount of biomass a piece of cactus will yield in a fermenter. [range: 0 ~ 2000, default: 10] + I:cactus=10 + + # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. [range: 0 ~ 2000, default: 10] + I:cane=10 + + # modifies the amount of biomass a mushroom will yield in a fermenter. [range: 0 ~ 2000, default: 10] + I:mushroom=10 + + # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. [range: 0 ~ 2000, default: 50] + I:sapling=50 + + # modifies the amount of biomass a piece of wheat will yield in a fermenter. [range: 0 ~ 2000, default: 10] + I:wheat=10 + } + + } + + squeezer { + + liquid { + # modifies the amount of juice squeezed from a single apple. other sources are based off this. [range: 0 ~ 2000, default: 60] + I:apple=60 + + # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. [range: 0 ~ 2000, default: 3] + I:seed=3 + } + + mulch { + # modifies the chance of mulch per squeezed apple. [range: 0 ~ 2000, default: 8] + I:apple=8 } } @@ -123,21 +142,3 @@ recipe { } -squeezer { - - liquid { - # modifies the amount of juice squeezed from a single apple. other sources are based off this. - I:apple=200 - - # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. - I:seed=3 - } - - mulch { - # modifies the chance of mulch per squeezed apple. - I:apple=20 - } - -} - - diff --git a/src/main/resources/config/forestry/gamemodes/NORMAL.cfg b/src/main/resources/config/forestry/gamemodes/NORMAL.cfg index 7fac8dfc8..3a880cbad 100644 --- a/src/main/resources/config/forestry/gamemodes/NORMAL.cfg +++ b/src/main/resources/config/forestry/gamemodes/NORMAL.cfg @@ -1,143 +1,143 @@ # Configuration file -energy { - # modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. - D:demand.modifier=1.5 +~CONFIG_VERSION: 1.0.0 - # set to false to disable the clockwork engine. - B:engine.clockwork=true -} +gamemode { + energy { + # Modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. [range: 0.0 ~ 10.0, default: 1.5] + S:demand.modifier=1.5 -farms { - # modifies the time a piece of fertilizer lasts in a farm. - I:fertilizer.value=1000 -} - - -fermenter { - - cycles { - # modifies the amount of cycles compost can keep a fermenter going. - I:compost=200 - - # modifies the amount of cycles fertilizer can keep a fermenter going. - I:fertilizer=150 + # Enable the clockwork engine. [default: true] + B:engine.clockwork=true } - value { - # modifies the amount of biomass per cycle a fermenter will produce using compost. - I:compost=48 - - # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. - I:fertilizer=56 + farms { + # Modifies the time a piece of fertilizer lasts in a farm. [range: 0 ~ 2000, default: 1000] + I:fertilizer.value=1000 } - yield { - # modifies the amount of biomass a piece of cactus will yield in a fermenter. - I:cactus=25 + fuel { - # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. - I:cane=25 + ethanol { + # modifies the energy provided by ethanol in Buildcraft Combustion Engines. [range: 0.0 ~ 10.0, default: 0.75] + S:combustion=0.75 - # modifies the amount of biomass a mushroom will yield in a fermenter. - I:mushroom=25 - - # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. - I:sapling=100 - - # modifies the amount of biomass a piece of wheat will yield in a fermenter. - I:wheat=25 - } - -} - - -fuel { - - ethanol { - # modifies the energy provided by ethanol in Buildcraft Combustion Engines. - D:combustion=0.75 - - # modifies the energy provided by ethanol in a Bio Generator. - D:generator=0.75 - } - - biomass { - # modifies the energy provided by Biomass in Biogas Engines. - D:biogas=0.75 - - # modifies the energy provided by Biomass in a Bio Generator. - D:generator=0.75 - } - -} - - -recipe { - - output { - # amount yielded by the recipe for tin cans. - I:can=10 - - # amount yielded by the recipe for wax capsules. - I:capsule=3 - - # amount yielded by the recipe for refractory capsules. - I:refractory=3 - - fertilizer { - # amount of fertilizer yielded by the recipe using apatite. - I:apatite=6 - - # amount of fertilizer yielded by the recipe using ash. - I:ash=10 + # modifies the energy provided by ethanol in a Bio Generator. [range: 0.0 ~ 10.0, default: 0.75] + S:generator=0.75 } - compost { - # amount of compost yielded by the recipe using ash. - I:ash=1 + biomass { + # modifies the energy provided by Biomass in Biogas Engines. [range: 0.0 ~ 10.0, default: 0.75] + S:biogas=0.75 - # amount of compost yielded by the recipe using wheat. - I:wheat=2 + # modifies the energy provided by Biomass in a Bio Generator. [range: 0.0 ~ 10.0, default: 0.75] + S:generator=0.75 } - humus { - # amount of humus yielded by the recipe using compost. - I:compost=8 + } + + recipe { + + output { + # amount yielded by the recipe for tin cans. [range: 0 ~ 64, default: 10] + I:can=10 + + # amount yielded by the recipe for wax capsules. [range: 0 ~ 64, default: 3] + I:capsule=3 + + # amount yielded by the recipe for refractory capsules. [range: 0 ~ 64, default: 3] + I:refractory=3 + + fertilizer { + # amount of fertilizer yielded by the recipe using apatite. [range: 0 ~ 64, default: 6] + I:apatite=6 + + # amount of fertilizer yielded by the recipe using ash. [range: 0 ~ 64, default: 10] + I:ash=10 + } + + compost { + # amount of compost yielded by the recipe using ash. [range: 0 ~ 64, default: 1] + I:ash=1 + + # amount of compost yielded by the recipe using wheat. [range: 0 ~ 64, default: 2] + I:wheat=2 + } + + humus { + # amount of humus yielded by the recipe using compost. [range: 0 ~ 64, default: 8] + I:compost=8 + + # amount of humus yielded by the recipe using fertilizer. [range: 0 ~ 64, default: 8] + I:fertilizer=8 + } + + bogearth { + # amount of bog earth yielded by the recipe using buckets. [range: 0 ~ 64, default: 4] + I:bucket=4 + + # amount of bog earth yielded by the recipes using cans, cells or capsules. [range: 0 ~ 64, default: 6] + I:can=6 + } - # amount of humus yielded by the recipe using fertilizer. - I:fertilizer=8 } - bogearth { - # amount of bog earth yielded by the recipe using buckets. - I:bucket=4 + } - # amount of bog earth yielded by the recipes using cans, cells or capsules. - I:can=6 + fermenter { + + cycles { + # modifies the amount of cycles compost can keep a fermenter going. [range: 0 ~ 2000, default: 250] + I:compost=250 + + # modifies the amount of cycles fertilizer can keep a fermenter going. [range: 0 ~ 2000, default: 200] + I:fertilizer=200 + } + + value { + # modifies the amount of biomass per cycle a fermenter will produce using compost. [range: 0 ~ 2000, default: 48] + I:compost=48 + + # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. [range: 0 ~ 2000, default: 56] + I:fertilizer=56 + } + + yield { + # modifies the amount of biomass a piece of cactus will yield in a fermenter. [range: 0 ~ 2000, default: 50] + I:cactus=50 + + # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. [range: 0 ~ 2000, default: 50] + I:cane=50 + + # modifies the amount of biomass a mushroom will yield in a fermenter. [range: 0 ~ 2000, default: 50] + I:mushroom=50 + + # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. [range: 0 ~ 2000, default: 250] + I:sapling=250 + + # modifies the amount of biomass a piece of wheat will yield in a fermenter. [range: 0 ~ 2000, default: 50] + I:wheat=50 + } + + } + + squeezer { + + liquid { + # modifies the amount of juice squeezed from a single apple. other sources are based off this. [range: 0 ~ 2000, default: 100] + I:apple=100 + + # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. [range: 0 ~ 2000, default: 5] + I:seed=5 + } + + mulch { + # modifies the chance of mulch per squeezed apple. [range: 0 ~ 2000, default: 10] + I:apple=10 } } } - -squeezer { - - liquid { - # modifies the amount of juice squeezed from a single apple. other sources are based off this. - I:apple=200 - - # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. - I:seed=5 - } - - mulch { - # modifies the chance of mulch per squeezed apple. - I:apple=20 - } - -} - - diff --git a/src/main/resources/config/forestry/gamemodes/OP.cfg b/src/main/resources/config/forestry/gamemodes/OP.cfg index db8cdbeb3..84417243b 100644 --- a/src/main/resources/config/forestry/gamemodes/OP.cfg +++ b/src/main/resources/config/forestry/gamemodes/OP.cfg @@ -1,143 +1,143 @@ # Configuration file -energy { - # modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. - D:demand.modifier=1.0 +~CONFIG_VERSION: 1.0.0 - # set to false to disable the clockwork engine. - B:engine.clockwork=true -} +gamemode { + energy { + # Modifies the energy required to activate machines, as well as the max amount of energy stored and accepted. [range: 0.0 ~ 10.0, default: 1.0] + S:demand.modifier=1.0 -farms { - # modifies the time a piece of fertilizer lasts in a farm. - I:fertilizer.value=-1 -} - - -fermenter { - - cycles { - # modifies the amount of cycles compost can keep a fermenter going. - I:compost=1000 - - # modifies the amount of cycles fertilizer can keep a fermenter going. - I:fertilizer=800 + # Enable the clockwork engine. [default: true] + B:engine.clockwork=true } - value { - # modifies the amount of biomass per cycle a fermenter will produce using compost. - I:compost=192 - - # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. - I:fertilizer=224 + farms { + # Modifies the time a piece of fertilizer lasts in a farm. [range: 0 ~ 2000, default: 2000] + I:fertilizer.value=2000 } - yield { - # modifies the amount of biomass a piece of cactus will yield in a fermenter. - I:cactus=400 + fuel { - # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. - I:cane=400 + ethanol { + # modifies the energy provided by ethanol in Buildcraft Combustion Engines. [range: 0.0 ~ 10.0, default: 4.0] + S:combustion=4.0 - # modifies the amount of biomass a mushroom will yield in a fermenter. - I:mushroom=400 - - # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. - I:sapling=2000 - - # modifies the amount of biomass a piece of wheat will yield in a fermenter. - I:wheat=400 - } - -} - - -fuel { - - ethanol { - # modifies the energy provided by ethanol in Buildcraft Combustion Engines. - D:combustion=4.0 - - # modifies the energy provided by ethanol in a Bio Generator. - D:generator=4.0 - } - - biomass { - # modifies the energy provided by Biomass in Biogas Engines. - D:biogas=4.0 - - # modifies the energy provided by Biomass in a Bio Generator. - D:generator=4.0 - } - -} - - -recipe { - - output { - # amount yielded by the recipe for tin cans. - I:can=24 - - # amount yielded by the recipe for wax capsules. - I:capsule=8 - - # amount yielded by the recipe for refractory capsules. - I:refractory=8 - - fertilizer { - # amount of fertilizer yielded by the recipe using apatite. - I:apatite=16 - - # amount of fertilizer yielded by the recipe using ash. - I:ash=32 + # modifies the energy provided by ethanol in a Bio Generator. [range: 0.0 ~ 10.0, default: 4.0] + S:generator=4.0 } - compost { - # amount of compost yielded by the recipe using ash. - I:ash=2 + biomass { + # modifies the energy provided by Biomass in Biogas Engines. [range: 0.0 ~ 10.0, default: 4.0] + S:biogas=4.0 - # amount of compost yielded by the recipe using wheat. - I:wheat=8 + # modifies the energy provided by Biomass in a Bio Generator. [range: 0.0 ~ 10.0, default: 4.0] + S:generator=4.0 } - humus { - # amount of humus yielded by the recipe using compost. - I:compost=8 + } + + recipe { + + output { + # amount yielded by the recipe for tin cans. [range: 0 ~ 64, default: 24] + I:can=24 + + # amount yielded by the recipe for wax capsules. [range: 0 ~ 64, default: 8] + I:capsule=8 + + # amount yielded by the recipe for refractory capsules. [range: 0 ~ 64, default: 8] + I:refractory=8 + + fertilizer { + # amount of fertilizer yielded by the recipe using apatite. [range: 0 ~ 64, default: 16] + I:apatite=16 + + # amount of fertilizer yielded by the recipe using ash. [range: 0 ~ 64, default: 32] + I:ash=32 + } + + compost { + # amount of compost yielded by the recipe using ash. [range: 0 ~ 64, default: 2] + I:ash=2 + + # amount of compost yielded by the recipe using wheat. [range: 0 ~ 64, default: 8] + I:wheat=8 + } + + humus { + # amount of humus yielded by the recipe using compost. [range: 0 ~ 64, default: 8] + I:compost=8 + + # amount of humus yielded by the recipe using fertilizer. [range: 0 ~ 64, default: 8] + I:fertilizer=8 + } + + bogearth { + # amount of bog earth yielded by the recipe using buckets. [range: 0 ~ 64, default: 6] + I:bucket=6 + + # amount of bog earth yielded by the recipes using cans, cells or capsules. [range: 0 ~ 64, default: 8] + I:can=8 + } - # amount of humus yielded by the recipe using fertilizer. - I:fertilizer=8 } - bogearth { - # amount of bog earth yielded by the recipe using buckets. - I:bucket=6 + } - # amount of bog earth yielded by the recipes using cans, cells or capsules. - I:can=8 + fermenter { + + cycles { + # modifies the amount of cycles compost can keep a fermenter going. [range: 0 ~ 2000, default: 1000] + I:compost=1000 + + # modifies the amount of cycles fertilizer can keep a fermenter going. [range: 0 ~ 2000, default: 800] + I:fertilizer=800 + } + + value { + # modifies the amount of biomass per cycle a fermenter will produce using compost. [range: 0 ~ 2000, default: 192] + I:compost=192 + + # modifies the amount of biomass per cycle a fermenter will produce using fertilizer. [range: 0 ~ 2000, default: 224] + I:fertilizer=224 + } + + yield { + # modifies the amount of biomass a piece of cactus will yield in a fermenter. [range: 0 ~ 2000, default: 400] + I:cactus=400 + + # modifies the amount of biomass a piece of sugar cane will yield in a fermenter. [range: 0 ~ 2000, default: 400] + I:cane=400 + + # modifies the amount of biomass a mushroom will yield in a fermenter. [range: 0 ~ 2000, default: 400] + I:mushroom=400 + + # modifies the base amount of biomass a sapling will yield in a fermenter, affected by sappiness trait. [range: 0 ~ 2000, default: 2000] + I:sapling=2000 + + # modifies the amount of biomass a piece of wheat will yield in a fermenter. [range: 0 ~ 2000, default: 400] + I:wheat=400 + } + + } + + squeezer { + + liquid { + # modifies the amount of juice squeezed from a single apple. other sources are based off this. [range: 0 ~ 2000, default: 1600] + I:apple=1600 + + # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. [range: 0 ~ 2000, default: 80] + I:seed=80 + } + + mulch { + # modifies the chance of mulch per squeezed apple. [range: 0 ~ 2000, default: 160] + I:apple=160 } } } - -squeezer { - - liquid { - # modifies the amount of juice squeezed from a single apple. other sources are based off this. - I:apple=1600 - - # modifies the amount of seed oil squeezed from a single seed. other sources are based off this. - I:seed=80 - } - - mulch { - # modifies the chance of mulch per squeezed apple. - I:apple=160 - } - -} - -