Fix CME in storage cache flush. Fixes #1930

This commit is contained in:
raoulvdberge
2018-08-02 20:35:44 +02:00
parent 4a9aa52280
commit ffa369d275
2 changed files with 2 additions and 2 deletions

View File

@@ -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();

View File

@@ -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();