mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-28 11:29:12 +00:00
Fix fakeplayer display error
This commit is contained in:
@@ -249,7 +249,7 @@ index 1fb25e8a21b568864974cc81b452ba062890d593..c32825a237a539035828a9c85673ea0e
|
||||
public final String worldName;
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/bot/BotCommand.java b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..10758cf524047814154f8daa4c21703b36a25301
|
||||
index 0000000000000000000000000000000000000000..5a9f2a01449cb8c11c6c05490ad48682acb0f389
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
|
||||
@@ -0,0 +1,271 @@
|
||||
@@ -331,7 +331,7 @@ index 0000000000000000000000000000000000000000..10758cf524047814154f8daa4c21703b
|
||||
+ case "action" -> {
|
||||
+ BotAction action = Actions.getForName(args[2]);
|
||||
+ if (action != null) {
|
||||
+ if (action.hasNumber()) {
|
||||
+ if (action.hasNumber() && action.hasDelay()) {
|
||||
+ list.add("[doNumber]");
|
||||
+ }
|
||||
+ }
|
||||
@@ -573,7 +573,7 @@ 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..c14601ed99c7c8353b0d37c1c7de0f74bec0c389
|
||||
index 0000000000000000000000000000000000000000..a79122d986fc6bad91d1f90c8dd9ce5207b8ba7e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
|
||||
@@ -0,0 +1,729 @@
|
||||
@@ -669,7 +669,7 @@ index 0000000000000000000000000000000000000000..c14601ed99c7c8353b0d37c1c7de0f74
|
||||
+
|
||||
+ private ServerBot(MinecraftServer server, ServerLevel world, GameProfile profile) {
|
||||
+ super(server, world, profile);
|
||||
+ this.entityData.set(new EntityDataAccessor<>(16, EntityDataSerializers.INT), 0xFF);
|
||||
+ // this.entityData.set(new EntityDataAccessor<>(16, EntityDataSerializers.INT), 0xFF);
|
||||
+
|
||||
+ this.velocity = new Vector(0, 0, 0);
|
||||
+ this.oldVelocity = velocity.clone();
|
||||
@@ -769,11 +769,11 @@ index 0000000000000000000000000000000000000000..c14601ed99c7c8353b0d37c1c7de0f74
|
||||
+ connection.send(packets[0]);
|
||||
+ if (all) {
|
||||
+ connection.send(packets[1]);
|
||||
+ connection.send(packets[2]);
|
||||
+ // connection.send(packets[2]);
|
||||
+ if (login) {
|
||||
+ connection.send(packets[3]); // This need delay 10 tick ? real ?
|
||||
+ connection.send(packets[2]); // This need delay 10 tick ? real ?
|
||||
+ } else {
|
||||
+ connection.send(packets[3]);
|
||||
+ connection.send(packets[2]);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -782,7 +782,7 @@ index 0000000000000000000000000000000000000000..c14601ed99c7c8353b0d37c1c7de0f74
|
||||
+ return new Packet[]{
|
||||
+ 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 ClientboundSetEntityDataPacket(this.getId(), ),
|
||||
+ new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f))
|
||||
+ };
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user