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.

Featured Replies

Posted

I've tried to figure this out on my own, but I'm stuck. No tutorials really exist on Forge's terrain generation capabilities.  :-\

 

I'm currently working on a mod that is based around changing the way Villages generate. I know mods like Millenaire currently do this, so I'm guessing it's possible. I see the TerrainGen getModdedMapGen() hook, but I'm not getting how to make use of it. Do I have to make my own MapGenerator from scratch? I don't need to change everything about how the overworld generates. How would I tell the TerrainGen code to use my MapGen, anyway?

 

My ultimate goal: I do not want Vanilla Villages spawning at all, but rather, my own improved Villages. They will have modified conditions for spawning, as well. Aside from that, no changes need to be made to the Vanilla generation. How would I best go about accomplishing this, preferably without making base class edits?

 

 

easiest way is to declare a new worldtype in post init you can also override default, when you declare the worldtype you link to a custom worldtype.class where you can specify a custom ChunkProviderGenerate which is the file you want to look at for most generation

 

	@PostInit
public void postinitConfig(FMLPostInitializationEvent fmlpostinitializationevent)
{
	WorldType DEFAULT = new WorldTypeCustom(0, "Default");	

}

 

then have WorldTypeCustom extend WorldType and add this

 

  @Override
    public IChunkProvider getChunkGenerator(World world, String generatorOptions)
    {
        return (this == FLAT ? new ChunkProviderFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions) : new ChunkProviderCustom(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled()));
    }
  

 

Copy the vanilla ChunkProviderGenerate into new classs ChunkProviderCustom and start tweaking

  • Author

That may work to accomplish what I want to do, but wouldn't that potentially cause problems with other mods that change parts of terrain gen? There may be something behind the scenes that would fix that, but if so, I'm not seeing it. I'd like this mod to be as compatible with other mods as possible. I realize it won't be compatible with mods like Millenaire for obvious reasons, but I'd like it to work with RedPower or Thaumcraft. Mods that do their own world gen, but not Village generation.

theres a forge hook in the replacebiomeblocks event someone posted sample of how to use it in another thread

  • Author

ReplaceBiomeBlocks just changes the village blocks from one type of block to another after it generates. I need to change the fundamental structures and layout of the villages. That probably won't do what I need it to do.

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

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.