pathing frame listener
This commit is contained in:
parent
c1306ab8bf
commit
4cbf20922c
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user