1098 Commits

Author SHA1 Message Date
David Vierra
89648d77a2 Revert "Support dimensions with arbitrary directory names."
This reverts commit 90460f89db7ff340c6ebb166c555fd77d302c366.
2012-11-07 22:41:31 -10:00
David Vierra
e904341eb7 Biomes: Add biome types. 2012-11-07 04:27:50 -10:00
David Vierra
0d22baea91 Test: time_relight using a human-built structure and using natural terrain. 2012-11-07 02:45:27 -10:00
David Vierra
4569227304 Fixed: Bug in copyBlocks where entities and tile entities would be copied multiple times. 2012-11-07 00:36:38 -10:00
David Vierra
3b868969c0 Fixed: generateLights was loading every affected chunk at once.
Now it only uses chunkPositions until after the work is split into batches. Also reduced the batch size to loadedChunkLimit, slowing things down slightly.
2012-11-07 00:23:22 -10:00
David Vierra
41fcf62bf8 Fixed: Mark chunks dirty while relighting chunks to make sure they don't get discarded between lighting passes.
If you change a chunk, and then don't mark it dirty before losing the reference to the chunk, it will eventually get unloaded and your changes will be lost.
2012-11-04 20:52:05 -10:00
David Vierra
da5dfcd3e5 Fixed: Don't save chunks from the unsaved work folder if they have already been saved from _loadedChunkData.
This was causing old versions of chunks to be written over newer ones. The bug manifested as lighting errors and chunk reversions.
2012-11-04 20:52:04 -10:00
David Vierra
864e640b22 Fixed: Check that Blocks, BlockLight and SkyLight all have default values before discarding a chunk section.
Fixes #114
2012-11-04 14:52:37 -10:00
David Vierra
dea8e79b26 Fixed: AnvilWorldFolder no longer creates empty region files when trying to retrieve absent chunks. 2012-11-03 22:02:48 -10:00
David Vierra
95af0c3c06 Blocktypes: Include classic blocks in indev.yaml instead of loading classic.yaml twice. 2012-11-03 22:02:17 -10:00
David Vierra
1968475474 Items: Ignore enchantment definitions (for now) 2012-11-03 22:01:35 -10:00
David Vierra
d68d58f570 Items: Update to 1.4.2 (thanks @copyboy!) 2012-11-03 18:11:15 -10:00
David Vierra
325b8f7735 Blocktypes: Add Anvils, minor reformat. 2012-11-03 18:09:37 -10:00
David Vierra
1d218a21b8 Fixed: MCServerChunkGenerator is working again.
Don't delete the unsaved work folder when unloading chunks.
Copy each chunk's bytes instead of decoding its NBT tree.
Only copy chunks that are completely surrounded by other chunks, instead of ones that have TerrainPopulated set. TerrainPopulated seems to have changed and only appears on the south east edges of a world.

xxx Should probably have an option for generating chunks "directly" instead of via a temporary level, a la createWorld. Also, should make MCInfdevOldLevel.close mark the world closed and have it raise errors if you try to use it again.
2012-11-03 11:45:34 -10:00
David Vierra
3ce0a7e41b Fixed: MCServerChunkGenerator.createWorld accepts a relative pathname.
Previously, it would raise WindowsError whenever the cwd argument to subprocess.Popen was an empty string.
2012-11-02 12:19:56 -10:00
David Vierra
0cb929901c Fixed: extractAnySchematic no longer consumes all available memory.
Instead, it uses loadedChunkLimit to decide which format to use.
2012-11-02 12:18:58 -10:00
David Vierra
4b06963463 Fixed: Loaded chunk limit will not be exceeded when creating thousands of new chunks.
Newly created chunks will now bump older chunks out of memory. Moved the save-and-unload code into a new function, _storeLoadedChunkData
2012-11-02 12:15:29 -10:00
David Vierra
07c8024121 BoundingBox: Made BoundingBox immutable and added immutable Vector class
Vectors can be added, subtracted, or multiplied.
This change can avoid some errors where a box is modified while being used.
2012-11-01 00:21:01 -10:00
David Vierra
f5e4fd1cb8 FakeChunk now uses TAG_List for its fake Entities and TileEntities instead of lists.
Allows tag type checking.
2012-10-31 15:17:03 -10:00
David Vierra
3e4a9b8ef6 NBT: TAG_List now accepts item assignment using slices.
e.g. `list_tag[:] = [nbt.TAG_Double(3), nbt.TAG_Double(5)]`

Also, changed the names of a few method args to be more consistent between implementations.
2012-10-31 15:16:12 -10:00
David Vierra
30cfb1d380 Test: testFillBlocks calls fillBlocks with a blocksToReplace argument 2012-10-31 14:30:24 -10:00
David Vierra
3fb1b0cf6d Fixed: Scan the unsaved work folder and _loadedChunkData in addition to the world folder when listing chunks.
Newly created chunks will only show up in _loadedChunkData and chunks that have been "swapped out" will only show up in the unsaved work folder.
This fixes a problem where flood fill could not be undone.
2012-10-31 13:01:52 -10:00
David Vierra
fae5e61057 Fixed: Scan the unsaved work folder in addition to the world folder when listing chunks. 2012-10-31 02:25:48 -10:00
David Vierra
35bbbdc576 Refactor: Change log statements to use log.info() instead of info=log.info; info() 2012-10-31 02:04:05 -10:00
David Vierra
ecac4faf93 Refactor: Move fillBlocks into its own file and remove "fillBlocksFinite" implementation. 2012-10-31 02:04:05 -10:00
David Vierra
a7fd3ed3ca Refactor: Move copyEntitiesFrom logic into copyBlocksFrom and remove "copyEntitiesFromFinite" implementation.
copyBlocksFrom now copies everything in a single pass instead of doing the entities in a second pass through every chunk.
2012-10-31 02:04:04 -10:00
David Vierra
b0ef494546 Test: copyBlocksFrom no longer fails if the requested box is partially out of the source level's bounds.
It should just copy the area within the requested box.
2012-10-31 02:04:04 -10:00
David Vierra
459b20863d Indev: Now separates LocalPlayer from Entities on load and reinserts it on save.
Avoids returning LocalPlayer in level.Entities and level.getEntitiesInBox
2012-10-31 02:04:03 -10:00
David Vierra
14f5343504 Test: Improve copyConvertBlocks to count entities copied 2012-10-31 02:03:57 -10:00
David Vierra
ea585d7627 Test: test_mcr no longer re-runs TestAnvilLevel. 2012-10-30 17:57:24 -10:00
David Vierra
cf51ef4291 Refactor: infiniteworld.py: Change log statements to use log.info() instead of info=log.info; info() 2012-10-30 17:27:26 -10:00
David Vierra
f36634b6e4 Refactor: Move copyBlocksFrom and supporting methods to its own file and simplify them.
Add a function to ChunkBase for getting the slices for a chunk's arrays and the area of the chunk bounded by a given BoundingBox
Remove copyBlocksFromFinite and use copyBlocksFromInfinite as the default implementation
Rewrite copyBlocksFrom to use chunk.getChunkSlicesForBox instead of world.getChunkSlices
2012-10-30 17:05:11 -10:00
David Vierra
ded3b8f3e5 Refactor: Remove redundant code for setting an anvil world's Height. 2012-10-30 16:59:28 -10:00
David Vierra
93ccf9dda8 Refactor: Change a chunk's Height to reference the Height of its containing world. 2012-10-30 16:58:26 -10:00
David Vierra
fe03b70651 Entities: Fixed Tile positions when copying and rotating ItemFrames
Fixes mcedit/mcedit#155
2012-10-30 00:56:47 -10:00
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