aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAikar <[email protected]>2019-03-04 23:44:24 -0500
committerAikar <[email protected]>2019-03-04 23:47:42 -0500
commit677997fa9eeed6b9f741f8d0c7d68f0a137d72c2 (patch)
tree3529fb02010bbba9e726135b149c25578821ad8d
parent0b1a9b2e8fe7387c68fc17ce134eb1949d5b0fb9 (diff)
downloadPaper-677997fa9eeed6b9f741f8d0c7d68f0a137d72c2.tar.gz
Paper-677997fa9eeed6b9f741f8d0c7d68f0a137d72c2.zip
Remove Entity slice debug logs
As per 1.13, we have no evidence these illegal states are causing issues we can identify, so just going to hide the fact its happening (but still have the code to auto fix it)
-rw-r--r--Spigot-Server-Patches/0340-Monitor-and-detect-illegal-Entity-slice-state.patch (renamed from Spigot-Server-Patches/0340-Add-some-Debug-to-Chunk-Entity-slices.patch)32
-rw-r--r--Spigot-Server-Patches/0347-Entity-add-to-world-fixes.patch14
-rw-r--r--Spigot-Server-Patches/0364-Backport-the-dupe-uuid-and-entity-log-changes.patch16
3 files changed, 26 insertions, 36 deletions
diff --git a/Spigot-Server-Patches/0340-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0340-Monitor-and-detect-illegal-Entity-slice-state.patch
index 271f4fb86b..3330f5f86d 100644
--- a/Spigot-Server-Patches/0340-Add-some-Debug-to-Chunk-Entity-slices.patch
+++ b/Spigot-Server-Patches/0340-Monitor-and-detect-illegal-Entity-slice-state.patch
@@ -1,18 +1,18 @@
-From cb60a9794593e7752a415d3f558e8b789054c2eb Mon Sep 17 00:00:00 2001
+From 3e0934988343ec1ba1f5950d8302636c306ebc0d Mon Sep 17 00:00:00 2001
From: Aikar <[email protected]>
Date: Mon, 23 Jul 2018 22:44:23 -0400
-Subject: [PATCH] Add some Debug to Chunk Entity slices
+Subject: [PATCH] Monitor and detect illegal Entity slice state
-If we detect unexpected state, log and try to recover
+If we detect unexpected state, try to recover
This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index ce66bb780d..2a5d1c90b4 100644
+index e5c900a85..e4d5e65c8 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
-@@ -681,8 +681,34 @@ public class Chunk {
+@@ -681,8 +681,27 @@ public class Chunk {
entity.ab = this.locX;
entity.ac = k;
entity.ad = this.locZ;
@@ -22,24 +22,17 @@ index ce66bb780d..2a5d1c90b4 100644
+ List<Entity> entitySlice = this.entitySlices[k];
+ boolean inThis = entitySlice.contains(entity);
+ List<Entity> currentSlice = entity.entitySlice;
-+ if ((currentSlice != null && currentSlice.contains(entity)) || inThis) {
++ if (inThis || (currentSlice != null && currentSlice.contains(entity))) {
+ if (currentSlice == entitySlice || inThis) {
-+ LogManager.getLogger().warn(entity + " was already in this chunk section! Report this to https://github.com/PaperMC/Paper/issues/1302");
-+ new Throwable().printStackTrace();
+ return;
+ } else {
-+ LogManager.getLogger().warn(entity + " is still in another ChunkSection! Report this to https://github.com/PaperMC/Paper/issues/1302");
-+
+ Chunk chunk = entity.getCurrentChunk();
+ if (chunk != null) {
-+ if (chunk != this) {
-+ LogManager.getLogger().warn(entity + " was in another chunk at that! " + chunk.locX + "," + chunk.locZ);
-+ }
+ chunk.removeEntity(entity);
+ } else {
+ removeEntity(entity);
+ }
-+ new Throwable().printStackTrace();
++ currentSlice.remove(entity); // Just incase the above did not remove from this target slice
+ }
+ }
+ entity.entitySlice = entitySlice;
@@ -48,20 +41,17 @@ index ce66bb780d..2a5d1c90b4 100644
this.markDirty();
entity.setCurrentChunk(this);
entityCounts.increment(entity.getMinecraftKeyString());
-@@ -725,6 +751,12 @@ public class Chunk {
+@@ -725,6 +744,9 @@ public class Chunk {
}
// Paper start
+ if (entity.entitySlice == null || !entity.entitySlice.contains(entity) || entitySlices[i] == entity.entitySlice) {
+ entity.entitySlice = null;
-+ } else {
-+ LogManager.getLogger().warn(entity + " was removed from a entitySlice we did not expect. Report this to https://github.com/PaperMC/Paper/issues/1302");
-+ new Throwable().printStackTrace();
+ }
if (!this.entitySlices[i].remove(entity)) { return; }
this.markDirty();
entity.setCurrentChunk(null);
-@@ -955,6 +987,7 @@ public class Chunk {
+@@ -955,6 +977,7 @@ public class Chunk {
}
// Spigot End
entity.setCurrentChunk(null); // Paper
@@ -70,7 +60,7 @@ index ce66bb780d..2a5d1c90b4 100644
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index eb8904a728..86b0b84335 100644
+index b761524f0..a2654690f 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -59,6 +59,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
@@ -82,5 +72,5 @@ index eb8904a728..86b0b84335 100644
static boolean isLevelAtLeast(NBTTagCompound tag, int level) {
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
--
-2.18.0
+2.21.0
diff --git a/Spigot-Server-Patches/0347-Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/0347-Entity-add-to-world-fixes.patch
index 506a7aae75..e0cdf53921 100644
--- a/Spigot-Server-Patches/0347-Entity-add-to-world-fixes.patch
+++ b/Spigot-Server-Patches/0347-Entity-add-to-world-fixes.patch
@@ -1,4 +1,4 @@
-From 28915916c310632997ed1146e1f86bc7d89ac53e Mon Sep 17 00:00:00 2001
+From 006c7fd9553064cea0bc6a4d4dc0afb7535e6de5 Mon Sep 17 00:00:00 2001
From: Aikar <[email protected]>
Date: Fri, 3 Aug 2018 22:47:46 -0400
Subject: [PATCH] Entity add to world fixes
@@ -14,10 +14,10 @@ Fix this by differing entity add to world for all entities at the same time
the original entity is dead, overwrite it as the logic does for unloaod queued entities.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index dfa4a4bf..523d10e8 100644
+index e4d5e65c8..0a3f00c3b 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
-@@ -889,6 +889,7 @@ public class Chunk {
+@@ -879,6 +879,7 @@ public class Chunk {
this.world.b(this.tileEntities.values());
List[] aentityslice = this.entitySlices; // Spigot
int i = aentityslice.length;
@@ -25,7 +25,7 @@ index dfa4a4bf..523d10e8 100644
for (int j = 0; j < i; ++j) {
List entityslice = aentityslice[j]; // Spigot
-@@ -936,10 +937,12 @@ public class Chunk {
+@@ -926,10 +927,12 @@ public class Chunk {
thisChunk.put(entity.uniqueID, entity);
}
}
@@ -41,7 +41,7 @@ index dfa4a4bf..523d10e8 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 4a16f7ac..04d0fa1d 100644
+index 4a16f7ac7..04d0fa1df 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1204,6 +1204,7 @@ public abstract class World implements IBlockAccess {
@@ -70,7 +70,7 @@ index 4a16f7ac..04d0fa1d 100644
}
this.entityList.add(entity);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
-index 1244baf4..a14b5e06 100644
+index 1244baf45..a14b5e061 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1173,7 +1173,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -83,5 +83,5 @@ index 1244baf4..a14b5e06 100644
} else {
if (!(entity instanceof EntityHuman)) {
--
-2.19.1
+2.21.0
diff --git a/Spigot-Server-Patches/0364-Backport-the-dupe-uuid-and-entity-log-changes.patch b/Spigot-Server-Patches/0364-Backport-the-dupe-uuid-and-entity-log-changes.patch
index 25e983ade1..cb49ba6f4d 100644
--- a/Spigot-Server-Patches/0364-Backport-the-dupe-uuid-and-entity-log-changes.patch
+++ b/Spigot-Server-Patches/0364-Backport-the-dupe-uuid-and-entity-log-changes.patch
@@ -1,11 +1,11 @@
-From 82ae87163d6936053ea6476cf58a3115948a1892 Mon Sep 17 00:00:00 2001
+From eb1f52537e3d7166a3d72850715cd6ec8d6c8160 Mon Sep 17 00:00:00 2001
From: Aikar <[email protected]>
Date: Fri, 12 Oct 2018 01:37:54 -0400
Subject: [PATCH] Backport the dupe uuid and entity log changes
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index ed147535..ba299afc 100644
+index ed1475351..ba299afc4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -543,7 +543,7 @@ public class PaperWorldConfig {
@@ -34,10 +34,10 @@ index ed147535..ba299afc 100644
case "remove":
case "delete":
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index 6541f5af..00c46fe5 100644
+index 4f88db79a..4060fd274 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
-@@ -888,7 +888,7 @@ public class Chunk {
+@@ -878,7 +878,7 @@ public class Chunk {
List entityslice = aentityslice[j]; // Spigot
// Paper start
DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode;
@@ -46,7 +46,7 @@ index 6541f5af..00c46fe5 100644
Map<UUID, Entity> thisChunk = new HashMap<>();
for (Iterator<Entity> iterator = ((List<Entity>) entityslice).iterator(); iterator.hasNext(); ) {
Entity entity = iterator.next();
-@@ -903,27 +903,26 @@ public class Chunk {
+@@ -893,27 +893,26 @@ public class Chunk {
&& java.util.Objects.equals(other.getSaveID(), entity.getSaveID())
&& entity.getBukkitEntity().getLocation().distance(other.getBukkitEntity().getLocation()) < world.paperConfig.duplicateUUIDDeleteRange
) {
@@ -80,7 +80,7 @@ index 6541f5af..00c46fe5 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index bcbdadbd..7633a613 100644
+index bcbdadbd3..7633a6134 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -45,6 +45,7 @@ public abstract class World implements IBlockAccess {
@@ -92,7 +92,7 @@ index bcbdadbd..7633a613 100644
{
@Override
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
-index b19942e0..d29420dd 100644
+index b19942e0f..d29420dd4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -54,7 +54,6 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -140,5 +140,5 @@ index b19942e0..d29420dd 100644
old.addedToWorldStack.printStackTrace();
} else {
--
-2.19.1
+2.21.0