--- a/net/minecraft/network/syncher/SynchedEntityData.java +++ b/net/minecraft/network/syncher/SynchedEntityData.java @@ -51,7 +51,7 @@ } private SynchedEntityData.DataItem getItem(EntityDataAccessor key) { - return this.itemsById[key.id()]; + return (SynchedEntityData.DataItem) this.itemsById[key.id()]; // CraftBukkit - decompile error } public T get(EntityDataAccessor data) { @@ -74,6 +74,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; } @@ -140,7 +147,7 @@ if (!Objects.equals(from.serializer(), to.accessor.serializer())) { throw new IllegalStateException(String.format(Locale.ROOT, "Invalid entity data item type for field %d on entity %s: old=%s(%s), new=%s(%s)", to.accessor.id(), this.entity, to.value, to.value.getClass(), from.value, from.value.getClass())); } else { - to.setValue(from.value); + to.setValue((T) from.value); // CraftBukkit - decompile error } }