mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed shift-clicking stacks from the result slot not putting them into the correct location and fixed shift-clicking not clearing the input grid
This commit is contained in:
parent
8f7fa1ae7e
commit
17a989f2a0
1 changed files with 6 additions and 1 deletions
|
@ -185,6 +185,7 @@ public class SpellbookScreenHandler extends ScreenHandler {
|
|||
|
||||
@Override
|
||||
public ItemStack transferSlot(PlayerEntity player, int index) {
|
||||
System.out.println("Transfer slot: " + index);
|
||||
Slot sourceSlot = slots.get(index);
|
||||
|
||||
if (sourceSlot == null || !sourceSlot.hasStack()) {
|
||||
|
@ -194,7 +195,11 @@ public class SpellbookScreenHandler extends ScreenHandler {
|
|||
ItemStack transferredStack = sourceSlot.getStack();
|
||||
ItemStack stack = transferredStack.copy();
|
||||
|
||||
if (index >= HOTBAR_START) {
|
||||
if (sourceSlot instanceof ResultSlot result) {
|
||||
result.onTakeItem(player, stack);
|
||||
}
|
||||
|
||||
if (index >= HOTBAR_START && !(sourceSlot instanceof ResultSlot || sourceSlot instanceof InputSlot)) {
|
||||
if (!gemSlot.hasStack() && gemSlot.canInsert(stack)) {
|
||||
if (insertItem(transferredStack, GEM_SLOT_INDEX, GEM_SLOT_INDEX + 1, false)) {
|
||||
onContentChanged(input);
|
||||
|
|
Loading…
Reference in a new issue