Record Class CustomRegistryArgument<T>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.command.CustomRegistryArgument<T>
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Ref<T>>
public record CustomRegistryArgument<T>(com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> ops, net.minecraft.nbt.TagParser<net.minecraft.nbt.Tag> parser, CustomRegistry<?,T> registry)
extends Record
implements com.mojang.brigadier.arguments.ArgumentType<Ref<T>>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCustomRegistryArgument(com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> ops, net.minecraft.nbt.TagParser<net.minecraft.nbt.Tag> parser, CustomRegistry<?, T> registry) Creates an instance of aCustomRegistryArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.<S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> ops()Returns the value of theopsrecord component.parse(com.mojang.brigadier.StringReader reader) net.minecraft.nbt.TagParser<net.minecraft.nbt.Tag> parser()Returns the value of theparserrecord component.CustomRegistry<?, T> registry()Returns the value of theregistryrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface com.mojang.brigadier.arguments.ArgumentType
parse
-
Constructor Details
-
CustomRegistryArgument
public CustomRegistryArgument(com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> ops, net.minecraft.nbt.TagParser<net.minecraft.nbt.Tag> parser, CustomRegistry<?, T> registry) Creates an instance of aCustomRegistryArgumentrecord class.- Parameters:
ops- the value for theopsrecord componentparser- the value for theparserrecord componentregistry- the value for theregistryrecord component
-
-
Method Details
-
parse
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) - Specified by:
listSuggestionsin interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-
getExamples
- Specified by:
getExamplesin interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-
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). -
ops
public com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> ops()Returns the value of theopsrecord component.- Returns:
- the value of the
opsrecord component
-
parser
public net.minecraft.nbt.TagParser<net.minecraft.nbt.Tag> parser()Returns the value of theparserrecord component.- Returns:
- the value of the
parserrecord component
-
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-