Package noppes.npcs.api.handler.data
Interface ILinkedItem
-
public interface ILinkedItemRepresents a linked item definition. Linked items are custom item templates that can be globally updated; all existing instances inherit the new properties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IItemStackcreateStack()Creates an ItemStack from this linked item definition.intgetArmorType()intgetAttackSpeed()intgetDigSpeed()doublegetDurabilityValue()intgetEnchantability()intgetId()intgetItemUseAction()intgetMaxItemUseDuration()StringgetName()intgetStackSize()intgetVersion()booleanisNormalItem()booleanisTool()ILinkedItemsave()Persists this linked item and returns the saved instance.voidsetArmorType(int armorType)voidsetAttackSpeed(int time)voidsetDigSpeed(int digSpeed)voidsetDurabilityValue(double durabilityValue)voidsetEnchantability(int enchantability)voidsetId(int id)voidsetItemUseAction(int itemUseAction)voidsetMaxItemUseDuration(int maxItemUseDuration)voidsetName(String name)voidsetNormalItem(boolean normalItem)voidsetStackSize(int stackSize)voidsetTool(boolean tool)voidsetVersion(int version)
-
-
-
Method Detail
-
save
ILinkedItem save()
Persists this linked item and returns the saved instance.- Returns:
- the saved linked item.
-
createStack
IItemStack createStack()
Creates an ItemStack from this linked item definition.- Returns:
- the created item stack.
-
getId
int getId()
- Returns:
- the unique ID of this linked item.
-
setId
void setId(int id)
- Parameters:
id- the unique ID.
-
getVersion
int getVersion()
- Returns:
- the version number of this linked item.
-
setVersion
void setVersion(int version)
- Parameters:
version- the new version number.
-
getName
String getName()
- Returns:
- the display name.
-
setName
void setName(String name)
- Parameters:
name- the display name.
-
getDurabilityValue
double getDurabilityValue()
- Returns:
- the durability value (max damage).
-
setDurabilityValue
void setDurabilityValue(double durabilityValue)
- Parameters:
durabilityValue- the durability value.
-
getStackSize
int getStackSize()
- Returns:
- the maximum stack size.
-
setStackSize
void setStackSize(int stackSize)
- Parameters:
stackSize- the maximum stack size.
-
getMaxItemUseDuration
int getMaxItemUseDuration()
- Returns:
- the maximum item use duration in ticks.
-
setMaxItemUseDuration
void setMaxItemUseDuration(int maxItemUseDuration)
- Parameters:
maxItemUseDuration- the use duration in ticks.
-
getItemUseAction
int getItemUseAction()
- Returns:
- the item use action type.
- See Also:
EnumAction
-
setItemUseAction
void setItemUseAction(int itemUseAction)
- Parameters:
itemUseAction- the item use action type ordinal.
-
isNormalItem
boolean isNormalItem()
- Returns:
- true if this is a normal (non-tool, non-armor) item.
-
setNormalItem
void setNormalItem(boolean normalItem)
- Parameters:
normalItem- true for a normal item.
-
isTool
boolean isTool()
- Returns:
- true if this item functions as a tool.
-
setTool
void setTool(boolean tool)
- Parameters:
tool- true to mark as a tool.
-
getDigSpeed
int getDigSpeed()
- Returns:
- the dig speed for tool items.
-
setDigSpeed
void setDigSpeed(int digSpeed)
- Parameters:
digSpeed- the dig speed.
-
getArmorType
int getArmorType()
- Returns:
- the armor type slot. 0: helmet, 1: chestplate, 2: leggings, 3: boots, -1: not armor.
-
setArmorType
void setArmorType(int armorType)
- Parameters:
armorType- the armor type slot.
-
getEnchantability
int getEnchantability()
- Returns:
- the enchantability value.
-
setEnchantability
void setEnchantability(int enchantability)
- Parameters:
enchantability- the enchantability value.
-
getAttackSpeed
int getAttackSpeed()
- Returns:
- the attack speed in ticks between attacks.
-
setAttackSpeed
void setAttackSpeed(int time)
- Parameters:
time- attack speed in ticks.
-
-