911 Commits

Author SHA1 Message Date
David Vierra
a12dfdf29a print the name of the regression before starting 2011-03-07 22:34:01 -10:00
David Vierra
3320be689f set hasEntities for more level types. suspect this was why zipschematics were getting exported without entities. 2011-03-07 19:37:32 -10:00
David Vierra
2c0257e6a4 removed cruft 2011-03-07 18:59:41 -10:00
David Vierra
396925bc1e restored support for the older chunked format, including zipped schematics exported from older MCEdits
changed world._loadChunk to set chunk.root_tag and chunk.compressedTag instead of just returning the uncompressed, flat NBT data. RegionFile.loadChunk also changed to set chunk.root_tag and chunk.compressedTag instead of returning data. These methods now take a chunk object as input instead of coordinates and data
2011-03-07 18:24:40 -10:00
David Vierra
7170e003d7 compressedSize is only used by chunks 2011-03-06 16:29:14 -10:00
David Vierra
a10ef86ae9 this code was completely unused! 2011-03-06 15:30:12 -10:00
David Vierra
b887a2c6be added flat color values for low detail rendering. values borrowed from c10t. 2011-03-06 14:58:03 -10:00
David Vierra
3e8852a97c these were incorrect; schematic.Data is unpacked 2011-03-05 15:14:51 -10:00
David Vierra
12f1282103 accept -h and --help 2011-03-04 12:10:55 -10:00
David Vierra
834f5f0b9f mce accepts world names instead of world numbers, xxx scan through the saves folder for LevelName tags? 2011-03-04 12:05:32 -10:00
David Vierra
1112b8b6fa go back to not holding files open to avoid having too many files open...? 2011-02-27 10:01:29 -10:00
Jean-Yves Faye
1539fb59d7 Added exception for unknown items in id to name conversion 2011-02-27 19:39:09 +01:00
Jean-Yves Faye
498eeb33a7 Added item name instead of id and clean up 2011-02-27 16:55:21 +01:00
Jean-Yves Faye
1633ba1dad Added dumpchests command which dump all chests in the world with their
contents
2011-02-27 16:30:29 +01:00
David Vierra
2a7ae26db3 don't try to pass None into decompressSectors 2011-02-27 01:10:44 -10:00
David Vierra
ede1a2ba4b added an automatic repair routine that detects misplaced and overlapping chunks 2011-02-27 01:03:47 -10:00
David Vierra
5ad16c7a87 on chunk load, alert the world that the chunk is also decompressed xxx this is very sloppy 2011-02-27 00:16:29 -10:00
David Vierra
9c0edc6e85 once again, region filenames have no base36 involved 2011-02-26 21:37:33 -10:00
David Vierra
643d9cfc39 delete empty region files on load 2011-02-26 20:21:24 -10:00
David Vierra
1bb6b6d7cf switch to holding region files open 2011-02-26 20:20:34 -10:00
David Vierra
e0ef5fbb75 this error message now offers a possible fix 2011-02-26 19:10:13 -10:00
David Vierra
0025c6b3df recompress chunks during getChunkSlices 2011-02-26 19:09:52 -10:00
David Vierra
9bdc185127 fix bad reference to self.file in setOffset, this contextmanager stuff may be a bad idea... 2011-02-26 19:09:18 -10:00
David Vierra
ae77c58187 delete empty region files after deleting chunks 2011-02-26 17:13:27 -10:00
David Vierra
d94ec4b3ba don't need to use decbase36 for region filenames 2011-02-26 17:12:47 -10:00
David Vierra
8b5ebab219 reset regionFiles to an empty dict instead of None, which is incorrect 2011-02-26 17:11:16 -10:00
David Vierra
f0c3e4affc correctly use context managers to close the file only when the RegionFile class is configured to open files on demand.
as it turns out, experimenting with this option vs earlier code showed no change in the number of open filehandles. python will close the file when it garbage-collects the file object so we don't ever have to close the file.  on windows, opening the file for writing doesn't give an exclusive lock so we don't determine if minecraft is holding onto the file
2011-02-26 17:06:17 -10:00
David Vierra
ff912c2235 compressedTag can be none - this means we are unloaded. 2011-02-26 16:55:04 -10:00
David Vierra
27ef9011a2 detect region files with overlapping chunks 2011-02-26 15:22:58 -10:00
David Vierra
f1aeedd64a synthesize a descriptive filename to read out of chunk files xxx rename property? 2011-02-26 15:21:44 -10:00
David Vierra
b323f6cc6e describe this ChunkMalformed error with more detail 2011-02-26 15:21:16 -10:00
David Vierra
b3ccdd5956 start using psyco where available 2011-02-23 09:39:08 -10:00
David Vierra
d961d96c79 add methods to close a file, now that the region files may be held open. they are not held open by default. 2011-02-23 09:38:40 -10:00
David Vierra
689bf41e1d close the GzipFile after reading from it 2011-02-23 09:37:45 -10:00
David Vierra
fd7388fcd0 fill out the new version and LevelName fields on creation 2011-02-23 09:35:53 -10:00
David Vierra
5ed31290c4 create regionDir when creating a level 2011-02-23 09:35:38 -10:00
David Vierra
c1c92d889b immediately preload regions on load 2011-02-23 09:35:28 -10:00
David Vierra
54ceb4c8f9 LastPlayed is actually a timestamp * 1000 2011-02-23 09:34:57 -10:00
David Vierra
b8c933fd66 use gzip.GzipFile instead of gzip.open because .open won't take a fileobj 2011-02-23 09:32:16 -10:00
David Vierra
549741e909 convenience function to load any world from the saves folder 2011-02-23 09:31:38 -10:00
David Vierra
8a52c977b5 catch more general errors in chunk.load and wrap them in ChunkMalformed 2011-02-23 09:31:18 -10:00
David Vierra
76787fb9ef catch general errors in regionFile.readChunk and wrap them in ChunkMalformed 2011-02-23 09:30:42 -10:00
David Vierra
2aef37d5dc don't throw an error when deleting a chunk whose region file is absent 2011-02-23 09:30:13 -10:00
David Vierra
3bb8e786a5 correctly fill out the free sector map while loading the region, additionally checking for bad offsets and logging a few statistics 2011-02-23 09:29:30 -10:00
David Vierra
2e8ed9fa9b chunk.compress checks for a compressed tag before throwing away uncompressed data 2011-02-23 08:47:05 -10:00
David Vierra
a95345231d add option to hold the file open or reopen it on every access 2011-02-22 13:45:42 -10:00
David Vierra
eff036576b fix zipped schematic imports 2011-02-22 13:45:21 -10:00
David Vierra
a3097b1072 clear region offsets when deleting chunks 2011-02-22 13:44:36 -10:00
David Vierra
283bd4ba9b fix zipped schematic imports 2011-02-22 13:44:16 -10:00
David Vierra
a7a79d8529 fix incorrect sector numbers when extending or reclaiming file space 2011-02-22 13:44:03 -10:00