Package net.minecraft.command
Interface CommandRegistryWrapper<T>
- All Known Implementing Classes:
CommandRegistryWrapper.Impl
public interface CommandRegistryWrapper<T>
A wrapper of a registry, used in command arguments.
The methods in this class in most cases perform the same as ones defined
in Registry. However, subclasses may have slightly different behaviors
to make it easier to handle user-passed arguments. For example, getEntryList(TagKey)
may return an empty RegistryEntryList instead of Optional.empty().
A wrapper without any special behaviors can be created by calling {#link of(Registry)}.
- Mappings:
Namespace Name official hdintermediary net/minecraft/class_7225named net/minecraft/command/CommandRegistryWrapper
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetEntry(RegistryKey<T> key) Optional<? extends RegistryEntryList<T>>getEntryList(TagKey<T> tag) Returns the entry list for the provided tag.static <T> CommandRegistryWrapper<T>Returns a new wrapper for theregistrywithout any special behaviors.Returns a stream of registry keys defined in the wrapped registry.
-
Method Details
-
getEntry
- See Also:
- Mappings:
Namespace Name Mixin selector official aLhd;a(Laai;)Ljava/util/Optional;intermediary method_42019Lnet/minecraft/class_7225;method_42019(Lnet/minecraft/class_5321;)Ljava/util/Optional;named getEntryLnet/minecraft/command/CommandRegistryWrapper;getEntry(Lnet/minecraft/util/registry/RegistryKey;)Ljava/util/Optional;
-
streamKeys
Stream<RegistryKey<T>> streamKeys()Returns a stream of registry keys defined in the wrapped registry.- Returns:
- a stream of registry keys defined in the wrapped registry
- See Also:
- Mappings:
Namespace Name Mixin selector official aLhd;a()Ljava/util/stream/Stream;intermediary method_42017Lnet/minecraft/class_7225;method_42017()Ljava/util/stream/Stream;named streamKeysLnet/minecraft/command/CommandRegistryWrapper;streamKeys()Ljava/util/stream/Stream;
-
getEntryList
Returns the entry list for the provided tag.Implementations have different behaviors for unrecognized tags. The default implementation returns
Optional.empty(); however, the ones created byCommandRegistryAccess.createWrapper(net.minecraft.util.registry.RegistryKey<? extends net.minecraft.util.registry.Registry<T>>)can create and return a new entry list, or return an empty entry list.- Returns:
- the entry list for the provided tag
- See Also:
- Mappings:
Namespace Name Mixin selector official aLhd;a(Lakh;)Ljava/util/Optional;intermediary method_41700Lnet/minecraft/class_7225;method_41700(Lnet/minecraft/class_6862;)Ljava/util/Optional;named getEntryListLnet/minecraft/command/CommandRegistryWrapper;getEntryList(Lnet/minecraft/tag/TagKey;)Ljava/util/Optional;
-
streamTags
- See Also:
- Mappings:
Namespace Name Mixin selector official bLhd;b()Ljava/util/stream/Stream;intermediary method_42020Lnet/minecraft/class_7225;method_42020()Ljava/util/stream/Stream;named streamTagsLnet/minecraft/command/CommandRegistryWrapper;streamTags()Ljava/util/stream/Stream;
-
of
Returns a new wrapper for theregistrywithout any special behaviors.- Returns:
- a new wrapper for the
registrywithout any special behaviors - Mappings:
Namespace Name Mixin selector official aLhd;a(Lhm;)Lhd;intermediary method_42018Lnet/minecraft/class_7225;method_42018(Lnet/minecraft/class_2378;)Lnet/minecraft/class_7225;named ofLnet/minecraft/command/CommandRegistryWrapper;of(Lnet/minecraft/util/registry/Registry;)Lnet/minecraft/command/CommandRegistryWrapper;
-