Class EventValue
java.lang.Object
ua.mcchickenstudio.opencreative.coding.values.EventValue
- All Implemented Interfaces:
ExtensionContent
- Direct Known Subclasses:
BooleanEventValue,ItemEventValue,ListEventValue,LocationEventValue,NumberEventValue,TextEventValue,TransferKeyValue,VectorEventValue
EventValue
This class represents a value, that can be got from event, actions handler, action and target.
To create custom event value create a class,
that extends one of prepared: TextEventValue,
NumberEventValue, VectorEventValue,
LocationEventValue, ItemEventValue,
BooleanEventValue and register with
EventValues.registerEventValue(EventValue).
-
Constructor Summary
ConstructorsConstructorDescriptionEventValue(@NotNull String id, @NotNull org.bukkit.inventory.ItemStack displayIcon, @NotNull MenusCategory category) Constructor of event value. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull MenusCategoryReturns a category, that event value belongs to.@NotNull org.bukkit.inventory.ItemStackReturns an icon that will be used in event values menus.final @NotNull StringgetID()Returns id of event value, that will be used to find it in registry.@NotNull StringReturns localized name of event value, that will be used in menus.@NotNull StringgetName()Returns name of event value for displaying in registry by converting id.abstract @Nullable ObjectgetValue(@NotNull ActionsHandler handler, @NotNull Action action, @Nullable org.bukkit.entity.Entity entity) Returns a value that will be set instead of event value name tag item.inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ua.mcchickenstudio.opencreative.coding.ExtensionContent
getDescription, getExtensionId
-
Constructor Details
-
Method Details
-
getDisplayIcon
@NotNull public @NotNull org.bukkit.inventory.ItemStack getDisplayIcon()Returns an icon that will be used in event values menus.- Returns:
- icon of event value to display.
-
getCategory
Returns a category, that event value belongs to.- Returns:
- category where event value will be able.
-
getValue
@Nullable public abstract @Nullable Object getValue(@NotNull @NotNull ActionsHandler handler, @NotNull @NotNull Action action, @Nullable @Nullable org.bukkit.entity.Entity entity) Returns a value that will be set instead of event value name tag item.- Parameters:
handler- handler of action to get value.action- action to get value.entity- entity to get value, can be null.- Returns:
- string, number, boolean, item, location, vector, or null.
-
getName
Returns name of event value for displaying in registry by converting id. Not used in menus.- Specified by:
getNamein interfaceExtensionContent- Returns:
- display name of event value.
-
getID
Returns id of event value, that will be used to find it in registry.- Returns:
- id of event value.
-
getLocaleName
Returns localized name of event value, that will be used in menus.- Returns:
- localized name.
-
hashCode
public int hashCode() -
equals
-