<commit_before>package de.iani.cubequest.quests;

import de.iani.cubequest.PlayerData;
import de.iani.cubequest.Reward;
import de.iani.cubequest.questStates.AmountQuestState;
import de.iani.cubequest.questStates.QuestState;
import de.iani.cubequest.questStates.QuestState.Status;
import de.iani.cubequest.util.ChatAndTextUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.entity.Item;
import org.bukkit.event.player.PlayerFishEvent;

@DelegateDeserialization(Quest.class)
public class FishingQuest extends MaterialsAndAmountQuest {
    
    public FishingQuest(int id, String name, String displayMessage, String giveMessage,
            String successMessage, Reward successReward, Collection<Material> types, int amount) {
        super(id, name, displayMessage, giveMessage, successMessage, successReward, types, amount);
    }
    
    public FishingQuest(int id) {
        this(id, null, null, null, null, null, null, 0);
    }
    
    @Override
    public boolean onPlayerFishEvent(PlayerFishEvent event, QuestState state) {
        if (!(event.getCaught() instanceof Item)) {
            return false;
        }
        Item item = (Item) event.getCaught();
        if (!getTypes().contains(item.getItemStack().getType())) {<commit_msg>Fix bug with items counted as fished when pulled with a fishing rod.<commit_after>package de.iani.cubequest.quests;

import de.iani.cubequest.PlayerData;
import de.iani.cubequest.Reward;
import de.iani.cubequest.questStates.AmountQuestState;
import de.iani.cubequest.questStates.QuestState;
import de.iani.cubequest.questStates.QuestState.Status;
import de.iani.cubequest.util.ChatAndTextUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.entity.Item;
import org.bukkit.event.player.PlayerFishEvent;
import org.bukkit.event.player.PlayerFishEvent.State;

@DelegateDeserialization(Quest.class)
public class FishingQuest extends MaterialsAndAmountQuest {
    
    public FishingQuest(int id, String name, String displayMessage, String giveMessage,
            String successMessage, Reward successReward, Collection<Material> types, int amount) {
        super(id, name, displayMessage, giveMessage, successMessage, successReward, types, amount);
    }
    
    public FishingQuest(int id) {
        this(id, null, null, null, null, null, null, 0);
    }
    
    @Override
    public boolean onPlayerFishEvent(PlayerFishEvent event, QuestState state) {
        if (event.getState() != State.CAUGHT_FISH) {
            return false;
        }
        if (!(event.getCaught() instanceof Item)) {
            return false;
        }
        Item item = (Item) event.getCaught();
        if (!getTypes().contains(item.getItemStack().getType())) {
{'fraction_non_alphanumeric': 0.10313075506445672, 'fraction_numerical': 0.0024554941682013503, 'mean_word_length': 4.231139646869984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '253280', 'n_tokens_mistral': 1003, 'n_tokens_neox': 990, 'n_words': 209}