public class ItemHelpers
extends java.lang.Object
| Constructor and Description |
|---|
ItemHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getNBTInt(net.minecraft.item.ItemStack itemStack,
java.lang.String tag)
Get the integer value of the given ItemStack.
|
static boolean |
hasPlayerItem(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.Item item)
Check if the given player has at least one of the given item.
|
static boolean |
isActivated(net.minecraft.item.ItemStack itemStack)
Check if the given item is activated.
|
static void |
setNBTInt(net.minecraft.item.ItemStack itemStack,
int integer,
java.lang.String tag)
Set the integer value of the given ItemStack for the given tag.
|
static void |
toggleActivation(net.minecraft.item.ItemStack itemStack)
Toggle activation for the given item.
|
static void |
tryFillContainerForPlayer(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.item.ItemStack toFill,
net.minecraftforge.fluids.FluidStack tickFluid,
net.minecraft.entity.player.EntityPlayer player)
Tries to fill a container item in a player inventory.
|
static void |
updateAutoFill(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity)
Run an auto-fill tick for filling currently held container items from this item.
|
public static boolean isActivated(net.minecraft.item.ItemStack itemStack)
itemStack - The item to checkpublic static void toggleActivation(net.minecraft.item.ItemStack itemStack)
itemStack - The item to toggle.public static int getNBTInt(net.minecraft.item.ItemStack itemStack,
java.lang.String tag)
itemStack - The item to check.tag - The tag in NBT for storing this value.public static void setNBTInt(net.minecraft.item.ItemStack itemStack,
int integer,
java.lang.String tag)
itemStack - The item to change.integer - The new integer value.tag - The tag in NBT for storing this value.public static void updateAutoFill(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity)
item - The item type to fill from.itemStack - The item stack to fill from.world - The world.entity - The entity that holds this item.public static void tryFillContainerForPlayer(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.item.ItemStack toFill,
net.minecraftforge.fluids.FluidStack tickFluid,
net.minecraft.entity.player.EntityPlayer player)
item - The item container to drain from.itemStack - The stack 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.public static boolean hasPlayerItem(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.Item item)
player - The player.item - The item to search in the inventory.