Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Issues with Biome Registration [1.12]


naturaGodhead
 Share

Recommended Posts

So I'm having a go at biomes just for kicks, but I get stuck at getting it to actually show up in the world. Feels like I'm missing something and everything I can find online is old information from previous versions. 

 

Biome Handler: 

https://pastebin.com/LPt9bFfJ

 

Biome:

https://pastebin.com/dz6Kca2Q

 

CommonProxy: (Relevant bit)

public void preInit(FMLPreInitializationEvent e) {
    	MinecraftForge.EVENT_BUS.register(new RosetteBiomes());
}

 

Link to comment
Share on other sites

How do you know it is not working? It is actually a bit tough to know if your biome is working without wandering around a lot in the world, but you should at least be able to tell that your biome is registered and you could do things like handling the world gen or chunk load events and test what biome is present.

 

Also note that in 1.12.x you should technically register your biomes by subscribing to the RegistryEvent<Biome> instead. See information on that here:  https://mcforge.readthedocs.io/en/latest/concepts/registries/ However I think that for now at least that registering in pre-init should still work.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

15 minutes ago, jabelar said:

How do you know it is not working? It is actually a bit tough to know if your biome is working without wandering around a lot in the world, but you should at least be able to tell that your biome is registered and you could do things like handling the world gen or chunk load events and test what biome is present.

 

Also note that in 1.12.x you should technically register your biomes by subscribing to the RegistryEvent<Biome> instead. See information on that here:  https://mcforge.readthedocs.io/en/latest/concepts/registries/ However I think that for now at least that registering in pre-init should still work.

My biome handler class subscribes to the registryevent. I'm not completely sure that it isn't working, but turning the weight up and exploring for hours hasn't shown anything.

Link to comment
Share on other sites

6 minutes ago, naturaGodhead said:

My biome handler class subscribes to the registryevent. I'm not completely sure that it isn't working, but turning the weight up and exploring for hours hasn't shown anything.

Sorry you're right, but I got confused because you register your class to the bus in pre-init and most people have switched to the @EventBusHandler annotation instead so admit I just assumed you did it all the old way.

 

Like I said, maybe subscribe to the other events, including maybe the terrain gen bus, related to world generation and chunk population and print out console statements to see if your biome is ever actually used. Also possibly in your ashBlock in the getDefaultState() method maybe put a console statement to see how much activity it is getting in terms of being placed. Or if that generates too much console spam, set a breakpoint on getDefaultState() for your block (you might have to @Override and just call the super-method in order to breakpoint within your custom block.)

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

1 hour ago, jabelar said:

Sorry you're right, but I got confused because you register your class to the bus in pre-init and most people have switched to the @EventBusHandler annotation instead so admit I just assumed you did it all the old way.

 

Like I said, maybe subscribe to the other events, including maybe the terrain gen bus, related to world generation and chunk population and print out console statements to see if your biome is ever actually used. Also possibly in your ashBlock in the getDefaultState() method maybe put a console statement to see how much activity it is getting in terms of being placed. Or if that generates too much console spam, set a breakpoint on getDefaultState() for your block (you might have to @Override and just call the super-method in order to breakpoint within your custom block.)

I've tried setting up a listener and changing some things around, and it seems like the biome is never actually being registered at all. Any idea why? I would've thought the registry.register would do that...

Link to comment
Share on other sites

It looks kinda correct to me. One thing is that the addSpawnBiome() already does the provider.allowedBiomes.add() and that might be a problem because then it is listed twice. Not really sure that is a problem, but it might be as the addSpawnBiome() specifically won't add it if it has already been added. So you should definitely delete the line with the BiomeProvider.

 

Also, I've also seen mention that maybe you also need to use the addStrongholdBiome() and addVillageBiome() methods although I suspect you only need one of the three -- you certainly shouldn't have to have your biome be a place where village or stronghold should generate, but worth a try. 

 

Also, you should probably put a System.out.println() statement in your registration code to confirm it is indeed firing.

 

Here's a tip from Choonster on another thread: To maybe help you figure out if the biome is actually generating or not: BiomeProvider#findBiomePosition will try to find the position of one of the specified biomes in a fixed range around the starting coordinates and return null if none was found. Note that this uses the biomes that would currently generate at each position rather than the biomes that have already generated at each position. This is an important distinction if the world was generated with a different set of biomes to those currently registered.

 

To check for biomes that have already generated, use World#getBiomeGenForCoords. BlockPos.getAllInBoxMutable can be used to create an Iterable<BlockPos> that iterates through every BlockPos between two positions.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

You register an instance of your class with the Forge event bus, so it looks for non-static event handler methods to subscribe. Your event handler method is static, so it's never subscribed.

 

Either make the event handler method non-static or register the Class object instead of an instance (manually or with @Mod.EventBusSubscriber).

 

Forge's documentation explains events in more detail here

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.