3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-17 12:00:07 +01:00

SPIGOT-4160: StructureGrowEvent not triggering for giant trees

Dieser Commit ist enthalten in:
md_5 2018-07-27 19:16:12 +10:00
Ursprung 095239d4c5
Commit 0891fc1c45
2 geänderte Dateien mit 27 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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) {