2022-11-25 07:32:29 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 18 Mar 2022 21:30:00 -0700
Subject: [PATCH] Fix async entity add due to fungus trees
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
2024-10-24 00:08:29 +02:00
index 5bf438bb58833c1df3620e82d3d2b90207366372..2e72e92762877b28dd908711671e1dfb933de9b0 100644
2022-11-25 07:32:29 +01:00
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
2024-06-14 03:30:23 +02:00
@@ -237,6 +237,7 @@ public class WorldGenRegion implements WorldGenLevel {
2022-11-25 07:32:29 +01:00
if (iblockdata.isAir()) {
return false;
} else {
2024-01-16 12:41:40 +01:00
+ if (drop) LOGGER.warn("Potential async entity add during worldgen", new Throwable()); // Paper - Fix async entity add due to fungus trees; log when this happens
2022-11-25 07:32:29 +01:00
if (false) { // CraftBukkit - SPIGOT-6833: Do not drop during world generation
BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
2024-10-24 00:08:29 +02:00
index 6baa06dc0f102fe83b10015dbbe1410066961c82..29825ea687827c075b87e88c45672e7b0093ed17 100644
2022-11-25 07:32:29 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
2024-06-14 03:30:23 +02:00
@@ -261,10 +261,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
2022-11-25 07:32:29 +01:00
((ChorusFlowerBlock) Blocks.CHORUS_FLOWER).generatePlant(access, pos, random, 8);
return true;
case CRIMSON_FUNGUS:
- gen = TreeFeatures.CRIMSON_FUNGUS_PLANTED;
2024-01-16 12:41:40 +01:00
+ gen = this.isNormalWorld() ? TreeFeatures.CRIMSON_FUNGUS_PLANTED : TreeFeatures.CRIMSON_FUNGUS; // Paper - Fix async entity add due to fungus trees; if world gen, don't use planted version
2022-11-25 07:32:29 +01:00
break;
case WARPED_FUNGUS:
- gen = TreeFeatures.WARPED_FUNGUS_PLANTED;
2024-01-16 12:41:40 +01:00
+ gen = this.isNormalWorld() ? TreeFeatures.WARPED_FUNGUS_PLANTED : TreeFeatures.WARPED_FUNGUS; // Paper - Fix async entity add due to fungus trees; if world gen, don't use planted version
2022-11-25 07:32:29 +01:00
break;
case AZALEA:
gen = TreeFeatures.AZALEA_TREE;