2020-01-29 00:40:28 +01:00
|
|
|
package de.ellpeck.naturesaura.data;
|
|
|
|
|
2023-07-24 17:56:29 +02:00
|
|
|
import net.minecraft.data.loot.LootTableProvider;
|
|
|
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
2022-08-01 16:14:37 +02:00
|
|
|
import net.minecraftforge.data.event.GatherDataEvent;
|
2020-01-29 00:40:28 +01:00
|
|
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
|
2023-07-24 17:56:29 +02:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2020-01-29 00:40:28 +01:00
|
|
|
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
|
|
|
|
public final class ModData {
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void gatherData(GatherDataEvent event) {
|
2023-07-24 17:56:29 +02:00
|
|
|
var gen = event.getGenerator();
|
|
|
|
var out = gen.getPackOutput();
|
|
|
|
var lookup = event.getLookupProvider();
|
|
|
|
var existing = event.getExistingFileHelper();
|
|
|
|
|
|
|
|
var blockTags = new BlockTagProvider(out, lookup, existing);
|
|
|
|
gen.addProvider(event.includeServer(), blockTags);
|
|
|
|
gen.addProvider(event.includeServer(), new ItemTagProvider(out, lookup, blockTags.contentsGetter(), existing));
|
|
|
|
gen.addProvider(event.includeServer(), new LootTableProvider(out, Set.of(), List.of(new LootTableProvider.SubProviderEntry(BlockLootProvider::new, LootContextParamSets.BLOCK))));
|
|
|
|
gen.addProvider(event.includeServer(), new BlockStateGenerator(out, existing));
|
|
|
|
gen.addProvider(event.includeServer(), new ItemModelGenerator(out, existing));
|
2020-01-29 00:40:28 +01:00
|
|
|
}
|
|
|
|
}
|