Class Executors
java.lang.Object
ua.mcchickenstudio.opencreative.coding.blocks.executors.Executors
Executors
This class represents registry of executors, that can register new executors for coding.
To get instance use getInstance().
To add custom executor create a class, that
extends one of prepared: PlayerExecutor,
WorldExecutor,
EntityExecutor, and register it with
registerExecutor(Executor) method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if executor with specified class exists in registry.booleanChecks if executor with specified ID exists in registry.@Nullable ExecutorgetByBlock(@NotNull org.bukkit.block.Block block) Returns executor from registry by specified block if it exists, otherwise will return null.getByCategories(@NotNull ExecutorCategory executorCategory, @NotNull MenusCategory menusCategory) Returns list of executors, that have same menu category.@Nullable ExecutorgetByClass(@NotNull Class<? extends Executor> clazz) Returns executor from registry by specified class if it exists, otherwise will return null.@Nullable ExecutorReturns executor from registry by specified id if it exists, otherwise will return null.@NotNull List<MenusCategory> getCategories(@NotNull ExecutorCategory executorCategory) Returns list of all menu categories of specified executor category..Returns a copy of list that contains all registered executors.static @NotNull ExecutorsReturns instance of executors controller class.voidregisterExecutor(@NotNull Executor executor) Registers executor, that will be replaced in coding.voidregisterExecutor(@NotNull Executor... executors) Registers executors, that will be replaced in coding.voidunregisterExecutor(@NotNull Executor executor) Unregisters executor if list contains it.
-
Constructor Details
-
Executors
public Executors()
-
-
Method Details
-
getInstance
Returns instance of executors controller class.- Returns:
- instance of executors.
-
registerExecutor
Registers executor, that will be replaced in coding.- Parameters:
executor- executor to register.
-
registerExecutor
Registers executors, that will be replaced in coding.- Parameters:
executors- executors to register.
-
unregisterExecutor
Unregisters executor if list contains it.- Parameters:
executor- executor to unregister.
-
getExecutors
-
getCategories
@NotNull public @NotNull List<MenusCategory> getCategories(@NotNull @NotNull ExecutorCategory executorCategory) Returns list of all menu categories of specified executor category..- Parameters:
executorCategory- executor category.- Returns:
- list of menu categories.
-
exists
Checks if executor with specified ID exists in registry.- Parameters:
id- id of executor.- Returns:
- true - exists, false - not exists.
-
exists
-
getByClass
-
getById
-
getByBlock
Returns executor from registry by specified block if it exists, otherwise will return null.- Parameters:
block- block to get executor.- Returns:
- executor - if exists, or null - not exists.
-