Skip to content

Commit

Permalink
Merge pull request #64 from alt-art/fix-send-to-chat
Browse files Browse the repository at this point in the history
Make send to chat condition on send_chat event listener
  • Loading branch information
alt-art authored Feb 9, 2024
2 parents a09402b + 3a2d373 commit d2bf7db
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ public static void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) {
}
Player player = event.getEntity();
wsClient.addEventListener("send_chat", jsonObject -> {
player.sendSystemMessage(Component.nullToEmpty(jsonObject.get("data").getAsString()));
if (ClientConfig.SEND_TO_CHAT.get()) {
player.sendSystemMessage(Component.nullToEmpty(jsonObject.get("data").getAsString()));
}
return null;
});
String worldName = Objects.requireNonNull(player.getServer()).getWorldData().getLevelName();
Expand Down

0 comments on commit d2bf7db

Please sign in to comment.