Fixed External Storage sending storage updates when it is disabled. Fixes #2110
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
### 1.6.12
|
||||
- Increased the speed of autocrafting (raoulvdberge)
|
||||
- Fixed External Storage sending storage updates when it is disabled (raoulvdberge)
|
||||
- Added a completion percentage to the Crafting Monitor (raoulvdberge)
|
||||
- Updated Russian translation (kellixon)
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class CraftingTask implements ICraftingTask {
|
||||
this.executionStarted = tag.getLong(NBT_EXECUTION_STARTED);
|
||||
|
||||
if (tag.hasKey(NBT_TOTAL_STEPS)) {
|
||||
totalSteps = tag.getInteger(NBT_TOTAL_STEPS);
|
||||
this.totalSteps = tag.getInteger(NBT_TOTAL_STEPS);
|
||||
}
|
||||
|
||||
StorageDiskFactoryItem factoryItem = new StorageDiskFactoryItem();
|
||||
|
||||
@@ -83,7 +83,7 @@ public class NetworkNodeExternalStorage extends NetworkNode implements IStorageP
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (network != null) {
|
||||
if (canUpdate()) {
|
||||
if (networkTicks++ == 0) {
|
||||
updateStorage(network);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class StorageCacheFluid implements IStorageCache<FluidStack> {
|
||||
if (!batched) {
|
||||
listeners.forEach(l -> l.onChanged(stack, size));
|
||||
} else {
|
||||
batchedChanges.add(Pair.of(stack, size));
|
||||
batchedChanges.add(Pair.of(stack.copy(), size));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class StorageCacheFluid implements IStorageCache<FluidStack> {
|
||||
if (!batched) {
|
||||
listeners.forEach(l -> l.onChanged(stack, -size));
|
||||
} else {
|
||||
batchedChanges.add(Pair.of(stack, -size));
|
||||
batchedChanges.add(Pair.of(stack.copy(), -size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class StorageCacheItem implements IStorageCache<ItemStack> {
|
||||
if (!batched) {
|
||||
listeners.forEach(l -> l.onChanged(stack, size));
|
||||
} else {
|
||||
batchedChanges.add(Pair.of(stack, size));
|
||||
batchedChanges.add(Pair.of(stack.copy(), size));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class StorageCacheItem implements IStorageCache<ItemStack> {
|
||||
if (!batched) {
|
||||
listeners.forEach(l -> l.onChanged(stack, -size));
|
||||
} else {
|
||||
batchedChanges.add(Pair.of(stack, -size));
|
||||
batchedChanges.add(Pair.of(stack.copy(), -size));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,11 +81,12 @@ public class StorageCacheItem implements IStorageCache<ItemStack> {
|
||||
@Override
|
||||
public synchronized void flush() {
|
||||
if (!batchedChanges.isEmpty()) {
|
||||
if(batchedChanges.size() > 1) {
|
||||
if (batchedChanges.size() > 1) {
|
||||
listeners.forEach(l -> l.onChangedBulk(batchedChanges));
|
||||
} else {
|
||||
batchedChanges.forEach(c -> listeners.forEach(l -> l.onChanged(c.getKey(), c.getValue())));
|
||||
}
|
||||
|
||||
batchedChanges.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user