summaryrefslogtreecommitdiffstats
path: root/nms-patches/DataWatcher.patch
blob: 676bc64c1a8f0f8bf7e95ee64c604a273ca04aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/net/minecraft/server/DataWatcher.java
+++ b/net/minecraft/server/DataWatcher.java
@@ -70,7 +70,7 @@
         }
     }
 
-    public <T> void register(DataWatcherObject<T> datawatcherobject, T t0) {
+    public <T> void register(DataWatcherObject<T> datawatcherobject, Object t0) { // CraftBukkit T -> Object
         int i = datawatcherobject.a();
 
         if (i > 254) {
@@ -84,7 +84,7 @@
         }
     }
 
-    private <T> void registerObject(DataWatcherObject<T> datawatcherobject, T t0) {
+    private <T> void registerObject(DataWatcherObject<T> datawatcherobject, Object t0) { // CraftBukkit Object
         DataWatcher.Item datawatcher_item = new DataWatcher.Item(datawatcherobject, t0);
 
         this.e.writeLock().lock();
@@ -128,6 +128,13 @@
 
     }
 
+    // CraftBukkit start - add method from above
+    public <T> void markDirty(DataWatcherObject<T> datawatcherobject) {
+        this.b(datawatcherobject).a(true);
+        this.g = true;
+    }
+    // CraftBukkit end
+
     public boolean a() {
         return this.g;
     }