Interface RegistryEntryContext<V>
- Type Parameters:
V- the entry type used by the relevantRegistry
- All Known Implementing Classes:
MutableRegistryEntryContextImpl
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.
Modified to work on Fabric
-
Method Summary
Modifier and TypeMethodDescriptionintrawId()Returns the entry's raw int identifier.default <T extends V>
Tregister(net.minecraft.resources.ResourceLocation id, T value) Safely registers a new entry in the registry of this context.net.minecraft.core.Registry<V> registry()Returns the relevant registry for this entry.net.minecraft.resources.ResourceLocationReturns the entry's namespaced identifier.value()Returns the entry's object.
-
Method Details
-
registry
net.minecraft.core.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
-
resourceLocation
net.minecraft.resources.ResourceLocation resourceLocation()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
-