fix change to discovery not allowing for unstackables
This commit is contained in:
parent
2ae33cf82d
commit
8ea5b53ee2
1 changed files with 1 additions and 2 deletions
|
@ -14,7 +14,6 @@ import net.minecraft.server.level.ServerLevel
|
|||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.InteractionHand
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.item.ItemEntity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.level.GameType
|
||||
|
@ -157,7 +156,7 @@ data class CastingContext(
|
|||
val stacksToExamine = DiscoveryHandlers.collectItemSlots(this)
|
||||
|
||||
fun matches(stack: ItemStack): Boolean =
|
||||
!stack.isEmpty && ItemEntity.areMergable(stack, item)
|
||||
!stack.isEmpty && ItemStack.matches(item, stack)
|
||||
|
||||
val presentCount = stacksToExamine.fold(0) { acc, stack ->
|
||||
acc + if (matches(stack)) stack.count else 0
|
||||
|
|
Loading…
Reference in a new issue