Class VanillaInventoryHook

java.lang.Object
com.breakinblocks.graveless.capture.VanillaInventoryHook
All Implemented Interfaces:
InventoryHook

public class VanillaInventoryHook extends Object implements InventoryHook
  • Field Details

  • Constructor Details

    • VanillaInventoryHook

      public VanillaInventoryHook()
  • Method Details

    • id

      public String id()
      Specified by:
      id 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
    • 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