mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
f8db65033c
By: md_5 <git@md-5.net>
25 lines
1.1 KiB
Diff
25 lines
1.1 KiB
Diff
--- a/net/minecraft/network/syncher/DataWatcher.java
|
|
+++ b/net/minecraft/network/syncher/DataWatcher.java
|
|
@@ -142,6 +142,13 @@
|
|
|
|
}
|
|
|
|
+ // CraftBukkit start - add method from above
|
|
+ public <T> void markDirty(DataWatcherObject<T> datawatcherobject) {
|
|
+ this.getItem(datawatcherobject).setDirty(true);
|
|
+ this.isDirty = true;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public boolean isDirty() {
|
|
return this.isDirty;
|
|
}
|
|
@@ -274,7 +281,7 @@
|
|
if (!Objects.equals(datawatcher_item1.accessor.getSerializer(), datawatcher_item.accessor.getSerializer())) {
|
|
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()));
|
|
} else {
|
|
- datawatcher_item.setValue(datawatcher_item1.getValue());
|
|
+ datawatcher_item.setValue((T) datawatcher_item1.getValue()); // CraftBukkit - decompile error
|
|
}
|
|
}
|
|
|