Class ArenaConditionVariable<T extends ArenaConditionVariableValue<?>>

java.lang.Object
de.marcely.bedwars.api.arena.picker.condition.variable.ArenaConditionVariable<T>
Type Parameters:
T - inherits ArenaConditionVariableValue. It's equal to getValueClass()

public abstract class ArenaConditionVariable<T extends ArenaConditionVariableValue<?>> extends Object
Represents a variable that persists of a name and a type and is able to fetch a specific property of an arena at any time.

Make sure to register it when constructing a custom one using ArenaPickerAPI.registerConditionVariable(ArenaConditionVariable).

  • Constructor Details

    • ArenaConditionVariable

      public ArenaConditionVariable(Plugin plugin, String name, Class<T> valueClass)
      Construct a new variable type.
      Parameters:
      plugin - The plugin that is constructing it
      name - Must be in the following format: a-z, _, @, :. It is automatically being put into lower-case
      valueClass - Must be a ArenaConditionVariableTypeNumber or ArenaConditionVariableTypeSring
  • Method Details

    • getType

      public ArenaConditionVariableType getType()
      Returns the type of this variable.
      Returns:
      The type
    • getPlugin

      public final Plugin getPlugin()
      The plugin that has constructed this instance.
      Returns:
      The plugin behind its existence
    • getName

      public final String getName()
      The name of the variable.

      It is always in lower-case and follows this format: a-z, _, @, :

      Returns:
      The name
    • getValueClass

      public final Class<T> getValueClass()
      The class of the value that is being fetched.
      Returns:
      The value class that this variable returns
    • isRegistered

      public final boolean isRegistered()
      Returns whether this instance is registered.
      Returns:
      Whether it is currently registered and useable
      See Also:
    • getValue

      public abstract T getValue(Arena arena)
      Fetches the value of a local arena.

      The class of the returned object is equal to getValueClass().

      Parameters:
      arena - The local arena
      Returns:
      The given property of this current moment
    • getValue

      public abstract T getValue(RemoteArena arena)
      Fetches the value of a remote arena.

      The class of the returned object is equal to getValueClass().

      Parameters:
      arena - The remote arena
      Returns:
      The given property of this current moment