类 MetadataValueAdapter

java.lang.Object
org.bukkit.metadata.MetadataValueAdapter
所有已实现的接口:
MetadataValue
直接已知子类:
LazyMetadataValue

public abstract class MetadataValueAdapter extends Object implements MetadataValue
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().

  • 字段详细资料

  • 构造器详细资料

    • MetadataValueAdapter

      protected MetadataValueAdapter(Plugin owningPlugin)
  • 方法详细资料

    • getOwningPlugin

      public Plugin getOwningPlugin()
      从接口复制的说明: MetadataValue
      Returns the Plugin that created this metadata item.
      指定者:
      getOwningPlugin 在接口中 MetadataValue
      返回:
      the plugin that owns this metadata value. This should never be null.
    • asInt

      public int asInt()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into an int.
      指定者:
      asInt 在接口中 MetadataValue
      返回:
      the value as an int.
    • asFloat

      public float asFloat()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a float.
      指定者:
      asFloat 在接口中 MetadataValue
      返回:
      the value as a float.
    • asDouble

      public double asDouble()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a double.
      指定者:
      asDouble 在接口中 MetadataValue
      返回:
      the value as a double.
    • asLong

      public long asLong()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a long.
      指定者:
      asLong 在接口中 MetadataValue
      返回:
      the value as a long.
    • asShort

      public short asShort()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a short.
      指定者:
      asShort 在接口中 MetadataValue
      返回:
      the value as a short.
    • asByte

      public byte asByte()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a byte.
      指定者:
      asByte 在接口中 MetadataValue
      返回:
      the value as a byte.
    • asBoolean

      public boolean asBoolean()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a boolean.
      指定者:
      asBoolean 在接口中 MetadataValue
      返回:
      the value as a boolean.
    • asString

      public String asString()
      从接口复制的说明: MetadataValue
      Attempts to convert the value of this metadata item into a string.
      指定者:
      asString 在接口中 MetadataValue
      返回:
      the value as a string.