Record Class RegistryLoadTask.PendingRegistration<T>
java.lang.Object
java.lang.Record
net.minecraft.resources.RegistryLoadTask.PendingRegistration<T>
- Enclosing class:
RegistryLoadTask<T>
protected static record RegistryLoadTask.PendingRegistration<T>(ResourceKey<T> key, com.mojang.datafixers.util.Either<T, Exception> value, RegistrationInfo registrationInfo)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceKey<T> The field for thekeyrecord component.private final RegistrationInfoThe field for theregistrationInforecord component.The field for thevaluerecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPendingRegistration(ResourceKey<T> key, com.mojang.datafixers.util.Either<T, Exception> value, RegistrationInfo registrationInfo) Creates an instance of aPendingRegistrationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static <T> com.mojang.datafixers.util.Either<T, Exception> findAndLoadFromResource(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<JsonElement> ops, ResourceKey<T> elementKey, FileToIdConverter converter, ResourceProvider resourceProvider) final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.static <T> com.mojang.datafixers.util.Either<T, Exception> loadFromNetwork(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<Tag> ops, ResourceKey<T> elementKey, Tag contents) static <T> com.mojang.datafixers.util.Either<T, Exception> loadFromResource(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<JsonElement> ops, ResourceKey<T> elementKey, Resource thunk) Returns the value of theregistrationInforecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Field Details
-
key
The field for thekeyrecord component. -
value
-
registrationInfo
The field for theregistrationInforecord component.
-
-
Constructor Details
-
PendingRegistration
protected PendingRegistration(ResourceKey<T> key, com.mojang.datafixers.util.Either<T, Exception> value, RegistrationInfo registrationInfo) Creates an instance of aPendingRegistrationrecord class.- Parameters:
key- the value for thekeyrecord componentvalue- the value for thevaluerecord componentregistrationInfo- the value for theregistrationInforecord component
-
-
Method Details
-
loadFromResource
public static <T> com.mojang.datafixers.util.Either<T, Exception> loadFromResource(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<JsonElement> ops, ResourceKey<T> elementKey, Resource thunk) -
findAndLoadFromResource
public static <T> com.mojang.datafixers.util.Either<T, Exception> findAndLoadFromResource(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<JsonElement> ops, ResourceKey<T> elementKey, FileToIdConverter converter, ResourceProvider resourceProvider) -
loadFromNetwork
public static <T> com.mojang.datafixers.util.Either<T, Exception> loadFromNetwork(com.mojang.serialization.Decoder<T> elementDecoder, RegistryOps<Tag> ops, ResourceKey<T> elementKey, Tag contents) -
toString
-
hashCode
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
value
-
registrationInfo
Returns the value of theregistrationInforecord component.- Returns:
- the value of the
registrationInforecord component
-