mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 08:56:23 +01:00
SPIGOT-4160: StructureGrowEvent not triggering for giant trees
This commit is contained in:
parent
095239d4c5
commit
0891fc1c45
2 changed files with 27 additions and 5 deletions
26
nms-patches/WorldGenMegaTreeProvider.patch
Normal file
26
nms-patches/WorldGenMegaTreeProvider.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
--- 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);
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
public abstract class WorldGenTreeProvider {
|
||||
|
||||
@@ -16,6 +17,29 @@
|
||||
@@ -16,6 +17,25 @@
|
||||
if (worldgentreeabstract == null) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -21,10 +21,6 @@
|
|||
+ BlockSapling.treeType = TreeType.BIRCH;
|
||||
+ } else if (worldgentreeabstract instanceof WorldGenForestTree) {
|
||||
+ BlockSapling.treeType = TreeType.DARK_OAK;
|
||||
+ } else if (worldgentreeabstract instanceof WorldGenJungleTree) {
|
||||
+ BlockSapling.treeType = TreeType.JUNGLE;
|
||||
+ } else if (worldgentreeabstract instanceof WorldGenMegaTree) {
|
||||
+ BlockSapling.treeType = TreeType.MEGA_REDWOOD;
|
||||
+ } else if (worldgentreeabstract instanceof WorldGenTaiga1) {
|
||||
+ BlockSapling.treeType = TreeType.REDWOOD;
|
||||
+ } else if (worldgentreeabstract instanceof WorldGenTaiga2) {
|
||||
|
|
Loading…
Reference in a new issue