Add render pass game event

This commit is contained in:
Howard Stark 2018-08-04 21:55:38 -04:00
parent 89a64a375e
commit 9bda792a3e
No known key found for this signature in database
GPG Key ID: 9FA4E350B33067F3
5 changed files with 15 additions and 5 deletions

View File

@ -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();

View File

@ -1,4 +0,0 @@
package baritone.bot;
public class RenderPassHandler {
}

View File

@ -29,4 +29,7 @@ public interface AbstractGameEventListener extends IGameEventListener {
@Override
default void onChunkEvent(ChunkEvent event) {}
@Override
default void onRenderPass() {}
}

View File

@ -40,4 +40,9 @@ public interface IGameEventListener {
* @see WorldClient#doPreChunk(int, int, boolean)
*/
void onChunkEvent(ChunkEvent event);
/**
* Runs once each frame
*/
void onRenderPass();
}

View File

@ -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();
}