Interface ItemStackChecker

All Known Implementing Classes:
ItemStackMixinCast_ItemStackChecker

public interface ItemStackChecker
Checks iItemStacks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    NBT Key BlockEntityTag for BlockItems containing block entities.
    static final Collection<net.minecraft.entity.effect.StatusEffectInstance>
    Cached unluck singleton
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    cleanBanner(net.minecraft.nbt.NbtCompound blockEntity, net.minecraft.item.ItemStack faked)
    Minimally copies over the banner NBT based on the provided blockEntity data.
    static void
    cleanCrossbow(net.minecraft.nbt.NbtCompound crossbow, net.minecraft.item.ItemStack faked, boolean isInventory)
    Minimally copies over the crossbow data based on the provided Crossbow data.
    static void
    cleanSkull(net.minecraft.nbt.NbtCompound skullOwner, net.minecraft.item.ItemStack faked)
    Minimally copies over the skull data based on the provided SkullOwner data.
    static net.minecraft.item.ItemStack
    creativeInventoryStack(net.minecraft.item.ItemStack stack)
    This is for keeping creative from getting inadvertently sanitised, as creative has the property of allowing one to summon any item at will, including freely mutating the inventory.
    static net.minecraft.item.ItemStack
    fakeStack(net.minecraft.item.ItemStack original, boolean spoofCount)
    Creates a fake ItemStack based on the provided stack.
    static net.minecraft.item.ItemStack
    inventoryStack(net.minecraft.item.ItemStack stack)
    Creates a fake ItemStack based on the provided stack.
    void
    makeLegal(boolean survival)
    Checks the ItemStack and makes it legal.
  • Field Details

    • BLOCK_ENTITY_TAG_KEY

      static final String BLOCK_ENTITY_TAG_KEY
      NBT Key BlockEntityTag for BlockItems containing block entities.
      See Also:
    • UNLUCK

      static final Collection<net.minecraft.entity.effect.StatusEffectInstance> UNLUCK
      Cached unluck singleton
  • Method Details

    • makeLegal

      void makeLegal(boolean survival)
      Checks the ItemStack and makes it legal. Removes all enchantments if they are incompatible or have too high level.
    • fakeStack

      static net.minecraft.item.ItemStack fakeStack(net.minecraft.item.ItemStack original, boolean spoofCount)
      Creates a fake ItemStack based on the provided stack.

      E.g. removes enchantment info, stack size, etc. Used on ground ItemEntities / opponent's stacks etc.

      Parameters:
      original - the original ItemStack
      spoofCount - whether or not the item count should be faked
      Returns:
      the faked ItemStack
    • creativeInventoryStack

      static net.minecraft.item.ItemStack creativeInventoryStack(net.minecraft.item.ItemStack stack)
      This is for keeping creative from getting inadvertently sanitised, as creative has the property of allowing one to summon any item at will, including freely mutating the inventory.
      Parameters:
      stack - The original ItemStack.
      Returns:
      The faked ItemStack, with a GolfIV pointer injected.
      See Also:
    • inventoryStack

      static net.minecraft.item.ItemStack inventoryStack(net.minecraft.item.ItemStack stack)
      Creates a fake ItemStack based on the provided stack.

      Changes the tag to be the minimal required NBT to render in an inventory.

      Parameters:
      stack - The original ItemStack.
      Returns:
      The faked ItemStack
    • cleanCrossbow

      static void cleanCrossbow(net.minecraft.nbt.NbtCompound crossbow, net.minecraft.item.ItemStack faked, boolean isInventory)
      Minimally copies over the crossbow data based on the provided Crossbow data.

      Only the NBT required to render the crossbow, including rocket, is copied over.

      Parameters:
      crossbow - The raw crossbow NBT.
      faked - The faked ItemStack to copy to.
      isInventory - Whether to send the raw item or not.
    • cleanSkull

      static void cleanSkull(net.minecraft.nbt.NbtCompound skullOwner, net.minecraft.item.ItemStack faked)
      Minimally copies over the skull data based on the provided SkullOwner data.

      Only the NBT required to render the skull is copied over.

      Parameters:
      skullOwner - The SkullOwner NBT compound. May be null.
      faked - The faked ItemStack to copy to.
    • cleanBanner

      static void cleanBanner(net.minecraft.nbt.NbtCompound blockEntity, net.minecraft.item.ItemStack faked)
      Minimally copies over the banner NBT based on the provided blockEntity data.

      Only the NBT required to render a layer is copied over.

      Parameters:
      blockEntity - The original block entity tag. May be null.
      faked - The faked ItemStack to copy to.