mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 14:33:09 +01:00
Fix dupe uuid check on entity add (#6735)
This commit is contained in:
parent
e0cac960b1
commit
8cd49fef6b
1 changed files with 4 additions and 3 deletions
|
@ -173,9 +173,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
private boolean addEntityUuid(T entity) {
|
private boolean addEntityUuid(T entity) {
|
||||||
if (!this.knownUuids.add(entity.getUUID())) {
|
if (!this.knownUuids.add(entity.getUUID())) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (((Entity) entity).isRemoved()) {
|
+ T conflict = this.visibleEntityStorage.getEntity(entity.getUUID());
|
||||||
+ stopTracking(entity); // remove the existing entity
|
+ if (conflict != null && ((Entity) conflict).isRemoved()) {
|
||||||
+ return false;
|
+ stopTracking(conflict); // remove the existing entity
|
||||||
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
PersistentEntitySectionManager.LOGGER.warn("UUID of added entity already exists: {}", entity);
|
PersistentEntitySectionManager.LOGGER.warn("UUID of added entity already exists: {}", entity);
|
||||||
|
|
Loading…
Reference in a new issue