File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
java/com/aetherteam/cumulus/mixin/mixins/client Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .aetherteam .cumulus .mixin .mixins .client ;
2+
3+ import com .aetherteam .cumulus .client .CumulusClient ;
4+ import net .minecraft .client .Minecraft ;
5+ import net .minecraft .client .sounds .MusicManager ;
6+ import net .minecraft .sounds .Music ;
7+ import net .minecraft .sounds .Musics ;
8+ import org .spongepowered .asm .mixin .Mixin ;
9+ import org .spongepowered .asm .mixin .injection .At ;
10+ import org .spongepowered .asm .mixin .injection .ModifyVariable ;
11+
12+ @ Mixin (MusicManager .class )
13+ public class MusicManagerMixin {
14+ /**
15+ * This mixin modifies the return of {@link Minecraft#getSituationalMusic()} as it is given to the music variable in {@link MusicManager}.
16+ * @param music The original {@link Music} variable.
17+ * @return The modified {@link Music} variable.
18+ */
19+ @ ModifyVariable (method = "tick()V" , at = @ At (value = "STORE" ))
20+ public Music injected (Music music ) {
21+ if (music == Musics .MENU && CumulusClient .MENU_HELPER .getActiveMusic () != null ) {
22+ return CumulusClient .MENU_HELPER .getActiveMusic ();
23+ }
24+ return music ;
25+ }
26+ }
Original file line number Diff line number Diff line change 1010 "defaultRequire" : 1
1111 },
1212 "client" : [
13+ " client.MusicManagerMixin" ,
1314 " client.accessor.CreateWorldScreenAccessor" ,
1415 " client.accessor.RealmsPlayerScreenAccessor" ,
1516 " client.accessor.ScreenAccessor" ,
You can’t perform that action at this time.
0 commit comments