NaturesAura/src/main/java/de/ellpeck/naturesaura/data/ModData.java

30 lines
1.3 KiB
Java
Raw Normal View History

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;
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
}
}