Fix CME in storage cache flush. Fixes #1930
This commit is contained in:
@@ -77,7 +77,7 @@ public class StorageCacheFluid implements IStorageCache<FluidStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
public synchronized void flush() {
|
||||
if (!batchedChanges.isEmpty()) {
|
||||
batchedChanges.forEach(c -> listeners.forEach(l -> l.onChanged(c.getKey(), c.getValue())));
|
||||
batchedChanges.clear();
|
||||
|
||||
@@ -79,7 +79,7 @@ public class StorageCacheItem implements IStorageCache<ItemStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
public synchronized void flush() {
|
||||
if (!batchedChanges.isEmpty()) {
|
||||
batchedChanges.forEach(c -> listeners.forEach(l -> l.onChanged(c.getKey(), c.getValue())));
|
||||
batchedChanges.clear();
|
||||
|
||||
Reference in New Issue
Block a user