Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ public class AbstractWidgetMixin {
value = "INVOKE",
//? if >=1.21.9 {
target = "Lnet/minecraft/client/gui/components/AbstractWidget;onClick(Lnet/minecraft/client/input/MouseButtonEvent;Z)V"
//?} else {
//?} elif fabric {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit: Since this issue is NeoForge/Forge-specific, as they modify the vanilla method signature, would it be better to check for NeoForge and then use the else case for Fabric?

This approach scales better if Controlify adds another mod loader in the future, and it makes the code’s semantics clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah probably.

/*target = "Lnet/minecraft/client/gui/components/AbstractWidget;onClick(DD)V"
*///?} else {
/*target = "Lnet/minecraft/client/gui/components/AbstractWidget;onClick(DDI)V"
*///?}
)
)
private boolean openKeyboardInVmouseMode(
AbstractWidget instance,
//? if >=1.21.9 {
net.minecraft.client.input.MouseButtonEvent mouseButtonEvent, boolean doubleClick
//?} else {
//?} elif fabric {
/*double x, double y
*///?} else {
/*double x, double y, int button
*///?}
) {
Controlify controlify = Controlify.instance();
Expand Down