public final class ResourceName extends java.lang.Object implements java.lang.Comparable<ResourceName>
Constants.RESOURCE_SEPARATOR, followed by the actual
resource name.
The game's internal resource names use the IGameInstance instance
from RockBottomAPI.getGame() as the domain. Using this in mods is
highly discouraged and, if anything, should only be used to access existing
internal resources, not create new ones.
| Constructor and Description |
|---|
ResourceName(IMod mod,
java.lang.String resourceName)
Creates a resource name with the given
IMod as the domain. |
ResourceName(java.lang.String combined)
Creates a resource name from a combined string.
|
| Modifier and Type | Method and Description |
|---|---|
ResourceName |
addPrefix(java.lang.String prefix)
Returns a new resource name with the given prefix added to the front of
the resource.
|
ResourceName |
addSuffix(java.lang.String suffix)
Returns a new resource name with the given suffix added to the end of the
resource.
|
int |
compareTo(ResourceName o) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getDomain()
Returns the domain of this resource name.
|
java.lang.String |
getResourceName()
Returns the name of this resource
|
int |
hashCode() |
static ResourceName |
intern(java.lang.String resourceName)
Creates an internal resource name that uses the
IGameInstance
instance from RockBottomAPI.getGame() as the domain. |
java.lang.String |
toString() |
public ResourceName(IMod mod, java.lang.String resourceName)
IMod as the domain.mod - The mod domainresourceName - The resource namepublic ResourceName(java.lang.String combined)
Constants.RESOURCE_SEPARATOR, then it will throw an
IllegalArgumentException.combined - The combined resource stringtoString()@ApiInternal public static ResourceName intern(java.lang.String resourceName)
IGameInstance
instance from RockBottomAPI.getGame() as the domain. Using this
in mods is highly discouraged and, if anything, should only be used to
access existing internal resources, not create new ones.resourceName - The name of the resourcepublic java.lang.String getDomain()
getResourceName(),
Constants.RESOURCE_SEPARATORpublic java.lang.String getResourceName()
getDomain(),
Constants.RESOURCE_SEPARATORpublic ResourceName addPrefix(java.lang.String prefix)
prefix - The prefix to addpublic ResourceName addSuffix(java.lang.String suffix)
suffix - The suffix to addpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(ResourceName o)
compareTo in interface java.lang.Comparable<ResourceName>public java.lang.String toString()
toString in class java.lang.Object