--- a/net/minecraft/server/WorldGenTreeProvider.java +++ b/net/minecraft/server/WorldGenTreeProvider.java @@ -3,6 +3,7 @@ import java.util.Iterator; import java.util.Random; import javax.annotation.Nullable; +import org.bukkit.TreeType; // CraftBukkit public abstract class WorldGenTreeProvider { @@ -17,6 +18,7 @@ if (worldgenfeatureconfigured == null) { return false; } else { + setTreeType(worldgenfeatureconfigured); // CraftBukkit worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4); ((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b(); if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) { @@ -43,4 +45,46 @@ return true; } + + // CraftBukkit start + protected void setTreeType(WorldGenFeatureConfigured worldgentreeabstract) { + if (worldgentreeabstract.f == BiomeDecoratorGroups.OAK || worldgentreeabstract.f == BiomeDecoratorGroups.OAK_BEES_005) { + BlockSapling.treeType = TreeType.TREE; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.HUGE_RED_MUSHROOM) { + BlockSapling.treeType = TreeType.RED_MUSHROOM; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM) { + BlockSapling.treeType = TreeType.BROWN_MUSHROOM; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_TREE) { + BlockSapling.treeType = TreeType.COCOA_TREE; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_TREE_NO_VINE) { + BlockSapling.treeType = TreeType.SMALL_JUNGLE; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.PINE) { + BlockSapling.treeType = TreeType.TALL_REDWOOD; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SPRUCE) { + BlockSapling.treeType = TreeType.REDWOOD; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.ACACIA) { + BlockSapling.treeType = TreeType.ACACIA; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.BIRCH || worldgentreeabstract.f == BiomeDecoratorGroups.BIRCH_BEES_005) { + BlockSapling.treeType = TreeType.BIRCH; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SUPER_BIRCH_BEES_0002) { + BlockSapling.treeType = TreeType.TALL_BIRCH; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SWAMP_TREE) { + BlockSapling.treeType = TreeType.SWAMP; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.FANCY_OAK || worldgentreeabstract.f == BiomeDecoratorGroups.FANCY_OAK_BEES_005) { + BlockSapling.treeType = TreeType.BIG_TREE; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_BUSH) { + BlockSapling.treeType = TreeType.JUNGLE_BUSH; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.DARK_OAK) { + BlockSapling.treeType = TreeType.DARK_OAK; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_SPRUCE) { + BlockSapling.treeType = TreeType.MEGA_REDWOOD; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_PINE) { + BlockSapling.treeType = TreeType.MEGA_REDWOOD; + } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_JUNGLE_TREE) { + BlockSapling.treeType = TreeType.JUNGLE; + } else { + throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract); + } + } + // CraftBukkit end }