diff --git a/src/main/java/baritone/bot/Baritone.java b/src/main/java/baritone/bot/Baritone.java index 8ef538aa..8dbfc188 100755 --- a/src/main/java/baritone/bot/Baritone.java +++ b/src/main/java/baritone/bot/Baritone.java @@ -1,6 +1,7 @@ package baritone.bot; import baritone.bot.behavior.Behavior; +import baritone.bot.behavior.impl.PathingBehavior; import java.util.ArrayList; import java.util.List; @@ -40,6 +41,7 @@ public enum Baritone { this.gameEventHandler = new GameEventHandler(); this.inputOverrideHandler = new InputOverrideHandler(); this.behaviors = new ArrayList<>(); + behaviors.add(PathingBehavior.INSTANCE); this.active = true; this.initialized = true; diff --git a/src/main/java/baritone/bot/GameEventHandler.java b/src/main/java/baritone/bot/GameEventHandler.java index 1edaac83..b3570110 100755 --- a/src/main/java/baritone/bot/GameEventHandler.java +++ b/src/main/java/baritone/bot/GameEventHandler.java @@ -82,7 +82,7 @@ public final class GameEventHandler implements IGameEventListener { @Override public void onRenderPass(RenderEvent event) { - dispatch(behavior -> onRenderPass(event)); + dispatch(behavior -> behavior.onRenderPass(event)); } @Override diff --git a/src/main/java/baritone/bot/behavior/Behavior.java b/src/main/java/baritone/bot/behavior/Behavior.java index c2825384..e61f5850 100644 --- a/src/main/java/baritone/bot/behavior/Behavior.java +++ b/src/main/java/baritone/bot/behavior/Behavior.java @@ -14,7 +14,7 @@ public class Behavior implements AbstractGameEventListener, Helper { /** * Whether or not this behavior is enabled */ - private boolean enabled; + private boolean enabled = true; /** * Toggles the enabled state of this {@link Behavior}. @@ -51,7 +51,7 @@ public class Behavior implements AbstractGameEventListener, Helper { * that should always be active, given that the bot itself is * active. * - * @param oldState The old state + * @param oldState The old state * @param proposedState The proposed state * @return The new state */ diff --git a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java index 471a02df..d41d01e7 100644 --- a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java @@ -1,6 +1,7 @@ package baritone.bot.behavior.impl; import baritone.bot.behavior.Behavior; +import baritone.bot.event.events.RenderEvent; import baritone.bot.pathing.path.IPath; import baritone.bot.pathing.path.PathExecutor; @@ -14,6 +15,7 @@ public class PathingBehavior extends Behavior { @Override public void onTick() { + System.out.println("Ticking"); if (current == null) { return; } @@ -33,4 +35,11 @@ public class PathingBehavior extends Behavior { } return current.getPath(); } + + @Override + public void onRenderPass(RenderEvent event) { + System.out.println("Render passing"); + System.out.println(event.getPartialTicks()); + } + }