1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 1 Oct 2021 08:04:43 -0700
Subject: [PATCH] Add missing team sidebar display slots
diff --git a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java
index 5d58a18b3625fd01ea34969200edc3bc80cbb587..fe7d0a19f970ac5b4e0c4bef4ff7c4ceae60bb86 100644
--- a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java
+++ b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java
@@ -1,10 +1,55 @@
package org.bukkit.scoreboard;
+import net.kyori.adventure.text.format.NamedTextColor; // Paper
/**
* Locations for displaying objectives to the player
*/
public enum DisplaySlot {
- BELOW_NAME,
- PLAYER_LIST,
- SIDEBAR;
+ // Paper start
+ BELOW_NAME("belowName"),
+ PLAYER_LIST("list"),
+ SIDEBAR("sidebar"),
+ SIDEBAR_TEAM_BLACK(NamedTextColor.BLACK),
+ SIDEBAR_TEAM_DARK_BLUE(NamedTextColor.DARK_BLUE),
+ SIDEBAR_TEAM_DARK_GREEN(NamedTextColor.DARK_GREEN),
+ SIDEBAR_TEAM_DARK_AQUA(NamedTextColor.DARK_AQUA),
+ SIDEBAR_TEAM_DARK_RED(NamedTextColor.DARK_RED),
+ SIDEBAR_TEAM_DARK_PURPLE(NamedTextColor.DARK_PURPLE),
+ SIDEBAR_TEAM_GOLD(NamedTextColor.GOLD),
+ SIDEBAR_TEAM_GRAY(NamedTextColor.GRAY),
+ SIDEBAR_TEAM_DARK_GRAY(NamedTextColor.DARK_GRAY),
+ SIDEBAR_TEAM_BLUE(NamedTextColor.BLUE),
+ SIDEBAR_TEAM_GREEN(NamedTextColor.GREEN),
+ SIDEBAR_TEAM_AQUA(NamedTextColor.AQUA),
+ SIDEBAR_TEAM_RED(NamedTextColor.RED),
+ SIDEBAR_TEAM_LIGHT_PURPLE(NamedTextColor.LIGHT_PURPLE),
+ SIDEBAR_TEAM_YELLOW(NamedTextColor.YELLOW),
+ SIDEBAR_TEAM_WHITE(NamedTextColor.WHITE);
+
+ public static final net.kyori.adventure.util.Index<String, DisplaySlot> NAMES = net.kyori.adventure.util.Index.create(DisplaySlot.class, DisplaySlot::getId);
+
+ private final String id;
+
+ DisplaySlot(@org.jetbrains.annotations.NotNull String id) {
+ this.id = id;
+ }
+
+ DisplaySlot(@org.jetbrains.annotations.NotNull NamedTextColor color) {
+ this.id = "sidebar.team." + color;
+ }
+
+ /**
+ * Get the string id of this display slot.
+ *
+ * @return the string id
+ */
+ public @org.jetbrains.annotations.NotNull String getId() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return this.id;
+ }
+ // Paper end
}
|