Class PlanetExecutors
java.lang.Object
ua.mcchickenstudio.opencreative.coding.blocks.executors.PlanetExecutors
PlanetExecutors
This class represents Executors in every planet code script.- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidactivate(@NotNull WorldEvent event) Finds executor for world event and activates it, if found.static voidactivate(@NotNull Executor executor, @NotNull WorldEvent event) Calls executor that executes actions.static booleancanRunExecutor(@NotNull Planet planet, @NotNull Executor executor) voidclear()Clears temporary data: executors list, last executors calls.intReturns amount of actions and conditions.Returns list of registered cycle executors.intReturns amount of executors.Returns list of registered function executors.getInsideActionsList(@NotNull Action action) Returns list of actions inside the condition or multi action.Returns list of registered method executors.voidLoads executors from script file.voidStops code in planet by setting its mode to Build and sends log in console.
-
Field Details
-
planet
-
-
Constructor Details
-
PlanetExecutors
-
-
Method Details
-
activate
Finds executor for world event and activates it, if found.- Parameters:
event- event to activate executor.
-
activate
public static void activate(@NotNull @NotNull Executor executor, @NotNull @NotNull WorldEvent event) Calls executor that executes actions.- Parameters:
executor- executor to call.event- event of executor.
-
canRunExecutor
-
clear
public void clear()Clears temporary data: executors list, last executors calls. -
load
Loads executors from script file.- Parameters:
file- script file.
-
getExecutorsList
-
getInsideActionsList
Returns list of actions inside the condition or multi action.- Parameters:
action- condition or multi action.- Returns:
- list of inside actions.
-
getCyclesList
Returns list of registered cycle executors.- Returns:
- list of cycles.
-
getFunctionsList
Returns list of registered function executors.- Returns:
- list of functions.
-
getMethodsList
Returns list of registered method executors.- Returns:
- list of methods.
-
getExecutorsAmount
public int getExecutorsAmount()Returns amount of executors.- Returns:
- amount of executors.
-
getActionsAmount
public int getActionsAmount()Returns amount of actions and conditions.- Returns:
- amount of actions and conditions.
-
stopCode
Stops code in planet by setting its mode to Build and sends log in console. Doesn't call quit events.- Parameters:
reason- reason of stopping the code.
-