David Vierra
6cde2003f4
Fixed: Log the exception in materials.py when pkg_resources fails to load a yaml file.
2012-10-29 21:51:44 -10:00
David Vierra
03c6baa42d
Add dist/ to .gitignore
2012-10-29 21:50:57 -10:00
David Vierra
c62bc969d3
Build: Merge setup_nbt.py into setup.py.
...
Now you can run `setup.py build_ext --inplace` to build _nbt for testing.
2012-10-29 21:50:39 -10:00
David Vierra
7b3a5995b2
nbt: gunzip calls GzipFile now instead of zlib.decompress.
...
Removed gunzip/zlib workaround used for Primordial Desert. This was causing some uncompressed NBT files to fail to load.
2012-10-29 18:21:08 -10:00
David Vierra
2712e297ee
Refactor: Clean up imports in nbt and _nbt
2012-10-29 18:19:06 -10:00
David Vierra
5b5f3999cb
Test: Move the extended HeightMap test from mcr_test to anvil_test and give it a better name.
...
This test only checks that the TAG_Int_Array-type HeightMap's byte order gets swapped correctly when saving and loading.
2012-10-29 16:37:54 -10:00
David Vierra
b0f7d59e29
Test: Add uncompressed NBT file and NBT file modified by NBTExplorer.
...
Uncompressed files should load without error using the same load function as compressed ones.
NBTExplorer does nothing unusual, but it's nice to make sure its output is readable.
2012-10-29 16:35:55 -10:00
David Vierra
894ff7a458
Server: ChunkNotPresent error while copying chunks now chains exception tracebacks.
2012-10-29 16:16:29 -10:00
David Vierra
df75222f2b
Test: testDeleteChunks asserts that the chunk is no longer present.
2012-10-29 16:14:58 -10:00
David Vierra
adb6b7bb45
Test: Place temporary copies of testing files into their own subfolder.
...
Make sure temporary copies are removed on exit using atexit.register.
2012-10-29 16:14:30 -10:00
David Vierra
6713404fe2
Storage: Modified, unsaved chunks are stored on disk instead of being retained in memory.
...
This allows potentially unlimited numbers of chunks to be modified in a single session.
2012-10-29 06:27:59 -10:00
David Vierra
94bfb1ab43
Fixed: deleteChunk removes the given chunk from allChunks and marks the world for recalculating its bounds.
...
Previously the world would erroneously report a deleted chunk is still present.
2012-10-29 04:56:36 -10:00
David Vierra
5ed8c3daff
Backend: Add listDirtyChunks to let MCEdit find out which chunks to redraw after saving and relighting the level.
2012-10-29 04:38:03 -10:00
David Vierra
5b921d7c43
Backend: Split AnvilChunkData apart from AnvilChunk.
...
MCInfdevOldLevel will hold weak references to AnvilChunk. When an AnvilChunk is no longer referenced, it is safe to unload its AnvilChunkData, or save it to a temporary folder to be held until world.saveInPlace is called. (See upcoming commits.)
2012-10-29 04:36:43 -10:00
David Vierra
b2c8046417
Refactor: Removed now-unused fake "filename" attribute from AnvilChunk
2012-10-29 02:23:31 -10:00
David Vierra
10ed3a614a
Refactor: Move chunk.sanitizeBlocks to global scope.
2012-10-29 02:13:17 -10:00
David Vierra
f9bd0704a8
Debug: Little script to run nbt tests with and without _nbt.pyx built.
2012-10-28 19:44:57 -10:00
David Vierra
5f8d9e67a4
Fixed: Newly created chunks create the HeightMap array with the correct byte order.
2012-10-28 19:44:15 -10:00
David Vierra
4629531703
Debug: Add test case for Primordial Desert generator.
...
nbt.gunzip is the way it is because of this generator. Figure out exactly what is happening someday. (I think it's because PD doesn't set the region file's chunk header's length field correctly.)
2012-10-28 19:42:25 -10:00
David Vierra
cc201158eb
Debug: Add test to measure time taken for level.generateLights
2012-10-28 15:05:19 -10:00
David Vierra
8f782ec8c9
Debug: Add MCRegionFile.__repr__
2012-10-28 03:48:44 -10:00
David Vierra
d9d49eb404
Fixed: Chunk.bounds now returns a sensible bounding box for its position in the world.
2012-10-28 02:45:08 -10:00
David Vierra
1c6c307585
Fixed: AnvilWorldFolder won't accept a non-folder path but will create a folder for a nonexistent path.
2012-10-27 16:42:52 -10:00
David Vierra
124e3389cd
Refactor: Change chunk.save() into chunk.getSavedData(). Remove world._saveChunk.
...
World.saveInPlace now checks chunk.dirty before saving the chunk.
2012-10-27 15:40:23 -10:00
David Vierra
75ae4a35e6
AnvilChunk no longer calls world._loadChunk. Instead, the world passes the chunk's root_tag to the chunk's initializer.
2012-10-27 15:33:51 -10:00
David Vierra
78f473e22c
Fixed: Change dtype of HeightMap in newly created chunks to uint32
2012-10-27 15:22:04 -10:00
David Vierra
428a95088a
Refactor: Simplify ZipSchematic code and move it to schematic.py
...
Upon loading, extract the zip file to a temporary folder and load that as an Anvil world
Upon saving, recreate the zip file from the temporary folder.
Register an atexit func to remove the temp folder.
2012-10-27 15:05:12 -10:00
David Vierra
36e7972b22
Fixed: AnvilWorldFolder.getRegionFilename calls getFolderPath to ensure the folder exists
2012-10-27 15:05:12 -10:00
David Vierra
208ba76efb
Fixed: Call sanitizeBlocks when saving a chunk.
2012-10-27 15:05:11 -10:00
David Vierra
85d79d6203
Normalized line endings
2012-10-27 15:05:11 -10:00
David Vierra
28209fe262
Refactor: Move chunk and region loading code out of MCInfdevOldLevel into a new class.
...
AnvilWorldFolder is responsible for computing filesystem paths, caching MCRegionFiles, and loading and saving uncompressed chunk data.
2012-10-27 15:05:10 -10:00
David Vierra
8d0f6c014f
Change pocket_test to load an Anvil world instead of an MCR world.
2012-10-27 15:05:10 -10:00
David Vierra
89c535fea1
Refactor: Change TagProperty to accept either a value or a function for the default value.
2012-10-27 15:05:10 -10:00
David Vierra
81f5bbfbb8
Test: testServerGen asserts that the newly created chunk contains any non-air blocks.
...
Exposes bugs in server gen where block data doesn't get copied from the temporary level.
2012-10-27 15:05:09 -10:00
David Vierra
38cd052bb0
Refactor: Reorder members and methods of MCInfdevOldLevel to place related methods closer together.
...
Change version to use TagProperty. Remove some backward compatibility from MCServerChunkGenerator
Add # --- Subheaders --- to mark related method groups
Fix whitespace according to pep8
2012-10-27 15:05:09 -10:00
David Vierra
f4b40912a3
Fixed: Statement seems to have no effect
...
Change several strings-in-void-context into comments like they ought to be.
Change member accesses in void context into assertions or prints.
2012-10-27 15:05:08 -10:00
David Vierra
b7ce019c43
Fixed: Remove redundant parentheses
2012-10-27 15:05:08 -10:00
David Vierra
55c23697df
Fixed: Incorrect call arguments
...
Inspector assumed TagProperty was instance method
Classmethod should have cls as first argument, not self.
2012-10-27 15:05:07 -10:00
David Vierra
bca5e1866b
Fixed: Default argument value is mutable
2012-10-27 15:05:07 -10:00
David Vierra
6fa9249a8c
Refactor: Remove dead class members.
2012-10-27 15:05:06 -10:00
David Vierra
79f4e1a8f6
Refactor: Remove dead function.
2012-10-27 15:05:06 -10:00
David Vierra
a749389bba
Fixed: Comparison with None performed with equality operators
2012-10-27 15:05:05 -10:00
David Vierra
670bb46d8a
Refactor: Move MCServerChunkGenerator and related classes and functions to a new file minecraft_server.py
2012-10-27 15:05:05 -10:00
David Vierra
0b55db744c
Refactor: Remove tag names statically declared as string constants.
2012-10-27 15:05:02 -10:00
David Vierra
50f9ee5147
Add .gitattributes with core.autocrlf
2012-10-27 15:04:35 -10:00
David Vierra
78e45aedfb
Refactor: Remove compressedChunks and related methods and data from MCInfdevOldLevel and AnvilChunk
...
Move MCRegionFile to its own source file.
Remove knowledge of chunk structure from MCRegionFile. Rename loadChunk to readChunk.
Remove compress, decompress, unload, isLoaded, compressedSize methods.
Remove compressedTag, dataIsPacked, loadedChunkQueue/Limit, decompressedChunkQueue/Limit members.
Rename InfdevChunk to AnvilChunk. Keep in place the conversion to old-style chunks until all client code is updated.
Remove most checks for self.version and keep only the VERSION_ANVIL code in place
Rename Alpha tests to Anvil tests.
Change several tests to load the AnvilWorld test data.
Change ZipSchematic test to export an area from the center of the world instead of from hard-coded coordinates.
2012-10-27 15:04:28 -10:00
David Vierra
7c4296675a
TempLevel raises an error when the file isn't found, and doesn't raise AttributeErrors during __del__()
2012-10-26 01:04:36 -10:00
David Vierra
419a403eab
Remove last remnant of old NBT code.
...
saveGzipped is gone, tag.save now saves as gzipped by default. Pass compressed=False to save as uncompressed.
2012-10-18 14:09:52 -10:00
David Vierra
fde247b651
Change data type of computed heightmap arrays to signed integer to avoid unsigned overflow.
...
Code that works with heightmaps such as filters/smooth.py will subtract two heights expecting to get a negative integer. Getting a very large positive one usually causes an error, so make sure signed int arithmetic gets used.
2012-10-17 12:19:01 -10:00
David Vierra
14967d46da
Increase default height of MCInfdevOldLevel to 256
2012-10-17 12:16:04 -10:00