Add 1.16 tree types (#757)

This commit is contained in:
Aurora
2020-11-23 19:04:34 +01:00
committed by GitHub
parent 202631ca26
commit 11f50f8b53
2 changed files with 24 additions and 21 deletions

View File

@ -82,10 +82,12 @@ public class TreeGenerator {
JUNGLE_BUSH("Jungle bush", "junglebush", "jungleshrub"),
RED_MUSHROOM("Red mushroom", "redmushroom", "redgiantmushroom"),
BROWN_MUSHROOM("Brown mushroom", "brownmushroom", "browngiantmushroom"),
CRIMSON_FUNGUS("Crimson fungus", "crimsonfungus", "rednethermushroom"),
WARPED_FUNGUS("Warped fungus", "warpedfungus", "greennethermushroom"),
RANDOM_MUSHROOM("Random mushroom", "randmushroom", "randommushroom") {
@Override
public boolean generate(EditSession editSession, BlockVector3 pos) throws MaxChangedBlocksException {
TreeType[] choices = { RED_MUSHROOM, BROWN_MUSHROOM };
TreeType[] choices = { RED_MUSHROOM, BROWN_MUSHROOM, CRIMSON_FUNGUS, WARPED_FUNGUS };
return choices[TreeGenerator.RANDOM.nextInt(choices.length)].generate(editSession, pos);
}
},
@ -99,6 +101,13 @@ public class TreeGenerator {
return true;
}
},
CHORUS_PLANT("Chorus plant", "chorusplant") {
@Override
public boolean generate(EditSession editSession, BlockVector3 pos) throws MaxChangedBlocksException {
// chorus plants have to generate starting in the end stone itself, not the air above the ground
return editSession.getWorld().generateTree(this, editSession, pos.subtract(0, 1, 0));
}
},
RANDOM("Random tree", "rand", "random") {
@Override
public boolean generate(EditSession editSession, BlockVector3 pos) throws MaxChangedBlocksException {