package net.wayward_realms.waywardmonsters;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;

public class CreatureSpawnListener implements Listener {

    private WaywardMonsters plugin;

    public CreatureSpawnListener(WaywardMonsters plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onEntitySpawn(CreatureSpawnEvent event) {
        if (event.getEntity() != null) {
            if (plugin.getEntityLevelManager().getEntityLevel(event.getEntity()) == 0) {
                event.setCancelled(true);
            }
        }
    }

}

@@ -38,16 +38,44 @@
 sters;%0A%0A
+import org.bukkit.Material;%0A
 import o
@@ -100,24 +100,24 @@
 entHandler;%0A
-
 import org.b
@@ -188,16 +188,100 @@
 wnEvent;
+%0Aimport org.bukkit.inventory.EntityEquipment;%0Aimport org.bukkit.inventory.ItemStack;
 %0A%0Apublic
@@ -598,42 +598,122 @@
     
-if (plugin.getEntityLevelManager()
+EntityLevelManager entityLevelManager = plugin.getEntityLevelManager();%0A            int level = entityLevelManager
 .get
@@ -742,16 +742,39 @@
 ntity())
+;%0A            if (level
  == 0) %7B
@@ -816,16 +816,2044 @@
 (true);%0A
+            %7D else %7B%0A                EntityEquipment equipment = event.getEntity().getEquipment();%0A                if (level %3E 5 && level %3C= 10) %7B%0A                    equipment.setHelmet(new ItemStack(Material.LEATHER_HELMET));%0A                    equipment.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));%0A                    equipment.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));%0A                    equipment.setBoots(new ItemStack(Material.LEATHER_BOOTS));%0A                %7D else if (level %3E 10 && level %3C= 15) %7B%0A                    equipment.setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));%0A                    equipment.setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));%0A                    equipment.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));%0A                    equipment.setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));%0A                %7D else if (level %3E 15 && level %3C= 20) %7B%0A                    equipment.setHelmet(new ItemStack(Material.IRON_HELMET));%0A                    equipment.setChestplate(new ItemStack(Material.IRON_CHESTPLATE));%0A                    equipment.setLeggings(new ItemStack(Material.IRON_LEGGINGS));%0A                    equipment.setBoots(new ItemStack(Material.IRON_BOOTS));%0A                %7D else if (level %3E 20 && level %3C= 25) %7B%0A                    equipment.setHelmet(new ItemStack(Material.GOLD_HELMET));%0A                    equipment.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));%0A                    equipment.setLeggings(new ItemStack(Material.GOLD_LEGGINGS));%0A                    equipment.setBoots(new ItemStack(Material.GOLD_BOOTS));%0A                %7D else if (level %3E 25) %7B%0A                    equipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));%0A                    equipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));%0A                    equipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));%0A                    equipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS));%0A                %7D%0A
         

Add mob armour scaling, closes #164