Class ItemHelpers
java.lang.Object
org.cyclops.evilcraft.core.helper.ItemHelpers
Helpers for items.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackstatic intGet the integer value of the given ItemStack.static booleanisActivated(net.minecraft.world.item.ItemStack itemStack) Check if the given item is activated.static voidSet the integer value of the given ItemStack for the given tag.static voidtoggleActivation(net.minecraft.world.item.ItemStack itemStack) Toggle activation for the given item.static net.minecraft.world.item.ItemStacktryFillContainerForPlayer(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 voidupdateAutoFill(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.
-
Field Details
-
NBT_KEY_ENABLED
- See Also:
-
-
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
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
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.
-