[Bug]: Conflict with ItemSwapper
pajicadvance opened this issue ยท 1 comments
Mod Loader (Required)
Fabric
Minecraft Version(s) (Required)
1.21.1
Mod Version(s) (Required)
v21.1.3
Other Mods Involved (Required)
Yes
Notes (Required)
Installing Puzzles Lib prevents walking with the ItemSwapper UI open, even when Allow Walking With UI is set to ON in ItemSwapper config
- Install ItemSwapper 0.7.1, Puzzles Lib 21.1.3, and ModMenu (to access configs)
- Ensure that Allow Walking With UI is set to ON in ItemSwapper config
- Load into a world, select any item in the hotbar and press and hold R to open the ItemSwapper UI
- With the UI still open, try to walk in any direction. It does not work
- Uninstall Puzzles Lib and try the same thing. It does work
Investigation:
ItemSwapper uses KeyMapping.same()
calls to determine whether to release the key presses or not: https://github.com/tr7zw/ItemSwapper/blob/main/src/main/java/dev/tr7zw/itemswapper/mixin/KeyMappingMixin.java
PuzzlesLib modifies the KeyMapping.same()
method to add additional logic and cancels it early: https://github.com/Fuzss/puzzleslib/blob/main/1.21.1/Fabric/src/main/java/fuzs/puzzleslib/fabric/mixin/client/KeyMappingFabricMixin.java. Most likely it makes the calls used in ItemSwapper always return false when they would normally return true.