mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
Prevent commands from setting players to negative levels
This commit is contained in:
@ -245,7 +245,7 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
|
||||
/* General Settings */
|
||||
|
||||
//Classic mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
|
||||
//Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
|
||||
public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode", true); }
|
||||
|
||||
//XP needed to level is multiplied by this when using classic mode
|
||||
|
@ -280,6 +280,10 @@ public class PlayerProfile {
|
||||
|
||||
changed = true;
|
||||
|
||||
//Don't allow levels to be negative
|
||||
if(level < 0)
|
||||
level = 0;
|
||||
|
||||
skills.put(skill, level);
|
||||
skillsXp.put(skill, 0F);
|
||||
}
|
||||
|
Reference in New Issue
Block a user