changed to and tweaked tabcomplete

This commit is contained in:
walterhiggins 2013-01-26 13:47:16 +00:00
parent 460f93ca8d
commit 446ba9ad7b
4 changed files with 6 additions and 6 deletions

View file

@ -97,7 +97,7 @@ the Bukkit ScriptCraft plugin...
* `__plugin` - the ScriptCraft Plugin itself. This is a useful starting point for accessing other Bukkit objects. The `__plugin` object is of type [org.bukkit.plugin.java.JavaPlugin][api] and all of its properties and methods are accessible. For example... `js __plugin.server.motd` returns the server's message of the day (javascript is more concise than the equivalent java code: __plugin.getServer().getMotd() ). * `__plugin` - the ScriptCraft Plugin itself. This is a useful starting point for accessing other Bukkit objects. The `__plugin` object is of type [org.bukkit.plugin.java.JavaPlugin][api] and all of its properties and methods are accessible. For example... `js __plugin.server.motd` returns the server's message of the day (javascript is more concise than the equivalent java code: __plugin.getServer().getMotd() ).
* `self` - The player/command-block or server console operator who invoked the js command. Again, this is a good jumping off point for diving into the Bukkit API. * `self` - The player/command-block or server console operator who invoked the js command. Again, this is a good jumping off point for diving into the Bukkit API.
* `bukkit` - The top-level Bukkit object. See the [Bukkit API docs][bukapi] for reference. * `server` - The top-level org.bukkit.Server object. See the [Bukkit API docs][bukapi] for reference.
[dl]: http://walterhiggins.net/blog/files/scriptcraft/ [dl]: http://walterhiggins.net/blog/files/scriptcraft/
[api]: http://jd.bukkit.org/apidocs/org/bukkit/plugin/java/JavaPlugin.html [api]: http://jd.bukkit.org/apidocs/org/bukkit/plugin/java/JavaPlugin.html

View file

@ -56,7 +56,7 @@ var global = this;
throw new Error("Invalid Parameter: blockId must be 63 or 68"); throw new Error("Invalid Parameter: blockId must be 63 or 68");
putBlock(x,y,z,blockId,meta); putBlock(x,y,z,blockId,meta);
var block = _getBlockObject(x,y,z); var block = _getBlockObject(x,y,z);
state = block.state; var state = block.state;
if (state instanceof org.bukkit.block.Sign){ if (state instanceof org.bukkit.block.Sign){
for (var i = 0;i < texts.length; i++) for (var i = 0;i < texts.length; i++)
state.setLine(i%4,texts[i]); state.setLine(i%4,texts[i]);

View file

@ -23,7 +23,7 @@ var verbose = verbose || false;
/* /*
wph 20130124 - make self, plugin and bukkit public - these are far more useful now that tab-complete works. wph 20130124 - make self, plugin and bukkit public - these are far more useful now that tab-complete works.
*/ */
var bukkit = org.bukkit.Bukkit; var server = org.bukkit.Bukkit.server;
// //
// private implementation // private implementation
// //
@ -241,7 +241,7 @@ var bukkit = org.bukkit.Bukkit;
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") if (typeof o[i] == "function" )
result.push(i+"()"); result.push(i+"()");
else else
result.push(i); result.push(i);

View file

@ -341,7 +341,7 @@ var Drone = Drone || {
} }
var bm = _getBlockIdAndMeta(block); var bm = _getBlockIdAndMeta(block);
block = bm[0]; block = bm[0];
meta = bm[1]; var meta = bm[1];
if (block != 63 && block != 68){ if (block != 63 && block != 68){
print("ERROR: Invalid block id for use in signs"); print("ERROR: Invalid block id for use in signs");
return; return;
@ -653,7 +653,7 @@ var Drone = Drone || {
return [parseInt(bs),0]; return [parseInt(bs),0];
} }
b = parseInt(bs.substring(0,sp)); b = parseInt(bs.substring(0,sp));
md = parseInt(bs.substring(sp+1,bs.length)); var md = parseInt(bs.substring(sp+1,bs.length));
return [b,md]; return [b,md];
}else{ }else{
return [b,0]; return [b,0];