类 RegistryKey<T>

  • 类型参数:
    T - the type of the value

    public class RegistryKey<T>
    extends Object
    Represents a key for a value in a registry in a context where a root registry is available.
    另请参阅:
    Registry.ROOT
    Mappings:
    Namespace Name
    official wo
    intermediary net/minecraft/class_5321
    named net/minecraft/util/registry/RegistryKey
    • 字段详细资料

      • INSTANCES

        private static final Map<String,​RegistryKey<?>> INSTANCES
        A cache of all registry keys ever created.
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a:Ljava/util/Map;
        intermediary field_25136 Lnet/minecraft/class_5321;field_25136:Ljava/util/Map;
        named INSTANCES Lnet/minecraft/util/registry/RegistryKey;INSTANCES:Ljava/util/Map;
      • registry

        private final Identifier registry
        The identifier of the registry in the root registry.
        Mappings:
        Namespace Name Mixin selector
        official b Lwo;b:Lwp;
        intermediary field_25137 Lnet/minecraft/class_5321;field_25137:Lnet/minecraft/class_2960;
        named registry Lnet/minecraft/util/registry/RegistryKey;registry:Lnet/minecraft/util/Identifier;
      • value

        private final Identifier value
        The identifier of the value in the registry specified by registry.
        Mappings:
        Namespace Name Mixin selector
        official c Lwo;c:Lwp;
        intermediary field_25138 Lnet/minecraft/class_5321;field_25138:Lnet/minecraft/class_2960;
        named value Lnet/minecraft/util/registry/RegistryKey;value:Lnet/minecraft/util/Identifier;
    • 构造器详细资料

      • RegistryKey

        private RegistryKey​(Identifier registry,
                            Identifier value)
        Mappings:
        Namespace Name Mixin selector
        official <init> Lwo;<init>(Lwp;Lwp;)V
        intermediary <init> Lnet/minecraft/class_5321;<init>(Lnet/minecraft/class_2960;Lnet/minecraft/class_2960;)V
        named <init> Lnet/minecraft/util/registry/RegistryKey;<init>(Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
    • 方法详细资料

      • of

        public static <T> RegistryKey<T> of​(RegistryKey<? extends Registry<T>> registry,
                                            Identifier value)
        Creates a registry key for a value in a registry with a registry key for the value-holding registry in the root registry and an identifier of the value.

        You can call it like RegistryKey.of(Registry.ITEM_KEY, new Identifier("iron_ingot")) to create a registry key for iron ingot.

        类型参数:
        T - the type of the value
        参数:
        registry - the registry key of the registry in the root registry
        value - the identifier of the value
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a(Lwo;Lwp;)Lwo;
        intermediary method_29179 Lnet/minecraft/class_5321;method_29179(Lnet/minecraft/class_5321;Lnet/minecraft/class_2960;)Lnet/minecraft/class_5321;
        named of Lnet/minecraft/util/registry/RegistryKey;of(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/util/Identifier;)Lnet/minecraft/util/registry/RegistryKey;
      • ofRegistry

        public static <T> RegistryKey<Registry<T>> ofRegistry​(Identifier registry)
        Creates a registry key for a registry in the root registry (registry of all registries) with an identifier for the registry.

        You can call it like RegistryKey.of(new Identifier("block")) to create a registry key for the block registry.

        类型参数:
        T - the element type of the registry
        参数:
        registry - the identifier of the registry
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a(Lwp;)Lwo;
        intermediary method_29180 Lnet/minecraft/class_5321;method_29180(Lnet/minecraft/class_2960;)Lnet/minecraft/class_5321;
        named ofRegistry Lnet/minecraft/util/registry/RegistryKey;ofRegistry(Lnet/minecraft/util/Identifier;)Lnet/minecraft/util/registry/RegistryKey;
      • of

        private static <T> RegistryKey<T> of​(Identifier registry,
                                             Identifier value)
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a(Lwp;Lwp;)Lwo;
        intermediary method_29181 Lnet/minecraft/class_5321;method_29181(Lnet/minecraft/class_2960;Lnet/minecraft/class_2960;)Lnet/minecraft/class_5321;
        named of Lnet/minecraft/util/registry/RegistryKey;of(Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)Lnet/minecraft/util/registry/RegistryKey;
      • toString

        public String toString()
        覆盖:
        toString 在类中 Object
        Mappings:
        Namespace Name Mixin selector
        official toString Lwo;toString()Ljava/lang/String;
        intermediary toString Lnet/minecraft/class_5321;toString()Ljava/lang/String;
        named toString Lnet/minecraft/util/registry/RegistryKey;toString()Ljava/lang/String;
      • isOf

        public boolean isOf​(RegistryKey<? extends Registry<?>> registry)
        Returns whether this registry key belongs to the given registry (according to its type, not whether the registry actually contains this key).
        参数:
        registry - the key of the registry that this registry key should be inside
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a(Lwo;)Z
        intermediary method_31163 Lnet/minecraft/class_5321;method_31163(Lnet/minecraft/class_5321;)Z
        named isOf Lnet/minecraft/util/registry/RegistryKey;isOf(Lnet/minecraft/util/registry/RegistryKey;)Z
      • getValue

        public Identifier getValue()
        Mappings:
        Namespace Name Mixin selector
        official a Lwo;a()Lwp;
        intermediary method_29177 Lnet/minecraft/class_5321;method_29177()Lnet/minecraft/class_2960;
        named getValue Lnet/minecraft/util/registry/RegistryKey;getValue()Lnet/minecraft/util/Identifier;
      • createKeyFactory

        public static <T> Function<Identifier,​RegistryKey<T>> createKeyFactory​(RegistryKey<? extends Registry<T>> registry)
        Creates a function that converts an identifier to a registry key for the registry that registry refers to in the root registry.
        参数:
        registry - the reference to the value-holding registry in the root registry
        Mappings:
        Namespace Name Mixin selector
        official b Lwo;b(Lwo;)Ljava/util/function/Function;
        intermediary method_29178 Lnet/minecraft/class_5321;method_29178(Lnet/minecraft/class_5321;)Ljava/util/function/Function;
        named createKeyFactory Lnet/minecraft/util/registry/RegistryKey;createKeyFactory(Lnet/minecraft/util/registry/RegistryKey;)Ljava/util/function/Function;