Class LoopSection

All Implemented Interfaces:
Debuggable, SectionExitHandler, SyntaxElement

public abstract class LoopSection extends Section implements SyntaxElement, Debuggable, SectionExitHandler
Represents a loop section.
See Also:
  • SecWhile
  • SecLoop
  • Field Details

    • currentLoopCounter

      protected final transient Map<org.bukkit.event.Event,Long> currentLoopCounter
  • Constructor Details

    • LoopSection

      public LoopSection()
  • Method Details

    • getLoopCounter

      public long getLoopCounter(org.bukkit.event.Event event)
      Parameters:
      event - The event where the loop is used to return its loop iterations
      Returns:
      The loop iteration number
    • getActualNext

      public abstract TriggerItem getActualNext()
      Description copied from class: TriggerItem
      This method guarantees to return next TriggerItem after this item. This is not always the case for TriggerItem.getNext(), for example, getNext() of a loop section usually returns itself.
      Overrides:
      getActualNext in class TriggerItem
      Returns:
      The next TriggerItem after the loop
    • exit

      public void exit(org.bukkit.event.Event event)
      Exit the loop, used to reset the loop properties such as iterations counter
      Specified by:
      exit in interface SectionExitHandler
      Parameters:
      event - The event where the loop is used to reset its relevant properties