Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mod.common.datagen;
- import com.mod.core.mod;
- import com.mod.core.init.Biomes;
- import com.mod.core.init.Dimensions;
- import net.minecraft.core.RegistrySetBuilder;
- import net.minecraft.core.registries.Registries;
- import net.minecraft.data.DataGenerator;
- import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider;
- import net.minecraftforge.data.event.GatherDataEvent;
- import net.minecraftforge.eventbus.api.SubscribeEvent;
- import net.minecraftforge.fml.common.Mod;
- import java.util.Set;
- @Mod.EventBusSubscriber(modid = mod.modId, bus = Mod.EventBusSubscriber.Bus.MOD)
- public class SetupDataGenerator {
- private static final RegistrySetBuilder BUILDER = new RegistrySetBuilder().add(Registries.DIMENSION_TYPE, Dimensions::bootstrap).add(Registries.BIOME, Biomes::bootstrap);
- @SubscribeEvent
- public static void onGatherData(GatherDataEvent event) {
- DataGenerator generator = event.getGenerator();
- generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(generator.getPackOutput(), event.getLookupProvider(), BUILDER, Set.of(mod.modId)));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement