From 7c89df7d1becd967831fbf11aa2e0c6ecd9fc18c Mon Sep 17 00:00:00 2001 From: laforetbrut Date: Thu, 26 Mar 2026 18:51:27 +0100 Subject: [PATCH] Remove dataStorage.save() call that conflicts with fastasyncworldsave storeRefinedStorageDisks() called DimensionDataStorage.save() directly to flush RS2 data before reading the .dat file. This triggers all SavedData saves simultaneously and conflicts with fastasyncworldsave's async save mixin, causing ConcurrentModificationException crash. Fix: Only mark RS2 SavedData as dirty (setDirty()) and let the normal world save cycle handle the flush. The .dat file read may get slightly stale data but avoids crashing the server. Vyrriox --- .../java/vip/fubuki/playersync/sync/addons/ModsSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/vip/fubuki/playersync/sync/addons/ModsSupport.java b/src/main/java/vip/fubuki/playersync/sync/addons/ModsSupport.java index 49e5193..0c115bf 100644 --- a/src/main/java/vip/fubuki/playersync/sync/addons/ModsSupport.java +++ b/src/main/java/vip/fubuki/playersync/sync/addons/ModsSupport.java @@ -451,13 +451,14 @@ public class ModsSupport { if (diskUuids.isEmpty()) return; try { - // Force RS2's SavedData to flush to disk before reading + // Mark RS2's SavedData as dirty so it gets saved on the next world save. + // Do NOT call dataStorage.save() directly - it conflicts with fastasyncworldsave + // and other mods that mixin into DimensionDataStorage, causing ConcurrentModificationException. com.refinedmods.refinedstorage.common.api.storage.StorageRepository repo = com.refinedmods.refinedstorage.common.api.RefinedStorageApi.INSTANCE.getStorageRepository(sp.serverLevel()); if (repo instanceof net.minecraft.world.level.saveddata.SavedData sd) { sd.setDirty(); } - sp.getServer().overworld().getDataStorage().save(); // Read the .dat file directly (getDataFile is private, use reflection) java.io.File datFile = getRS2DataFile(sp);