# Convenience method to load a numbered world from the saves folder.
world1 = mclevel.loadWorldNumber(1);
# Find out which chunks are present
chunkPositions = world1.presentChunks
# presentChunks returns a list of tuples (xPos, zPos)
xPos, zPos = chunkPositions;
# retrieve an InfdevChunk object. getChunk is a special method;
# it will load the chunk from disk, decompress it, inflate the NBT structures, and unpack the data arrays for you.
aChunk = world1.getChunk(xPos, zPos)
### Access the data arrays of the chunk like so:
# Fire to Leaves.
aChunk.Blocks[aChunk.Blocks==world.materials.materialNamed("Fire")] = world.materials.materialNamed("Leaves")
That's a bug, and you have the right fix. That codepath is the one for copying directly from one infinite level to another without an intermediate buffer. The functionality isn't exposed anywhere in either program so it never gets used. You might notice it accesses the blocks one by one instead of doing a mass block copy via numpy. This is extraordinarily slow and my dread about rewriting it in numpy is why it's still in such bad shape.
Turns out I'm using an even slower path, nested fors, block for block for now.
I'm trying to do something that would copy a segment from one map to another, perform block replacements with some probability (ie not always) and do other stuff like drop orphan blocks to the ground, so it has to be pretty much block for block. Plus numpy is very confusing to me and I'd like it to be as simple as possible to understand, no matter how slow...
Forgot to thank you for the module btw: thank you =D
I just have an idea to give, hopefully someone will run with it now that there's such a nice library. Make it dump the text off signs? It could just put the coordinates, and the 4 lines of text. I'd love to see all the fun sign text people have made on our server.
I hate it when clueless newbies post begging posts, thus flaunting how clueless and new they are, but:
>>> import mclevel
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
File "C:\Users\bbot\Downloads\pymclevel-20100920\mclevel.py", line 112, in <module>
File "C:\Users\bbot\Downloads\pymclevel-20100920\nbt.py", line 23, in <module>
from numpy import array, zeros, uint8, fromstring
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 136, in <module>
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from type_check import *
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 5, in <module>
ImportError: DLL load failed: The specified module could not be found.
What the hell is happening here? Installing numpy was an enormous pain in the ass, requiring a registry edit, since apparently python doesn't set registry keys right on 64-bit versions of windows? Previously numpy just refused to work at all, but after the registry edit, it didn't install correctly?
Edit: Nevermind, eventually found it, in TileEntities. Just have to construct a new NBT_Compound with the appropriate stuff to add a sign with a message. Thanks again!
(original post follows)
Hey, this is a great package btw - I'm enjoying playing around with it (writing a little converter to load maps from Eschalon into Minecraft). I did have a quick question, though - is there a way to get at (and set) the text on signs? I haven't yet found anything in the API which looks right. Perhaps it's just something I need to do with the block Data structure?
Oh, and I should mention I'm just using the Python API, not the CLI tool.