From b51a261bd10483a0ec10527f92db2171f4b7f9fc Mon Sep 17 00:00:00 2001 From: StijnSimons Date: Mon, 15 Jul 2019 22:31:55 +0200 Subject: [PATCH 1/2] Added entityfollow Hey look i can cntrl + c v --- .../api/utils/ExampleBaritoneControl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 2445f6341..29e2e9d17 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -411,6 +411,24 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener logDirect("Following any players"); return true; } + if (msg.startsWith("followentity")) { + String name = msg.substring(12).trim(); + Optional toFollow = Optional.empty(); + for (Entity entity : ctx.world().loadedEntityList) { + String entityName = entity.getName().trim().toLowerCase(); + if (entityName.contains(name) || name.contains(entityName)) { + toFollow = Optional.of(entity); + } + } + if (!toFollow.isPresent()) { + logDirect("Entity not found"); + return true; + } + Entity effectivelyFinal = toFollow.get(); + baritone.getFollowProcess().follow(effectivelyFinal::equals); + logDirect("Following entity " + toFollow.get()); + return true; + } if (msg.startsWith("follow")) { String name = msg.substring(6).trim(); Optional toFollow = Optional.empty(); From 3ba8824eb003aedec9edc334f2ec59c991ecad3b Mon Sep 17 00:00:00 2001 From: StijnSimons Date: Mon, 15 Jul 2019 22:34:52 +0200 Subject: [PATCH 2/2] More copy paste --- src/api/java/baritone/api/utils/ExampleBaritoneControl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 29e2e9d17..1b47c8a56 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -406,6 +406,11 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener } return true; } + if (msg.startsWith("followentities")) { + baritone.getFollowProcess().follow(Entity.class::isInstance); + logDirect("Following any entities"); + return true; + } if (msg.startsWith("followplayers")) { baritone.getFollowProcess().follow(EntityPlayer.class::isInstance); // O P P A logDirect("Following any players");