Package ch.njol.skript.lang
Class TriggerSection
java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.TriggerSection
- All Implemented Interfaces:
Debuggable
Represents a section of a trigger, e.g. a conditional or a loop
-
Field Summary
Fields inherited from class ch.njol.skript.lang.TriggerItem
parent
-
Constructor Summary
ModifierConstructorDescriptionprotected
Important when using this constructor: set the items withsetTriggerItems(List)
!protected
TriggerSection
(SectionNode node) protected
TriggerSection
(List<TriggerItem> items) Reserved for new Trigger(...) -
Method Summary
Modifier and TypeMethodDescriptionprotected final boolean
run
(org.bukkit.event.Event event) Executes this item.setNext
(@Nullable TriggerItem next) setParent
(@Nullable TriggerSection parent) protected void
setTriggerItems
(List<TriggerItem> items) Remember to add this section toParserInstance.getCurrentSections()
before parsing child elements!protected abstract @Nullable TriggerItem
walk
(org.bukkit.event.Event event) Executes this item and returns the next item to run.protected final @Nullable TriggerItem
walk
(org.bukkit.event.Event event, boolean run) Methods inherited from class ch.njol.skript.lang.TriggerItem
debug, getIndentation, getNext, getParent, getTrigger, toString, walk
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString
-
Field Details
-
first
-
last
-
-
Constructor Details
-
TriggerSection
Reserved for new Trigger(...) -
TriggerSection
-
TriggerSection
protected TriggerSection()Important when using this constructor: set the items withsetTriggerItems(List)
!
-
-
Method Details
-
setTriggerItems
Remember to add this section toParserInstance.getCurrentSections()
before parsing child elements!ScriptLoader.currentSections.add(this); setTriggerItems(ScriptLoader.loadItems(node)); ScriptLoader.currentSections.remove(ScriptLoader.currentSections.size() - 1);
-
setNext
- Overrides:
setNext
in classTriggerItem
-
setParent
- Overrides:
setParent
in classTriggerItem
-
run
protected final boolean run(org.bukkit.event.Event event) Description copied from class:TriggerItem
Executes this item.- Specified by:
run
in classTriggerItem
- Parameters:
event
- The event to run this item with- Returns:
- True if the next item should be run, or false for the item following this item's parent.
-
walk
Description copied from class:TriggerItem
Executes this item and returns the next item to run.Overriding classes must call
TriggerItem.debug(Event, boolean)
. If this method is overridden,TriggerItem.run(Event)
is not used anymore and can be ignored.- Overrides:
walk
in classTriggerItem
- Parameters:
event
- The event- Returns:
- The next item to run or null to stop execution
-
walk
-