Advertisement
jayhillx

ModBiomes Class04

Dec 12th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. @Mod.EventBusSubscriber(modid = MysticsBiomes.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
  2. public class ModBiomes {
  3.  
  4. public static RegistryKey<Biome> STRAWBERRY_FIELD = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, new ResourceLocation(MysticsBiomes.MOD_ID, "strawberry_field"));
  5. public static RegistryKey<Biome> LAVENDER_MEADOW = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, new ResourceLocation(MysticsBiomes.MOD_ID, "lavender_meadow"));
  6.  
  7. public static void addBiomesToGeneration() {
  8. BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(STRAWBERRY_FIELD, Config.COMMON.strawberryFieldWeight.get()));
  9. BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(LAVENDER_MEADOW, Config.COMMON.lavenderMeadowWeight.get()));
  10. }
  11. public static void addBiomeTypes() {
  12. BiomeDictionary.addTypes(STRAWBERRY_FIELD, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.OVERWORLD);
  13. BiomeDictionary.addTypes(LAVENDER_MEADOW, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.OVERWORLD);
  14. }
  15.  
  16. static {
  17. register(0, ModBiomes.STRAWBERRY_FIELD, ModBiomeMaker.makeStrawberryFieldBiome());
  18. register(1, ModBiomes.LAVENDER_MEADOW, ModBiomeMaker.makeLavenderMeadowBiome());
  19. }
  20.  
  21. private static void register(int id, RegistryKey<Biome> key, Biome biome) {
  22. idToKeyMap.put(id, key);
  23. WorldGenRegistries.register(WorldGenRegistries.BIOME, id, key, biome);
  24. }
  25. private static final Int2ObjectMap<RegistryKey<Biome>> idToKeyMap = new Int2ObjectArrayMap<>();
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement