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:
@@ -170,10 +170,11 @@ public class BotList {
|
|||||||
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(joinMessage), false);
|
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(joinMessage), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bot.renderAll();
|
bot.renderInfo();
|
||||||
bot.supressTrackerForLogin = false;
|
bot.supressTrackerForLogin = false;
|
||||||
|
|
||||||
bot.level().getChunkSource().chunkMap.addEntity(bot);
|
bot.level().getChunkSource().chunkMap.addEntity(bot);
|
||||||
|
bot.renderData();
|
||||||
bot.initInventoryMenu();
|
bot.initInventoryMenu();
|
||||||
botsNameByWorldUuid
|
botsNameByWorldUuid
|
||||||
.computeIfAbsent(bot.level().uuid.toString(), (k) -> new HashSet<>())
|
.computeIfAbsent(bot.level().uuid.toString(), (k) -> new HashSet<>())
|
||||||
|
|||||||
@@ -474,12 +474,15 @@ public class ServerBot extends ServerPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderAll() {
|
public void renderInfo() {
|
||||||
this.getServer().getPlayerList().getPlayers().forEach(
|
this.getServer().getPlayerList().getPlayers().forEach(
|
||||||
player -> {
|
player -> this.sendPlayerInfo(player)
|
||||||
this.sendPlayerInfo(player);
|
);
|
||||||
this.sendFakeDataIfNeed(player, false);
|
}
|
||||||
}
|
|
||||||
|
public void renderData() {
|
||||||
|
this.getServer().getPlayerList().getPlayers().forEach(
|
||||||
|
player -> this.sendFakeDataIfNeed(player, false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user