Switch to "common" in the build script (I should clean that thing up)
and removing more of my older localization stuff from commands.
This commit is contained in:
parent
0012ef3594
commit
27de3ccb0d
3 changed files with 101 additions and 147 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
<target name="prep">
|
||||
<copy todir="${build.dir.development}\mcp\src\minecraft">
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\ee3_common\" />
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\common\" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue