0

Create RegionSets via the World object

This commit is contained in:
Andrew Chin
2012-01-21 19:04:21 -05:00
parent c63029a14d
commit 163dd66a38
5 changed files with 23 additions and 11 deletions

View File

@@ -9,7 +9,10 @@ def validateWorldPath(name, **kwargs):
world = kwargs.get('world', dict())
if name not in world.keys():
raise ValidationException("bad world name")
return os.path.abspath(world[name])
abs_path = os.path.abspath(world[name])
if not os.path.exists(os.path.join(abs_path, "level.dat")):
raise ValidationException("No level.dat file in %r. Check the path for world %r" % (abs_path, name))
return abs_path
def validateRenderMode(mode, **kwargs):
@@ -94,3 +97,9 @@ def validateInt(i, **kwargs):
def validateStr(s, **kwargs):
return str(s)
def validateDimension(d, **kwargs):
if d in ["nether", "overworld", "end", "default"]:
return d
raise ValidationException("%r is not a valid dimension" % d)