Package forgottentowns.mod.api
Interface ColonyInventory
public interface ColonyInventory
Access to physical settlement stockpiles and placed storage containers.
Every method requires the owning callback thread and expires with its context.
Actor inventories, loot, carts and abstract overflow stores are outside this interface.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordDetached physical inventory, safe to retain after the callback. -
Method Summary
Modifier and TypeMethodDescriptionLooks up a concrete store without creating an inventory or exposing a mutable manager.stores()Lists concrete storage keys, including empty storage.booleanImmediately transfers an exact quantity between two concrete stores.
-
Method Details
-
stores
Lists concrete storage keys, including empty storage. This is a category scan; retain the detached result and prefer direct lookups during a callback.- Returns:
- immutable storage keys with positive physical capacity, in lexical order
- Throws:
IllegalStateException- outside the owning callback or thread
-
stock
Looks up a concrete store without creating an inventory or exposing a mutable manager.- Parameters:
key- opaque key returned bystores(); null or blank has no match- Returns:
- detached contents and physical capacity, or null for a missing/ineligible store
- Throws:
IllegalStateException- outside the owning callback or thread
-
transfer
Immediately transfers an exact quantity between two concrete stores. This is a scripted inventory operation, not a hauling order. Filters, aggregate stack-size capacity, and integer overflow are checked before mutation; stack metadata and age buckets are preserved. Capacity estimation does not distinguish individual copies' metadata. A rejected transfer changes neither store.- Parameters:
source- existing source keydestination- existing destination key, distinct from sourceresourceId- registered resource identityamount- quantity from 1 through 4096- Returns:
- whether the full quantity moved
- Throws:
IllegalArgumentException- if amount is outside its boundsIllegalStateException- outside the callback/thread or after its shared 128-command budget
-