1163 Commits

Author SHA1 Message Date
David Vierra
99f20ebfc5 remove the automatic recompress in getChunkSlices to avoid decompress thrashing; xxx get to work on a LRU cache or something! 2011-08-16 15:16:49 -10:00
David Vierra
e4f522e2a2 add method addEntities() 2011-08-16 15:16:01 -10:00
David Vierra
d1ad50724a remove the explicit compress() because getChunkSlices() will call it 2011-08-16 13:40:51 -10:00
David Vierra
cb2dd8e746 raise PlayerNotFound when trying to get "Player" from a multiplayer world 2011-08-16 13:40:08 -10:00
David Vierra
f7122848ae only sanitize blocks on the first compress; don't decompress only to resanitize, since we assume the blocks haven't been touched if we're still compressed 2011-08-16 13:39:17 -10:00
David Vierra
2a4e0435a0 refactor base entity code into an EntityLevel subclass and derive Indev/Infdev levels and MCSchematic from it. remove the hasEntities flag. 2011-08-16 13:38:30 -10:00
David Vierra
9127ee0ff5 remove the unused entitiesAt 2011-08-15 19:04:30 -10:00
David Vierra
ae18928064 print a more informative keyerror 2011-08-15 19:03:00 -10:00
David Vierra
650bf8d62d add extra tags to TileEntities in Indev levels, decoding the position from the TAG_Int "Pos" to the x,y,z used in Alpha 2011-08-15 19:02:51 -10:00
David Vierra
076956dcfe fix a bad bug in Entity.Create 2011-08-15 18:49:54 -10:00
David Vierra
e2445ba8be infinite-to-infinite block copy now uses a more sensible direct copy method instead of repeated subsection import/export; refactored some code out of the finite-to-infinite function. someday change it to only use infinite-to-infinite by using the fake chunk interface on finite levels? 2011-08-15 11:25:48 -10:00
David Vierra
2613ac7ff9 ZipSchematic now remembers its materials 2011-08-15 11:22:42 -10:00
David Vierra
28fde10d27 change this to yield the new progress indicators 2011-08-14 16:32:43 -10:00
David Vierra
b327ded803 fix a completely wrong subsection count calculation 2011-08-14 10:07:49 -10:00
David Vierra
b001be05f9 in generateLights, don't call chunkChanged on the neighbors of the requested chunks; just relight them. also slightly improve the progress estimates. 2011-08-13 11:01:40 -10:00
David Vierra
85a4eb0d19 fix the non-iterator generateLights() 2011-08-13 10:00:42 -10:00
David Vierra
e75b651304 incomplete impl of ZipSchematic.saveToFile; it only saves the already saved zipfile to another file ignoring the dirty, changed chunks in memory. 2011-08-13 09:59:31 -10:00
David Vierra
e8870e76e4 add iterator-type counterparts to extractSchematic, extractZipSchematic and copyBlocksFrom to facilitate progress bars. iterators repeatedly yield a tuple of (progress, total). extract methods finally yield the extracted schematic object. 2011-08-13 09:57:59 -10:00
David Vierra
55dc972e22 add box.chunkCount 2011-08-12 19:08:47 -10:00
David Vierra
fef958d571 add base tag structures for known tile entities 2011-08-11 16:19:15 -10:00
David Vierra
1aa7ed366a copyBlocksFrom now passes the correct entities flag to copyEntitiesFrom 2011-08-10 17:30:32 -10:00
David Vierra
5e4c57a883 refactoring. create TagProperty() to create a getter+setter that automatically creates a required tag when it is absent. extract createPlayer() out of create() and getPlayerPath out of getPlayerTag 2011-08-10 17:29:39 -10:00
David Vierra
3b80ead4a7 tweak the items.txt, don't know what the parentheses mean 2011-08-08 15:38:26 -10:00
David Vierra
6cac9bb5fa added FlipVertical to blockrotation.py, called it from MCSchematic.flipVertical 2011-08-08 12:45:10 -10:00
David Vierra
887092de05 add latest items courtesy of copyboy 2011-08-05 07:06:46 -10:00
David Vierra
aab4d07776 fix bug introduced by rearranged imports 2011-08-05 06:20:52 -10:00
David Vierra
72dc4374dd change getChunks to return an iterator 2011-08-04 05:17:07 -10:00
David Vierra
aca3bf88e7 this is actually test output, not input 2011-08-04 05:16:42 -10:00
David Vierra
cb65e25c95 also sanitize grass with dirt above it. 2011-08-01 02:49:10 -10:00
David Vierra
f865c78e8d add a test for setPlayerSpawnPosition 2011-07-30 00:51:04 -10:00
David Vierra
fc42fc4ab4 add profiling scripts 2011-07-30 00:50:13 -10:00
David Vierra
55a8505d53 add entities flag to copyBlocksFrom and extractSchematic, to avoid copying entities. TileEntities are always copied with the blocks. Paintings should probably be copied with them too. 2011-07-28 22:14:28 -10:00
David Vierra
744c782b93 add expand function to BoundingBox (needs to be immutable, maybe) 2011-07-27 04:39:14 -10:00
David Vierra
7ca143a87a generateHeightmap should just call self.load() instead of checking root_tag 2011-07-27 04:38:51 -10:00
David Vierra
19daf35a9e fix the return values of getChunkSlices so when an extra tall box is requested, the offset point and slices line up properly 2011-07-27 04:38:25 -10:00
David Vierra
bab9af4c6d entity position is a TAG_Double 2011-07-24 22:36:09 -10:00
David Vierra
b664a2bf73 refactor some entity code out to entity.py 2011-07-24 14:23:27 -10:00
David Vierra
6e7c6f0ab3 create a method getRegionFile, which automatically loads a region file if present. fixes deleteChunk not deleting from unloaded regions 2011-07-24 01:13:11 -10:00
David Vierra
d74bf07343 TAG_Compound automatically wraps lists, tuples, and strings 2011-07-24 00:21:44 -10:00
David Vierra
daf593378b put the extract methods back onto MCLevel 2011-07-23 22:21:28 -10:00
David Vierra
225f813d28 put everything through pydev's code auto-formatter 2011-07-23 21:59:18 -10:00
David Vierra
6b9e82c2e4 refactor level formats out to different files, add testing framework and test files 2011-07-23 19:58:11 -10:00
David Vierra
5b39487030 don't misuse TypeError here...this is an unexpected value 2011-07-22 22:56:18 -10:00
David Vierra
2e10c3b24a extractAllChunks now saves them with "standard" gzip compression 2011-07-22 22:55:57 -10:00
David Vierra
5c56843a76 repair the shabby unit tests 2011-07-22 20:46:47 -10:00
David Vierra
f462469424 TAG_Short_Array used by cubic chunks 2011-07-22 20:34:49 -10:00
David Vierra
a6c0da238a add pretty_string method to tags for indented output 2011-07-22 20:34:36 -10:00
David Vierra
694a5b8df7 refactoring compress methods in InfdevChunk, decompress methods in MCRegionFile, added extractAllChunks to MCRegionFile, refactored preloading code in MCInfdevOldLevel 2011-07-22 20:08:07 -10:00
David Vierra
db69f5bd98 set materials for fake chunks 2011-07-11 11:54:10 -10:00
David Vierra
0e6b3cfac9 sanitize both grass and snow layer. maybe more blocks in the future. 2011-07-06 10:03:25 -10:00