diff options
author | Ronald Inglett <71849533+inglettronald@users.noreply.github.com> | 2023-06-26 17:32:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 17:32:59 -0500 |
commit | ef1eac4f891c16e169c3a79eabc02a9e94fc55d2 (patch) | |
tree | 27630c8b768e9b3141cc6efc0bcce2c460779e49 /src/main/kotlin/dulkirmod/features | |
parent | 5aa81b2dbf81f0ef3907ebec082828b7e0023798 (diff) | |
parent | 23840aa72afb6708cfc2474873c0d6be6fe2da6f (diff) | |
download | DulkirMod-ef1eac4f891c16e169c3a79eabc02a9e94fc55d2.tar.gz DulkirMod-ef1eac4f891c16e169c3a79eabc02a9e94fc55d2.tar.bz2 DulkirMod-ef1eac4f891c16e169c3a79eabc02a9e94fc55d2.zip |
Merge pull request #20 from romangraef/feat/hypefixes
Various fixes for hype sound effects
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/ImpactDisplay.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/features/ReaperDisplay.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt | 22 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt index 9415edc..5e473ee 100644 --- a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt @@ -1,8 +1,8 @@ package dulkirmod.features +import dulkirmod.events.AlwaysPlaySoundEvent import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.client.event.sound.PlaySoundEvent import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable @@ -25,7 +25,7 @@ object ImpactDisplay { } @SubscribeEvent - fun onSound(event: PlaySoundEvent) { + fun onSound(event: AlwaysPlaySoundEvent) { if (event.name != "mob.zombie.remedy") return if (event.sound.pitch != 0.6984127f) return if (event.sound.volume != 1.0f) return diff --git a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt index c595775..5d7207f 100644 --- a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt @@ -1,8 +1,8 @@ package dulkirmod.features +import dulkirmod.events.AlwaysPlaySoundEvent import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.client.event.sound.PlaySoundEvent import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable @@ -25,7 +25,7 @@ object ReaperDisplay { } @SubscribeEvent - fun onSound(event: PlaySoundEvent) { + fun onSound(event: AlwaysPlaySoundEvent) { if (event.name != "mob.zombie.remedy") return if (event.sound.pitch != 1.0f) return if (event.sound.volume != .5f) return diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index d91e59e..242e226 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -1,9 +1,9 @@ package dulkirmod.features.chat import dulkirmod.config.DulkirConfig +import dulkirmod.events.AlwaysPlaySoundEvent import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent -import net.minecraftforge.client.event.sound.PlaySoundEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -11,16 +11,16 @@ private val abiphoneFormat = "✆ (\\w+) ✆ ".toRegex() private var lastRing: Long = 0 object AbiphoneDND { - //BLOCK ABIPHONE SOUNDS - @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) - fun onSound(event: PlaySoundEvent) { - if (!DulkirConfig.abiDND) return - if (System.currentTimeMillis() - lastRing < 5000) { - if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { - event.result = null - } - } - } + //BLOCK ABIPHONE SOUNDS + @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) + fun onSound(event: AlwaysPlaySoundEvent) { + if (!DulkirConfig.abiDND) return + if (System.currentTimeMillis() - lastRing < 5000) { + if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { + event.result = null + } + } + } fun handle(event: ClientChatReceivedEvent, unformatted: String) { if (!DulkirConfig.abiDND) return |