Skip to content

Commit

Permalink
remove no longer necessary legacy workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolij committed Jul 4, 2024
1 parent 4e7411e commit 21d8ae7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 60 deletions.
7 changes: 7 additions & 0 deletions legacy/src/main/java/dev/nolij/zume/legacy/LegacyZume.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import net.legacyfabric.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.SmoothUtil;
Expand All @@ -25,6 +26,12 @@ public void onInitializeClient() {
Zume.LOGGER.info("Loading Legacy Zume...");

Zume.registerImplementation(this, FabricLoader.getInstance().getConfigDir());
if (Zume.disabled)
return;

for (final ZumeKeyBind keyBind : ZumeKeyBind.values()) {
KeyBindingHelper.registerKeyBinding(keyBind.value);
}
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
package dev.nolij.zume.mixin.legacy;

import dev.nolij.zume.impl.Zume;
import dev.nolij.zumegradle.proguard.ProGuardKeep;
import net.minecraft.client.option.KeyBinding;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Map;
import java.util.Set;

@Mixin(KeyBinding.class)
public abstract class KeyBindingMixin {

@Shadow private boolean pressed;

@SuppressWarnings({"MissingUnique", "unused", "MismatchedQueryAndUpdateOfCollection"})
@ProGuardKeep
private static Map<String, Integer> field_15867; // vintage intermediary

@SuppressWarnings({"MissingUnique", "unused", "MismatchedQueryAndUpdateOfCollection"})
@ProGuardKeep
private static Set<String> field_7614; // archaic intermediary

@Inject(method = "<clinit>", at = @At("TAIL"))
private static void static$TAIL(CallbackInfo ci) {
if (Zume.disabled)
return;

if (field_7614 != null)
field_7614.add("zume");
if (field_15867 != null)
field_15867.put("zume", 8);
}

// ugly hack for <=6.4 compat
@SuppressWarnings({"MissingUnique", "unused"})
@ProGuardKeep
Expand Down
1 change: 0 additions & 1 deletion legacy/src/main/resources/zume-legacy.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"compatibilityLevel": "JAVA_8",
"client": [
"legacy.MinecraftClientMixin",
"legacy.GameOptionsMixin",
"legacy.GameRendererAccessor",
"legacy.GameRendererMixin",
"legacy.KeyBindingMixin"
Expand Down

0 comments on commit 21d8ae7

Please sign in to comment.