@Override
public SpellResult perform(CastContext context) {
Block block = context.getTargetBlock();
if (breakBlocks && !context.hasBreakPermission(block))
{
return SpellResult.INSUFFICIENT_PERMISSION;
}
if (useFire && !context.hasBuildPermission(block))
{
return SpellResult.INSUFFICIENT_PERMISSION;
}
Entity entity = context.getEntity();
Location location = block.getLocation();
UndoList currentList = com.elmakers.mine.bukkit.block.UndoList.getUndoList(entity);
com.elmakers.mine.bukkit.block.UndoList.setUndoList(context.getPlugin(), entity, context.getUndoList());
NMSUtils.createExplosion(entity, location.getWorld(), location.getX(), location.getY(), location.getZ(), size, useFire, breakBlocks);
com.elmakers.mine.bukkit.block.UndoList.setUndoList(context.getPlugin(), entity, currentList);
return SpellResult.CAST;
}