Fixes slip-up by forgetting to display animation to all nearby players

This commit is contained in:
Kristian Knarvik 2024-07-29 12:32:38 +02:00
parent 966eed910a
commit 3b81d2f57c

View File

@ -95,13 +95,16 @@ public class BlacksmithListener implements Listener {
List<Entity> 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);
}
}
/**