9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

Fix fakeplayer list

This commit is contained in:
violetc
2022-12-16 15:22:12 +08:00
parent 0dff17995a
commit 42b1acc161

View File

@@ -573,10 +573,10 @@ index 0000000000000000000000000000000000000000..daaece30b2a3983f1cc9ee9a851e8f37
+}
diff --git a/src/main/java/top/leavesmc/leaves/bot/ServerBot.java b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
new file mode 100644
index 0000000000000000000000000000000000000000..7b1e786dd30e019b4fce88df6f4d3cbb1ad5d606
index 0000000000000000000000000000000000000000..c14601ed99c7c8353b0d37c1c7de0f74bec0c389
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
@@ -0,0 +1,728 @@
@@ -0,0 +1,729 @@
+package top.leavesmc.leaves.bot;
+
+import com.google.common.collect.Lists;
@@ -638,6 +638,7 @@ index 0000000000000000000000000000000000000000..7b1e786dd30e019b4fce88df6f4d3cbb
+import javax.annotation.Nullable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
@@ -779,7 +780,7 @@ index 0000000000000000000000000000000000000000..7b1e786dd30e019b4fce88df6f4d3cbb
+
+ private Packet<?>[] getRenderPackets() {
+ return new Packet[]{
+ new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, this),
+ new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED), List.of(this)),
+ new ClientboundAddPlayerPacket(this),
+ new ClientboundSetEntityDataPacket(this.getId(), this.getEntityData().packDirty()),
+ new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f))