use of io.xol.chunkstories.api.net.packets.PacketTime in project chunkstories by Hugobros3.
the class WorldServer method tick.
@Override
public void tick() {
processIncommingPackets();
super.tick();
// Update client tracking
Iterator<Player> playersIterator = this.getPlayers();
while (playersIterator.hasNext()) {
Player player = playersIterator.next();
// System.out.println("client: "+client);
if (player.hasSpawned()) {
// Update whatever he sees
((ServerPlayer) player).updateTrackedEntities();
}
// Update time & weather
PacketTime packetTime = new PacketTime(this);
packetTime.time = this.getTime();
packetTime.overcastFactor = this.getWeather();
player.pushPacket(packetTime);
}
virtualServerSoundManager.update();
// TODO this should work per-world
this.getServer().getHandler().flushAll();
}
Aggregations