mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fishing will no longer cancel the exp dropped for ice fishing and will no longer bring xp values below zero with the xp multiplier
Not sure if this fixes the XP bug though!
This commit is contained in:
parent
8e048300e8
commit
017e32c30a
@ -264,6 +264,8 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) {
|
if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) {
|
||||||
|
//Don't modify XP below vanilla values
|
||||||
|
if(fishingManager.handleVanillaXpBoost(event.getExpToDrop()) > 1)
|
||||||
event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop()));
|
event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop()));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -272,7 +274,9 @@ public class PlayerListener implements Listener {
|
|||||||
Block block = player.getTargetBlock(null, 100);
|
Block block = player.getTargetBlock(null, 100);
|
||||||
|
|
||||||
if (fishingManager.canIceFish(block)) {
|
if (fishingManager.canIceFish(block)) {
|
||||||
event.setCancelled(true);
|
|
||||||
|
cancelFishingEventAndDropXp(event, player);
|
||||||
|
|
||||||
fishingManager.iceFishing(event.getHook(), block);
|
fishingManager.iceFishing(event.getHook(), block);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -282,6 +286,12 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cancelFishingEventAndDropXp(PlayerFishEvent event, Player player) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
ExperienceOrb experienceOrb = (ExperienceOrb) player.getWorld().spawnEntity(player.getEyeLocation(), EntityType.EXPERIENCE_ORB);
|
||||||
|
experienceOrb.setExperience(event.getExpToDrop());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitor PlayerFishEvents.
|
* Monitor PlayerFishEvents.
|
||||||
* <p>
|
* <p>
|
||||||
@ -312,6 +322,7 @@ public class PlayerListener implements Listener {
|
|||||||
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
||||||
|
|
||||||
Entity caught = event.getCaught();
|
Entity caught = event.getCaught();
|
||||||
|
//event.setExpToDrop(event.getExpToDrop()); //Redundant?
|
||||||
|
|
||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
case FISHING:
|
case FISHING:
|
||||||
|
Loading…
Reference in New Issue
Block a user