Are snapshots running in debug mode? Much more CPU hungry.
I've also tried these tricks 'wmname LG3D' and '_JAVA_AWT_WM_NONREPARENTING=1
'. Neither help. Both are common X tricks for tiling window managers, sway promotes the latter in its FAQ with an entry for Java. I have used the second one with XMonad in the past.
I can confirm that 'wmname' does change the name for Xwayland, not just the terminal I ran it in.
Reproduced issue on Exherbo with sway using oracle-jdk-bin:11. Both the latest snapshot and release. Unplayable.
I had to remove these flags for oracle java 11 as they are deprecated, the former warns while the latter isn't even recognized: -XX:+UseConcMarkSweepGC -XX+CMIncrementalMode.
With mouse sensitivity set to "yawn", I can see the direction of the spinning is always counter-clockwise regardless on if the mouse is inverted. Non-inverted is down, inverted is up. After toggling the mouse inversion, you can look into the horizon as it spins up/down. The mouse works fine for the UI, just not the 3D world.
Returning focus to the game also spins the cursor when pause-on-unfocus is disabled.
Moving the cursor only to the left hits an invisible barrier - observable looking at the sun (mouse inverted). Moving the mouse to the right restricted by the size of my mouse pad spins relative to the distance from the barrier. Initially at around 1/3 rotation. The further I move the mouse right, the faster it goes around eventually capping around 7 full rotations. Moving back to the left takes between the number of rotations after going right to ~25 rotations. Capping at 25 rotations, but it doesn't take 25 rotations to reach that cap.
Edit: after loading a world, defocusing, and refocusing after the world loaded. I can see my mouse cursor. The left barrier is the left of the screen. Moving up/down along the left does no spinning at all. The top, bottom, and right borders have no special effects.
Forced crash report. Superflat redstone ready world.