Class ItemHelpers

java.lang.Object
org.cyclops.evilcraft.core.helper.ItemHelpers

public class ItemHelpers extends Object
Helpers for items.
  • Field Summary

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.ItemStack
     
    static int
    getNBTInt(net.minecraft.world.item.ItemStack itemStack, String tag)
    Get the integer value of the given ItemStack.
    static boolean
    isActivated(net.minecraft.world.item.ItemStack itemStack)
    Check if the given item is activated.
    static void
    setNBTInt(net.minecraft.world.item.ItemStack itemStack, int integer, String tag)
    Set the integer value of the given ItemStack for the given tag.
    static void
    toggleActivation(net.minecraft.world.item.ItemStack itemStack)
    Toggle activation for the given item.
    static net.minecraft.world.item.ItemStack
    tryFillContainerForPlayer(net.minecraftforge.fluids.capability.IFluidHandlerItem toDrain, net.minecraft.world.item.ItemStack toFill, net.minecraftforge.fluids.FluidStack tickFluid, net.minecraft.world.entity.player.Player player)
    Tries to fill a container item in a player inventory.
    static void
    updateAutoFill(net.minecraftforge.fluids.capability.IFluidHandlerItem toDrain, net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entity, boolean fillBuckets)
    Run an auto-fill tick for filling currently held container items from this item.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • ItemHelpers

      public ItemHelpers()
  • Method Details

    • isActivated

      public static boolean isActivated(net.minecraft.world.item.ItemStack itemStack)
      Check if the given item is activated.
      Parameters:
      itemStack - The item to check
      Returns:
      If it is an active container.
    • toggleActivation

      public static void toggleActivation(net.minecraft.world.item.ItemStack itemStack)
      Toggle activation for the given item.
      Parameters:
      itemStack - The item to toggle.
    • getNBTInt

      public static int getNBTInt(net.minecraft.world.item.ItemStack itemStack, String tag)
      Get the integer value of the given ItemStack.
      Parameters:
      itemStack - The item to check.
      tag - The tag in NBT for storing this value.
      Returns:
      The integer value for the given tag.
    • setNBTInt

      public static void setNBTInt(net.minecraft.world.item.ItemStack itemStack, int integer, String tag)
      Set the integer value of the given ItemStack for the given tag.
      Parameters:
      itemStack - The item to change.
      integer - The new integer value.
      tag - The tag in NBT for storing this value.
    • updateAutoFill

      public static void updateAutoFill(net.minecraftforge.fluids.capability.IFluidHandlerItem toDrain, net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entity, boolean fillBuckets)
      Run an auto-fill tick for filling currently held container items from this item.
      Parameters:
      toDrain - The item handler to drain from.
      world - The world.
      entity - The entity that holds this item.
      fillBuckets - If buckets should be filled.
    • tryFillContainerForPlayer

      public static net.minecraft.world.item.ItemStack tryFillContainerForPlayer(net.minecraftforge.fluids.capability.IFluidHandlerItem toDrain, net.minecraft.world.item.ItemStack toFill, net.minecraftforge.fluids.FluidStack tickFluid, net.minecraft.world.entity.player.Player player)
      Tries to fill a container item in a player inventory.
      Parameters:
      toDrain - The item handler to drain from.
      toFill - The container to try to fill.
      tickFluid - The fluid to fill with.
      player - The player that is the owner of toFill.
      Returns:
      The filled container
    • getBloodBucket

      public static net.minecraft.world.item.ItemStack getBloodBucket()
      Returns:
      The filled blood bucket.