public class ItemUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ItemUtils.ItemStacksMerger
Utility class to help merge
itemStacks. |
static class |
ItemUtils.ItemStackSplitter
Utility class to help split an
ItemStack. |
| Modifier and Type | Field and Description |
|---|---|
static int |
FULL_STACK
Defines a full stack amount to process.
|
static int |
HALF_STACK
Defines a half stack amount to process.
|
static java.util.regex.Pattern |
pattern
Regex pattern to convert a string into an
ItemStack. |
| Constructor and Description |
|---|
ItemUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areItemStacksStackable(net.minecraft.item.ItemStack stack1,
net.minecraft.item.ItemStack stack2)
Checks whether two
itemStacks can be stacked together |
static net.minecraft.item.ItemStack |
getItemStack(java.lang.String str)
Construct an
ItemStack from a string in the format modid:itemName@damagexstackSize. |
static net.minecraft.item.ItemStack |
getItemStackFromState(net.minecraft.block.state.IBlockState state)
Gets the
ItemStack matching the specified IBlockState |
static net.minecraft.block.state.IBlockState |
getStateFromItemStack(net.minecraft.item.ItemStack itemStack)
Gets a
IBlockState corresponding to the specified ItemStack |
public static final int FULL_STACK
public static final int HALF_STACK
public static final java.util.regex.Pattern pattern
ItemStack. Format : [modid:]item[@damage[xsize]]public static boolean areItemStacksStackable(net.minecraft.item.ItemStack stack1,
net.minecraft.item.ItemStack stack2)
itemStacks can be stacked togetherstack1 - first itemStackstack2 - second itemStackpublic static net.minecraft.block.state.IBlockState getStateFromItemStack(net.minecraft.item.ItemStack itemStack)
IBlockState corresponding to the specified ItemStackitemStack - the item stackpublic static net.minecraft.item.ItemStack getItemStackFromState(net.minecraft.block.state.IBlockState state)
ItemStack matching the specified IBlockStatestate - the statepublic static net.minecraft.item.ItemStack getItemStack(java.lang.String str)
ItemStack from a string in the format modid:itemName@damagexstackSize.str - the str