Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit 4124347

Browse files
committed
Orange wool converts to air.
1 parent fdaa144 commit 4124347

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

s2b.rb

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# Usage: ruby s2b.rb
33
# This will convert all schematics in the sibling folder "in".
44
# The results will be placed in the folder "out".
5-
# Air and magenta colored wool is ignored.
6-
# If the file name is ending with R5 the z will use a -5 offset
5+
# We ignore air, standing sign, magentawool and (dark) blue wool.
6+
# We convert orange wool to air.
7+
# If the file name is ending with R5 the z will use a -5 offset.
78
#
89
# See: http://www.minecraftwiki.net/wiki/Schematic_File_Format
910
# https://github.com/Wickth/TerrainControll/blob/master/bo2spec.txt
@@ -117,12 +118,20 @@ def stringifyLine(lineArray)
117118
layers.each_with_index do |rows, z|
118119
z += zoffset
119120
rows.each_with_index do |columns, x|
120-
x -= schematic["Width"] / 2 # Center the object on the X axis
121+
# Center the object on the X axis
122+
x -= schematic["Width"] / 2
121123
columns.each_with_index do |(block, data), y|
122-
if block == 0 || block == 63 || (block == 35 && (data == 2 || data == 11)) then # We ignore air, standing sign, magentawool and (dark) blue wool
124+
# We ignore air, standing sign, magentawool and (dark) blue wool.
125+
if block == 0 || block == 63 || (block == 35 && (data == 2 || data == 11)) then
123126
next
124127
end
125-
y -= schematic["Length"] / 2 # Center the object on the Y axis
128+
# We convert orange wool to air.
129+
if block == 35 && data == 1 then
130+
block = 0
131+
data = 0
132+
end
133+
# Center the object on the Y axis
134+
y -= schematic["Length"] / 2
126135
line = [y, x, z, block, data]
127136
if NEEDY_BLOCKS.include?(block)
128137
deferred << line

0 commit comments

Comments
 (0)