From 01c8701b68986ccfa83e902515716838d6829311 Mon Sep 17 00:00:00 2001 From: Onyx Date: Tue, 1 Dec 2015 20:55:30 +0000 Subject: - Fixed all of the bugs mentioned on github - Added new config options - Rabbits paw now increases the chance of spawning hearts, rather than itself spawning some - Hearts now have a much lower chance to spawn by default - You can no longer increase your health past 20 hearts (aka double the default health) - The guide now also shows the total number of pages on each tab - A new luck stat has been added to the Curse API - Cleaned up the code a bit (removed unused methods, imports etc) - The displayer's info now has a purple solid color background; the text also has a much closer shadow and now shrinks in height as well as in width when too big - I have modified the potion list to use Mithion's code, credits have been given --- .../darkknight/jewelrycraft/config/ConfigGui.java | 50 +++++++++--------- .../jewelrycraft/config/ConfigGuiFactory.java | 60 +++++++++++----------- .../jewelrycraft/config/ConfigHandler.java | 18 +++++-- 3 files changed, 69 insertions(+), 59 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/config') diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java b/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java index bb40ed8..b337f06 100644 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java @@ -1,26 +1,26 @@ -package darkknight.jewelrycraft.config; - -import cpw.mods.fml.client.config.GuiConfig; -import cpw.mods.fml.client.config.IConfigElement; -import net.minecraft.client.gui.GuiScreen; -import net.minecraftforge.common.config.ConfigElement; -import java.util.ArrayList; -import java.util.List; -import darkknight.jewelrycraft.util.Variables; - -public class ConfigGui extends GuiConfig -{ - public ConfigGui(GuiScreen parent) - { - super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, Variables.MODNAME + " Config"); - } - - @SuppressWarnings ({"rawtypes"}) - private static List getElements() - { - List list = new ArrayList(ConfigHandler.categories.length); - for(String category: ConfigHandler.categories) - list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category))); - return list; - } +package darkknight.jewelrycraft.config; + +import java.util.ArrayList; +import java.util.List; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import darkknight.jewelrycraft.util.Variables; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, Variables.MODNAME + " Config"); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories) + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category))); + return list; + } } \ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java b/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java index d06efc3..31d85a3 100644 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java @@ -1,31 +1,31 @@ -package darkknight.jewelrycraft.config; - -import cpw.mods.fml.client.IModGuiFactory; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import java.util.Set; - -public class ConfigGuiFactory implements IModGuiFactory -{ - @Override - public void initialize(Minecraft minecraftInstance) - {} - - @Override - public Class mainConfigGuiClass() - { - return ConfigGui.class; - } - - @Override - public Set runtimeGuiCategories() - { - return null; - } - - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) - { - return null; - } +package darkknight.jewelrycraft.config; + +import java.util.Set; +import cpw.mods.fml.client.IModGuiFactory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; + +public class ConfigGuiFactory implements IModGuiFactory +{ + @Override + public void initialize(Minecraft minecraftInstance) + {} + + @Override + public Class mainConfigGuiClass() + { + return ConfigGui.class; + } + + @Override + public Set runtimeGuiCategories() + { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) + { + return null; + } } \ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java index 290c8ae..d5431bc 100644 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java @@ -1,11 +1,10 @@ package darkknight.jewelrycraft.config; -import java.io.File; -import net.minecraftforge.common.config.Configuration; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import darkknight.jewelrycraft.util.Variables; +import net.minecraftforge.common.config.Configuration; public class ConfigHandler { @@ -33,6 +32,10 @@ public class ConfigHandler public static int MAX_BLACK_HEARTS_PICKUP; public static int MAX_BLUE_HEARTS_PICKUP; + public static boolean CAN_BLUE_HEARTS_SPAWN; + public static boolean CAN_BLACK_HEARTS_SPAWN; + public static boolean CAN_HOLY_HEARTS_SPAWN; + public static boolean CAN_RED_HEARTS_SPAWN; public static boolean CRYSTAL_GLOW; public static boolean CRYSTAL_PARTICLES; @@ -56,7 +59,8 @@ public class ConfigHandler public static boolean ORE_GEN = true; public static boolean CRYSTAL_GEN = true; public static boolean STRUCTURES[] = {true, true, true, true, true, true}; - + public static int STRUCTURES_SPAWN_CHANCE[] = {6, 5, 7, 10, 6, 10}; + public void loadConfig(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile(),true); @@ -69,7 +73,7 @@ public class ConfigHandler INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); - RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 1000, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end."); + RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 500, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end."); HEART_DESPAWN_TIME = config.getInt( "Hearts Despawn Time", categories[0], 900, 20, Integer.MAX_VALUE, "This sets the number of ticks it takes for hearts to despawn, 20=1 second"); GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); @@ -91,12 +95,18 @@ public class ConfigHandler JEWELRY_INFO = config.getBoolean("Jewelry Info", categories[2], true, "If false, then extra info won't be show when hovering over a jewelery."); MAX_BLACK_HEARTS_PICKUP = config.getInt("Max Black Hearts Pickup", categories[2], Integer.MAX_VALUE, 0, Integer.MAX_VALUE, "Determines how many black hearts can a player pick up."); MAX_BLUE_HEARTS_PICKUP = config.getInt("Max Blue Hearts Pickup", categories[2], Integer.MAX_VALUE, 0, Integer.MAX_VALUE, "Determines how many blue hearts can a player pick up."); + CAN_BLUE_HEARTS_SPAWN = config.getBoolean("Can Blue Hearts Spawn", categories[2], true, "Determines if blue hearts can spawn."); + CAN_BLACK_HEARTS_SPAWN = config.getBoolean("Can Black Hearts Spawn", categories[2], true, "Determines if black hearts can spawn."); + CAN_HOLY_HEARTS_SPAWN = config.getBoolean("Can Holy Hearts Spawn", categories[2], true, "Determines if holy hearts can spawn."); + CAN_RED_HEARTS_SPAWN = config.getBoolean("Can Red Hearts Spawn", categories[2], true, "Determines if red hearts can spawn."); ENABLE_WORLD_GEN = config.getBoolean("World Generation", categories[3], true, "If false, nothing will generate (this includes ore)"); ORE_GEN = config.getBoolean("Ore Generation", categories[3], true, "If false, ores won't generate"); CRYSTAL_GEN = config.getBoolean("Crystal Generation", categories[3], true, "If false, crystals won't generate"); for(int i = 0; i < STRUCTURES.length; i++) STRUCTURES[i] = config.getBoolean("Structure "+(i+1)+" Generation", categories[3], true, "If false, structure no."+(i+1)+" won't generate"); + for(int i = 0; i < STRUCTURES.length; i++) + STRUCTURES_SPAWN_CHANCE[i] = config.getInt("Structure "+(i+1)+" Spawn Chance", categories[3], STRUCTURES_SPAWN_CHANCE[i], 1, Integer.MAX_VALUE, "Determines the chance for structure no."+(i+1)+" to generate. Lower = higher chance and vice versa."); CURSES_ENABLED = config.getBoolean("Curses", categories[4], true, "If set to false curses will be deactivated."); CURSE_ROTTEN_HEART = config.getBoolean("Rotten Heart", categories[4], true, "If set to false this curse will be deactivated."); -- cgit v1.2.3