Terminal: Fix multiple stacks being extracted on a single shift-click

This commit is contained in:
Shadowfacts 2019-10-30 14:09:47 -04:00
parent 654baa81a1
commit 2ec294d427
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import net.minecraft.entity.player.PlayerInventory
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraft.util.Identifier import net.minecraft.util.Identifier
import net.shadowfacts.phycon.PhysicalConnectivity import net.shadowfacts.phycon.PhysicalConnectivity
import kotlin.math.max import kotlin.math.min
/** /**
* @author shadowfacts * @author shadowfacts
@ -63,7 +63,7 @@ class TerminalContainer(syncId: Int, playerInv: PlayerInventory, val terminal: T
val slot = slotList[slotId] val slot = slotList[slotId]
val stack = slotList[slotId].stack val stack = slotList[slotId].stack
if (!stack.isEmpty && !player.world.isClient) { if (!stack.isEmpty && !player.world.isClient) {
terminal.requestItem(stack, max(stack.count, stack.maxCount)) terminal.requestItem(stack, min(stack.count, stack.maxCount))
} }
return ItemStack.EMPTY return ItemStack.EMPTY
} }