Jump to content

Tree registration causes exception error


MarKis

Recommended Posts

Hello, I am very new to this forum. 

I  have managed to crate a new tree with this code:

public static final Holder<ConfiguredFeature<TreeConfiguration,?>> PINE_TREE = FeatureUtils.register("pine_tree", Feature.TREE, new TreeConfiguration.TreeConfigurationBuilder (BlockStateProvider.simple(BlockManager.PINE_LOG.get()), new StraightTrunkPlacer(5, 6, 3), BlockStateProvider.simple(BlockManager.PINE_LEAVES.get()), new BlobFoliagePlacer(ConstantInt.of(2), ConstantInt.of(0), 4), new TwoLayersFeatureSize(1, 0, 2)).build());


In my placedFeatures class, I've this code:

public static final Holder<PlacedFeature> PINE_CHECKED = PlacementUtils.register("pine_checked", ConfiguredFeaturesManager.PINE_TREE, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
public static final RegistryObject<PlacedFeature> PINE_PLACED = PLACED_FEATURES.register( "pine_placed", () -> new PlacedFeature ((Holder<ConfiguredFeature<?,?>>) (Holder<? extends ConfiguredFeature<?,?>>) ConfiguredFeaturesManager.PINE_TREE, List.of(RarityFilter.onAverageOnceEvery(15), InSquarePlacement.spread(), PlacementUtils. HEIGHTMAP, BiomeFilter.biome())));

 

And, in my configuredFeatures class, I've this code:

public static final Holder<ConfiguredFeature<RandomFeatureConfiguration, ?>> PINE_SPAWN = FeatureUtils.register("pine_spawn", Feature.RANDOM_SELECTOR, new RandomFeatureConfiguration(List.of(new WeightedPlacedFeature(PINE_CHECKED, 0.2F), new WeightedPlacedFeature(PINE_CHECKED, 0.1F)), PlacedFeaturesManager.PINE_CHECKED));

when I run, it gives this errors:

java.lang.ExceptionInInitializerError
java.lang.NullPointerException: Registry Object not present: udy:rubyore

I have tried to solve this, but don't know how. If someone has an idea that would be great. 

Thank you for the help!

Edited by MarKis
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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