fixed network locks not being resolved when canceling crafting requests

This commit is contained in:
Ell 2020-10-20 02:52:26 +02:00
parent b6df64df57
commit 636f40eee5
2 changed files with 6 additions and 4 deletions

View file

@ -55,10 +55,10 @@ public class RetrievalModuleItem extends ModuleItem {
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(copy, true, this.preventOversending);
if (dest == null)
continue;
// are we already waiting for crafting results? If so, don't request more
if (network.getCurrentlyCraftingAmount(tile.getPos(), copy, equalityTypes) >= this.maxExtraction)
break;
if (network.requestItem(tile.getPos(), dest.getLeft(), dest.getRight(), equalityTypes).isEmpty())
ItemStack remain = dest.getRight().copy();
// are we already waiting for crafting results? If so, don't request those again
remain.shrink(network.getCurrentlyCraftingAmount(tile.getPos(), copy, equalityTypes));
if (network.requestItem(tile.getPos(), dest.getLeft(), remain, equalityTypes).isEmpty())
break;
}
}

View file

@ -208,6 +208,8 @@ public class ItemTerminalTileEntity extends TileEntity implements INamedContaine
for (Pair<BlockPos, ItemStack> craftable : network.getAllCraftables(pipe.getPos())) {
PipeTileEntity otherPipe = network.getPipe(craftable.getLeft());
if (otherPipe != null) {
for (NetworkLock lock : otherPipe.craftIngredientRequests)
network.resolveNetworkLock(lock);
otherPipe.craftIngredientRequests.clear();
otherPipe.craftResultRequests.clear();
}