Print entity debug stacktrace on entity double add (#2438)

This commit is contained in:
Spottedleaf
2019-08-14 19:37:07 -07:00
parent 2ecd461296
commit ada657bafd
9 changed files with 32 additions and 15 deletions

View File

@@ -72,7 +72,7 @@ index 65df0e7c8c..abddc8895e 100644
});
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9d92fb2a3f..c791ab686e 100644
index b01af00c86..192b3be1f0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World {
@@ -80,9 +80,9 @@ index 9d92fb2a3f..c791ab686e 100644
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
+ if (entity.spawnReason == null) entity.spawnReason = spawnReason; // Paper
if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
if (entity.dead) {
// Paper start
// Paper start
if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 1cd3448e57..15042943c9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java