mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 13:27:23 +01:00
Improvements to Logging Warnings/Dupe Entities - Resolves #1544
1) Removed "Regen" mode of Dupe UUID resolver, forced safe. Some servers who updated before we had safe mode added still had this value. There's really no reason to keep this mode, as we've seen that vanilla triggers this often and 99.9999999% of cases will be an actual duplicate that needs to be deleted. 2) Made Vanilla Debug messages about dupe UUIDs and dupe uuid resolve messages only show up if the debug.entities flag is on. This will stop server owners from panicing from seeing these logs, and stop opening bug reports on this, only for us to tell you "don't worry about it". 3) Avoid adding entities to world that are already added to world. This can be triggered by anything that causes an entity to be added to the world during the chunk load process, such as chunk conversions. Issue #1544 was a case of this. 4) Removed debug warning about ExpiringMap. Nothing more I know to do about this anyways. We recover from it, stop warning to reduce noise of issues to us.
This commit is contained in:
parent
92e277e36b
commit
9f3623d30d
24 changed files with 77 additions and 82 deletions
Spigot-Server-Patches
Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patchAdd-some-Debug-to-Chunk-Entity-slices.patchAdd-source-block-to-BlockPhysicsEvent.patchAllow-disabling-armour-stand-ticking.patchAlways-process-chunk-removal-in-removeEntity.patchAnti-Xray.patchAsync-Chunk-Loading-and-Generation.patchCache-World-Entity-Type-counts.patchConfigurable-speed-for-water-flowing-over-lava.patchDuplicate-UUID-Resolve-Option.patchEntity-add-to-world-fixes.patchFix-Sending-Chunks-to-Client.patchFix-issues-with-entity-loss-due-to-unloaded-chunks.patchIgnore-Dead-Entities-in-entityList-iteration.patchImplement-Force-Loaded-Chunk-API.patchOptimize-Chunk-getPos.patchOptimize-Light-Recalculations.patchOptimize-and-Fix-ExpiringMap-Issues.patchOptimize-getChunkIfLoaded-type-calls.patchOption-to-prevent-armor-stands-from-doing-entity-loo.patchPrevent-Mob-AI-Rules-from-Loading-Chunks.patchSend-nearby-packets-from-world-player-list-not-serve.patchVanished-players-don-t-have-rights.patchWorld-EntityHuman-Lookup-Optimizations.patch
|
@ -17,15 +17,26 @@ index 42c1c47c58..3606c78843 100644
|
|||
public CraftEntity getBukkitEntity() {
|
||||
if (bukkitEntity == null) {
|
||||
bukkitEntity = CraftEntity.getEntity(world.getServer(), this);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index ee2cdb897c..a341f5de9a 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
public boolean pvpMode;
|
||||
public boolean keepSpawnInMemory = true;
|
||||
public ChunkGenerator generator;
|
||||
+ public static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper
|
||||
|
||||
public boolean captureBlockStates = false;
|
||||
public boolean captureTreeGeneration = false;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 27278078e4..f6becaae43 100644
|
||||
index 27278078e4..7eab55e7c1 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 {
|
||||
|
||||
// CraftBukkit start
|
||||
public final DimensionManager dimension;
|
||||
+ private static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper
|
||||
+ private static Throwable getAddToWorldStackTrace(Entity entity) {
|
||||
+ return new Throwable(entity + " Added to world at " + new java.util.Date());
|
||||
+ }
|
||||
|
@ -51,9 +62,11 @@ index 27278078e4..f6becaae43 100644
|
|||
} else {
|
||||
if (!(entity instanceof EntityHuman)) {
|
||||
- WorldServer.a.error("Keeping entity {} that already exists with UUID {} - " + entity1, EntityTypes.getName(entity1.P()), uuid.toString()); // CraftBukkit // Paper
|
||||
+ WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
|
||||
WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
|
||||
- WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
|
||||
+ if (DEBUG_ENTITIES) {
|
||||
+ WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
|
||||
+ WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
|
||||
+
|
||||
+ if (entity1.addedToWorldStack != null) {
|
||||
+ entity1.addedToWorldStack.printStackTrace();
|
||||
+ }
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 4e6ed1e349..d5937e4378 100644
|
||||
index 3c3d44ffbd..0f79ad9588 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add source block to BlockPhysicsEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 39175ea0ad..4426798c74 100644
|
||||
index a7dcfb4191..f713b0d3d0 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow disabling armour stand ticking
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 4fbafb5bf2..31b2c71960 100644
|
||||
index a2656abaf0..95fc2d8ed8 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
|
|
@ -8,7 +8,7 @@ which can keep them in the chunk when they shouldnt be if done
|
|||
during entity ticking.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 81777fce64..597169b4cc 100644
|
||||
index b3eaac23a6..0331512468 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index d818d39039..cc8fdedd5b 100644
|
||||
index ac07bcc751..ca93fab889 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -1049,7 +1049,7 @@ index 0000000000..37093419cf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index dfc3047a84..7857d871f4 100644
|
||||
index a5f939f557..80ec314599 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -1510,7 +1510,7 @@ index 9242b95a52..395ce2e4ad 100644
|
|||
|
||||
if (enumskyblock == EnumSkyBlock.SKY) {
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 4426798c74..650e605b5b 100644
|
||||
index f713b0d3d0..2016051ef5 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
|
@ -392,7 +392,7 @@ index 0000000000..5c77b6e8e1
|
|||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index fe40d62692..33d52447be 100644
|
||||
index edfcb107bd..cb99888707 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -1736,7 +1736,7 @@ index f87182b5c4..574930f5fe 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index e52e4bb458..13f69f1b82 100644
|
||||
index a2559f0c19..bbcedb8fc7 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
|
@ -1980,7 +1980,7 @@ index fa99fe0146..4f49786aa3 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 14905fceb0..c0aeccffbf 100644
|
||||
index ad3fea9c97..0a76482638 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 {
|
||||
|
|
|
@ -183,7 +183,7 @@ index 95d98b65cf..387570ed67 100644
|
|||
if (l1 <= k) {
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 85570e4a5d..39175ea0ad 100644
|
||||
index 2474b96382..a7dcfb4191 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable speed for water flowing over lava
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index cc8fdedd5b..5bab0018da 100644
|
||||
index ca93fab889..93bf8c6d3c 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -19,7 +19,7 @@ index cc8fdedd5b..5bab0018da 100644
|
|||
+ }
|
||||
+
|
||||
public enum DuplicateUUIDMode {
|
||||
SAFE_REGEN, REGEN, DELETE, NOTHING, WARN
|
||||
SAFE_REGEN, DELETE, NOTHING, WARN
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
index 5346eaa348..ec77cbd57e 100644
|
||||
|
|
|
@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
|
|||
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index deb0d4f053..249af8b4c6 100644
|
||||
index deb0d4f053..75b591bc2a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -42,7 +42,7 @@ index deb0d4f053..249af8b4c6 100644
|
|||
}
|
||||
+
|
||||
+ public enum DuplicateUUIDMode {
|
||||
+ SAFE_REGEN, REGEN, DELETE, NOTHING, WARN
|
||||
+ SAFE_REGEN, DELETE, NOTHING, WARN
|
||||
+ }
|
||||
+ public DuplicateUUIDMode duplicateUUIDMode = DuplicateUUIDMode.SAFE_REGEN;
|
||||
+ public int duplicateUUIDDeleteRange = 32;
|
||||
|
@ -50,15 +50,12 @@ index deb0d4f053..249af8b4c6 100644
|
|||
+ String desiredMode = getString("duplicate-uuid-resolver", "saferegen").toLowerCase().trim();
|
||||
+ duplicateUUIDDeleteRange = getInt("duplicate-uuid-saferegen-delete-range", duplicateUUIDDeleteRange);
|
||||
+ switch (desiredMode.toLowerCase()) {
|
||||
+ case "regen":
|
||||
+ case "regenerate":
|
||||
+ case "saferegen":
|
||||
+ case "saferegenerate":
|
||||
+ duplicateUUIDMode = DuplicateUUIDMode.SAFE_REGEN;
|
||||
+ log("Duplicate UUID Resolve: Safer Regenerate New UUID (Delete likely duplicates within " + duplicateUUIDDeleteRange + " blocks)");
|
||||
+ break;
|
||||
+ case "regen":
|
||||
+ case "regenerate":
|
||||
+ duplicateUUIDMode = DuplicateUUIDMode.REGEN;
|
||||
+ log("Duplicate UUID Resolve: Regenerate New UUID");
|
||||
+ log("Duplicate UUID Resolve: Regenerate New UUID if distant (Delete likely duplicates within " + duplicateUUIDDeleteRange + " blocks)");
|
||||
+ break;
|
||||
+ case "remove":
|
||||
+ case "delete":
|
||||
|
@ -69,7 +66,6 @@ index deb0d4f053..249af8b4c6 100644
|
|||
+ case "nothing":
|
||||
+ duplicateUUIDMode = DuplicateUUIDMode.NOTHING;
|
||||
+ logError("Duplicate UUID Resolve: Do Nothing (no logs) - Warning, may lose indication of bad things happening");
|
||||
+ logError("PaperMC Strongly discourages use of this setting! Triggering these messages means SOMETHING IS WRONG!");
|
||||
+ break;
|
||||
+ case "log":
|
||||
+ case "warn":
|
||||
|
@ -78,14 +74,14 @@ index deb0d4f053..249af8b4c6 100644
|
|||
+ break;
|
||||
+ default:
|
||||
+ duplicateUUIDMode = DuplicateUUIDMode.WARN;
|
||||
+ logError("Warning: Invalidate duplicate-uuid-resolver config " + desiredMode + " - must be one of: regen, delete, nothing, warn");
|
||||
+ logError("Warning: Invalid duplicate-uuid-resolver config " + desiredMode + " - must be one of: regen, delete, nothing, warn");
|
||||
+ log("Duplicate UUID Resolve: Warn (do nothing but log it happened, may be spammy)");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 0a40488586..60829fded7 100644
|
||||
index 0a40488586..1245576e8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -121,7 +117,7 @@ index 0a40488586..60829fded7 100644
|
|||
List entityslice = aentityslice[j]; // Spigot
|
||||
+ // Paper start
|
||||
+ DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode;
|
||||
+ if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.REGEN || mode == DuplicateUUIDMode.SAFE_REGEN) {
|
||||
+ if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.SAFE_REGEN) {
|
||||
+ Map<UUID, Entity> thisChunk = new HashMap<>();
|
||||
+ for (Iterator<Entity> iterator = ((List<Entity>) entityslice).iterator(); iterator.hasNext(); ) {
|
||||
+ Entity entity = iterator.next();
|
||||
|
@ -136,27 +132,26 @@ index 0a40488586..60829fded7 100644
|
|||
+ && java.util.Objects.equals(other.getSaveID(), entity.getSaveID())
|
||||
+ && entity.getBukkitEntity().getLocation().distance(other.getBukkitEntity().getLocation()) < world.paperConfig.duplicateUUIDDeleteRange
|
||||
+ ) {
|
||||
+ logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + " because it was near the duplicate and likely an actual duplicate. See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ if (World.DEBUG_ENTITIES) logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + " because it was near the duplicate and likely an actual duplicate. See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ entity.die();
|
||||
+ iterator.remove();
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (other != null && !other.dead) {
|
||||
+ switch (mode) {
|
||||
+ case SAFE_REGEN:
|
||||
+ case REGEN: {
|
||||
+ case SAFE_REGEN: {
|
||||
+ entity.setUUID(UUID.randomUUID());
|
||||
+ logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", regenerated UUID for " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ if (World.DEBUG_ENTITIES) logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", regenerated UUID for " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ break;
|
||||
+ }
|
||||
+ case DELETE: {
|
||||
+ logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ if (World.DEBUG_ENTITIES) logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ entity.die();
|
||||
+ iterator.remove();
|
||||
+ break;
|
||||
+ }
|
||||
+ default:
|
||||
+ logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", doing nothing to " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ if (World.DEBUG_ENTITIES) logger.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", doing nothing to " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -180,7 +175,7 @@ index 3606c78843..57adaf2a4c 100644
|
|||
this.uniqueID = uuid;
|
||||
this.au = this.uniqueID.toString();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index ee2cdb897c..956eabd7dc 100644
|
||||
index a341f5de9a..61c260a2fb 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
@ -193,7 +188,7 @@ index ee2cdb897c..956eabd7dc 100644
|
|||
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
|
||||
private final List<TileEntity> c = Lists.newArrayList();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index f6becaae43..f7078ded5c 100644
|
||||
index 7eab55e7c1..0e63a0b5cd 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 {
|
||||
|
@ -209,25 +204,10 @@ index f6becaae43..f7078ded5c 100644
|
|||
this.g.remove(entity1);
|
||||
} else {
|
||||
if (!(entity instanceof EntityHuman)) {
|
||||
- WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
|
||||
- WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
|
||||
- if (DEBUG_ENTITIES) {
|
||||
- if (entity1.addedToWorldStack != null) {
|
||||
- entity1.addedToWorldStack.printStackTrace();
|
||||
+ if (entity.world.paperConfig.duplicateUUIDMode != com.destroystokyo.paper.PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
|
||||
+ WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
|
||||
+ WorldServer.a.error("Duplicate entity {} will not be added to the world. See paper.yml duplicate-uuid-resolver and set this to either regen, delete or nothing to get rid of this message", entity); // Paper
|
||||
+ if (DEBUG_ENTITIES) {
|
||||
+ if (entity1.addedToWorldStack != null) {
|
||||
+ entity1.addedToWorldStack.printStackTrace();
|
||||
+ }
|
||||
+ getAddToWorldStackTrace(entity).printStackTrace();
|
||||
}
|
||||
- getAddToWorldStackTrace(entity).printStackTrace();
|
||||
}
|
||||
+
|
||||
return false;
|
||||
}
|
||||
+ if (DEBUG_ENTITIES && entity.world.paperConfig.duplicateUUIDMode != com.destroystokyo.paper.PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
|
||||
WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper
|
||||
WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper
|
||||
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
|
|
|
@ -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 d5937e4378..dfc3047a84 100644
|
||||
index 0f79ad9588..a5f939f557 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -37,12 +37,12 @@ index d5937e4378..dfc3047a84 100644
|
|||
+ toAdd.addAll(entityslice);
|
||||
+ // Paper end
|
||||
}
|
||||
+ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman))); // Paper - add all at same time to avoid entities adding to world modifying slice state
|
||||
+ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen)
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.Server server = this.world.getServer();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index aa94e399af..85570e4a5d 100644
|
||||
index 4cc7f7af0d..2474b96382 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
@ -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 f7078ded5c..9cba1822bf 100644
|
||||
index 0e63a0b5cd..72c661ef2d 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 {
|
||||
|
|
|
@ -14,7 +14,7 @@ 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 6a6c68b066..bf800fcb72 100644
|
||||
index 2ecac57a81..4258b1200a 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
|
|
@ -18,7 +18,7 @@ This change ensures the chunks are always loaded when entities are
|
|||
added to the world, or a valid entity moves between chunks.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 4179ba7cd8..d659ffe9ba 100644
|
||||
index a19e941174..4d0c8cbd4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -35,7 +35,7 @@ index 965cd592f3..1dd56aec38 100644
|
|||
public float length;
|
||||
public float J;
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 597169b4cc..b18ea7154f 100644
|
||||
index 0331512468..eb6d2b9d51 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement Force-Loaded Chunk API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 650e605b5b..2ff8536d59 100644
|
||||
index 2016051ef5..bcbc78bd8f 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Optimize Chunk#getPos
|
|||
Don't create an object just to get chunk coords.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 7857d871f4..6abbbc057f 100644
|
||||
index 80ec314599..6548bdbd31 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
|
|
@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for
|
|||
light lookups.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 33d52447be..c6b002bb6b 100644
|
||||
index cb99888707..027f98633e 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -36,7 +36,7 @@ index 33d52447be..c6b002bb6b 100644
|
|||
int i1 = iblockdata.b(this.world, blockposition);
|
||||
int j1 = iblockdata1.b(this.world, blockposition);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 13f69f1b82..4179ba7cd8 100644
|
||||
index bbcedb8fc7..a19e941174 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -14,7 +14,7 @@ manipulation, and instead to run clean
|
|||
once per tick per active expiring map.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java
|
||||
index 4006f5a69c..127de5c8df 100644
|
||||
index 4006f5a69c..795e735420 100644
|
||||
--- a/src/main/java/net/minecraft/server/ExpiringMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/ExpiringMap.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
@ -35,6 +35,7 @@ index 4006f5a69c..127de5c8df 100644
|
|||
private final int a;
|
||||
- private final Long2LongMap b = new Long2LongLinkedOpenHashMap();
|
||||
+ private final Long2LongMap ttl = new Long2LongLinkedOpenHashMap(); // Paper
|
||||
+ private static final boolean DEBUG_EXPIRING_MAP = Boolean.getBoolean("debug.expiringmap");
|
||||
|
||||
public ExpiringMap(int i, int j) {
|
||||
- super(i);
|
||||
|
@ -149,7 +150,6 @@ index 4006f5a69c..127de5c8df 100644
|
|||
+ }
|
||||
|
||||
+ private boolean registered = false;
|
||||
+ private boolean hasLeaked = false;
|
||||
+
|
||||
+ // Break clean to its own method to be ticked
|
||||
+ boolean clean() {
|
||||
|
@ -172,20 +172,22 @@ index 4006f5a69c..127de5c8df 100644
|
|||
+ int ttlSize = this.ttl.size();
|
||||
+ int thisSize = this.size();
|
||||
+ if (ttlSize < thisSize) {
|
||||
+ if (!hasLeaked) { // log once
|
||||
+ hasLeaked = true;
|
||||
+ MinecraftServer.LOGGER.warn("WARNING: ExpiringMap desync (" + ttlSize + ":" + thisSize + ")- Memory leak risk! We will recover from this, but this means there is still a bug. Please do not open an issue about this. Mention it in Discord (we don't need everyone reporting the same thing)");
|
||||
+ if (DEBUG_EXPIRING_MAP) {
|
||||
+ MinecraftServer.LOGGER.warn("WARNING: ExpiringMap desync (ttl:" + ttlSize + " < actual:" + thisSize + ")");
|
||||
+ }
|
||||
+ try {
|
||||
+ for (Entry<T> entry : this.long2ObjectEntrySet()) {
|
||||
+ ttl.putIfAbsent(entry.getLongKey(), now);
|
||||
+ }
|
||||
+ } catch (Exception e) {
|
||||
+ } catch (Exception ignored) {
|
||||
+ } // Ignore any como's
|
||||
+ } else if (ttlSize > this.size()) {
|
||||
+ if (DEBUG_EXPIRING_MAP) {
|
||||
+ MinecraftServer.LOGGER.warn("WARNING: ExpiringMap desync (ttl:" + ttlSize + " > actual:" + thisSize + ")");
|
||||
+ }
|
||||
+ try {
|
||||
+ this.ttl.long2LongEntrySet().removeIf(entry -> !this.containsKey(entry.getLongKey()));
|
||||
+ } catch (Exception e) {
|
||||
+ } catch (Exception ignored) {
|
||||
+ } // Ignore any como's
|
||||
+ }
|
||||
+ if (isEmpty()) {
|
||||
|
|
|
@ -10,7 +10,7 @@ Will improve inlining across many hot methods.
|
|||
Improve getBrightness to not do double chunk map lookups.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index c0d48c33fc..5b57ea93c8 100644
|
||||
index d07ba950eb..958a4084e6 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
@ -23,7 +23,7 @@ index c0d48c33fc..5b57ea93c8 100644
|
|||
neighbor.setNeighborUnloaded(-x, -z);
|
||||
chunk.setNeighborUnloaded(x, z);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 2ff8536d59..0c42d042b1 100644
|
||||
index bcbc78bd8f..af7cbb5fcf 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Option to prevent armor stands from doing entity lookups
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 249af8b4c6..4fbafb5bf2 100644
|
||||
index 75b591bc2a..a2656abaf0 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -21,7 +21,7 @@ index 249af8b4c6..4fbafb5bf2 100644
|
|||
private void maxEntityCollision() {
|
||||
maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) );
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 956eabd7dc..6605449a8b 100644
|
||||
index 61c260a2fb..d58de13028 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index debf47d9fd..01244c1d37 100644
|
||||
index b8d87beae6..300c54c806 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -84,7 +84,7 @@ index 800e0046a8..bfa6c2eef8 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0c42d042b1..e52e4bb458 100644
|
||||
index af7cbb5fcf..a2559f0c19 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -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 9cba1822bf..14905fceb0 100644
|
||||
index 72c661ef2d..ad3fea9c97 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 {
|
||||
|
|
|
@ -64,7 +64,7 @@ index ea8f1c170a..fdfc0d442e 100644
|
|||
return this.a.a();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6605449a8b..81777fce64 100644
|
||||
index d58de13028..b3eaac23a6 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] World EntityHuman Lookup Optimizations
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index b18ea7154f..aa94e399af 100644
|
||||
index eb6d2b9d51..4cc7f7af0d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
|
Loading…
Add table
Reference in a new issue