package net.minecraft.world.item; import net.minecraft.Util; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; public interface Instruments { int GOAT_HORN_RANGE_BLOCKS = 256; float GOAT_HORN_DURATION = 7.0F; ResourceKey PONDER_GOAT_HORN = create("ponder_goat_horn"); ResourceKey SING_GOAT_HORN = create("sing_goat_horn"); ResourceKey SEEK_GOAT_HORN = create("seek_goat_horn"); ResourceKey FEEL_GOAT_HORN = create("feel_goat_horn"); ResourceKey ADMIRE_GOAT_HORN = create("admire_goat_horn"); ResourceKey CALL_GOAT_HORN = create("call_goat_horn"); ResourceKey YEARN_GOAT_HORN = create("yearn_goat_horn"); ResourceKey DREAM_GOAT_HORN = create("dream_goat_horn"); private static ResourceKey create(String name) { return ResourceKey.create(Registries.INSTRUMENT, ResourceLocation.withDefaultNamespace(name)); } static void bootstrap(BootstrapContext bootstrapContext) { register(bootstrapContext, PONDER_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(0), 7.0F, 256.0F); register(bootstrapContext, SING_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(1), 7.0F, 256.0F); register(bootstrapContext, SEEK_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(2), 7.0F, 256.0F); register(bootstrapContext, FEEL_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(3), 7.0F, 256.0F); register(bootstrapContext, ADMIRE_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(4), 7.0F, 256.0F); register(bootstrapContext, CALL_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(5), 7.0F, 256.0F); register(bootstrapContext, YEARN_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(6), 7.0F, 256.0F); register(bootstrapContext, DREAM_GOAT_HORN, (Holder)SoundEvents.GOAT_HORN_SOUND_VARIANTS.get(7), 7.0F, 256.0F); } static void register(BootstrapContext bootstrapContext, ResourceKey resourceKey, Holder holder, float f, float g) { MutableComponent mutableComponent = Component.translatable(Util.makeDescriptionId("instrument", resourceKey.location())); bootstrapContext.register(resourceKey, new Instrument(holder, f, g, mutableComponent)); } }