From 61d297412aa1f86019c71761c9df2c4bcbb93653 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Thu, 16 Apr 2020 15:00:57 +0200 Subject: [PATCH] !Added safe checks, updated version nb --- pom.xml | 2 +- src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 058e84b0..39971c6c 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 net.Indyuce MMOCore - 1.2.5 + 1.3 Offer your players a brand new RPG experience. diff --git a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index e67f05e9..3556790f 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -246,7 +246,7 @@ public class PlayerData extends OfflinePlayerData { public void refreshVanillaExp() { if (MMOCore.plugin.configManager.overrideVanillaExp) { player.setLevel(getLevel()); - player.setExp((float) experience / (float) getLevelUpExperience()); + player.setExp(Math.max(0, Math.min(1, (float) experience / (float) getLevelUpExperience()))); } }