Class MutableRegistryEntryContextImpl<V>
java.lang.Object
org.quiltmc.qsl.frozenblock.core.registry.impl.event.MutableRegistryEntryContextImpl<V>
- Type Parameters:
V- the type of the relevantRegistry's entries
- All Implemented Interfaces:
RegistryEntryContext<V>
@Internal
public class MutableRegistryEntryContextImpl<V>
extends Object
implements RegistryEntryContext<V>
The default implementation for
RegistryEntryContext.
In order to minimize allocations during event invocation, especially during registry iteration, this class is mutable. The api interface only allows accessing fields of the class, whereas modification methods are reserved for the impl.
Modified to work on Fabric
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintrawId()Returns the entry's raw int identifier.net.minecraft.core.Registry<V> registry()Returns the relevant registry for this entry.net.minecraft.resources.ResourceLocationReturns the entry's namespaced identifier.voidChanges the current entry information.voidChanges the current entry information.value()Returns the entry's object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.quiltmc.qsl.frozenblock.core.registry.api.event.RegistryEntryContext
register
-
Constructor Details
-
MutableRegistryEntryContextImpl
-
-
Method Details
-
set
Changes the current entry information.Raw identifier is set to -1 to signify that it should be lazily looked up.
- Parameters:
id- the namespaced identifier of the new entryentry- the new entry's object
-
set
Changes the current entry information.- Parameters:
id- the namespaced identifier of the new entryentry- the new entry's objectrawId- the raw int identifier of the new entry
-
registry
Description copied from interface:RegistryEntryContextReturns the relevant registry for this entry.- Specified by:
registryin interfaceRegistryEntryContext<V>- Returns:
- the relevant registry for this entry
-
value
Description copied from interface:RegistryEntryContextReturns the entry's object.- Specified by:
valuein interfaceRegistryEntryContext<V>- Returns:
- the entry's object
-
resourceLocation
public net.minecraft.resources.ResourceLocation resourceLocation()Description copied from interface:RegistryEntryContextReturns the entry's namespaced identifier.- Specified by:
resourceLocationin interfaceRegistryEntryContext<V>- Returns:
- the entry's namespaced identifier
-
rawId
public int rawId()Description copied from interface:RegistryEntryContextReturns the entry's raw int identifier.- Specified by:
rawIdin interfaceRegistryEntryContext<V>- Returns:
- the entry's raw int identifier
-