public final class ItemStackUnknown extends java.lang.Object implements IItemStack
| Modifier and Type | Field and Description |
|---|---|
static ItemStackUnknown |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
void |
addEnchantment(IEnchantment enchantment) |
IItemStack |
amount(int amount)
Creates a new item stack with a different stack size.
|
IItemStack |
anyAmount()
Creates an item stack with wildcard stack size.
|
IIngredient |
anyDamage()
Creates an item stack with the same item and stack size, but accepting
any damage value.
|
IItemStack |
applyNewTransform(IItemStack item) |
IItemStack |
applyTransform(IItemStack item,
IPlayer byPlayer)
Applies transformations after crafting, if any, to the given item.
|
IBlock |
asBlock()
Converts this item stack into a block.
|
boolean |
canApplyAtEnchantingTable(IEnchantmentDefinition enchantment) |
boolean |
canDestroy(IBlockDefinition block) |
boolean |
canEditBlocks() |
boolean |
canHarvestBlock(IBlockState block) |
boolean |
canPlaceOn(IBlockDefinition block) |
void |
clearCustomName() |
boolean |
contains(IIngredient ingredient)
Check if this ingredient contains all possible values for the given
ingredient.
|
IEntityItem |
createEntityItem(IWorld world,
IBlockPos pos) |
IEntityItem |
createEntityItem(IWorld world,
int x,
int y,
int z) |
void |
damageItem(int amount,
IEntity entity) |
int |
getAmount()
Gets the amount.
|
float |
getBlockHardness()
Gets the block hardness
|
IItemStack |
getContainerItem()
Gets the item's container ItemStack.
|
int |
getDamage()
Gets the item damage.
|
IItemDefinition |
getDefinition()
Gets the item definition.
|
java.lang.String |
getDisplayName()
Gets the display name.
|
java.util.List<IEnchantment> |
getEnchantments() |
boolean |
getHasSubtypes() |
java.lang.Object |
getInternal()
Gets the internal item backing this ingredient.
|
IItemStack[] |
getItemArray()
Gets all possible items for this ingredient as Array.
|
int |
getItemBurnTime() |
int |
getItemEnchantability() |
java.util.List<IItemStack> |
getItems()
Gets all possible items for this ingredient.
|
ILiquidStack |
getLiquid()
Gets the liquid contained in this item, if any.
|
java.util.List<ILiquidStack> |
getLiquids()
Gets all possible liquids for this ingredient.
|
java.lang.String |
getMark()
Gets the mark of the ingredient.
|
int |
getMaxDamage()
Gets the maximum item damage.
|
int |
getMaxStackSize()
Gets the max stack size for an item
|
int |
getMetadata() |
java.lang.String |
getName()
Gets the unlocalized item name.
|
java.util.List<IOreDictEntry> |
getOres()
Retrieves all the ores referring to this item.
|
int |
getRepairCost()
Checks the NBT-Tag for the repairCost and returns it as int.
|
float |
getStrengthAgainstBlock(IBlockState blockState) |
IData |
getTag()
Gets the item tag.
|
java.util.List<java.lang.String> |
getToolClasses() |
boolean |
hasContainerItem() |
boolean |
hasCustomEntity() |
boolean |
hasDisplayName() |
boolean |
hasEffect() |
boolean |
hasNewTransformers()
Checks if this ingredient has (or could have) any transformatiosns.
|
boolean |
hasTag() |
boolean |
hasTransformers() |
boolean |
isBeaconPayment() |
boolean |
isDamageable() |
boolean |
isEmpty()
Checks if the IItemStack either has an amount of 0 or represents the AIR item.
|
boolean |
isItemBlock()
Determine if the itemstack contains an itemblock.
|
boolean |
isItemDamaged() |
boolean |
isItemEnchantable() |
boolean |
isItemEnchanted() |
boolean |
isOnItemFrame() |
boolean |
isStackable() |
IIngredient |
marked(java.lang.String mark)
Returns a new ingredient marked with the given name.
|
boolean |
matches(IItemStack item)
Checks if this ingredient matches the given item.
|
boolean |
matches(ILiquidStack liquid)
Checks if this ingredient matches the given liquid.
|
boolean |
matchesExact(IItemStack item)
Checks if this ingredient matches the given item.
|
IMutableItemStack |
mutable() |
IIngredient |
only(IItemCondition condition)
Returns a new ingredient with the given condition added to it.
|
IIngredient |
or(IIngredient ingredient)
Combines multiple ingredients into a single one.
|
WeightedItemStack |
percent(float p)
Creates a weighted item stack with the given percentage chance.
|
IItemStack |
removeTag(java.lang.String tag)
Creates an item stack without the given nbt tag.
|
void |
setBlockHardness(float hardness)
Sets the block hardness
|
void |
setDisplayName(java.lang.String name)
Sets the display name.
|
void |
setMaxDamage(int damage)
Sets the max Itemstack damage
|
void |
setMaxStackSize(int size)
Sets the ItemStack max stack size.
|
void |
setRepairCost(int repairCost)
Writes the repairCost to the NBT-Tag
|
boolean |
showsDurabilityBar() |
IItemStack |
splitStack(int amount)
Splits the current itemStack and returns the new one.
|
java.lang.String |
toCommandString() |
IIngredient |
transform(IItemTransformer transformer) |
IIngredient |
transformNew(IItemTransformerNew transformer)
Returns a new ingredient with the given transform added to it.
|
IItemStack |
updateTag(IData tagUpdate) |
WeightedItemStack |
weight(float p)
Creates a weighted item stack with the given weight.
|
IItemStack |
withAmount(int amount)
Creates an item stack with the specified stack size.
|
IItemStack |
withDamage(int damage)
Creates an item stack with the specified damage.
|
IItemStack |
withDisplayName(java.lang.String name)
Adds a display name to the Item, even if it already has nbt
|
IItemStack |
withEmptyTag()
Create an item stack with an empty nbt tag.
|
IItemStack |
withLore(java.lang.String[] lore)
Adds a Lore to the Item, even if it already has nbt
|
IItemStack |
withTag(IData tag) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateEntityItem, getHarvestLevel, getHarvestLevel, getHealAmount, getMatchTagExact, getSaturation, isFood, updateTag, withTagpublic static final ItemStackUnknown INSTANCE
public IItemDefinition getDefinition()
IItemStackgetDefinition in interface IItemStackpublic boolean isItemBlock()
IItemStackisItemBlock in interface IItemStackpublic java.lang.String getName()
IItemStackgetName in interface IItemStackpublic java.lang.String getDisplayName()
IItemStackgetDisplayName in interface IItemStackpublic void setDisplayName(java.lang.String name)
IItemStacksetDisplayName in interface IItemStackname - item display namepublic int getMaxStackSize()
IItemStackgetMaxStackSize in interface IItemStackpublic void setMaxStackSize(int size)
IItemStacksetMaxStackSize in interface IItemStacksize - the new max sizepublic float getBlockHardness()
IItemStackgetBlockHardness in interface IItemStackpublic void setBlockHardness(float hardness)
IItemStacksetBlockHardness in interface IItemStackhardness - the new hardnesspublic int getDamage()
IItemStackgetDamage in interface IItemStackpublic int getMaxDamage()
IItemStackgetMaxDamage in interface IItemStackpublic void setMaxDamage(int damage)
IItemStacksetMaxDamage in interface IItemStackdamage - the new max damagepublic IData getTag()
IItemStackgetTag in interface IItemStackpublic ILiquidStack getLiquid()
IItemStackgetLiquid in interface IItemStackpublic java.lang.String getMark()
IIngredientgetMark in interface IIngredientpublic int getAmount()
IIngredientShould return -1 if no amount is available and 1 for a single item. Stacks return the stack size.
getAmount in interface IIngredientpublic java.util.List<IItemStack> getItems()
IIngredientIf there is no item list (for example, it is the <*> wildcard item) null should be returned.
getItems in interface IIngredientpublic IItemStack[] getItemArray()
IIngredientIf there is no item list (for example, it is the <*> wildcard item) an empty Array should be returned
getItemArray in interface IIngredientpublic java.util.List<ILiquidStack> getLiquids()
IIngredientIf there is no liquid list (for example, it is the <*&ft; wildcard item) null should be returned.
getLiquids in interface IIngredientpublic IItemStack amount(int amount)
IItemStackamount in interface IIngredientamount in interface IItemStackamount - new item stack sizepublic IIngredient or(IIngredient ingredient)
IIngredientor in interface IIngredientingredient - ingredient to combine withpublic IIngredient transformNew(IItemTransformerNew transformer)
IIngredienttransformNew in interface IIngredienttransformer - transformer to addpublic IIngredient only(IItemCondition condition)
IIngredientonly in interface IIngredientcondition - condition to addpublic IIngredient marked(java.lang.String mark)
IIngredientmarked in interface IIngredientmark - mark to applypublic boolean matches(IItemStack item)
IIngredientmatches in interface IIngredientitem - item to checkpublic boolean matchesExact(IItemStack item)
IIngredientmatchesExact in interface IIngredientitem - item to checkpublic boolean matches(ILiquidStack liquid)
IIngredientmatches in interface IIngredientliquid - liquid to checkpublic boolean contains(IIngredient ingredient)
IIngredientcontains in interface IIngredientingredient - ingredient to checkpublic IItemStack applyTransform(IItemStack item, IPlayer byPlayer)
IIngredientapplyTransform in interface IIngredientitem - item to transformNewbyPlayer - player performing the crafting operationpublic IItemStack applyNewTransform(IItemStack item)
applyNewTransform in interface IIngredientpublic boolean hasNewTransformers()
IIngredienthasNewTransformers in interface IIngredientpublic boolean hasTransformers()
hasTransformers in interface IIngredientpublic IIngredient transform(IItemTransformer transformer)
transform in interface IIngredientpublic java.lang.Object getInternal()
IIngredientThe value is implementation-dependent and should only be handled by the internal code. Don't use this value - instead, use the version-specific helper methods.
getInternal in interface IIngredientpublic java.lang.String toCommandString()
toCommandString in interface IIngredientpublic WeightedItemStack percent(float p)
IItemStackpercent in interface IItemStackp - probability, with percentpublic WeightedItemStack weight(float p)
IItemStackweight in interface IItemStackp - item weightpublic IIngredient anyDamage()
IItemStackanyDamage in interface IItemStackpublic IItemStack withDamage(int damage)
IItemStackwithDamage in interface IItemStackdamage - damage valuepublic IItemStack withAmount(int amount)
IItemStackwithAmount in interface IItemStackamount - stack sizepublic IItemStack anyAmount()
IItemStackanyAmount in interface IItemStackpublic IItemStack withTag(IData tag)
withTag in interface IItemStackpublic IItemStack withEmptyTag()
IItemStackwithEmptyTag in interface IItemStackpublic IItemStack removeTag(java.lang.String tag)
IItemStackremoveTag in interface IItemStacktag - item tag to be removedpublic IItemStack updateTag(IData tagUpdate)
updateTag in interface IItemStackpublic IBlock asBlock()
IItemStackasBlock in interface IItemStackpublic java.util.List<IOreDictEntry> getOres()
IItemStackgetOres in interface IItemStackpublic IItemStack withDisplayName(java.lang.String name)
IItemStackwithDisplayName in interface IItemStackname - supports color codes with "§"public IItemStack withLore(java.lang.String[] lore)
IItemStackwithLore in interface IItemStacklore - supports color codes with "§"public java.util.List<java.lang.String> getToolClasses()
getToolClasses in interface IItemStackpublic int getItemEnchantability()
getItemEnchantability in interface IItemStackpublic IItemStack getContainerItem()
IItemStackgetContainerItem in interface IItemStackpublic boolean isBeaconPayment()
isBeaconPayment in interface IItemStackpublic boolean canPlaceOn(IBlockDefinition block)
canPlaceOn in interface IItemStackpublic boolean canDestroy(IBlockDefinition block)
canDestroy in interface IItemStackpublic boolean canHarvestBlock(IBlockState block)
canHarvestBlock in interface IItemStackpublic int getRepairCost()
IItemStackgetRepairCost in interface IItemStackpublic void setRepairCost(int repairCost)
IItemStacksetRepairCost in interface IItemStackpublic boolean canEditBlocks()
canEditBlocks in interface IItemStackpublic boolean isOnItemFrame()
isOnItemFrame in interface IItemStackpublic boolean isItemEnchanted()
isItemEnchanted in interface IItemStackpublic boolean isItemDamaged()
isItemDamaged in interface IItemStackpublic boolean isDamageable()
isDamageable in interface IItemStackpublic boolean isStackable()
isStackable in interface IItemStackpublic void addEnchantment(IEnchantment enchantment)
addEnchantment in interface IItemStackpublic boolean canApplyAtEnchantingTable(IEnchantmentDefinition enchantment)
canApplyAtEnchantingTable in interface IItemStackpublic java.util.List<IEnchantment> getEnchantments()
getEnchantments in interface IItemStackpublic boolean isItemEnchantable()
isItemEnchantable in interface IItemStackpublic boolean hasEffect()
hasEffect in interface IItemStackpublic boolean hasDisplayName()
hasDisplayName in interface IItemStackpublic void clearCustomName()
clearCustomName in interface IItemStackpublic boolean hasTag()
hasTag in interface IItemStackpublic void damageItem(int amount,
IEntity entity)
damageItem in interface IItemStackpublic int getMetadata()
getMetadata in interface IItemStackpublic boolean getHasSubtypes()
getHasSubtypes in interface IItemStackpublic float getStrengthAgainstBlock(IBlockState blockState)
getStrengthAgainstBlock in interface IItemStackpublic IItemStack splitStack(int amount)
IItemStacksplitStack in interface IItemStackamount - amount to splitpublic boolean isEmpty()
IItemStackisEmpty in interface IItemStackpublic int getItemBurnTime()
getItemBurnTime in interface IItemStackpublic boolean showsDurabilityBar()
showsDurabilityBar in interface IItemStackpublic boolean hasCustomEntity()
hasCustomEntity in interface IItemStackpublic boolean hasContainerItem()
hasContainerItem in interface IItemStackpublic IEntityItem createEntityItem(IWorld world, int x, int y, int z)
createEntityItem in interface IItemStackpublic IEntityItem createEntityItem(IWorld world, IBlockPos pos)
createEntityItem in interface IItemStackpublic IMutableItemStack mutable()
mutable in interface IItemStack