aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0602-Add-missing-team-sidebar-display-slots.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0602-Add-missing-team-sidebar-display-slots.patch')
-rw-r--r--patches/server/0602-Add-missing-team-sidebar-display-slots.patch18
1 files changed, 8 insertions, 10 deletions
diff --git a/patches/server/0602-Add-missing-team-sidebar-display-slots.patch b/patches/server/0602-Add-missing-team-sidebar-display-slots.patch
index 9d0068df5a..8e253e2960 100644
--- a/patches/server/0602-Add-missing-team-sidebar-display-slots.patch
+++ b/patches/server/0602-Add-missing-team-sidebar-display-slots.patch
@@ -9,30 +9,28 @@ public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations toBukkitSlo
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations fromBukkitSlot(Lorg/bukkit/scoreboard/DisplaySlot;)Lnet/minecraft/world/scores/DisplaySlot;
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
-index 658f3962543a36bc8c16f306ccb3e254b5b3d0a8..7bef8539d26bced77406f49c0b6fd2c04e6e641e 100644
+index 658f3962543a36bc8c16f306ccb3e254b5b3d0a8..a1510dfd4824c0e246543d770f0e74f0f97c4ace 100644
--- a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
@@ -27,6 +27,7 @@ public class FieldRename {
}
return switch (owner) {
-+ case "org/bukkit/scoreboard/DisplaySlot" -> FieldRename.convertDisplaySlot(apiVersion, from); // Paper - DisplaySlot
++ case "org/bukkit/scoreboard/DisplaySlot" -> FieldRename.convertDisplaySlot(from); // Paper - DisplaySlot
case "org/bukkit/block/banner/PatternType" -> FieldRename.convertPatternTypeName(apiVersion, from);
case "org/bukkit/enchantments/Enchantment" -> FieldRename.convertEnchantmentName(apiVersion, from);
case "org/bukkit/block/Biome" -> FieldRename.convertBiomeName(apiVersion, from);
-@@ -43,6 +44,18 @@ public class FieldRename {
+@@ -43,6 +44,16 @@ public class FieldRename {
};
}
+ // Paper start - DisplaySlot
-+ private static final FieldRenameData DISPLAY_SLOT_DATA = FieldRenameData.Builder.newBuilder()
-+ .forAllVersions()
-+ .change("SIDEBAR_TEAM_", "SIDEBAR_")
-+ .build();
-+
+ @DoNotReroute
-+ public static String convertDisplaySlot(ApiVersion version, String from) {
-+ return FieldRename.DISPLAY_SLOT_DATA.getReplacement(version, from);
++ public static String convertDisplaySlot(final String from) {
++ if (from.startsWith("SIDEBAR_") && !from.startsWith("SIDEBAR_TEAM_")) {
++ return from.replace("SIDEBAR_", "SIDEBAR_TEAM_");
++ }
++ return from;
+ }
+ // Paper end - DisplaySlot
+