9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-19 14:59:30 +00:00

Fix lenient merging sometimes merging entities out of order

This commit is contained in:
Samsuik
2025-05-29 20:57:12 +01:00
parent 476ea68d41
commit 1d4877f84e

View File

@@ -86,12 +86,16 @@ public interface MergeStrategy {
return previous;
}
if (!mergeHistory.hasPreviousMerged(entity, previous)) {
this.entityTable.clear();
}
Entity nextEntity = this.entityTable.getAndWrite(entity);
if (nextEntity == null || entity == nextEntity || !nextEntity.level().equals(entity.level())) {
return null;
}
return mergeHistory.hasPreviousMerged(entity, nextEntity) && entity.compareState(nextEntity) ? nextEntity : null;
return entity.compareState(nextEntity) ? nextEntity : null;
}
}