mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
giveExperience does nothing if exp is negative
This commit is contained in:
parent
1765b15707
commit
a13987cac9
@ -532,6 +532,9 @@ 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)
|
||||
return;
|
||||
|
||||
if (hasReachedMaxLevel()) {
|
||||
setExperience(0);
|
||||
return;
|
||||
|
@ -157,6 +157,8 @@ public class PlayerProfessions {
|
||||
|
||||
public void giveExperience(Profession profession, double value, EXPSource source, @Nullable Location hologramLocation) {
|
||||
Validate.isTrue(playerData.isOnline(), "Cannot give experience to offline player");
|
||||
if (value <= 0)
|
||||
return;
|
||||
|
||||
if (hasReachedMaxLevel(profession)) {
|
||||
setExperience(profession, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user