Removed underscore from source (it's downloaded) and fixed spawn plugin.

This commit is contained in:
walterhiggins 2014-01-29 23:11:40 +00:00
parent 7ab34980e4
commit 621245adac
4 changed files with 32 additions and 1327 deletions

View File

@ -17,12 +17,14 @@
<mkdir dir="${build}"/>
<available file="${minecraft.dir}" property="minecraft.present"/>
<available file="${dist}/js/modules/underscore.js" property="underscore.present"/>
</target>
<target name="test" depends="package" description="Perform unit tests">
</target>
<target name="server-setup" depends="init" description="Downloads the latest bukkit dev jar"
unless="minecraft.present">
<mkdir dir="${minecraft.dir}" />
@ -131,26 +133,39 @@ Walter Higgins
<target name="zip_js" depends="zip_lib, zip_modules, zip_plugins">
</target>
<target name="zip_lib" depends="init">
<target name="copy_js" depends="init">
<copy todir="${dist}/js">
<fileset dir="src/main/js"/>
</copy>
</target>
<target name="zip_lib" depends="copy_js">
<delete file="${build}/lib.zip"/>
<zip destfile="${build}/lib.zip"
basedir="./src/main/js"
basedir="${dist}/js"
excludes="modules/**, plugins/**,">
</zip>
</target>
<target name="zip_modules" depends="init">
<target name="get_underscore" depends="copy_js" unless="underscore.present">
<!-- download underscore -->
<get src="http://underscorejs.org/underscore.js"
verbose="true"
dest="${dist}/js/modules/underscore.js"/>
</target>
<target name="zip_modules" depends="copy_js, get_underscore">
<delete file="${build}/modules.zip"/>
<zip destfile="${build}/modules.zip"
basedir="./src/main/js"
basedir="${dist}/js"
excludes="lib/**, plugins/**,">
</zip>
</target>
<target name="zip_plugins" depends="init">
<target name="zip_plugins" depends="copy_js">
<delete file="${build}/plugins.zip"/>
<zip destfile="${build}/plugins.zip"
basedir="./src/main/js"
basedir="${dist}/js"
excludes="lib/**, modules/**">
</zip>
</target>
@ -169,6 +184,7 @@ Walter Higgins
<mkdir dir="${dist}/${DSTAMP}" />
<jar jarfile="${dist}/${DSTAMP}/scriptcraft.jar" basedir="${build}"/>
<copy file="${dist}/${DSTAMP}/scriptcraft.jar" tofile="${dist}/scriptcraft.jar"/>
</target>
<target name="clean" description="clean up" >

View File

@ -1,4 +0,0 @@
{
name: 'underscore',
main: './underscore.js'
}

File diff suppressed because it is too large Load Diff

View File

@ -19,9 +19,12 @@ for a list of possible entities (creatures) which can be spawned.
var entities = [],
EntityType = org.bukkit.entity.EntityType;
for ( var t in EntityType ) {
if ( EntityType[t] && EntityType[t].ordinal ) {
entities.push(t);
var MaterialEnum = Packages.MaterialEnum;
var entitytypes = EntityType.values();
for ( var t in entitytypes ) {
if ( entitytypes[t] && entitytypes[t].ordinal ) {
entities.push(entitytypes[t].name());
}
}
command( 'spawn', function( parameters, sender ) {
@ -30,6 +33,10 @@ command( 'spawn', function( parameters, sender ) {
return;
}
var location = sender.location;
if ( !location ) {
sender.sendMessage( 'You have no location. This command only works in-game.' );
return;
}
var world = location.world;
var type = ('' + parameters[0]).toUpperCase();
world.spawnEntity( location, EntityType[type] );