fix fabric r click bug
add thoraxis music
This commit is contained in:
1 parent
6f47e59ff0
commit
918a5be5a8
8 files changed
+35
-35
No files matched your search
+4
@@ -8,12 +8,16 @@ import java.util.Map;
|
||||
import net.minecraft.client.KeyMapping;
|
||||
|
||||
public final class KeybindingConflictFixStore {
|
||||
private static final String ANTARCHY_KEY_PREFIX = "key.antarchy.";
|
||||
private static final Map<InputConstants.Key, List<KeyMapping>> MAPPINGS = new HashMap<>();
|
||||
|
||||
private KeybindingConflictFixStore() {
|
||||
}
|
||||
|
||||
public static void add(InputConstants.Key key, KeyMapping mapping) {
|
||||
if (!mapping.getName().startsWith(ANTARCHY_KEY_PREFIX)) {
|
||||
return;
|
||||
}
|
||||
List<KeyMapping> mappings = MAPPINGS.computeIfAbsent(key, ignored -> new ArrayList<>());
|
||||
if (!mappings.contains(mapping)) {
|
||||
mappings.add(mapping);
|
||||
|
||||
-17
@@ -19,7 +19,6 @@ public abstract class KeybindingConflictFixMixin {
|
||||
@Shadow @Final private static Map<String, KeyMapping> ALL;
|
||||
@Shadow private InputConstants.Key key;
|
||||
@Shadow private boolean isDown;
|
||||
@Shadow private int clickCount;
|
||||
|
||||
@Inject(method = "<init>(Ljava/lang/String;Lcom/mojang/blaze3d/platform/InputConstants$Type;ILjava/lang/String;)V", at = @At("TAIL"))
|
||||
private void antarchy$addInitialMapping(String name, InputConstants.Type type, int key, String category, CallbackInfo ci) {
|
||||
@@ -34,17 +33,6 @@ public abstract class KeybindingConflictFixMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "click", at = @At("TAIL"))
|
||||
private static void antarchy$clickConflicts(InputConstants.Key key, CallbackInfo ci) {
|
||||
if (!AntarchySettings.fabricKeybindingConflictFixEnabled()) {
|
||||
return;
|
||||
}
|
||||
KeyMapping active = MAP.get(key);
|
||||
for (KeyMapping mapping : KeybindingConflictFixStore.others(key, active)) {
|
||||
((KeybindingConflictFixMixin) (Object) mapping).antarchy$click();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "set", at = @At("TAIL"))
|
||||
private static void antarchy$setConflicts(InputConstants.Key key, boolean down, CallbackInfo ci) {
|
||||
if (!AntarchySettings.fabricKeybindingConflictFixEnabled()) {
|
||||
@@ -56,11 +44,6 @@ public abstract class KeybindingConflictFixMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void antarchy$click() {
|
||||
this.clickCount++;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void antarchy$setDown(boolean down) {
|
||||
this.isDown = down;
|
||||
|
||||
Reference in new issue
Block a user