Class PlanetExecutors

java.lang.Object
ua.mcchickenstudio.opencreative.coding.blocks.executors.PlanetExecutors

public class PlanetExecutors extends Object

PlanetExecutors

This class represents Executors in every planet code script.
Since:
5.0
Version:
6.0
Author:
McChicken Studio
  • Field Details

    • planet

      protected final Planet planet
  • Constructor Details

    • PlanetExecutors

      public PlanetExecutors(Planet planet)
  • Method Details

    • activate

      public static void activate(@NotNull @NotNull WorldEvent event)
      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

      public static boolean canRunExecutor(@NotNull @NotNull Planet planet, @NotNull @NotNull Executor executor)
    • clear

      public void clear()
      Clears temporary data: executors list, last executors calls.
    • load

      public void load(File file)
      Loads executors from script file.
      Parameters:
      file - script file.
    • getExecutorsList

      @NotNull public @NotNull List<Executor> getExecutorsList()
    • getInsideActionsList

      @NotNull public @NotNull List<Action> getInsideActionsList(@NotNull @NotNull Action action)
      Returns list of actions inside the condition or multi action.
      Parameters:
      action - condition or multi action.
      Returns:
      list of inside actions.
    • getCyclesList

      @NotNull public @NotNull List<Cycle> getCyclesList()
      Returns list of registered cycle executors.
      Returns:
      list of cycles.
    • getFunctionsList

      @NotNull public @NotNull List<Function> getFunctionsList()
      Returns list of registered function executors.
      Returns:
      list of functions.
    • getMethodsList

      @NotNull public @NotNull List<Method> getMethodsList()
      Returns list of registered method executors.
      Returns:
      list of methods.
    • stopCode

      public void stopCode(@NotNull @NotNull String reason)
      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.