mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 19:58:35 +01:00
fixed network locks not being resolved when canceling crafting requests
This commit is contained in:
parent
b6df64df57
commit
636f40eee5
2 changed files with 6 additions and 4 deletions
|
@ -55,10 +55,10 @@ public class RetrievalModuleItem extends ModuleItem {
|
||||||
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(copy, true, this.preventOversending);
|
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(copy, true, this.preventOversending);
|
||||||
if (dest == null)
|
if (dest == null)
|
||||||
continue;
|
continue;
|
||||||
// are we already waiting for crafting results? If so, don't request more
|
ItemStack remain = dest.getRight().copy();
|
||||||
if (network.getCurrentlyCraftingAmount(tile.getPos(), copy, equalityTypes) >= this.maxExtraction)
|
// are we already waiting for crafting results? If so, don't request those again
|
||||||
break;
|
remain.shrink(network.getCurrentlyCraftingAmount(tile.getPos(), copy, equalityTypes));
|
||||||
if (network.requestItem(tile.getPos(), dest.getLeft(), dest.getRight(), equalityTypes).isEmpty())
|
if (network.requestItem(tile.getPos(), dest.getLeft(), remain, equalityTypes).isEmpty())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,8 @@ public class ItemTerminalTileEntity extends TileEntity implements INamedContaine
|
||||||
for (Pair<BlockPos, ItemStack> craftable : network.getAllCraftables(pipe.getPos())) {
|
for (Pair<BlockPos, ItemStack> craftable : network.getAllCraftables(pipe.getPos())) {
|
||||||
PipeTileEntity otherPipe = network.getPipe(craftable.getLeft());
|
PipeTileEntity otherPipe = network.getPipe(craftable.getLeft());
|
||||||
if (otherPipe != null) {
|
if (otherPipe != null) {
|
||||||
|
for (NetworkLock lock : otherPipe.craftIngredientRequests)
|
||||||
|
network.resolveNetworkLock(lock);
|
||||||
otherPipe.craftIngredientRequests.clear();
|
otherPipe.craftIngredientRequests.clear();
|
||||||
otherPipe.craftResultRequests.clear();
|
otherPipe.craftResultRequests.clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue