Add Debug Entities option to debug dupe uuid issues
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/world/level/entity/EntityLookup.java
|
||||
+++ b/net/minecraft/world/level/entity/EntityLookup.java
|
||||
@@ -33,6 +33,14 @@
|
||||
UUID uUID = entity.getUUID();
|
||||
if (this.byUuid.containsKey(uUID)) {
|
||||
LOGGER.warn("Duplicate entity UUID {}: {}", uUID, entity);
|
||||
+ // Paper start - extra debug info
|
||||
+ if (entity instanceof net.minecraft.world.entity.Entity) {
|
||||
+ final T old = this.byUuid.get(entity.getUUID());
|
||||
+ if (old instanceof net.minecraft.world.entity.Entity oldCast && oldCast.getId() != entity.getId() && oldCast.valid) {
|
||||
+ LOGGER.error("Overwrote an existing entity {} with {}", oldCast, entity);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - extra debug info
|
||||
} else {
|
||||
this.byUuid.put(uUID, entity);
|
||||
this.byId.put(entity.getId(), entity);
|
||||
Reference in New Issue
Block a user