Java Code Examples for ch.njol.skript.ScriptLoader#hasDelayBefore()
The following examples show how to use
ch.njol.skript.ScriptLoader#hasDelayBefore() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleExpressionFork.java From skript-yaml with MIT License | 5 votes |
/** * {@inheritDoc} * <p> * This implementation sets the time but returns false. * * @see #setTime(int, Class, Expression...) * @see #setTime(int, Expression, Class...) */ @Override public boolean setTime(final int time) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } this.time = time; return false; }
Example 2
Source File: SimpleExpressionFork.java From skript-yaml with MIT License | 5 votes |
protected final boolean setTime(final int time, final Class<? extends Event> applicableEvent, final Expression<?>... mustbeDefaultVars) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } if (!ScriptLoader.isCurrentEvent(applicableEvent)) return false; for (final Expression<?> var : mustbeDefaultVars) { if (!var.isDefault()) { return false; } } this.time = time; return true; }
Example 3
Source File: SimpleExpressionFork.java From skript-yaml with MIT License | 5 votes |
protected final boolean setTime(final int time, final Expression<?> mustbeDefaultVar, final Class<? extends Event>... applicableEvents) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } if (!mustbeDefaultVar.isDefault()) return false; for (final Class<? extends Event> e : applicableEvents) { if (ScriptLoader.isCurrentEvent(e)) { this.time = time; return true; } } return false; }
Example 4
Source File: SimpleExpression.java From Skript with GNU General Public License v3.0 | 5 votes |
/** * {@inheritDoc} * <p> * This implementation sets the time but returns false. * * @see #setTime(int, Class, Expression...) * @see #setTime(int, Expression, Class...) */ @Override public boolean setTime(final int time) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } this.time = time; return false; }
Example 5
Source File: SimpleExpression.java From Skript with GNU General Public License v3.0 | 5 votes |
protected final boolean setTime(final int time, final Class<? extends Event> applicableEvent, final Expression<?>... mustbeDefaultVars) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } if (!ScriptLoader.isCurrentEvent(applicableEvent)) return false; for (final Expression<?> var : mustbeDefaultVars) { if (!var.isDefault()) { return false; } } this.time = time; return true; }
Example 6
Source File: SimpleExpression.java From Skript with GNU General Public License v3.0 | 5 votes |
protected final boolean setTime(final int time, final Expression<?> mustbeDefaultVar, final Class<? extends Event>... applicableEvents) { if (ScriptLoader.hasDelayBefore == Kleenean.TRUE && time != 0) { Skript.error("Can't use time states after the event has already passed"); return false; } if (!mustbeDefaultVar.isDefault()) return false; for (final Class<? extends Event> e : applicableEvents) { if (ScriptLoader.isCurrentEvent(e)) { this.time = time; return true; } } return false; }