Package org.spongepowered.api
Interface ResourceKey
- All Superinterfaces:
- Comparable<Key>,- net.kyori.examination.Examinable,- Key,- Namespaced
An object representation of a location or pointer to resources.
 The key can be represented as a 
String by Object.toString().
 The key is built with two parts:
 - The Namespace
- The Value
ResourceKey, including but
 not restricted to DataRegistrations, ConfigurationNodes,
 DataTranslators, and DataSerializables.
 Note that the methods minecraft(String) and
 sponge(String) should only be used by the implementations for
 creating new keys and usage by plugins may result in
 a crash condition by the implementation.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder to createResourceKeys.static interfaceA factory to generateResourceKeys.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptiondefault StringasString()static @NonNull ResourceKeyCreates a resource key with a namespace ofbrigadier.static ResourceKey.Builderbuilder()Creates a newResourceKey.Builderfor creatingResourceKeys.default intdefault StringGets this key as a formatted value.static @NonNull ResourceKeyCreates a resource key with a namespace ofminecraft.static ResourceKeyCreates a resource key.static ResourceKeyCreates a resource key.static ResourceKeyResolves a resource key from a string.static @NonNull ResourceKeyCreates a resource key with a namespace ofsponge.Methods inherited from interface net.kyori.examination.ExaminableexaminableName, examineMethods inherited from interface net.kyori.adventure.key.KeyexaminableProperties, namespace, value
- 
Field Details- 
BRIGADIER_NAMESPACEThe brigadier namespace.- See Also:
 
- 
MINECRAFT_NAMESPACEThe minecraft namespace.- See Also:
 
- 
SPONGE_NAMESPACEThe sponge namespace.- See Also:
 
 
- 
- 
Method Details- 
brigadierCreates a resource key with a namespace ofbrigadier.- Parameters:
- value- The value
- Returns:
- A new resource key
 
- 
minecraftCreates a resource key with a namespace ofminecraft.- Parameters:
- value- The value
- Returns:
- A new resource key
 
- 
spongeCreates a resource key with a namespace ofsponge.- Parameters:
- value- The value
- Returns:
- A new resource key
 
- 
builderCreates a newResourceKey.Builderfor creatingResourceKeys. The builder can be used for creating keys based onPluginContainers,Objects of plugins, andStringnamespaces.- Returns:
- The new builder instance
 
- 
ofCreates a resource key.- Parameters:
- namespace- The namespace
- value- The value
- Returns:
- A new resource key
 
- 
ofCreates a resource key.- Parameters:
- plugin- The plugin
- value- The value
- Returns:
- A new resource key
 
- 
resolveResolves a resource key from a string.If no namespace is found in formattedthenMINECRAFT_NAMESPACEwill be the namespace.- Parameters:
- formatted- The formatted string to parse
- Returns:
- A new resource key
 
- 
formattedGets this key as a formatted value.It is up to the implementation to determine the formatting. In vanilla Minecraft, keys are formatted as "namespace:value". For example, "minecraft:carrot". - Returns:
- The key, formatted
 
- 
asString
- 
compareTo- Specified by:
- compareToin interface- Comparable<Key>
- Specified by:
- compareToin interface- Key
 
 
-