mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-26 05:28:33 +01:00
allow shift clicking a ghost item to clear the entire crafting grid
closes #197
This commit is contained in:
parent
c7f43c3500
commit
5b96a9d5a2
1 changed files with 11 additions and 4 deletions
|
@ -64,10 +64,17 @@ public class CraftingTerminalContainer extends ItemTerminalContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clicked(int slotId, int dragType, ClickType clickTypeIn, Player player) {
|
public void clicked(int slotId, int dragType, ClickType clickTypeIn, Player player) {
|
||||||
if (slotId > 0 && clickTypeIn == ClickType.PICKUP) {
|
if (slotId > 0) {
|
||||||
|
var ghostItems = this.getTile().ghostItems;
|
||||||
|
if (clickTypeIn == ClickType.PICKUP) {
|
||||||
var slot = this.slots.get(slotId);
|
var slot = this.slots.get(slotId);
|
||||||
if (slot.container == this.craftInventory && !slot.hasItem())
|
if (slot.container == this.craftInventory && !slot.hasItem())
|
||||||
this.getTile().ghostItems.setStackInSlot(slot.getSlotIndex(), ItemStack.EMPTY);
|
ghostItems.setStackInSlot(slot.getSlotIndex(), ItemStack.EMPTY);
|
||||||
|
} else if (clickTypeIn == ClickType.QUICK_MOVE) {
|
||||||
|
// clear the entire grid when holding shift
|
||||||
|
for (var i = 0; i < ghostItems.getSlots(); i++)
|
||||||
|
ghostItems.setStackInSlot(i, ItemStack.EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.clicked(slotId, dragType, clickTypeIn, player);
|
super.clicked(slotId, dragType, clickTypeIn, player);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue