本文整理汇总了Java中org.bukkit.TreeType.JUNGLE属性的典型用法代码示例。如果您正苦于以下问题:Java TreeType.JUNGLE属性的具体用法?Java TreeType.JUNGLE怎么用?Java TreeType.JUNGLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.TreeType
的用法示例。
在下文中一共展示了TreeType.JUNGLE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populate
@Override
public void populate(World world, Random random, Chunk chunk) {
int worldChunkX = chunk.getX();
int worldChunkZ = chunk.getZ();
TreeType[] treeTypes = new TreeType[] {};
int treesPerChunk = 0;
switch (world.getBiome(worldChunkX, worldChunkZ)) {
case EXTREME_HILLS:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 1;
break;
case FOREST: case FOREST_HILLS:
treeTypes = new TreeType[] {TreeType.TREE, TreeType.BIRCH};
treesPerChunk = 8;
break;
case FROZEN_OCEAN:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 1;
break;
case FROZEN_RIVER:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 1;
break;
case ICE_MOUNTAINS:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 2;
break;
case ICE_PLAINS:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 1;
break;
case JUNGLE: case JUNGLE_HILLS:
treeTypes = new TreeType[] {TreeType.JUNGLE, TreeType.SMALL_JUNGLE, TreeType.JUNGLE_BUSH};
treesPerChunk = 4;
break;
case MUSHROOM_ISLAND: case MUSHROOM_SHORE:
treeTypes = new TreeType[] {TreeType.RED_MUSHROOM, TreeType.BROWN_MUSHROOM};
treesPerChunk = 4;
break;
case RIVER:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 4;
break;
case SMALL_MOUNTAINS:
treeTypes = new TreeType[] {TreeType.TREE};
treesPerChunk = 1;
break;
case SWAMPLAND:
treeTypes = new TreeType[] {TreeType.SWAMP};
break;
case TAIGA: case TAIGA_HILLS:
treeTypes = new TreeType[] {TreeType.REDWOOD, TreeType.TALL_REDWOOD};
break;
default:
break;
}
if (treeTypes.length > 0 && treesPerChunk != 0) {
for (int i = 0; i < treesPerChunk; i++) {
world.generateTree(world.getHighestBlockAt(worldChunkX + random.nextInt(16), worldChunkZ + random.nextInt(16)).getLocation(), treeTypes[random.nextInt(treeTypes.length)]);
}
}
}