diff --git a/src/main/java/org/cyclops/cyclopscore/config/ConfigurableType.java b/src/main/java/org/cyclops/cyclopscore/config/ConfigurableType.java index bb8fdf9d46..21f7f09d03 100644 --- a/src/main/java/org/cyclops/cyclopscore/config/ConfigurableType.java +++ b/src/main/java/org/cyclops/cyclopscore/config/ConfigurableType.java @@ -84,6 +84,7 @@ public class ConfigurableType { public static final ConfigurableType LOOT_NUMBER_PROVIDER = new ConfigurableType(true, LootNumberProviderConfig.class, new ConfigurableTypeActionForge<>(), "loot_number_provider"); public static final ConfigurableType LOOT_NBT_PROVIDER = new ConfigurableType(true, LootNbtProviderConfig.class, new ConfigurableTypeActionForge<>(), "loot_nbt_provider"); public static final ConfigurableType LOOT_SCORE_PROVIDER = new ConfigurableType(true, LootScoreProviderConfig.class, new ConfigurableTypeActionForge<>(), "loot_score_provider"); + public static final ConfigurableType SOUND_EVENT = new ConfigurableType(true, SoundEventConfig.class, new ConfigurableTypeActionForge<>(), "sound_event"); /** * Dummy type, only used for configs that refer to nothing. diff --git a/src/main/java/org/cyclops/cyclopscore/config/extendedconfig/SoundEventConfig.java b/src/main/java/org/cyclops/cyclopscore/config/extendedconfig/SoundEventConfig.java new file mode 100644 index 0000000000..28f9b9e49a --- /dev/null +++ b/src/main/java/org/cyclops/cyclopscore/config/extendedconfig/SoundEventConfig.java @@ -0,0 +1,36 @@ +package org.cyclops.cyclopscore.config.extendedconfig; + +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.sounds.SoundEvent; +import org.cyclops.cyclopscore.config.ConfigurableType; +import org.cyclops.cyclopscore.init.ModBase; + +import java.util.function.Function; + +/** + * Config for sound events. + * @author rubensworks + * @see ExtendedConfig + */ +public abstract class SoundEventConfig extends ExtendedConfigForge{ + + public SoundEventConfig(ModBase mod, String namedId, Function elementConstructor) { + super(mod, namedId, elementConstructor); + } + + @Override + public String getTranslationKey() { + return "sound_events." + getMod().getModId() + "." + getNamedId(); + } + + @Override + public ConfigurableType getConfigurableType() { + return ConfigurableType.SOUND_EVENT; + } + + @Override + public Registry getRegistry() { + return BuiltInRegistries.SOUND_EVENT; + } +}