From 789ee71ee8e869e39242ad890b6ed5531788109d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 22:37:11 -0400 Subject: [PATCH] Remove the "Entity already removed" warning unless debug entities is on --- ...g-Entities-option-to-debug-dupe-uuid-issues.patch | 12 +++++++++--- .../Duplicate-UUID-Resolve-Option.patch | 2 +- .../Entity-add-to-world-fixes.patch | 2 +- ...-add-vanilla-entity-warnings-for-duplicates.patch | 11 +---------- ...by-packets-from-world-player-list-not-serve.patch | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 410d56e1eb..1358a99dfc 100644 --- a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -18,7 +18,7 @@ index 42c1c47c58..3606c78843 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b76b8dbf5d..709f3e525c 100644 +index 27278078e4..f6becaae43 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 implements IAsyncTaskHandler { @@ -33,10 +33,16 @@ index b76b8dbf5d..709f3e525c 100644 // Add env and gen to constructor public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, PersistentCollection persistentcollection, WorldData worlddata, DimensionManager dimensionmanager, MethodProfiler methodprofiler, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + private boolean j(Entity entity) { if (entity.dead) { - WorldServer.a.warn("Tried to add entity {} but it was marked as removed already: " + entity); // CraftBukkit // Paper -+ if (DEBUG_ENTITIES) getAddToWorldStackTrace(entity).printStackTrace(); +- // WorldServer.a.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.P())); // CraftBukkit ++ // Paper start ++ if (DEBUG_ENTITIES) { ++ new Throwable("Tried to add entity " + entity + " but it was marked as removed already").printStackTrace(); // CraftBukkit ++ getAddToWorldStackTrace(entity).printStackTrace(); ++ } ++ // Paper end return false; } else { UUID uuid = entity.getUniqueID(); diff --git a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch index 77a4280430..db1eb7c2af 100644 --- a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch @@ -193,7 +193,7 @@ index ee2cdb897c..956eabd7dc 100644 public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 709f3e525c..2692d0a1b6 100644 +index f6becaae43..f7078ded5c 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 implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch index 258d9ff825..d0030dfb54 100644 --- a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch @@ -68,7 +68,7 @@ index aa94e399af..85570e4a5d 100644 this.b(entity); }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2692d0a1b6..911d03c70b 100644 +index f7078ded5c..9cba1822bf 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 implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch index de62937faf..2f4459c2a4 100644 --- a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,18 +8,9 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b939c31b23..b76b8dbf5d 100644 +index b939c31b23..27278078e4 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 implements IAsyncTaskHandler { - - private boolean j(Entity entity) { - if (entity.dead) { -- // WorldServer.a.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.P())); // CraftBukkit -+ WorldServer.a.warn("Tried to add entity {} but it was marked as removed already: " + entity); // CraftBukkit // Paper - return false; - } else { - UUID uuid = entity.getUniqueID(); @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { diff --git a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch index 510ae63032..6006592c50 100644 --- a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch @@ -95,7 +95,7 @@ index e26405d341..23f390c221 100644 if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) { double d0 = (double) blockposition.getX() - entityplayer.locX; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 911d03c70b..f837e6c36c 100644 +index 9cba1822bf..14905fceb0 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 implements IAsyncTaskHandler {