Fixed exp hologram display

This commit is contained in:
Jules 2022-06-18 20:08:05 +02:00
parent e1d43c8a05
commit 9996211296
8 changed files with 13 additions and 8 deletions

View File

@ -49,7 +49,7 @@ public class PlayerActionBar extends BukkitRunnable {
.replace("{stellium}", digit.format(data.getStellium()))
.replace("{max_stellium}", StatInfo.valueOf("MAX_STELLIUM").format(data.getStats().getStat("MAX_STELLIUM")))
.replace("{class}", data.getProfess().getName())
.replace("{xp}", "" + data.getExperience())
.replace("{xp}", MythicLib.plugin.getMMOConfig().decimal.format(data.getExperience()))
.replace("{armor}", StatInfo.valueOf("ARMOR").format(data.getPlayer().getAttribute(Attribute.GENERIC_ARMOR).getValue()))
.replace("{level}", "" + data.getLevel())
.replace("{name}", data.getPlayer().getDisplayName())))));

View File

@ -1,5 +1,6 @@
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.player.TemporaryPlayerData;
import io.lumine.mythic.lib.player.cooldown.CooldownMap;
@ -560,7 +561,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
// Experience hologram
if (hologramLocation != null && isOnline())
MMOCoreUtils.displayIndicator(hologramLocation, MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", String.valueOf(event.getExperience())).message());
MMOCoreUtils.displayIndicator(hologramLocation, MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", MythicLib.plugin.getMMOConfig().decimal.format(event.getExperience())).message());
experience = Math.max(0, experience + event.getExperience());

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.command.rpg.admin;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.command.api.CommandTreeNode;
import io.lumine.mythic.lib.command.api.Parameter;
import net.Indyuce.mmocore.MMOCore;
@ -68,7 +69,7 @@ public class ExperienceCommandTreeNode extends CommandTreeNode {
if (args[4].equalsIgnoreCase("main")) {
main.accept(data, amount);
CommandVerbose.verbose(sender, CommandVerbose.CommandType.EXPERIENCE, ChatColor.GOLD + player.getName() + ChatColor.YELLOW
+ " now has " + ChatColor.GOLD + data.getExperience() + ChatColor.YELLOW + " EXP.");
+ " now has " + ChatColor.GOLD + MythicLib.plugin.getMMOConfig().decimal.format(data.getExperience()) + ChatColor.YELLOW + " EXP.");
return CommandResult.SUCCESS;
}

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.command.rpg.admin;
import io.lumine.mythic.lib.MythicLib;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
@ -33,7 +34,7 @@ public class InfoCommandTreeNode extends CommandTreeNode {
sender.sendMessage(ChatColor.YELLOW + "----------------------------------------------------");
sender.sendMessage(ChatColor.YELLOW + "Class: " + ChatColor.GOLD + playerData.getProfess().getName());
sender.sendMessage(ChatColor.YELLOW + "Level: " + ChatColor.GOLD + playerData.getLevel());
sender.sendMessage(ChatColor.YELLOW + "Experience: " + ChatColor.GOLD + playerData.getExperience() + ChatColor.YELLOW + " / " + ChatColor.GOLD
sender.sendMessage(ChatColor.YELLOW + "Experience: " + ChatColor.GOLD + MythicLib.plugin.getMMOConfig().decimal.format(playerData.getExperience()) + ChatColor.YELLOW + " / " + ChatColor.GOLD
+ playerData.getLevelUpExperience());
sender.sendMessage(ChatColor.YELLOW + "Class Points: " + ChatColor.GOLD + playerData.getClassPoints());
sender.sendMessage(ChatColor.YELLOW + "Quests: " + ChatColor.GOLD + playerData.getQuestData().getFinishedQuests().size() + ChatColor.YELLOW

View File

@ -128,7 +128,7 @@ public class RPGPlaceholders extends PlaceholderExpansion {
.valueOf(playerData.getCollectionSkills().getLevel(identifier.substring(11).replace(" ", "-").replace("_", "-").toLowerCase()));
else if (identifier.equals("experience"))
return String.valueOf(playerData.getExperience());
return MythicLib.plugin.getMMOConfig().decimal.format(playerData.getExperience());
else if (identifier.equals("next_level"))
return String.valueOf(playerData.getLevelUpExperience());

View File

@ -187,7 +187,7 @@ public class PlayerProfessions {
// Display hologram
if (hologramLocation != null)
MMOCoreUtils.displayIndicator(hologramLocation.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message());
MMOCoreUtils.displayIndicator(hologramLocation.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", MythicLib.plugin.getMMOConfig().decimal.format(event.getExperience())).message());
exp.put(profession.getId(), Math.max(0, exp.getOrDefault(profession.getId(), 0.) + event.getExperience()));
int level, oldLevel = getLevel(profession);

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.gui;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.stat.modifier.StatModifier;
import io.lumine.mythic.lib.version.VersionMaterial;
@ -243,7 +244,7 @@ public class PlayerStats extends EditableInventory {
bar.append(j == chars ? "" + ChatColor.WHITE + ChatColor.BOLD : "").append("|");
holders.register("percent", decimal.format(ratio * 100));
holders.register("exp", "" + data.getExperience());
holders.register("exp", MythicLib.plugin.getMMOConfig().decimal.format(data.getExperience()));
holders.register("level", "" + data.getLevel());
holders.register("class_points", "" + data.getClassPoints());
holders.register("skill_points", "" + data.getSkillPoints());

View File

@ -227,7 +227,8 @@ resource-bar-colors:
# When set to true, attributes are saved and
# reset when a player changes their class.
attributes-as-class-info: true
# Not implemented yet.
# attributes-as-class-info: true
# Whether or not the admin commands should display
# the result of the command when ran.