Skip to content

Commit 207d922

Browse files
committed
Fix issue #243 and autoindent blocks.js
1 parent f35fd11 commit 207d922

3 files changed

Lines changed: 40 additions & 47 deletions

File tree

src/docs/js/generateTOC.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,3 @@ for (var i = 0; i < contents.length; i++){
4848
java.lang.System.out.println(' * [' + h3 + '](#' + link + ')');
4949
}
5050
}
51-
52-
/**
53-
* // tg 20161022 Sort secondary topics, with some exceptions
54-
* // Still work in progress. Ignore
55-
* var sortedContents =[];
56-
* var sortedTemp = [];
57-
*
58-
* for (var i = 0; i < contents.length; i++) {
59-
* line = contents[i];
60-
* if(line.match(/^##\s+/)) {
61-
* if (sortedTemp.length > 0) {
62-
* sortedContents.push(sortedTemp.sort());
63-
* sortedContents.push(line);
64-
* } else {
65-
* if (line.match(/^###\s+/)) {
66-
* sortedTemp.push(line);
67-
* } else {
68-
* sortedContents.push(line);
69-
* }
70-
* }
71-
* }
72-
* contents = sortedContents;
73-
*/

src/main/js/modules/blocks.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ var blocks = {
7979
sandstone_red: 181,,
8080
sandstone_red_smooth: '181:8',
8181
wooden: '43:2',
82-
wood: {
83-
oak: 125,
84-
spruce: '125:1',
85-
birch: '125:2',
86-
jungle: '125:3',
87-
acacia: '125:4',
88-
dark_oak: '125:5'
89-
},
82+
wood: {
83+
oak: 125,
84+
spruce: '125:1',
85+
birch: '125:2',
86+
jungle: '125:3',
87+
acacia: '125:4',
88+
dark_oak: '125:5'
89+
},
9090
cobblestone: '43:3',
9191
brick: '43:4',
9292
stonebrick: '43:5',
@@ -120,17 +120,17 @@ var blocks = {
120120
spruce: '126:9',
121121
birch: '126:10',
122122
jungle: '126:11',
123-
acacia: '126:12',
124-
dark_oak: '126:13'
123+
acacia: '126:12',
124+
dark_oak: '126:13'
125125
},
126126
snow: 78,
127127
stone: 44,
128128
oak: 126,
129129
spruce: '126:1',
130130
birch: '126:2',
131131
jungle: '126:3',
132-
acacia: '126:4',
133-
dark_oak: '126:5'
132+
acacia: '126:4',
133+
dark_oak: '126:5'
134134
sandstone_red: 182,
135135
purpur: 205,
136136
},
@@ -153,8 +153,8 @@ var blocks = {
153153
birch: 135,
154154
jungle: 136,
155155
quartz: 156,
156-
acacia: 163,
157-
dark_oak: 164,
156+
acacia: 163,
157+
dark_oak: 164,
158158
sandstone_red: 180,
159159
purpur: 203,
160160
},
@@ -300,7 +300,7 @@ var blocks = {
300300
dandelion: 37,
301301
rose: 38,
302302
red: 38,
303-
poppy: 38,
303+
poppy: 38,
304304
blueorchid: '38:1',
305305
allium: '38:2',
306306
azure_bluet: '38:3',
@@ -352,11 +352,11 @@ for (var i = 0, len = colorized_blocks.length; i < len; i++) {
352352
};
353353

354354
/*
355-
rainbow colors - a convenience
356-
Color aliased properties that were a direct descendant of the blocks
357-
object are no longer used to avoid confusion with carpet and stained
358-
clay blocks.
359-
*/
355+
rainbow colors - a convenience
356+
Color aliased properties that were a direct descendant of the blocks
357+
object are no longer used to avoid confusion with carpet and stained
358+
clay blocks.
359+
*/
360360
blocks.rainbow = [
361361
blocks.stained_glass.red,
362362
blocks.stained_glass.orange,

src/main/js/modules/drone/index.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Alternatively if you provide just a function as a parameter, then the function n
208208
209209
// submitted by [edonaldson][edonaldson]
210210
var Drone = require('drone');
211-
Drone.extend('pyramid', function( block,height) {
211+
Drone.extend('pyramid', function( block, height ) {
212212
this.chkpt('pyramid');
213213
for ( var i = height; i > 0; i -= 2) {
214214
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
219219
#### Example 2 Using just a named function as a parameter
220220
221221
var Drone = require('drone');
222-
function pyramid( block,height) {
222+
function pyramid( block, height ) {
223223
this.chkpt('pyramid');
224224
for ( var i = height; i > 0; i -= 2) {
225225
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:
277277
278278
drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[(drone.dir + 2) % 4]);
279279
280+
#### Drone.MAX_SIDE
281+
282+
Specifies the maximum length (in any dimension) when calling the Drone.cuboidX (box) method.
283+
The default value is 1,000 blocks.
284+
285+
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.
286+
287+
#### Drone.MAX_VOLUME
288+
289+
Specifies the maximum value for any call to Drone.cuboidX (box) method.
290+
The default value is 1,000,000 (1 million) blocks.
291+
292+
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!` .
293+
294+
The values of both the `Drone.MAX_SiDE` and `Drone.MAX_VOLUME` variables _can_ be overridden but it's not recommended.
295+
280296
***/
281297

282298
//
@@ -656,7 +672,7 @@ Drone.prototype.cuboida = function(/* Array */ blocks, w, h, d, overwrite) {
656672
Drone.MAX_VOLUME = 1 * MILLION;
657673
Drone.MAX_SIDE = 1 * THOUSAND;
658674

659-
var tooBig = function(w, h, d ) {
675+
function isTooBig(w, h, d ) {
660676
return ( w * h * d ) >= Drone.MAX_VOLUME ||
661677
( w >= Drone.MAX_SIDE ) ||
662678
( h >= Drone.MAX_SIDE ) ||
@@ -677,7 +693,7 @@ Drone.prototype.cuboidX = function( blockType, meta, w, h, d, immediate ) {
677693
if ( typeof w == 'undefined' ) {
678694
w = 1;
679695
}
680-
if ( tooBig( w, h, d ) ) {
696+
if ( isTooBig( w, h, d ) ) {
681697
this.sign([
682698
'Build too Big!',
683699
'width:' + w,

0 commit comments

Comments
 (0)