Created mod sound definition provider and added it to data generators. Defined firefly bush sounds.
This commit is contained in:
@ -3,6 +3,7 @@ package dev.micle.firefly_bush_backport.data;
|
||||
import dev.micle.firefly_bush_backport.FireflyBushBackport;
|
||||
import dev.micle.firefly_bush_backport.data.client.ModBlockStateProvider;
|
||||
import dev.micle.firefly_bush_backport.data.client.ModItemModelProvider;
|
||||
import dev.micle.firefly_bush_backport.data.client.ModSoundDefinitionsProvider;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
@ -16,7 +17,8 @@ public class DataGenerators {
|
||||
DataGenerator generator = event.getGenerator();
|
||||
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
|
||||
|
||||
generator.addProvider(event.includeServer(), new ModBlockStateProvider(generator, existingFileHelper));
|
||||
generator.addProvider(event.includeServer(), new ModItemModelProvider(generator, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModBlockStateProvider(generator, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModItemModelProvider(generator, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModSoundDefinitionsProvider(generator, existingFileHelper));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package dev.micle.firefly_bush_backport.data.client;
|
||||
|
||||
import dev.micle.firefly_bush_backport.FireflyBushBackport;
|
||||
import dev.micle.firefly_bush_backport.sound.ModSounds;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.common.data.SoundDefinitionsProvider;
|
||||
|
||||
public class ModSoundDefinitionsProvider extends SoundDefinitionsProvider {
|
||||
public ModSoundDefinitionsProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) {
|
||||
super(generator.getPackOutput(), FireflyBushBackport.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSounds() {
|
||||
add(ModSounds.FIREFLY_BUSH_IDLE, definition()
|
||||
.subtitle("sound." + FireflyBushBackport.MOD_ID + ".block.firefly_bush.idle")
|
||||
.with(
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush1"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush2"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush3"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush4"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush5"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush6"))
|
||||
.volume(4),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush7"))
|
||||
.volume(4)
|
||||
.weight(2),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush8"))
|
||||
.volume(4)
|
||||
.weight(2),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush9"))
|
||||
.volume(4)
|
||||
.weight(2),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush10"))
|
||||
.volume(4)
|
||||
.weight(2),
|
||||
sound(ResourceLocation.fromNamespaceAndPath(FireflyBushBackport.MOD_ID, "block/firefly_bush/firefly_bush11"))
|
||||
.volume(4)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user