ianm1647 Posted April 9, 2021 Posted April 9, 2021 public class OreGeneration { public static final Feature<OreFeatureConfig> KUNZITE_ORE = new OreFeature(OreFeatureConfig.CODEC); public static final ConfiguredFeature <?,?> KUNZITE_FEATURE = new ConfiguredFeature<?, ?>((KUNZITE_ORE).withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockInit.KUNZITE_ORE.get().defaultBlockState(), 6)).range(20).square().func_242731_b(20)); public static void generateOre(final BiomeLoadingEvent event) { if (event.getCategory() == Category.SAVANNA) { event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> KUNZITE_FEATURE); } } } I have used multiple ways of incorporating ore generation into the game and they all seem to require ".withConfiguration" this one doesnt require ".configure" though but most others do, and I have no idea why there is an error. theres usually a replacement solution but i cant seem to figure anything out let me know if im missing anything also this code heavily inspired by Beethoven92's better end generation, but i've tried many different simple ways of generating Quote
kiou.23 Posted April 9, 2021 Posted April 9, 2021 (edited) 57 minutes ago, ianm1647 said: and I have no idea why there is an error. It'd be useful if you could've told the error public static final ConfiguredFeature <?,?> KUNZITE_FEATURE = new ConfiguredFeature<?, ?>((KUNZITE_ORE).withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockInit.KUNZITE_ORE.get().defaultBlockState(), 6)).range(20).square().func_242731_b(20)); this should throw an error as you call RegistryObject#get before the objects have been registered (i.e.: in static initialization). I'd instantiate the ore features in the common setup event Edited April 9, 2021 by kiou.23 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.