From e545a554b3b18724b7ff9567c6268da5b104a1ab Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Sat, 27 Jul 2024 19:29:58 +0800 Subject: [PATCH] =?UTF-8?q?misc:=20=E8=AE=A9SingleWatcher=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=99=90=E5=88=B6=E6=9A=82=E6=97=B6=E5=8F=98?= =?UTF-8?q?=E5=BE=97=E6=9B=B4=E5=AE=BD=E5=AE=B9=E4=BA=9B...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renderer/network/datawatcher/watchers/SingleWatcher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java index 519cf24f..838477b3 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java +++ b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java @@ -259,7 +259,7 @@ public Map, Object> getRegistry() return new Object2ObjectOpenHashMap<>(registry); } - private final Map, Object> dirtySingles = new Object2ObjectOpenHashMap<>(); + private final Map, Object> dirtySingles = Collections.synchronizedMap(new Object2ObjectOpenHashMap<>()); public Map, Object> getDirty() { @@ -282,11 +282,13 @@ public void sync() try { + /* if (!isPlayerOnline()) throw new IllegalStateException("Can't sync value for offline player!"); var nmsPlayer = NmsRecord.ofPlayer(getBindingPlayer()); TickThread.ensureTickThread(nmsPlayer, "Syncing watcher's value while not on its player's ticking thread!"); + */ doSync(); }