-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix ambient sounds to mono channel - play mother sound when boss bar is active - add sounds to remains defender, ghost and vulnerability
- Loading branch information
1 parent
d137dba
commit c9d2160
Showing
17 changed files
with
309 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/de/teamlapen/vampirism/mixin/client/BossHealthOverlayAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.teamlapen.vampirism.mixin.client; | ||
|
||
import net.minecraft.client.gui.components.BossHealthOverlay; | ||
import net.minecraft.client.gui.components.LerpingBossEvent; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
@Mixin(BossHealthOverlay.class) | ||
public interface BossHealthOverlayAccessor { | ||
|
||
@Accessor("events") | ||
Map<UUID, LerpingBossEvent> getEvents(); | ||
} |
19 changes: 15 additions & 4 deletions
19
src/main/java/de/teamlapen/vampirism/mixin/client/MinecraftMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
package de.teamlapen.vampirism.mixin.client; | ||
|
||
import de.teamlapen.vampirism.blockentity.MotherBlockEntity; | ||
import de.teamlapen.vampirism.VampirismMod; | ||
import de.teamlapen.vampirism.core.ModSounds; | ||
import de.teamlapen.vampirism.proxy.ClientProxy; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.Gui; | ||
import net.minecraft.client.gui.components.LerpingBossEvent; | ||
import net.minecraft.sounds.Music; | ||
import org.spongepowered.asm.mixin.Final; | ||
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.util.Map; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
@Mixin(Minecraft.class) | ||
public class MinecraftMixin { | ||
|
||
@Final | ||
@Shadow | ||
public Gui gui; | ||
@Inject(method="getSituationalMusic", at=@At(value="INVOKE", target = "Lnet/minecraft/world/level/Level;getBiome(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/core/Holder;"), cancellable = true) | ||
private void getSituationalMusicVampirism(CallbackInfoReturnable<Music> cir){ | ||
if(MotherBlockEntity.IS_A_MOTHER_LOADED_UNRELIABLE && Minecraft.getInstance().gui.getBossOverlay().shouldPlayMusic()){ | ||
cir.setReturnValue(ModSounds.getMotherMusic()); | ||
} | ||
Map<UUID, LerpingBossEvent> events = ((BossHealthOverlayAccessor) this.gui.getBossOverlay()).getEvents(); | ||
events.values().stream().map(s -> ((ClientProxy) VampirismMod.proxy).getBossEventSound(s.getId())).filter(Objects::nonNull).findFirst().ifPresent(s -> cir.setReturnValue(ModSounds.getMusic(s))); | ||
} | ||
} |
Oops, something went wrong.