@@ -29,11 +29,11 @@ public class KeyMappingMixin {
29
29
@ Shadow
30
30
private static KeyMappingLookup MAP ;
31
31
32
- @ Shadow (remap = false , aliases = "f_90810_" )
32
+ @ Shadow (remap = false , aliases = { "f_90810_" , "MAP" } )
33
33
private static final Map <InputConstants .Key , KeyMapping > vanillaKeyMapping ;
34
-
34
+
35
35
private static final ThreadLocal <KeyMapping > KEY_MAPPING_LOCAL = new ThreadLocal <>();
36
-
36
+
37
37
@ Inject (method = "set" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/KeyMapping;setDown(Z)V" ))
38
38
private static void onSetKeyMapping (InputConstants .Key pKey , boolean pHeld , CallbackInfo ci , @ Local KeyMapping keyMapping ) {
39
39
KEY_MAPPING_LOCAL .set (keyMapping );
@@ -50,7 +50,7 @@ private static void connector_onSetKeyMapping(InputConstants.Key pKey, boolean p
50
50
// if they use the field in their code or otherwise reflect (see voxelmap)
51
51
// The field is added back through a coremod, and here it is semi-delegated
52
52
final EnumMap <KeyModifier , Map <InputConstants .Key , Collection <KeyMapping >>> actualMap = ObfuscationReflectionHelper
53
- .getPrivateValue (KeyMappingLookup .class , MAP , "map" );
53
+ .getPrivateValue (KeyMappingLookup .class , MAP , "map" );
54
54
final var delegate = actualMap .get (KeyModifier .NONE );
55
55
vanillaKeyMapping = new Map <>() {
56
56
@ Override
@@ -99,7 +99,7 @@ public KeyMapping remove(Object key) {
99
99
public boolean remove (Object key , Object value ) {
100
100
Object curValue = get (key );
101
101
if (!Objects .equals (curValue , value ) ||
102
- (curValue == null && !containsKey (key ))) {
102
+ (curValue == null && !containsKey (key ))) {
103
103
return false ;
104
104
}
105
105
MAP .remove ((KeyMapping ) value );
@@ -126,20 +126,20 @@ public Set<InputConstants.Key> keySet() {
126
126
@ Override
127
127
public Collection <KeyMapping > values () {
128
128
return delegate .values ()
129
- .stream ().flatMap (Collection ::stream )
130
- .toList ();
129
+ .stream ().flatMap (Collection ::stream )
130
+ .toList ();
131
131
}
132
132
133
133
@ NotNull
134
134
@ Override
135
135
public Set <Entry <InputConstants .Key , KeyMapping >> entrySet () {
136
136
return delegate .entrySet ().stream ()
137
- .filter (e -> !e .getValue ().isEmpty ())
138
- .collect (Collectors .toMap (
139
- Entry ::getKey ,
140
- e -> ((ArrayList <KeyMapping >) e .getValue ()).get (0 )
141
- ))
142
- .entrySet ();
137
+ .filter (e -> !e .getValue ().isEmpty ())
138
+ .collect (Collectors .toMap (
139
+ Entry ::getKey ,
140
+ e -> ((ArrayList <KeyMapping >) e .getValue ()).get (0 )
141
+ ))
142
+ .entrySet ();
143
143
}
144
144
};
145
145
}
0 commit comments