Class ResourceLocation
java.lang.Object
net.minheur.potoflux.utils.ressourcelocation.ResourceLocation
The ResourceLocation is used to have a unique identifier from the mod's namespace and the item id
-
Constructor Summary
ConstructorsConstructorDescriptionResourceLocation(String location) Creates a resourceLocation with a unique string, that gets decomposedResourceLocation(String namespace, String path) Creates a ResourceLocation from a namespace and an ID -
Method Summary
Modifier and TypeMethodDescriptionprotected static String[]Decompose a single string into an array containing the modId and the IDGet the namespace (modID) of the locgetPath()Get the ID of the locstatic booleanisValidNamespace(String pNamespace) Checks if the namespace is validstatic booleanisValidPath(String pPath) Checks if the path is correcttoString()Merge correctly the loc togetherstatic booleanvalidNamespaceChar(char pNamespaceChar) Checks a char of the namespacestatic booleanvalidPathChar(char pPathChar) Checks a char of the ID
-
Constructor Details
-
ResourceLocation
Creates a ResourceLocation from a namespace and an ID- Parameters:
namespace- the ID of the mod registeringpath- the ID of the item registered
-
ResourceLocation
Creates a resourceLocation with a unique string, that gets decomposed- Parameters:
location- loc to decompose
-
-
Method Details
-
getPath
Get the ID of the loc- Returns:
- the loc's ID
-
getNamespace
Get the namespace (modID) of the loc- Returns:
- the loc's namespace
-
toString
Merge correctly the loc together -
decompose
Decompose a single string into an array containing the modId and the ID- Parameters:
pLocation- full loc to decomposepSeparator- char to search in the loc to separate the modId and the ID- Returns:
- an array containing the namespace and the ID
-
isValidPath
Checks if the path is correct- Parameters:
pPath- ID of the loc- Returns:
- if the ID is correct
-
isValidNamespace
Checks if the namespace is valid- Parameters:
pNamespace- namespace of the loc- Returns:
- if the namespace is correct
-
validPathChar
public static boolean validPathChar(char pPathChar) Checks a char of the ID- Parameters:
pPathChar- the char to check- Returns:
- if char is valid
-
validNamespaceChar
public static boolean validNamespaceChar(char pNamespaceChar) Checks a char of the namespace- Parameters:
pNamespaceChar- the char to check- Returns:
- if char is valid
-