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 |
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.
|
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, wait
updateTag, withTag
public static final ItemStackUnknown INSTANCE
public IItemDefinition getDefinition()
IItemStack
getDefinition
in interface IItemStack
public java.lang.String getName()
IItemStack
getName
in interface IItemStack
public java.lang.String getDisplayName()
IItemStack
getDisplayName
in interface IItemStack
public void setDisplayName(java.lang.String name)
IItemStack
setDisplayName
in interface IItemStack
name
- item display namepublic int getMaxStackSize()
IItemStack
getMaxStackSize
in interface IItemStack
public void setMaxStackSize(int size)
IItemStack
setMaxStackSize
in interface IItemStack
size
- the new max sizepublic float getBlockHardness()
IItemStack
getBlockHardness
in interface IItemStack
public void setBlockHardness(float hardness)
IItemStack
setBlockHardness
in interface IItemStack
hardness
- the new hardnesspublic int getDamage()
IItemStack
getDamage
in interface IItemStack
public int getMaxDamage()
IItemStack
getMaxDamage
in interface IItemStack
public void setMaxDamage(int damage)
IItemStack
setMaxDamage
in interface IItemStack
damage
- the new max damagepublic IData getTag()
IItemStack
getTag
in interface IItemStack
public ILiquidStack getLiquid()
IItemStack
getLiquid
in interface IItemStack
public java.lang.String getMark()
IIngredient
getMark
in interface IIngredient
public int getAmount()
IIngredient
Should return -1 if no amount is available and 1 for a single item. Stacks return the stack size.
getAmount
in interface IIngredient
public java.util.List<IItemStack> getItems()
IIngredient
If there is no item list (for example, it is the <*> wildcard item) null should be returned.
getItems
in interface IIngredient
public IItemStack[] getItemArray()
IIngredient
If there is no item list (for example, it is the <*> wildcard item) an empty Array should be returned
getItemArray
in interface IIngredient
public java.util.List<ILiquidStack> getLiquids()
IIngredient
If there is no liquid list (for example, it is the <*&ft; wildcard item) null should be returned.
getLiquids
in interface IIngredient
public IItemStack amount(int amount)
IItemStack
amount
in interface IIngredient
amount
in interface IItemStack
amount
- new item stack sizepublic IIngredient or(IIngredient ingredient)
IIngredient
or
in interface IIngredient
ingredient
- ingredient to combine withpublic IIngredient transformNew(IItemTransformerNew transformer)
IIngredient
transformNew
in interface IIngredient
transformer
- transformer to addpublic IIngredient only(IItemCondition condition)
IIngredient
only
in interface IIngredient
condition
- condition to addpublic IIngredient marked(java.lang.String mark)
IIngredient
marked
in interface IIngredient
mark
- mark to applypublic boolean matches(IItemStack item)
IIngredient
matches
in interface IIngredient
item
- item to checkpublic boolean matchesExact(IItemStack item)
IIngredient
matchesExact
in interface IIngredient
item
- item to checkpublic boolean matches(ILiquidStack liquid)
IIngredient
matches
in interface IIngredient
liquid
- liquid to checkpublic boolean contains(IIngredient ingredient)
IIngredient
contains
in interface IIngredient
ingredient
- ingredient to checkpublic IItemStack applyTransform(IItemStack item, IPlayer byPlayer)
IIngredient
applyTransform
in interface IIngredient
item
- item to transformNewbyPlayer
- player performing the crafting operationpublic IItemStack applyNewTransform(IItemStack item)
applyNewTransform
in interface IIngredient
public boolean hasNewTransformers()
IIngredient
hasNewTransformers
in interface IIngredient
public boolean hasTransformers()
hasTransformers
in interface IIngredient
public IIngredient transform(IItemTransformer transformer)
transform
in interface IIngredient
public java.lang.Object getInternal()
IIngredient
The 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 IIngredient
public java.lang.String toCommandString()
toCommandString
in interface IIngredient
public WeightedItemStack percent(float p)
IItemStack
percent
in interface IItemStack
p
- probability, with percentpublic WeightedItemStack weight(float p)
IItemStack
weight
in interface IItemStack
p
- item weightpublic IIngredient anyDamage()
IItemStack
anyDamage
in interface IItemStack
public IItemStack withDamage(int damage)
IItemStack
withDamage
in interface IItemStack
damage
- damage valuepublic IItemStack withAmount(int amount)
IItemStack
withAmount
in interface IItemStack
amount
- stack sizepublic IItemStack anyAmount()
IItemStack
anyAmount
in interface IItemStack
public IItemStack withTag(IData tag)
withTag
in interface IItemStack
public IItemStack withEmptyTag()
IItemStack
withEmptyTag
in interface IItemStack
public IItemStack removeTag(java.lang.String tag)
IItemStack
removeTag
in interface IItemStack
tag
- item tag to be removedpublic IItemStack updateTag(IData tagUpdate)
updateTag
in interface IItemStack
public IBlock asBlock()
IItemStack
asBlock
in interface IItemStack
public java.util.List<IOreDictEntry> getOres()
IItemStack
getOres
in interface IItemStack
public IItemStack withDisplayName(java.lang.String name)
IItemStack
withDisplayName
in interface IItemStack
name
- supports color codes with "§"public IItemStack withLore(java.lang.String[] lore)
IItemStack
withLore
in interface IItemStack
lore
- supports color codes with "§"public java.util.List<java.lang.String> getToolClasses()
getToolClasses
in interface IItemStack
public int getItemEnchantability()
getItemEnchantability
in interface IItemStack
public IItemStack getContainerItem()
IItemStack
getContainerItem
in interface IItemStack
public boolean isBeaconPayment()
isBeaconPayment
in interface IItemStack
public boolean canPlaceOn(IBlockDefinition block)
canPlaceOn
in interface IItemStack
public boolean canDestroy(IBlockDefinition block)
canDestroy
in interface IItemStack
public boolean canHarvestBlock(IBlockState block)
canHarvestBlock
in interface IItemStack
public int getRepairCost()
IItemStack
getRepairCost
in interface IItemStack
public void setRepairCost(int repairCost)
IItemStack
setRepairCost
in interface IItemStack
public boolean canEditBlocks()
canEditBlocks
in interface IItemStack
public boolean isOnItemFrame()
isOnItemFrame
in interface IItemStack
public boolean isItemEnchanted()
isItemEnchanted
in interface IItemStack
public boolean isItemDamaged()
isItemDamaged
in interface IItemStack
public boolean isDamageable()
isDamageable
in interface IItemStack
public boolean isStackable()
isStackable
in interface IItemStack
public void addEnchantment(IEnchantment enchantment)
addEnchantment
in interface IItemStack
public boolean canApplyAtEnchantingTable(IEnchantmentDefinition enchantment)
canApplyAtEnchantingTable
in interface IItemStack
public java.util.List<IEnchantment> getEnchantments()
getEnchantments
in interface IItemStack
public boolean isItemEnchantable()
isItemEnchantable
in interface IItemStack
public boolean hasEffect()
hasEffect
in interface IItemStack
public boolean hasDisplayName()
hasDisplayName
in interface IItemStack
public void clearCustomName()
clearCustomName
in interface IItemStack
public boolean hasTag()
hasTag
in interface IItemStack
public void damageItem(int amount, IEntity entity)
damageItem
in interface IItemStack
public int getMetadata()
getMetadata
in interface IItemStack
public boolean getHasSubtypes()
getHasSubtypes
in interface IItemStack
public float getStrengthAgainstBlock(IBlockState blockState)
getStrengthAgainstBlock
in interface IItemStack
public IItemStack splitStack(int amount)
IItemStack
splitStack
in interface IItemStack
amount
- amount to splitpublic boolean isEmpty()
IItemStack
isEmpty
in interface IItemStack
public int getItemBurnTime()
getItemBurnTime
in interface IItemStack
public boolean showsDurabilityBar()
showsDurabilityBar
in interface IItemStack
public boolean hasCustomEntity()
hasCustomEntity
in interface IItemStack
public boolean hasContainerItem()
hasContainerItem
in interface IItemStack
public IEntityItem createEntityItem(IWorld world, int x, int y, int z)
createEntityItem
in interface IItemStack
public IEntityItem createEntityItem(IWorld world, IBlockPos pos)
createEntityItem
in interface IItemStack