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
192
build.xml
192
build.xml
|
@ -1,96 +1,96 @@
|
|||
<?xml version="1.0" ?>
|
||||
<project name="Equivalent Exchange 3" default="build">
|
||||
|
||||
<property file="build.properties" prefix="build"/>
|
||||
<property file="build_number.properties" prefix="build_number"/>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="${build.dir.development}\mcp\src\minecraft\mcmod.info" />
|
||||
<delete dir="${build.dir.development}\mcp\src\minecraft\com\pahimar" />
|
||||
<delete dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
</target>
|
||||
|
||||
<target name="increment_build_number">
|
||||
<propertyfile file="build_number.properties">
|
||||
<entry key="build_number" type="int" operation="+" default="1"/>
|
||||
</propertyfile>
|
||||
</target>
|
||||
|
||||
<target name="prep">
|
||||
<copy todir="${build.dir.development}\mcp\src\minecraft">
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\ee3_common\" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="replace_tokens">
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@VERSION@" value="${build.release.mod.version}" />
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@FINGERPRINT@" value="${build.release.mod.fingerprint}" />
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@BUILD_NUMBER@" value="${build_number.build_number}" />
|
||||
</target>
|
||||
|
||||
<target name="recompile">
|
||||
<exec dir="${build.dir.development}\mcp" executable="cmd" osfamily="windows">
|
||||
<arg line="/c recompile.bat" />
|
||||
</exec>
|
||||
<exec dir="${build.dir.development}\mcp" executable="bash" osfamily="unix">
|
||||
<arg line="recompile.sh" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="reobfuscate">
|
||||
<exec dir="${build.dir.development}\mcp" executable="cmd" osfamily="windows">
|
||||
<arg line="/c reobfuscate_srg.bat" />
|
||||
</exec>
|
||||
<exec dir="${build.dir.development}\mcp" executable="bash" osfamily="unix">
|
||||
<arg line="reobfuscate_srg.sh" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="sign_jar">
|
||||
<signjar jar="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar" keystore="${build.keystore.location}" alias="${build.keystore.alias}" storepass="${build.keystore.password}" />
|
||||
</target>
|
||||
|
||||
<target name="build">
|
||||
<!-- Prep for the build -->
|
||||
<antcall target="clean" />
|
||||
<antcall target="increment_build_number" />
|
||||
<antcall target="prep" />
|
||||
<antcall target="recompile" />
|
||||
<antcall target="reobfuscate" />
|
||||
|
||||
<!-- Build the jar -->
|
||||
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
|
||||
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar">
|
||||
<fileset dir="${build.dir.development}\mcp\src\minecraft\" includes="mcmod.info" />
|
||||
<fileset dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\resources" excludes="**/xcf/**" />
|
||||
</jar>
|
||||
|
||||
<!-- Clean up the MCP source now that we are done -->
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="release">
|
||||
<!-- Prep for the build -->
|
||||
<antcall target="clean" />
|
||||
<antcall target="increment_build_number" />
|
||||
<antcall target="prep" />
|
||||
<antcall target="replace_tokens" />
|
||||
<antcall target="recompile" />
|
||||
<antcall target="reobfuscate" />
|
||||
|
||||
<!-- Build the jar -->
|
||||
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
|
||||
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar">
|
||||
<fileset dir="${build.dir.development}\mcp\src\minecraft\" includes="mcmod.info" />
|
||||
<fileset dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\resources" excludes="**/xcf/**" />
|
||||
</jar>
|
||||
|
||||
<!-- Sign the finished jar -->
|
||||
<antcall target="sign_jar" />
|
||||
|
||||
<!-- Clean up the MCP source now that we are done -->
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
</project>
|
||||
<?xml version="1.0" ?>
|
||||
<project name="Equivalent Exchange 3" default="build">
|
||||
|
||||
<property file="build.properties" prefix="build"/>
|
||||
<property file="build_number.properties" prefix="build_number"/>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="${build.dir.development}\mcp\src\minecraft\mcmod.info" />
|
||||
<delete dir="${build.dir.development}\mcp\src\minecraft\com\pahimar" />
|
||||
<delete dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
</target>
|
||||
|
||||
<target name="increment_build_number">
|
||||
<propertyfile file="build_number.properties">
|
||||
<entry key="build_number" type="int" operation="+" default="1"/>
|
||||
</propertyfile>
|
||||
</target>
|
||||
|
||||
<target name="prep">
|
||||
<copy todir="${build.dir.development}\mcp\src\minecraft">
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\common\" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="replace_tokens">
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@VERSION@" value="${build.release.mod.version}" />
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@FINGERPRINT@" value="${build.release.mod.fingerprint}" />
|
||||
<replace dir="${build.dir.development}\mcp\src\minecraft" token="@BUILD_NUMBER@" value="${build_number.build_number}" />
|
||||
</target>
|
||||
|
||||
<target name="recompile">
|
||||
<exec dir="${build.dir.development}\mcp" executable="cmd" osfamily="windows">
|
||||
<arg line="/c recompile.bat" />
|
||||
</exec>
|
||||
<exec dir="${build.dir.development}\mcp" executable="bash" osfamily="unix">
|
||||
<arg line="recompile.sh" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="reobfuscate">
|
||||
<exec dir="${build.dir.development}\mcp" executable="cmd" osfamily="windows">
|
||||
<arg line="/c reobfuscate_srg.bat" />
|
||||
</exec>
|
||||
<exec dir="${build.dir.development}\mcp" executable="bash" osfamily="unix">
|
||||
<arg line="reobfuscate_srg.sh" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="sign_jar">
|
||||
<signjar jar="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar" keystore="${build.keystore.location}" alias="${build.keystore.alias}" storepass="${build.keystore.password}" />
|
||||
</target>
|
||||
|
||||
<target name="build">
|
||||
<!-- Prep for the build -->
|
||||
<antcall target="clean" />
|
||||
<antcall target="increment_build_number" />
|
||||
<antcall target="prep" />
|
||||
<antcall target="recompile" />
|
||||
<antcall target="reobfuscate" />
|
||||
|
||||
<!-- Build the jar -->
|
||||
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
|
||||
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar">
|
||||
<fileset dir="${build.dir.development}\mcp\src\minecraft\" includes="mcmod.info" />
|
||||
<fileset dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\resources" excludes="**/xcf/**" />
|
||||
</jar>
|
||||
|
||||
<!-- Clean up the MCP source now that we are done -->
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="release">
|
||||
<!-- Prep for the build -->
|
||||
<antcall target="clean" />
|
||||
<antcall target="increment_build_number" />
|
||||
<antcall target="prep" />
|
||||
<antcall target="replace_tokens" />
|
||||
<antcall target="recompile" />
|
||||
<antcall target="reobfuscate" />
|
||||
|
||||
<!-- Build the jar -->
|
||||
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
|
||||
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\ee3-universal-${build.release.mod.version}-${build_number.build_number}.jar">
|
||||
<fileset dir="${build.dir.development}\mcp\src\minecraft\" includes="mcmod.info" />
|
||||
<fileset dir="${build.dir.development}\mcp\reobf\minecraft" />
|
||||
<fileset dir="${build.dir.development}\source\Equivalent-Exchange-3\resources" excludes="**/xcf/**" />
|
||||
</jar>
|
||||
|
||||
<!-- Sign the finished jar -->
|
||||
<antcall target="sign_jar" />
|
||||
|
||||
<!-- Clean up the MCP source now that we are done -->
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
</project>
|
||||
|
|
|
@ -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