Moving some stuff around
This commit is contained in:
parent
9eb828d842
commit
ef2ed87bc9
4 changed files with 38 additions and 30 deletions
|
@ -26,6 +26,7 @@ import static net.minecraftforge.common.Configuration.*;
|
||||||
public class ConfigurationHandler {
|
public class ConfigurationHandler {
|
||||||
|
|
||||||
private static final String CATEGORY_KEYBIND = "keybinds";
|
private static final String CATEGORY_KEYBIND = "keybinds";
|
||||||
|
private static final String CATEGORY_GRAPHICS = "graphics";
|
||||||
|
|
||||||
public static void init(File configFile) {
|
public static void init(File configFile) {
|
||||||
Configuration configuration = new Configuration(configFile);
|
Configuration configuration = new Configuration(configFile);
|
||||||
|
@ -35,14 +36,11 @@ public class ConfigurationHandler {
|
||||||
|
|
||||||
/* General Configs */
|
/* General Configs */
|
||||||
ConfigurationSettings.ENABLE_VERSION_CHECK = configuration
|
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);
|
.getBoolean(ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT);
|
||||||
ConfigurationSettings.ENABLE_SOUNDS = configuration
|
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);
|
.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
|
ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST = configuration
|
||||||
.get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT)
|
.get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT)
|
||||||
.getInt(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)
|
.get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT)
|
||||||
.getInt(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 */
|
/* Block Configs */
|
||||||
ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS = configuration
|
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);
|
.getBoolean(ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT);
|
||||||
BlockIds.CALCINATOR = configuration
|
BlockIds.CALCINATOR = configuration
|
||||||
.getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT)
|
.getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT)
|
||||||
|
|
|
@ -23,7 +23,7 @@ import ee3.client.core.handlers.DrawBlockHighlightHandler;
|
||||||
import ee3.client.core.helper.RenderUtils;
|
import ee3.client.core.helper.RenderUtils;
|
||||||
import ee3.common.core.helper.TransmutationHelper;
|
import ee3.common.core.helper.TransmutationHelper;
|
||||||
import ee3.common.core.helper.VersionHelper;
|
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.ConfigurationSettings;
|
||||||
import ee3.common.lib.Reference;
|
import ee3.common.lib.Reference;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class RenderTickHandler implements ITickHandler {
|
||||||
currentItemStack = player.inventory.getCurrentItem();
|
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]);
|
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) {
|
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 blockScale = overlayScale / 2;
|
||||||
float overlayOpacity = 1F;
|
float overlayOpacity = 1F; // TODO config option
|
||||||
|
|
||||||
MovingObjectPosition rayTrace = minecraft.objectMouseOver;
|
MovingObjectPosition rayTrace = minecraft.objectMouseOver;
|
||||||
ItemStack currentBlock = null;
|
ItemStack currentBlock = null;
|
||||||
|
|
|
@ -13,40 +13,48 @@ import ee3.common.item.ModItems;
|
||||||
*/
|
*/
|
||||||
public class ConfigurationSettings {
|
public class ConfigurationSettings {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* General configuration settings
|
* General configuration settings
|
||||||
*/
|
*/
|
||||||
// Whether or not automatic block id resolution for EE3 is turned on or off
|
// Whether or not automatic block id resolution for EE3 is turned on or off
|
||||||
public static boolean AUTO_RESOLVE_BLOCK_IDS;
|
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;
|
public static final boolean AUTO_RESOLVE_BLOCK_IDS_DEFAULT = false;
|
||||||
|
|
||||||
// Whether or not EE3 sounds are enabled
|
// Whether or not EE3 sounds are enabled
|
||||||
public static boolean ENABLE_SOUNDS;
|
public static boolean ENABLE_SOUNDS;
|
||||||
|
public static final String ENABLE_SOUNDS_CONFIGNAME = "enable_sounds";
|
||||||
public static final boolean ENABLE_SOUNDS_DEFAULT = true;
|
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
|
// Whether or not EE3 will do a version check when loaded
|
||||||
public static boolean ENABLE_VERSION_CHECK;
|
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;
|
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
|
// 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;
|
||||||
public static boolean ENABLE_OVERLAY_PHILOSOPHER_STONE = false;
|
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
|
* Minium stone config settings
|
||||||
*/
|
*/
|
||||||
// The durability cost for each transmute with the Minium Stone
|
// The durability cost for each transmute with the Minium Stone
|
||||||
public static int MINIUM_STONE_TRANSMUTE_COST;
|
public static int MINIUM_STONE_TRANSMUTE_COST;
|
||||||
public static final String MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".transmuteCost";
|
public static final String MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".transmuteCost";
|
||||||
public static final int MINIUM_STONE_TRANSMUTE_COST_DEFAULT = 1;
|
public static final int MINIUM_STONE_TRANSMUTE_COST_DEFAULT = 1;
|
||||||
|
|
||||||
// The maximum durability for the Minium Stone
|
// The maximum durability for the Minium Stone
|
||||||
public static int MINIUM_STONE_MAX_DURABILITY;
|
public static int MINIUM_STONE_MAX_DURABILITY;
|
||||||
public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".maxDurability";
|
public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".maxDurability";
|
||||||
public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521;
|
public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,6 @@ public class Reference {
|
||||||
public static final String SERVER_PROXY_CLASS = "ee3.common.core.CommonProxy";
|
public static final String SERVER_PROXY_CLASS = "ee3.common.core.CommonProxy";
|
||||||
public static final String CLIENT_PROXY_CLASS = "ee3.client.core.ClientProxy";
|
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 */
|
/* KeyBinding related constants */
|
||||||
public static final String KEYBINDING_EXTRA = "key.extra";
|
public static final String KEYBINDING_EXTRA = "key.extra";
|
||||||
public static final int KEYBINDING_EXTRA_DEFAULT = 46;
|
public static final int KEYBINDING_EXTRA_DEFAULT = 46;
|
||||||
|
|
Loading…
Reference in a new issue