Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Mod.EventBusSubscriber(modid = MysticsBiomes.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
- public class ModBiomes {
- public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, MysticsBiomes.MOD_ID);
- //Biomes
- public static final RegistryObject<Biome> STRAWBERRY_FIELDS = BIOMES.register("strawberry_fields", StrawberryFieldsBiome::makeStrawberryFieldBiome);
- public static final RegistryObject<Biome> LAVENDER_MEADOW = BIOMES.register("lavender_meadow", LavenderMeadowBiome::makeLavenderMeadowBiome);
- public static final RegistryObject<Biome> CHERRY_BLOSSOM_FOREST = BIOMES.register("cherry_blossom_forest", CherryBlossomForestBiome::makeCherryBlossomForestBiome);
- @SubscribeEvent
- public static void setupBiomes(final FMLCommonSetupEvent event) {
- event.enqueueWork(() -> {
- setupBiome(STRAWBERRY_FIELDS.get(), BiomeManager.BiomeType.WARM, 1, BiomeDictionary.Type.RARE, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.OVERWORLD);
- setupBiome(LAVENDER_MEADOW.get(), BiomeManager.BiomeType.COOL, 2, BiomeDictionary.Type.RARE, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.OVERWORLD);
- setupBiome(CHERRY_BLOSSOM_FOREST.get(), BiomeManager.BiomeType.COOL, 2, BiomeDictionary.Type.RARE, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.OVERWORLD);
- });
- }
- private static void setupBiome(final Biome biome, final BiomeManager.BiomeType biomeType, final int weight, final BiomeDictionary.Type... types) {
- BiomeDictionary.addTypes(key(biome), types);
- BiomeManager.addBiome(biomeType, new BiomeManager.BiomeEntry(key(biome), weight));
- }
- private static RegistryKey<Biome> key(final Biome biome) {
- return RegistryKey.getOrCreateKey(ForgeRegistries.Keys.BIOMES, Objects.requireNonNull(ForgeRegistries.BIOMES.getKey(biome), "Biome registry name was null"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement