package com.elmakers.mine.bukkit.magicworlds.spawn.builtin;

import com.elmakers.mine.bukkit.entity.EntityData;
import com.elmakers.mine.bukkit.magicworlds.MagicWorldsController;
import com.elmakers.mine.bukkit.magicworlds.spawn.SpawnRule;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.plugin.Plugin;

public class EquipmentRule extends SpawnRule {
    protected EntityData equipment;

    @Override
    public boolean load(String key, ConfigurationSection parameters, MagicWorldsController controller)
    {
    	if (!super.load(key, parameters, controller)) return false;
        equipment = new EntityData(controller.getMagic().getController(), parameters);
        controller.getLogger().info(" Replacing equipment of : " + targetEntityType.name() + " at y > " + minY
                + " at a " + (percentChance * 100) + "% chance");
        return true;
    }

    protected void setEquipment(LivingEntity entity) {
        equipment.copyEquipmentTo(entity);
    }

    @Override
    public LivingEntity onProcess(Plugin plugin, LivingEntity entity) {
        setEquipment(entity);
        return null;
    }
}

@@ -153,144 +153,23 @@
 lds.
-MagicWorldsController;%0Aimport com.elmakers.mine.bukkit.magicworlds.spawn.SpawnRule;%0Aimport org.bukkit.configuration.ConfigurationSection
+spawn.SpawnRule
 ;%0Aim
@@ -352,170 +352,49 @@
 lic 
-boolean load(String key, ConfigurationSection parameters, MagicWorldsController controller)%0A    %7B%0A    %09if (!super.load(key, parameters, controller)) return false;
+void finalizeLoad(String worldName)%0A    %7B
 %0A   
@@ -658,29 +658,8 @@
 %22);%0A
-        return true;%0A
     

Fix load-issue order with EquipmentRule and Magic dependency