Advertisement
jayhillx

ModBiomes Class02

Dec 10th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. import com.meepshadow.mysticsbiomes.core.MysticsBiomes;
  2. import net.minecraft.entity.EntityClassification;
  3. import net.minecraft.entity.EntityType;
  4. import net.minecraft.util.RegistryKey;
  5. import net.minecraft.util.ResourceLocation;
  6. import net.minecraft.util.registry.Registry;
  7. import net.minecraft.world.biome.*;
  8. import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilders;
  9. import net.minecraftforge.common.BiomeManager;
  10. import net.minecraftforge.fml.RegistryObject;
  11. import net.minecraftforge.registries.DeferredRegister;
  12. import net.minecraftforge.registries.ForgeRegistries;
  13.  
  14. public class ModBiomes {
  15. public static ResourceLocation STRAWBERRY_FIELD_LOC = new ResourceLocation(MysticsBiomes.MOD_ID,"strawberry_field");
  16. public static RegistryKey<Biome> STRAWBERRY_FIELD;
  17.  
  18. public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, MysticsBiomes.MOD_ID);
  19.  
  20. public static final RegistryObject<Biome> makeStrawberryFieldBiome = BIOMES.register("strawberry_field", ModBiomes::makeStrawberryFieldBiome);
  21.  
  22. public static Biome makeStrawberryFieldBiome(){
  23. MobSpawnInfo.Builder spawns = new MobSpawnInfo.Builder();
  24.  
  25. spawns.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.RABBIT, 100, 2, 4));
  26. spawns.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.COW, 50, 1, 3));
  27. spawns.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.HORSE, 50, 1, 6));
  28.  
  29. BiomeGenerationSettings.Builder builder = (new BiomeGenerationSettings.Builder()).withSurfaceBuilder(ConfiguredSurfaceBuilders.field_244178_j);
  30.  
  31. DefaultBiomeFeatures.withMonsterRoom(builder);
  32. DefaultBiomeFeatures.withOverworldOres(builder);
  33.  
  34. return (new Biome.Builder()).precipitation(Biome.RainType.NONE).category(Biome.Category.PLAINS).depth(0.1F).scale(0.2F).temperature(0.5F).downfall(0.4F).setEffects((new BiomeAmbience.Builder()).setWaterColor(4159204).setWaterFogColor(329011).setFogColor(0xbec4ee).withSkyColor(0xbec4ee).setMoodSound(MoodSoundAmbience.DEFAULT_CAVE).build()).withMobSpawnSettings(spawns.copy()).withGenerationSettings(builder.build()).build();
  35. }
  36.  
  37.  
  38. public static void setupBiomes() {
  39. STRAWBERRY_FIELD = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, STRAWBERRY_FIELD_LOC);
  40. BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(STRAWBERRY_FIELD, 10));
  41. }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement