diff --git a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/FishingLootHandler.java b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/FishingLootHandler.java index 9df92261a..f399737c1 100644 --- a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/FishingLootHandler.java +++ b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/FishingLootHandler.java @@ -8,8 +8,6 @@ import dev.aurelium.auraskills.api.source.XpSource; import dev.aurelium.auraskills.api.source.type.FishingXpSource; import dev.aurelium.auraskills.bukkit.AuraSkills; -import dev.aurelium.auraskills.bukkit.hooks.WorldGuardFlags.FlagKey; -import dev.aurelium.auraskills.bukkit.hooks.WorldGuardHook; import dev.aurelium.auraskills.api.loot.Loot; import dev.aurelium.auraskills.api.loot.LootPool; import dev.aurelium.auraskills.api.loot.LootTable; @@ -43,12 +41,7 @@ public FishingLootHandler(AuraSkills plugin) { public void onFish(PlayerFishEvent event) { Player player = event.getPlayer(); - if (plugin.getWorldManager().isInBlockedWorld(player.getLocation())) { - return; - } - if (plugin.getHookManager().isRegistered(WorldGuardHook.class)) { - plugin.getHookManager().getHook(WorldGuardHook.class).isBlocked(player.getLocation(), player, FlagKey.CUSTOM_LOOT); - } + if (failsChecks(player, player.getLocation())) return; if (!(event.getCaught() instanceof Item)) return; if (!event.getState().equals(PlayerFishEvent.State.CAUGHT_FISH)) return; diff --git a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/LootHandler.java b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/LootHandler.java index 3c4b7d000..e4ea07045 100644 --- a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/LootHandler.java +++ b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/handler/LootHandler.java @@ -194,6 +194,13 @@ protected Loot selectLoot(LootPool pool, @NotNull LootContext providedContext) { } private void giveXp(Player player, Loot loot, @Nullable XpSource source, Skill skill) { + if (plugin.getHookManager().isRegistered(WorldGuardHook.class)) { + // Check generic xp-gain and skill-specific flags + if (plugin.getHookManager().getHook(WorldGuardHook.class).isBlocked(player.getLocation(), player, skill)) { + return; + } + } + User user = plugin.getUser(player); Object xpObj = loot.getValues().getOptions().get("xp");