Section
Developers
10 TOP-LEVEL ITEMSRepo API
Repo API is Croparia IF’s abstraction and proxy layer for multi-platform storage interaction. Out of the box it supports two built-in resource types, items and fluids, and it is mainly used to expose and access storage on blocks and block entities.
The Repo access restriction model uses separate accept/consume locking:
acceptandconsumeeach maintain their own lock state;- locks are view-level filters and do not mutate the underlying repo itself;
capacityFor(...)andamountFor(...)still return raw values from the underlying repo and are not changed by locks;- the common locking entry points are
lockAccept(...),lockConsume(...), andlock(...); - these views are built on
DelegateRepo, so they can keep chaining and can be flattened into a single wrapper withtrim()when needed.
Relevant code lives under the package cool.muyucloud.croparia.api.repo.
Basic architecture
Repo API mainly consists of the storage view Repo, the registration bridge ProxyProvider, the wrapper RepoProxy, and the platform adapter interfaces PlatformItemProxy and PlatformFluidProxy.
Repo- the direct interaction layer inside the common module, based on slot-indexed storage views
DelegateRepo- a lightweight wrapper used to build view-level restrictions such as accept/consume locks
RepoProxy- wraps a
Reposo it can adapt to different modding platforms
- wraps a
ProxyProvider- registers a
RepoProxyinto a concrete platform so external storage systems can discover it
- registers a
PlatformItemProxy/PlatformFluidProxy- unified wrappers for platform item or fluid storage interfaces, so the common module can access them in a
Repo-style way
- unified wrappers for platform item or fluid storage interfaces, so the common module can access them in a
Repo API also uses the Resource API to manage resource types.
Navigation
In This Page