Interface SwapResult

All Known Implementing Classes:
SwapResultImpl

public interface SwapResult
The result of swapping ItemStacks between the player and an Immersive, usually by interacting with a hitbox of the Immersive that can hold items.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    giveToPlayer(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
    Give the playerHandStack() and leftoverStack() to the player specified as appropriate.
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.ItemStack
     
  • Method Details

    • playerHandStack

      net.minecraft.world.item.ItemStack playerHandStack()
      Returns:
      The ItemStack that should be placed in the player's hand, overwriting what is currently in it.
    • immersiveStack

      net.minecraft.world.item.ItemStack immersiveStack()
      Returns:
      The ItemStack that should be placed in the Immersive, overwriting what is currently in it.
    • leftoverStack

      net.minecraft.world.item.ItemStack leftoverStack()
      Returns:
      The leftover items that should be given to the player.
    • giveToPlayer

      void giveToPlayer(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Give the playerHandStack() and leftoverStack() to the player specified as appropriate. This function should only be called once per swap operation.
      The immersiveStack() needs to be handled separately.
      Parameters:
      player - The player to give items to.
      hand - The hand the player used to interact with the Immersive.