Package net.minecraft.modding.api.game
Class ResourceLocation
- java.lang.Object
-
- net.minecraft.modding.api.game.ResourceLocation
-
- All Implemented Interfaces:
java.lang.Comparable<ResourceLocation>
public class ResourceLocation extends java.lang.Object implements java.lang.Comparable<ResourceLocation>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_NAMESPACE
static char
NAMESPACE_SEPARATOR
-
Constructor Summary
Constructors Modifier Constructor Description ResourceLocation(java.lang.String string)
ResourceLocation(java.lang.String namespace, java.lang.String path)
protected
ResourceLocation(java.lang.String namespace, java.lang.String path, java.lang.Void ignored)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ResourceLocation other)
protected static java.lang.String[]
decompose(java.lang.String location, char separator)
boolean
equals(java.lang.Object object)
java.lang.String
getNamespace()
java.lang.String
getPath()
int
hashCode()
static boolean
isAllowedInResourceLocation(char c)
static boolean
isValidResourceLocation(java.lang.String location)
static ResourceLocation
of(java.lang.String location, char separator)
java.lang.String
toDebugFileName()
java.lang.String
toLanguageKey()
java.lang.String
toLanguageKey(java.lang.String type)
java.lang.String
toLanguageKey(java.lang.String type, java.lang.String key)
java.lang.String
toShortLanguageKey()
java.lang.String
toString()
static @Nullable ResourceLocation
tryBuild(java.lang.String namespace, java.lang.String path)
static @Nullable ResourceLocation
tryParse(java.lang.String location)
static boolean
validPathChar(char pathChar)
ResourceLocation
withPath(java.lang.String path)
ResourceLocation
withPath(java.util.function.UnaryOperator<java.lang.String> pathOperator)
ResourceLocation
withPrefix(java.lang.String pathPrefix)
ResourceLocation
withSuffix(java.lang.String pathSuffix)
-
-
-
Field Detail
-
NAMESPACE_SEPARATOR
public static final char NAMESPACE_SEPARATOR
- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE
public static final java.lang.String DEFAULT_NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static ResourceLocation of(java.lang.String location, char separator)
-
tryParse
@Nullable public static @Nullable ResourceLocation tryParse(java.lang.String location)
-
tryBuild
@Nullable public static @Nullable ResourceLocation tryBuild(java.lang.String namespace, java.lang.String path)
-
decompose
protected static java.lang.String[] decompose(java.lang.String location, char separator)
-
getPath
public java.lang.String getPath()
-
getNamespace
public java.lang.String getNamespace()
-
withPath
public ResourceLocation withPath(java.lang.String path)
-
withPath
public ResourceLocation withPath(java.util.function.UnaryOperator<java.lang.String> pathOperator)
-
withPrefix
public ResourceLocation withPrefix(java.lang.String pathPrefix)
-
withSuffix
public ResourceLocation withSuffix(java.lang.String pathSuffix)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(ResourceLocation other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ResourceLocation>
-
toDebugFileName
public java.lang.String toDebugFileName()
-
toLanguageKey
public java.lang.String toLanguageKey()
-
toShortLanguageKey
public java.lang.String toShortLanguageKey()
-
toLanguageKey
public java.lang.String toLanguageKey(java.lang.String type)
-
toLanguageKey
public java.lang.String toLanguageKey(java.lang.String type, java.lang.String key)
-
isAllowedInResourceLocation
public static boolean isAllowedInResourceLocation(char c)
-
validPathChar
public static boolean validPathChar(char pathChar)
-
isValidResourceLocation
public static boolean isValidResourceLocation(java.lang.String location)
-
-