Package de.ellpeck.rockbottom.api.item
Class Item
java.lang.Object
de.ellpeck.rockbottom.api.item.Item
- Direct Known Subclasses:
BasicItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final ResourceNameprotected final ResourceName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanattacksMultipleEntities(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) booleancanHoldButtonToAttack(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) voiddescribeItem(IAssetManager manager, ItemInstance instance, List<String> desc, boolean isAdvanced, boolean isRealItem) Allows items to add to the tooltipintgetAttackCooldown(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) intgetAttackDamage(IWorld world, Entity entity, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) getCustomAttackableEntities(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) intgetDespawnTime(ItemInstance instance) intintgetInteractionPriority(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) getLocalizedName(ItemInstance instance) intdoublegetMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) floatgetMiningSpeed(IWorld world, int x, int y, TileLayer layer, Tile tile, boolean isRightTool, ItemInstance instance) getName()getToolProperties(ItemInstance instance) getUnlocalizedName(ItemInstance instance) booleanhasToolProperty(ItemInstance instance, ToolProperty property) booleanisDataSensitive(ItemInstance instance) Deprecated.This method is now unused - items will always be data sensitivebooleanonEntityAttack(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, Entity entity, ItemInstance instance) booleanonInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) booleanonInteractWithDestKey(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) voidonTileBroken(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity player, Tile tile, ItemInstance instance) register()setMaxAmount(int amount) takeDamage(ItemInstance instance, int amount) voidtakeDamage(ItemInstance instance, AbstractPlayerEntity player, int amount) toString()boolean
-
Field Details
-
name
-
unlocName
-
maxAmount
protected int maxAmount
-
-
Constructor Details
-
Item
-
-
Method Details
-
getRenderer
-
register
-
getMaxAmount
public int getMaxAmount() -
setMaxAmount
-
getName
-
getUnlocalizedName
-
getLocalizedName
-
describeItem
public void describeItem(IAssetManager manager, ItemInstance instance, List<String> desc, boolean isAdvanced, boolean isRealItem) Allows items to add to the tooltip- Parameters:
manager- The asset managerinstance- The item that is being describeddesc- The item description. You can add to this list or replace it.isAdvanced- If the player is holding SHIFT to view advanced infoisRealItem- Does the player actually own this item or is it a preview in a GUI? Used by tools to display durability descriptors only on real items.
-
onInteractWith
public boolean onInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
onInteractWithDestKey
public boolean onInteractWithDestKey(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
getInteractionPriority
public int getInteractionPriority(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
toString
-
getDespawnTime
-
isDataSensitive
Deprecated.This method is now unused - items will always be data sensitive- Parameters:
instance- the item instance- Returns:
- if the instance data is sensitive
-
getToolProperties
-
hasToolProperty
-
getMiningSpeed
public float getMiningSpeed(IWorld world, int x, int y, TileLayer layer, Tile tile, boolean isRightTool, ItemInstance instance) -
onTileBroken
public void onTileBroken(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity player, Tile tile, ItemInstance instance) -
getHighestPossibleMeta
public int getHighestPossibleMeta() -
getMaxInteractionDistance
public double getMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
canHoldButtonToAttack
public boolean canHoldButtonToAttack(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
getCustomAttackableEntities
public List<Entity> getCustomAttackableEntities(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
onEntityAttack
public boolean onEntityAttack(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, Entity entity, ItemInstance instance) -
getAttackDamage
public int getAttackDamage(IWorld world, Entity entity, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
getAttackCooldown
public int getAttackCooldown(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
attacksMultipleEntities
public boolean attacksMultipleEntities(IWorld world, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) -
useMetaAsDurability
public boolean useMetaAsDurability() -
takeDamage
-
takeDamage
-