documentation for fireworks module
This commit is contained in:
parent
1114c3750f
commit
2e283dcd39
3 changed files with 66 additions and 2 deletions
31
docs/api.md
31
docs/api.md
|
@ -1166,6 +1166,37 @@ To unregister a listener *outside* of the listener function...
|
|||
[buk2]: http://wiki.bukkit.org/Event_API_Reference
|
||||
[buk]: http://jd.bukkit.org/dev/apidocs/index.html?org/bukkit/event/Event.html
|
||||
|
||||
Fireworks Module
|
||||
================
|
||||
The fireworks module makes it easy to create fireworks using
|
||||
ScriptCraft. The module has a single function `firework` which takes
|
||||
a `org.bukkit.Location` as its 1 and only parameter.
|
||||
|
||||
Examples
|
||||
--------
|
||||
The module also extends the `Drone` object adding a `firework` method
|
||||
so that fireworks can be created as a part of a Drone chain. For
|
||||
Example....
|
||||
|
||||
/js firework()
|
||||
|
||||
... creates a single firework, while ....
|
||||
|
||||
/js firework.fwd(3).times(5)
|
||||
|
||||
... creates 5 fireworks in a row. Fireworks have also been added as a
|
||||
possible option for the `arrow` module. To have a firework launch
|
||||
where an arrow strikes...
|
||||
|
||||
/js arrows.firework()
|
||||
|
||||
To call the fireworks.firework() function directly, you must provide a
|
||||
location. For example...
|
||||
|
||||
/js fireworks.firework(self.location);
|
||||
|
||||
![firework example][img/firework.png)
|
||||
|
||||
http.request() function
|
||||
====================
|
||||
The http.request() function will fetch a web address asynchronously (on a
|
||||
|
|
BIN
docs/img/firework.png
Normal file
BIN
docs/img/firework.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
|
@ -1,3 +1,36 @@
|
|||
/************************************************************************
|
||||
Fireworks Module
|
||||
================
|
||||
The fireworks module makes it easy to create fireworks using
|
||||
ScriptCraft. The module has a single function `firework` which takes
|
||||
a `org.bukkit.Location` as its 1 and only parameter.
|
||||
|
||||
Examples
|
||||
--------
|
||||
The module also extends the `Drone` object adding a `firework` method
|
||||
so that fireworks can be created as a part of a Drone chain. For
|
||||
Example....
|
||||
|
||||
/js firework()
|
||||
|
||||
... creates a single firework, while ....
|
||||
|
||||
/js firework.fwd(3).times(5)
|
||||
|
||||
... creates 5 fireworks in a row. Fireworks have also been added as a
|
||||
possible option for the `arrow` module. To have a firework launch
|
||||
where an arrow strikes...
|
||||
|
||||
/js arrows.firework()
|
||||
|
||||
To call the fireworks.firework() function directly, you must provide a
|
||||
location. For example...
|
||||
|
||||
/js fireworks.firework(self.location);
|
||||
|
||||
![firework example][img/firework.png)
|
||||
|
||||
***/
|
||||
plugin("fireworks", {
|
||||
/*
|
||||
create a firework at the given location
|
||||
|
@ -31,9 +64,9 @@ plugin("fireworks", {
|
|||
var c1 = getColor(r1i);
|
||||
var c2 = getColor(r2i);
|
||||
var effectBuilder = FireworkEffect.builder()
|
||||
.flicker(true)
|
||||
.flicker(Math.round(Math.random()==0)
|
||||
.withColor(c1)
|
||||
.withFade(c2).trail(true);
|
||||
.withFade(c2).trail(Math.round(Math.random()==0);
|
||||
effectBuilder['with'](type);
|
||||
var effect = effectBuilder.build();
|
||||
fwm.addEffect(effect);
|
||||
|
|
Reference in a new issue