<commit_before>package info.tregmine.listeners;

//import java.util.Random;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
//import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;

import info.tregmine.Tregmine;
import info.tregmine.api.Insult;

public class TauntListener implements Listener
{
    //private Tregmine plugin;

    public TauntListener(Tregmine instance)
    {
        //this.plugin = instance;
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event)
    {
        if (!(event instanceof PlayerDeathEvent)) {
            return;
        }

        Player player = (Player) event.getEntity();
        PlayerDeathEvent e = (PlayerDeathEvent) event;

        String death =
                ChatColor.DARK_GRAY + "DIED - " + player.getName() + " "
                        + Insult.random();

        ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
        SkullMeta meta = (SkullMeta) item.getItemMeta();
        meta.setOwner(player.getName());
        meta.setDisplayName(ChatColor.GRAY + player.getName());

        List<String> lore = new ArrayList<String>();
        lore.add(ChatColor.stripColor(e.getDeathMessage()));

        meta.setLore(lore);

        item.setItemMeta(meta);

        player.getWorld().dropItemNaturally(player.getLocation(), item);

        e.setDeathMessage(death);
    }
}<commit_msg>Update TauntListener.java<commit_after>package info.tregmine.listeners;

//import java.util.Random;

import info.tregmine.Tregmine;
import info.tregmine.api.Insult;
import info.tregmine.api.TregminePlayer;
import info.tregmine.quadtree.Point;
import info.tregmine.zones.Zone;
import info.tregmine.zones.ZoneWorld;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
//import org.bukkit.inventory.meta.ItemMeta;

public class TauntListener implements Listener
{
    private Tregmine plugin;

    public TauntListener(Tregmine instance)
    {
        this.plugin = instance;
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event)
    {
        if (!(event instanceof PlayerDeathEvent)) {
            return;
        }

        Player player = (Player) event.getEntity();
        PlayerDeathEvent e = (PlayerDeathEvent) event;

        String death =
                ChatColor.DARK_GRAY + "DIED - " + player.getName() + " "
                        + Insult.random();
        
        EntityDamageEvent damage = player.getLastDamageCause();
        DamageCause cause = damage.getCause();
        Location location = player.getLocation();
        
        Point pos = new Point(location.getBlockX(), location.getBlockZ());
        ZoneWorld world = plugin.getWorld(player.getWorld());
        TregminePlayer player2 = plugin.getPlayer(player);
        
        Zone currentZone = player2.getCurrentZone();
        if (currentZone == null || !currentZone.contains(pos)) {
            currentZone = world.findZone(pos);
            player2.setCurrentZone(currentZone);
        }
        
        if (cause == DamageCause.ENTITY_ATTACK &&
                currentZone.isPvp()) {
            
            World w = player.getWorld();
            Entity a = w.spawnEntity(player.getLocation(), EntityType.ZOMBIE);
            if(!(a instanceof Zombie)) return;
            
            ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
            SkullMeta meta = (SkullMeta) item.getItemMeta();
            meta.setOwner(player.getName());
            meta.setDisplayName(ChatColor.GRAY + player.getName());
    
            List<String> lore = new ArrayList<String>();
            lore.add(ChatColor.stripColor(e.getDeathMessage()));
            meta.setLore(lore);
    
            item.setItemMeta(meta);
            
            Zombie zomb = (Zombie) a;
            zomb.setCustomName(player.getDisplayName());
            zomb.setCustomNameVisible(true);
            
            EntityEquipment ee = zomb.getEquipment();
            ee.setHelmet(item);
            ee.setHelmetDropChance(1F);
            
            zomb.setCanPickupItems(false);
        }
        
        e.setDeathMessage(death);
    }
}
{'fraction_non_alphanumeric': 0.10941475826972011, 'fraction_numerical': 0.0015658641612840086, 'mean_word_length': 2.7055837563451774, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5661416', 'n_tokens_mistral': 1577, 'n_tokens_neox': 1499, 'n_words': 266}