SmylerMC / litemapy

Litemapy's goal is to provide an easy to use way to read and edit Litematica's schematic file format
GNU General Public License v3.0
52 stars 6 forks source link

schematic.py blocks, indexerror #3

Closed Anosema closed 3 years ago

Anosema commented 3 years ago

I try to create a schematic like this :

schem = Schematic(25, 25, 25, name="test", main_region_name="test")
reg = schem.regions["test"]
block = BlockState("minecraft:grass_block")

for x in range(25):
    for z in range(25):
        y = random.randint(0,4)
        reg.setblock(x, y, z, block)

But I get an error at x, y, z = 1, 3, 3 :

File "/home/anosema/.local/lib.python3.8/site-packages/litemapy/schematic.py", line 215, in setblock
    self.__blocks[x][y][z] = i
IndexError : list assignment index out of range