fixed something in scoreboard
This commit is contained in:
parent
7a76db189b
commit
30ef01bb52
2 changed files with 4 additions and 5 deletions
|
@ -1,10 +1,9 @@
|
|||
package com.night.nullvalkyrie.RankSys;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
|
||||
public class BelowNameManager {
|
||||
|
@ -12,7 +11,7 @@ public class BelowNameManager {
|
|||
Scoreboard board = player.getScoreboard();
|
||||
Objective obj = board.registerNewObjective("HealthBar", "health");
|
||||
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
||||
obj.setDisplayName("/ 20");
|
||||
obj.setDisplayName(ChatColor.RED + "❤");
|
||||
player.setScoreboard(board);
|
||||
player.setHealth(player.getHealth());
|
||||
|
||||
|
|
|
@ -38,11 +38,11 @@ public class RankManager {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(Bukkit.getOfflinePlayer(uuid).isOnline()) {
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
main.getNameTagManager().removeTag(player);
|
||||
main.getNameTagManager().newTag(player);
|
||||
}
|
||||
|
||||
}
|
||||
public Rank getRank(UUID uuid) {
|
||||
return Rank.valueOf(config.getString(uuid.toString()));
|
||||
|
|
Loading…
Reference in a new issue