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.StringDEFAULT_NAMESPACEstatic charNAMESPACE_SEPARATOR
-
Constructor Summary
Constructors Modifier Constructor Description ResourceLocation(java.lang.String string)ResourceLocation(java.lang.String namespace, java.lang.String path)protectedResourceLocation(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 intcompareTo(ResourceLocation other)protected static java.lang.String[]decompose(java.lang.String location, char separator)booleanequals(java.lang.Object object)java.lang.StringgetNamespace()java.lang.StringgetPath()inthashCode()static booleanisAllowedInResourceLocation(char c)static booleanisValidResourceLocation(java.lang.String location)static ResourceLocationof(java.lang.String location, char separator)java.lang.StringtoDebugFileName()java.lang.StringtoLanguageKey()java.lang.StringtoLanguageKey(java.lang.String type)java.lang.StringtoLanguageKey(java.lang.String type, java.lang.String key)java.lang.StringtoShortLanguageKey()java.lang.StringtoString()static @Nullable ResourceLocationtryBuild(java.lang.String namespace, java.lang.String path)static @Nullable ResourceLocationtryParse(java.lang.String location)static booleanvalidPathChar(char pathChar)ResourceLocationwithPath(java.lang.String path)ResourceLocationwithPath(java.util.function.UnaryOperator<java.lang.String> pathOperator)ResourceLocationwithPrefix(java.lang.String pathPrefix)ResourceLocationwithSuffix(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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(ResourceLocation other)
- Specified by:
compareToin 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)
-
-