2021-03-15 23:00:00 +01:00
--- a/net/minecraft/network/syncher/DataWatcher.java
+++ b/net/minecraft/network/syncher/DataWatcher.java
2022-07-27 20:00:00 +02:00
@@ -142,6 +142,13 @@
2018-07-15 02:00:00 +02:00
}
+ // CraftBukkit start - add method from above
+ public <T> void markDirty(DataWatcherObject<T> datawatcherobject) {
2021-11-21 23:00:00 +01:00
+ this.getItem(datawatcherobject).setDirty(true);
2021-06-11 07:00:00 +02:00
+ this.isDirty = true;
2018-07-15 02:00:00 +02:00
+ }
+ // CraftBukkit end
+
2021-11-21 23:00:00 +01:00
public boolean isDirty() {
2021-06-11 07:00:00 +02:00
return this.isDirty;
2018-07-15 02:00:00 +02:00
}
2022-07-27 20:00:00 +02:00
@@ -274,7 +281,7 @@
2021-11-21 23:00:00 +01:00
if (!Objects.equals(datawatcher_item1.accessor.getSerializer(), datawatcher_item.accessor.getSerializer())) {
2022-07-27 20:00:00 +02:00
throw new IllegalStateException(String.format(Locale.ROOT, "Invalid entity data item type for field %d on entity %s: old=%s(%s), new=%s(%s)", datawatcher_item.accessor.getId(), this.entity, datawatcher_item.value, datawatcher_item.value.getClass(), datawatcher_item1.value, datawatcher_item1.value.getClass()));
2021-06-11 07:00:00 +02:00
} else {
2021-11-21 23:00:00 +01:00
- datawatcher_item.setValue(datawatcher_item1.getValue());
+ datawatcher_item.setValue((T) datawatcher_item1.getValue()); // CraftBukkit - decompile error
2021-06-11 07:00:00 +02:00
}
}