Skooldown/src/lt/govindas/skooldown/Skooldown.java

38 lines
1.5 KiB
Java
Raw Normal View History

2020-02-15 15:39:44 +00:00
package lt.govindas.skooldown;
import ch.njol.skript.Skript;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.util.Timespan;
2020-02-16 15:13:31 +00:00
import lt.govindas.skooldown.conditions.CondIsCooldownOver;
2020-02-24 18:13:11 +00:00
import lt.govindas.skooldown.effects.EffEndCooldown;
2020-02-15 15:39:44 +00:00
import lt.govindas.skooldown.effects.EffStartCooldown;
import lt.govindas.skooldown.expressions.ExprCooldown;
2020-02-16 15:13:31 +00:00
import lt.govindas.skooldown.utilities.CleanupTimer;
2020-02-15 15:39:44 +00:00
import org.bukkit.plugin.java.JavaPlugin;
2020-02-15 15:39:44 +00:00
import java.util.HashMap;
public final class Skooldown extends JavaPlugin {
public static HashMap<String, Long> cooldowns = new HashMap<String, Long>();
@Override
public void onEnable() {
Skript.registerAddon(this);
Skript.registerEffect(EffStartCooldown.class, "(create|start) [a] cooldown %string% for %timespan%", "(create|start) [a] cooldown %string% for %timespan%");
2020-02-24 18:13:11 +00:00
Skript.registerEffect(EffEndCooldown.class, "(reset|stop|delete|clear) cooldown %string%");
2020-02-24 18:13:11 +00:00
Skript.registerCondition(CondIsCooldownOver.class, "cooldown %string% (is|has) (finished|over|done)", "cooldown %string% is(n't| not) unfinished)", "cooldown %string% is(n't| not) (finished|over|done)", "cooldown %string% is unfinished");
Skript.registerExpression(ExprCooldown.class, Timespan.class, ExpressionType.PROPERTY, "cooldown %string%");
2020-04-24 06:27:20 +00:00
getLogger().info("Skript addon enabled!");
2020-02-16 15:13:31 +00:00
new CleanupTimer();
2020-02-15 15:39:44 +00:00
}
@Override
public void onDisable() {
getLogger().info("Skript addon disabled!");
2020-02-15 15:39:44 +00:00
}
}