mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 05:13:11 +08:00
fix: home worlds are ticked twice (#2360)
This commit is contained in:
parent
ea5ee075a7
commit
2b64814534
@ -23,8 +23,8 @@ public class HomeWorld extends World {
|
|||||||
super(server, owner);
|
super(server, owner);
|
||||||
|
|
||||||
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
|
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
|
||||||
server.registerHomeWorld(this);
|
|
||||||
this.refreshModuleManager();
|
this.refreshModuleManager();
|
||||||
|
server.registerHomeWorld(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -288,12 +288,9 @@ public final class GameServer extends KcpServer implements Iterable<Player> {
|
|||||||
public synchronized void onTick() {
|
public synchronized void onTick() {
|
||||||
var tickStart = Instant.now();
|
var tickStart = Instant.now();
|
||||||
|
|
||||||
// Tick worlds.
|
// Tick worlds and home worlds.
|
||||||
this.worlds.removeIf(World::onTick);
|
this.worlds.removeIf(World::onTick);
|
||||||
|
|
||||||
// Tick Home Worlds (Not remove, HomeWorld is constant).
|
|
||||||
this.homeWorlds.values().forEach(HomeWorld::onTick);
|
|
||||||
|
|
||||||
// Tick players.
|
// Tick players.
|
||||||
this.players.values().forEach(Player::onTick);
|
this.players.values().forEach(Player::onTick);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user