Class ComponentNode
Component record plus its position in a
materialized ComponentTree. Mirrors the entity wrappers (e.g.
Npc): cheap field access delegating to the record, in-memory tree
navigation, and a thin interaction hook.
Obtained via Components.in(int) / Components.under(int, int)
(attached — full navigation, no extra RPC) or Components.get(int, int)
(detached — parent() is null and children() triggers
a one-shot subtree fetch).
-
Method Summary
Modifier and TypeMethodDescriptionchildren()Direct children.intdata()The underlying raw record.All descendants, depth-first.voiddragOnto(ComponentNode target) Queue a drag of this component ontotarget, reproducing a manual drag-and-release so the client sends its component-drag packet.intheight()voidinteract(int optionIndex) Queue a click on this component with the given 1-based right-click option index.intbooleanisHidden()booleanisRoot()True when this node has no parent in its view.intintitemId()parent()Parent node, ornullat the root / for a detached node.intrawType()Build-specific raw type byte.voidQueue selection of this component as a multi-choice dialogue option.intspriteId()intsubId()text()toString()type()Stable semantic category (decoded from the wirecategorycode).intwidth()intx()inty()
-
Method Details
-
interfaceId
public int interfaceId() -
componentId
public int componentId() -
subId
public int subId() -
type
Stable semantic category (decoded from the wirecategorycode). -
rawType
public int rawType()Build-specific raw type byte. Prefertype()for queries. -
text
-
spriteId
public int spriteId() -
itemId
public int itemId() -
itemAmount
public int itemAmount() -
isHidden
public boolean isHidden() -
x
public int x() -
y
public int y() -
width
public int width() -
height
public int height() -
data
The underlying raw record. -
parent
Parent node, ornullat the root / for a detached node. -
children
Direct children. For an attached node this is in-memory; for a detached node (fromComponents.get(int, int)) it triggers oneget_interface_treefetch rooted here. -
descendants
All descendants, depth-first. One fetch total for a detached node. -
isRoot
public boolean isRoot()True when this node has no parent in its view. -
interact
public void interact(int optionIndex) Queue a click on this component with the given 1-based right-click option index. Builds aGameActionwithActionTypes.COMPONENT, the option inparam1,-1(no sub-slot) inparam2, and the packed(iface<<16)|compinparam3— the same shape inventory slot clicks use, minus the slot. For inventory grids use theBackpack/Bankfacades, which supply the slot. -
selectDialogOption
public void selectDialogOption()Queue selection of this component as a multi-choice dialogue option.Dialogue options are driven by the
ActionTypes.DIALOGUEaction (type 30) — the engine's resume / pausebutton path — not theActionTypes.COMPONENTactioninteract(int)sends. A COMPONENT click on an option row dispatches but the server ignores it (the dialogue doesn't advance); the DIALOGUE action is what a manual option pick emits. Shape:param1 = 0, no sub-slot, packed(iface<<16)|compinparam3. Verified live against interface 1188. -
dragOnto
Queue a drag of this component ontotarget, reproducing a manual drag-and-release so the client sends its component-drag packet. Builds aGameActionwithActionTypes.COMPONENT_DRAG: this node's(iface<<16)|comphash inparam1, the target's inparam2, and the two nodes'sub-slot idspacked intoparam3as(fromSub<<16)|(toSub&0xFFFF)— each-1when the node is a top-level component.Because each node carries its own wire
subId, dragging one inventory slot onto another — two sub-components of the same grid that differ only by sub-slot — works: obtain both slot nodes from the component tree, thenfrom.dragOnto(to). -
toString
-