Package net.minecraft.util
Class Identifier
java.lang.Object
net.minecraft.util.Identifier
- All Implemented Interfaces:
Comparable<Identifier>
- Direct Known Subclasses:
ModelIdentifier
The namespace and path must contain only lowercase letters ([a-z]), digits ([0-9]), or the characters '_', '.', and '-'. The path can also contain the standard path separator '/'.
- Mappings:
Namespace Name official ww
intermediary net/minecraft/class_2960
named net/minecraft/util/Identifier
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Identifier>
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final String
protected final String
static final char
protected final String
static final String
-
Constructor Summary
ModifierConstructorDescriptionIdentifier
(String id) Takes a string of the form<namespace>:<path>
, for exampleminecraft:iron_ingot
.protected
Identifier
(String[] id) Identifier
(String namespace, String path) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Identifier identifier) boolean
static Identifier
fromCommandInput
(com.mojang.brigadier.StringReader reader) getPath()
int
hashCode()
static boolean
isCharValid
(char c) private static boolean
isNamespaceCharacterValid
(char character) private static boolean
isNamespaceValid
(String namespace) static boolean
isPathCharacterValid
(char character) private static boolean
isPathValid
(String path) static boolean
protected static String[]
static Identifier
toString()
static @Nullable Identifier
Parses a string into anIdentifier
.private static com.mojang.serialization.DataResult<Identifier>
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lww;a:Lcom/mojang/serialization/Codec;
intermediary field_25139
Lnet/minecraft/class_2960;field_25139:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/util/Identifier;CODEC:Lcom/mojang/serialization/Codec;
-
COMMAND_EXCEPTION
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType COMMAND_EXCEPTION- Mappings:
Namespace Name Mixin selector official g
Lww;g:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
intermediary field_13354
Lnet/minecraft/class_2960;field_13354:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
named COMMAND_EXCEPTION
Lnet/minecraft/util/Identifier;COMMAND_EXCEPTION:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
-
NAMESPACE_SEPARATOR
public static final char NAMESPACE_SEPARATOR- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lww;b:C
intermediary field_33380
Lnet/minecraft/class_2960;field_33380:C
named NAMESPACE_SEPARATOR
Lnet/minecraft/util/Identifier;NAMESPACE_SEPARATOR:C
-
DEFAULT_NAMESPACE
- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lww;c:Ljava/lang/String;
intermediary field_33381
Lnet/minecraft/class_2960;field_33381:Ljava/lang/String;
named DEFAULT_NAMESPACE
Lnet/minecraft/util/Identifier;DEFAULT_NAMESPACE:Ljava/lang/String;
-
REALMS_NAMESPACE
- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lww;d:Ljava/lang/String;
intermediary field_33382
Lnet/minecraft/class_2960;field_33382:Ljava/lang/String;
named REALMS_NAMESPACE
Lnet/minecraft/util/Identifier;REALMS_NAMESPACE:Ljava/lang/String;
-
namespace
- Mappings:
Namespace Name Mixin selector official e
Lww;e:Ljava/lang/String;
intermediary field_13353
Lnet/minecraft/class_2960;field_13353:Ljava/lang/String;
named namespace
Lnet/minecraft/util/Identifier;namespace:Ljava/lang/String;
-
path
- Mappings:
Namespace Name Mixin selector official f
Lww;f:Ljava/lang/String;
intermediary field_13355
Lnet/minecraft/class_2960;field_13355:Ljava/lang/String;
named path
Lnet/minecraft/util/Identifier;path:Ljava/lang/String;
-
-
Constructor Details
-
Identifier
- Mappings:
Namespace Name Mixin selector official <init>
Lww;<init>([Ljava/lang/String;)V
intermediary <init>
Lnet/minecraft/class_2960;<init>([Ljava/lang/String;)V
named <init>
Lnet/minecraft/util/Identifier;<init>([Ljava/lang/String;)V
-
Identifier
Takes a string of the form
<namespace>:<path>
, for exampleminecraft:iron_ingot
.The string will be split (on the
:
) into an identifier with the specified path and namespace. Prefer using theIdentifier(java.lang.String, java.lang.String)
constructor that takes the namespace and path as individual parameters to avoid mistakes.- Throws:
InvalidIdentifierException
- if the string cannot be parsed as an identifier.- Mappings:
Namespace Name Mixin selector official <init>
Lww;<init>(Ljava/lang/String;)V
intermediary <init>
Lnet/minecraft/class_2960;<init>(Ljava/lang/String;)V
named <init>
Lnet/minecraft/util/Identifier;<init>(Ljava/lang/String;)V
-
Identifier
- Mappings:
Namespace Name Mixin selector official <init>
Lww;<init>(Ljava/lang/String;Ljava/lang/String;)V
intermediary <init>
Lnet/minecraft/class_2960;<init>(Ljava/lang/String;Ljava/lang/String;)V
named <init>
Lnet/minecraft/util/Identifier;<init>(Ljava/lang/String;Ljava/lang/String;)V
-
-
Method Details
-
splitOn
- Mappings:
Namespace Name Mixin selector official a
Lww;a(Ljava/lang/String;C)Lww;
intermediary method_12838
Lnet/minecraft/class_2960;method_12838(Ljava/lang/String;C)Lnet/minecraft/class_2960;
named splitOn
Lnet/minecraft/util/Identifier;splitOn(Ljava/lang/String;C)Lnet/minecraft/util/Identifier;
-
tryParse
Parses a string into an
Identifier
. Takes a string of the form<namespace>:<path>
, for exampleminecraft:iron_ingot
.- Returns:
- resulting identifier, or
null
if the string couldn't be parsed as an identifier - Mappings:
Namespace Name Mixin selector official a
Lww;a(Ljava/lang/String;)Lww;
intermediary method_12829
Lnet/minecraft/class_2960;method_12829(Ljava/lang/String;)Lnet/minecraft/class_2960;
named tryParse
Lnet/minecraft/util/Identifier;tryParse(Ljava/lang/String;)Lnet/minecraft/util/Identifier;
-
split
- Mappings:
Namespace Name Mixin selector official b
Lww;b(Ljava/lang/String;C)[Ljava/lang/String;
intermediary method_12830
Lnet/minecraft/class_2960;method_12830(Ljava/lang/String;C)[Ljava/lang/String;
named split
Lnet/minecraft/util/Identifier;split(Ljava/lang/String;C)[Ljava/lang/String;
-
validate
- Mappings:
Namespace Name Mixin selector official c
Lww;c(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
intermediary method_29186
Lnet/minecraft/class_2960;method_29186(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
named validate
Lnet/minecraft/util/Identifier;validate(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
-
getPath
- Mappings:
Namespace Name Mixin selector official a
Lww;a()Ljava/lang/String;
intermediary method_12832
Lnet/minecraft/class_2960;method_12832()Ljava/lang/String;
named getPath
Lnet/minecraft/util/Identifier;getPath()Ljava/lang/String;
-
getNamespace
- Mappings:
Namespace Name Mixin selector official b
Lww;b()Ljava/lang/String;
intermediary method_12836
Lnet/minecraft/class_2960;method_12836()Ljava/lang/String;
named getNamespace
Lnet/minecraft/util/Identifier;getNamespace()Ljava/lang/String;
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Identifier>
- Mappings:
Namespace Name Mixin selector official a
Lww;a(Lww;)I
intermediary method_12833
Lnet/minecraft/class_2960;method_12833(Lnet/minecraft/class_2960;)I
named compareTo
Lnet/minecraft/util/Identifier;compareTo(Lnet/minecraft/util/Identifier;)I
-
toUnderscoreSeparatedString
- Mappings:
Namespace Name Mixin selector official c
Lww;c()Ljava/lang/String;
intermediary method_36181
Lnet/minecraft/class_2960;method_36181()Ljava/lang/String;
named toUnderscoreSeparatedString
Lnet/minecraft/util/Identifier;toUnderscoreSeparatedString()Ljava/lang/String;
-
fromCommandInput
public static Identifier fromCommandInput(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
- Mappings:
Namespace Name Mixin selector official a
Lww;a(Lcom/mojang/brigadier/StringReader;)Lww;
intermediary method_12835
Lnet/minecraft/class_2960;method_12835(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/class_2960;
named fromCommandInput
Lnet/minecraft/util/Identifier;fromCommandInput(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/util/Identifier;
-
isCharValid
public static boolean isCharValid(char c) - Mappings:
Namespace Name Mixin selector official a
Lww;a(C)Z
intermediary method_12831
Lnet/minecraft/class_2960;method_12831(C)Z
named isCharValid
Lnet/minecraft/util/Identifier;isCharValid(C)Z
-
isPathValid
- Mappings:
Namespace Name Mixin selector official d
Lww;d(Ljava/lang/String;)Z
intermediary method_20208
Lnet/minecraft/class_2960;method_20208(Ljava/lang/String;)Z
named isPathValid
Lnet/minecraft/util/Identifier;isPathValid(Ljava/lang/String;)Z
-
isNamespaceValid
- Mappings:
Namespace Name Mixin selector official e
Lww;e(Ljava/lang/String;)Z
intermediary method_20209
Lnet/minecraft/class_2960;method_20209(Ljava/lang/String;)Z
named isNamespaceValid
Lnet/minecraft/util/Identifier;isNamespaceValid(Ljava/lang/String;)Z
-
isPathCharacterValid
public static boolean isPathCharacterValid(char character) - Mappings:
Namespace Name Mixin selector official b
Lww;b(C)Z
intermediary method_29184
Lnet/minecraft/class_2960;method_29184(C)Z
named isPathCharacterValid
Lnet/minecraft/util/Identifier;isPathCharacterValid(C)Z
-
isNamespaceCharacterValid
private static boolean isNamespaceCharacterValid(char character) - Mappings:
Namespace Name Mixin selector official c
Lww;c(C)Z
intermediary method_29185
Lnet/minecraft/class_2960;method_29185(C)Z
named isNamespaceCharacterValid
Lnet/minecraft/util/Identifier;isNamespaceCharacterValid(C)Z
-
isValid
- Mappings:
Namespace Name Mixin selector official b
Lww;b(Ljava/lang/String;)Z
intermediary method_20207
Lnet/minecraft/class_2960;method_20207(Ljava/lang/String;)Z
named isValid
Lnet/minecraft/util/Identifier;isValid(Ljava/lang/String;)Z
-