Skip to content

Commit

Permalink
disable vanilla music
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaIndustries committed Nov 27, 2024
1 parent c64e835 commit 562f3aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ minecraft_version=1.21.1
loader_version=0.16.9

# Mod Properties
mod_version=3.0.0
mod_version=4.0.0
maven_group=symbolics.division.meret
archives_base_name=meret

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.Holder;
import net.minecraft.sounds.Music;
import net.minecraft.sounds.SoundEvents;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -21,8 +23,12 @@ public class MinecraftMixin {
)
public void modifyGetSituationalMusic(CallbackInfoReturnable<Music> ci) {
Music override = MeretClient.getOverride(this.player);
if (override == null) return;
ci.setReturnValue(override);
if (override == null) {
// override vanilla music always
ci.setReturnValue(new Music(Holder.direct(SoundEvents.EMPTY), 10, 10, false));
} else {
ci.setReturnValue(override);
}
ci.cancel();
}
}

0 comments on commit 562f3aa

Please sign in to comment.