use of com.elmakers.mine.bukkit.action.builtin.FreezeAction 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);
}
Aggregations