Jump to content

Recommended Posts

Posted

Quick question and maybe someone can provide an example. Is there a way to add a spawn to ALL biomes? I am aware of the addSpawnable function but I am sure there is an easier way then physically adding in every Biome to an array. Also what if you have a mod that adds biomes like Biomes O Plenty and the like? How would you have your spawnables get added into that list also?

Posted (edited)

Not sure if you can still get registered biomes from the BiomeDictionary, but older versions had a getBiomesForType(Type.Forest) that could be useful (I seriously doubt you really want it to be in absolutely every biome. e.g. ocean and nether).

 

Another way I found is to wait for the RegistryEvent.Register<Biome> event and then just do something like this:

        final IForgeRegistry<Biome> registry = event.getRegistry();
        for(Biome b :registry) {
            System.out.println(b.getBiomeName());
        }

But I am sure that there is a better way to get access to the ForgeRegistry.  My example above is an absolute nightmare for way too many reasons. Could one of the code gods please descend and help us?

Edited by Jacky2611

Here could be your advertisement!

Posted

All of the registries for vanilla types are stored in the ForgeRegistries class.

 

As @Jacky2611 said, use the BiomeDictionary (specifically BiomeDictionary#getBiomes) to get the Biomes with the specified Type.

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.

Posted

@Choonster Damn, I knew it. The ForgeRegistries class was the first place I looked. Could it be that I need a forge version newer than 14.21.1.2387(recommended) if I want to get the registries from inside the ForgeRegistries class?

Here could be your advertisement!

Posted
4 minutes ago, Jacky2611 said:

@Choonster Damn, I knew it. The ForgeRegistries class was the first place I looked. Could it be that I need a forge version newer than 14.21.1.2387(recommended) if I want to get the registries from inside the ForgeRegistries class?

 

No, the ForgeRegistries class was first added in 1.9 and the Biome registry has been in it since then.

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.

Posted (edited)

So lets, see. In looking at the biome dictionary. Types, HOT, COLD, MUSHROOM, BEACH, FOREST, MOUNTAIN, PLAINS, WET, MESA pretty musch seems to catch all biomes. Anyone know if I am missing any off the top of their head? Yes this one mob is supposed to spawn everywhere lol. Including in the mushroom biomes.

 

Secondly EntityRegister.addSpawn looks for the actual Biome though. How can I make it so that i put in the BiomeDictionary.getBiomes(BiomeDictionary.Type.HOT) and it will be acceptable for the .addSpawn

I'm sure it is rather simple, but  I've enver worked with spawns in the updated forge versions.

 

EntityRegistry.addSpawn(EntityCreeperPrime.class, 14, 1, 6, EnumCreatureType.MONSTER, BiomeDictionary.getBiomes(BiomeDictionary.Type.MUSHROOM));

Still looks for the actual Biome even though if I am reading correctly, that should return all biomes of type Mushroom. (Mushroom Shore, Mushroom)

Edited by HalestormXV
Posted

If you want the mob to spawn in every single biome rather than biomes of a certain type, use IForgeRegistry#getValues to get a List of every registered Biome. You then need to convert this to an array and pass it as the vararg parameter of EntityRegistry.addSpawn.

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.

Posted (edited)
43 minutes ago, Choonster said:

If you want the mob to spawn in every single biome rather than biomes of a certain type, use IForgeRegistry#getValues to get a List of every registered Biome. You then need to convert this to an array and pass it as the vararg parameter of EntityRegistry.addSpawn.

Okydokey. Thanks

 

Unlreated note but if either of you can take a look at another thread I made that is giving me issues. I'd apprecaite it. I don't want to keep bumping the thread over and over but perhaps a simplistic answer can be made: 

Spoiler

 

 

Edited by HalestormXV

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.