From 2b64814534f84aefd95aeed9dacacbec18a5200a Mon Sep 17 00:00:00 2001 From: hamusuke Date: Thu, 14 Sep 2023 14:22:29 +0900 Subject: [PATCH] fix: home worlds are ticked twice (#2360) --- src/main/java/emu/grasscutter/game/home/HomeWorld.java | 2 +- src/main/java/emu/grasscutter/server/game/GameServer.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/home/HomeWorld.java b/src/main/java/emu/grasscutter/game/home/HomeWorld.java index 525da1be4..c98e93c22 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeWorld.java +++ b/src/main/java/emu/grasscutter/game/home/HomeWorld.java @@ -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 diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index 4baf00b51..1787f93ea 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -288,12 +288,9 @@ public final class GameServer extends KcpServer implements Iterable { 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);