From a11ab271a2f07d5d31bd61e6a5418d6b2d9353e1 Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Sun, 23 Jun 2024 20:17:28 +0100 Subject: [PATCH] fix(spigot): bossbar action UPDATE_PROGRESS cannot be converted Adds an alias for this enum member, since it has been renamed between Minecraft versions. --- .../protocollib/BossBarPacketHandler.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/rexcantor64/triton/packetinterceptor/protocollib/BossBarPacketHandler.java b/core/src/main/java/com/rexcantor64/triton/packetinterceptor/protocollib/BossBarPacketHandler.java index d93a6e07..a43837bf 100644 --- a/core/src/main/java/com/rexcantor64/triton/packetinterceptor/protocollib/BossBarPacketHandler.java +++ b/core/src/main/java/com/rexcantor64/triton/packetinterceptor/protocollib/BossBarPacketHandler.java @@ -16,6 +16,7 @@ import com.comphenix.protocol.wrappers.EnumWrappers; import com.comphenix.protocol.wrappers.WrappedChatComponent; import com.rexcantor64.triton.player.SpigotLanguagePlayer; +import lombok.Getter; import lombok.val; import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.TranslatableComponent; @@ -225,7 +226,14 @@ public void registerPacketTypes(Map registry) { /** * BossBar packet Action wrapper */ - public enum Action { - ADD, REMOVE, UPDATE_PCT, UPDATE_NAME, UPDATE_STYLE, UPDATE_PROPERTIES + @Getter + public enum Action implements EnumWrappers.AliasedEnum { + ADD, REMOVE, UPDATE_PROGRESS("UPDATE_PCT"), UPDATE_NAME, UPDATE_STYLE, UPDATE_PROPERTIES; + + private final String[] aliases; + + Action(String... aliases) { + this.aliases = aliases; + } } }