diff --git a/mce.py b/mce.py index 8feb3e1..5d60e3d 100644 --- a/mce.py +++ b/mce.py @@ -32,6 +32,9 @@ class mce(object): {commandPrefix}prune {commandPrefix}relight [ ] + World commands: + {commandPrefix}degrief + Editor commands: {commandPrefix}save {commandPrefix}reload @@ -79,6 +82,8 @@ class mce(object): "prune", "relight", + "degrief", + "save", "load", "reload", @@ -512,6 +517,39 @@ class mce(object): print "Relit 0 chunks." + def _degrief(self, command): + """ + degrief [ ] + + Reverse a few forms of griefing by removing + Adminium, Obsidian, Fire, and Lava wherever + they occur above the specified height. + Without a height, uses height level 32. + + Removes natural surface lava. + + Also see removeEntities + """ + box = self.level.getWorldBounds(); + box.miny = 32 + if len(command): + try: + box.miny = int(command[0]) + except ValueError: + pass + + print "Removing grief matter and surface lava above height {0}...".format(box.miny) + + self.level.fillBlocks(box, + self.level.materials.materialNamed("Air"), + blocksToReplace=[self.level.materials.materialNamed("Adminium"), + self.level.materials.materialNamed("Obsidian"), + self.level.materials.materialNamed("Fire"), + self.level.materials.materialNamed("Lava"), + self.level.materials.materialNamed("Stationary lava"), + ] + ) + def _quit(self, command): """ quit [ yes | no ]