use of com.elmakers.mine.bukkit.api.block.BlockList in project MagicPlugin by elBukkit.
the class TransmuteSpell method onCast.
@Override
public SpellResult onCast(ConfigurationSection parameters) {
BlockList transmuteAction = null;
/*
* Use target if targeting
*/
Block target = getTargetBlock();
if (target != null) {
UndoQueue undoQueue = mage.getUndoQueue();
transmuteAction = undoQueue.getLast(target);
}
if (transmuteAction == null) {
UndoQueue undoQueue = mage.getUndoQueue();
transmuteAction = undoQueue.getLast();
}
if (transmuteAction == null) {
return SpellResult.NO_TARGET;
}
MaterialBrush buildWith = getBrush();
for (BlockData undoBlock : transmuteAction) {
Block block = undoBlock.getBlock();
buildWith.modify(block);
}
return SpellResult.CAST;
}
Aggregations