Fixed shift clicking a created pattern going into Grid inventory. Fixes #1653

This commit is contained in:
raoulvdberge
2018-06-26 19:44:44 +02:00
parent d9ccd97871
commit c595a5082d
2 changed files with 14 additions and 0 deletions

View File

@@ -209,6 +209,19 @@ public class ContainerGrid extends ContainerBase {
if (slot.getHasStack()) {
if (grid instanceof IPortableGrid && slot.slotNumber == 4) { // Prevent moving disk slot into portable grid itself
return ItemStack.EMPTY;
} else if (grid.getType() == GridType.PATTERN && slot.slotNumber == 5) { // From output slot to inventory
ItemStack stack = slot.getStack();
int startIndex = 5;
int endIndex = startIndex + (9 * 4);
if (mergeItemStack(stack, startIndex, endIndex, false)) {
slot.onSlotChanged();
detectAndSendChanges();
}
return ItemStack.EMPTY;
} else if (slot == craftingResultSlot) {
grid.onCraftedShift(player);