summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-27 19:16:12 +1000
committermd_5 <git@md-5.net>2018-07-27 19:16:16 +1000
commit0891fc1c4577ab8786683f2e1b1ec0e03e10bacd (patch)
treec28f5a666ca8edfaf28dacbc16e59b19237b2d94 /nms-patches
parent095239d4c56519b1236eb200900f4034a8dd4a4d (diff)
downloadcraftbukkit-0891fc1c4577ab8786683f2e1b1ec0e03e10bacd.tar
craftbukkit-0891fc1c4577ab8786683f2e1b1ec0e03e10bacd.tar.gz
craftbukkit-0891fc1c4577ab8786683f2e1b1ec0e03e10bacd.tar.lz
craftbukkit-0891fc1c4577ab8786683f2e1b1ec0e03e10bacd.tar.xz
craftbukkit-0891fc1c4577ab8786683f2e1b1ec0e03e10bacd.zip
SPIGOT-4160: StructureGrowEvent not triggering for giant trees
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/WorldGenMegaTreeProvider.patch26
-rw-r--r--nms-patches/WorldGenTreeProvider.patch6
2 files changed, 27 insertions, 5 deletions
diff --git a/nms-patches/WorldGenMegaTreeProvider.patch b/nms-patches/WorldGenMegaTreeProvider.patch
new file mode 100644
index 00000000..66577618
--- /dev/null
+++ b/nms-patches/WorldGenMegaTreeProvider.patch
@@ -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);
diff --git a/nms-patches/WorldGenTreeProvider.patch b/nms-patches/WorldGenTreeProvider.patch
index c8da90ac..41d9998c 100644
--- a/nms-patches/WorldGenTreeProvider.patch
+++ b/nms-patches/WorldGenTreeProvider.patch
@@ -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) {