This commit is contained in:
Marcel Konrad
2018-02-05 17:31:55 +01:00
parent cc0f1e43b6
commit 9ba0331404
167 changed files with 18034 additions and 6 deletions

View File

@@ -0,0 +1,45 @@
package exopandora.worldhandler.config;
import java.util.HashMap;
import java.util.Map;
import exopandora.worldhandler.helper.EntityHelper;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ConfigButcher
{
private static Map<String, Boolean> ENTITIES = new HashMap<String, Boolean>();
public static final String CATEGORY = "butcher";
public static void load(Configuration config)
{
for(ResourceLocation location : EntityList.ENTITY_EGGS.keySet())
{
String entity = EntityHelper.getEntityName(location);
String translationKey = "entity." + entity + ".name";
String translation = I18n.format(translationKey);
if(!translation.equals(translationKey))
{
ENTITIES.put(entity, config.getBoolean(entity, CATEGORY, false, I18n.format("gui.worldhandler.config.comment.butcher", translation), translationKey));
}
}
if(config.hasChanged())
{
config.save();
}
}
public static Map<String, Boolean> getEntitiyMap()
{
return ENTITIES;
}
}

View File

@@ -0,0 +1,129 @@
package exopandora.worldhandler.config;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ConfigSettings
{
private static boolean BIOME_INDICATOR;
private static boolean COMMAND_SYNTAX;
private static boolean SHORTCUTS;
private static boolean SHORTCUT_KEYS;
private static boolean TOOLTIPS;
private static boolean WATCH;
private static boolean SMOOTH_WATCH;
private static boolean PAUSE;
private static boolean CUSTOM_TIMES;
private static boolean PERMISSION_QEURY;
private static int DAWN;
private static int NOON;
private static int SUNSET;
private static int MIDNIGHT;
private static String BLOCK_PLACING_MODE;
public static final String CATEGORY = "settings";
public static void load(Configuration config)
{
BIOME_INDICATOR = config.getBoolean("biome_indicator", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.biome_indicator"), "gui.worldhandler.config.key.settings.biome_indicator");
COMMAND_SYNTAX = config.getBoolean("command_syntax", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.command_syntax"), "gui.worldhandler.config.key.settings.command_syntax");
SHORTCUTS = config.getBoolean("shortcuts", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.shortcuts"), "gui.worldhandler.config.key.settings.shortcuts");
SHORTCUT_KEYS = config.getBoolean("key_shortcuts", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.key_shortcuts"), "gui.worldhandler.config.key.settings.key_shortcuts");
TOOLTIPS = config.getBoolean("tooltips", CATEGORY, true, I18n.format("gui.worldhandler.config.comment.settings.tooltips"), "gui.worldhandler.config.key.settings.tooltips");
WATCH = config.getBoolean("watch", CATEGORY, true, I18n.format("gui.worldhandler.config.comment.settings.watch"), "gui.worldhandler.config.key.settings.watch");
SMOOTH_WATCH = config.getBoolean("smooth_watch", CATEGORY, true, I18n.format("gui.worldhandler.config.comment.settings.smooth_watch"), "gui.worldhandler.config.key.settings.smooth_watch");
PAUSE = config.getBoolean("pause_game", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.pause_game"), "gui.worldhandler.config.key.settings.pause_game");
CUSTOM_TIMES = config.getBoolean("custom_times", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.settings.custom_times"), "gui.worldhandler.config.key.settings.custom_times");
PERMISSION_QEURY = config.getBoolean("permission_query", CATEGORY, true, I18n.format("gui.worldhandler.config.comment.settings.permission_query"), "gui.worldhandler.config.key.settings.permission_query");
DAWN = config.getInt("custom_time_dawn", CATEGORY, 1000, 0, 24000, I18n.format("gui.worldhandler.config.comment.settings.custom_time_dawn"), "gui.worldhandler.config.key.settings.custom_time_dawn");
NOON = config.getInt("custom_time_noon", CATEGORY, 6000, 0, 24000, I18n.format("gui.worldhandler.config.comment.settings.custom_time_noon"), "gui.worldhandler.config.key.settings.custom_time_noon");
SUNSET = config.getInt("custom_time_sunset", CATEGORY, 12500, 0, 24000, I18n.format("gui.worldhandler.config.comment.settings.custom_time_sunset"), "gui.worldhandler.config.key.settings.custom_time_sunset");
MIDNIGHT = config.getInt("custom_time_midnight", CATEGORY, 18000, 0, 24000, I18n.format("gui.worldhandler.config.comment.settings.custom_time_midnight"), "gui.worldhandler.config.key.settings.custom_time_midnight");
BLOCK_PLACING_MODE = config.getString("block_placing_mode", CATEGORY, "keep", I18n.format("gui.worldhandler.config.comment.settings.block_placing_mode"), new String[]{"keep", "replace", "destroy"}, "gui.worldhandler.config.key.settings.block_placing_mode");
if(config.hasChanged())
{
config.save();
}
}
public static boolean isBiomeIndicatorEnabled()
{
return BIOME_INDICATOR;
}
public static boolean isCommandSyntaxEnabled()
{
return COMMAND_SYNTAX;
}
public static boolean areShortcutsEnabled()
{
return SHORTCUTS;
}
public static boolean arePosShortcutsEnabled()
{
return SHORTCUT_KEYS;
}
public static boolean areTooltipsEnabled()
{
return TOOLTIPS;
}
public static boolean isWatchEnabled()
{
return WATCH;
}
public static boolean isSmoothWatchEnabled()
{
return SMOOTH_WATCH;
}
public static boolean isPauseEnabled()
{
return PAUSE;
}
public static boolean isCustomTimeEnabled()
{
return CUSTOM_TIMES;
}
public static boolean isPermissionQueryEnabled()
{
return PERMISSION_QEURY;
}
public static int getDawn()
{
return DAWN;
}
public static int getNoon()
{
return NOON;
}
public static int getSunset()
{
return SUNSET;
}
public static int getMidnight()
{
return MIDNIGHT;
}
public static String getMode()
{
return BLOCK_PLACING_MODE;
}
}

View File

@@ -0,0 +1,127 @@
package exopandora.worldhandler.config;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ConfigSkin
{
private static int ICON_SIZE;
private static int LABEL_COLOR;
private static int HEADLINE_COLOR;
private static int BACKGROUND_RED;
private static int BACKGROUND_GREEN;
private static int BACKGROUND_BLUE;
private static int BACKGROUND_ALPHA;
private static int BUTTON_RED;
private static int BUTTON_GREEN;
private static int BUTTON_BLUE;
private static int BUTTON_ALPHA;
private static String TYPE;
private static boolean SHARP_EDGES;
private static boolean DRAW_BACKGROUND;
public static final String CATEGORY = "skin";
public static void load(Configuration config)
{
ICON_SIZE = Integer.valueOf(config.getString("icon_size", CATEGORY, "16", I18n.format("gui.worldhandler.config.comment.skin.icons"), new String[]{"16", "32", "64"}, "gui.worldhandler.config.key.skin.icons"));
LABEL_COLOR = config.getInt("label_color", CATEGORY, 0x1F1F1F, 0x80000000, 0x7FFFFFFF, I18n.format("gui.worldhandler.config.comment.skin.label_color"), "gui.worldhandler.config.key.skin.label_color");
HEADLINE_COLOR = config.getInt("headline_color", CATEGORY, 0x4F4F4F, 0x80000000, 0x7FFFFFFF, I18n.format("gui.worldhandler.config.comment.skin.headline_color"), "gui.worldhandler.config.key.skin.headline_color");
BACKGROUND_RED = config.getInt("background_red", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.background_red"), "gui.worldhandler.config.key.skin.background_red");
BACKGROUND_GREEN = config.getInt("background_green", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.background_green"), "gui.worldhandler.config.key.skin.background_green");
BACKGROUND_BLUE = config.getInt("background_blue", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.background_blue"), "gui.worldhandler.config.key.skin.background_blue");
BACKGROUND_ALPHA = config.getInt("background_alpha", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.background_alpha"), "gui.worldhandler.config.key.skin.background_alpha");
BUTTON_RED = config.getInt("button_red", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.button_red"), "gui.worldhandler.config.key.skin.button_red");
BUTTON_GREEN = config.getInt("button_green", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.button_green"), "gui.worldhandler.config.key.skin.button_green");
BUTTON_BLUE = config.getInt("button_blue", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.button_blue"), "gui.worldhandler.config.key.skin.button_blue");
BUTTON_ALPHA = config.getInt("button_alpha", CATEGORY, 255, 0, 255, I18n.format("gui.worldhandler.config.comment.skin.button_alpha"), "gui.worldhandler.config.key.skin.button_alpha");
TYPE = config.getString("textures", CATEGORY, "resourcepack", I18n.format("gui.worldhandler.config.comment.skin.textures"), new String[]{"resourcepack", "vanilla"}, "gui.worldhandler.config.key.skin.textures");
SHARP_EDGES = config.getBoolean("sharp_tab_edges", CATEGORY, false, I18n.format("gui.worldhandler.config.comment.skin.sharp_tab_edges"), "gui.worldhandler.config.key.skin.sharp_tab_edges");
DRAW_BACKGROUND = config.getBoolean("draw_background", CATEGORY, true, I18n.format("gui.worldhandler.config.comment.skin.draw_background"), "gui.worldhandler.config.key.skin.draw_background");
if(config.hasChanged())
{
config.save();
}
}
public static int getIconSize()
{
return ICON_SIZE;
}
public static int getLabelColor()
{
return LABEL_COLOR;
}
public static int getHeadlineColor()
{
return HEADLINE_COLOR;
}
public static int getBackgroundRed()
{
return BACKGROUND_RED;
}
public static int getBackgroundGreen()
{
return BACKGROUND_GREEN;
}
public static int getBackgroundBlue()
{
return BACKGROUND_BLUE;
}
public static int getButtonRed()
{
return BUTTON_RED;
}
public static int getButtonGreen()
{
return BUTTON_GREEN;
}
public static int getButtonBlue()
{
return BUTTON_BLUE;
}
public static String getTextureType()
{
return TYPE;
}
public static boolean areSharpEdgesEnabled()
{
return SHARP_EDGES;
}
public static boolean isBackgroundDrawingEnabled()
{
return DRAW_BACKGROUND;
}
public static int getBackgroundAlpha()
{
return BACKGROUND_ALPHA;
}
public static int getButtonAlpha()
{
return BUTTON_ALPHA;
}
}