Merith-TK / cc-restitched-unmaintained

CC: Tweaked ported for Fabric 1.16.x
Other
10 stars 11 forks source link

[Bug] Turtles do not return `mouse_up` event #51

Closed Merith-TK closed 3 years ago

Merith-TK commented 3 years ago

Useful information to include:

turtles do not return mouse up event

toad-dev commented 3 years ago

I poked around in the debugger and found that the mouse event packet (don't remember the class name I'm on mobile) isn't being sent to the server for turtle mouse_up's. I didn't have time to trace it further back but it's a bit of a head scratcher as turtles and computers share most of their code along that path and computers are working.

hugeblank commented 3 years ago

It's definitely a client side thing. having a program that just listens for mouse_up events shows that they fire when opening up the turtle GUI, but otherwise don't.

hugeblank commented 3 years ago

found the issue, will be committing fix soon :D

hugeblank commented 3 years ago

Actually I lie. I'm going to do a refactor, a lot of the code between computer and turtle is shared, and to prevent future issues like this from cropping up I'll have both GUIs extend from one class.

SquidDev commented 3 years ago

@hugeblank Can you explain the problem? I couldn't see anything off with the GuiTurtle code in its current state.

hugeblank commented 3 years ago

@hugeblank Can you explain the problem? I couldn't see anything off with the GuiTurtle code in its current state.

The issue was that GuiTurtle was missing the mouseRelease method override. GuiComputer had it. This was why the issue couldn't be reproduced on computers.

toad-dev commented 3 years ago

I haven't looked at the newest commit, but in GuiComputer there is this override handler:

@Override public boolean mouseReleased( double mouseX, double mouseY, int button )

It doesn't exist on forge because the super handler doesn't seem to consume the mouse release event over there. It does on fabric though so not having that same handler in GuiTurtle is what's causing the bug.

SquidDev commented 3 years ago

Ahhh, joys of Forge patching things (well, and fixing vanilla bugs).