mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2024-11-26 22:00:26 +00:00
fix: login too slow (#2380)
This commit is contained in:
parent
ec2bfffdd1
commit
5ee4812ac5
@ -25,7 +25,6 @@ public class HomeWorld extends World {
|
||||
|
||||
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
|
||||
this.refreshModuleManager();
|
||||
server.registerHomeWorld(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,6 +72,8 @@ public class World implements Iterable<Player> {
|
||||
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
|
||||
this.entity = new EntityWorld(this);
|
||||
this.lastUpdateTime = System.currentTimeMillis();
|
||||
|
||||
server.registerWorld(this);
|
||||
}
|
||||
|
||||
public int getLevelEntityId() {
|
||||
|
@ -311,11 +311,6 @@ public final class GameServer extends KcpServer implements Iterable<Player> {
|
||||
world.save(); // Save the player's world
|
||||
}
|
||||
|
||||
public void registerHomeWorld(HomeWorld homeWorld) {
|
||||
this.getHomeWorlds().put(homeWorld.getOwnerUid(), homeWorld);
|
||||
this.registerWorld(homeWorld);
|
||||
}
|
||||
|
||||
public HomeWorld getHomeWorldOrCreate(Player owner) {
|
||||
return this.getHomeWorlds()
|
||||
.computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner));
|
||||
|
Loading…
Reference in New Issue
Block a user