Skip to content

Commit

Permalink
Fix fakeplayer rot set
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Dec 2, 2024
1 parent 8045636 commit 3c93f30
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2126,10 +2126,10 @@ index 0000000000000000000000000000000000000000..4162df8802b1af73d9a0a76f846ab9ad
+}
diff --git a/src/main/java/org/leavesmc/leaves/bot/ServerBot.java b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java
new file mode 100644
index 0000000000000000000000000000000000000000..40f46253389bd75afeebcc7954c1132ac7e97298
index 0000000000000000000000000000000000000000..f83b787a6827bdcf3927dbf2a0a0fa6e998959ac
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java
@@ -0,0 +1,561 @@
@@ -0,0 +1,556 @@
+package org.leavesmc.leaves.bot;
+
+import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -2507,11 +2507,6 @@ index 0000000000000000000000000000000000000000..40f46253389bd75afeebcc7954c1132a
+ }
+
+ @Override
+ public void setRot(float yaw, float pitch) {
+ this.getBukkitEntity().setRotation(yaw, pitch);
+ }
+
+ @Override
+ public void attack(@NotNull Entity target) {
+ super.attack(target);
+ this.swing(InteractionHand.MAIN_HAND);
Expand Down Expand Up @@ -3318,7 +3313,7 @@ index 0000000000000000000000000000000000000000..be55a3085a53542c08e7f0209883a4f3
+}
diff --git a/src/main/java/org/leavesmc/leaves/bot/agent/actions/AttackAction.java b/src/main/java/org/leavesmc/leaves/bot/agent/actions/AttackAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..03e9baf9b7c2da0fd1d7d9b0058b70daddedeeaa
index 0000000000000000000000000000000000000000..6c66ef29e702a49d1b8569aa0942e22e40843343
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bot/agent/actions/AttackAction.java
@@ -0,0 +1,22 @@
Expand All @@ -3336,7 +3331,7 @@ index 0000000000000000000000000000000000000000..03e9baf9b7c2da0fd1d7d9b0058b70da
+
+ @Override
+ public boolean doTick(@NotNull ServerBot bot) {
+ Entity entity = bot.getTargetEntity(3, Entity::isAttackable);
+ Entity entity = bot.getTargetEntity(3, target -> target.isAttackable() && !target.skipAttackInteraction(bot));
+ if (entity != null) {
+ bot.attack(entity);
+ return true;
Expand Down

0 comments on commit 3c93f30

Please sign in to comment.