Package net.risingworld.api.definitions
Class Items.ItemDefinition
java.lang.Object
net.risingworld.api.definitions.Items.ItemDefinition
- Enclosing class:
Items
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionItem break sound.booleanGets whether or not this item can have a modifierbooleanDetermines whether of not this item can swim in waterItem category (e.g tool, medical, weapon etc)Item collide sound.booleanDetermines whether this item requires a collision listener (if spawned as world item)Consume info for this item.booleanIf true, this item has a custom icon which is generated at runtimefloatMass for debrisshortInitial status for new items.floatInitial value for new items.booleanIf true, item will be destroyed when being dropped (i.e it does not spawn a world item)intItem durability (number of uses before it breaks).Era/age this item belongs toExtent / size of the itemItem group flagsDetermines in which hand this item is being held (0 == left, 1 == right, 2 == none).Item hit sound.shortInternal ID of the itemAll item infos related to this item.floatItem massItem material (i.e the material this item consists of, e.g stone, metal, wood etc)shortMax status for items.floatMax value for items.Name of the itembooleanDetermines whether the item action is performed if held by a (hostile) npc, or if the npc performs a generic punch when attacking the playerPicking info for this item.Optional other item that gets added to the inventory when picking up this item.Item place sound.Item model offset when holding in handsOptional offset when rendering the item (e.g as custom icon or for crafting preview)Optional rotation when rendering the item (e.g as custom icon or for crafting preview)booleanIf true, the item status will be set to 0 when dropping this itembooleanIf true, the item value will be set to 0 when dropping this itemItem model rotation when holding in handsfloatItem model size (default: 1.0f)shortMax stack size for this itemshortItem strength / hit pointsbooleanDetermines if this item is two-handed, i.e held by both handsItem typeArray containing all item variants.intNumber of item variants (see variants array). -
Method Summary
Modifier and TypeMethodDescriptiongetIcon(int texture) Gets the ingame icon of this item as TextureAsset.getVariant(int variant) Gets a item variant.void
-
Field Details
-
id
public short idInternal ID of the item -
name
Name of the item -
type
Item type -
group
Item group flags -
variations
public int variationsNumber of item variants (see variants array). 0 means there are no additional variants available (only the default variant), 1 means there are two variants (default and 1) etc -
hand
Determines in which hand this item is being held (0 == left, 1 == right, 2 == none). Basically this just determines which hand the game object gets attached to -
twohanded
public boolean twohandedDetermines if this item is two-handed, i.e held by both hands -
position
Item model offset when holding in hands -
rotation
Item model rotation when holding in hands -
pickupitem
Optional other item that gets added to the inventory when picking up this item. Null by default -
size
public float sizeItem model size (default: 1.0f) -
stacksize
public short stacksizeMax stack size for this item -
material
Item material (i.e the material this item consists of, e.g stone, metal, wood etc) -
extent
Extent / size of the item -
category
Item category (e.g tool, medical, weapon etc) -
era
Era/age this item belongs to -
strength
public short strengthItem strength / hit points -
durability
public int durabilityItem durability (number of uses before it breaks). -1 == infinite -
mass
public float massItem mass -
debrismass
public float debrismassMass for debris -
collisionlistener
public boolean collisionlistenerDetermines whether this item requires a collision listener (if spawned as world item) -
canhavemodifier
public boolean canhavemodifierGets whether or not this item can have a modifier -
canswim
public boolean canswimDetermines whether of not this item can swim in water -
npcaction
public boolean npcactionDetermines whether the item action is performed if held by a (hostile) npc, or if the npc performs a generic punch when attacking the player -
defaultstatus
public short defaultstatusInitial status for new items. Default: 0 -
defaultvalue
public float defaultvalueInitial value for new items. Default: 0.0 -
maxstatus
public short maxstatusMax status for items. Default: 0 -
maxvalue
public float maxvalueMax value for items. Default: 0.0 -
resetstatusondrop
public boolean resetstatusondropIf true, the item status will be set to 0 when dropping this item -
resetvalueondrop
public boolean resetvalueondropIf true, the item value will be set to 0 when dropping this item -
destroyondrop
public boolean destroyondropIf true, item will be destroyed when being dropped (i.e it does not spawn a world item) -
customicon
public boolean customiconIf true, this item has a custom icon which is generated at runtime -
renderoffset
Optional offset when rendering the item (e.g as custom icon or for crafting preview) -
renderrotation
Optional rotation when rendering the item (e.g as custom icon or for crafting preview) -
hitsound
Item hit sound. May be null -
breaksound
Item break sound. May be null -
collidesound
Item collide sound. May be null -
placesound
Item place sound. May be null -
pickingInfo
Picking info for this item. May be null -
itemInfos
All item infos related to this item. May be null -
consumeInfo
Consume info for this item. May be null -
variants
Array containing all item variants. Variant 0 is always the default variant. Never null and always has a minimum size of 1
-
-
Method Details
-
synchronize
public void synchronize() -
getVariant
Gets a item variant.- Parameters:
variant- the variant. The default variant is always 0. The value is clamped automatically.- Returns:
- the item variant.
-
getIcon
Gets the ingame icon of this item as TextureAsset.- Parameters:
texture- the item texture/variant. By default 0.- Returns:
- the icon of this item.
-