Skip to content

Commit

Permalink
Update EntityMetadataAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMDEV committed Aug 8, 2022
1 parent 6ac9a7d commit 66a92f1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66a92f1

Please sign in to comment.