diff --git a/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java b/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java index 8bcd86d9..5606ce4c 100644 --- a/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java +++ b/ee3_common/ee3/common/core/handlers/ConfigurationHandler.java @@ -26,6 +26,7 @@ import static net.minecraftforge.common.Configuration.*; public class ConfigurationHandler { private static final String CATEGORY_KEYBIND = "keybinds"; + private static final String CATEGORY_GRAPHICS = "graphics"; public static void init(File configFile) { Configuration configuration = new Configuration(configFile); @@ -35,14 +36,11 @@ public class ConfigurationHandler { /* General Configs */ ConfigurationSettings.ENABLE_VERSION_CHECK = configuration - .get(CATEGORY_GENERAL, Reference.ENABLE_VERSION_CHECK, ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT) + .get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_VERSION_CHECK_CONFIGNAME, ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT) .getBoolean(ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT); ConfigurationSettings.ENABLE_SOUNDS = configuration - .get(CATEGORY_GENERAL, Reference.ENABLE_SOUNDS, ConfigurationSettings.ENABLE_SOUNDS_DEFAULT) + .get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, ConfigurationSettings.ENABLE_SOUNDS_DEFAULT) .getBoolean(ConfigurationSettings.ENABLE_SOUNDS_DEFAULT); - ConfigurationSettings.ENABLE_PARTICLE_FX = configuration - .get(CATEGORY_GENERAL, Reference.ENABLE_PARTICLE_FX, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT) - .getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT); ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST = configuration .get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT) .getInt(ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT); @@ -50,9 +48,17 @@ public class ConfigurationHandler { .get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT) .getInt(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT); + /* Graphics/Rendering Configs */ + ConfigurationSettings.ENABLE_PARTICLE_FX = configuration + .get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT) + .getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT); + ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE = configuration + .get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE_CONFIGNAME, ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE_DEFAULT) + .getBoolean(ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE_DEFAULT); + /* Block Configs */ ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS = configuration - .get(CATEGORY_BLOCK, Reference.AUTO_RESOLVE_BLOCK_IDS, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT) + .get(CATEGORY_BLOCK, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_CONFIGNAME, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT) .getBoolean(ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT); BlockIds.CALCINATOR = configuration .getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT) diff --git a/ee3_common/ee3/common/core/handlers/RenderTickHandler.java b/ee3_common/ee3/common/core/handlers/RenderTickHandler.java index b58c79cd..06445703 100644 --- a/ee3_common/ee3/common/core/handlers/RenderTickHandler.java +++ b/ee3_common/ee3/common/core/handlers/RenderTickHandler.java @@ -23,7 +23,7 @@ import ee3.client.core.handlers.DrawBlockHighlightHandler; import ee3.client.core.helper.RenderUtils; import ee3.common.core.helper.TransmutationHelper; import ee3.common.core.helper.VersionHelper; -import ee3.common.item.ItemPhilosopherStone; +import ee3.common.item.ITransmutationStone; import ee3.common.lib.ConfigurationSettings; import ee3.common.lib.Reference; @@ -46,7 +46,7 @@ public class RenderTickHandler implements ITickHandler { currentItemStack = player.inventory.getCurrentItem(); } - if ((player != null) && (currentItemStack != null) && (minecraft.inGameHasFocus) && (currentItemStack.getItem() instanceof ItemPhilosopherStone) && (ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE)) { + if ((player != null) && (currentItemStack != null) && (minecraft.inGameHasFocus) && (currentItemStack.getItem() instanceof ITransmutationStone) && (ConfigurationSettings.ENABLE_OVERLAY_PHILOSOPHER_STONE)) { renderStoneHUD(minecraft, player, currentItemStack, (Float) tickData[0]); } } @@ -66,9 +66,9 @@ public class RenderTickHandler implements ITickHandler { private static void renderStoneHUD(Minecraft minecraft, EntityPlayer player, ItemStack stack, float partialTicks) { - float overlayScale = 2F; + float overlayScale = 2F; // TODO config option float blockScale = overlayScale / 2; - float overlayOpacity = 1F; + float overlayOpacity = 1F; // TODO config option MovingObjectPosition rayTrace = minecraft.objectMouseOver; ItemStack currentBlock = null; diff --git a/ee3_common/ee3/common/lib/ConfigurationSettings.java b/ee3_common/ee3/common/lib/ConfigurationSettings.java index f2c9bee9..aee106eb 100644 --- a/ee3_common/ee3/common/lib/ConfigurationSettings.java +++ b/ee3_common/ee3/common/lib/ConfigurationSettings.java @@ -13,40 +13,48 @@ import ee3.common.item.ModItems; */ public class ConfigurationSettings { - /* + /* * General configuration settings */ // Whether or not automatic block id resolution for EE3 is turned on or off public static boolean AUTO_RESOLVE_BLOCK_IDS; + public static final String ENABLE_VERSION_CHECK_CONFIGNAME = "enable_version_check"; public static final boolean AUTO_RESOLVE_BLOCK_IDS_DEFAULT = false; - + // Whether or not EE3 sounds are enabled public static boolean ENABLE_SOUNDS; + public static final String ENABLE_SOUNDS_CONFIGNAME = "enable_sounds"; public static final boolean ENABLE_SOUNDS_DEFAULT = true; - - // Whether or not EE3 particle fx are enabled - public static boolean ENABLE_PARTICLE_FX; - public static final boolean ENABLE_PARTICLE_FX_DEFAULT = true; - + // Whether or not EE3 will do a version check when loaded public static boolean ENABLE_VERSION_CHECK; + public static final String AUTO_RESOLVE_BLOCK_IDS_CONFIGNAME = "auto_resolve_block_ids"; public static final boolean ENABLE_VERSION_CHECK_DEFAULT = true; - + + /* + * Render config settings + */ + // Whether or not EE3 particle fx are enabled + public static boolean ENABLE_PARTICLE_FX; + public static final String ENABLE_PARTICLE_FX_CONFIGNAME = "enable_particle_fx"; + public static final boolean ENABLE_PARTICLE_FX_DEFAULT = true; + // Whether or not the Philosopher Stone overlay is enabled - // TODO Do a proper overlay toggle that is saved between sessions - public static boolean ENABLE_OVERLAY_PHILOSOPHER_STONE = false; - - /* + public static boolean ENABLE_OVERLAY_PHILOSOPHER_STONE; + public static final String ENABLE_OVERLAY_PHILOSOPHER_STONE_CONFIGNAME = "enable_philosopher_stone_overlay"; + public static final boolean ENABLE_OVERLAY_PHILOSOPHER_STONE_DEFAULT = true; + + /* * Minium stone config settings */ // The durability cost for each transmute with the Minium Stone public static int MINIUM_STONE_TRANSMUTE_COST; public static final String MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".transmuteCost"; public static final int MINIUM_STONE_TRANSMUTE_COST_DEFAULT = 1; - + // The maximum durability for the Minium Stone public static int MINIUM_STONE_MAX_DURABILITY; public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".maxDurability"; public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521; - + } diff --git a/ee3_common/ee3/common/lib/Reference.java b/ee3_common/ee3/common/lib/Reference.java index e5ef090e..a6e5c761 100644 --- a/ee3_common/ee3/common/lib/Reference.java +++ b/ee3_common/ee3/common/lib/Reference.java @@ -24,12 +24,6 @@ public class Reference { public static final String SERVER_PROXY_CLASS = "ee3.common.core.CommonProxy"; public static final String CLIENT_PROXY_CLASS = "ee3.client.core.ClientProxy"; - /* Configuration related constants */ - public static final String ENABLE_VERSION_CHECK = "enable_version_check"; - public static final String ENABLE_SOUNDS = "enable_sounds"; - public static final String ENABLE_PARTICLE_FX = "enable_particle_fx"; - public static final String AUTO_RESOLVE_BLOCK_IDS = "auto_resolve_block_ids"; - /* KeyBinding related constants */ public static final String KEYBINDING_EXTRA = "key.extra"; public static final int KEYBINDING_EXTRA_DEFAULT = 46;