Package net.minecraft.util
Class ResourceLocation
- java.lang.Object
-
- net.minecraft.util.ResourceLocation
-
- All Implemented Interfaces:
java.lang.Comparable<ResourceLocation>
- Direct Known Subclasses:
ModelResourceLocation
public class ResourceLocation extends java.lang.Object implements java.lang.Comparable<ResourceLocation>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceLocation.Serializer
-
Field Summary
Fields Modifier and Type Field Description static com.mojang.serialization.Codec<ResourceLocation>
CODEC
private static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_INVALID
protected java.lang.String
namespace
protected java.lang.String
path
-
Constructor Summary
Constructors Modifier Constructor Description ResourceLocation(java.lang.String p_i1293_1_)
protected
ResourceLocation(java.lang.String[] p_i47923_1_)
ResourceLocation(java.lang.String p_i1292_1_, java.lang.String p_i1292_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareNamespaced(ResourceLocation o)
int
compareTo(ResourceLocation p_compareTo_1_)
protected static java.lang.String[]
decompose(java.lang.String p_195823_0_, char p_195823_1_)
boolean
equals(java.lang.Object p_equals_1_)
java.lang.String
getNamespace()
java.lang.String
getPath()
int
hashCode()
static boolean
isAllowedInResourceLocation(char p_195824_0_)
private static boolean
isValidNamespace(java.lang.String p_217858_0_)
private static boolean
isValidPath(java.lang.String p_217856_0_)
static boolean
isValidResourceLocation(java.lang.String p_217855_0_)
static ResourceLocation
of(java.lang.String p_195828_0_, char p_195828_1_)
static ResourceLocation
read(com.mojang.brigadier.StringReader p_195826_0_)
private static com.mojang.serialization.DataResult<ResourceLocation>
read(java.lang.String p_240911_0_)
java.lang.String
toString()
static ResourceLocation
tryParse(java.lang.String p_208304_0_)
private static boolean
validNamespaceChar(char p_240910_0_)
static boolean
validPathChar(char p_240909_0_)
-
-
-
Field Detail
-
CODEC
public static final com.mojang.serialization.Codec<ResourceLocation> CODEC
-
ERROR_INVALID
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID
-
namespace
protected final java.lang.String namespace
-
path
protected final java.lang.String path
-
-
Method Detail
-
of
public static ResourceLocation of(java.lang.String p_195828_0_, char p_195828_1_)
-
tryParse
@Nullable public static ResourceLocation tryParse(java.lang.String p_208304_0_)
-
decompose
protected static java.lang.String[] decompose(java.lang.String p_195823_0_, char p_195823_1_)
-
read
private static com.mojang.serialization.DataResult<ResourceLocation> read(java.lang.String p_240911_0_)
-
getPath
public java.lang.String getPath()
-
getNamespace
public java.lang.String getNamespace()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object p_equals_1_)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(ResourceLocation p_compareTo_1_)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ResourceLocation>
-
compareNamespaced
public int compareNamespaced(ResourceLocation o)
-
read
public static ResourceLocation read(com.mojang.brigadier.StringReader p_195826_0_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isAllowedInResourceLocation
public static boolean isAllowedInResourceLocation(char p_195824_0_)
-
isValidPath
private static boolean isValidPath(java.lang.String p_217856_0_)
-
isValidNamespace
private static boolean isValidNamespace(java.lang.String p_217858_0_)
-
validPathChar
public static boolean validPathChar(char p_240909_0_)
-
validNamespaceChar
private static boolean validNamespaceChar(char p_240910_0_)
-
isValidResourceLocation
public static boolean isValidResourceLocation(java.lang.String p_217855_0_)
-
-