Skip to content

Commit

Permalink
Ensure source slot is not cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Ferguson committed Aug 26, 2024
1 parent 2708be1 commit f3e1541
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ public ItemStackResponse translateRequest(GeyserSession session, Inventory inven
}

// Handle partial transfer of output slot
if (pendingOutput == 0 && getSlotType(sourceSlot) == SlotType.OUTPUT && transferAction.getCount() < plan.getItem(sourceSlot).getAmount()) {
if (pendingOutput == 0 && !isSourceCursor && getSlotType(sourceSlot) == SlotType.OUTPUT
&& transferAction.getCount() < plan.getItem(sourceSlot).getAmount()) {
// Cursor as dest should always be full transfer.
if (isDestCursor) {
return rejectRequest(request);
Expand All @@ -266,7 +267,7 @@ public ItemStackResponse translateRequest(GeyserSession session, Inventory inven

// Continue transferring items from output that is currently stored in the cursor
if (pendingOutput > 0) {
if (getSlotType(sourceSlot) != SlotType.OUTPUT
if (isSourceCursor || getSlotType(sourceSlot) != SlotType.OUTPUT
|| transferAction.getCount() > pendingOutput
|| destSlot == savedTempSlot
|| isDestCursor) {
Expand Down

0 comments on commit f3e1541

Please sign in to comment.