Class TrinketsInventoryHook

java.lang.Object
com.breakinblocks.graveless.integration.trinkets.TrinketsInventoryHook
All Implemented Interfaces:
InventoryHook

public class TrinketsInventoryHook extends Object implements InventoryHook
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    capture(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.damagesource.DamageSource source)
     
    dropEntry(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack)
     
    void
    finishDrops(net.minecraft.server.level.ServerPlayer player)
     
    id()
     
    void
    prepareDrops(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.damagesource.DamageSource source)
     
    net.minecraft.world.item.ItemStack
    restore(net.minecraft.server.level.ServerPlayer player, CapturedEntry entry)
    Restores into the original destination, leaving fallback until all original slots are tried.
    net.minecraft.world.item.ItemStack
    restoreFallback(net.minecraft.server.level.ServerPlayer player, CapturedEntry entry)
    Tries alternative hook destinations with the same live-remainder contract as restore.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • TrinketsInventoryHook

      public TrinketsInventoryHook()
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface InventoryHook
    • prepareDrops

      public void prepareDrops(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.damagesource.DamageSource source)
      Specified by:
      prepareDrops in interface InventoryHook
    • capture

      public List<CapturedEntry> capture(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.damagesource.DamageSource source)
      Specified by:
      capture in interface InventoryHook
    • dropEntry

      public CapturedEntry dropEntry(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack)
      Specified by:
      dropEntry in interface InventoryHook
    • finishDrops

      public void finishDrops(net.minecraft.server.level.ServerPlayer player)
      Specified by:
      finishDrops in interface InventoryHook
    • restore

      public net.minecraft.world.item.ItemStack restore(net.minecraft.server.level.ServerPlayer player, CapturedEntry entry)
      Description copied from interface: InventoryHook
      Restores into the original destination, leaving fallback until all original slots are tried. The entry stack is the live remainder: shrink it as transfers succeed, including before invoking callbacks that may throw. Never install that mutable remainder in an inventory; insert a copy. On failure the engine retains the remainder and retries it on a later claim.
      Specified by:
      restore in interface InventoryHook
    • restoreFallback

      public net.minecraft.world.item.ItemStack restoreFallback(net.minecraft.server.level.ServerPlayer player, CapturedEntry entry)
      Description copied from interface: InventoryHook
      Tries alternative hook destinations with the same live-remainder contract as restore.
      Specified by:
      restoreFallback in interface InventoryHook