9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00

Fix fakeplayer cant get entity tracker correctly (#676)

* Fix fakeplayer cant get entity tracker correctly

* Remove extra line by mistake

---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
This commit is contained in:
Lumine1909
2025-08-11 02:13:32 -07:00
committed by GitHub
parent 099be5b864
commit ba8993d381
2 changed files with 10 additions and 6 deletions

View File

@@ -170,10 +170,11 @@ public class BotList {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(joinMessage), false);
}
bot.renderAll();
bot.renderInfo();
bot.supressTrackerForLogin = false;
bot.level().getChunkSource().chunkMap.addEntity(bot);
bot.renderData();
bot.initInventoryMenu();
botsNameByWorldUuid
.computeIfAbsent(bot.level().uuid.toString(), (k) -> new HashSet<>())

View File

@@ -474,12 +474,15 @@ public class ServerBot extends ServerPlayer {
}
}
public void renderAll() {
public void renderInfo() {
this.getServer().getPlayerList().getPlayers().forEach(
player -> {
this.sendPlayerInfo(player);
this.sendFakeDataIfNeed(player, false);
player -> this.sendPlayerInfo(player)
);
}
public void renderData() {
this.getServer().getPlayerList().getPlayers().forEach(
player -> this.sendFakeDataIfNeed(player, false)
);
}