Package dev.dhyces.trimmed.api.client
Record Class ClientKeyResolver<T>
java.lang.Object
java.lang.Record
dev.dhyces.trimmed.api.client.ClientKeyResolver<T>
- All Implemented Interfaces:
KeyResolver<T>
public record ClientKeyResolver<T>(BiFunction<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DynamicOps<?>,T> decoder)
extends Record
implements KeyResolver<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
ConstructorsConstructorDescriptionClientKeyResolver(BiFunction<net.minecraft.resources.ResourceLocation, com.mojang.serialization.DynamicOps<?>, T> decoder) Creates an instance of aClientKeyResolverrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondecode(net.minecraft.resources.ResourceLocation resourceLocation, com.mojang.serialization.DynamicOps<?> ops) BiFunction<net.minecraft.resources.ResourceLocation, com.mojang.serialization.DynamicOps<?>, T> decoder()Returns the value of thedecoderrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClientKeyResolver
public ClientKeyResolver(BiFunction<net.minecraft.resources.ResourceLocation, com.mojang.serialization.DynamicOps<?>, T> decoder) Creates an instance of aClientKeyResolverrecord class.- Parameters:
decoder- the value for thedecoderrecord component
-
-
Method Details
-
decode
@Nullable public T decode(net.minecraft.resources.ResourceLocation resourceLocation, com.mojang.serialization.DynamicOps<?> ops) - Specified by:
decodein interfaceKeyResolver<T>
-
getStreamCodec
@Nullable public @Nullable 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). -
decoder
public BiFunction<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DynamicOps<?>, decoder()T> Returns the value of thedecoderrecord component.- Returns:
- the value of the
decoderrecord component
-