Skip to content

Commit

Permalink
Update correct entity data list in 1.8->1.7
Browse files Browse the repository at this point in the history
Co-authored-by: "BT (calcastor/mame)" <[email protected]>
  • Loading branch information
FlorianMichael and calcastor committed Sep 26, 2024
1 parent 6d35536 commit 0ee7c1c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ public void setClientEntityGameMode(int clientEntityGameMode) {
}

public void updateEntityData(List<EntityData> entityData) {
entityData.removeIf(first -> entityData.stream().anyMatch(second -> first.id() == second.id()));
this.entityData.removeIf(first -> entityData.stream().anyMatch(second -> first.id() == second.id()));
for (final EntityData data : entityData) {
final Object value = data.value();
if (value instanceof Item item) {
entityData.add(new EntityData(data.id(), data.dataType(), item.copy()));
this.entityData.add(new EntityData(data.id(), data.dataType(), item.copy()));
} else {
entityData.add(new EntityData(data.id(), data.dataType(), value));
this.entityData.add(new EntityData(data.id(), data.dataType(), value));
}
}
}
Expand Down

0 comments on commit 0ee7c1c

Please sign in to comment.