Package org.dreambot.api.wrappers.items
Class Item
- java.lang.Object
-
- org.dreambot.api.wrappers.items.Item
-
- All Implemented Interfaces:
Identifiable
public class Item extends java.lang.Object implements Identifiable
-
-
Constructor Summary
Constructors Constructor Description Item(int itemId, int stack)
Item(int itemId, int stack, int slot)
Item(int itemId, int stack, int slot, ContainerType containerType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String[]
getActions()
int
getAmount()
org.dreambot.internal.cache.wrappers.def.ItemDefinition
getComposite()
ContainerType
getContainerType()
AbstractMouseDestination
getDestination()
Gets theRectangleDestination
for the Item.int
getDiscardableID()
int
getDiscardableValue()
int
getEquippedModelFemale1()
int
getEquippedModelFemale2()
int
getEquippedModelFemale3()
int
getEquippedModelFemaleDialogue1()
int
getEquippedModelFemaleDialogue2()
int
getEquippedModelFemaleTranslationY()
int
getEquippedModelMale1()
int
getEquippedModelMale2()
int
getEquippedModelMale3()
int
getEquippedModelMaleDialog1()
int
getEquippedModelMaleDialog2()
int
getEquippedModelMaleDialogue1()
int
getEquippedModelMaleDialogue2()
int
getEquippedModelMaleTranslationY()
java.lang.String[]
getGroundActions()
int
getHighAlchValue()
int
getID()
Gets ID number of the given object.java.awt.image.BufferedImage
getImage()
int
getInventoryModelID()
int
getLightIntensity()
int
getLightMagnitude()
int
getLivePrice()
This will get the average selling price on the GE, if availableint
getLowAlchValue()
short[]
getModelRecolorOriginal()
short[]
getModelRecolorTarget()
int
getModelScaleX()
int
getModelScaleY()
int
getModelScaleZ()
java.lang.String
getName()
Gets the name of the given object.int
getNotedItemID()
java.util.Map<java.lang.Integer,java.lang.Object>
getParams()
int
getPlaceholderID()
int
getPlaceholderValue()
short[]
getReTextureToFind()
short[]
getReTextureToReplace()
int
getRotationLength()
int
getRotationX()
int
getRotationY()
int
getRotationZ()
int
getShiftClickIndex()
int
getSlot()
For Inventory items only!int[]
getStackVariantID()
int[]
getStackVariantSize()
int
getTeam()
int
getTranslateX()
int
getTranslateY()
int
getUnnotedItemID()
int
getValue()
Base item value determined by Jagex, high/low alch is based on this value.boolean
hasAction(java.lang.String... actions)
boolean
hasDefinition()
int
hashCode()
boolean
interact()
seeinteract(String)
with action of nullboolean
interact(java.lang.String action)
Interacts with this item in its respective container using the action given.boolean
isMembersOnly()
boolean
isNotable()
boolean
isNoted()
boolean
isPlaceholder()
boolean
isStackable()
boolean
isTradable()
boolean
isValid()
Checks to make sure the item has valid id, stack size, and namevoid
setAmount(int amount)
void
setComposite(org.dreambot.internal.cache.wrappers.def.ItemDefinition composite)
void
setDestination(RectangleDestination destination)
Manually sets the destination for this item.java.lang.String
toString()
boolean
useOn(int id)
Uses this item on another item
Note: this item MUST be an inventory item for this method to workboolean
useOn(java.lang.String name)
Uses this item on another item
Note: this item MUST be an inventory item for this method to workboolean
useOn(Filter<Item> filter)
Uses this item on another item
Note: this item MUST be an inventory item for this method to workboolean
useOn(Entity entity)
Uses this item on an entity
Note: this item MUST be an inventory item for this method to workboolean
useOn(Item item)
Uses this item on another item
Note: both items MUST be inventory items for this method to work
-
-
-
Constructor Detail
-
Item
public Item(int itemId, int stack, int slot, ContainerType containerType)
-
Item
public Item(int itemId, int stack, int slot)
-
Item
public Item(int itemId, int stack)
-
-
Method Detail
-
getDestination
public AbstractMouseDestination getDestination()
Gets theRectangleDestination
for the Item. If there is noContainerType
on the item, it will return the currently set destination. Otherwise, if the respective container is open, it will recalculate and return the current destination for the item's slot. If the respective container is closed, it will return the last set destination. If no set destination and it cannot calculate a destination, this will return null;
-
setDestination
public void setDestination(RectangleDestination destination)
Manually sets the destination for this item. This will be overridden on the next getDestination call if the respective container is available.
-
getID
public int getID()
Description copied from interface:Identifiable
Gets ID number of the given object.- Specified by:
getID
in interfaceIdentifiable
- Returns:
- the ID number as integer.
-
getAmount
public int getAmount()
-
setAmount
public void setAmount(int amount)
-
getLivePrice
public int getLivePrice()
This will get the average selling price on the GE, if available- Returns:
- The current average price sold on the GE if found, otherwise 0
-
getSlot
public int getSlot()
For Inventory items only!- Returns:
- Slot for inventory item.
-
isMembersOnly
public boolean isMembersOnly()
-
isStackable
public boolean isStackable()
-
getUnnotedItemID
public int getUnnotedItemID()
-
getNotedItemID
public int getNotedItemID()
-
isNoted
public boolean isNoted()
-
isNotable
public boolean isNotable()
-
isPlaceholder
public boolean isPlaceholder()
-
getPlaceholderValue
public int getPlaceholderValue()
-
getPlaceholderID
public int getPlaceholderID()
-
getDiscardableValue
public int getDiscardableValue()
-
getDiscardableID
public int getDiscardableID()
-
getComposite
public org.dreambot.internal.cache.wrappers.def.ItemDefinition getComposite()
-
setComposite
public void setComposite(org.dreambot.internal.cache.wrappers.def.ItemDefinition composite)
-
getName
public java.lang.String getName()
Description copied from interface:Identifiable
Gets the name of the given object.- Specified by:
getName
in interfaceIdentifiable
- Returns:
- the name as a string.
-
isValid
public boolean isValid()
Checks to make sure the item has valid id, stack size, and name- Returns:
- True if information is valid, else false
-
useOn
public boolean useOn(Entity entity)
Uses this item on an entity
Note: this item MUST be an inventory item for this method to work- Parameters:
entity
- The entity you want to use this item on- Returns:
- True if successful
-
useOn
public boolean useOn(Item item)
Uses this item on another item
Note: both items MUST be inventory items for this method to work- Parameters:
item
- The Item you want to use this item on- Returns:
- True if successful
-
useOn
public boolean useOn(java.lang.String name)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
name
- The Item name you want to use this item on- Returns:
- True if successful
-
useOn
public boolean useOn(int id)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
id
- The Item id you want to use this item on- Returns:
- True if successful
-
useOn
public boolean useOn(Filter<Item> filter)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
filter
- The Item filter you want to use this item on- Returns:
- True if successful
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
interact
public boolean interact()
seeinteract(String)
with action of null
-
interact
public boolean interact(java.lang.String action)
Interacts with this item in its respective container using the action given. If no container exists, it will check for the item to be in the inventory and then equipment, otherwise it will log an Error. Null actions on Bank/Trade/Deposit Box will use basic actions for 1 amount, eg: Bank would beBank.withdraw(int)
Otherwise it will use the respectively needed methods. Note: Action-X does currently not work with Item#interact. Please use respective container classes for that due to the requirement of extra input. If no container exists, it will first check Inventory, then check Equipment for the item.- Parameters:
action
- The action to interact with- Returns:
- True if successful
-
hasAction
public boolean hasAction(java.lang.String... actions)
-
getTeam
public int getTeam()
-
getValue
public int getValue()
Base item value determined by Jagex, high/low alch is based on this value.- Returns:
- Base item value, 0 if definition is not found
-
getShiftClickIndex
public int getShiftClickIndex()
-
isTradable
public boolean isTradable()
-
getActions
public java.lang.String[] getActions()
-
getLowAlchValue
public int getLowAlchValue()
-
getHighAlchValue
public int getHighAlchValue()
-
getEquippedModelMaleDialog2
public int getEquippedModelMaleDialog2()
-
getReTextureToReplace
public short[] getReTextureToReplace()
-
getEquippedModelMaleDialog1
public int getEquippedModelMaleDialog1()
-
getReTextureToFind
public short[] getReTextureToFind()
-
getParams
public java.util.Map<java.lang.Integer,java.lang.Object> getParams()
-
getEquippedModelFemale1
public int getEquippedModelFemale1()
-
getEquippedModelFemale2
public int getEquippedModelFemale2()
-
getEquippedModelFemale3
public int getEquippedModelFemale3()
-
getEquippedModelFemaleDialogue1
public int getEquippedModelFemaleDialogue1()
-
getEquippedModelFemaleDialogue2
public int getEquippedModelFemaleDialogue2()
-
getEquippedModelFemaleTranslationY
public int getEquippedModelFemaleTranslationY()
-
getEquippedModelMale1
public int getEquippedModelMale1()
-
getEquippedModelMale2
public int getEquippedModelMale2()
-
getEquippedModelMale3
public int getEquippedModelMale3()
-
getEquippedModelMaleDialogue1
public int getEquippedModelMaleDialogue1()
-
getEquippedModelMaleDialogue2
public int getEquippedModelMaleDialogue2()
-
getEquippedModelMaleTranslationY
public int getEquippedModelMaleTranslationY()
-
getGroundActions
public java.lang.String[] getGroundActions()
-
getInventoryModelID
public int getInventoryModelID()
-
getLightIntensity
public int getLightIntensity()
-
getLightMagnitude
public int getLightMagnitude()
-
getModelRecolorOriginal
public short[] getModelRecolorOriginal()
-
getModelRecolorTarget
public short[] getModelRecolorTarget()
-
getModelScaleX
public int getModelScaleX()
-
getModelScaleY
public int getModelScaleY()
-
getModelScaleZ
public int getModelScaleZ()
-
getRotationLength
public int getRotationLength()
-
getRotationX
public int getRotationX()
-
getRotationY
public int getRotationY()
-
getRotationZ
public int getRotationZ()
-
getStackVariantID
public int[] getStackVariantID()
-
getStackVariantSize
public int[] getStackVariantSize()
-
getTranslateX
public int getTranslateX()
-
getTranslateY
public int getTranslateY()
-
getImage
public java.awt.image.BufferedImage getImage()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hasDefinition
public boolean hasDefinition()
-
getContainerType
public ContainerType getContainerType()
-
-