Remove ChunkSection debug - #1302

While these logs indicate something is 'off', we've had no reports
of visible 'issues' with entities, and no one is going to take the
time to debug this farther, so just getting rid of the logs so it's
like its never happening!

Ignorance is bliss.
This commit is contained in:
Aikar 2019-02-23 12:24:23 -05:00
parent 17b58d00d8
commit 7ab257e4f1
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
3 changed files with 15 additions and 25 deletions

View File

@ -1,4 +1,4 @@
From 668a1de336154c1375df2341f437b33e9f398e05 Mon Sep 17 00:00:00 2001
From abf1bf94c272bcaf8daf2d6e5252e54a426bf936 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:44:23 -0400
Subject: [PATCH] Add some Debug to Chunk Entity slices
@ -9,10 +9,10 @@ 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 42b76b212..ca236a315 100644
index 42b76b2122..1c9e2cb1ce 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -714,8 +714,34 @@ public class Chunk implements IChunkAccess {
@@ -714,8 +714,27 @@ public class Chunk implements IChunkAccess {
entity.chunkX = this.locX;
entity.chunkY = k;
entity.chunkZ = this.locZ;
@ -24,17 +24,10 @@ index 42b76b212..ca236a315 100644
+ List<Entity> currentSlice = entity.entitySlice;
+ if ((currentSlice != null && currentSlice.contains(entity)) || inThis) {
+ 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);
@ -48,7 +41,7 @@ index 42b76b212..ca236a315 100644
this.markDirty();
if (entity instanceof EntityItem) {
itemCounts[k]++;
@@ -745,9 +771,13 @@ public class Chunk implements IChunkAccess {
@@ -745,9 +764,10 @@ public class Chunk implements IChunkAccess {
i = this.entitySlices.length - 1;
}
// Paper start
@ -56,15 +49,12 @@ index 42b76b212..ca236a315 100644
- return;
+ 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();
if (entity instanceof EntityItem) {
itemCounts[i]--;
@@ -1028,6 +1058,7 @@ public class Chunk implements IChunkAccess {
@@ -1028,6 +1048,7 @@ public class Chunk implements IChunkAccess {
}
// Spigot End
entity.setCurrentChunk(null); // Paper
@ -73,7 +63,7 @@ index 42b76b212..ca236a315 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 12ab5def2..50e616179 100644
index 61a547a40d..15a81d1eb9 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -62,6 +62,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

View File

@ -1,4 +1,4 @@
From 53c212aceb5442fc775470aefd2a3160946881e8 Mon Sep 17 00:00:00 2001
From e3b5379cd5d3c1a87616e9bec80bdb6b9dfbac86 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 3 Aug 2018 22:47:46 -0400
Subject: [PATCH] Entity add to world fixes
@ -14,7 +14,7 @@ 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 ca236a315..edf4d9130 100644
index 1c9e2cb1ce..d22e83f3c6 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -2,6 +2,8 @@ package net.minecraft.server;
@ -26,7 +26,7 @@ index ca236a315..edf4d9130 100644
import java.util.HashMap;
import java.util.UUID;
// Paper end
@@ -964,15 +966,16 @@ public class Chunk implements IChunkAccess {
@@ -954,15 +956,16 @@ public class Chunk implements IChunkAccess {
// Paper end
// CraftBukkit start
@ -53,7 +53,7 @@ index ca236a315..edf4d9130 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 74e1f4810..db130852f 100644
index 74e1f48105..db130852f8 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1037,6 +1037,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -79,7 +79,7 @@ index 74e1f4810..db130852f 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 a896f8fe4..609be457a 100644
index a896f8fe46..609be457ab 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -968,7 +968,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View File

@ -1,4 +1,4 @@
From b50cd605c8fcdb6b00a8adb40b8e3db7b39562c2 Mon Sep 17 00:00:00 2001
From c8ee9bd0790aa5289010a437427f87ba778417b8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 29 Sep 2018 01:18:16 -0400
Subject: [PATCH] Fix Sending Chunks to Client
@ -14,10 +14,10 @@ This fix always sends chunks to the client, and simply updates
the client anytime post processing is triggered with the new chunk data.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d9eb3e51be..e73149d4d1 100644
index 52e2b9db58..e61fefa4c8 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1199,7 +1199,7 @@ public class Chunk implements IChunkAccess {
@@ -1189,7 +1189,7 @@ public class Chunk implements IChunkAccess {
}
public boolean isReady() {
@ -26,7 +26,7 @@ index d9eb3e51be..e73149d4d1 100644
}
public boolean v() {
@@ -1437,6 +1437,13 @@ public class Chunk implements IChunkAccess {
@@ -1427,6 +1427,13 @@ public class Chunk implements IChunkAccess {
this.h.clear();
this.a(ChunkStatus.POSTPROCESSED);
this.m.a(this);