diff --git a/docs/API-Reference.md b/docs/API-Reference.md index d94826c..3a63c2b 100644 --- a/docs/API-Reference.md +++ b/docs/API-Reference.md @@ -371,6 +371,7 @@ Walter Higgins * [Drone Constants](#drone-constants) * [Drone.times() Method](#dronetimes-method) * [Drone.arc() method](#dronearc-method) + * [Drone.bed() method](#dronebed-method) * [Drone.blocktype() method](#droneblocktype-method) * [Copy & Paste using Drone](#copy--paste-using-drone) * [Drone.copy() method](#dronecopy-method) @@ -4416,6 +4417,26 @@ stroke width of 2 blocks ... [bres]: http://en.wikipedia.org/wiki/Midpoint_circle_algorithm [dv]: http://www.minecraftwiki.net/wiki/Data_values +### Drone.bed() method + +Creates a bed. The foot of the bed will be at the drone's location and +the head of the bed will extend away from the drone. + +#### Example +To create a bed at the in-game prompt, look at a block then type: + +```javascript +/js bed() +``` + +Like most Drone methods, this returns the drone so it can be chained like so: + +```javascript +this + .fwd(3) + .bed() + .back(3) +``` ### Drone.blocktype() method Creates the text out of blocks. Useful for large-scale in-game signs. diff --git a/src/main/js/plugins/drone/bed.js b/src/main/js/plugins/drone/bed.js index 702f40d..062fbed 100644 --- a/src/main/js/plugins/drone/bed.js +++ b/src/main/js/plugins/drone/bed.js @@ -2,6 +2,28 @@ /*global require, Packages*/ var Drone = require('./drone').Drone, blocks = require('blocks'); +/************************************************************************ +### Drone.bed() method + +Creates a bed. The foot of the bed will be at the drone's location and +the head of the bed will extend away from the drone. + +#### Example +To create a bed at the in-game prompt, look at a block then type: + +```javascript +/js bed() +``` + +Like most Drone methods, this returns the drone so it can be chained like so: + +```javascript +this + .fwd(3) + .bed() + .back(3) +``` +***/ var bedDirections = { 0:3, // east 1:0, // south