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