fix: home worlds are ticked twice (#2360)

This commit is contained in:
hamusuke 2023-09-14 14:22:29 +09:00 committed by GitHub
parent ea5ee075a7
commit 2b64814534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -23,8 +23,8 @@ public class HomeWorld extends World {
super(server, owner);
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
server.registerHomeWorld(this);
this.refreshModuleManager();
server.registerHomeWorld(this);
}
@Override

View File

@ -288,12 +288,9 @@ public final class GameServer extends KcpServer implements Iterable<Player> {
public synchronized void onTick() {
var tickStart = Instant.now();
// Tick worlds.
// Tick worlds and home worlds.
this.worlds.removeIf(World::onTick);
// Tick Home Worlds (Not remove, HomeWorld is constant).
this.homeWorlds.values().forEach(HomeWorld::onTick);
// Tick players.
this.players.values().forEach(Player::onTick);