From 3b81d2f57c6d674b3dc92467e3caa85e9a1ce15e Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 29 Jul 2024 12:32:38 +0200 Subject: [PATCH] Fixes slip-up by forgetting to display animation to all nearby players --- .../knarcraft/blacksmithvisuals/BlacksmithListener.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/blacksmithvisuals/BlacksmithListener.java b/src/main/java/net/knarcraft/blacksmithvisuals/BlacksmithListener.java index 71b8507..794169c 100644 --- a/src/main/java/net/knarcraft/blacksmithvisuals/BlacksmithListener.java +++ b/src/main/java/net/knarcraft/blacksmithvisuals/BlacksmithListener.java @@ -95,13 +95,16 @@ public class BlacksmithListener implements Listener { List nearby = event.getNpc().getEntity().getNearbyEntities(10, 10, 5); nearby.removeIf((entity) -> !(entity instanceof Player)); - + this.playWorkSound(event.getNpc().getEntity()); ProtocolManager manager = ProtocolLibrary.getProtocolManager(); PacketContainer packet = manager.createPacket(PacketType.Play.Server.ANIMATION); packet.getIntegers().write(0, event.getNpc().getEntity().getEntityId()); packet.getIntegers().write(1, 3); - manager.sendServerPacket(event.getPlayer(), packet); + + for (Entity entity : nearby) { + manager.sendServerPacket((Player) entity, packet); + } } /**