package ru.dbotthepony.mc.otm.registry

import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents
import net.minecraft.world.entity.EntityType
import net.minecraftforge.eventbus.api.IEventBus
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)

	// TODO: 1.19.3
	private fun make(name: String) = registry.register(name) { SoundEvent.createVariableRangeEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, name)) }

	val RIFLE_SHOT: SoundEvent 				by make("item.rifle_shot")
	val PLASMA_WEAPON_OVERHEAT: SoundEvent 	by make("item.plasma_weapon_overheat")
	val PLAYER_BECOME_ANDROID: SoundEvent 	by make("player_become_android")
	val CARGO_CRATE_OPEN: SoundEvent 		by make("cargo_crate_open")

	val ANDROID_JUMP_BOOST: SoundEvent		by make("android.jump_boost")
	val ANDROID_SHOCKWAVE: SoundEvent		by make("android.shockwave")
	val ANDROID_PROJ_PARRY: SoundEvent		by make("android.projectile_parry")

	internal fun register(bus: IEventBus) {
		registry.register(bus)
	}
}
