Class ArmorCosmeticHook

java.lang.Object
com.breakinblocks.graveless.integration.armorcosmetic.ArmorCosmeticHook
All Implemented Interfaces:
InventoryHook
Direct Known Subclasses:
ArmorCosmeticInventoryHook

public abstract class ArmorCosmeticHook 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)
     
    protected abstract net.minecraft.world.item.ItemStack
    get(net.minecraft.server.level.ServerPlayer player, int slot)
     
    id()
     
    boolean
    moveToGrave(net.minecraft.server.level.ServerPlayer player)
     
    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.
    protected abstract void
    set(net.minecraft.server.level.ServerPlayer player, int slot, net.minecraft.world.item.ItemStack stack)
     
    protected abstract int
    slots(net.minecraft.server.level.ServerPlayer player)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface InventoryHook

    prepareDrops, restoreFallback
  • Field Details

  • Constructor Details

    • ArmorCosmeticHook

      public ArmorCosmeticHook()
  • Method Details

    • slots

      protected abstract int slots(net.minecraft.server.level.ServerPlayer player)
    • get

      protected abstract net.minecraft.world.item.ItemStack get(net.minecraft.server.level.ServerPlayer player, int slot)
    • set

      protected abstract void set(net.minecraft.server.level.ServerPlayer player, int slot, net.minecraft.world.item.ItemStack stack)
    • 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
    • moveToGrave

      public boolean moveToGrave(net.minecraft.server.level.ServerPlayer player)
    • 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