From 6c39109a1d8b3c983fac5b17d8c6ff3dacf8ace6 Mon Sep 17 00:00:00 2001 From: MCMDEV Date: Sun, 14 Aug 2022 16:35:02 +0200 Subject: [PATCH] Fixed BossbarAdapter --- i18n-adventure/pom.xml | 4 ++-- i18n-api/pom.xml | 2 +- i18n-common/pom.xml | 4 ++-- i18n-paper/pom.xml | 4 ++-- .../helixdevs/i18n/paper/protocollib/BossbarAdapter.java | 8 +++++++- i18n-velocity/pom.xml | 4 ++-- .../de/helixdevs/i18n/velocity/I18nVelocityPlugin.java | 2 +- pom.xml | 2 +- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/i18n-adventure/pom.xml b/i18n-adventure/pom.xml index 750c23e..ac95e22 100644 --- a/i18n-adventure/pom.xml +++ b/i18n-adventure/pom.xml @@ -5,7 +5,7 @@ i18n de.helixdevs - 1.1 + 1.2 4.0.0 @@ -26,7 +26,7 @@ de.helixdevs i18n-common - 1.1 + 1.2 diff --git a/i18n-api/pom.xml b/i18n-api/pom.xml index 0ca2d03..a2f4053 100644 --- a/i18n-api/pom.xml +++ b/i18n-api/pom.xml @@ -5,7 +5,7 @@ i18n de.helixdevs - 1.1 + 1.2 4.0.0 diff --git a/i18n-common/pom.xml b/i18n-common/pom.xml index 72cd0c1..2bfa24e 100644 --- a/i18n-common/pom.xml +++ b/i18n-common/pom.xml @@ -5,7 +5,7 @@ i18n de.helixdevs - 1.1 + 1.2 4.0.0 @@ -20,7 +20,7 @@ de.helixdevs i18n-api - 1.1 + 1.2 diff --git a/i18n-paper/pom.xml b/i18n-paper/pom.xml index a5d9378..6927b4e 100644 --- a/i18n-paper/pom.xml +++ b/i18n-paper/pom.xml @@ -5,7 +5,7 @@ i18n de.helixdevs - 1.1 + 1.2 4.0.0 @@ -32,7 +32,7 @@ de.helixdevs i18n-adventure - 1.1 + 1.2 diff --git a/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/BossbarAdapter.java b/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/BossbarAdapter.java index 560fb0a..d90164a 100644 --- a/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/BossbarAdapter.java +++ b/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/BossbarAdapter.java @@ -2,16 +2,22 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketAdapter; +import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import org.bukkit.plugin.Plugin; public class BossbarAdapter extends PacketAdapter implements ITranslationAdapter { + public BossbarAdapter(Plugin plugin) { super(plugin, PacketType.Play.Server.BOSS); } @Override public void onPacketSending(PacketEvent event) { - handleChatComponent(event.getPlayer(), event.getPacket(), 0); + PacketContainer packet = event.getPacket(); + packet.getStructures().modify(1, internalStructure -> { + handleChatComponent(event.getPlayer(), internalStructure, 0); + return internalStructure; + }); } } diff --git a/i18n-velocity/pom.xml b/i18n-velocity/pom.xml index 34ae0d6..11ed47e 100644 --- a/i18n-velocity/pom.xml +++ b/i18n-velocity/pom.xml @@ -5,7 +5,7 @@ i18n de.helixdevs - 1.1 + 1.2 4.0.0 @@ -27,7 +27,7 @@ de.helixdevs i18n-adventure - 1.1 + 1.2 com.velocitypowered diff --git a/i18n-velocity/src/main/java/de/helixdevs/i18n/velocity/I18nVelocityPlugin.java b/i18n-velocity/src/main/java/de/helixdevs/i18n/velocity/I18nVelocityPlugin.java index c32ca6d..855a066 100644 --- a/i18n-velocity/src/main/java/de/helixdevs/i18n/velocity/I18nVelocityPlugin.java +++ b/i18n-velocity/src/main/java/de/helixdevs/i18n/velocity/I18nVelocityPlugin.java @@ -32,7 +32,7 @@ @Plugin( id = "i18n", name = "I18n", - version = "1.1", + version = "1.2", description = "Velocity implementation of I18n", authors = {"MCMDEV"} ) diff --git a/pom.xml b/pom.xml index 1e7d61d..4c39485 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ de.helixdevs i18n pom - 1.1 + 1.2 i18n-common i18n-paper