refactor(bot): delay some logic of extra load in fakeplayer spawn

This commit is contained in:
Helvetica Volubi
2026-01-13 20:47:55 +08:00
parent 670d4e39c9
commit 429a0345d9
@@ -211,12 +211,11 @@ public class BotList {
bot.suppressTrackerForLogin = true;
optional.ifPresent(nbt -> {
bot.loadAndSpawnEnderPearls(nbt);
bot.loadAndSpawnParentVehicle(nbt);
});
Runnable task = () -> {
optional.ifPresent(nbt -> {
bot.loadAndSpawnEnderPearls(nbt);
bot.loadAndSpawnParentVehicle(nbt);
});
world.getCurrentWorldData().connections.add(bot.connection.connection);
world.addNewPlayer(bot);
BotJoinEvent event1 = new BotJoinEvent(bot.getBukkitEntity(), PaperAdventure.asAdventure(Component.translatable("multiplayer.player.joined", bot.getDisplayName())).style(Style.style(NamedTextColor.YELLOW)));
@@ -243,7 +242,7 @@ public class BotList {
} else {
RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(
world, location.getBlockX() >> 4, location.blockZ() >> 4,
task::run);
task);
}
return bot;