Forgified Fabric API

Forgified Fabric API

13M Downloads

Mouse return mixin trouble

Xsssya opened this issue ยท 1 comments

commented

It works with custom machinery to cause player_inventory in the custom machine to not be able to pick up and place items

kubejs.zip

The attached file is a machine that I built using kubejs and custom machinery
It has the above problems

The problem disappeared when the Forgified Fabric API was removed

I have tested this problem on the smallest mod scale
It's a must

Test version:
MineCraft: 1.21.1
neoforge -21.1.119
Forgified Fabric API -0.107.0+2.0.23
custom machinery-1.21.1-0.10.22
kubejs-2101.7.1-build.181

Please excuse my poor English

commented

Hi, I'm the dev of Custom Machinery.
The issue mentioned here can actually affect any mod that add widgets in a container screen.

More precisely the issue comes from a mixin in the screen API : https://github.com/Sinytra/ForgifiedFabricAPI/blob/1.21.1/fabric-screen-api-v1/src/client/java/net/fabricmc/fabric/mixin/screen/HandledScreenMixin.java#L36

Returning early on mouse released breaks the default behavior implemented by NeoForge here : https://github.com/neoforged/NeoForge/blob/1.21.x/patches/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch#L108

As you can see on NeoForge the normal behavior is that mouseReleased() shouldn't return early but your mixin break this assumption. Not to mention that as NeoForge already calls super.mouseReleased your mixin will make it called twice which could cause other issues.