From 27de3ccb0d173cfd0361fd7f3acd808bc05f54f5 Mon Sep 17 00:00:00 2001 From: pahimar Date: Sun, 1 Sep 2013 18:40:54 -0400 Subject: [PATCH] Switch to "common" in the build script (I should clean that thing up) and removing more of my older localization stuff from commands. --- build.xml | 192 +++++++++--------- .../pahimar/ee3/command/CommandOverlay.java | 10 +- .../ee3/core/util/LocalizationUtil.java | 46 ----- 3 files changed, 101 insertions(+), 147 deletions(-) delete mode 100644 common/com/pahimar/ee3/core/util/LocalizationUtil.java diff --git a/build.xml b/build.xml index 020890ce..4269a673 100644 --- a/build.xml +++ b/build.xml @@ -1,96 +1,96 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/com/pahimar/ee3/command/CommandOverlay.java b/common/com/pahimar/ee3/command/CommandOverlay.java index 638b6d25..c3e69223 100644 --- a/common/com/pahimar/ee3/command/CommandOverlay.java +++ b/common/com/pahimar/ee3/command/CommandOverlay.java @@ -6,7 +6,6 @@ import net.minecraft.util.ChatMessageComponent; import com.pahimar.ee3.configuration.ConfigurationHandler; import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.LocalizationUtil; import com.pahimar.ee3.lib.Commands; import com.pahimar.ee3.lib.Strings; @@ -92,8 +91,9 @@ public class CommandOverlay { try { float opacity = Float.parseFloat(args[1]); - if (opacity < 0F || opacity > 1F) - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); + if (opacity < 0F || opacity > 1F) { + throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); + } else { ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = opacity; ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME, args[1]); @@ -101,11 +101,11 @@ public class CommandOverlay { } } catch (Exception e) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); } } else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); } private static void processPositionCommand(ICommandSender commandSender, String[] args) { diff --git a/common/com/pahimar/ee3/core/util/LocalizationUtil.java b/common/com/pahimar/ee3/core/util/LocalizationUtil.java deleted file mode 100644 index 44a840b8..00000000 --- a/common/com/pahimar/ee3/core/util/LocalizationUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.pahimar.ee3.core.util; - -import cpw.mods.fml.common.registry.LanguageRegistry; - -/** - * Equivalent-Exchange-3 - * - * LocalizationHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class LocalizationUtil { - - /*** - * Simple test to determine if a specified file name represents a XML file - * or not - * - * @param fileName - * String representing the file name of the file in question - * @return True if the file name represents a XML file, false otherwise - */ - public static boolean isXMLLanguageFile(String fileName) { - - return fileName.endsWith(".xml"); - } - - /*** - * Returns the locale from file name - * - * @param fileName - * String representing the file name of the file in question - * @return String representation of the locale snipped from the file name - */ - public static String getLocaleFromFileName(String fileName) { - - return fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.')); - } - - public static String getLocalizedString(String key) { - - return LanguageRegistry.instance().getStringLocalization(key); - } - -}