<commit_before>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);
            }
        }
    }

}
<commit_msg>Add mob armour scaling, closes #164<commit_after>package net.wayward_realms.waywardmonsters;

import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;

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) {
            EntityLevelManager entityLevelManager = plugin.getEntityLevelManager();
            int level = entityLevelManager.getEntityLevel(event.getEntity());
            if (level == 0) {
                event.setCancelled(true);
            } else {
                EntityEquipment equipment = event.getEntity().getEquipment();
                if (level > 5 && level <= 10) {
                    equipment.setHelmet(new ItemStack(Material.LEATHER_HELMET));
                    equipment.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.LEATHER_BOOTS));
                } else if (level > 10 && level <= 15) {
                    equipment.setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
                    equipment.setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
                } else if (level > 15 && level <= 20) {
                    equipment.setHelmet(new ItemStack(Material.IRON_HELMET));
                    equipment.setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.IRON_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.IRON_BOOTS));
                } else if (level > 20 && level <= 25) {
                    equipment.setHelmet(new ItemStack(Material.GOLD_HELMET));
                    equipment.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
                } else if (level > 25) {
                    equipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
                    equipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS));
                }
            }
        }
    }

}

{'fraction_non_alphanumeric': 0.09219661205220772, 'fraction_numerical': 0.006109414051652319, 'mean_word_length': 2.4936954413191077, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2774682', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1026, 'n_words': 154}