correctly set materials for extracted schematics (.materials= doesn't do it)
This commit is contained in:
parent
ba96a653af
commit
b82b617f8b
@ -139,9 +139,9 @@ class MCSchematic (EntityLevel):
|
|||||||
""" shape is (x,y,z) for a new level's shape. if none, takes
|
""" shape is (x,y,z) for a new level's shape. if none, takes
|
||||||
root_tag as a TAG_Compound for an existing schematic file. if
|
root_tag as a TAG_Compound for an existing schematic file. if
|
||||||
none, tries to read the tag from filename. if none, results
|
none, tries to read the tag from filename. if none, results
|
||||||
are undefined. materials can be a MCMaterials instance, or
|
are undefined. materials can be a MCMaterials instance, or one of
|
||||||
"Classic" or "Alpha" to indicate allowable blocks. The default is
|
"Classic", "Alpha", "Pocket" to indicate allowable blocks. The default
|
||||||
Alpha.
|
is Alpha.
|
||||||
|
|
||||||
block coordinate order in the file is y,z,x to use the same code as classic/indev levels.
|
block coordinate order in the file is y,z,x to use the same code as classic/indev levels.
|
||||||
in hindsight, this was a completely arbitrary decision.
|
in hindsight, this was a completely arbitrary decision.
|
||||||
@ -497,8 +497,7 @@ def extractSchematicFromIter(sourceLevel, box, entities=True):
|
|||||||
return
|
return
|
||||||
newbox, destPoint = p
|
newbox, destPoint = p
|
||||||
|
|
||||||
tempSchematic = MCSchematic(shape=box.size)
|
tempSchematic = MCSchematic(shape=box.size, mats=sourceLevel.materials)
|
||||||
tempSchematic.materials = sourceLevel.materials
|
|
||||||
for i in tempSchematic.copyBlocksFromIter(sourceLevel, newbox, destPoint, entities=entities):
|
for i in tempSchematic.copyBlocksFromIter(sourceLevel, newbox, destPoint, entities=entities):
|
||||||
yield i
|
yield i
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user