mirror of https://github.com/PaperMC/Paper.git
36 lines
1004 B
Diff
36 lines
1004 B
Diff
--- a/net/minecraft/network/syncher/SynchedEntityData.java
|
|
+++ b/net/minecraft/network/syncher/SynchedEntityData.java
|
|
@@ -146,6 +148,13 @@
|
|
|
|
}
|
|
|
|
+ // CraftBukkit start - add method from above
|
|
+ public <T> void markDirty(EntityDataAccessor<T> datawatcherobject) {
|
|
+ this.getItem(datawatcherobject).setDirty(true);
|
|
+ this.isDirty = true;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public boolean isDirty() {
|
|
return this.isDirty;
|
|
}
|
|
@@ -235,6 +244,18 @@
|
|
return this.itemsById.isEmpty();
|
|
}
|
|
|
|
+ // CraftBukkit start
|
|
+ public void refresh(ServerPlayer to) {
|
|
+ if (!this.isEmpty()) {
|
|
+ List<SynchedEntityData.DataValue<?>> list = this.getNonDefaultValues();
|
|
+
|
|
+ if (list != null) {
|
|
+ to.connection.send(new ClientboundSetEntityDataPacket(this.entity.getId(), list));
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public static class DataItem<T> {
|
|
|
|
final EntityDataAccessor<T> accessor;
|