Class MinecraftKeyWrapper
java.lang.Object
com.fren_gor.ultimateAdvancementAPI.nms.wrappers.AbstractWrapper
com.fren_gor.ultimateAdvancementAPI.nms.wrappers.MinecraftKeyWrapper
- All Implemented Interfaces:
Comparable<MinecraftKeyWrapper>
public abstract class MinecraftKeyWrapper
extends AbstractWrapper
implements Comparable<MinecraftKeyWrapper>
Wrapper class for NMS
MinecraftKey
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MinecraftKeyWrapper
Creates a newMinecraftKeyWrapper
with the same namespaced key of the provided NMSMinecraftKey
.static @NotNull MinecraftKeyWrapper
Creates a newMinecraftKeyWrapper
with the provided namespace and key.boolean
getKey()
Gets the key.Gets the namespace.int
hashCode()
toString()
Methods inherited from class com.fren_gor.ultimateAdvancementAPI.nms.wrappers.AbstractWrapper
toNMS
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
MinecraftKeyWrapper
public MinecraftKeyWrapper()
-
-
Method Details
-
craft
@NotNull public static @NotNull MinecraftKeyWrapper craft(@NotNull @NotNull Object minecraftKey) throws ReflectiveOperationException, ClassCastException Creates a newMinecraftKeyWrapper
with the same namespaced key of the provided NMSMinecraftKey
.- Parameters:
minecraftKey
- The NMSMinecraftKey
.- Returns:
- A new
MinecraftKeyWrapper
with the same namespaced key of the provided NMSMinecraftKey
. - Throws:
ReflectiveOperationException
- If reflections goes wrong.ClassCastException
- If the provided object is not a NMSMinecraftKey
.
-
craft
@NotNull public static @NotNull MinecraftKeyWrapper craft(@NotNull @NotNull String namespace, @NotNull @NotNull String key) throws ReflectiveOperationException, IllegalArgumentException Creates a newMinecraftKeyWrapper
with the provided namespace and key.The namespace must match the following pattern:
[a-z0-9_.-]+
.The key must match the following pattern:
[a-z0-9_.-/]+
.- Parameters:
namespace
- The namespace.key
- The key.- Returns:
- A new
MinecraftKeyWrapper
with the provided namespace and key. - Throws:
ReflectiveOperationException
- If reflections goes wrong.IllegalArgumentException
- If the provided namespace or key does not match their pattern.
-
getNamespace
Gets the namespace.- Returns:
- The namespace.
-
getKey
Gets the key.- Returns:
- The key.
-
toString
- Overrides:
toString
in classAbstractWrapper
-
equals
- Overrides:
equals
in classAbstractWrapper
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractWrapper
-