Class Condition

java.lang.Object
ua.mcchickenstudio.opencreative.coding.blocks.actions.Action
ua.mcchickenstudio.opencreative.coding.blocks.conditions.Condition
All Implemented Interfaces:
CodingBlock
Direct Known Subclasses:
EntityCondition, PlayerCondition, VariableCondition, WorldCondition

public abstract class Condition extends Action
  • Constructor Details

    • Condition

      public Condition(Executor executor, Target target, int x, Arguments args, List<Action> actions, List<Action> reactions, boolean isOpposed)
      Creates a Condition with linked executor and specified arguments.
      Parameters:
      executor - Executor where this action will be added.
      x - X from Action's block location in developers planet.
      args - List of arguments for action.
  • Method Details

    • check

      public abstract boolean check(org.bukkit.entity.Entity entity)
    • prepareAndExecute

      public final void prepareAndExecute(@NotNull @NotNull ActionsHandler handler)
      Description copied from class: Action
      Prepares action for executing, sets handler and event, and executes action with target.
      Overrides:
      prepareAndExecute in class Action
      Parameters:
      handler - ActionsHandler that stores event data and temporary variables.
    • execute

      protected void execute(org.bukkit.entity.Entity entity)
      Description copied from class: Action
      Executes action with specified entity.
      Specified by:
      execute in class Action
      Parameters:
      entity - Entity to execute action.
    • getActionCategory

      @NotNull public abstract @NotNull ActionCategory getActionCategory()
      Description copied from class: Action
      Returns category of action, that contains information about action: glass pane materials, block materials.
      Specified by:
      getActionCategory in class Action
      Returns:
      Category of action.
    • getActions

      public List<Action> getActions()
    • getElseActions

      public List<Action> getElseActions()
    • isOpposed

      public boolean isOpposed()
    • getEventValue

      @Nullable protected @Nullable Object getEventValue(@NotNull @NotNull Class<? extends EventValue> clazz)