1190 Commits

Author SHA1 Message Date
David Sowder
4ae04dbaeb pyflakes helped fixes: infiniteworld.py: unravel import all of mclevelbase module 2012-02-27 19:04:50 -06:00
David Sowder
9cb13d4f22 pyflakes helped fixes: indev.py: unravel import all of mclevelbase module 2012-02-27 18:25:02 -06:00
David Sowder
6d6f6ca3e9 materials.py: explicitly import the items needed from the faces module 2012-02-27 18:07:51 -06:00
David Sowder
c4e98d7384 explicitly import getLogger from the logging module, which in some places was relying on the import of all of the mclevelbase module into the local namespace 2012-02-27 17:17:20 -06:00
David Sowder
0b146ea4ad entity.py: remove import all of the nbt module in favor of using the already imported nbt module namespace 2012-02-27 16:56:56 -06:00
Tyler Kennedy
d6a5a9a105 Merge pull request #76 from zothar/master
PEP8 compliance changes, some initial pyflakes fixes and gitignore the ENV directory
2012-02-26 19:40:25 -08:00
David Sowder
a2364dc3c0 pyflakes result fix: local variable is assigned to but never used 2012-02-26 16:31:14 -06:00
David Sowder
150e6f9485 Both add imports and fix a wrong PEP8 edit identified by running 'python tests.py' 2012-02-26 15:46:49 -06:00
David Sowder
1a2ecc5c41 pyflakes result fix: imported but unused 2012-02-26 15:06:41 -06:00
David Sowder
c681391335 pep8 compliance changes missed because I forgot I was looking at a subset of the hits earlier 2012-02-26 14:41:17 -06:00
David Sowder
4270a929d7 pep8 compliance changes and gitignore the ENV directory 2012-02-26 13:47:58 -06:00
David Vierra
d0784287b8 Create new Anvil chunks with a TAG_Int_Array for the HeightMap array 2012-02-19 16:39:56 -10:00
David Vierra
06c2168eed pynbt: Catch and ignore both zlib.errors and IOErrors which may be thrown when trying to decompress data. 2012-02-18 21:25:06 -10:00
David Vierra
710d078bd5 Added Jungle Leaves 2012-02-18 19:26:14 -10:00
David Vierra
303c604c49 Anvil format support (as it appears in 12w07)
A height of 256 is hard-coded for Anvil worlds (version == 19133). The AnvilChunk class emulates an old extended height chunk by swapping axes and stacking the chunk sections vertically.

