接口 MetadataValue

所有已知实现类:
FixedMetadataValue, LazyMetadataValue, MetadataValueAdapter

public interface MetadataValue
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    Attempts to convert the value of this metadata item into a boolean.
    byte
    Attempts to convert the value of this metadata item into a byte.
    double
    Attempts to convert the value of this metadata item into a double.
    float
    Attempts to convert the value of this metadata item into a float.
    int
    Attempts to convert the value of this metadata item into an int.
    long
    Attempts to convert the value of this metadata item into a long.
    short
    Attempts to convert the value of this metadata item into a short.
    Attempts to convert the value of this metadata item into a string.
    Returns the Plugin that created this metadata item.
    void
    Invalidates this metadata item, forcing it to recompute when next accessed.
    Fetches the value of this metadata item.
  • 方法详细资料

    • value

      Fetches the value of this metadata item.
      返回:
      the metadata value.
    • asInt

      int asInt()
      Attempts to convert the value of this metadata item into an int.
      返回:
      the value as an int.
    • asFloat

      float asFloat()
      Attempts to convert the value of this metadata item into a float.
      返回:
      the value as a float.
    • asDouble

      double asDouble()
      Attempts to convert the value of this metadata item into a double.
      返回:
      the value as a double.
    • asLong

      long asLong()
      Attempts to convert the value of this metadata item into a long.
      返回:
      the value as a long.
    • asShort

      short asShort()
      Attempts to convert the value of this metadata item into a short.
      返回:
      the value as a short.
    • asByte

      byte asByte()
      Attempts to convert the value of this metadata item into a byte.
      返回:
      the value as a byte.
    • asBoolean

      boolean asBoolean()
      Attempts to convert the value of this metadata item into a boolean.
      返回:
      the value as a boolean.
    • asString

      Attempts to convert the value of this metadata item into a string.
      返回:
      the value as a string.
    • getOwningPlugin

      @Nullable @Nullable Plugin getOwningPlugin()
      Returns the Plugin that created this metadata item.
      返回:
      the plugin that owns this metadata value. Could be null if the plugin was already unloaded.
    • invalidate

      void invalidate()
      Invalidates this metadata item, forcing it to recompute when next accessed.