31
31
("Up offset" , 0 ),
32
32
("Include air" , False ),
33
33
("Include blocks" , True ),
34
+ ("Include null block data" , False ),
34
35
("Include entities" , False ),
35
36
("Include \" gamerule commandBlockOutput false\" command" , True ),
36
37
("Include \" gamerule logAdminCommands false\" command" , True ),
@@ -56,6 +57,7 @@ def perform(level, box, options):
56
57
execution_center = (box .maxx + options ["Forward offset" ] - 1 , box .miny - options ["Up offset" ] + 2 , (box .minz + box .maxz ) // 2 - options ["Left offset" ])
57
58
include_air = options ["Include air" ]
58
59
include_blocks = options ["Include blocks" ]
60
+ include_null_block_data = options ["Include null block data" ]
59
61
include_entities = options ["Include entities" ]
60
62
include_commandblockoutput_command = options ["Include \" gamerule commandBlockOutput false\" command" ]
61
63
include_logadmincommands_command = options ["Include \" gamerule logAdminCommands false\" command" ]
@@ -120,9 +122,12 @@ def perform(level, box, options):
120
122
unformatted_command += ","
121
123
first_element = False
122
124
if volume (cuboid [0 ][0 ], cuboid [0 ][1 ], cuboid [0 ][2 ], cuboid [1 ][0 ], cuboid [1 ][1 ], cuboid [1 ][2 ]) == 1 :
123
- command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" setblock ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " minecraft:air\" } "
125
+ command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" setblock ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " minecraft:air"
124
126
else :
125
- command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" fill ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " ~" + str (cuboid [1 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [1 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [1 ][2 ] + box .minz - execution_center [2 ]) + " minecraft:air\" }"
127
+ command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" fill ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " ~" + str (cuboid [1 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [1 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [1 ][2 ] + box .minz - execution_center [2 ]) + " minecraft:air"
128
+ if include_null_block_data :
129
+ command_part += " 0"
130
+ command_part += "\" }"
126
131
command += "\n \t " + command_part
127
132
unformatted_command += command_part
128
133
@@ -145,10 +150,10 @@ def perform(level, box, options):
145
150
command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" setblock ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " " + materials .block_map [block [0 ]]
146
151
else :
147
152
command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" fill ~" + str (cuboid [0 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [0 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [0 ][2 ] + box .minz - execution_center [2 ]) + " ~" + str (cuboid [1 ][0 ] + box .minx - execution_center [0 ]) + " ~" + str (cuboid [1 ][1 ] + box .miny - execution_center [1 ]) + " ~" + str (cuboid [1 ][2 ] + box .minz - execution_center [2 ]) + " " + materials .block_map [block [0 ]]
148
- if block [1 ] != 0 and block [2 ] is None :
153
+ if include_null_block_data or ( block [1 ] != 0 and block [2 ] is not None ) :
149
154
command_part += " " + str (block [1 ])
150
155
if block [2 ] is not None :
151
- command_part += " " + str ( block [ 1 ]) + " replace " + escape_string (nbt_to_string (block [2 ], nbt_tags_to_ignore ))
156
+ command_part += " replace " + escape_string (nbt_to_string (block [2 ], nbt_tags_to_ignore ))
152
157
command_part += "\" }"
153
158
if block [0 ] not in blocks_to_enqueue :
154
159
if not first_element :
@@ -209,7 +214,10 @@ def perform(level, box, options):
209
214
if not first_element :
210
215
command += ","
211
216
unformatted_command += ","
212
- command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" setblock ~ ~1 ~ minecraft:command_block 0 replace {auto:1b,Command:\\ \" fill ~ ~-3 ~ ~ ~ ~ minecraft:air\\ \" }\" }"
217
+ command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" setblock ~ ~1 ~ minecraft:command_block 0 replace {auto:1b,Command:\\ \" fill ~ ~-3 ~ ~ ~ ~ minecraft:air"
218
+ if include_null_block_data :
219
+ command_part += " 0"
220
+ command_part += "\\ \" }\" }"
213
221
command += "\n \t " + command_part
214
222
unformatted_command += command_part
215
223
command_part = "{id:\" minecraft:commandblock_minecart\" ,Command:\" kill @e[type=minecraft:commandblock_minecart,r=0]\" }\n ]}]}"
0 commit comments