Fix issue #243 and autoindent blocks.js

This commit is contained in:
Walter Higgins 2016-12-23 09:17:59 +00:00
parent f35fd111fb
commit 207d922767
3 changed files with 40 additions and 47 deletions

View file

@ -48,26 +48,3 @@ for (var i = 0; i < contents.length; i++){
java.lang.System.out.println(' * [' + h3 + '](#' + link + ')');
}
}
/**
* // tg 20161022 Sort secondary topics, with some exceptions
* // Still work in progress. Ignore
* var sortedContents =[];
* var sortedTemp = [];
*
* for (var i = 0; i < contents.length; i++) {
* line = contents[i];
* if(line.match(/^##\s+/)) {
* if (sortedTemp.length > 0) {
* sortedContents.push(sortedTemp.sort());
* sortedContents.push(line);
* } else {
* if (line.match(/^###\s+/)) {
* sortedTemp.push(line);
* } else {
* sortedContents.push(line);
* }
* }
* }
* contents = sortedContents;
*/

View file

@ -79,14 +79,14 @@ var blocks = {
sandstone_red: 181,,
sandstone_red_smooth: '181:8',
wooden: '43:2',
wood: {
oak: 125,
spruce: '125:1',
birch: '125:2',
jungle: '125:3',
acacia: '125:4',
dark_oak: '125:5'
},
wood: {
oak: 125,
spruce: '125:1',
birch: '125:2',
jungle: '125:3',
acacia: '125:4',
dark_oak: '125:5'
},
cobblestone: '43:3',
brick: '43:4',
stonebrick: '43:5',
@ -120,8 +120,8 @@ var blocks = {
spruce: '126:9',
birch: '126:10',
jungle: '126:11',
acacia: '126:12',
dark_oak: '126:13'
acacia: '126:12',
dark_oak: '126:13'
},
snow: 78,
stone: 44,
@ -129,8 +129,8 @@ var blocks = {
spruce: '126:1',
birch: '126:2',
jungle: '126:3',
acacia: '126:4',
dark_oak: '126:5'
acacia: '126:4',
dark_oak: '126:5'
sandstone_red: 182,
purpur: 205,
},
@ -153,8 +153,8 @@ var blocks = {
birch: 135,
jungle: 136,
quartz: 156,
acacia: 163,
dark_oak: 164,
acacia: 163,
dark_oak: 164,
sandstone_red: 180,
purpur: 203,
},
@ -300,7 +300,7 @@ var blocks = {
dandelion: 37,
rose: 38,
red: 38,
poppy: 38,
poppy: 38,
blueorchid: '38:1',
allium: '38:2',
azure_bluet: '38:3',
@ -352,11 +352,11 @@ for (var i = 0, len = colorized_blocks.length; i < len; i++) {
};
/*
rainbow colors - a convenience
Color aliased properties that were a direct descendant of the blocks
object are no longer used to avoid confusion with carpet and stained
clay blocks.
*/
rainbow colors - a convenience
Color aliased properties that were a direct descendant of the blocks
object are no longer used to avoid confusion with carpet and stained
clay blocks.
*/
blocks.rainbow = [
blocks.stained_glass.red,
blocks.stained_glass.orange,

View file

@ -208,7 +208,7 @@ Alternatively if you provide just a function as a parameter, then the function n
// submitted by [edonaldson][edonaldson]
var Drone = require('drone');
Drone.extend('pyramid', function( block,height) {
Drone.extend('pyramid', function( block, height ) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {
this.box(block, i, 1, i).up().right().fwd();
@ -219,7 +219,7 @@ Alternatively if you provide just a function as a parameter, then the function n
#### Example 2 Using just a named function as a parameter
var Drone = require('drone');
function pyramid( block,height) {
function pyramid( block, height ) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {
this.box(block, i, 1, i).up().right().fwd();
@ -277,6 +277,22 @@ If you want to place a torch so it faces _away_ from the drone:
drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[(drone.dir + 2) % 4]);
#### Drone.MAX_SIDE
Specifies the maximum length (in any dimension) when calling the Drone.cuboidX (box) method.
The default value is 1,000 blocks.
If you see an error message in the console `Build too big!` It's because the width, height or length paramete was greater than the Drone.MAX_SIDE value.
#### Drone.MAX_VOLUME
Specifies the maximum value for any call to Drone.cuboidX (box) method.
The default value is 1,000,000 (1 million) blocks.
If the volume (width X height X length) of any single call to the Drone.cuboidX() method exceeds this value, you will see an error message in the console `Build too big!` .
The values of both the `Drone.MAX_SiDE` and `Drone.MAX_VOLUME` variables _can_ be overridden but it's not recommended.
***/
//
@ -656,7 +672,7 @@ Drone.prototype.cuboida = function(/* Array */ blocks, w, h, d, overwrite) {
Drone.MAX_VOLUME = 1 * MILLION;
Drone.MAX_SIDE = 1 * THOUSAND;
var tooBig = function(w, h, d ) {
function isTooBig(w, h, d ) {
return ( w * h * d ) >= Drone.MAX_VOLUME ||
( w >= Drone.MAX_SIDE ) ||
( h >= Drone.MAX_SIDE ) ||
@ -677,7 +693,7 @@ Drone.prototype.cuboidX = function( blockType, meta, w, h, d, immediate ) {
if ( typeof w == 'undefined' ) {
w = 1;
}
if ( tooBig( w, h, d ) ) {
if ( isTooBig( w, h, d ) ) {
this.sign([
'Build too Big!',
'width:' + w,