Class Bank
Queries read an immutable BankSnapshot. While the bank container is
loaded, the facade also refreshes a history cache. When the container is no
longer loaded and history use is enabled, item queries can therefore describe
the last loaded bank rather than the current interface. Call isLoaded()
when a decision requires live bank data, and use resetCache() when
stale history must not be considered.
Action methods fail closed. They return false when the active client
does not advertise Capabilities.BANK_ACTIONS, when an argument or
required item cannot be resolved, or when the runtime rejects the requested
operation. A true result means that the request was accepted for
dispatch, or that the requested state was already observed; it does not prove
that a later game tick completed the action. Scripts should confirm completion
from a subsequent bank or inventory snapshot.
The current native runtime supports close, default-quantity, withdraw,
deposit, empty-containers, deposit-all-inventory, and deposit-all-equipment
requests. Opening the bank, changing tabs or modes, toggling placeholders,
dragging, scrolling, and searching are represented by this forward-compatible
facade but currently return false unless the requested state is already
satisfied. Native amount dispatch currently accepts 1, 5, 10, and
ALL; other positive amounts and ALL_BUT_ONE fail closed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSentinel amount requesting the complete available stack.static final intSentinel amount requesting all but one item. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddToBankHistoryCache(Item item) Adds an item amount to an existing history cache.all()Returns every captured bank entry, including placeholders.Returns usable bank entries accepted by a filter.static intReturns the number of optional bank tabs reported by the snapshot.static intcapacity()Returns the captured bank-container capacity.static booleanclose()Submits a request to close the bank interface.static booleancontains(int id) Reports whether a usable entry has an identifier.static booleancontains(int... ids) Reports whether a usable entry matches any primitive identifier.static booleanReports whether a usable entry is accepted by a filter.static booleanReports whether a usable entry matches any boxed identifier.static booleanReports whether the bank contains a supported value representation.static booleanReports whether a usable entry has an exact captured name, ignoring case.static booleanReports whether a usable entry matches any exact captured name, ignoring case.static booleancontainsAll(int... ids) Reports whether every primitive identifier is present as a usable entry.static booleancontainsAll(Integer... ids) Reports whether every boxed identifier is present as a usable entry.static booleancontainsAll(String... names) Reports whether every exact name is present as a usable entry, ignoring case.static booleancontainsAll(Collection<?> values) Reports whether every supported value in a collection is present.static intcount(int id) Returns the total captured amount for a usable item identifier.static intcount(int... ids) Returns the total captured amount for any primitive identifier.static intCounts captured container entries assigned to a bank tab.static intReturns the total captured amount of usable entries accepted by a filter.static intReturns the total captured amount for any boxed identifier.static intReturns the total captured amount for an exact item name, ignoring case.static intReturns the total captured amount for any exact item name, ignoring case.static booleandeposit(int id) Submits a one-item deposit by identifier.static booleandeposit(int id, int amount) Submits a deposit by identifier and amount.static booleanSubmits a one-item deposit using an inventory item's captured identifier and slot.static booleanSubmits a deposit using an inventory item's captured identifier and slot.static booleanSubmits a one-item deposit for the first inventory entry accepted by a filter.static booleanSubmits a deposit for the first inventory entry accepted by a filter.static booleanSubmits a one-item deposit by exact captured inventory name, ignoring case.static booleanSubmits a deposit by exact captured inventory name, ignoring case.static booleandepositAll(int id) Submits a full-stack deposit by identifier.static booleandepositAll(Item item) Submits a full-stack deposit using an inventory item's captured slot.static booleandepositAll(Filter<Item> filter) Submits a full-stack deposit for the first inventory entry accepted by a filter.static booleandepositAll(String name) Submits a full-stack deposit by exact captured inventory name, ignoring case.static booleanSubmits the bank interface's deposit-all-equipment action.static booleandepositAllExcept(int... ids) Submits full-stack deposits for every inventory entry except allowed identifiers.static booleandepositAllExcept(Filter<Item> keep) Submits full-stack deposits for inventory entries rejected by a keep filter.static booleandepositAllExcept(String... names) Submits full-stack deposits for every inventory entry except allowed names.static booleanSubmits the bank interface's deposit-all-inventory action.static booleandepositSlot(int slot, int amount) Submits a deposit by inventory slot when inventory snapshots are unavailable.static booleandrag(int fromSlot, int toSlot) Requests an item drag between bank-container slots.static booleanSubmits the bank interface's empty-containers action.static intReturns the capacity not represented by captured entries.Returns usable bank entries rejected by a filter.static intReturns the number of captured occupied entries, including placeholders.get(int id) Finds the first usable entry with an item-definition identifier.get(int... ids) Finds the first usable entry matching any primitive identifier.Finds the first usable entry accepted by a filter.Finds the first usable entry matching any boxed identifier.Finds the first usable entry whose captured name equals a value, ignoring case.Finds the first usable entry matching any captured name, ignoring case.Returns the immutable last-loaded bank-entry cache.Returns the current bank tab as a typed value.static intReturns the current bank-tab identifier.static intReturns the captured custom withdraw-X amount.static BankQuantitySelectionReturns the captured default quantity-button selection.static intReturns the lowest slot not represented in the captured container.static intReturns the lowest occupied captured slot.static intgetIdForSlot(int slot) Returns the identifier captured in a slot.getItemInSlot(int slot) Finds the captured entry in a zero-based bank-container slot.static longReturns the client tick associated with the last history-cache update.static longReturns when the history cache was last replaced.static longReturns the client tick attached to the latest bank snapshot.static intReturns the item-count threshold for preferring bank search.static StringgetNameForSlot(int slot) Returns the name captured in a slot.static BankModeReturns the captured item-rearrangement mode.static intReturns the zero-based eight-column bank-grid row containing an item.static intReturns the captured bank scroll height.static intgetSlot(int id) Finds the slot of the first usable entry with an identifier.static intFinds the slot of the first usable entry accepted by a filter.static intFinds the slot of the first usable entry with an exact name, ignoring case.static intgetTab(int slot) Returns the tab identifier captured for a slot.static intReturns an item's captured tab identifier.static BankModeReturns the captured withdrawal mode.static booleanReturns the local always-open-tab preference.static booleanisCached()Reports whether the bank history cache contains any entries.static booleanisEmpty()Reports whether no captured bank entries exist.static booleanisFull()Reports whether the captured entry count meets or exceeds captured capacity.static booleanisLoaded()Reports whether live bank-container contents are loaded.static booleanisOpen()Reports whether the bank interface is open.static booleanReports whether the bank search interface is open.static booleanisSlotEmpty(int slot) Reports whether no captured entry occupies a slot.static booleanisSlotFull(int slot) Reports whether a captured entry occupies a slot.static booleanisSlotVisible(Item item) Reports whether an item's slot lies within the captured visible-slot range.static booleanneedToScroll(Item item) Reports whether an item is outside the captured visible-slot range.static booleanneedToScrollDown(Item item) Reports whether an item's slot follows the captured visible range.static booleanneedToScrollUp(Item item) Reports whether an item's slot precedes the captured visible range.static booleanonlyContains(int... ids) Reports whether every usable entry matches one of the supplied identifiers.static booleanonlyContains(Filter<Item> filter) Reports whether every usable entry is accepted by a filter.static booleanonlyContains(String... names) Reports whether every usable entry matches an allowed exact name, ignoring case.static booleanopen()Requests that a bank interface be opened.static booleanopenTab(int tab) Requests a bank tab by numeric identifier.static booleanRequests a typed bank tab.static booleanReports whether the snapshot has bank placeholders enabled.static voidreset()Resets bank history unless cache retention is enabled.static voidreset(boolean full) Resets bank facade state.static voidClears all bank-history entries and their update timestamps.static booleanscroll(int id) Requests that an identified bank entry become visible using click-style scrolling.static booleanscroll(int id, BankScroll type) Requests that an identified bank entry become visible.static booleanRequests that the first filtered bank entry become visible using click-style scrolling.static booleanscroll(Filter<Item> filter, BankScroll type) Requests that the first filtered bank entry become visible.static booleanRequests that a named bank entry become visible using click-style scrolling.static booleanscroll(String name, BankScroll type) Requests that a named bank entry become visible.static booleansearchItem(String itemName) Requests a bank search for an item name.static voidsetAlwaysOpenTab(boolean enabled) Sets the local always-open-tab preference.static booleansetDefaultQuantity(BankQuantitySelection selection) Requests the bank's default quantity-button selection.static voidsetMinimumItemToSearch(int amount) Sets the item-count threshold for higher-level bank-search logic.static booleansetRearrangeMode(BankMode mode) Requests swap or insert rearrangement mode.static voidsetRetainBankCache(boolean retain) Controls whether ordinary facade resets preserve the history cache.static voidsetSearchItem(boolean enabled) Sets whether higher-level script logic should prefer bank search.static voidsetUseBankHistoryCache(boolean enabled) Controls whether item queries fall back to bank history when live data is unloaded.static booleansetWithdrawMode(BankMode mode) Requests item or note withdrawal mode.static booleanReports whether non-full resets retain bank history.static booleanReports whether higher-level script logic should prefer bank search.static booleanslotContains(int slot, int... ids) Reports whether the entry in a slot matches any primitive identifier.static booleanslotContains(int slot, Item item) Reports whether the entry in a slot equals an item snapshot.static booleanslotContains(int slot, Filter<Item> filter) Reports whether the entry in a slot is accepted by a filter.static booleanslotContains(int slot, String... names) Reports whether the entry in a slot matches any exact name, ignoring case.static booleanslotNameContains(int slot, String substring) Reports whether a slot's captured name contains text, ignoring case.static booleantogglePlaceholders(boolean enabled) Requests a bank-placeholder setting.static voidReplaces history with the current snapshot when the bank is reported open.static voidupdateCache(Collection<Item> items) Replaces history with caller-supplied entries when the bank is reported open.static booleanwithdraw(int id) Submits a one-item withdrawal by identifier.static booleanwithdraw(int id, int amount) Submits a withdrawal by identifier and amount.static booleanSubmits a one-item withdrawal using an item's captured identifier and slot.static booleanSubmits a withdrawal using an item's captured identifier and slot.static booleanSubmits a one-item withdrawal for the first usable entry accepted by a filter.static booleanSubmits a withdrawal for the first usable entry accepted by a filter.static booleanSubmits a one-item withdrawal by exact captured name, ignoring case.static booleanSubmits a withdrawal by exact captured name, ignoring case.static booleanwithdrawAll(int id) Submits a full-stack withdrawal by identifier.static booleanwithdrawAll(Item item) Submits a full-stack withdrawal using an item's captured identifier and slot.static booleanwithdrawAll(Filter<Item> filter) Submits a full-stack withdrawal for the first entry accepted by a filter.static booleanwithdrawAll(String name) Submits a full-stack withdrawal by exact captured name, ignoring case.static booleanwithdrawSlot(int slot, int amount) Submits a withdrawal by container slot when item snapshots are unavailable.
-
Field Details
-
ALL
public static final int ALLSentinel amount requesting the complete available stack.- See Also:
-
ALL_BUT_ONE
public static final int ALL_BUT_ONESentinel amount requesting all but one item.The facade recognizes this value, but the current native bank adapter does not dispatch it and action methods consequently return
false.- See Also:
-
-
Method Details
-
all
Returns every captured bank entry, including placeholders.The returned list is immutable. It can be the last loaded history snapshot when live bank data is unavailable and history use is enabled.
- Returns:
- immutable captured bank entries
-
all
Returns usable bank entries accepted by a filter.Placeholder entries are excluded before the filter is evaluated.
- Parameters:
filter- predicate applied to each non-placeholder entry- Returns:
- immutable list of matching entries
- Throws:
NullPointerException- iffilterisnull
-
except
Returns usable bank entries rejected by a filter.- Parameters:
filter- predicate identifying entries to exclude- Returns:
- immutable list of non-placeholder entries not accepted by the filter
- Throws:
NullPointerException- iffilterisnull
-
get
Finds the first usable entry with an item-definition identifier.- Parameters:
id- item-definition identifier- Returns:
- the first matching non-placeholder entry, or an empty optional
-
get
Finds the first usable entry matching any primitive identifier.- Parameters:
ids- item-definition identifiers;nullproduces an empty result- Returns:
- the first matching non-placeholder entry, or an empty optional
-
get
Finds the first usable entry matching any boxed identifier.- Parameters:
ids- item-definition identifiers; null array elements are ignored and anullarray produces an empty result- Returns:
- the first matching non-placeholder entry, or an empty optional
-
get
Finds the first usable entry whose captured name equals a value, ignoring case.- Parameters:
name- exact item name;nullproduces an empty result- Returns:
- the first matching non-placeholder entry, or an empty optional
-
get
Finds the first usable entry matching any captured name, ignoring case.- Parameters:
names- exact item names; null elements are ignored and anullarray produces an empty result- Returns:
- the first matching non-placeholder entry, or an empty optional
-
get
Finds the first usable entry accepted by a filter.- Parameters:
filter- predicate applied to each non-placeholder entry- Returns:
- the first accepted entry, or an empty optional
- Throws:
NullPointerException- iffilterisnull
-
getItemInSlot
Finds the captured entry in a zero-based bank-container slot.Unlike filtered queries, this method can return a placeholder.
- Parameters:
slot- zero-based bank-container slot- Returns:
- the entry in the slot, or an empty optional for a negative or empty slot
-
contains
public static boolean contains(int id) Reports whether a usable entry has an identifier.- Parameters:
id- item-definition identifier- Returns:
truewhen a matching non-placeholder entry exists
-
contains
public static boolean contains(int... ids) Reports whether a usable entry matches any primitive identifier.- Parameters:
ids- item-definition identifiers- Returns:
truewhen any identifier matches;falsefor a null or empty array
-
contains
Reports whether a usable entry matches any boxed identifier.- Parameters:
ids- item-definition identifiers; null elements are ignored- Returns:
truewhen any identifier matches;falsefor a null or empty array
-
contains
Reports whether a usable entry has an exact captured name, ignoring case.- Parameters:
name- exact item name- Returns:
truewhen a matching non-placeholder entry exists
-
contains
Reports whether a usable entry matches any exact captured name, ignoring case.- Parameters:
names- exact item names; null elements are ignored- Returns:
truewhen any name matches;falsefor a null or empty array
-
contains
Reports whether a usable entry is accepted by a filter.- Parameters:
filter- predicate applied to each non-placeholder entry- Returns:
truewhen the filter accepts at least one entry- Throws:
NullPointerException- iffilterisnull
-
contains
Reports whether the bank contains a supported value representation.Supported values are
Item,Integer, andString. Other values, includingnull, producefalse.- Parameters:
value- item snapshot, boxed identifier, or exact item name- Returns:
truewhen the represented usable entry exists
-
containsAll
public static boolean containsAll(int... ids) Reports whether every primitive identifier is present as a usable entry.- Parameters:
ids- item-definition identifiers- Returns:
falsefor a null array; otherwisetrueonly when every identifier is present, including vacuous truth for an empty array
-
containsAll
Reports whether every boxed identifier is present as a usable entry.- Parameters:
ids- item-definition identifiers- Returns:
falsefor a null array or null element; otherwisetrueonly when every identifier is present
-
containsAll
Reports whether every exact name is present as a usable entry, ignoring case.- Parameters:
names- exact item names- Returns:
falsefor a null array or null element; otherwisetrueonly when every name is present
-
containsAll
Reports whether every supported value in a collection is present.- Parameters:
values- item snapshots, boxed identifiers, or names- Returns:
falsefor a null collection or unsupported element; otherwisetrueonly when every represented item is present
-
onlyContains
public static boolean onlyContains(int... ids) Reports whether every usable entry matches one of the supplied identifiers.Placeholders are ignored. An empty bank therefore returns
true.- Parameters:
ids- allowed item-definition identifiers- Returns:
falsefor a null array; otherwise whether all usable entries are allowed
-
onlyContains
Reports whether every usable entry matches an allowed exact name, ignoring case.- Parameters:
names- allowed exact item names; null elements never match- Returns:
falsefor a null array; otherwise whether all usable entries are allowed
-
onlyContains
Reports whether every usable entry is accepted by a filter.- Parameters:
filter- predicate defining allowed entries- Returns:
truewhen all non-placeholder entries are accepted- Throws:
NullPointerException- iffilterisnull
-
count
public static int count(int id) Returns the total captured amount for a usable item identifier.- Parameters:
id- item-definition identifier- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE
-
count
public static int count(int... ids) Returns the total captured amount for any primitive identifier.- Parameters:
ids- item-definition identifiers- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE; zero for a null array
-
count
Returns the total captured amount for any boxed identifier.- Parameters:
ids- item-definition identifiers; null elements are ignored- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE; zero for a null array
-
count
Returns the total captured amount for an exact item name, ignoring case.- Parameters:
name- exact item name- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE; zero fornull
-
count
Returns the total captured amount for any exact item name, ignoring case.- Parameters:
names- exact item names; null elements are ignored- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE; zero for a null array
-
count
Returns the total captured amount of usable entries accepted by a filter.- Parameters:
filter- predicate applied to each non-placeholder entry- Returns:
- summed stack amount, capped at
Integer.MAX_VALUE - Throws:
NullPointerException- iffilterisnull
-
count
Counts captured container entries assigned to a bank tab.This counts occupied entries, not stack amounts, and includes placeholders.
- Parameters:
tab- bank tab to inspect- Returns:
- number of captured entries assigned to the tab
- Throws:
NullPointerException- iftabisnull
-
capacity
public static int capacity()Returns the captured bank-container capacity.- Returns:
- captured bank-container capacity
-
fullSlotCount
public static int fullSlotCount()Returns the number of captured occupied entries, including placeholders.- Returns:
- captured entry count
-
emptySlotCount
public static int emptySlotCount()Returns the capacity not represented by captured entries.- Returns:
- non-negative estimated empty-slot count
-
isEmpty
public static boolean isEmpty()Reports whether no captured bank entries exist.- Returns:
- whether no captured bank entries exist
-
isFull
public static boolean isFull()Reports whether the captured entry count meets or exceeds captured capacity.- Returns:
- whether the captured bank is full
-
getFirstFullSlot
public static int getFirstFullSlot()Returns the lowest occupied captured slot.- Returns:
- lowest occupied slot, or
-1when no entry exists
-
getFirstEmptySlot
public static int getFirstEmptySlot()Returns the lowest slot not represented in the captured container.- Returns:
- lowest empty slot, or
-1when every slot is occupied
-
getIdForSlot
public static int getIdForSlot(int slot) Returns the identifier captured in a slot.- Parameters:
slot- zero-based bank-container slot- Returns:
- item-definition identifier, or
-1when the slot is absent
-
getNameForSlot
Returns the name captured in a slot.- Parameters:
slot- zero-based bank-container slot- Returns:
- captured item name, or an empty string when the slot is absent
-
getSlot
public static int getSlot(int id) Finds the slot of the first usable entry with an identifier.- Parameters:
id- item-definition identifier- Returns:
- zero-based bank slot, or
-1when not found
-
getSlot
Finds the slot of the first usable entry with an exact name, ignoring case.- Parameters:
name- exact item name- Returns:
- zero-based bank slot, or
-1when not found
-
getSlot
Finds the slot of the first usable entry accepted by a filter.- Parameters:
filter- predicate applied to non-placeholder entries- Returns:
- zero-based bank slot, or
-1when not found - Throws:
NullPointerException- iffilterisnull
-
isSlotEmpty
public static boolean isSlotEmpty(int slot) Reports whether no captured entry occupies a slot.- Parameters:
slot- zero-based bank-container slot- Returns:
truewhen the slot is absent, including for a negative slot
-
isSlotFull
public static boolean isSlotFull(int slot) Reports whether a captured entry occupies a slot.- Parameters:
slot- zero-based bank-container slot- Returns:
truewhen an entry, including a placeholder, occupies the slot
-
slotContains
public static boolean slotContains(int slot, int... ids) Reports whether the entry in a slot matches any primitive identifier.- Parameters:
slot- zero-based bank-container slotids- item-definition identifiers- Returns:
truewhen the occupied slot matches any identifier
-
slotContains
Reports whether the entry in a slot matches any exact name, ignoring case.- Parameters:
slot- zero-based bank-container slotnames- exact item names; null elements are ignored- Returns:
truewhen the occupied slot matches any name
-
slotContains
Reports whether the entry in a slot is accepted by a filter.Unlike the general filtered queries, a placeholder is passed to the filter.
- Parameters:
slot- zero-based bank-container slotfilter- predicate applied to the captured entry- Returns:
truewhen the slot is occupied and the filter accepts its entry- Throws:
NullPointerException- iffilterisnull
-
slotContains
Reports whether the entry in a slot equals an item snapshot.- Parameters:
slot- zero-based bank-container slotitem- complete item snapshot to compare- Returns:
truewhen the occupied slot equalsitem
-
slotNameContains
Reports whether a slot's captured name contains text, ignoring case.- Parameters:
slot- zero-based bank-container slotsubstring- text fragment to find- Returns:
truewhen an occupied slot's name contains the fragment
-
getRow
Returns the zero-based eight-column bank-grid row containing an item.- Parameters:
item- captured bank entry- Returns:
- zero-based bank-grid row
- Throws:
NullPointerException- ifitemisnull
-
getTab
Returns an item's captured tab identifier.- Parameters:
item- captured bank entry- Returns:
- tab identifier from 0 through 9
- Throws:
NullPointerException- ifitemisnull
-
getTab
public static int getTab(int slot) Returns the tab identifier captured for a slot.- Parameters:
slot- zero-based bank-container slot- Returns:
- tab identifier from 0 through 9; 0 when the slot is absent
-
availableTabs
public static int availableTabs()Returns the number of optional bank tabs reported by the snapshot.- Returns:
- optional bank-tab count from 0 through 9
-
getCurrentTab
public static int getCurrentTab()Returns the current bank-tab identifier.- Returns:
- current bank-tab identifier from 0 through 9
-
getCurrentBankTab
Returns the current bank tab as a typed value.- Returns:
- current typed bank tab, or an empty optional for an unrecognized identifier
-
getScrollHeight
public static int getScrollHeight()Returns the captured bank scroll height.- Returns:
- non-negative bank scroll height reported by the snapshot
-
getCustomWithdrawAmount
public static int getCustomWithdrawAmount()Returns the captured custom withdraw-X amount.- Returns:
- non-negative custom withdraw-X amount reported by the snapshot
-
getWithdrawMode
Returns the captured withdrawal mode.- Returns:
- captured withdrawal mode
-
getRearrangeMode
Returns the captured item-rearrangement mode.- Returns:
- captured item-rearrangement mode
-
getDefaultQuantity
Returns the captured default quantity-button selection.- Returns:
- captured default quantity-button selection
-
placeHoldersEnabled
public static boolean placeHoldersEnabled()Reports whether the snapshot has bank placeholders enabled.- Returns:
- whether bank placeholders are enabled
-
isSearchItem
public static boolean isSearchItem()Reports whether the bank search interface is open.- Returns:
- whether the snapshot reports the search interface open
-
isOpen
public static boolean isOpen()Reports whether the bank interface is open.- Returns:
- whether the bank interface is reported open
-
isLoaded
public static boolean isLoaded()Reports whether live bank-container contents are loaded.- Returns:
truewhen item queries represent the currently loaded container
-
getLastUpdatedTick
public static long getLastUpdatedTick()Returns the client tick attached to the latest bank snapshot.- Returns:
- non-negative client tick
-
isSlotVisible
Reports whether an item's slot lies within the captured visible-slot range.- Parameters:
item- captured bank entry- Returns:
truewhen visibility bounds are known and contain the item slot- Throws:
NullPointerException- ifitemisnull
-
needToScroll
Reports whether an item is outside the captured visible-slot range.This returns
truewhen the adapter has no visibility bounds.- Parameters:
item- captured bank entry- Returns:
- whether the item is not currently reported visible
- Throws:
NullPointerException- ifitemisnull
-
needToScrollUp
Reports whether an item's slot precedes the captured visible range.- Parameters:
item- captured bank entry- Returns:
truewhen known visibility bounds place the item above the viewport- Throws:
NullPointerException- ifitemisnull
-
needToScrollDown
Reports whether an item's slot follows the captured visible range.- Parameters:
item- captured bank entry- Returns:
truewhen known visibility bounds place the item below the viewport- Throws:
NullPointerException- ifitemisnull
-
isCached
public static boolean isCached()Reports whether the bank history cache contains any entries.- Returns:
- whether at least one captured entry is cached
-
getBankHistoryCache
Returns the immutable last-loaded bank-entry cache.- Returns:
- immutable cached entries; possibly empty
-
getLastBankHistoryCacheTime
public static long getLastBankHistoryCacheTime()Returns when the history cache was last replaced.- Returns:
- local epoch time in milliseconds, or zero before the first update
-
getLastBankHistoryCacheTick
public static long getLastBankHistoryCacheTick()Returns the client tick associated with the last history-cache update.- Returns:
- non-negative client tick, or zero before the first update
-
setUseBankHistoryCache
public static void setUseBankHistoryCache(boolean enabled) Controls whether item queries fall back to bank history when live data is unloaded.Disabling fallback does not clear an existing cache.
- Parameters:
enabled- whether unloaded item queries may use cached history
-
setRetainBankCache
public static void setRetainBankCache(boolean retain) Controls whether ordinary facade resets preserve the history cache.A full reset or an explicit
resetCache()still clears it.- Parameters:
retain- whether non-full resets should retain history
-
shouldRetainBankCache
public static boolean shouldRetainBankCache()Reports whether non-full resets retain bank history.- Returns:
- whether cache retention is enabled
-
resetCache
public static void resetCache()Clears all bank-history entries and their update timestamps. -
reset
public static void reset()Resets bank history unless cache retention is enabled.- See Also:
-
reset
public static void reset(boolean full) Resets bank facade state.A full reset always clears history and restores the local open-tab/search preferences to their defaults. A non-full reset honors cache retention.
- Parameters:
full- whether to clear history regardless of retention and restore preferences
-
updateCache
public static void updateCache()Replaces history with the current snapshot when the bank is reported open.This method has no effect while the bank is closed.
-
updateCache
Replaces history with caller-supplied entries when the bank is reported open.- Parameters:
items- entries to copy into the immutable history cache- Throws:
NullPointerException- ifitemsisnull
-
addToBankHistoryCache
Adds an item amount to an existing history cache.An entry with the same identifier has its amount increased, capped at
Integer.MAX_VALUE; otherwise the supplied entry is appended. The cache must already be non-empty, so this method cannot initialize history.- Parameters:
item- item snapshot to merge- Returns:
trueafter a merge;falsewhen no cache exists- Throws:
NullPointerException- ifitemisnull
-
open
public static boolean open()Requests that a bank interface be opened.The current native bank adapter cannot discover or open a nearby banker, booth, or chest. Consequently this method returns
trueonly when the bank snapshot already reports open, and otherwise fails closed.- Returns:
truewhen already open or when a supporting runtime accepts the request
-
close
public static boolean close()Submits a request to close the bank interface.- Returns:
truewhen the native runtime accepts the close request
-
openTab
public static boolean openTab(int tab) Requests a bank tab by numeric identifier.- Parameters:
tab- tab identifier from 0 through 9- Returns:
truewhen that tab is already current or a supporting runtime accepts the request;falsefor an invalid identifier
-
openTab
Requests a typed bank tab.The current native adapter does not dispatch tab changes, so a non-current tab fails closed.
- Parameters:
tab- bank tab to select- Returns:
truewhen the tab is already current or a supporting runtime accepts the request- Throws:
NullPointerException- iftabisnull
-
setWithdrawMode
Requests item or note withdrawal mode.The current native adapter does not dispatch mode changes, so a valid mode succeeds only when it is already observed.
- Parameters:
mode-BankMode.ITEMorBankMode.NOTE- Returns:
truewhen the valid mode is already selected or a supporting runtime accepts the request- Throws:
NullPointerException- ifmodeisnull
-
setRearrangeMode
Requests swap or insert rearrangement mode.The current native adapter does not dispatch mode changes, so a valid mode succeeds only when it is already observed.
- Parameters:
mode-BankMode.SWAPorBankMode.INSERT- Returns:
truewhen the valid mode is already selected or a supporting runtime accepts the request- Throws:
NullPointerException- ifmodeisnull
-
setDefaultQuantity
Requests the bank's default quantity-button selection.The current native adapter accepts one, five, ten, and all. The custom-X selection fails closed unless it is already selected.
- Parameters:
selection- default quantity to select- Returns:
truewhen already selected or when the native runtime accepts the request- Throws:
NullPointerException- ifselectionisnull
-
togglePlaceholders
public static boolean togglePlaceholders(boolean enabled) Requests a bank-placeholder setting.The current native adapter does not dispatch this toggle, so the method succeeds only when the requested value is already observed.
- Parameters:
enabled- desired placeholder setting- Returns:
truewhen already in the requested state or a supporting runtime accepts the request
-
drag
public static boolean drag(int fromSlot, int toSlot) Requests an item drag between bank-container slots.The current native adapter does not dispatch drag requests.
- Parameters:
fromSlot- zero-based source bank slottoSlot- zero-based destination bank slot- Returns:
trueonly when a supporting runtime accepts valid slots
-
emptyContainers
public static boolean emptyContainers()Submits the bank interface's empty-containers action.- Returns:
truewhen the native runtime accepts the request
-
withdraw
public static boolean withdraw(int id) Submits a one-item withdrawal by identifier.- Parameters:
id- item-definition identifier- Returns:
truewhen the native runtime accepts the resolved-slot request
-
withdraw
public static boolean withdraw(int id, int amount) Submits a withdrawal by identifier and amount.The item must resolve to a usable captured bank entry. Although positive amounts are valid at facade level, the current native adapter accepts only 1, 5, 10, and
ALL.- Parameters:
id- item-definition identifieramount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen the native runtime accepts the request
-
withdraw
Submits a one-item withdrawal by exact captured name, ignoring case.- Parameters:
name- exact item name- Returns:
truewhen a usable entry resolves and the runtime accepts the request
-
withdraw
Submits a withdrawal by exact captured name, ignoring case.- Parameters:
name- exact item nameamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen a usable entry resolves and the runtime accepts the request
-
withdraw
Submits a one-item withdrawal for the first usable entry accepted by a filter.- Parameters:
filter- predicate selecting a bank entry- Returns:
truewhen an entry resolves and the runtime accepts the request- Throws:
NullPointerException- iffilterisnull
-
withdraw
Submits a withdrawal for the first usable entry accepted by a filter.- Parameters:
filter- predicate selecting a bank entryamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen an entry resolves and the runtime accepts the request- Throws:
NullPointerException- iffilterisnull
-
withdrawAll
public static boolean withdrawAll(int id) Submits a full-stack withdrawal by identifier.- Parameters:
id- item-definition identifier- Returns:
truewhen the runtime accepts the resolved-slot request
-
withdrawAll
Submits a full-stack withdrawal by exact captured name, ignoring case.- Parameters:
name- exact item name- Returns:
truewhen the runtime accepts the resolved-slot request
-
withdrawAll
Submits a full-stack withdrawal for the first entry accepted by a filter.- Parameters:
filter- predicate selecting a bank entry- Returns:
truewhen the runtime accepts the resolved-slot request- Throws:
NullPointerException- iffilterisnull
-
withdraw
Submits a one-item withdrawal using an item's captured identifier and slot.- Parameters:
item- captured bank entry- Returns:
truewhen the runtime accepts the request
-
withdraw
Submits a withdrawal using an item's captured identifier and slot.The caller is responsible for ensuring the snapshot still describes the current bank layout.
- Parameters:
item- captured bank entryamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen the runtime accepts the request
-
withdrawAll
Submits a full-stack withdrawal using an item's captured identifier and slot.- Parameters:
item- captured bank entry- Returns:
truewhen the runtime accepts the request
-
withdrawSlot
public static boolean withdrawSlot(int slot, int amount) Submits a withdrawal by container slot when item snapshots are unavailable.If the slot has no captured item, the request carries identifier
-1; the current native adapter uses the slot and can still accept it.- Parameters:
slot- zero-based bank-container slotamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen the native runtime accepts the request
-
deposit
public static boolean deposit(int id) Submits a one-item deposit by identifier.- Parameters:
id- item-definition identifier- Returns:
truewhen a matching inventory slot resolves and the runtime accepts it
-
deposit
public static boolean deposit(int id, int amount) Submits a deposit by identifier and amount.The identifier must resolve to a captured inventory entry. Although positive amounts are valid at facade level, the current native adapter accepts only 1, 5, 10, and
ALL.- Parameters:
id- item-definition identifieramount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen a matching inventory slot resolves and the runtime accepts it
-
deposit
Submits a one-item deposit by exact captured inventory name, ignoring case.- Parameters:
name- exact item name- Returns:
truewhen an inventory entry resolves and the runtime accepts it
-
deposit
Submits a deposit by exact captured inventory name, ignoring case.- Parameters:
name- exact item nameamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen an inventory entry resolves and the runtime accepts it
-
deposit
Submits a one-item deposit for the first inventory entry accepted by a filter.- Parameters:
filter- predicate selecting an inventory entry- Returns:
truewhen an entry resolves and the runtime accepts it- Throws:
NullPointerException- iffilterisnull
-
deposit
Submits a deposit for the first inventory entry accepted by a filter.- Parameters:
filter- predicate selecting an inventory entryamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen an entry resolves and the runtime accepts it- Throws:
NullPointerException- iffilterisnull
-
deposit
Submits a one-item deposit using an inventory item's captured identifier and slot.- Parameters:
item- captured inventory entry- Returns:
truewhen the runtime accepts the request
-
deposit
Submits a deposit using an inventory item's captured identifier and slot.The caller is responsible for ensuring the snapshot still describes the current inventory layout.
- Parameters:
item- captured inventory entryamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen the runtime accepts the request
-
depositAll
public static boolean depositAll(int id) Submits a full-stack deposit by identifier.- Parameters:
id- item-definition identifier- Returns:
truewhen an inventory slot resolves and the runtime accepts it
-
depositAll
Submits a full-stack deposit by exact captured inventory name, ignoring case.- Parameters:
name- exact item name- Returns:
truewhen an inventory slot resolves and the runtime accepts it
-
depositAll
Submits a full-stack deposit for the first inventory entry accepted by a filter.- Parameters:
filter- predicate selecting an inventory entry- Returns:
truewhen an entry resolves and the runtime accepts it- Throws:
NullPointerException- iffilterisnull
-
depositAll
Submits a full-stack deposit using an inventory item's captured slot.- Parameters:
item- captured inventory entry- Returns:
truewhen the runtime accepts the request
-
depositSlot
public static boolean depositSlot(int slot, int amount) Submits a deposit by inventory slot when inventory snapshots are unavailable.- Parameters:
slot- zero-based inventory slotamount- positive requested amount,ALL, orALL_BUT_ONE- Returns:
truewhen the native runtime accepts the request
-
depositAllItems
public static boolean depositAllItems()Submits the bank interface's deposit-all-inventory action.- Returns:
truewhen the native runtime accepts the request
-
depositAllEquipment
public static boolean depositAllEquipment()Submits the bank interface's deposit-all-equipment action.- Returns:
truewhen the native runtime accepts the request
-
depositAllExcept
public static boolean depositAllExcept(int... ids) Submits full-stack deposits for every inventory entry except allowed identifiers.- Parameters:
ids- identifiers to retain in inventory- Returns:
falsefor a null array or any rejected deposit request; otherwisetrue, including when nothing needs depositing
-
depositAllExcept
Submits full-stack deposits for every inventory entry except allowed names.- Parameters:
names- exact names to retain, compared ignoring case; null elements never match- Returns:
falsefor a null array or any rejected deposit request; otherwisetrue, including when nothing needs depositing
-
depositAllExcept
Submits full-stack deposits for inventory entries rejected by a keep filter.When every occupied inventory slot is to be deposited, this uses the deposit-all-inventory action. Multiple accepted requests still require later snapshot confirmation; the return value does not prove completion.
- Parameters:
keep- predicate returningtruefor entries to retain- Returns:
truewhen nothing needs depositing or all requests are accepted- Throws:
NullPointerException- ifkeepisnull
-
scroll
public static boolean scroll(int id) Requests that an identified bank entry become visible using click-style scrolling.- Parameters:
id- item-definition identifier- Returns:
truewhen the entry is already visible or a supporting runtime accepts the request
-
scroll
Requests that an identified bank entry become visible.The current native adapter does not dispatch scrolling, so an off-screen entry fails closed.
- Parameters:
id- item-definition identifiertype- preferred scrolling input- Returns:
truewhen the resolved entry is already visible or a supporting runtime accepts the request- Throws:
NullPointerException- iftypeisnull
-
scroll
Requests that a named bank entry become visible using click-style scrolling.- Parameters:
name- exact captured item name, compared ignoring case- Returns:
truewhen the entry is already visible or a supporting runtime accepts the request
-
scroll
Requests that a named bank entry become visible.- Parameters:
name- exact captured item name, compared ignoring casetype- preferred scrolling input- Returns:
truewhen the resolved entry is already visible or a supporting runtime accepts the request- Throws:
NullPointerException- iftypeisnulland an item resolves
-
scroll
Requests that the first filtered bank entry become visible using click-style scrolling.- Parameters:
filter- predicate selecting a usable bank entry- Returns:
truewhen the entry is already visible or a supporting runtime accepts the request- Throws:
NullPointerException- iffilterisnull
-
scroll
Requests that the first filtered bank entry become visible.- Parameters:
filter- predicate selecting a usable bank entrytype- preferred scrolling input- Returns:
truewhen the resolved entry is already visible or a supporting runtime accepts the request- Throws:
NullPointerException- iffilteror, after an item resolves,typeisnull
-
searchItem
Requests a bank search for an item name.The current native adapter does not dispatch search requests.
- Parameters:
itemName- non-blank search text- Returns:
trueonly when a supporting runtime accepts the request
-
isAlwaysOpenTab
public static boolean isAlwaysOpenTab()Returns the local always-open-tab preference.The facade stores this author preference but does not itself open tabs.
- Returns:
- local always-open-tab preference
-
setAlwaysOpenTab
public static void setAlwaysOpenTab(boolean enabled) Sets the local always-open-tab preference.- Parameters:
enabled- preference value for higher-level script logic
-
setSearchItem
public static void setSearchItem(boolean enabled) Sets whether higher-level script logic should prefer bank search.This preference does not itself submit a search action.
- Parameters:
enabled- whether search should be preferred
-
shouldSearchItems
public static boolean shouldSearchItems()Reports whether higher-level script logic should prefer bank search.- Returns:
- whether bank search is preferred
-
getMinimumItemToSearch
public static int getMinimumItemToSearch()Returns the item-count threshold for preferring bank search.- Returns:
- non-negative item-count threshold
-
setMinimumItemToSearch
public static void setMinimumItemToSearch(int amount) Sets the item-count threshold for higher-level bank-search logic.- Parameters:
amount- threshold; negative values are stored as zero
-