From f6dff1e6e2760b3cb014f830a77ac0aef9d628f3 Mon Sep 17 00:00:00 2001 From: TheFaser Date: Mon, 25 Dec 2023 15:21:02 +0500 Subject: [PATCH] Death: fix player component --- .../flectone/chat/module/serverMessage/death/DeathModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java b/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java index 283dc1d..6bdd62a 100644 --- a/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java +++ b/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java @@ -111,8 +111,8 @@ public void sendMessage(@NotNull Player sender, @Nullable Player player, @NotNul public void createEntityComponent(@NotNull Player sender, @Nullable Player player, @Nullable Entity entity, @NotNull ComponentBuilder componentBuilder, String color) { if (entity == null) return; - if (entity instanceof Player) { - componentBuilder.append(new FPlayerComponent(player, entity, color + entity.getName()).get()); + if (entity instanceof Player entityPlayer) { + componentBuilder.append(new FPlayerComponent(entityPlayer, player, color + entity.getName()).get()); return; }