Skip to content

Commit 7882d23

Browse files
committed
include more mc blocks
1 parent 3f97181 commit 7882d23

File tree

6 files changed

+228
-15
lines changed

6 files changed

+228
-15
lines changed

blocks/minecraft.js

Lines changed: 158 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,165 @@
1+
Blockly.Blocks.MinecraftBlocks = [
2+
["air","0"],
3+
["bed","26"],
4+
["bedrock invisible","95"],
5+
["bedrock","7"],
6+
["bookshelf","47"],
7+
["brick block","45"],
8+
["cactus","81"],
9+
["carpet black","171,15"],
10+
["carpet blue","171,11"],
11+
["carpet brown","171,12"],
12+
["carpet cyan","171,9"],
13+
["carpet gray","171,7"],
14+
["carpet green","171,13"],
15+
["carpet light blue","171,3"],
16+
["carpet light gray","171,8"],
17+
["carpet lime","171,5"],
18+
["carpet magenta","171,2"],
19+
["carpet orange","171,1"],
20+
["carpet pink","171,6"],
21+
["carpet purple","171,10"],
22+
["carpet red","171,14"],
23+
["carpet white","171"],
24+
["carpet yellow","171,4"],
25+
["chest","54"],
26+
["clay","82"],
27+
["coal block","173"],
28+
["coal ore","16"],
29+
["cobblestone","4"],
30+
["cobweb","30"],
31+
["crafting table","58"],
32+
["diamond block","57"],
33+
["diamond ore","56"],
34+
["dirt","3"],
35+
["door iron","71"],
36+
["door wood","64"],
37+
["double tallgrass","175,2"],
38+
["farmland","60"],
39+
["fence gate","107"],
40+
["fence","85"],
41+
["fire","51"],
42+
["flower cyan","38"],
43+
["flower yellow","37"],
44+
["furnace active","62"],
45+
["furnace inactive","61"],
46+
["glass pane","102"],
47+
["glass","20"],
48+
["glowstone block","89"],
49+
["gold block","41"],
50+
["gold ore","14"],
51+
["grass tall","31"],
52+
["grass","2"],
53+
["gravel","13"],
54+
["hardened clay stained black","159,15"],
55+
["hardened clay stained blue","159,11"],
56+
["hardened clay stained brown","159,12"],
57+
["hardened clay stained cyan","159,9"],
58+
["hardened clay stained gray","159,7"],
59+
["hardened clay stained green","159,13"],
60+
["hardened clay stained light blue","159,3"],
61+
["hardened clay stained light gray","159,8"],
62+
["hardened clay stained lime","159,5"],
63+
["hardened clay stained magenta","159,2"],
64+
["hardened clay stained orange","159,1"],
65+
["hardened clay stained pink","159,6"],
66+
["hardened clay stained purple","159,10"],
67+
["hardened clay stained red","159,14"],
68+
["hardened clay stained white","159"],
69+
["hardened clay stained yellow","159,4"],
70+
["ice","79"],
71+
["iron block","42"],
72+
["iron ore","15"],
73+
["ladder","65"],
74+
["lapis lazuli block","22"],
75+
["lapis lazuli ore","21"],
76+
["large fern","175,3"],
77+
["lava flowing","10"],
78+
["lava stationary","11"],
79+
["leaves birch decayable","18,2"],
80+
["leaves birch permanent","18,6"],
81+
["leaves jungle decayable","18,3"],
82+
["leaves jungle permanent","18,7"],
83+
["leaves oak decayable","18"],
84+
["leaves oak permanent","18,4"],
85+
["leaves spruce decayable","18,1"],
86+
["leaves spruce permanent","18,5"],
87+
["leaves","18"],
88+
["lilac","175,1"],
89+
["melon","103"],
90+
["moss stone","48"],
91+
["mushroom brown","39"],
92+
["mushroom red","40"],
93+
["obsidian","49"],
94+
["peony","175,5"],
95+
["quartz block","155"],
96+
["redstone block","152"],
97+
["redstone lamp active","124"],
98+
["redstone lamp inactive","123"],
99+
["redstone ore","73"],
100+
["rose bush","175,4"],
101+
["sand","12"],
102+
["sandstone","24"],
103+
["sapling","6"],
104+
["sea lantern","169"],
105+
["snow block","80"],
106+
["snow","78"],
107+
["stained glass black","95,15"],
108+
["stained glass blue","95,11"],
109+
["stained glass brown","95,12"],
110+
["stained glass cyan","95,9"],
111+
["stained glass gray","95,7"],
112+
["stained glass green","95,13"],
113+
["stained glass light blue","95,3"],
114+
["stained glass light gray","95,8"],
115+
["stained glass lime","95,5"],
116+
["stained glass magenta","95,2"],
117+
["stained glass orange","95,1"],
118+
["stained glass pink","95,6"],
119+
["stained glass purple","95,10"],
120+
["stained glass red","95,14"],
121+
["stained glass white","95"],
122+
["stained glass yellow","95,4"],
123+
["stairs cobblestone","67"],
124+
["stairs wood","53"],
125+
["stone brick","98"],
126+
["stone button","77"],
127+
["stone slab double","43"],
128+
["stone slab","44"],
129+
["stone","1"],
130+
["sugar cane","83"],
131+
["sunflower","175"],
132+
["TNT","46"],
133+
["torch","50"],
134+
["water flowing","8"],
135+
["water stationary","9"],
136+
["wood button","143"],
137+
["wood planks","5"],
138+
["wood","17"],
139+
["wool black","35,15"],
140+
["wool blue","35,11"],
141+
["wool brown","35,12"],
142+
["wool cyan","35,9"],
143+
["wool gray","35,7"],
144+
["wool green","35,13"],
145+
["wool light blue","35,3"],
146+
["wool light gray","35,8"],
147+
["wool lime","35,5"],
148+
["wool magenta","35,2"],
149+
["wool orange","35,1"],
150+
["wool pink","35,6"],
151+
["wool purple","35,10"],
152+
["wool red","35,14"],
153+
["wool white","35"],
154+
["wool yellow","35,4"]
155+
];
156+
1157
Blockly.Blocks['minecraft_set_block'] = {
2158
init: function() {
3159
this.appendDummyInput()
4160
.appendField("Put");
5161
this.appendDummyInput()
6-
.appendField(new Blockly.FieldDropdown([["air", "0"], ["stone", "1"], ["grass", "2"]]), "BLOCK");
162+
.appendField(new Blockly.FieldDropdown(Blockly.Blocks.MinecraftBlocks), "BLOCK");
7163
this.appendValueInput("x")
8164
.setCheck("Number")
9165
.appendField("at");
@@ -118,7 +274,7 @@ Blockly.Blocks['minecraft_turtle_set_pen'] = {
118274
this.appendDummyInput()
119275
.appendField("and block to");
120276
this.appendDummyInput()
121-
.appendField(new Blockly.FieldDropdown([["air", "0"], ["stone", "1"], ["grass", "2"]]), "BLOCK");
277+
.appendField(new Blockly.FieldDropdown(Blockly.Blocks.MinecraftBlocks), "BLOCK");
122278
this.setInputsInline(true);
123279
this.setPreviousStatement(true);
124280
this.setNextStatement(true);

blocks_compressed.js

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generators/javascript/minecraft.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Blockly.JavaScript.minecraft = function() {
157157
" return;\n"+
158158
" }\n"+
159159
"\n"+
160-
" for (i = 0 ; i < l ; i++) {\n"+
160+
" for (var i = 0 ; i < l ; i++) {\n"+
161161
" var p = MCPI.nib[i];\n"+
162162
" var x = p[0] + x0;\n"+
163163
" var y = p[1] + y0;\n"+

generators/javascript/source/mcinit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ MCPI.drawPoint = function(x0,y0,z0) {
156156
return;
157157
}
158158

159-
for (i = 0 ; i < l ; i++) {
159+
for (var i = 0 ; i < l ; i++) {
160160
var p = MCPI.nib[i];
161161
var x = p[0] + x0;
162162
var y = p[1] + y0;

0 commit comments

Comments
 (0)