Package dev.dhyces.trimmed.api
Record Class KeyResolver.Static<T>
java.lang.Object
java.lang.Record
dev.dhyces.trimmed.api.KeyResolver.Static<T>
- All Implemented Interfaces:
KeyResolver<T>,KeyResolver.RegistryResolver<T>
- Enclosing interface:
KeyResolver<T>
public static record KeyResolver.Static<T>(net.minecraft.core.Registry<T> registry)
extends Record
implements KeyResolver.RegistryResolver<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.dhyces.trimmed.api.KeyResolver
KeyResolver.Dynamic<T>, KeyResolver.RegistryResolver<T>, KeyResolver.Static<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(net.minecraft.resources.ResourceLocation resourceLocation, com.mojang.serialization.DynamicOps<?> ops) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> getKey()net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> final inthashCode()Returns a hash code value for this object.net.minecraft.core.Registry<T> registry()Returns the value of theregistryrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Static
Creates an instance of aStaticrecord class.- Parameters:
registry- the value for theregistryrecord component
-
-
Method Details
-
getKey
- Specified by:
getKeyin interfaceKeyResolver.RegistryResolver<T>
-
decode
@Nullable public T decode(net.minecraft.resources.ResourceLocation resourceLocation, com.mojang.serialization.DynamicOps<?> ops) - Specified by:
decodein interfaceKeyResolver<T>
-
getStreamCodec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T> getStreamCodec()- Specified by:
getStreamCodecin interfaceKeyResolver<T>
-
requiresActiveWorld
public boolean requiresActiveWorld()- Specified by:
requiresActiveWorldin interfaceKeyResolver<T>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-