152 Commits

Author SHA1 Message Date
David Vierra
a97ce1c8c6 mce.py: dumpsigns: Don't decode sign text now that TAG_String automatically decodes it. 2013-03-09 20:50:25 -10:00
David Vierra
8e4a87157a Fixed: mce.py analyze is now 4096 block ID aware. 2013-01-24 12:51:30 -10:00
David Vierra
b824cfbfaf Increase block limit to 4096. Change Schematic format slightly to store extended blockIDs.
InfdevOldWorld now allocates Blocks as a 16-bit array and reads Add into the top 8 bits if present. MCSchematic also allocates Blocks as uint16 and uses WorldEdit's extension to the schematic format to store the Add arrays.

Conflicts:
	test/extended_id_test.py
2013-01-08 11:27:59 -10:00
David Vierra
e9b72b3151 mce.py heightmap is less spammy. 2012-12-02 12:47:14 -10:00
David Vierra
d787801d05 Fixed: mce.py degrief works again. 2012-12-01 17:38:08 -10:00
David Vierra
89648d77a2 Revert "Support dimensions with arbitrary directory names."
This reverts commit 90460f89db7ff340c6ebb166c555fd77d302c366.
2012-11-07 22:41:31 -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
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
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
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 O'Shea
96c155909e Correct references to ChunkMalformed exception in dumpSigns/dumpChests
The exception handlers in the dumpSigns and dumpChests commands
referenced ChunkMalformed in the wrong package.

This fix corrects the references, but note that this by itself is not
desirable, as ChunkMalformed is raised when a MemoryError occurs, and
the exception handlers ignore the exception.  As a MemoryError is not
likely to go away by itself, this can result in a flood of error
messages being printed, instead of the existing behaviour where
execution of the command terminates due to the incorrect reference to
ChunkMalformed.
2012-09-29 23:37:20 +09:30
David O'Shea
0e4399b053 Use UTF-8 for decoding of sign text from world
When using the dumpSigns command, if non-ASCII characters were present
in the sign text, a UnicodeDecodeError exception would occur when
concatenating the text from the sign with 'u"\n"'.

This fix decodes the sign text as UTF-8, which appears to be
consistent with the behaviour of Minecraft 1.2.5 for the following
sign text as dumped in Python using repr():
'\xc2\xa3$\xc2\xa3$\xc2\xa3$\xc2\xa3$\xc2\xa3$\xc2\xa3$\xc2\xa3$\xc2\xa3'

Additionally, this fix ensures the output file includes a signature
which makes it easier for tools to work out that the file contains
UTF-8.
2012-09-29 23:19:08 +09:30
Philippe Latulippe
90460f89db Support dimensions with arbitrary directory names. 2012-09-09 18:54:37 -04:00
FlukyPhoenix
040e97547e Fix dimension not listing dimensions. Add dimension command to main help.
Signed-off-by: FlukyPhoenix <git@flukyphoenix.com>
2012-04-13 00:37:01 +01:00
David Sowder
59d4aec9a2 pyflakes helped fixes: mce.py: resolve redefinition of match function 2012-03-04 16:56:36 -06: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
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
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
Mike Swanson
11aaca46a4 Change the help message to include gametype's new invokation. 2011-11-13 20:52:49 -08:00
Mike Swanson
4d5a8ebe7f Refine gametype command to be more robust.
Now supports both single- and multi-player worlds, and it also
sets the player abilities added in Beta 1.9-pre5 to proper values
based on the gametype changed to.  No longer will allow flying and
invulnerable players when switching to survival mode!
2011-11-12 17:43:35 -08:00
David Vierra
2ca14695f3 'blocks' command lists blocks nicely when given a single block ID 2011-10-25 02:55:21 -10:00
David Vierra
44b1857802 blocks are now defined in .yaml files. added a yaml library.
the .yaml format is an extended version of the one used by Minecraft X-Ray. fields are added for data variants, extra search terms, and lighting info. tables for converting blocks are now inferred from the block info: for each source block's name, it will search the destination's block info for names or aliases (aka) that match or contain the name.

the MCMaterials objects gained the [] operator, which can accept a block name, block id, or (id, data) pair.
2011-10-25 01:23:01 -10:00
Mike Swanson
68d51b6dc2 Add a command to display and change the game's mode (Survival or Creative). 2011-10-01 06:36:00 -07:00
David Vierra
f0a9407479 added some commands for dumping a region file's headers and finding the unused sectors 2011-09-25 02:39:37 -10:00
David Vierra
a94c032c94 added a 'create' option to copyBlocksFrom and getChunkSlices. 2011-09-13 16:03:58 -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
9ca56ea596 dumpchests now observes items with differing damage values 2011-04-30 18:46:11 -10:00
David Vierra
02c2f117fd dumpsigns writes to a file with explicit encoding 2011-04-30 10:18:21 -10:00
David Vierra
dc13ca8302 randomseed command makes sure to save the level 2011-04-24 13:48:26 -10:00
David Vierra
f4724cfe8b Added dumpchests command, contributed by user JYF
Merge remote branch 'JYF/master'

Conflicts:
	mce.py
2011-04-07 18:11:07 -10:00
David Vierra
f52bacdc29 don't need to print this header for 'blocks' command 2011-03-13 16:46:24 -10:00
David Vierra
49b9392dd9 updated analyze to count blocks with alternate blockData 2011-03-13 16:46:09 -10:00
David Vierra
9f02076ae0 changed blocksByName to allBlocks to keep the blocks ordered (right now, ordered by initialization order...) 2011-03-13 16:31:51 -10:00
David Vierra
11695c48fd these strings need to be unicode because displayName is a filename 2011-03-11 05:12:55 -10:00
David Vierra
cb4fa95b24 added 'repair' command that scans region files for inconsistent chunk storage 2011-03-09 16:21:55 -10:00
David Vierra
1bf1cfa8b6 expanded block definitions to support blockData for colored wool and varied trees
textures are given as a pair of 0-255 pixel coordinates instead of combining them into one byte. the first coordinate of the pair is left-to-right on the terrain.png

added flat color definitions for low-detail rendering. color codes borrowed from c10t

block defs are now attrs of the MCMaterials objects.

fillBlocks now takes Block objects instead of block ID numbers
2011-03-09 13:05:23 -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
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
5ac521957b loadWorld is clearer and doesn't set self.filename any more 2011-02-09 18:26:32 -10:00
David Vierra
823349a5ee log heightmap progress with logger so it appears during regression tests 2011-02-07 21:16:44 -10:00
David Vierra
4dbccca9dd add property chunkCount because allChunks is now exposed as an iterator 2011-02-07 18:58:22 -10:00
David Vierra
ba33f6dcca xxx needed for material rename 2011-02-05 16:26:34 -10:00