!Added safe checks, updated version nb

This commit is contained in:
Indyuce 2020-04-16 15:00:57 +02:00
parent fb86db6437
commit 61d297412a
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.Indyuce</groupId> <groupId>net.Indyuce</groupId>
<artifactId>MMOCore</artifactId> <artifactId>MMOCore</artifactId>
<version>1.2.5</version> <version>1.3</version>
<description>Offer your players a brand new RPG experience.</description> <description>Offer your players a brand new RPG experience.</description>
<properties> <properties>

View File

@ -246,7 +246,7 @@ public class PlayerData extends OfflinePlayerData {
public void refreshVanillaExp() { public void refreshVanillaExp() {
if (MMOCore.plugin.configManager.overrideVanillaExp) { if (MMOCore.plugin.configManager.overrideVanillaExp) {
player.setLevel(getLevel()); player.setLevel(getLevel());
player.setExp((float) experience / (float) getLevelUpExperience()); player.setExp(Math.max(0, Math.min(1, (float) experience / (float) getLevelUpExperience())));
} }
} }