cjcj55

OreGeneration

Jul 14th, 2019
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. package chris.chrispymod.world;
  2.  
  3. import chris.chrispymod.config.OreGenConfig;
  4. import chris.chrispymod.lists.ChrispyBlocks;
  5. import net.minecraft.world.biome.Biome;
  6. import net.minecraft.world.gen.GenerationStage.Decoration;
  7. import net.minecraft.world.gen.feature.ConfiguredFeature;
  8. import net.minecraft.world.gen.feature.Feature;
  9. import net.minecraft.world.gen.feature.OreFeatureConfig;
  10. import net.minecraft.world.gen.feature.OreFeatureConfig.FillerBlockType;
  11. import net.minecraftforge.registries.ForgeRegistries;
  12.  
  13. public class OreGeneration
  14. {
  15.  
  16. public static void setupOreGeneration()
  17. {
  18. if(OreGenConfig.generate_overworld.get())
  19. {
  20. for(Biome biome : ForgeRegistries.BIOMES)
  21. {
  22. // Chance to spawn (how many veins will spawn per chunk), Minimum Height, Maximum Height Base, Maximum Height.
  23. // 8 is max number of ore blocks that can spawn in a vein.
  24. biome.addFeature(Decoration.UNDERGROUND_ORES, new ConfiguredFeature<OreFeatureConfig>(Feature.ORE, new OreFeatureConfig(FillerBlockType.NATURAL_STONE, ChrispyBlocks.ruby_ore.getDefaultState(), OreGenConfig.ruby_chance.get())));
  25. biome.addFeature(Decoration.UNDERGROUND_ORES, new ConfiguredFeature<OreFeatureConfig>(Feature.ORE, new OreFeatureConfig(FillerBlockType.NATURAL_STONE, ChrispyBlocks.opal_ore.getDefaultState(), OreGenConfig.opal_chance.get())));
  26. biome.addFeature(Decoration.UNDERGROUND_ORES, new ConfiguredFeature<OreFeatureConfig>(Feature.ORE, new OreFeatureConfig(FillerBlockType.NATURAL_STONE, ChrispyBlocks.tangerine_ore.getDefaultState(), OreGenConfig.tangerine_chance.get())));
  27. biome.addFeature(Decoration.UNDERGROUND_ORES, new ConfiguredFeature<OreFeatureConfig>(Feature.ORE, new OreFeatureConfig(FillerBlockType.NATURAL_STONE, ChrispyBlocks.cobalt_ore.getDefaultState(), OreGenConfig.cobalt_chance.get())));
  28.  
  29. biome.addFeature(Decoration.UNDERGROUND_ORES, new ConfiguredFeature<OreFeatureConfig>(Feature.ORE, new OreFeatureConfig(FillerBlockType.NETHERRACK, ChrispyBlocks.ruby_ore_nether.getDefaultState(), OreGenConfig.ruby_chance.get())));
  30. }
  31.  
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment