Jump to content

[1.12] Register Biome (since Build 2347)


Keks

Recommended Posts

Registrations of Items, blocks (Itemblocks) and sounds functions.
But the Biome spawnen no more.

 

======================================================

In 1.11.2:

 

public static void registerBiome(Biome biome, BiomeType type, boolean isSpawnBiome, int weight) {
        GameRegistry.register(biome); //<-------------not in 1.12
        BiomeManager.addBiome(type, new BiomeEntry(biome, weight));
        if(isSpawnBiome){
            BiomeManager.addSpawnBiome(biome);
        }
        BiomeManager.addStrongholdBiome(biome);
   }

======================================================

In 1.12?

 

@SubscribeEvent
    public void registerBiome(RegistryEvent.Register<Biome> event) {
        event.getRegistry().registerAll(
            //================================
            biome1, biome2
            //================================
        );
    }

 

Or must be registered biome other?

Link to comment
Share on other sites

In Mod Main Class:

 

public static Biome Meadow;

 

@EventHandler
    public void Init(FMLInitializationEvent event){  

 

Meadow = new Biome_Meadow(new BiomeProperties("Meadow").setBaseHeight(0.0F).setHeightVariation(0.2F).setTemperature(0.5F));

 

regi_biomes.registerOverworldBiomes(Meadow, BiomeType.WARM, true, 6);

MinecraftForge.EVENT_BUS.register(new regi_biomes());

 

}//end of Init

 

//=========================================================

And in regi_biomes Class:

 

public class regi_biomes {

 

  public static void registerOverworldBiomes(Biome biome, BiomeType type, boolean isSpawnBiome, int weight) {
        
        BiomeManager.addBiome(type, new BiomeEntry(biome, weight));
        if(isSpawnBiome){
            BiomeManager.addSpawnBiome(biome);
        }
        BiomeManager.addStrongholdBiome(biome);
    }

 

 

@SubscribeEvent
    public void registerBiome(RegistryEvent.Register<Biome> event) {
        event.getRegistry().registerAll(
            //================================
            ModMainClass.Meadow
            //================================
        );

  }

}

Link to comment
Share on other sites

Thank you very much. In the PreInit work it.

What is strange, since 1.8 it was with me in the Init an area and functioned. And from 1.12 it has to go in the PreInit... Central issue functions. Thanks to you.

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.

Announcements



×
×
  • Create New...

Important Information

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