The Dupe Chute

- Fixed a duplication bug involving belts and chutes #6210 #5781 #6686
This commit is contained in:
simibubi 2024-07-15 11:44:30 +02:00
parent 75d337ba8c
commit 7bd602a33f
2 changed files with 8 additions and 4 deletions

View file

@ -378,6 +378,8 @@ public class BeltInventory {
float min = offset; float min = offset;
float max = offset + 1; float max = offset + 1;
for (TransportedItemStack stack : items) { for (TransportedItemStack stack : items) {
if (toRemove.contains(stack))
continue;
if (stack.beltPosition > max) if (stack.beltPosition > max)
continue; continue;
if (stack.beltPosition > min) if (stack.beltPosition > min)

View file

@ -50,13 +50,15 @@ public class ItemHandlerBeltSegment implements IItemHandler {
return ItemStack.EMPTY; return ItemStack.EMPTY;
amount = Math.min(amount, transported.stack.getCount()); amount = Math.min(amount, transported.stack.getCount());
ItemStack extracted = simulate ? transported.stack.copy().split(amount) : transported.stack.split(amount); ItemStack extracted = simulate ? transported.stack.copy()
.split(amount) : transported.stack.split(amount);
if (!simulate) { if (!simulate) {
if (transported.stack.isEmpty()) if (transported.stack.isEmpty())
this.beltInventory.toRemove.add(transported); beltInventory.toRemove.add(transported);
this.beltInventory.belt.setChanged(); else
this.beltInventory.belt.sendData(); beltInventory.belt.notifyUpdate();
} }
return extracted; return extracted;
} }