Skip to content

Commit

Permalink
Also send events when records are played in Beta 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixaurora committed Nov 18, 2024
1 parent 56af998 commit 6c3caf5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ private SoundFile onBackgroundMusicQueued(SoundFile sound) {
return sound;
}

@ModifyExpressionValue(method = "playRecord", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/sound/system/Sounds;getRandom(Ljava/lang/String;)Lnet/minecraft/client/sound/system/SoundFile;"))
private SoundFile onRecordQueued(SoundFile sound) {
if (sound != null) {
MusicPolling.onPlaySong(sound, "streaming");
}

return sound;
}

/*
* There's a short time between when we queue a song and it registers as
* "playing."
Expand Down

0 comments on commit 6c3caf5

Please sign in to comment.