commit 8e1a2f8e479a4f66cb64dd9383e4d4ed0aecba92
parent f7e96ccbb47cb26a48cb33fb97007cf9c6686f80
Author: Amb0s <ambos@disroot.org>
Date: Fri, 11 Aug 2023 10:13:40 +0200
Fixed mod resources path and updated README
Diffstat:
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
@@ -1,10 +1,14 @@
# Vanilla Fixes
## Fixes
-* Jittering
+* Removed jittering
+* Reduced block hit delays
+* Changed mod resources directory path
+* Fixed version display
## Improvements
-* Minimal main menu
+* Removed some elements on the main menu
+* Item durability and damage display in the tooltip
## Instructions
diff --git a/src/main/java/turniplabs/vanillafixes/mixin/SoundManagerMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/SoundManagerMixin.java
@@ -5,25 +5,35 @@ 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.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
import java.io.File;
@Mixin(value = SoundManager.class, remap = false)
final class SoundManagerMixin {
+ @Redirect(method = "loadModAudio", at = @At(value = "INVOKE",
+ target = "Lnet/minecraft/client/Minecraft;getAppDir(Ljava/lang/String;)Ljava/io/File;", ordinal = 0))
+ private static File doNotGetAppDir(String s) {
+ return new File(s);
+ }
+
@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) {
+ private void changeModResourcesPath(Args args) {
+ // Note: "mod" directory is now inside .minecraft/resources instead of $HOME/.minecraft-bta/resources
+ // (MultiMC users should be happy)
+ Minecraft mc = Minecraft.getMinecraft(Minecraft.class);
if (args.get(0) == "minecraft-bta/resources/mod/sound") {
- args.set(0, "minecraft/resources/mod/sound");
+ args.set(0, mc.getMinecraftDir() + "/resources/mod/sound");
} else if (args.get(0) == "minecraft-bta/resources/mod/streaming") {
- args.set(0, "minecraft/resources/mod/streaming");
+ args.set(0, mc.getMinecraftDir() + "/resources/mod/streaming");
} else if (args.get(0) == "minecraft-bta/resources/mod/music") {
- args.set(0, "minecraft/resources/mod/music");
+ args.set(0, mc.getMinecraftDir() + "/resources/mod/music");
} else {
- args.set(0, "minecraft/resources/mod/cavemusic");
+ args.set(0, mc.getMinecraftDir() + "/resources/mod/cavemusic");
}
}
}