added version to plugin.yml

This commit is contained in:
walterhiggins 2013-10-21 20:24:29 +01:00
parent 6f725423c0
commit 55563a090e
5 changed files with 39 additions and 26 deletions

View file

@ -1 +1 @@
bukkit-version=1.4.7 bukkit-version=1.6.4

View file

@ -1,12 +1,18 @@
<project name="scriptcraft" default="package" basedir="."> <project name="scriptcraft" default="package" basedir=".">
<property file="build.properties"/> <property file="build.properties"/>
<description>Builds the scriptcraft.jar file - a plugin for bukkit <description>Builds the scriptcraft.jar file - a plugin for bukkit</description>
</description>
<property name="src" location="src/main/java"/> <property name="src" location="src/main/java"/>
<property name="build" location="target/classes"/> <property name="build" location="target/classes"/>
<property name="dist" location="target/" /> <property name="dist" location="target/" />
<property name="minecraft.dir" location="${dist}/minecraft" /> <property name="minecraft.dir" location="${dist}/minecraft" />
<property name="http.agent" value="'Walter'" />
<target name="testy">
<echo message="${http.agent}"/>
<get src="http://dl.bukkit.org/api/1.0/downloads/projects/CraftBukkit/?_accept=application/xml"
verbose="true"
httpusecaches="false"
dest="${minecraft.dir}/waltbukkit.xml" />
</target>
<target name="init"> <target name="init">
<property file="build.local.properties"/> <property file="build.local.properties"/>
<tstamp> <tstamp>
@ -23,9 +29,10 @@
unless="minecraft.present"> unless="minecraft.present">
<mkdir dir="${minecraft.dir}" /> <mkdir dir="${minecraft.dir}" />
<echo>Retrieving CraftBukkit artifact info <echo>Retrieving CraftBukkit artifact info</echo>
</echo> <get src="http://dl.bukkit.org/api/1.0/downloads/projects/CraftBukkit/?_accept=application/xml"
<get src="http://dl.bukkit.org/api/1.0/downloads/projects/CraftBukkit?_accept=application/xml" verbose="true"
httpusecaches="false"
dest="${minecraft.dir}/bukkit.xml" /> dest="${minecraft.dir}/bukkit.xml" />
<xslt in="${minecraft.dir}/bukkit.xml" <xslt in="${minecraft.dir}/bukkit.xml"
@ -33,27 +40,20 @@
style="build/bukkit-to-url.xsl"/> style="build/bukkit-to-url.xsl"/>
<xmlproperty file="${minecraft.dir}/ant.properties.xml" keeproot="true"/> <xmlproperty file="${minecraft.dir}/ant.properties.xml" keeproot="true"/>
<echo>Retrieving CraftBukkit jar <echo>Retrieving CraftBukkit jar</echo>
</echo>
<get src="${bukkit.url}" <get src="${bukkit.url}"
dest="${minecraft.dir}/craftbukkit.jar" dest="${minecraft.dir}/craftbukkit.jar"
verbose="true"/> verbose="true"/>
<echo>Creating default ops.txt for your user <echo>Creating default ops.txt for your user</echo>
</echo>
<echo message="${op.name}" file="${minecraft.dir}/ops.txt" /> <echo message="${op.name}" file="${minecraft.dir}/ops.txt" />
</target> </target>
<target name="run" depends="server-setup, package, update-live-cb" description="Starts Bukkit with ScriptCraft"> <target name="run" depends="server-setup, package, update-live-cb" description="Starts Bukkit with ScriptCraft">
<echo>Starting Bukkit with ScriptCraft <echo>Starting Bukkit with ScriptCraft</echo>
</echo> <java jar="${minecraft.dir}/craftbukkit.jar" maxmemory="1024m" fork="true" dir="${minecraft.dir}" />
<java jar="${minecraft.dir}/craftbukkit.jar"
maxmemory="1024m"
fork="true"
dir="${minecraft.dir}"
/>
</target> </target>
<target name="compile" depends="init, server-setup" description="compile bukkit plugin source"> <target name="compile" depends="init, server-setup" description="compile bukkit plugin source">
@ -72,8 +72,7 @@
</target> </target>
<target name="coffeescript_setup" depends="init" description="Gets latest coffeescript compiler"> <target name="coffeescript_setup" depends="init" description="Gets latest coffeescript compiler">
<echo>Retrieving Coffeescript compiler <echo>Retrieving Coffeescript compiler</echo>
</echo>
<mkdir dir="${build}/coffeescript/core" /> <mkdir dir="${build}/coffeescript/core" />
<get src="https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js" <get src="https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js"
dest="${build}/coffeescript/core/_coffeescript.js"/> dest="${build}/coffeescript/core/_coffeescript.js"/>
@ -86,14 +85,12 @@
</zip> </zip>
</target> </target>
<target name="package" depends="gendocs,zip_js,compile" <target name="package" depends="gendocs,zip_js,compile" description="generate the distribution" >
description="generate the distribution" >
<!-- ensure plugin.yml is always copied --> <!-- ensure plugin.yml is always copied -->
<delete file="${build}/plugin.yml" /> <delete file="${build}/plugin.yml" />
<copy file="src/main/resources/plugin.yml" todir="${build}"/> <copy file="src/main/resources/plugin.yml" todir="${build}"/>
<replace file="${build}/plugin.yml" value="${bukkit-version}-${DSTAMP}"> <replace file="${build}/plugin.yml" value="${bukkit-version}-${DSTAMP}">
<replacetoken>[[version]] <replacetoken>[[version]]</replacetoken>
</replacetoken>
</replace> </replace>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->

View file

@ -131,5 +131,9 @@ var global = this;
global.putSign = _putSign; global.putSign = _putSign;
global.notifyAdministrators = _notifyAdministrators; global.notifyAdministrators = _notifyAdministrators;
global.echo = _echo; global.echo = _echo;
/*
wph 20131020 - add 'alert' - behaves just like echo. For programmers familiar with browser-based js
*/
global.alert = _echo;
}()); }());

View file

@ -548,6 +548,7 @@ var server = org.bukkit.Bukkit.server;
return result; return result;
}; };
var _javaLangObjectMethods = ["equals","getClass","class","getClass","hashCode","notify","notifyAll","toString","wait","clone","finalize"]; var _javaLangObjectMethods = ["equals","getClass","class","getClass","hashCode","notify","notifyAll","toString","wait","clone","finalize"];
var _getProperties = function(o) var _getProperties = function(o)
{ {
var result = []; var result = [];
@ -563,7 +564,17 @@ var server = org.bukkit.Bukkit.server;
for (var j = 0;j < _javaLangObjectMethods.length; j++) for (var j = 0;j < _javaLangObjectMethods.length; j++)
if (_javaLangObjectMethods[j] == i) if (_javaLangObjectMethods[j] == i)
continue propertyLoop; continue propertyLoop;
if (typeof o[i] == "function" ) var typeofProperty = null;
try {
typeofProperty = typeof o[i];
}catch( e ){
if (e.message == "java.lang.IllegalStateException: Entity not leashed"){
// wph 20131020 fail silently for Entity leashing in craftbukkit
}else{
throw e;
}
}
if (typeofProperty == "function" )
result.push(i+"()"); result.push(i+"()");
else else
result.push(i); result.push(i);

View file

@ -783,6 +783,7 @@ Used when placing torches so that they face towards the drone.
return result; return result;
}; };
}; };
/************************************************************************** /**************************************************************************
Drone.times() Method Drone.times() Method
==================== ====================