Package com.valhalla.sdk.api.entities
Class GroundItem
java.lang.Object
com.valhalla.sdk.api.entities.GroundItem
- All Implemented Interfaces:
Identifiable,Interactable,Locatable,Nameable
public final class GroundItem
extends Object
implements Locatable, Identifiable, Nameable, Interactable
Immutable ground-item stack snapshot.
-
Constructor Summary
ConstructorsConstructorDescriptionGroundItem(int id, int amount, String name, Tile tile) Creates an immutable scene snapshot of a ground-item stack. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the captured stack amount.intgetId()Returns the item definition identifier.getName()Returns the captured item name.getTile()Returns the captured world location.booleaninteract(int action) Dispatches a raw ground-item action opcode.booleaninteract(GroundItemAction action) Dispatches a typed ground-item menu action.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.valhalla.sdk.api.entities.Locatable
canReach, canReach, distance, distanceTo, getGridX, getGridY, getPlane, getRegionId, getX, getY, getZ, isInArea, isWithinDistance, walkingDistance
-
Constructor Details
-
GroundItem
Creates an immutable scene snapshot of a ground-item stack.- Parameters:
id- item definition identifieramount- stack amountname- captured display name, possibly blanktile- world location
-
-
Method Details
-
getId
public int getId()Returns the item definition identifier.- Specified by:
getIdin interfaceIdentifiable- Returns:
- item definition identifier
-
getAmount
public int getAmount()Returns the captured stack amount.- Returns:
- stack amount captured in this snapshot
-
getName
Returns the captured item name. -
getTile
Returns the captured world location. -
interact
public boolean interact(int action) Dispatches a raw ground-item action opcode.- Specified by:
interactin interfaceInteractable- Parameters:
action- native action opcode- Returns:
truewhen the runtime accepted the action
-
interact
Dispatches a typed ground-item menu action.- Parameters:
action- action to dispatch- Returns:
truewhen accepted; verify inventory or scene state for completion
-
toString
-