WayFix icon indicating copy to clipboard operation
WayFix copied to clipboard

Crash on development environment

Open heipiao233 opened this issue 1 year ago • 0 comments

I'm working on an IME mod, and want to test it under Wayland, so I added this mod as a runtime dependency. However I found that WayFixForge.java#34 uses DistExecutor#safeRunWhenOn improperly on Forge (and NeoForge 1.20.1).

Forge Document says:

These two methods are subdivided further into #safe* and #unsafe* variants. Safe and unsafe variants are misnomers for their purposes. The main difference is that when in a development environment, the #safe* methods will validate that the supplied executing method is a lambda returning a method reference to another class with an error being thrown otherwise. Within the production environment, #safe* and #unsafe* are functionally the same.

So setupConfigScreen can't be in WayFixForge, if calling safeRunWhenOn in WayFixForge. Although this doesn't affect end user, it makes developing mods in Wayland environment harder.

Environment: WayFix 1.0.9, Minecraft 1.20.1, NeoForge 47.1.106.

heipiao233 avatar Oct 01 '25 06:10 heipiao233