Commits

md_5 authored 22c3a2f9a5c
Fix crash growing saplings
No tags

nms-patches/WorldGenTreeProvider.patch

Modified
16 16 worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4);
17 17 ((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b();
18 18 if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) {
19 19 @@ -43,4 +45,46 @@
20 20
21 21 return true;
22 22 }
23 23 +
24 24 + // CraftBukkit start
25 25 + protected void setTreeType(WorldGenFeatureConfigured<?, ?> worldgentreeabstract) {
26 -+ if (worldgentreeabstract.f == BiomeDecoratorGroups.OAK || worldgentreeabstract.f == BiomeDecoratorGroups.OAK_BEES_005) {
26 ++ if (worldgentreeabstract == BiomeDecoratorGroups.OAK || worldgentreeabstract == BiomeDecoratorGroups.OAK_BEES_005) {
27 27 + BlockSapling.treeType = TreeType.TREE;
28 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.HUGE_RED_MUSHROOM) {
28 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.HUGE_RED_MUSHROOM) {
29 29 + BlockSapling.treeType = TreeType.RED_MUSHROOM;
30 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM) {
30 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM) {
31 31 + BlockSapling.treeType = TreeType.BROWN_MUSHROOM;
32 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_TREE) {
32 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_TREE) {
33 33 + BlockSapling.treeType = TreeType.COCOA_TREE;
34 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_TREE_NO_VINE) {
34 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_TREE_NO_VINE) {
35 35 + BlockSapling.treeType = TreeType.SMALL_JUNGLE;
36 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.PINE) {
36 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.PINE) {
37 37 + BlockSapling.treeType = TreeType.TALL_REDWOOD;
38 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SPRUCE) {
38 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.SPRUCE) {
39 39 + BlockSapling.treeType = TreeType.REDWOOD;
40 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.ACACIA) {
40 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.ACACIA) {
41 41 + BlockSapling.treeType = TreeType.ACACIA;
42 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.BIRCH || worldgentreeabstract.f == BiomeDecoratorGroups.BIRCH_BEES_005) {
42 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.BIRCH || worldgentreeabstract == BiomeDecoratorGroups.BIRCH_BEES_005) {
43 43 + BlockSapling.treeType = TreeType.BIRCH;
44 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SUPER_BIRCH_BEES_0002) {
44 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.SUPER_BIRCH_BEES_0002) {
45 45 + BlockSapling.treeType = TreeType.TALL_BIRCH;
46 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.SWAMP_TREE) {
46 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.SWAMP_TREE) {
47 47 + BlockSapling.treeType = TreeType.SWAMP;
48 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.FANCY_OAK || worldgentreeabstract.f == BiomeDecoratorGroups.FANCY_OAK_BEES_005) {
48 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.FANCY_OAK || worldgentreeabstract == BiomeDecoratorGroups.FANCY_OAK_BEES_005) {
49 49 + BlockSapling.treeType = TreeType.BIG_TREE;
50 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.JUNGLE_BUSH) {
50 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_BUSH) {
51 51 + BlockSapling.treeType = TreeType.JUNGLE_BUSH;
52 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.DARK_OAK) {
52 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.DARK_OAK) {
53 53 + BlockSapling.treeType = TreeType.DARK_OAK;
54 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_SPRUCE) {
54 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_SPRUCE) {
55 55 + BlockSapling.treeType = TreeType.MEGA_REDWOOD;
56 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_PINE) {
56 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_PINE) {
57 57 + BlockSapling.treeType = TreeType.MEGA_REDWOOD;
58 -+ } else if (worldgentreeabstract.f == BiomeDecoratorGroups.MEGA_JUNGLE_TREE) {
58 ++ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_JUNGLE_TREE) {
59 59 + BlockSapling.treeType = TreeType.JUNGLE;
60 60 + } else {
61 61 + throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract);
62 62 + }
63 63 + }
64 64 + // CraftBukkit end
65 65 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut