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
FieldsFields inherited from class ch.njol.skript.lang.TriggerItem
parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImportant when using this constructor: set the items withsetTriggerItems(List)!protectedTriggerSection(SectionNode node)protectedTriggerSection(List<TriggerItem> items)Reserved for new Trigger(...) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanrun(org.bukkit.event.Event e)Executes this item.setNext(@Nullable TriggerItem next)setParent(@Nullable TriggerSection parent)protected voidsetTriggerItems(List<TriggerItem> items)Remember to add this section toParserInstance.getCurrentSections()before parsing child elements!protected abstract @Nullable TriggerItemwalk(org.bukkit.event.Event e)Executes this item and returns the next item to run.protected @Nullable TriggerItemwalk(org.bukkit.event.Event e, boolean run)Methods inherited from class ch.njol.skript.lang.TriggerItem
debug, getIndentation, getNext, getParent, getTrigger, toString, walkMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
setNextin classTriggerItem
-
setParent
- Overrides:
setParentin classTriggerItem
-
run
protected final boolean run(org.bukkit.event.Event e)Description copied from class:TriggerItemExecutes this item.- Specified by:
runin classTriggerItem- Returns:
- True if the next item should be run, or false for the item following this item's parent.
-
walk
Description copied from class:TriggerItemExecutes 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:
walkin classTriggerItem- Returns:
- The next item to run or null to stop execution
-
walk
-