Class AEKeyTypes
key types
.
AE2 has built-in item
and fluid
key types. Addons can register
additional key types during initialization using register(AEKeyType)
.-
Method Details
-
register
Register a new storage channel.AE2 already provides native channels for
AEItemKey
andAEFluidKey
.Each
AEKey
subtype can only have a single factory instance. Overwriting is not intended. Each subtype should be a direct one, this might be enforced at any time.Channel class and factory instance can be used interchangeable as identifier. In most cases the factory instance is used as key as having direct access the methods is more beneficial compared to being forced to query the registry each time.
Caching the factory instance in a field or local variable is perfectly for performance reasons. But do not use any AE2 internal field as they can change randomly between releases.
-
get
Fetch the implementation for a specific storage channelid
.- Parameters:
id
- Thestorage channel id
.- Returns:
- The storage channel implementation.
- Throws:
IllegalArgumentException
- when fetching an unregistered channel.
-
getAll
An unmodifiable collection of all registered key types.This is mainly used as helper to let storage grids construct their internal storage for each type.
-