use of com.elmakers.mine.bukkit.action.builtin.CoverAction in project MagicPlugin by elBukkit.
the class LightningSpell method onCast.
@Override
public SpellResult onCast(ConfigurationSection parameters) {
Target target = getTarget();
if (target == null || !target.isValid()) {
return SpellResult.NO_TARGET;
}
Block targetBlock = target.getBlock();
if (!hasBuildPermission(targetBlock)) {
return SpellResult.INSUFFICIENT_PERMISSION;
}
CoverAction cover = new CoverAction();
cover.addAction(new LightningAction());
ActionHandler handler = new ActionHandler();
handler.loadAction(cover);
handler.initialize(this, parameters);
registerForUndo();
return handler.start(getCurrentCast(), parameters);
}
use of com.elmakers.mine.bukkit.action.builtin.CoverAction in project MagicPlugin by elBukkit.
the class FrostSpell method onCast.
@Override
public SpellResult onCast(ConfigurationSection parameters) {
Target target = getTarget();
if (target == null || !target.isValid()) {
return SpellResult.NO_TARGET;
}
Block targetBlock = target.getBlock();
if (!hasBuildPermission(targetBlock)) {
return SpellResult.INSUFFICIENT_PERMISSION;
}
CoverAction cover = new CoverAction();
cover.addAction(new FreezeAction());
cover.addAction(new DamageAction());
cover.addAction(new PotionEffectAction());
ActionHandler handler = new ActionHandler();
handler.loadAction(cover);
handler.initialize(this, parameters);
registerForUndo();
return handler.start(getCurrentCast(), parameters);
}
use of com.elmakers.mine.bukkit.action.builtin.CoverAction in project MagicPlugin by elBukkit.
the class FireSpell method onCast.
@Override
public SpellResult onCast(ConfigurationSection parameters) {
Target target = getTarget();
if (target == null || !target.isValid()) {
return SpellResult.NO_TARGET;
}
Block targetBlock = target.getBlock();
if (!hasBuildPermission(targetBlock)) {
return SpellResult.INSUFFICIENT_PERMISSION;
}
CoverAction cover = new CoverAction();
cover.addAction(new BurnAction());
ActionHandler handler = new ActionHandler();
handler.loadAction(cover);
handler.initialize(this, parameters);
registerForUndo();
return handler.start(getCurrentCast(), parameters);
}
use of com.elmakers.mine.bukkit.action.builtin.CoverAction in project MagicPlugin by elBukkit.
the class FlowerSpell method onCast.
@Override
public SpellResult onCast(ConfigurationSection parameters) {
Target target = getTarget();
if (target == null || !target.isValid()) {
return SpellResult.NO_TARGET;
}
Block targetBlock = target.getBlock();
if (!hasBuildPermission(targetBlock)) {
return SpellResult.INSUFFICIENT_PERMISSION;
}
CoverAction cover = new CoverAction();
cover.addAction(new FlowerAction());
ActionHandler handler = new ActionHandler();
handler.loadAction(cover);
handler.initialize(this, parameters);
registerForUndo();
return handler.start(getCurrentCast(), parameters);
}
Aggregations