<commit_before>package en.twebor.mobmasks.maskeffects;

import en.twebor.mobmasks.utils.MaskUtils;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.util.Vector;

public class MaskSkeleton {
    private int[] bonusArrows;
    private int[] bonusArrowsChance;
    private float[] bonusArrowSpread;
    private float arrowSpeed;
    private Player player;

    public MaskSkeleton(Player player,int[] bonusArrows, int[] bonusArrowsChance, float[] bonusArrowSpread,
                        float arrowSpeed) {
        this.bonusArrows = bonusArrows;
        this.bonusArrowsChance = bonusArrowsChance;
        this.bonusArrowSpread = bonusArrowSpread;
        this.arrowSpeed = arrowSpeed;
        this.player = player;
    }

    public void multishot() {
        // helmet has already been checked to be valid in the isValidMask method in the listener.
        ItemStack helmet = player.getInventory().getHelmet();
        // If helmet does not have Meta, cancels.
        if (!helmet.hasItemMeta()) {
            return;
        }
        SkullMeta helmMeta = (SkullMeta) helmet.getItemMeta();
        if (MaskUtils.willTrigger(helmMeta, bonusArrowsChance)) {
            Location eyeLoc = player.getEyeLocation();
            World world = eyeLoc.getWorld();
            Vector direction = eyeLoc.getDirection();
            Location newLoc = eyeLoc.add(direction);
            for (int i = 0; i < bonusArrows[MaskUtils.getTier(helmMeta)] ; i++) {
                // Prevents arrows from spawning within each other.
                newLoc = newLoc.add(0, 0.1, 0);
                world.spawnArrow(newLoc, direction, arrowSpeed, bonusArrowSpread[MaskUtils.getTier(helmMeta)]);
            }
        }
    }
}
<commit_msg>Disabled picking up of bonus arrows. Also set shooter as the player who shot the original arrow.<commit_after>package en.twebor.mobmasks.maskeffects;

import en.twebor.mobmasks.utils.MaskUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.util.Vector;

public class MaskSkeleton {
    private int[] bonusArrows;
    private int[] bonusArrowsChance;
    private float[] bonusArrowSpread;
    private float arrowSpeed;
    private Player player;

    public MaskSkeleton(Player player,int[] bonusArrows, int[] bonusArrowsChance, float[] bonusArrowSpread,
                        float arrowSpeed) {
        this.bonusArrows = bonusArrows;
        this.bonusArrowsChance = bonusArrowsChance;
        this.bonusArrowSpread = bonusArrowSpread;
        this.arrowSpeed = arrowSpeed;
        this.player = player;
    }

    public void multishot() {
        // helmet has already been checked to be valid in the isValidMask method in the listener.
        ItemStack helmet = player.getInventory().getHelmet();
        // If helmet does not have Meta, cancels.
        if (!helmet.hasItemMeta()) {
            return;
        }
        SkullMeta helmMeta = (SkullMeta) helmet.getItemMeta();
        if (MaskUtils.willTrigger(helmMeta, bonusArrowsChance)) {
            Location eyeLoc = player.getEyeLocation();
            World world = eyeLoc.getWorld();
            Vector direction = eyeLoc.getDirection();
            Location newLoc = eyeLoc.add(direction);
            for (int i = 0; i < bonusArrows[MaskUtils.getTier(helmMeta)] ; i++) {
                // Prevents arrows from spawning within each other.
                newLoc = newLoc.add(0, 0.1, 0);
                Arrow arrow = world.spawnArrow(newLoc, direction, arrowSpeed,
                        bonusArrowSpread[MaskUtils.getTier(helmMeta)]);
                arrow.setPickupStatus(Arrow.PickupStatus.DISALLOWED);
                arrow.setShooter(player);
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.09383578737209883, 'fraction_numerical': 0.0024956326428749688, 'mean_word_length': 2.6140667267808837, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2363637', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1166, 'n_words': 276}