Merge branch 'antscriptupdates' into minecraft1.3

Conflicts:
	build.xml
This commit is contained in:
Christian 2012-07-02 15:21:15 -04:00
commit ecaa158981
2 changed files with 45 additions and 6 deletions

View file

@ -26,7 +26,7 @@
<target name="writeversion" depends="buildenvsetup"> <target name="writeversion" depends="buildenvsetup">
<exec executable="${python.exe}" dir="${basedir}" failonerror="true"> <exec executable="${python.exe}" dir="${basedir}" failonerror="true">
<arg value="${basedir}/getversion.py" /> <arg value="${basedir}/getversion.py" />
<arg value="${mcp.home}"/> <arg value="${mcp.home}" />
</exec> </exec>
<propertyfile file="fmlversion.properties"> <propertyfile file="fmlversion.properties">
<entry key="fmlbuild.build.number" type="int" value="${version.build}"/> <entry key="fmlbuild.build.number" type="int" value="${version.build}"/>
@ -68,7 +68,6 @@
<antcall target="writeversion" /> <antcall target="writeversion" />
<property file="fmlversion.properties" /> <property file="fmlversion.properties" />
<property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" /> <property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" />
<property name="version.minecraft" value="${fmlbuild.mcversion}" />
<property name="version.major" value="${fmlbuild.major.number}" /> <property name="version.major" value="${fmlbuild.major.number}" />
<property name="version.minor" value="${fmlbuild.minor.number}" /> <property name="version.minor" value="${fmlbuild.minor.number}" />
<property name="version.rev" value="${fmlbuild.revision.number}" /> <property name="version.rev" value="${fmlbuild.revision.number}" />
@ -214,4 +213,44 @@
</target> </target>
<target name="setupenvironment" depends="buildenvsetup">
<input message="This will clean the mcp environment at ${mcp.home} and backup any src-work folder there (src-base will be erased). Continue?" validargs="y,n" addproperty="do.continue" />
<condition property="do.not.continue">
<equals arg1="n" arg2="${do.continue}" />
</condition>
<fail if="do.not.continue">You have decided not to continue. This script will stop now.</fail>
<echo>Preparing the MCP environment at ${mcp.home}</echo>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/cleanup.py" />
<arg value="-f" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/decompile.py" />
<arg value="-d" />
<arg value="-n" />
<arg value="-r" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/updatemd5.py" />
<arg value="-f" />
</exec>
<echo>Moving old patched sources at ${mcp.home}/src-work out of the way</echo>
<move todir="${mcp.home}/src-work${timestamp}" failonerror="false" verbose="true">
<fileset dir="${mcp.home}/src-work"/>
</move>
<echo>Deleting old patch references at ${mcp.home}/src-base</echo>
<delete dir="${mcp.home}/src-base" failonerror="false"/>
<echo>Creating new patch references at ${mcp.home}/src-base</echo>
<copy todir="${mcp.home}/src-base">
<fileset dir="${mcp.home}/src"/>
</copy>
<echo>Creating clean patch references at ${mcp.home}/src-work</echo>
<copy todir="${mcp.home}/src-work">
<fileset dir="${mcp.home}/src"/>
</copy>
<antcall target="patch"/>
<antcall target="writeversion"/>
<echo>Setup complete! You should now be able to open ${basedir}/eclipse as a workspace in eclipse and import/refresh the FML-Server and FML-Client projects</echo>
</target>
</project> </project>

View file

@ -34,24 +34,24 @@ public class ProxyInjector
this.bukkitName = bukkitName; this.bukkitName = bukkitName;
this.target = target; this.target = target;
} }
public boolean isValidFor(Side type) public boolean isValidFor(Side type)
{ {
if (type == Side.CLIENT) if (type == Side.CLIENT)
{ {
return !this.clientName.isEmpty(); return !this.clientName.isEmpty();
} }
else if (type == Side.SERVER) else if (type == Side.SERVER)
{ {
return !this.serverName.isEmpty(); return !this.serverName.isEmpty();
} }
else if (type == Side.BUKKIT) else if (type == Side.BUKKIT)
{ {
return this.bukkitName.isEmpty(); return !this.bukkitName.isEmpty();
} }
return false; return false;
} }
public void inject(ModContainer mod, Side side) public void inject(ModContainer mod, Side side)
{ {
String targetType = side == Side.CLIENT ? clientName : serverName; String targetType = side == Side.CLIENT ? clientName : serverName;