mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-23 16:41:42 +01:00
Fixes EXP reset for players onJoin and onLeave (#2286)
The total experience does not reset player collected exp. This fixes that, as it will set level to 0 and progress in towards next level to 0
This commit is contained in:
parent
c9b7074e79
commit
6bf12d5e20
@ -109,6 +109,10 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
|
||||
// Reset the XP
|
||||
if (getIWM().isOnLeaveResetXP(getWorld())) {
|
||||
// Player collected XP (displayed)
|
||||
target.getPlayer().setLevel(0);
|
||||
target.getPlayer().setExp(0);
|
||||
// Player total XP (not displayed)
|
||||
target.getPlayer().setTotalExperience(0);
|
||||
}
|
||||
|
||||
|
@ -218,6 +218,10 @@ public class IslandTeamInviteAcceptCommand extends ConfirmableCommand {
|
||||
|
||||
// Reset the XP
|
||||
if (getIWM().isOnJoinResetXP(getWorld())) {
|
||||
// Player collected XP (displayed)
|
||||
user.getPlayer().setLevel(0);
|
||||
user.getPlayer().setExp(0);
|
||||
// Player total XP (not displayed)
|
||||
user.getPlayer().setTotalExperience(0);
|
||||
}
|
||||
|
||||
|
@ -1177,6 +1177,10 @@ public class IslandsManager {
|
||||
|
||||
// Reset the XP
|
||||
if (plugin.getIWM().isOnJoinResetXP(world)) {
|
||||
// Player collected XP (displayed)
|
||||
user.getPlayer().setLevel(0);
|
||||
user.getPlayer().setExp(0);
|
||||
// Player total XP (not displayed)
|
||||
user.getPlayer().setTotalExperience(0);
|
||||
}
|
||||
|
||||
|
@ -489,6 +489,10 @@ public class PlayersManager {
|
||||
|
||||
// Reset the XP
|
||||
if (plugin.getIWM().isOnLeaveResetXP(world) && target.isPlayer()) {
|
||||
// Player collected XP (displayed)
|
||||
target.getPlayer().setLevel(0);
|
||||
target.getPlayer().setExp(0);
|
||||
// Player total XP (not displayed)
|
||||
target.getPlayer().setTotalExperience(0);
|
||||
}
|
||||
// Save player
|
||||
|
Loading…
Reference in New Issue
Block a user