Interface WritableRegistry<T extends net.kyori.adventure.key.Keyed>
@NonExtendable
public interface WritableRegistry<T extends net.kyori.adventure.key.Keyed>
Registration-time handle on a static registry. Entries are attributed to the addon whose
RegistrationContext provided this handle.-
Method Summary
Modifier and TypeMethodDescriptionvoidalias(@NotNull net.kyori.adventure.key.Key from, @NotNull net.kyori.adventure.key.Key to) Makes the old keyfrommean the entryto, for an entry that was renamed or moved to another addon.booleancontains(@NotNull net.kyori.adventure.key.Key id) <V extends T>
Vregister(V value) Registersvalueunder itsKeyed.key().@NotNull RegistryType<T> type()
-
Method Details
-
type
-
register
Registersvalueunder itsKeyed.key().- Returns:
value- Throws:
RegistrationException- if the key is taken or the registry is frozen
-
contains
boolean contains(@NotNull @NotNull net.kyori.adventure.key.Key id) -
alias
void alias(@NotNull @NotNull net.kyori.adventure.key.Key from, @NotNull @NotNull net.kyori.adventure.key.Key to) Makes the old keyfrommean the entryto, for an entry that was renamed or moved to another addon. Everything that looks entries up by key follows it: saved machine data, YAML definitions, recipes and tags. Data is saved again underto.Startup validation fails the alias's addon if
tois not an entry of this registry (aliases do not chain) or iffromis in a namespace reserved for MachineEngine.- Throws:
RegistrationException- iffromalready is an entry or an alias, or the registry is frozenIllegalArgumentException- iffromequalsto
-