Paper/nms-patches/WorldGenMegaTreeProvider.patch

27 lines
1.0 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/WorldGenMegaTreeProvider.java
+++ b/net/minecraft/server/WorldGenMegaTreeProvider.java
@@ -2,6 +2,7 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.TreeType; // CraftBukkit
public abstract class WorldGenMegaTreeProvider extends WorldGenTreeProvider {
@@ -28,6 +29,15 @@
if (worldgentreeabstract == null) {
return false;
} else {
+ // CraftBukkit start
+ if (worldgentreeabstract instanceof WorldGenJungleTree) {
+ BlockSapling.treeType = TreeType.JUNGLE;
+ } else if (worldgentreeabstract instanceof WorldGenMegaTree) {
+ BlockSapling.treeType = TreeType.MEGA_REDWOOD;
+ } else {
+ throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract);
+ }
+ // CraftBukkit end
IBlockData iblockdata1 = Blocks.AIR.getBlockData();
generatoraccess.setTypeAndData(blockposition.a(i, 0, j), iblockdata1, 4);