Package ch.njol.skript.lang
Class TriggerItem
java.lang.Object
ch.njol.skript.lang.TriggerItem
- All Implemented Interfaces:
Debuggable
- Direct Known Subclasses:
Statement
,TriggerSection
Represents a trigger item, i.e. a trigger section, a condition or an effect.
- See Also:
TriggerSection
,Trigger
,Statement
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
debug(org.bukkit.event.Event e, boolean run)
@Nullable TriggerItem
getNext()
@Nullable TriggerSection
@Nullable Trigger
protected abstract boolean
run(org.bukkit.event.Event e)
Executes this item.setNext(@Nullable TriggerItem next)
setParent(@Nullable TriggerSection parent)
toString()
Should returntoString
(null, false)static boolean
walk(TriggerItem start, org.bukkit.event.Event e)
protected @Nullable TriggerItem
walk(org.bukkit.event.Event e)
Executes this item and returns the next item to run.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
-
parent
-
-
Constructor Details
-
TriggerItem
protected TriggerItem() -
TriggerItem
-
-
Method Details
-
walk
Executes this item and returns the next item to run.Overriding classes must call
debug(Event, boolean)
. If this method is overridden,run(Event)
is not used anymore and can be ignored.- Parameters:
e
-- Returns:
- The next item to run or null to stop execution
-
run
protected abstract boolean run(org.bukkit.event.Event e)Executes this item.- Parameters:
e
-- Returns:
- True if the next item should be run, or false for the item following this item's parent.
-
walk
- Parameters:
start
-e
-- Returns:
- false if an exception occurred
-
getIndentation
-
debug
protected final void debug(org.bukkit.event.Event e, boolean run) -
toString
Description copied from interface:Debuggable
Should returntoString
(null, false)- Specified by:
toString
in interfaceDebuggable
- Overrides:
toString
in classObject
-
setParent
-
getParent
-
getTrigger
- Returns:
- The trigger this item belongs to, or null if this is a stand-alone item (e.g. the effect of an effect command)
-
setNext
-
getNext
-