RuneHive-Game
Loading...
Searching...
No Matches
NpcUpdateTask.java
Go to the documentation of this file.
1package com.runehive.game.engine.sync.task;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.net.packet.out.SendNpcUpdate;
5import org.apache.logging.log4j.LogManager;
6import org.apache.logging.log4j.Logger;
7
8public class NpcUpdateTask extends SynchronizationTask {
9
10 private static final Logger logger = LogManager.getLogger(NpcUpdateTask.class);
11
12 private final Player player;
13
15 this.player = player;
16 }
17
18 @Override
19 public void run() {
20 try {
21 if (player == null) {
22 return;
23 }
24
25 player.send(new SendNpcUpdate());
26 } catch (Exception ex) {
27 logger.fatal(String.format("Error in %s %s", this.getClass().getSimpleName(), player), ex);
28 }
29 }
30
31}
This class represents a character controlled by a player.
Definition Player.java:125
The packet that's responsible for updating npcs.