From 8cd49fef6b75c80ad8ee63bfc8ffcd2d3245d369 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 31 Oct 2021 15:09:39 -0700 Subject: [PATCH] Fix dupe uuid check on entity add (#6735) --- patches/server/Duplicate-UUID-Resolve-Option.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/server/Duplicate-UUID-Resolve-Option.patch b/patches/server/Duplicate-UUID-Resolve-Option.patch index e3c4d25845..25d5d7e6f1 100644 --- a/patches/server/Duplicate-UUID-Resolve-Option.patch +++ b/patches/server/Duplicate-UUID-Resolve-Option.patch @@ -173,9 +173,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private boolean addEntityUuid(T entity) { if (!this.knownUuids.add(entity.getUUID())) { + // Paper start -+ if (((Entity) entity).isRemoved()) { -+ stopTracking(entity); // remove the existing entity -+ return false; ++ T conflict = this.visibleEntityStorage.getEntity(entity.getUUID()); ++ if (conflict != null && ((Entity) conflict).isRemoved()) { ++ stopTracking(conflict); // remove the existing entity ++ return true; + } + // Paper end PersistentEntitySectionManager.LOGGER.warn("UUID of added entity already exists: {}", entity);