Java Code Examples for cn.nukkit.block.BlockSapling#OAK

The following examples show how to use cn.nukkit.block.BlockSapling#OAK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ObjectTree.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public static void growTree(ChunkManager level, int x, int y, int z, NukkitRandom random, int type) {
    ObjectTree tree;
    switch (type) {
        case BlockSapling.SPRUCE:
            tree = new ObjectSpruceTree();
            break;
        case BlockSapling.BIRCH:
            tree = new ObjectBirchTree();
            break;
        case BlockSapling.JUNGLE:
            tree = new ObjectJungleTree();
            break;
        case BlockSapling.BIRCH_TALL:
            tree = new ObjectTallBirchTree();
            break;
        case BlockSapling.OAK:
        default:
            tree = new ObjectOakTree();
            //todo: more complex treeeeeeeeeeeeeeeee
            break;
    }

    if (tree.canPlaceObject(level, x, y, z, random)) {
        tree.placeObject(level, x, y, z, random);
    }
}
 
Example 2
Source File: ForestBiome.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public ForestBiome(int type) {
    super();

    this.type = type;

    PopulatorTree trees = new PopulatorTree(type == TYPE_BIRCH_TALL ? BlockSapling.BIRCH_TALL : BlockSapling.BIRCH);
    trees.setBaseAmount(type == TYPE_NORMAL ? 3 : 6);
    this.addPopulator(trees);

    if (type == TYPE_NORMAL) {
        //normal forest biomes have both oak and birch trees
        trees = new PopulatorTree(BlockSapling.OAK);
        trees.setBaseAmount(3);
        this.addPopulator(trees);
    }
}
 
Example 3
Source File: ForestBiome.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
public ForestBiome(int type) {
    super();

    this.type = type;

    PopulatorTree trees = new PopulatorTree(type == TYPE_BIRCH ? BlockSapling.BIRCH : BlockSapling.OAK);
    trees.setBaseAmount(5);
    this.addPopulator(trees);

    PopulatorGrass grass = new PopulatorGrass();
    grass.setBaseAmount(30);
    this.addPopulator(grass);

    PopulatorTallGrass tallGrass = new PopulatorTallGrass();
    tallGrass.setBaseAmount(3);

    this.addPopulator(tallGrass);

    this.setElevation(63, 81);

    if (type == TYPE_BIRCH) {
        this.temperature = 0.5;
        this.rainfall = 0.5;
    } else {
        this.temperature = 0.7;
        this.temperature = 0.8;
    }
}
 
Example 4
Source File: ObjectTree.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
public static void growTree(ChunkManager level, int x, int y, int z, NukkitRandom random, int type) {
    ObjectTree tree;
    switch (type) {
        case BlockSapling.SPRUCE:
            if (random.nextBoundedInt(39) == 0) {
                tree = new ObjectSpruceTree();
            } else {
                tree = new ObjectSpruceTree();
            }
            break;
        case BlockSapling.BIRCH:
            if (random.nextBoundedInt(39) == 0) {
                tree = new ObjectTallBirchTree();
            } else {
                tree = new ObjectBirchTree();
            }
            break;
        case BlockSapling.JUNGLE:
            tree = new ObjectJungleTree();
            break;
        case BlockSapling.OAK:
        default:
            tree = new ObjectOakTree();
            //todo: more complex treeeeeeeeeeeeeeeee
            break;
    }

    if (tree.canPlaceObject(level, x, y, z, random)) {
        tree.placeObject(level, x, y, z, random);
    }
}
 
Example 5
Source File: MesaPlateauFBiome.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
public MesaPlateauFBiome() {
    super();

    PopulatorTree tree = new PopulatorTree(BlockSapling.OAK);
    tree.setBaseAmount(2);
    tree.setRandomAmount(1);
    this.addPopulator(tree);
}
 
Example 6
Source File: ForestBiome.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
public ForestBiome(int type) {
    super();

    this.type = type;

    PopulatorTree trees = new PopulatorTree(type == TYPE_BIRCH ? BlockSapling.BIRCH : BlockSapling.OAK);
    trees.setBaseAmount(5);
    this.addPopulator(trees);

    PopulatorGrass grass = new PopulatorGrass();
    grass.setBaseAmount(30);
    this.addPopulator(grass);

    PopulatorTallGrass tallGrass = new PopulatorTallGrass();
    tallGrass.setBaseAmount(3);

    this.addPopulator(tallGrass);

    this.setElevation(63, 81);

    if (type == TYPE_BIRCH) {
        this.temperature = 0.5;
        this.rainfall = 0.5;
    } else {
        this.temperature = 0.7;
        this.temperature = 0.8;
    }
}
 
Example 7
Source File: ObjectTree.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
public static void growTree(ChunkManager level, int x, int y, int z, NukkitRandom random, int type) {
    ObjectTree tree;
    switch (type) {
        case BlockSapling.SPRUCE:
            if (random.nextBoundedInt(39) == 0) {
                tree = new ObjectSpruceTree();
            } else {
                tree = new ObjectSpruceTree();
            }
            break;
        case BlockSapling.BIRCH:
            if (random.nextBoundedInt(39) == 0) {
                tree = new ObjectTallBirchTree();
            } else {
                tree = new ObjectBirchTree();
            }
            break;
        case BlockSapling.JUNGLE:
            tree = new ObjectJungleTree();
            break;
        case BlockSapling.OAK:
        default:
            tree = new ObjectOakTree();
            //todo: more complex treeeeeeeeeeeeeeeee
            break;
    }

    if (tree.canPlaceObject(level, x, y, z, random)) {
        tree.placeObject(level, x, y, z, random);
    }
}
 
Example 8
Source File: PopulatorTree.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public PopulatorTree() {
    this(BlockSapling.OAK);
}
 
Example 9
Source File: SwampTreePopulator.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public SwampTreePopulator() {
    this(BlockSapling.OAK);
}
 
Example 10
Source File: PopulatorTree.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PopulatorTree() {
    this(BlockSapling.OAK);
}
 
Example 11
Source File: SwampTreePopulator.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public SwampTreePopulator() {
    this(BlockSapling.OAK);
}
 
Example 12
Source File: PopulatorTree.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PopulatorTree() {
    this(BlockSapling.OAK);
}
 
Example 13
Source File: SwampTreePopulator.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public SwampTreePopulator() {
    this(BlockSapling.OAK);
}