commit f7e96ccbb47cb26a48cb33fb97007cf9c6686f80
parent bbadcf9baf4bde610b8d298656596678a5303502
Author: Amb0s <ambos@disroot.org>
Date: Fri, 11 Aug 2023 09:33:44 +0200
Removed useless mixin and changed directory path
Diffstat:
3 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/src/main/java/turniplabs/vanillafixes/mixin/MinecraftMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/MinecraftMixin.java
@@ -1,29 +0,0 @@
-package turniplabs.vanillafixes.mixin;
-
-import net.minecraft.client.Minecraft;
-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.CallbackInfoReturnable;
-
-import java.io.File;
-
-@Mixin(value = Minecraft.class, remap = false)
-final class MinecraftMixin {
- @Shadow
- private File mcDataDir;
- @Shadow
- private static File minecraftDir;
-
- @Shadow
- public static File getAppDir(String s) {
- return null;
- }
-
- @Inject(method = "getMinecraftDir", at = @At("TAIL"), require = 0)
- private void renameMinecraftdirectory(CallbackInfoReturnable<File> cir) {
- minecraftDir = getAppDir("bta");
- mcDataDir = getAppDir("bta");
- }
-}
diff --git a/src/main/java/turniplabs/vanillafixes/mixin/SoundManagerMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/SoundManagerMixin.java
@@ -1,25 +1,29 @@
package turniplabs.vanillafixes.mixin;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.sound.SoundManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
+import java.io.File;
+
@Mixin(value = SoundManager.class, remap = false)
final class SoundManagerMixin {
@ModifyArgs(method = "loadSoundSettings", at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/sound/SoundManager;loadModAudio(Ljava/lang/String;Lnet/minecraft/client/sound/SoundPool;)V"),
require = 0)
private void renameMinecraftdirectory(Args args) {
+
if (args.get(0) == "minecraft-bta/resources/mod/sound") {
- args.set(0, "bta/resources/mod/sound");
+ args.set(0, "minecraft/resources/mod/sound");
} else if (args.get(0) == "minecraft-bta/resources/mod/streaming") {
- args.set(0, "bta/resources/mod/streaming");
+ args.set(0, "minecraft/resources/mod/streaming");
} else if (args.get(0) == "minecraft-bta/resources/mod/music") {
- args.set(0, "bta/resources/mod/music");
+ args.set(0, "minecraft/resources/mod/music");
} else {
- args.set(0, "bta/resources/mod/cavemusic");
+ args.set(0, "minecraft/resources/mod/cavemusic");
}
}
}
diff --git a/src/main/resources/vanillafixes.mixins.json b/src/main/resources/vanillafixes.mixins.json
@@ -6,7 +6,6 @@
"mixins": [
"GlobalMixin",
"GuiTooltipMixin",
- "MinecraftMixin",
"PlayerControllerMixin",
"SoundManagerMixin",
"ToolMaterialMixin"