Package net.minecraft.util
Class Identifier
java.lang.Object
net.minecraft.util.Identifier
- All Implemented Interfaces:
Comparable<Identifier>
- Direct Known Subclasses:
ModelIdentifier
public class Identifier extends Object implements Comparable<Identifier>
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 wb
intermediary net/minecraft/class_2960
named net/minecraft/util/Identifier
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Identifier.Serializer
-
Field Summary
Fields Modifier and Type Field Description static com.mojang.serialization.Codec<Identifier>
CODEC
private static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
COMMAND_EXCEPTION
protected String
namespace
protected String
path
-
Constructor Summary
Constructors Modifier Constructor Description Identifier(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 Type Method Description int
compareTo(Identifier identifier)
boolean
equals(Object other)
static Identifier
fromCommandInput(com.mojang.brigadier.StringReader reader)
String
getNamespace()
String
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
isValid(String id)
protected static String[]
split(String id, char delimiter)
static Identifier
splitOn(String id, char delimiter)
String
toString()
static Identifier
tryParse(String id)
Parses a string into anIdentifier
.private static com.mojang.serialization.DataResult<Identifier>
validate(String id)
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lwb;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 d
Lwb;d: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
- Mappings:
Namespace Name Mixin selector official b
Lwb;b: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 c
Lwb;c: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>
Lwb;<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
Prefer using the:
) into an identifier with the specified path and namespace.Identifier(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>
Lwb;<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>
Lwb;<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
Lwb;a(Ljava/lang/String;C)Lwb;
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
Takes a string of the formIdentifier
.<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
Lwb;a(Ljava/lang/String;)Lwb;
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
Lwb;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
Lwb;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
Lwb;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
Lwb;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
Lwb;a(Lwb;)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
-
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
Lwb;a(Lcom/mojang/brigadier/StringReader;)Lwb;
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
Lwb;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
Lwb;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
Lwb;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
Lwb;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
Lwb;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
Lwb;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
-