diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/MatchoAlert.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/MatchoAlert.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt index 54abc99..1b2bb7a 100644 --- a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt +++ b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt @@ -1,10 +1,11 @@ package dulkirmod.features -import dulkirmod.DulkirMod +import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils +import net.minecraft.client.audio.SoundCategory object MatchoAlert { @@ -21,8 +22,12 @@ object MatchoAlert { if (TabListUtils.explosivity && !hasSentAlert) { val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor) TitleUtils.drawStringForTime("${color}Matcho", 5000) - if (DulkirConfig.bestiaryAlertSounds) - DulkirMod.mc.thePlayer.playSound("mob.villager.yes", 1f * DulkirConfig.bestiaryNotifVol, 0f) + if (DulkirConfig.bestiaryAlertSounds) { + val prevVol = mc.gameSettings.getSoundLevel(SoundCategory.MOBS) + mc.gameSettings.setSoundLevel(SoundCategory.MOBS, 1f) + mc.thePlayer.playSound("mob.villager.yes", 1f * DulkirConfig.bestiaryNotifVol, 0f) + mc.gameSettings.setSoundLevel(SoundCategory.MOBS, prevVol) + } hasSentAlert = true } else if (!TabListUtils.explosivity) hasSentAlert = false } |