mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Add more random tree types.
This commit is contained in:
parent
e6662d7519
commit
b4d574273d
@ -298,6 +298,9 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM, TreeType.BROWN_MUSHROOM);
|
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM, TreeType.BROWN_MUSHROOM);
|
||||||
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_REDWOOD, TreeType.REDWOOD);
|
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_REDWOOD, TreeType.REDWOOD);
|
||||||
treeTypeMapping.put(TreeGenerator.TreeType.PINE, TreeType.REDWOOD);
|
treeTypeMapping.put(TreeGenerator.TreeType.PINE, TreeType.REDWOOD);
|
||||||
|
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_BIRCH, TreeType.BIRCH);
|
||||||
|
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_JUNGLE, TreeType.JUNGLE);
|
||||||
|
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_MUSHROOM, TreeType.BROWN_MUSHROOM);
|
||||||
for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) {
|
for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) {
|
||||||
if (treeTypeMapping.get(type) == null) {
|
if (treeTypeMapping.get(type) == null) {
|
||||||
WorldEdit.logger.severe("No TreeType mapping for TreeGenerator.TreeType." + type);
|
WorldEdit.logger.severe("No TreeType mapping for TreeGenerator.TreeType." + type);
|
||||||
|
@ -41,20 +41,20 @@ public class TreeGenerator {
|
|||||||
BIG_TREE("Large oak tree", "largeoak", "bigoak", "big", "bigtree"),
|
BIG_TREE("Large oak tree", "largeoak", "bigoak", "big", "bigtree"),
|
||||||
REDWOOD("Spruce tree", "spruce", "redwood", "sequoia", "sequoioideae"),
|
REDWOOD("Spruce tree", "spruce", "redwood", "sequoia", "sequoioideae"),
|
||||||
TALL_REDWOOD("Tall spruce tree", "tallspruce", "bigspruce", "tallredwood", "tallsequoia", "tallsequoioideae"),
|
TALL_REDWOOD("Tall spruce tree", "tallspruce", "bigspruce", "tallredwood", "tallsequoia", "tallsequoioideae"),
|
||||||
BIRCH("Birch tree", "birch", "white", "whitebark"),
|
MEGA_REDWOOD("Large spruce tree", "largespruce", "megaredwood"),
|
||||||
PINE("Pine tree", "pine") {
|
|
||||||
@Override
|
|
||||||
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
|
||||||
makePineTree(editSession, pos);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
RANDOM_REDWOOD("Random spruce tree", "randspruce", "randredwood", "randomredwood", "anyredwood") {
|
RANDOM_REDWOOD("Random spruce tree", "randspruce", "randredwood", "randomredwood", "anyredwood") {
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
TreeType[] choices = new TreeType[] {
|
TreeType[] choices = { REDWOOD, TALL_REDWOOD, MEGA_REDWOOD };
|
||||||
TreeType.REDWOOD, TreeType.TALL_REDWOOD
|
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
||||||
};
|
}
|
||||||
|
},
|
||||||
|
BIRCH("Birch tree", "birch", "white", "whitebark"),
|
||||||
|
TALL_BIRCH("Tall birch tree", "tallbirch"),
|
||||||
|
RANDOM_BIRCH("Random birch tree", "randbirch", "randombirch") {
|
||||||
|
@Override
|
||||||
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
|
TreeType[] choices = { BIRCH, TALL_BIRCH };
|
||||||
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -66,21 +66,37 @@ public class TreeGenerator {
|
|||||||
return SMALL_JUNGLE.generate(editSession, pos);
|
return SMALL_JUNGLE.generate(editSession, pos);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
RANDOM_JUNGLE("Random jungle tree", "randjungle", "randomjungle") {
|
||||||
|
@Override
|
||||||
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
|
TreeType[] choices = { JUNGLE, SMALL_JUNGLE };
|
||||||
|
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
||||||
|
}
|
||||||
|
},
|
||||||
JUNGLE_BUSH("Jungle bush", "junglebush", "jungleshrub"),
|
JUNGLE_BUSH("Jungle bush", "junglebush", "jungleshrub"),
|
||||||
RED_MUSHROOM("Red mushroom", "redmushroom", "redgiantmushroom"),
|
RED_MUSHROOM("Red mushroom", "redmushroom", "redgiantmushroom"),
|
||||||
BROWN_MUSHROOM("Brown mushroom", "brownmushroom", "browngiantmushroom"),
|
BROWN_MUSHROOM("Brown mushroom", "brownmushroom", "browngiantmushroom"),
|
||||||
|
RANDOM_MUSHROOM("Random mushroom", "randmushroom", "randommushroom") {
|
||||||
|
@Override
|
||||||
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
|
TreeType[] choices = { RED_MUSHROOM, BROWN_MUSHROOM };
|
||||||
|
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
||||||
|
}
|
||||||
|
},
|
||||||
SWAMP("Swamp tree", "swamp", "swamptree"),
|
SWAMP("Swamp tree", "swamp", "swamptree"),
|
||||||
ACACIA("Acacia tree", "acacia"),
|
ACACIA("Acacia tree", "acacia"),
|
||||||
DARK_OAK("Dark oak tree", "darkoak"),
|
DARK_OAK("Dark oak tree", "darkoak"),
|
||||||
MEGA_REDWOOD("Large spruce tree", "largespruce", "megaredwood"),
|
PINE("Pine tree", "pine") {
|
||||||
TALL_BIRCH("Tall birch tree", "tallbirch"),
|
@Override
|
||||||
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
|
makePineTree(editSession, pos);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
RANDOM("Random tree", "rand", "random") {
|
RANDOM("Random tree", "rand", "random") {
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException {
|
||||||
TreeType[] choices = new TreeType[] {
|
TreeType[] choices = TreeType.values();
|
||||||
TreeType.TREE, TreeType.BIG_TREE, TreeType.BIRCH,
|
|
||||||
TreeType.REDWOOD, TreeType.TALL_REDWOOD, TreeType.PINE
|
|
||||||
};
|
|
||||||
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user