package com.elmakers.mine.bukkit.action.builtin;

import com.elmakers.mine.bukkit.api.action.EntityAction;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import com.elmakers.mine.bukkit.spell.BaseSpellAction;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;

public class IgniteAction extends BaseSpellAction implements EntityAction
{
	@Override
	public SpellResult perform(ConfigurationSection parameters, Entity entity)
	{
		if (!(entity instanceof LivingEntity))
		{
			return SpellResult.NO_TARGET;
		}

        int duration = parameters.getInt("duration", 5000);
        int ticks = duration * 20 / 1000;
        LivingEntity targetEntity = (LivingEntity)entity;

        registerModified(targetEntity);
        targetEntity.setFireTicks(ticks);

		return SpellResult.CAST;
	}

	@Override
	public boolean isUndoable()
	{
		return true;
	}
}

@@ -507,91 +507,8 @@
 %0A%09%7B%0A
-%09%09if (!(entity instanceof LivingEntity))%0A%09%09%7B%0A%09%09%09return SpellResult.NO_TARGET;%0A%09%09%7D%0A%0A
     
@@ -608,66 +608,8 @@
 000;
-%0A        LivingEntity targetEntity = (LivingEntity)entity;
 %0A%0A  
@@ -631,23 +631,17 @@
 odified(
-targetE
+e
 ntity);%0A
@@ -652,15 +652,9 @@
     
-targetE
+e
 ntit

Streamline IgniteAction