Updated Upstream (Bukkit/CraftBukkit) (#8270)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: d43a1e72 SPIGOT-2450: Improve scoreboard criteria API, add missing DisplaySlots 9d6e4847 SPIGOT-7122: New Allay Methods from 1.19.1 CraftBukkit Changes: c379a6b4e SPIGOT-2450: Improve scoreboard criteria API, add missing DisplaySlots 051fcced1 SPIGOT-7122: New Allay Methods from 1.19.1
This commit is contained in:
parent
eb5b0d0edf
commit
d4b4d5b95b
8 changed files with 154 additions and 64 deletions
|
|
@ -12,13 +12,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import org.bukkit.scoreboard.RenderType;
|
||||
|
||||
public final class CraftScoreboardTranslations {
|
||||
- static final int MAX_DISPLAY_SLOT = 3;
|
||||
- static final int MAX_DISPLAY_SLOT = 19;
|
||||
+ static final int MAX_DISPLAY_SLOT = Scoreboard.getDisplaySlotNames().length; // Paper
|
||||
+ @Deprecated // Paper
|
||||
static ImmutableBiMap<DisplaySlot, String> SLOTS = ImmutableBiMap.of(
|
||||
DisplaySlot.BELOW_NAME, "belowName",
|
||||
DisplaySlot.PLAYER_LIST, "list",
|
||||
@@ -0,0 +0,0 @@ public final class CraftScoreboardTranslations {
|
||||
static final ImmutableBiMap<DisplaySlot, String> SLOTS = ImmutableBiMap.<DisplaySlot, String>builder()
|
||||
.put(DisplaySlot.BELOW_NAME, "belowName")
|
||||
.put(DisplaySlot.PLAYER_LIST, "list")
|
||||
.put(DisplaySlot.SIDEBAR, "sidebar")
|
||||
- .put(DisplaySlot.SIDEBAR_BLACK, "sidebar.team.black")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_BLUE, "sidebar.team.dark_blue")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_GREEN, "sidebar.team.dark_green")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_AQUA, "sidebar.team.dark_aqua")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_RED, "sidebar.team.dark_red")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_PURPLE, "sidebar.team.dark_purple")
|
||||
- .put(DisplaySlot.SIDEBAR_GOLD, "sidebar.team.gold")
|
||||
- .put(DisplaySlot.SIDEBAR_GRAY, "sidebar.team.gray")
|
||||
- .put(DisplaySlot.SIDEBAR_DARK_GRAY, "sidebar.team.dark_gray")
|
||||
- .put(DisplaySlot.SIDEBAR_BLUE, "sidebar.team.blue")
|
||||
- .put(DisplaySlot.SIDEBAR_GREEN, "sidebar.team.green")
|
||||
- .put(DisplaySlot.SIDEBAR_AQUA, "sidebar.team.aqua")
|
||||
- .put(DisplaySlot.SIDEBAR_RED, "sidebar.team.red")
|
||||
- .put(DisplaySlot.SIDEBAR_LIGHT_PURPLE, "sidebar.team.light_purple")
|
||||
- .put(DisplaySlot.SIDEBAR_YELLOW, "sidebar.team.yellow")
|
||||
- .put(DisplaySlot.SIDEBAR_WHITE, "sidebar.team.white")
|
||||
.buildOrThrow();
|
||||
|
||||
private CraftScoreboardTranslations() {}
|
||||
|
||||
public static DisplaySlot toBukkitSlot(int i) {
|
||||
|
|
@ -31,6 +49,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return Scoreboard.getDisplaySlotByName(CraftScoreboardTranslations.SLOTS.get(slot));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -0,0 +0,0 @@ public class Commodore
|
||||
desc = getOriginalOrRewrite( desc );
|
||||
}
|
||||
// Paper end
|
||||
+ // Paper start - DisplaySlot
|
||||
+ if (owner.equals("org/bukkit/scoreboard/DisplaySlot")) {
|
||||
+ if (name.startsWith("SIDEBAR_") && !name.startsWith("SIDEBAR_TEAM_")) {
|
||||
+ super.visitFieldInsn(opcode, owner, name.replace("SIDEBAR_", "SIDEBAR_TEAM_"), desc);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - DisplaySlot
|
||||
|
||||
if ( owner.equals( "org/bukkit/block/Biome" ) )
|
||||
{
|
||||
diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue