--- 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 void markDirty(EntityDataAccessor 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> list = this.getNonDefaultValues(); + + if (list != null) { + to.connection.send(new ClientboundSetEntityDataPacket(this.entity.getId(), list)); + } + } + } + // CraftBukkit end + public static class DataItem { final EntityDataAccessor accessor;