Skip to content

Commit 332f1bf

Browse files
committed
juhhh in case
1 parent facee7c commit 332f1bf

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/main/java/kamkeel/npcs/controllers/SyncController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ public static void clientHandleUpdate(SyncType syncType, int id, String key, int
272272
SyncHandler handler = SyncRegistry.getHandler(syncType);
273273
if (handler == null) return;
274274
try {
275+
handler.clientHandleUpdate(compound);
275276
handler.clientHandleUpdate(compound, id);
276277
handler.clientHandleUpdate(compound, key);
277278
} catch (Exception e) {

src/main/java/kamkeel/npcs/controllers/sync/SyncHandler.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ default void clientHandleReload(NBTTagCompound fullCompound){
5656
// No-op: type does not support individual updates
5757
}
5858

59+
/**
60+
* Handle an UPDATE action on the client.
61+
* Deserialize a single object and insert/replace it in the client-side data.
62+
*
63+
* <p>Default: no-op. Types that don't support individual updates
64+
* use {@code syncAll()} for full reload instead.</p>
65+
*
66+
* @param compound the serialized single object
67+
*/
68+
@SideOnly(Side.CLIENT)
69+
default void clientHandleUpdate(NBTTagCompound compound) {
70+
// No-op: type does not support individual updates
71+
}
72+
5973
/**
6074
* Handle an UPDATE action on the client.
6175
* Deserialize a single object and insert/replace it in the client-side data.

0 commit comments

Comments
 (0)