def testBigEndianIntHeightMap(): """ Test modifying, saving, and loading the new TAG_Int_Array heightmap added with the Anvil format. """ region = RegionFile(TempFile("AnvilWorld/region/r.0.0.mca")) chunk_data = region.readChunkBytes(0, 0) chunk = nbt.load(buf=chunk_data) hm = chunk["Level"]["HeightMap"] hm.value[2] = 500 oldhm = numpy.array(hm.value) filename = mktemp("ChangedChunk") chunk.save(filename) changedChunk = nbt.load(filename) os.unlink(filename) eq = (changedChunk["Level"]["HeightMap"].value == oldhm) assert eq.all()
def testBigEndianIntHeightMap(tmpdir, temp_file): """ Test modifying, saving, and loading the new TAG_Int_Array heightmap added with the Anvil format. """ region = RegionFile(temp_file.strpath) chunk_data = region.readChunkBytes(0, 0) chunk = nbt.load(buf=chunk_data) hm = chunk["Level"]["HeightMap"] hm.value[2] = 500 oldhm = numpy.array(hm.value) filename = tmpdir.join("ChangedChunk").strpath chunk.save(filename) changedChunk = nbt.load(filename) os.unlink(filename) eq = (changedChunk["Level"]["HeightMap"].value == oldhm) assert eq.all()
def testBigEndianIntHeightMap(): """ Test modifying, saving, and loading the new TAG_Int_Array heightmap added with the Anvil format. """ region = RegionFile(TempFile("AnvilWorld/region/r.0.0.mca")) chunk_data = region.readChunkBytes(0, 0) chunk = nbt.load(buf=chunk_data) hm = chunk["Level"]["HeightMap"] hm.value[2] = 500 oldhm = numpy.array(hm.value) filename = mktemp("ChangedChunk") chunk.save(filename) changedChunk = nbt.load(filename) os.unlink(filename) eq = (changedChunk["Level"]["HeightMap"].value == oldhm) assert eq.all()
def testBigEndianIntHeightMap(tmpdir, temp_file): """ Test modifying, saving, and loading the new TAG_Int_Array heightmap added with the Anvil format. """ region = RegionFile(temp_file.strpath) chunk_data = region.readChunkBytes(0, 0) chunk = nbt.load(buf=chunk_data) hm = chunk["Level"]["HeightMap"] hm.value[2] = 500 oldhm = numpy.array(hm.value) filename = tmpdir.join("ChangedChunk").strpath chunk.save(filename) changedChunk = nbt.load(filename) os.unlink(filename) eq = (changedChunk["Level"]["HeightMap"].value == oldhm) assert eq.all()