mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-12-23 04:47:37 +01:00
Fixed /mmocore admine exp take ... bug
This commit is contained in:
parent
88a3cc4282
commit
2085e61af6
@ -787,8 +787,10 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
* @param splitExp Should the exp be split among party members
|
||||
*/
|
||||
public void giveExperience(double value, EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
||||
if (value <= 0)
|
||||
if (value <= 0) {
|
||||
experience = Math.max(0, experience + value);
|
||||
return;
|
||||
}
|
||||
|
||||
// Splitting exp through party members
|
||||
AbstractParty party;
|
||||
|
@ -170,8 +170,10 @@ public class PlayerProfessions {
|
||||
|
||||
public void giveExperience(Profession profession, double value, EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
||||
Validate.isTrue(playerData.isOnline(), "Cannot give experience to offline player");
|
||||
if (value <= 0)
|
||||
if (value <= 0) {
|
||||
exp.put(profession.getId(), Math.max(0, exp.get(profession.getId() + value)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasReachedMaxLevel(profession)) {
|
||||
setExperience(profession, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user