mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-03 18:33:16 +01:00
Vanilla xp bonus should actually be in beginFishing()
or at least be called by beginFishing()
This commit is contained in:
parent
13a65e875f
commit
8b514d631c
@ -92,8 +92,7 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
case CAUGHT_FISH:
|
case CAUGHT_FISH:
|
||||||
Fishing.beginFishing(player, skillLevel, (Item) event.getCaught());
|
Fishing.beginFishing(player, skillLevel, event);
|
||||||
event.setExpToDrop(event.getExpToDrop() * Fishing.getVanillaXpMultiplier(skillLevel));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAUGHT_ENTITY:
|
case CAUGHT_ENTITY:
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Item;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||||
|
import org.bukkit.event.player.PlayerFishEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
@ -104,9 +105,9 @@ public final class Fishing {
|
|||||||
*
|
*
|
||||||
* @param player Player fishing
|
* @param player Player fishing
|
||||||
* @param skillLevel Fishing level of the player
|
* @param skillLevel Fishing level of the player
|
||||||
* @param caught Item reeled
|
* @param event Event to process
|
||||||
*/
|
*/
|
||||||
public static void beginFishing(Player player, int skillLevel, Item caught) {
|
public static void beginFishing(Player player, int skillLevel, PlayerFishEvent event) {
|
||||||
int treasureXp = 0;
|
int treasureXp = 0;
|
||||||
FishingTreasure treasure = checkForTreasure(player, skillLevel);
|
FishingTreasure treasure = checkForTreasure(player, skillLevel);
|
||||||
|
|
||||||
@ -121,11 +122,13 @@ public final class Fishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Drop the original catch at the feet of the player and set the treasure as the real catch
|
// Drop the original catch at the feet of the player and set the treasure as the real catch
|
||||||
|
Item caught = (Item) event.getCaught();
|
||||||
Misc.dropItem(player.getEyeLocation(), caught.getItemStack());
|
Misc.dropItem(player.getEyeLocation(), caught.getItemStack());
|
||||||
caught.setItemStack(treasureDrop);
|
caught.setItemStack(treasureDrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillTools.xpProcessing(player, Users.getProfile(player), SkillType.FISHING, Config.getInstance().getFishingBaseXP() + treasureXp);
|
SkillTools.xpProcessing(player, Users.getProfile(player), SkillType.FISHING, Config.getInstance().getFishingBaseXP() + treasureXp);
|
||||||
|
event.setExpToDrop(event.getExpToDrop() * Fishing.getVanillaXpMultiplier(skillLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user