954 Commits

Author SHA1 Message Date
David Vierra
a8d37bbfc6 added worldsize command 2010-10-23 17:27:27 -10:00
David Vierra
062f7eff46 catch all errors when trying to load a level 2010-10-23 17:27:04 -10:00
David Vierra
4f157e5b17 changed MCLevel.size into a property. 2010-10-23 17:26:26 -10:00
David Vierra
ead880dcc3 added a public isLevel method that can be called on a subclass of MCLevel that has one of the appropriate methods.
For example, MCInfdevOldLevel.isLevel("World4") will return True if World4 can be loaded using MCInfdevOldLevel("World4")
2010-10-23 17:25:38 -10:00
David Vierra
1869415a4e rearranged MCLevel.fromFile and changed the argument order for MCJavaLevel.__init__
now there are _isLevel, _isTagLevel and _isDataLevel methods on each class, called by fromFile to find out which level class can be used

the priority is hard-coded. data and root_tag are reused to prevent excessively reloading and unserializing data and tag structures.
2010-10-23 17:22:08 -10:00
David Vierra
d34b52b959 pulled create() out of MCInfdevOldLevel.__init__ 2010-10-23 17:19:24 -10:00
David Gilman
d4d9b35cd9 Added heightmap import command.
Heightmap opens a png and inserts it into the open map starting at chunk 0,0.  It requires PIL.
2010-10-23 17:13:17 -05:00
David Vierra
9dc288a638 display help message correctly in interactive mode 2010-10-22 18:07:34 -10:00
David Vierra
d834326942 attempted to document the new, more liberal box syntax 2010-10-21 20:58:12 -10:00
David Vierra
267ab2c4f2 createChunksInBox returns a list of created chunks 2010-10-21 20:48:34 -10:00
David Vierra
f5a272fc24 import operator, change splitting behavor of shlex in prettySplit 2010-10-21 20:45:07 -10:00
David Vierra
9956627842 truncate block types 2010-10-21 20:36:46 -10:00
David Vierra
066b1e6d0c fix the broken readIntPoint 2010-10-21 20:36:01 -10:00
David Vierra
c3ede6965d prettySplit function to re-split command on commas and parens 2010-10-21 20:35:46 -10:00
David Vierra
4ab7f09ce9 enforce integer input 2010-10-21 18:48:03 -10:00
David Vierra
943e9efddd count copied blocks in copyBlocksFromFinite 2010-10-21 18:47:49 -10:00
David Vierra
821201ddd6 UI tweaks 2010-10-21 18:47:28 -10:00
David Vierra
25ad51c8cb added createChest command and supporting function chestWithItemID 2010-10-21 18:47:01 -10:00
David Vierra
3eed2fe689 need to floor floating point values to get correct negative block coordinates 2010-10-21 18:46:14 -10:00
David Vierra
394d0b02f5 added readInt..... jeez, am i rebuilding a string scanner here? 2010-10-21 18:45:36 -10:00
David Vierra
b17618443f add new clone options to command summary 2010-10-21 18:44:26 -10:00
David Vierra
d67190a457 MCInfdevOldLevel now sets limits on the memory used by loaded and decompressed chunks.
Chunks are put into two queues and whenever either limit is reached, the oldest chunk is recompressed or unloaded.
2010-10-17 23:09:38 -10:00
David Vierra
d3d71d847e get the minecraftDir, too 2010-10-17 00:25:38 -10:00
David Vierra
dab9267014 use correct chunk attribute for block light 2010-10-15 22:52:32 -10:00
David Vierra
76379eef00 ensure dummy zero chunk is completely dark before lighting, or else light spills in from the dummy chunk 2010-10-15 22:47:40 -10:00
David Vierra
9941c17444 BlockLight does not have a light source :\ 2010-10-15 22:46:39 -10:00
David Vierra
2f1f140101 allow errors on loading level.dat to filter upward 2010-10-15 22:39:17 -10:00
David Vierra
8ffb8262da allow unicode filenames here, too 2010-10-15 22:06:33 -10:00
David Vierra
0269366aea need to update these checksums after bugfix... 2010-10-15 22:01:02 -10:00
David Vierra
29a3037554 mclevel.fromFile no longer takes last_played and random_seed arguments because it cannot implicitly create a level. 2010-10-15 22:00:00 -10:00
David Vierra
6e5110b532 fix logical errors in MCInfdevOldLevel.__init__ that were overwriting some level.dats
__init__ no longer has a root_tag arg, and has a create arg instead. if create is false, it will refuse to create a new alpha level.
2010-10-15 21:59:38 -10:00
David Vierra
a391b5dd12 added 'time' command 2010-10-15 20:35:07 -10:00
David Vierra
6bcfb0eb78 Added noair and nowater options for clone and import. 2010-10-15 18:55:30 -10:00
David Vierra
4cc5f05fa8 Need to import os 2010-10-15 16:02:08 -10:00
David Vierra
205e340aae Added a dummy generateLights for generic levels 2010-10-15 16:01:37 -10:00
David Vierra
0c56aa3536 catch ChunkMalformed in getAllChunkSlices 2010-10-15 16:00:27 -10:00
David Vierra
27ae6ee504 suppress these failure warnings 2010-10-14 22:07:32 -10:00
David Vierra
65443e1aa2 don't attempt to print this full path because of unicode errors during string format 2010-10-14 18:37:04 -10:00
David Vierra
2eb79cbf21 detect empty source boxes and respond by doing nothing 2010-10-14 18:36:35 -10:00
David Vierra
db032f403c unicode chunk-subdirectory strings (?????) 2010-10-14 14:54:46 -10:00
David Vierra
aa6f39f15f clamp source box of extractSchematic
return a schematic of the desired shape filled with air in the parts where there was nothing to extract
2010-10-14 14:54:30 -10:00
David Vierra
584b8a30b4 don't adjust minimum edge when adjusting maximum edges 2010-10-14 14:53:06 -10:00
David Vierra
9d8d14b5bd Get the save directory path in unicode on win32 systems 2010-10-14 14:52:42 -10:00
David Vierra
717e9384cd limit length of blocktype array to 256 2010-10-13 16:24:24 -10:00
David Vierra
e0b18c4ee0 changed more strings to unicode
I wonder if this is really needed. It seems like when filenames are in unicode, i have to format them into unicode strings or get an encoding error...
2010-10-13 13:06:22 -10:00
David Vierra
f4b439c222 catch chunk errors during relight 2010-10-12 23:07:25 -10:00
David Vierra
acfe936056 i have absolutely no idea why this function gets called on a malformed chunk that was already culled, but whatever 2010-10-12 14:05:23 -10:00
David Vierra
bdd85b7336 catch chunk loading errors here
todo: find a better way to deal with malformed and absent chunks in general
2010-10-12 14:04:58 -10:00
David Vierra
00509546b3 create a new function readBox in anticipation of better box specifiers 2010-10-11 22:59:40 -10:00
David Vierra
11048d9d74 Newly created chunks' initial lights are fully bright 2010-10-10 21:56:24 -10:00