From 5c4367f9d3e94751266c6f5640fef47a9a8a8baf Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 22:50:47 -0400 Subject: [PATCH] Add more entity debug info --- ...ies-option-to-debug-dupe-uuid-issues.patch | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/0336-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0336-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index c5f5055e2a..701004cc84 100644 --- a/Spigot-Server-Patches/0336-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0336-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -1,12 +1,31 @@ -From b061a231214e88cde43e0c3880f779723828b2b4 Mon Sep 17 00:00:00 2001 +From 46caf77f4a0b159f721e681f44228a02b3cfeee2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 08:25:40 -0400 Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index bcce5e8b7..f5b9aa561 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -351,6 +351,14 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + + while (iterator.hasNext()) { + Entity entity = (Entity) iterator.next(); ++ // Paper start ++ if (entity.getChunkX() != chunk.locX || entity.getChunkZ() != chunk.locZ) { ++ LogManager.getLogger().error(entity + " is not actually in this chunk! Report this to https://github.com/PaperMC/Paper/issues/1223", new Throwable()); ++ } ++ if ((int)Math.floor(entity.locX) >> 4 != chunk.locX || (int)Math.floor(entity.locZ) >> 4 != chunk.locZ) { ++ LogManager.getLogger().error(entity + " will be leaving this chunk but saved to it. Report this to https://github.com/PaperMC/Paper/issues/1223", new Throwable()); ++ } ++ // Paper end + + nbttagcompound1 = new NBTTagCompound(); + if (entity.d(nbttagcompound1)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f6b755863..108654d63 100644 +index 99dac412f..0d3af8cb7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -73,6 +73,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper