<commit_before>package me.Ninjoh.BattleEffects;

import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Skull;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;


public class bloodListener implements Listener
{
    FileConfiguration config = me.Ninjoh.BattleEffects.Main.plugin.getConfig();


    @EventHandler(priority= EventPriority.NORMAL)
    public void onPlayerDeathEvent(PlayerDeathEvent e)
    {
        if (config.getBoolean("enableLeavingBehindPlayerHeadOnDeath"))
        {

            // Get player
            Player p = e.getEntity();


            String skullOwner = p.getName();

            Location deathLocation = p.getLocation();

            // Place the player's skull on player's death location...
            deathLocation.getBlock().setType(Material.SKULL);
            deathLocation.getBlock().setData((byte) 1);
            Skull s = (Skull) deathLocation.getBlock().getState();
            s.setOwner(skullOwner);
            s.update();
        }
    }

    @EventHandler(priority= EventPriority.NORMAL)
    public void onEntityDamageByEntityEvent (EntityDamageByEntityEvent e)
    {
        if (e.getEntity() instanceof Player)
        {
            // Cast Event Entitiy to Player object.
            Player p = (Player)e.getEntity();


            // Show blood particle effect if enabled in config.
            if(config.getBoolean("enableBloodParticleEffect"))
            {
                // Show redstone block blood effect.
                p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK);
            }


            // Leave behind blood if enabled in config.
            if(config.getBoolean("enableLeavingBehindBlood"))
            {
                // Chance to leave blood behind, percentage in int.
                if (Chance(config.getInt("chanceToLeaveBehindBloodOnHit"))) {
                    // Prepare blockdata
                    Byte blockData = 0x0;

                    // If random chance is true leave blood behind
                    p.getLocation().getWorld().spawnFallingBlock(p.getLocation(), Material.REDSTONE_WIRE, blockData).setDropItem(false);
                }
            }
        }
    }<commit_msg>Changed event priority to LOWEST<commit_after>package me.Ninjoh.BattleEffects;

import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Skull;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;


public class bloodListener implements Listener
{
    FileConfiguration config = me.Ninjoh.BattleEffects.Main.plugin.getConfig();


    @EventHandler(priority= EventPriority.LOWEST)
    public void onPlayerDeathEvent(PlayerDeathEvent e)
    {
        if (config.getBoolean("enableLeavingBehindPlayerHeadOnDeath"))
        {

            // Get player
            Player p = e.getEntity();


            String skullOwner = p.getName();

            Location deathLocation = p.getLocation();

            // Place the player's skull on player's death location...
            deathLocation.getBlock().setType(Material.SKULL);
            deathLocation.getBlock().setData((byte) 1);
            Skull s = (Skull) deathLocation.getBlock().getState();
            s.setOwner(skullOwner);
            s.update();
        }
    }

    @EventHandler(priority= EventPriority.LOWEST)
    public void onEntityDamageByEntityEvent (EntityDamageByEntityEvent e)
    {
        if (e.getEntity() instanceof Player)
        {
            // Cast Event Entitiy to Player object.
            Player p = (Player)e.getEntity();


            // Show blood particle effect if enabled in config.
            if(config.getBoolean("enableBloodParticleEffect"))
            {
                // Show redstone block blood effect.
                p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK);
            }


            // Leave behind blood if enabled in config.
            if(config.getBoolean("enableLeavingBehindBlood"))
            {
                // Chance to leave blood behind, percentage in int.
                if (Chance(config.getInt("chanceToLeaveBehindBloodOnHit"))) {
                    // Prepare blockdata
                    Byte blockData = 0x0;

                    // If random chance is true leave blood behind
                    p.getLocation().getWorld().spawnFallingBlock(p.getLocation(), Material.REDSTONE_WIRE, blockData).setDropItem(false);
                }
            }
        }
    }
{'fraction_non_alphanumeric': 0.09661453177588597, 'fraction_numerical': 0.001187883587408434, 'mean_word_length': 2.2869225764476253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7520870', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1323, 'n_words': 282}