Search in sources :

Example 1 with OpenScreenEvent

use of meteordevelopment.meteorclient.events.game.OpenScreenEvent in project meteor-client by MeteorDevelopment.

the class MinecraftClientMixin method onSetScreen.

@Inject(method = "setScreen", at = @At("HEAD"), cancellable = true)
private void onSetScreen(Screen screen, CallbackInfo info) {
    if (screen instanceof WidgetScreen)
        screen.mouseMoved(mouse.getX() * window.getScaleFactor(), mouse.getY() * window.getScaleFactor());
    OpenScreenEvent event = OpenScreenEvent.get(screen);
    MeteorClient.EVENT_BUS.post(event);
    if (event.isCancelled())
        info.cancel();
}
Also used : WidgetScreen(meteordevelopment.meteorclient.gui.WidgetScreen) OpenScreenEvent(meteordevelopment.meteorclient.events.game.OpenScreenEvent)

Aggregations

OpenScreenEvent (meteordevelopment.meteorclient.events.game.OpenScreenEvent)1 WidgetScreen (meteordevelopment.meteorclient.gui.WidgetScreen)1