Skip to content

Use Fabric Api's ScreenMouseEvents$AllowMouseScroll event when a screen is open to allow for better mod compatibility #15

@Fuzss

Description

@Fuzss

Hi there, my Easy Shulker Boxes mod has a feature where you can scroll while hovering over a shulker box or bundle item in your inventory to change the slot to interact with the next time you right-click for extracting an item (as opposed to the vanilla bundle functionality where the last slot always is the one that will be interacted with).

Your Mouse Wheelie mod overrides this behavior with its item scrolling feature, which essentially comes back to Amecs and how the scroll keybind trigger is implemented in here:

private void onMouseScroll(long window, double rawX, double rawY, CallbackInfo callbackInfo, double deltaY) {
.

It would be great if Mouse Wheelie would allow me to handle the scroll (shulker boxes and bundles don't stack, so it wouldn't restrict Mouse Wheelie functionality anyway).

A very simple solution to this would be for you to only let your mixin run when no screen is open, and when a screen is open simply use net.fabricmc.fabric.api.client.screen.v1.ScreenMouseEvents$AllowMouseScroll, where I can register my callback at an earlier event phase than the default one, so I can cancel the event (mark the scroll handled) when I need to.

Would be great to see that change for both mods to be compatible, they really do complement each other quite well otherwise!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions