Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CraigoryOfAshdale

Members
  • Joined

  • Last visited

Everything posted by CraigoryOfAshdale

  1. I'm trying to set up ore generation for my custom ores and CountRangeConfig, BIOMES, NATURAL_STONE, addFeature, and FillerBlockType.create come up with errors, please help. package com.gabrielrhys.testmod.world.gen; import com.gabrielrhys.testmod.ExtraOres; import com.gabrielrhys.testmod.util.RegistryHandler; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = ExtraOres.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModOreGen { public static OreFeatureConfig.FillerBlockType END_STONE = OreFeatureConfig.FillerBlockType.create("END_STONE", "end_stone", new BlockMatcher(Blocks.END_STONE)); @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { //Nether Generation if (biome.getCategory() == Biome.Category.NETHER) { genOre(biome, 12, 5, 5, 80, OreFeatureConfig.FillerBlockType.NETHERRACK, RegistryHandler.RUBY_ORE.get().getDefaultState(), 4); //End Generation } else if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 18, 3, 5, 80, END_STONE, RegistryHandler.RUBY_ORE.get().getDefaultState(), 12); //World Generation } else { genOre(biome, 15, 8, 5, 50, OreFeatureConfig.FillerBlockType.NATURAL_STONE, RegistryHandler.RUBY_ORE.get().getDefaultState(), 6); } } } private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }
  2. I'm adding custom ore generation for my mod and it says CountRangeConfig and other things, like BIOMES cannot resolve symbols. package com.gabrielrhys.testmod.world.gen; import com.gabrielrhys.testmod.ExtraOres; import com.gabrielrhys.testmod.util.RegistryHandler; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = ExtraOres.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModOreGen { public static OreFeatureConfig.FillerBlockType END_STONE = OreFeatureConfig.FillerBlockType.create("END_STONE", "end_stone", new BlockMatcher(Blocks.END_STONE)); @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { //Nether Generation if (biome.getCategory() == Biome.Category.NETHER) { genOre(biome, 12, 5, 5, 80, OreFeatureConfig.FillerBlockType.NETHERRACK, RegistryHandler.RUBY_ORE.get().getDefaultState(), 4); //End Generation } else if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 18, 3, 5, 80, END_STONE, RegistryHandler.RUBY_ORE.get().getDefaultState(), 12); //World Generation } else { genOre(biome, 15, 8, 5, 50, OreFeatureConfig.FillerBlockType.NATURAL_STONE, RegistryHandler.RUBY_ORE.get().getDefaultState(), 6); } } } private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.