diff --git a/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/EntityMetadataAdapter.java b/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/EntityMetadataAdapter.java index 2b834bf..f1243ae 100644 --- a/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/EntityMetadataAdapter.java +++ b/i18n-paper/src/main/java/de/helixdevs/i18n/paper/protocollib/EntityMetadataAdapter.java @@ -23,6 +23,10 @@ public void onPacketSending(PacketEvent event) { watchableObjects.forEach(wrappedWatchableObject -> { if (wrappedWatchableObject.getValue() instanceof Optional optional) { optional.ifPresent(o -> { + if(o instanceof WrappedChatComponent wrappedChatComponent) { + WrappedChatComponent translated = translate(event.getPlayer(), wrappedChatComponent); + wrappedWatchableObject.setValue(Optional.of(translated.getHandle())); + } else if(MinecraftReflection.getIChatBaseComponentClass().isAssignableFrom(o.getClass())) { WrappedChatComponent wrappedChatComponent = WrappedChatComponent.fromHandle(o); WrappedChatComponent translated = translate(event.getPlayer(), wrappedChatComponent);