Plasma rifle fire sound
This commit is contained in:
parent
813a6f0ceb
commit
25916f920d
@ -1,5 +1,6 @@
|
|||||||
package ru.dbotthepony.mc.otm.item.weapon
|
package ru.dbotthepony.mc.otm.item.weapon
|
||||||
|
|
||||||
|
import net.minecraft.sounds.SoundSource
|
||||||
import net.minecraft.util.Mth
|
import net.minecraft.util.Mth
|
||||||
import net.minecraft.world.entity.Entity
|
import net.minecraft.world.entity.Entity
|
||||||
import net.minecraft.world.entity.player.Player
|
import net.minecraft.world.entity.player.Player
|
||||||
@ -9,6 +10,7 @@ import ru.dbotthepony.mc.otm.core.*
|
|||||||
import ru.dbotthepony.mc.otm.core.Vector
|
import ru.dbotthepony.mc.otm.core.Vector
|
||||||
import ru.dbotthepony.mc.otm.entity.PlasmaProjectile
|
import ru.dbotthepony.mc.otm.entity.PlasmaProjectile
|
||||||
import ru.dbotthepony.mc.otm.position
|
import ru.dbotthepony.mc.otm.position
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MSoundEvents
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
@ -145,6 +147,15 @@ class PlasmaRifleItem : PlasmaWeaponItem<WeaponDataTable>(WeaponDataTable::class
|
|||||||
dt.doFireAnim(deviation = rotFireAnimDeviation)
|
dt.doFireAnim(deviation = rotFireAnimDeviation)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.level.playSound(
|
||||||
|
player,
|
||||||
|
player,
|
||||||
|
MSoundEvents.RIFLE_SHOT,
|
||||||
|
SoundSource.NEUTRAL,
|
||||||
|
1f,
|
||||||
|
1f
|
||||||
|
)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ object MRegistry {
|
|||||||
MItems.register()
|
MItems.register()
|
||||||
AndroidFeatures.register()
|
AndroidFeatures.register()
|
||||||
AndroidResearch.register()
|
AndroidResearch.register()
|
||||||
|
MSoundEvents.register()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun register(event: NewRegistryEvent) {
|
private fun register(event: NewRegistryEvent) {
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.registry
|
||||||
|
|
||||||
|
import net.minecraft.resources.ResourceLocation
|
||||||
|
import net.minecraft.sounds.SoundEvent
|
||||||
|
import net.minecraft.world.entity.EntityType
|
||||||
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext
|
||||||
|
import net.minecraftforge.registries.DeferredRegister
|
||||||
|
import net.minecraftforge.registries.ForgeRegistries
|
||||||
|
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||||
|
|
||||||
|
object MSoundEvents {
|
||||||
|
private val registry: DeferredRegister<SoundEvent> = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, OverdriveThatMatters.MOD_ID)
|
||||||
|
|
||||||
|
val RIFLE_SHOT by registry.register("item.rifle_shot") { SoundEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, "item.rifle_shot")) }
|
||||||
|
|
||||||
|
internal fun register() {
|
||||||
|
registry.register(FMLJavaModLoadingContext.get().modEventBus)
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"otm.sound.rifle_shoot": "Plasma rifle fire",
|
||||||
"itemGroup.otm": "Overdrive That Matters",
|
"itemGroup.otm": "Overdrive That Matters",
|
||||||
|
|
||||||
"otm.pill.warning": "WARNING: This will INSTANTLY decommission you upon ingestion!",
|
"otm.pill.warning": "WARNING: This will INSTANTLY decommission you upon ingestion!",
|
||||||
|
12
src/main/resources/assets/overdrive_that_matters/sounds.json
Normal file
12
src/main/resources/assets/overdrive_that_matters/sounds.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"item.rifle_shot": {
|
||||||
|
"subtitle": "otm.sound.rifle_shoot",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "overdrive_that_matters:item/rifle_shot",
|
||||||
|
"volume": 1.0,
|
||||||
|
"weight": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user