color fixed
This commit is contained in:
parent
fab579d5af
commit
df9f53b1af
@ -44,7 +44,7 @@ public class ScoreboardService implements Listener {
|
|||||||
private static final String OBJECTIVE_NAME = "miningman_sb";
|
private static final String OBJECTIVE_NAME = "miningman_sb";
|
||||||
private static final TextColor LABEL_COLOR = TextColor.fromHexString("#FE5A1D");
|
private static final TextColor LABEL_COLOR = TextColor.fromHexString("#FE5A1D");
|
||||||
|
|
||||||
// Jede Zeile bekommt einen eigenen, satten Farbton für das Icon.
|
// Jede Zeile bekommt einen eigenen, satten Farbton - Titel und Icon in derselben Farbe.
|
||||||
private static final TextColor NAME_COLOR = TextColor.fromHexString("#FF5C8A");
|
private static final TextColor NAME_COLOR = TextColor.fromHexString("#FF5C8A");
|
||||||
private static final TextColor RANK_COLOR = TextColor.fromHexString("#FFD400");
|
private static final TextColor RANK_COLOR = TextColor.fromHexString("#FFD400");
|
||||||
private static final TextColor DEATHS_COLOR = TextColor.fromHexString("#FF3B3B");
|
private static final TextColor DEATHS_COLOR = TextColor.fromHexString("#FF3B3B");
|
||||||
@ -54,11 +54,6 @@ public class ScoreboardService implements Listener {
|
|||||||
private static final TextColor MINED_COLOR = TextColor.fromHexString("#C68642");
|
private static final TextColor MINED_COLOR = TextColor.fromHexString("#C68642");
|
||||||
private static final TextColor WALKED_COLOR = TextColor.fromHexString("#22D3EE");
|
private static final TextColor WALKED_COLOR = TextColor.fromHexString("#22D3EE");
|
||||||
|
|
||||||
// Die Titel (außer Name, der bleibt pink wie das Icon) bleiben im Marken-Rot-Orange,
|
|
||||||
// nur jede Zeile in einer anderen Stufe (dunkel -> hell).
|
|
||||||
private static final List<TextColor> LABEL_SHADES = ColorUtil.createGradient(
|
|
||||||
TextColor.fromHexString("#C43C0A"), TextColor.fromHexString("#FFC28C"), 7);
|
|
||||||
|
|
||||||
private static final String SEPARATOR = " "; // 25 Zeichen, als Leerzeichen für eine durchgehende Linie
|
private static final String SEPARATOR = " "; // 25 Zeichen, als Leerzeichen für eine durchgehende Linie
|
||||||
private static final String SERVER_DOMAIN = "ᴍɪɴɪɴɢᴍᴀɴ.eu";
|
private static final String SERVER_DOMAIN = "ᴍɪɴɪɴɢᴍᴀɴ.eu";
|
||||||
private static final List<Material> MINEABLE_MATERIALS = Arrays.stream(Material.values())
|
private static final List<Material> MINEABLE_MATERIALS = Arrays.stream(Material.values())
|
||||||
@ -199,18 +194,18 @@ public class ScoreboardService implements Listener {
|
|||||||
|
|
||||||
lines.add(separator());
|
lines.add(separator());
|
||||||
lines.add(nameLine(player));
|
lines.add(nameLine(player));
|
||||||
lines.add(rankLine(player, LABEL_SHADES.get(0)));
|
lines.add(rankLine(player));
|
||||||
lines.add(Component.empty());
|
lines.add(Component.empty());
|
||||||
lines.add(statLine("☠", DEATHS_COLOR, "ᴅᴇᴀᴛʜs", LABEL_SHADES.get(1),
|
lines.add(statLine("☠", DEATHS_COLOR, "ᴅᴇᴀᴛʜs",
|
||||||
String.valueOf(player.getStatistic(Statistic.DEATHS))));
|
String.valueOf(player.getStatistic(Statistic.DEATHS))));
|
||||||
lines.add(statLine("⌛", PLAYTIME_COLOR, "ᴘʟᴀʏᴛɪᴍᴇ", LABEL_SHADES.get(2),
|
lines.add(statLine("⌛", PLAYTIME_COLOR, "ᴘʟᴀʏᴛɪᴍᴇ",
|
||||||
formatPlaytime(player.getStatistic(Statistic.PLAY_ONE_MINUTE))));
|
formatPlaytime(player.getStatistic(Statistic.PLAY_ONE_MINUTE))));
|
||||||
lines.add(statLine("◎", ONLINE_COLOR, "ᴏɴʟɪɴᴇ", LABEL_SHADES.get(3),
|
lines.add(statLine("◎", ONLINE_COLOR, "ᴏɴʟɪɴᴇ",
|
||||||
Bukkit.getOnlinePlayers().size() + "/" + Bukkit.getMaxPlayers()));
|
Bukkit.getOnlinePlayers().size() + "/" + Bukkit.getMaxPlayers()));
|
||||||
lines.add(Component.empty());
|
lines.add(Component.empty());
|
||||||
lines.add(statLine("⧉", PLACED_COLOR, "ᴘʟᴀᴄᴇᴅ", LABEL_SHADES.get(4), formatNumber(blockStats[1])));
|
lines.add(statLine("⧉", PLACED_COLOR, "ᴘʟᴀᴄᴇᴅ", formatNumber(blockStats[1])));
|
||||||
lines.add(statLine("⛏", MINED_COLOR, "ᴍɪɴᴇᴅ", LABEL_SHADES.get(5), formatNumber(blockStats[0])));
|
lines.add(statLine("⛏", MINED_COLOR, "ᴍɪɴᴇᴅ", formatNumber(blockStats[0])));
|
||||||
lines.add(statLine("⇄", WALKED_COLOR, "ᴡᴀʟᴋᴇᴅ", LABEL_SHADES.get(6), formatNumber(getBlocksWalked(player))));
|
lines.add(statLine("⇄", WALKED_COLOR, "ᴡᴀʟᴋᴇᴅ", formatNumber(getBlocksWalked(player))));
|
||||||
lines.add(separator());
|
lines.add(separator());
|
||||||
lines.add(ipLine());
|
lines.add(ipLine());
|
||||||
|
|
||||||
@ -227,7 +222,7 @@ public class ScoreboardService implements Listener {
|
|||||||
.append(Component.text(player.getName(), NamedTextColor.WHITE).decoration(TextDecoration.BOLD, false));
|
.append(Component.text(player.getName(), NamedTextColor.WHITE).decoration(TextDecoration.BOLD, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component rankLine(Player player, TextColor labelColor) {
|
private Component rankLine(Player player) {
|
||||||
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||||
String prefix = user != null ? user.getCachedData().getMetaData().getPrefix() : null;
|
String prefix = user != null ? user.getCachedData().getMetaData().getPrefix() : null;
|
||||||
|
|
||||||
@ -239,13 +234,13 @@ public class ScoreboardService implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Component.text(" ★ ", RANK_COLOR)
|
return Component.text(" ★ ", RANK_COLOR)
|
||||||
.append(Component.text("ʀᴀɴᴋ: ", labelColor))
|
.append(Component.text("ʀᴀɴᴋ: ", RANK_COLOR))
|
||||||
.append(rankValue);
|
.append(rankValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component statLine(String icon, TextColor iconColor, String label, TextColor labelColor, String value) {
|
private Component statLine(String icon, TextColor color, String label, String value) {
|
||||||
return Component.text(" " + icon + " ", iconColor)
|
return Component.text(" " + icon + " ", color)
|
||||||
.append(Component.text(label + ": ", labelColor))
|
.append(Component.text(label + ": ", color))
|
||||||
.append(Component.text(value, NamedTextColor.WHITE));
|
.append(Component.text(value, NamedTextColor.WHITE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user