Improved format of exp amount in exp holo message

This commit is contained in:
Indyuce 2022-03-20 15:18:58 +01:00
parent 2d3249b15f
commit 5660a31d86

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.api.player; package net.Indyuce.mmocore.api.player;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.player.MMOPlayerData; import io.lumine.mythic.lib.api.player.MMOPlayerData;
import io.lumine.mythic.lib.player.TemporaryPlayerData; import io.lumine.mythic.lib.player.TemporaryPlayerData;
import io.lumine.mythic.lib.player.cooldown.CooldownMap; import io.lumine.mythic.lib.player.cooldown.CooldownMap;
@ -536,10 +537,6 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
return; return;
} }
// Experience hologram
if (hologramLocation != null && isOnline())
MMOCoreUtils.displayIndicator(hologramLocation, MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message());
value = MMOCore.plugin.boosterManager.calculateExp(null, value); value = MMOCore.plugin.boosterManager.calculateExp(null, value);
value *= 1 + getStats().getStat(StatType.ADDITIONAL_EXPERIENCE) / 100; value *= 1 + getStats().getStat(StatType.ADDITIONAL_EXPERIENCE) / 100;
@ -557,6 +554,10 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
if (event.isCancelled()) if (event.isCancelled())
return; return;
// Experience hologram
if (hologramLocation != null && isOnline())
MMOCoreUtils.displayIndicator(hologramLocation, MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", String.valueOf(event.getExperience())).message());
experience = Math.max(0, experience + event.getExperience()); experience = Math.max(0, experience + event.getExperience());
// Calculate the player's next level // Calculate the player's next level