Add TreeGen back in so GenerateTool doesn't crash on zero generator classes.
xxx allow zero generator classes
This commit is contained in:
parent
cd7b75d832
commit
1be1d81fc1
@ -128,9 +128,9 @@ class TreeGen(GeneratePlugin):
|
|||||||
self.optionsWidget = widget
|
self.optionsWidget = widget
|
||||||
return widget
|
return widget
|
||||||
|
|
||||||
def generate(self, bounds, blocktypes):
|
def generateInSchematic(self, dim):
|
||||||
schematic = createSchematic(bounds.size, blocktypes)
|
bounds = dim.bounds
|
||||||
dim = schematic.getDimension()
|
blocktypes = dim.blocktypes
|
||||||
|
|
||||||
trunkX = int(bounds.width / 2)
|
trunkX = int(bounds.width / 2)
|
||||||
trunkZ = int(bounds.length / 2)
|
trunkZ = int(bounds.length / 2)
|
||||||
@ -143,14 +143,13 @@ class TreeGen(GeneratePlugin):
|
|||||||
dim.setBlocks(range(0, bounds.width), [range(crownBottom, bounds.height)], [[range(0, bounds.length)]], leaves)
|
dim.setBlocks(range(0, bounds.width), [range(crownBottom, bounds.height)], [[range(0, bounds.length)]], leaves)
|
||||||
dim.setBlocks(trunkX, range(0, bounds.height), trunkZ, wood)
|
dim.setBlocks(trunkX, range(0, bounds.height), trunkZ, wood)
|
||||||
|
|
||||||
return schematic
|
|
||||||
|
|
||||||
_pluginClasses = []
|
_pluginClasses = []
|
||||||
|
|
||||||
def registerGeneratePlugin(cls):
|
def registerGeneratePlugin(cls):
|
||||||
_pluginClasses.append(cls)
|
_pluginClasses.append(cls)
|
||||||
|
|
||||||
#_pluginClasses.append(TreeGen)
|
_pluginClasses.append(TreeGen)
|
||||||
|
|
||||||
class GenerateTool(EditorTool):
|
class GenerateTool(EditorTool):
|
||||||
name = "Generate"
|
name = "Generate"
|
||||||
|
Reference in New Issue
Block a user