diff --git a/src/main/java/baritone/bot/GameEventHandler.java b/src/main/java/baritone/bot/GameEventHandler.java index c0f12d87..7b5f719c 100755 --- a/src/main/java/baritone/bot/GameEventHandler.java +++ b/src/main/java/baritone/bot/GameEventHandler.java @@ -23,6 +23,11 @@ public final class GameEventHandler implements IGameEventListener { dispatch(Behavior::onTick); } + @Override + public void onRenderPass() { + dispatch(Behavior::onRenderPass); + } + @Override public void onProcessKeyBinds() { InputOverrideHandler inputHandler = Baritone.INSTANCE.getInputOverrideHandler(); diff --git a/src/main/java/baritone/bot/RenderPassHandler.java b/src/main/java/baritone/bot/RenderPassHandler.java deleted file mode 100644 index 864567ec..00000000 --- a/src/main/java/baritone/bot/RenderPassHandler.java +++ /dev/null @@ -1,4 +0,0 @@ -package baritone.bot; - -public class RenderPassHandler { -} diff --git a/src/main/java/baritone/bot/event/AbstractGameEventListener.java b/src/main/java/baritone/bot/event/AbstractGameEventListener.java index 22199f3f..4a2b259e 100644 --- a/src/main/java/baritone/bot/event/AbstractGameEventListener.java +++ b/src/main/java/baritone/bot/event/AbstractGameEventListener.java @@ -29,4 +29,7 @@ public interface AbstractGameEventListener extends IGameEventListener { @Override default void onChunkEvent(ChunkEvent event) {} + + @Override + default void onRenderPass() {} } diff --git a/src/main/java/baritone/bot/event/IGameEventListener.java b/src/main/java/baritone/bot/event/IGameEventListener.java index e7694689..a6d3054f 100755 --- a/src/main/java/baritone/bot/event/IGameEventListener.java +++ b/src/main/java/baritone/bot/event/IGameEventListener.java @@ -40,4 +40,9 @@ public interface IGameEventListener { * @see WorldClient#doPreChunk(int, int, boolean) */ void onChunkEvent(ChunkEvent event); + + /** + * Runs once each frame + */ + void onRenderPass(); } diff --git a/src/main/java/baritone/launch/mixins/MixinEntityRenderer.java b/src/main/java/baritone/launch/mixins/MixinEntityRenderer.java index 2e079996..57a083d7 100644 --- a/src/main/java/baritone/launch/mixins/MixinEntityRenderer.java +++ b/src/main/java/baritone/launch/mixins/MixinEntityRenderer.java @@ -1,5 +1,6 @@ package baritone.launch.mixins; +import baritone.bot.Baritone; import net.minecraft.client.renderer.EntityRenderer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -17,7 +18,7 @@ public class MixinEntityRenderer { ) ) private void renderWorldPass(CallbackInfo ci) { - + Baritone.INSTANCE.getGameEventHandler().onRenderPass(); }