Jump to content

Recommended Posts

Posted

 

 

I don't understand why this isn't already the case, but I'm trying to add my custom world gen features into vanilla biomes and I am getting the error "Registry Object not present". The features are being registered in the same exact way as my blocks and items. In my Features class:

public static final DeferredRegister<Feature<?>> FEATURES = new DeferredRegister<>(ForgeRegistries.FEATURES, T3L.MODID);
    
public static final RegistryObject<Feature<TreeFeatureConfig>> WHITE_OAK_TREE	= FEATURES.register("quercus_alba", () -> new TreeFeature(TreeFeatureConfig::deserialize));

 

In my Main class:

@Mod(T3L.MODID)
public class T3L
{
    public static final String MODID = "t3l";

    public T3L()
    {	
	IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
	eventBus.register(this);

	Fluids.FLUIDS.register(eventBus);
	Blocks.BLOCKS.register(eventBus);
	Items.VANILLA_ITEMS.register(eventBus);
	Items.T3L_ITEMS.register(eventBus);
	
	Features.FEATURES.register(eventBus);
    }

    @SubscribeEvent
    public void biomeGeneration(RegistryEvent.Register<Biome> event)
    {
	Collection<Biome> biomes = event.getRegistry().getValues();

	for (Biome biome : biomes)
	{
	    List<ConfiguredFeature<?, ?>> configuredFeatures = biome.getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION);

	    for (ConfiguredFeature<?, ?> configuredFeature : configuredFeatures)
	    {
		switch (configuredFeature.feature.getRegistryName().getPath())
		{
		    case "normal_tree":
		    case "acacia_tree":
		    case "fancy_tree":
		    case "dark_oak_tree":
		    case "mega_jungle_tree":
		    case "mega_spruce_tree":

			configuredFeatures.remove(configuredFeature);
		}
	    }

	    biome.getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).clear();

	    for (ConfiguredFeature<?, ?> configuredFeature : configuredFeatures)
	    {
		biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, configuredFeature);
	    }

	    //biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Features.WHITE_OAK_TREE.get().withConfiguration(Features.WHITE_OAK_CONFIG).withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.configure(new AtSurfaceWithExtraConfig(10, 0.1F, 1))));
	}
    }
}

 

 

The line I commented out is the problem line. The rest of the code you see in the biome registration event handler is a test, it removes all of the tree generation from every biome, and works as intended.

If I run the program with the line uncommented I'll get an error on WHITE_OAK_TREE that says "Registry Object not present" which could only possibly mean that RegistryEvent.Register<Biome> is firing before RegistryEvent.Register<Feature<?>> and I dont know how to make that not happen

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
    • Maybe you need to create file in assets/<modid>/items/<itemname>.json with content like this:   { "model": { "type": "minecraft:model", "model": "modname:item/itemname" } }  
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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