Skip to content

Commit

Permalink
[ci skip] Remove nullable from SyncedEntityData#packAll (#11949)
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag authored Jan 11, 2025
1 parent ac3aaa2 commit 775002a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
public boolean isDirty() {
return this.isDirty;
}
@@ -169,6 +_,20 @@
@@ -169,6 +_,19 @@
return new SynchedEntityData(this.entity, this.itemsById);
}
}
+
+ // Paper start
+ // We need to pack all as we cannot rely on "non default values" or "dirty" ones.
+ // Because these values can possibly be desynced on the client.
+ @Nullable
+ public List<SynchedEntityData.DataValue<?>> packAll() {
+ final List<SynchedEntityData.DataValue<?>> list = new ArrayList<>();
+ final List<SynchedEntityData.DataValue<?>> list = new ArrayList<>(this.itemsById.length);
+ for (final DataItem<?> dataItem : this.itemsById) {
+ list.add(dataItem.value());
+ }
Expand Down

0 comments on commit 775002a

Please sign in to comment.