moved drone buildings/add-ons to drone/contrib folder
This commit is contained in:
parent
3f2e5e2c73
commit
1eb6756204
13 changed files with 67 additions and 65 deletions
90
docs/api.md
90
docs/api.md
|
@ -219,6 +219,51 @@ There are a couple of special javascript variables available in ScriptCraft...
|
||||||
* server - The Minecraft Server object.
|
* server - The Minecraft Server object.
|
||||||
* self - the current player. (Note - this value should not be used in multi-threaded scripts - it's not thread-safe)
|
* self - the current player. (Note - this value should not be used in multi-threaded scripts - it's not thread-safe)
|
||||||
|
|
||||||
|
Drone.spiral_stairs() method
|
||||||
|
============================
|
||||||
|
Constructs a spiral staircase with slabs at each corner.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
|
||||||
|
* stairBlock - The block to use for stairs, should be one of the following...
|
||||||
|
- 'oak'
|
||||||
|
- 'spruce'
|
||||||
|
- 'birch'
|
||||||
|
- 'jungle'
|
||||||
|
- 'cobblestone'
|
||||||
|
- 'brick'
|
||||||
|
- 'stone'
|
||||||
|
- 'nether'
|
||||||
|
- 'sandstone'
|
||||||
|
- 'quartz'
|
||||||
|
* flights - The number of flights of stairs to build.
|
||||||
|
|
||||||
|
![Spiral Staircase](img/spiralstair1.png)
|
||||||
|
|
||||||
|
Example
|
||||||
|
-------
|
||||||
|
To construct a spiral staircase 5 floors high made of oak...
|
||||||
|
|
||||||
|
spiral_stairs('oak', 5);
|
||||||
|
|
||||||
|
Drone.rainbow() method
|
||||||
|
======================
|
||||||
|
Creates a Rainbow.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
|
||||||
|
* radius (optional - default:18) - The radius of the rainbow
|
||||||
|
|
||||||
|
Example
|
||||||
|
-------
|
||||||
|
|
||||||
|
var d = new Drone();
|
||||||
|
d.rainbow(30);
|
||||||
|
|
||||||
|
![rainbow example](img/rainbowex1.png)
|
||||||
|
|
||||||
Drone Module
|
Drone Module
|
||||||
============
|
============
|
||||||
The Drone is a convenience class for building. It can be used for...
|
The Drone is a convenience class for building. It can be used for...
|
||||||
|
@ -815,34 +860,6 @@ Used when placing torches so that they face towards the drone.
|
||||||
|
|
||||||
drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[drone.dir]);
|
drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[drone.dir]);
|
||||||
|
|
||||||
Drone.spiral_stairs() method
|
|
||||||
============================
|
|
||||||
Constructs a spiral staircase with slabs at each corner.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
|
|
||||||
* stairBlock - The block to use for stairs, should be one of the following...
|
|
||||||
- 'oak'
|
|
||||||
- 'spruce'
|
|
||||||
- 'birch'
|
|
||||||
- 'jungle'
|
|
||||||
- 'cobblestone'
|
|
||||||
- 'brick'
|
|
||||||
- 'stone'
|
|
||||||
- 'nether'
|
|
||||||
- 'sandstone'
|
|
||||||
- 'quartz'
|
|
||||||
* flights - The number of flights of stairs to build.
|
|
||||||
|
|
||||||
![Spiral Staircase](img/spiralstair1.png)
|
|
||||||
|
|
||||||
Example
|
|
||||||
-------
|
|
||||||
To construct a spiral staircase 5 floors high made of oak...
|
|
||||||
|
|
||||||
spiral_stairs('oak', 5);
|
|
||||||
|
|
||||||
Drone.sphere() method
|
Drone.sphere() method
|
||||||
=====================
|
=====================
|
||||||
Creates a sphere.
|
Creates a sphere.
|
||||||
|
@ -957,23 +974,6 @@ To create a 2-line high message using glowstone...
|
||||||
|
|
||||||
[imgbt1]: img/blocktype1.png
|
[imgbt1]: img/blocktype1.png
|
||||||
|
|
||||||
Drone.rainbow() method
|
|
||||||
======================
|
|
||||||
Creates a Rainbow.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
|
|
||||||
* radius (optional - default:18) - The radius of the rainbow
|
|
||||||
|
|
||||||
Example
|
|
||||||
-------
|
|
||||||
|
|
||||||
var d = new Drone();
|
|
||||||
d.rainbow(30);
|
|
||||||
|
|
||||||
![rainbow example](img/rainbowex1.png)
|
|
||||||
|
|
||||||
events Module
|
events Module
|
||||||
=============
|
=============
|
||||||
The Events module provides a thin wrapper around Bukkit's
|
The Events module provides a thin wrapper around Bukkit's
|
||||||
|
|
|
@ -223,7 +223,7 @@ There are a couple of special javascript variables available in ScriptCraft...
|
||||||
***/
|
***/
|
||||||
|
|
||||||
var global = this;
|
var global = this;
|
||||||
var verbose = verbose || false;
|
var verbose = true; //verbose || false;
|
||||||
/*
|
/*
|
||||||
wph 20130124 - make self, plugin and server public - these are far more useful now that tab-complete works.
|
wph 20130124 - make self, plugin and server public - these are far more useful now that tab-complete works.
|
||||||
*/
|
*/
|
||||||
|
@ -325,14 +325,19 @@ var server = org.bukkit.Bukkit.server;
|
||||||
b = _canonize(b);
|
b = _canonize(b);
|
||||||
var aparts = (""+a).split(/\//);
|
var aparts = (""+a).split(/\//);
|
||||||
var bparts = (""+b).split(/\//);
|
var bparts = (""+b).split(/\//);
|
||||||
var adir = aparts[aparts.length-2];
|
//var adir = aparts[aparts.length-2];
|
||||||
|
var adir = aparts.slice(0,aparts.length-1).join("/");
|
||||||
var afile = aparts[aparts.length-1];
|
var afile = aparts[aparts.length-1];
|
||||||
var bdir = bparts[bparts.length-2];
|
//var bdir = bparts[bparts.length-2];
|
||||||
|
var bdir = bparts.slice(0,bparts.length-1).join("/");
|
||||||
var bfile = bparts[bparts.length-1];
|
var bfile = bparts[bparts.length-1];
|
||||||
|
|
||||||
if(adir<bdir) return -1;
|
if(adir<bdir) return -1;
|
||||||
if(adir>bdir) return 1;
|
if(adir>bdir) return 1;
|
||||||
if (afile.indexOf(adir) == 0)
|
|
||||||
|
afile = afile.match(/[a-zA-Z0-9\-_]+/)[0];
|
||||||
|
|
||||||
|
if (adir.match(new RegExp(afile + "$")))
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -616,17 +621,17 @@ var server = org.bukkit.Bukkit.server;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Unload Handlers
|
Unload Handlers
|
||||||
*/
|
*/
|
||||||
var unloadHandlers = [];
|
var unloadHandlers = [];
|
||||||
var _addUnloadHandler = function(f) {
|
var _addUnloadHandler = function(f) {
|
||||||
unloadHandlers.push(f);
|
unloadHandlers.push(f);
|
||||||
}
|
}
|
||||||
var _runUnloadHandlers = function() {
|
var _runUnloadHandlers = function() {
|
||||||
for (var i = 0; i < unloadHandlers.length; i++) {
|
for (var i = 0; i < unloadHandlers.length; i++) {
|
||||||
unloadHandlers[i]();
|
unloadHandlers[i]();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.load = _load;
|
global.load = _load;
|
||||||
global.save = _save;
|
global.save = _save;
|
||||||
|
@ -658,7 +663,7 @@ var server = org.bukkit.Bukkit.server;
|
||||||
save(pluginData.module.store, jsPluginsRootDirName + "/" + moduleName + "-store.txt");
|
save(pluginData.module.store, jsPluginsRootDirName + "/" + moduleName + "-store.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
_runUnloadHandlers();
|
_runUnloadHandlers();
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
load(__folder + "drone.js");
|
|
||||||
//
|
//
|
||||||
// Constructs the JS logo
|
// Constructs the JS logo
|
||||||
// https://raw.github.com/voodootikigod/logo.js/master/js.png
|
// https://raw.github.com/voodootikigod/logo.js/master/js.png
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
load(__folder + "../utils/text.js");
|
|
||||||
/*
|
/*
|
||||||
Define the signs module - signs are persistent
|
Define the signs module - signs are persistent
|
||||||
(that is - a menu sign will still be a menu after th
|
(that is - a menu sign will still be a menu after th
|
||||||
|
@ -35,7 +33,7 @@ var signs = signs || plugin("signs", {
|
||||||
if (offset+i < optLen)
|
if (offset+i < optLen)
|
||||||
text = p_displayOptions[offset+i];
|
text = p_displayOptions[offset+i];
|
||||||
if (offset+i == p_selectedIndex)
|
if (offset+i == p_selectedIndex)
|
||||||
text = ("" + text).replace(/^ /,">".white());
|
text = ("" + text).replace(/^ /,">");
|
||||||
p_sign.setLine(i+1,text);
|
p_sign.setLine(i+1,text);
|
||||||
}
|
}
|
||||||
p_sign.update(true);
|
p_sign.update(true);
|
||||||
|
|
Reference in a new issue