added randomseed command
This commit is contained in:
parent
de5854bd2a
commit
f8ee8ac66b
21
mce.py
21
mce.py
@ -50,6 +50,7 @@ class mce(object):
|
|||||||
{commandPrefix}time [ <time> ]
|
{commandPrefix}time [ <time> ]
|
||||||
{commandPrefix}worldsize
|
{commandPrefix}worldsize
|
||||||
{commandPrefix}heightmap <filename>
|
{commandPrefix}heightmap <filename>
|
||||||
|
{commandPrefix}randomseed [ <seed> ]
|
||||||
|
|
||||||
Editor commands:
|
Editor commands:
|
||||||
{commandPrefix}save
|
{commandPrefix}save
|
||||||
@ -79,6 +80,7 @@ class mce(object):
|
|||||||
"clone",
|
"clone",
|
||||||
"fill",
|
"fill",
|
||||||
"replace",
|
"replace",
|
||||||
|
|
||||||
"export",
|
"export",
|
||||||
"import",
|
"import",
|
||||||
|
|
||||||
@ -100,6 +102,7 @@ class mce(object):
|
|||||||
"time",
|
"time",
|
||||||
"worldsize",
|
"worldsize",
|
||||||
"heightmap",
|
"heightmap",
|
||||||
|
"randomseed",
|
||||||
|
|
||||||
"save",
|
"save",
|
||||||
"load",
|
"load",
|
||||||
@ -847,6 +850,24 @@ class mce(object):
|
|||||||
self.level.root_tag["Data"]["Time"].value = ticks
|
self.level.root_tag["Data"]["Time"].value = ticks
|
||||||
self.needsSave = True;
|
self.needsSave = True;
|
||||||
|
|
||||||
|
def _randomseed(self, command):
|
||||||
|
"""
|
||||||
|
randomseed [ <seed> ]
|
||||||
|
|
||||||
|
Set or display the world's random seed, a 64-bit integer that uniquely
|
||||||
|
defines the world's terrain.
|
||||||
|
"""
|
||||||
|
if len(command):
|
||||||
|
try:
|
||||||
|
seed = long(command[0]);
|
||||||
|
except ValueError:
|
||||||
|
raise UsageError, "Expected a long integer."
|
||||||
|
|
||||||
|
self.level.RandomSeed = seed;
|
||||||
|
|
||||||
|
else:
|
||||||
|
print "Random Seed: ", self.level.RandomSeed
|
||||||
|
|
||||||
def _worldsize(self, command):
|
def _worldsize(self, command):
|
||||||
"""
|
"""
|
||||||
worldsize
|
worldsize
|
||||||
|
Reference in New Issue
Block a user