The chunk compress/decompress thing really got in the way here. Compressed (unsaved) chunks should be stored separately instead of as a state of InfdevChunk.
2012-02-18 19:25:59 -10:00
David Vierra
f66254c71c _nbt.pyx supports the TAG_Int_Array type now. testAnvilChunk tests the int array by modifying a single Anvil chunk's HeightMap. 2012-02-17 15:14:02 -10:00
David Vierra
da517f5e88 Add a simple test case for Anvil worlds 2012-02-16 17:37:53 -10:00
David Vierra
8d9660d297 Add the new TAG_Int_Array to _nbt.pyx 2012-02-16 17:36:43 -10:00
David Vierra
1da12872af Formally depend on pyyaml instead of pasting it in. This way pyyaml gets linked to libyaml if present, speeding it up. 2012-02-13 14:44:51 -10:00
David Vierra
ddd59bacbd don't load user's levels in tests, load the temp level instead 2012-01-16 22:17:51 -10:00
David Vierra
f0d1eec483 testRecompress now checks its work more thoroughly 2012-01-16 01:55:09 -10:00
David Vierra
79913eee7d some code from activestate, might be cool later 2012-01-15 04:36:12 -10:00
David Vierra
b135d7693f rename chunkFilename arguments, move chunkFilenameAt nearby 2012-01-12 15:40:43 -10:00
David Vierra
745d1c41c0 remove 725 unnecessary semicolons 2012-01-12 15:27:44 -10:00
David Vierra
8fac69ebbb remove redundant parentheses 2012-01-09 21:32:26 -10:00
David Vierra
62c4fc43a8 extractHeights now returns a uint16 type array to avoid overflow problems 2012-01-07 16:15:10 -10:00
David Vierra
0bf8f1f74b PocketWorld.getChunk raises ChunkNotPresent for chunks outside of PE's current bounds (instead of returning the same chunks modulo 32) 2012-01-06 21:59:16 -10:00
David Vierra
639f32b8e5 Move chunkChanged and genFastLights to a new class, LightedChunk. PocketChunk now inherits from LightedChunk. ChunkBase now has dirty and needsLighting flags. PocketWorld respects dirty flags on its chunks. 2012-01-06 21:59:09 -10:00
David Vierra
448de43e64 move dirty and needsLighting to ChunkBase so PocketChunk inherits them 2012-01-06 14:23:09 -10:00
David Vierra
751f190274 Import error messages now explain that NBT acceleration is not available, and gives tips on how to enable it by getting pyximport working. 2012-01-03 12:18:40 -10:00
David Vierra
167f7e960c Pass numpy's include dir to pyximport.install() to fix "error: numpy/arrayobject.h: No such file or directory". 2012-01-03 12:05:24 -10:00
David Vierra
5687de8f36 Tell distutils to add numpy's include dir to the list of include paths. 2011-12-27 17:09:47 -10:00
David Vierra
ab070934e1 changing a chunk's TerrainPopulated bit now marks the chunk dirty 2011-12-25 08:38:19 -10:00
David Vierra
26aacd8265 create a ChunkBase class with attrs common to FakeChunk, InfdevChunk, and PocketChunk 2011-12-24 07:18:32 -10:00
David Vierra
de8dd71ee2 extractHeights always returns a heightmap without its axes swapped. Instead, computeChunkHeightMap swaps the axes and handles filling in a chunk's existing HeightMap array. 2011-12-23 11:07:58 -10:00
David Vierra
3e1520ee02 Import level classes where they're needed instead of in mclevelbase.py. This lets us run each file individually, e.g. for doctests. 2011-12-22 11:55:49 -10:00
David Vierra
56a9d56679 fix extractLightMap's return value 2011-12-17 06:08:13 -10:00
David Vierra
8a30875609 getChunkSlices takes a shortcut and enumerates all of the level's chunks whenever the requested box is the level's bounds 2011-12-16 14:42:45 -10:00
David Vierra
73a4954055 rewrite extractLightMap to use argmax on a reversed array instead of nonzero. this is about 3x faster. a new method extractHeights contains the new code and can be reused e.g. for topsoil methods 2011-12-16 14:01:07 -10:00
David Vierra
529e36c880 pkg_resources isn't always available, so fall back on PYMCLEVEL_YAML_ROOT and then cwd 2011-12-16 01:57:00 -10:00
David Vierra
b599e0d0b3 Parse ~item groups from items.txt 2011-12-12 19:09:38 -10:00
David Vierra
b3c5574a0f add FloatBox to default imports 2011-12-12 19:07:45 -10:00
David Vierra
f1a8bf76fc Set HeightMap to all zeros in the Nether to match what the game does. Otherwise, Nether Wart won't plant in low light. 2011-12-12 19:07:26 -10:00
David Vierra
0f52c0e655 addYamlBlocksFromFile now uses pkg_resources to find the requested YAML file instead of guessing wildly 2011-12-06 18:47:38 -10:00
David Vierra
05d2e39739 remove the __del__ from MCInfdevOldLevel so the gc can resolve the circular reference between a level and its dimensions. move it to RegionFile which might actually have filehandles to close if I ever turn "holdFileOpen" back on... 2011-12-05 04:30:42 -10:00
David Vierra
3d1d76d04b Revert "use weakrefs to break reference cycles between a world and its dimensions, and a world and its chunks."
Weakrefs are the wrong solution, we need to remove the __del__ from MCInfdevOldLevel

This reverts commit 12a5982b1693def30d74f9e656d87984e50fd8b1.
2011-12-05 04:27:10 -10:00
David Vierra
768d88ca33 extractAnySchematic calls extractZipSchematic whenever the box has more chunks than a threshold (currently the decompressed chunk limit) 2011-12-05 00:08:21 -10:00
David Vierra
12a5982b16 use weakrefs to break reference cycles between a world and its dimensions, and a world and its chunks. 2011-12-04 22:42:27 -10:00
David Vierra
9c94191073 pocket levels fill the DirtyColumns array with 255 to tell the MCPE server that the chunk is dirty. 2011-12-04 13:25:19 -10:00
David Vierra
413111477c add lists of entity IDs 2011-12-02 16:06:49 -10:00