Package org.bukkit.metadata
Class MetadataValueAdapter
java.lang.Object
org.bukkit.metadata.MetadataValueAdapter
- All Implemented Interfaces:
MetadataValue
- Direct Known Subclasses:
LazyMetadataValue
Deprecated.
Optional base class for facilitating MetadataValue implementations.
This provides all the conversion functions for MetadataValue so that writing an implementation of MetadataValue is as simple as implementing value() and invalidate().
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MetadataValueAdapter
(@NotNull Plugin owningPlugin) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Attempts to convert the value of this metadata item into a boolean.byte
asByte()
Deprecated.Attempts to convert the value of this metadata item into a byte.double
asDouble()
Deprecated.Attempts to convert the value of this metadata item into a double.float
asFloat()
Deprecated.Attempts to convert the value of this metadata item into a float.int
asInt()
Deprecated.Attempts to convert the value of this metadata item into an int.long
asLong()
Deprecated.Attempts to convert the value of this metadata item into a long.short
asShort()
Deprecated.Attempts to convert the value of this metadata item into a short.asString()
Deprecated.Attempts to convert the value of this metadata item into a string.Deprecated.Returns thePlugin
that created this metadata item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.metadata.MetadataValue
invalidate, value
-
Field Details
-
owningPlugin
Deprecated.
-
-
Constructor Details
-
MetadataValueAdapter
Deprecated.
-
-
Method Details
-
getOwningPlugin
Deprecated.Description copied from interface:MetadataValue
Returns thePlugin
that created this metadata item.- Specified by:
getOwningPlugin
in interfaceMetadataValue
- Returns:
- the plugin that owns this metadata value. Could be null if the plugin was already unloaded.
-
asInt
public int asInt()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into an int.- Specified by:
asInt
in interfaceMetadataValue
- Returns:
- the value as an int.
-
asFloat
public float asFloat()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a float.- Specified by:
asFloat
in interfaceMetadataValue
- Returns:
- the value as a float.
-
asDouble
public double asDouble()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a double.- Specified by:
asDouble
in interfaceMetadataValue
- Returns:
- the value as a double.
-
asLong
public long asLong()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a long.- Specified by:
asLong
in interfaceMetadataValue
- Returns:
- the value as a long.
-
asShort
public short asShort()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a short.- Specified by:
asShort
in interfaceMetadataValue
- Returns:
- the value as a short.
-
asByte
public byte asByte()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a byte.- Specified by:
asByte
in interfaceMetadataValue
- Returns:
- the value as a byte.
-
asBoolean
public boolean asBoolean()Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a boolean.- Specified by:
asBoolean
in interfaceMetadataValue
- Returns:
- the value as a boolean.
-
asString
Deprecated.Description copied from interface:MetadataValue
Attempts to convert the value of this metadata item into a string.- Specified by:
asString
in interfaceMetadataValue
- Returns:
- the value as a string.
-
PersistentDataContainer
. If you want temporary values on an entity, just use the entity lifecycle events. (SeeEntityAddToWorldEvent
0