Interface RegistryEntryContext<V>
- Type Parameters:
V- the entry type used by the relevantRegistry
public interface RegistryEntryContext<V>
Represents information about a registry entry.
Underlying implementations may be mutable; do not store this object in your own fields directly.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.util.Identifierid()Returns the entry's namespaced identifier.intrawId()Returns the entry's raw int identifier.default <T extends V>
Tregister(net.minecraft.util.Identifier id, T value) Safely registers a new entry in the registry of this context.net.minecraft.registry.Registry<V> registry()Returns the relevant registry for this entry.value()Returns the entry's object.
-
Method Details
-
registry
net.minecraft.registry.Registry<V> registry()Returns the relevant registry for this entry.- Returns:
- the relevant registry for this entry
-
value
V value()Returns the entry's object.- Returns:
- the entry's object
-
id
net.minecraft.util.Identifier id()Returns the entry's namespaced identifier.- Returns:
- the entry's namespaced identifier
-
rawId
int rawId()Returns the entry's raw int identifier.- Returns:
- the entry's raw int identifier
-
register
Safely registers a new entry in the registry of this context.Registration may be delayed when called from
RegistryMonitor.forAll(RegistryEvents.EntryAdded).- Type Parameters:
T- the type of the value- Parameters:
id- the identifier of the entryvalue- the value to register- Returns:
- the registered value
-