Fixed a duplication bug with a disconnected Crafting Grid. Fixes #1989

This commit is contained in:
raoulvdberge
2018-09-14 16:38:00 +02:00
parent 084c1ba6ca
commit b3352794be
3 changed files with 7 additions and 0 deletions

View File

@@ -144,6 +144,8 @@ public class ContainerGrid extends ContainerBase {
}
addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, getPlayer(), grid, 0, 130 + 4, headerAndSlots + 22));
transferManager.addTransfer(grid.getCraftingMatrix(), getPlayer().inventory);
}
private void addPatternSlots() {

View File

@@ -41,6 +41,10 @@ public class TransferManager {
addTransfer(new InventoryWrapperInventory(from), new InventoryWrapperItemHandler(to));
}
public void addTransfer(IInventory from, IInventory to) {
addTransfer(new InventoryWrapperInventory(from), new InventoryWrapperInventory(to));
}
public void addFilterTransfer(IInventory from, IItemHandlerModifiable itemTo, FluidInventory fluidTo, Supplier<Integer> typeGetter) {
addTransfer(new InventoryWrapperInventory(from), new InventoryWrapperFilter(itemTo, fluidTo, typeGetter));
}