Support for the fishing stat

This commit is contained in:
Indyuce 2022-11-10 16:52:13 +01:00
parent cbe1a06947
commit 79932d8306

View File

@ -9,10 +9,7 @@ import net.Indyuce.mmocore.api.util.MMOCoreUtils;
import net.Indyuce.mmocore.loot.LootBuilder;
import net.Indyuce.mmocore.loot.fishing.FishingDropItem;
import net.Indyuce.mmocore.manager.profession.FishingManager.FishingDropTable;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.*;
import org.bukkit.entity.FishHook;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
@ -183,6 +180,9 @@ public class FishingListener implements Listener {
if (called.isCancelled())
return;
// Increase player statistic
player.incrementStatistic(Statistic.FISH_CAUGHT);
// Calculate yeet velocity
Item item = hook.getWorld().dropItemNaturally(hook.getLocation(), collect);
MMOCoreUtils.displayIndicator(location.add(0, 1.25, 0),