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 togetValueClass()
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 Summary
ConstructorsConstructorDescriptionArenaConditionVariable(Plugin plugin, String name, Class<T> valueClass) Construct a new variable type. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()The name of the variable.final PluginThe plugin that has constructed this instance.getType()Returns the type of this variable.abstract TFetches the value of a local arena.abstract TgetValue(RemoteArena arena) Fetches the value of a remote arena.The class of the value that is being fetched.final booleanReturns whether this instance is registered.
-
Constructor Details
-
ArenaConditionVariable
Construct a new variable type.- Parameters:
plugin- The plugin that is constructing itname- Must be in the following format: a-z, _, @, :. It is automatically being put into lower-casevalueClass- Must be a ArenaConditionVariableTypeNumber or ArenaConditionVariableTypeSring
-
-
Method Details
-
getType
Returns the type of this variable.- Returns:
- The type
-
getPlugin
The plugin that has constructed this instance.- Returns:
- The plugin behind its existence
-
getName
The name of the variable.It is always in lower-case and follows this format: a-z, _, @, :
- Returns:
- The name
-
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
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
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
-