1
0
forked from Clones/Controlify

fix bugs:

fix reconnecting controllers are unidentified
fix some mod keybinds failing to register
fix crash with unmapped joysticks
This commit is contained in:
isXander
2023-05-02 12:30:34 +01:00
parent 4e076631a4
commit 681eabd90a
12 changed files with 57 additions and 10 deletions

View File

@ -417,7 +417,12 @@ public class ControllerBindings<T extends ControllerState> {
continue;
try {
var identifier = new ResourceLocation("fabric-key-binding-api-v1", keyMapping.getName());
var idPath = keyMapping.getName()
.toLowerCase()
.replaceAll("[^a-z0-9/._-]", "_")
.trim();
var identifier = new ResourceLocation("fabric-key-binding-api-v1", idPath);
BooleanSupplier toggleOverride = () -> false;
if (keyMapping instanceof ToggleKeyMapping toggleKeyMapping) {
toggleOverride = ((ToggleKeyMappingAccessor) toggleKeyMapping).getNeedsToggle();