Skip to content

Commit

Permalink
misc: 让SingleWatcher的同步限制暂时变得更宽容些...
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Jul 27, 2024
1 parent 876c298 commit e545a55
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public Map<SingleValue<?>, Object> getRegistry()
return new Object2ObjectOpenHashMap<>(registry);
}

private final Map<SingleValue<?>, Object> dirtySingles = new Object2ObjectOpenHashMap<>();
private final Map<SingleValue<?>, Object> dirtySingles = Collections.synchronizedMap(new Object2ObjectOpenHashMap<>());

public Map<SingleValue<?>, Object> getDirty()
{
Expand All @@ -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();
}
Expand Down

0 comments on commit e545a55

Please sign in to comment.